Fix subtle bugs, todo title and apiimpl package
This commit is contained in:
@@ -42,6 +42,7 @@ public class ItemBlockBase extends ItemBlock {
|
||||
return getUnlocalizedName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, IBlockState newState) {
|
||||
boolean result = super.placeBlockAt(stack, player, world, pos, side, hitX, hitY, hitZ, newState);
|
||||
|
||||
|
@@ -17,9 +17,9 @@ public class ItemCore extends ItemBase {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(Item item, CreativeTabs tab, NonNullList<ItemStack> list) {
|
||||
public void getSubItems(Item item, CreativeTabs tab, NonNullList<ItemStack> subItems) {
|
||||
for (int i = 0; i < 2; ++i) {
|
||||
list.add(new ItemStack(item, 1, i));
|
||||
subItems.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -41,9 +41,9 @@ public class ItemFluidStorageDisk extends ItemBase {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(Item item, CreativeTabs tab, NonNullList<ItemStack> list) {
|
||||
public void getSubItems(Item item, CreativeTabs tab, NonNullList<ItemStack> subItems) {
|
||||
for (int i = 0; i < 5; ++i) {
|
||||
list.add(FluidStorageNBT.createStackWithNBT(new ItemStack(item, 1, i)));
|
||||
subItems.add(FluidStorageNBT.createStackWithNBT(new ItemStack(item, 1, i)));
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -19,9 +19,9 @@ public class ItemFluidStoragePart extends ItemBase {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(Item item, CreativeTabs tab, NonNullList<ItemStack> list) {
|
||||
public void getSubItems(Item item, CreativeTabs tab, NonNullList<ItemStack> subItems) {
|
||||
for (int i = 0; i <= 3; ++i) {
|
||||
list.add(new ItemStack(item, 1, i));
|
||||
subItems.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -31,7 +31,14 @@ public class ItemNetworkCard extends ItemBase {
|
||||
Block block = world.getBlockState(pos).getBlock();
|
||||
|
||||
if (block == RSBlocks.NETWORK_RECEIVER) {
|
||||
setReceiver(player.getHeldItem(hand), pos, world.provider.getDimension());
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
|
||||
tag.setInteger(NBT_RECEIVER_X, pos.getX());
|
||||
tag.setInteger(NBT_RECEIVER_Y, pos.getY());
|
||||
tag.setInteger(NBT_RECEIVER_Z, pos.getZ());
|
||||
tag.setInteger(NBT_DIMENSION, world.provider.getDimension());
|
||||
|
||||
player.getHeldItem(hand).setTagCompound(tag);
|
||||
|
||||
return EnumActionResult.SUCCESS;
|
||||
}
|
||||
@@ -61,15 +68,4 @@ public class ItemNetworkCard extends ItemBase {
|
||||
public static int getDimension(ItemStack stack) {
|
||||
return (stack.hasTagCompound() && stack.getTagCompound().hasKey(NBT_DIMENSION)) ? stack.getTagCompound().getInteger(NBT_DIMENSION) : 0;
|
||||
}
|
||||
|
||||
public static void setReceiver(ItemStack stack, BlockPos pos, int dimension) {
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
|
||||
tag.setInteger(NBT_RECEIVER_X, pos.getX());
|
||||
tag.setInteger(NBT_RECEIVER_Y, pos.getY());
|
||||
tag.setInteger(NBT_RECEIVER_Z, pos.getZ());
|
||||
tag.setInteger(NBT_DIMENSION, dimension);
|
||||
|
||||
stack.setTagCompound(tag);
|
||||
}
|
||||
}
|
||||
|
@@ -143,7 +143,7 @@ public class ItemPattern extends ItemBase implements ICraftingPatternProvider {
|
||||
for (int i = 0; i < outputsTag.tagCount(); ++i) {
|
||||
ItemStack stack = new ItemStack(outputsTag.getCompoundTagAt(i));
|
||||
|
||||
if (stack != null) {
|
||||
if (!stack.isEmpty()) {
|
||||
outputs.add(stack);
|
||||
}
|
||||
}
|
||||
|
@@ -22,9 +22,9 @@ public class ItemProcessor extends ItemBase {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(Item item, CreativeTabs tab, NonNullList<ItemStack> list) {
|
||||
public void getSubItems(Item item, CreativeTabs tab, NonNullList<ItemStack> subItems) {
|
||||
for (int i = 0; i <= 6; ++i) {
|
||||
list.add(new ItemStack(item, 1, i));
|
||||
subItems.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -39,9 +39,9 @@ public class ItemStorageDisk extends ItemBase {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(Item item, CreativeTabs tab, NonNullList<ItemStack> list) {
|
||||
public void getSubItems(Item item, CreativeTabs tab, NonNullList<ItemStack> subItems) {
|
||||
for (int i = 0; i < 5; ++i) {
|
||||
list.add(ItemStorageNBT.createStackWithNBT(new ItemStack(item, 1, i)));
|
||||
subItems.add(ItemStorageNBT.createStackWithNBT(new ItemStack(item, 1, i)));
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -19,9 +19,9 @@ public class ItemStoragePart extends ItemBase {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(Item item, CreativeTabs tab, NonNullList<ItemStack> list) {
|
||||
public void getSubItems(Item item, CreativeTabs tab, NonNullList<ItemStack> subItems) {
|
||||
for (int i = 0; i <= 3; ++i) {
|
||||
list.add(new ItemStack(item, 1, i));
|
||||
subItems.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -51,13 +51,13 @@ public class ItemUpgrade extends ItemBase {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(Item item, CreativeTabs tab, NonNullList<ItemStack> list) {
|
||||
public void getSubItems(Item item, CreativeTabs tab, NonNullList<ItemStack> subItems) {
|
||||
for (int i = 0; i <= 6; ++i) {
|
||||
list.add(new ItemStack(item, 1, i));
|
||||
subItems.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
|
||||
for (int j = 1; j <= 3; ++j) {
|
||||
list.add(initializeForFortune(j));
|
||||
subItems.add(initializeForFortune(j));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,6 +71,7 @@ public class ItemUpgrade extends ItemBase {
|
||||
public static int getFortuneLevel(ItemStack stack) {
|
||||
if (stack != null && stack.getItemDamage() == ItemUpgrade.TYPE_FORTUNE) {
|
||||
NBTTagCompound tag = stack.getTagCompound();
|
||||
|
||||
if (tag.hasKey(ItemUpgrade.NBT_FORTUNE)) {
|
||||
return tag.getInteger(ItemUpgrade.NBT_FORTUNE);
|
||||
}
|
||||
|
@@ -1,5 +1,6 @@
|
||||
package com.raoulvdberge.refinedstorage.network;
|
||||
|
||||
import com.raoulvdberge.refinedstorage.RSUtils;
|
||||
import com.raoulvdberge.refinedstorage.block.EnumGridType;
|
||||
import com.raoulvdberge.refinedstorage.tile.grid.TileGrid;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
@@ -49,13 +50,13 @@ public class MessageGridCraftingClear extends MessageHandlerPlayerToServer<Messa
|
||||
for (int i = 0; i < grid.getMatrix().getSizeInventory(); ++i) {
|
||||
ItemStack slot = grid.getMatrix().getStackInSlot(i);
|
||||
|
||||
if (slot != null) {
|
||||
grid.getMatrix().setInventorySlotContents(i, grid.getNetwork().insertItem(slot, slot.getCount(), false));
|
||||
if (!slot.isEmpty()) {
|
||||
grid.getMatrix().setInventorySlotContents(i, RSUtils.getStack(grid.getNetwork().insertItem(slot, slot.getCount(), false)));
|
||||
}
|
||||
}
|
||||
} else if (grid.getType() == EnumGridType.PATTERN) {
|
||||
for (int i = 0; i < grid.getMatrix().getSizeInventory(); ++i) {
|
||||
grid.getMatrix().setInventorySlotContents(i, null);
|
||||
grid.getMatrix().setInventorySlotContents(i, ItemStack.EMPTY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -3,6 +3,7 @@ package com.raoulvdberge.refinedstorage.network;
|
||||
import com.raoulvdberge.refinedstorage.tile.TileProcessingPatternEncoder;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
|
||||
@@ -43,7 +44,7 @@ public class MessageProcessingPatternEncoderClear extends MessageHandlerPlayerTo
|
||||
TileProcessingPatternEncoder encoder = (TileProcessingPatternEncoder) tile;
|
||||
|
||||
for (int i = 0; i < encoder.getConfiguration().getSlots(); ++i) {
|
||||
encoder.getConfiguration().setStackInSlot(i, null);
|
||||
encoder.getConfiguration().setStackInSlot(i, ItemStack.EMPTY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user