workign through issues in the ForgeHandler
This commit is contained in:
@@ -102,71 +102,68 @@ public class Forge extends CustomContainerFacing implements ITileEntityProvider,
|
|||||||
ItemStack pItem = player.inventory.getCurrentItem().copy();
|
ItemStack pItem = player.inventory.getCurrentItem().copy();
|
||||||
ItemStack fuelItem = tile.getSlotStack(0);
|
ItemStack fuelItem = tile.getSlotStack(0);
|
||||||
|
|
||||||
if (!world.isRemote) {
|
/***********************
|
||||||
/***********************
|
FUEL SLOT CODE
|
||||||
FUEL SLOT CODE
|
***********************/
|
||||||
***********************/
|
if (!tile.getSlotStack(0).isEmpty()) {
|
||||||
if (!tile.getSlotStack(0).isEmpty()) {
|
if (player.inventory.getCurrentItem().getItem() instanceof ItemSpade) {
|
||||||
if (player.inventory.getCurrentItem().getItem() instanceof ItemSpade) {
|
ItemStack returnStack = tile.getSlotStack(0).copy();
|
||||||
ItemStack returnStack = tile.getSlotStack(0).copy();
|
PlayerHelper.spawnItemOnPlayer(world, player, returnStack);
|
||||||
PlayerHelper.spawnItemOnPlayer(world, player, returnStack);
|
tile.clearSlot(0);
|
||||||
tile.clearSlot(0);
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (pItem.isEmpty()) {
|
||||||
|
if (!player.isSneaking()) {
|
||||||
|
if (world.getBlockState(pos).getValue(PrimalAPI.States.ACTIVE) == true) {
|
||||||
|
Integer tempInt = tile.getHeat();
|
||||||
|
String tempString = tempInt.toString();
|
||||||
|
ITextComponent itextcomponent = new TextComponentString(tempString);
|
||||||
|
player.sendStatusMessage(itextcomponent, true);
|
||||||
|
//System.out.println(pos);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (pItem.isEmpty()) {
|
}
|
||||||
if (!player.isSneaking()) {
|
if ((FireSource.useSource(world, pos, facing, player, hand, pItem, hitX, hitY, hitZ))) {
|
||||||
if (world.getBlockState(pos).getValue(PrimalAPI.States.ACTIVE) == true) {
|
world.setBlockState(pos, state.withProperty(PrimalAPI.States.ACTIVE, true), 2);
|
||||||
Integer tempInt = tile.getHeat();
|
tile.setHeat(100);
|
||||||
String tempString = tempInt.toString();
|
tile.markDirty();
|
||||||
ITextComponent itextcomponent = new TextComponentString(tempString);
|
tile.updateBlock();
|
||||||
player.sendStatusMessage(itextcomponent, true);
|
return true;
|
||||||
//System.out.println(pos);
|
}
|
||||||
return true;
|
if ((!pItem.isEmpty()) && tile.isItemValidForSlot(0, pItem)) {
|
||||||
}
|
if (!fuelItem.isEmpty()) {
|
||||||
}
|
if (pItem.getItem() == fuelItem.getItem()) {
|
||||||
}
|
if (fuelItem.getCount() < 64) {
|
||||||
if ((FireSource.useSource(world, pos, facing, player, hand, pItem, hitX, hitY, hitZ))) {
|
if (fuelItem.getCount() + pItem.getCount() <= 64) {
|
||||||
world.setBlockState(pos, state.withProperty(PrimalAPI.States.ACTIVE, true), 2);
|
fuelItem.grow(pItem.getCount());
|
||||||
tile.setHeat(100);
|
player.inventory.setInventorySlotContents(player.inventory.currentItem, ItemStack.EMPTY);
|
||||||
tile.markDirty();
|
tile.markDirty();
|
||||||
tile.updateBlock();
|
tile.updateBlock();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if ((!pItem.isEmpty()) && tile.isItemValidForSlot(0, pItem)) {
|
if (fuelItem.getCount() + pItem.getCount() > 64) {
|
||||||
if (!fuelItem.isEmpty()) {
|
pItem.setCount(64 - pItem.getCount());
|
||||||
if (pItem.getItem() == fuelItem.getItem()) {
|
fuelItem.setCount(64);
|
||||||
if (fuelItem.getCount() < 64) {
|
tile.markDirty();
|
||||||
if (fuelItem.getCount() + pItem.getCount() <= 64) {
|
tile.updateBlock();
|
||||||
fuelItem.grow(pItem.getCount());
|
return true;
|
||||||
player.inventory.setInventorySlotContents(player.inventory.currentItem, ItemStack.EMPTY);
|
|
||||||
tile.markDirty();
|
|
||||||
tile.updateBlock();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (fuelItem.getCount() + pItem.getCount() > 64) {
|
|
||||||
pItem.setCount(64 - pItem.getCount());
|
|
||||||
fuelItem.setCount(64);
|
|
||||||
tile.markDirty();
|
|
||||||
tile.updateBlock();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (fuelItem.isEmpty()) {
|
|
||||||
tile.setSlotStack(0, pItem);
|
|
||||||
player.inventory.setInventorySlotContents(player.inventory.currentItem, ItemStack.EMPTY);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
if (fuelItem.isEmpty()) {
|
||||||
|
tile.setSlotStack(0, pItem);
|
||||||
if (facing == EnumFacing.UP) {
|
player.inventory.setInventorySlotContents(player.inventory.currentItem, ItemStack.EMPTY);
|
||||||
doForgeInventoryManager(pItem, world, tile, pos, hitX, hitY, hitZ, state, player);
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (facing == EnumFacing.UP) {
|
||||||
|
doForgeInventoryManager(pItem, world, tile, pos, hitX, hitY, hitZ, state, player);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -325,83 +325,82 @@ public class SlottedTongs extends Item implements IPickup, AnvilHandler{
|
|||||||
IBlockState state = world.getBlockState(pos);
|
IBlockState state = world.getBlockState(pos);
|
||||||
Block block = world.getBlockState(pos).getBlock();
|
Block block = world.getBlockState(pos).getBlock();
|
||||||
ItemStack itemstack = player.getHeldItem(hand);
|
ItemStack itemstack = player.getHeldItem(hand);
|
||||||
|
|
||||||
IItemHandler inventory = itemstack.getCapability(ITEM_HANDLER, null);
|
IItemHandler inventory = itemstack.getCapability(ITEM_HANDLER, null);
|
||||||
ItemStack slotStack = inventory.getStackInSlot(0).copy();
|
ItemStack slotStack = inventory.getStackInSlot(0).copy();
|
||||||
/*
|
|
||||||
if (block instanceof AnvilStone) {
|
|
||||||
TileAnvil tile = (TileAnvil) world.getTileEntity(pos);
|
|
||||||
doAnvilInventoryManager(itemstack, world, tile, pos, hitx, hity, hitz, state, player);
|
|
||||||
return EnumActionResult.SUCCESS;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
if (slotStack.isEmpty()) {
|
|
||||||
if (block instanceof NBTCrucible) {
|
|
||||||
ItemStack tempStack = takeBlock(world, pos, state, face, player, block).copy();
|
|
||||||
inventory.insertItem(0, tempStack, false);
|
|
||||||
world.setBlockState(pos, this.getReplacementBlock(world, pos, state));
|
|
||||||
return EnumActionResult.SUCCESS;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!slotStack.isEmpty()) {
|
|
||||||
if (slotStack.getItem() instanceof ItemNBTCrucible) {
|
|
||||||
NBTTagCompound tag = slotStack.getSubCompound("BlockEntityTag").copy();
|
|
||||||
|
|
||||||
if (tag != null) {
|
|
||||||
ItemBlock temp = (ItemBlock) slotStack.getItem();
|
|
||||||
int i = this.getMetadata(slotStack.getMetadata());
|
|
||||||
IBlockState iblockstate1 = temp.getBlock().getStateForPlacement(world, pos, face, hitx, hity, hitz, i, player, hand);
|
|
||||||
temp.placeBlockAt(slotStack, player, world, pos.up(1), face, hitx, hity, hitz, iblockstate1);
|
|
||||||
inventory.extractItem(0, 1, false);
|
|
||||||
return EnumActionResult.SUCCESS;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****
|
if (!(block instanceof AnvilBase)) {
|
||||||
DROPS the ToolParts into the World
|
if (!(block instanceof Forge)) {
|
||||||
*****/
|
System.out.println(inventory.getStackInSlot(0));
|
||||||
if (!slotStack.isEmpty()) {
|
if (slotStack.isEmpty()) {
|
||||||
if (!(block instanceof AnvilBase)) {
|
if (block instanceof NBTCrucible) {
|
||||||
if (slotStack.getItem() instanceof ToolPart) {
|
ItemStack tempStack = takeBlock(world, pos, state, face, player, block).copy();
|
||||||
ItemStack tempStack = slotStack;
|
inventory.insertItem(0, tempStack, false);
|
||||||
PlayerHelper.spawnItemOnGround(world, pos, tempStack);
|
world.setBlockState(pos, this.getReplacementBlock(world, pos, state));
|
||||||
inventory.extractItem(0, 1, false);
|
|
||||||
return EnumActionResult.SUCCESS;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****
|
|
||||||
Cools the Ingots on the Tongs
|
|
||||||
*****/
|
|
||||||
if (!slotStack.isEmpty()) {
|
|
||||||
if (world.getBlockState(pos).getBlock() == PrimalAPI.Blocks.BARREL) {
|
|
||||||
AbstractTileTank tileTank = (AbstractTileTank) world.getTileEntity(pos);
|
|
||||||
if (slotStack.getTagCompound().getBoolean("hot")) {
|
|
||||||
if (tileTank.getContainedFluid().getFluid().equals(FluidRegistry.WATER) ||
|
|
||||||
tileTank.getContainedFluid().getFluid().equals(PrimalAPI.Fluids.RAIN_WATER)
|
|
||||||
) {
|
|
||||||
ItemStack tempStack = slotStack.copy();
|
|
||||||
tempStack.getTagCompound().setBoolean("hot", false);
|
|
||||||
inventory.extractItem(0, 1, false);
|
|
||||||
PlayerHelper.spawnItemOnGround(world, pos, tempStack);
|
|
||||||
world.playSound(null, pos, SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundCategory.AMBIENT, 1.0F, PrimalAPI.getRandom().nextFloat() * 0.4F + 0.8F);
|
|
||||||
return EnumActionResult.SUCCESS;
|
return EnumActionResult.SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
if (!slotStack.isEmpty()) {
|
||||||
}
|
if (slotStack.getItem() instanceof ItemNBTCrucible) {
|
||||||
|
NBTTagCompound tag = slotStack.getSubCompound("BlockEntityTag").copy();
|
||||||
|
|
||||||
/*****
|
if (tag != null) {
|
||||||
DROPS the Ingots into the World
|
ItemBlock temp = (ItemBlock) slotStack.getItem();
|
||||||
*****/
|
int i = this.getMetadata(slotStack.getMetadata());
|
||||||
if (!slotStack.isEmpty()) {
|
IBlockState iblockstate1 = temp.getBlock().getStateForPlacement(world, pos, face, hitx, hity, hitz, i, player, hand);
|
||||||
if (!(block instanceof AnvilBase)) {
|
temp.placeBlockAt(slotStack, player, world, pos.up(1), face, hitx, hity, hitz, iblockstate1);
|
||||||
if (!(block instanceof Forge)) {
|
inventory.extractItem(0, 1, false);
|
||||||
|
return EnumActionResult.SUCCESS;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****
|
||||||
|
DROPS the ToolParts into the World
|
||||||
|
*****/
|
||||||
|
if (!slotStack.isEmpty()) {
|
||||||
|
|
||||||
|
if (slotStack.getItem() instanceof ToolPart) {
|
||||||
|
ItemStack tempStack = slotStack;
|
||||||
|
PlayerHelper.spawnItemOnGround(world, pos, tempStack);
|
||||||
|
inventory.extractItem(0, 1, false);
|
||||||
|
return EnumActionResult.SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****
|
||||||
|
Cools the Ingots on the Tongs
|
||||||
|
*****/
|
||||||
|
if (!slotStack.isEmpty()) {
|
||||||
|
if (world.getBlockState(pos).getBlock() == PrimalAPI.Blocks.BARREL) {
|
||||||
|
AbstractTileTank tileTank = (AbstractTileTank) world.getTileEntity(pos);
|
||||||
|
if (slotStack.getTagCompound().getBoolean("hot")) {
|
||||||
|
if (tileTank.getContainedFluid().getFluid().equals(FluidRegistry.WATER) ||
|
||||||
|
tileTank.getContainedFluid().getFluid().equals(PrimalAPI.Fluids.RAIN_WATER)
|
||||||
|
) {
|
||||||
|
ItemStack tempStack = slotStack.copy();
|
||||||
|
tempStack.getTagCompound().setBoolean("hot", false);
|
||||||
|
inventory.extractItem(0, 1, false);
|
||||||
|
PlayerHelper.spawnItemOnGround(world, pos, tempStack);
|
||||||
|
world.playSound(null, pos, SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundCategory.AMBIENT, 1.0F, PrimalAPI.getRandom().nextFloat() * 0.4F + 0.8F);
|
||||||
|
return EnumActionResult.SUCCESS;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****
|
||||||
|
DROPS the Ingots into the World
|
||||||
|
*****/
|
||||||
|
if (!slotStack.isEmpty()) {
|
||||||
|
System.out.println("Tongs isn't empty");
|
||||||
if (slotStack.getItem() instanceof BaseMultiItem) {
|
if (slotStack.getItem() instanceof BaseMultiItem) {
|
||||||
ItemStack tempStack = slotStack.copy();
|
ItemStack tempStack = slotStack.copy();
|
||||||
PlayerHelper.spawnItemOnGround(world, pos, tempStack);
|
PlayerHelper.spawnItemOnGround(world, pos, tempStack);
|
||||||
inventory.extractItem(0, 1, false);
|
inventory.extractItem(0, 1, false);
|
||||||
|
System.out.println(inventory.getStackInSlot(0));
|
||||||
return EnumActionResult.SUCCESS;
|
return EnumActionResult.SUCCESS;
|
||||||
}
|
}
|
||||||
if (!(slotStack.getItem() instanceof BaseMultiItem)) {
|
if (!(slotStack.getItem() instanceof BaseMultiItem)) {
|
||||||
@@ -434,9 +433,7 @@ public class SlottedTongs extends Item implements IPickup, AnvilHandler{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return EnumActionResult.FAIL;
|
|
||||||
}
|
}
|
||||||
return EnumActionResult.FAIL;
|
|
||||||
}
|
}
|
||||||
return EnumActionResult.FAIL;
|
return EnumActionResult.FAIL;
|
||||||
}
|
}
|
||||||
@@ -500,11 +497,11 @@ public class SlottedTongs extends Item implements IPickup, AnvilHandler{
|
|||||||
@Override
|
@Override
|
||||||
public NBTTagCompound getNBTShareTag(ItemStack stack)
|
public NBTTagCompound getNBTShareTag(ItemStack stack)
|
||||||
{
|
{
|
||||||
super.getNBTShareTag(stack);
|
return super.getNBTShareTag(stack);
|
||||||
IItemHandler inventory = stack.getCapability(ITEM_HANDLER, null);
|
//IItemHandler inventory = stack.getCapability(ITEM_HANDLER, null);
|
||||||
NonNullList<ItemStack> setList = NonNullList.<ItemStack>withSize(1, ItemStack.EMPTY);
|
//NonNullList<ItemStack> setList = NonNullList.<ItemStack>withSize(1, ItemStack.EMPTY);
|
||||||
ItemStackHelper.saveAllItems(stack.getTagCompound(), setList);
|
//ItemStackHelper.saveAllItems(stack.getTagCompound(), setList);
|
||||||
return stack.getTagCompound();
|
//return stack.getTagCompound();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -512,11 +509,11 @@ public class SlottedTongs extends Item implements IPickup, AnvilHandler{
|
|||||||
{
|
{
|
||||||
super.readNBTShareTag(stack, nbt);
|
super.readNBTShareTag(stack, nbt);
|
||||||
|
|
||||||
stack.deserializeNBT(nbt);
|
//stack.deserializeNBT(nbt);
|
||||||
IItemHandler inventory = stack.getCapability(ITEM_HANDLER, null);
|
//IItemHandler inventory = stack.getCapability(ITEM_HANDLER, null);
|
||||||
NonNullList<ItemStack> setList = NonNullList.<ItemStack>withSize(1, ItemStack.EMPTY);
|
//NonNullList<ItemStack> setList = NonNullList.<ItemStack>withSize(1, ItemStack.EMPTY);
|
||||||
ItemStackHelper.loadAllItems(nbt, setList);
|
//ItemStackHelper.loadAllItems(nbt, setList);
|
||||||
inventory.insertItem(0, setList.get(0), false);
|
//inventory.insertItem(0, setList.get(0), false);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -236,30 +236,31 @@ public interface AnvilHandler {
|
|||||||
|
|
||||||
static boolean doWork(ItemStack pItem, Integer counter, TileAnvil tile, World world, BlockPos pos, EntityPlayer player) {
|
static boolean doWork(ItemStack pItem, Integer counter, TileAnvil tile, World world, BlockPos pos, EntityPlayer player) {
|
||||||
|
|
||||||
if (pItem.getItem().equals(ModItems.slottedtongs)) {
|
|
||||||
|
|
||||||
IItemHandler inventory = pItem.getCapability(ITEM_HANDLER, null);
|
|
||||||
ItemStack tongStack = inventory.getStackInSlot(0).copy();
|
|
||||||
|
|
||||||
if (tongStack.isEmpty()) {
|
|
||||||
if (!tile.getSlotStack(counter).isEmpty()) {
|
|
||||||
ItemStack tempStack = tile.getSlotStack(counter).copy();
|
|
||||||
inventory.insertItem(0,tempStack, false);
|
|
||||||
tile.setSlotStack(counter, ItemStack.EMPTY);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!tongStack.isEmpty()) {
|
|
||||||
if (tile.getSlotStack(counter).isEmpty()) {
|
|
||||||
ItemStack tempStack = tongStack.copy();
|
|
||||||
tile.setSlotStack(counter, tempStack);
|
|
||||||
inventory.extractItem(0, 1, false);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!world.isRemote) {
|
if (!world.isRemote) {
|
||||||
|
if (pItem.getItem().equals(ModItems.slottedtongs)) {
|
||||||
|
|
||||||
|
IItemHandler inventory = pItem.getCapability(ITEM_HANDLER, null);
|
||||||
|
ItemStack tongStack = inventory.getStackInSlot(0).copy();
|
||||||
|
|
||||||
|
if (tongStack.isEmpty()) {
|
||||||
|
if (!tile.getSlotStack(counter).isEmpty()) {
|
||||||
|
ItemStack tempStack = tile.getSlotStack(counter).copy();
|
||||||
|
inventory.insertItem(0,tempStack, false);
|
||||||
|
tile.setSlotStack(counter, ItemStack.EMPTY);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!tongStack.isEmpty()) {
|
||||||
|
if (tile.getSlotStack(counter).isEmpty()) {
|
||||||
|
ItemStack tempStack = tongStack.copy();
|
||||||
|
tile.setSlotStack(counter, tempStack);
|
||||||
|
inventory.extractItem(0, 1, false);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (pItem.getItem().equals(Items.AIR) && player.isSneaking()) {
|
if (pItem.getItem().equals(Items.AIR) && player.isSneaking()) {
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import net.minecraft.util.EnumFacing;
|
|||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.items.IItemHandler;
|
import net.minecraftforge.items.IItemHandler;
|
||||||
|
import net.minecraftforge.items.IItemHandlerModifiable;
|
||||||
import nmd.primal.core.common.helper.RecipeHelper;
|
import nmd.primal.core.common.helper.RecipeHelper;
|
||||||
import nmd.primal.core.common.items.tools.Gallagher;
|
import nmd.primal.core.common.items.tools.Gallagher;
|
||||||
import nmd.primal.forgecraft.init.ModItems;
|
import nmd.primal.forgecraft.init.ModItems;
|
||||||
@@ -53,6 +54,7 @@ public interface ForgeHandler {
|
|||||||
default boolean doForgeInventoryManager(ItemStack pItem, World world, TileForge tile, BlockPos pos, float hitx, float hity, float hitz, IBlockState state, EntityPlayer player) {
|
default boolean doForgeInventoryManager(ItemStack pItem, World world, TileForge tile, BlockPos pos, float hitx, float hity, float hitz, IBlockState state, EntityPlayer player) {
|
||||||
|
|
||||||
if (state.getValue(FACING) == EnumFacing.NORTH) {
|
if (state.getValue(FACING) == EnumFacing.NORTH) {
|
||||||
|
|
||||||
int counter = 0;
|
int counter = 0;
|
||||||
for (int z = 0; z < arraySize; z++) {
|
for (int z = 0; z < arraySize; z++) {
|
||||||
for (int x = 0; x < arraySize; x++) {
|
for (int x = 0; x < arraySize; x++) {
|
||||||
@@ -109,16 +111,15 @@ public interface ForgeHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static boolean doWork(ItemStack pItem, Integer counter, TileForge tile, World world, BlockPos pos, EntityPlayer player) {
|
static boolean doWork(ItemStack pItem, Integer counter, TileForge tile, World world, BlockPos pos, EntityPlayer player) {
|
||||||
|
|
||||||
if (pItem.getItem().equals(ModItems.slottedtongs)) {
|
if (pItem.getItem().equals(ModItems.slottedtongs)) {
|
||||||
IItemHandler inventory = pItem.getCapability(ITEM_HANDLER, null);
|
IItemHandler inventory = (IItemHandlerModifiable) pItem.getCapability(ITEM_HANDLER, null);
|
||||||
ItemStack tongsStack = inventory.getStackInSlot(0).copy();
|
ItemStack tongsStack = inventory.getStackInSlot(0).copy();
|
||||||
|
|
||||||
if (tongsStack.isEmpty()) {
|
if (tongsStack.isEmpty()) {
|
||||||
if (!tile.getSlotStack(counter).isEmpty()) {
|
if (!tile.getSlotStack(counter).isEmpty()) {
|
||||||
ItemStack tempStack = tile.getSlotStack(counter).copy();
|
ItemStack tempStack = tile.getSlotStack(counter).copy();
|
||||||
inventory.insertItem(0, tempStack, false);
|
|
||||||
tile.setSlotStack(counter, ItemStack.EMPTY);
|
tile.setSlotStack(counter, ItemStack.EMPTY);
|
||||||
|
inventory.insertItem(0, tempStack, false);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user