mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-20 20:22:33 +00:00
Fix most non rendering issues
This commit is contained in:
1 parent
bafd2bfa6d
commit
24e777cab5
88 files changed
+397
-454
No files matched your search
@@ -18,6 +18,7 @@ import net.minecraft.item.BlockItemUseContext;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.Mirror;
|
||||
@@ -62,20 +63,20 @@ public class BlockAvatar extends BlockMod {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) {
|
||||
public ActionResultType onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) {
|
||||
TileAvatar avatar = (TileAvatar) world.getTileEntity(pos);
|
||||
ItemStack stackOnAvatar = avatar.getItemHandler().getStackInSlot(0);
|
||||
ItemStack stackOnPlayer = player.getHeldItem(hand);
|
||||
if(!stackOnAvatar.isEmpty()) {
|
||||
avatar.getItemHandler().setStackInSlot(0, ItemStack.EMPTY);
|
||||
ItemHandlerHelper.giveItemToPlayer(player, stackOnAvatar);
|
||||
return true;
|
||||
return ActionResultType.SUCCESS;
|
||||
} else if(!stackOnPlayer.isEmpty() && stackOnPlayer.getItem() instanceof IAvatarWieldable) {
|
||||
avatar.getItemHandler().setStackInSlot(0, stackOnPlayer.split(1));
|
||||
return true;
|
||||
return ActionResultType.SUCCESS;
|
||||
}
|
||||
|
||||
return false;
|
||||
return ActionResultType.PASS;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user