From bce444a4ff375340ffa152862de7f3fd6929f326 Mon Sep 17 00:00:00 2001 From: Modmuss50 Date: Mon, 23 Nov 2015 20:34:05 +0000 Subject: [PATCH] 0 --- .../techreborn/blocks/BlockMachineBase.java | 1 - .../techreborn/blocks/BlockQuantumChest.java | 1 - .../techreborn/blocks/storage/BlockIDSU.java | 3 --- .../techreborn/tiles/TileAlloySmelter.java | 4 ++-- .../tiles/TileAssemblingMachine.java | 4 ++-- .../techreborn/tiles/TileBlastFurnace.java | 23 +++++++++++++++--- .../java/techreborn/tiles/TileCentrifuge.java | 14 ++--------- .../techreborn/tiles/TileChargeBench.java | 4 ++-- .../techreborn/tiles/TileChemicalReactor.java | 14 ++--------- .../tiles/TileDragonEggSiphoner.java | 5 ++-- .../java/techreborn/tiles/TileGrinder.java | 4 ++-- .../techreborn/tiles/TileHeatGenerator.java | 11 +++++---- .../tiles/TileImplosionCompressor.java | 4 ++-- .../tiles/TileIndustrialElectrolyzer.java | 14 ++--------- .../tiles/TileIndustrialSawmill.java | 4 ++-- .../tiles/TileMatterFabricator.java | 24 +++++++++---------- .../java/techreborn/tiles/idsu/TileIDSU.java | 1 - 17 files changed, 59 insertions(+), 76 deletions(-) diff --git a/src/main/java/techreborn/blocks/BlockMachineBase.java b/src/main/java/techreborn/blocks/BlockMachineBase.java index 02a5b6814..7e573bcb7 100644 --- a/src/main/java/techreborn/blocks/BlockMachineBase.java +++ b/src/main/java/techreborn/blocks/BlockMachineBase.java @@ -22,7 +22,6 @@ import net.minecraft.util.MathHelper; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.fluids.*; -import net.minecraftforge.fml.common.Loader; import techreborn.client.TechRebornCreativeTab; import techreborn.init.ModBlocks; import techreborn.tiles.TileMachineBase; diff --git a/src/main/java/techreborn/blocks/BlockQuantumChest.java b/src/main/java/techreborn/blocks/BlockQuantumChest.java index ec8036eb6..87d7a1a12 100644 --- a/src/main/java/techreborn/blocks/BlockQuantumChest.java +++ b/src/main/java/techreborn/blocks/BlockQuantumChest.java @@ -10,7 +10,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; -import net.minecraft.util.MathHelper; import net.minecraft.world.World; import techreborn.Core; import techreborn.client.GuiHandler; diff --git a/src/main/java/techreborn/blocks/storage/BlockIDSU.java b/src/main/java/techreborn/blocks/storage/BlockIDSU.java index 8c16d9f09..af57287e6 100644 --- a/src/main/java/techreborn/blocks/storage/BlockIDSU.java +++ b/src/main/java/techreborn/blocks/storage/BlockIDSU.java @@ -6,10 +6,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.BlockPos; -import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; import techreborn.Core; import techreborn.blocks.BlockMachineBase; import techreborn.client.GuiHandler; diff --git a/src/main/java/techreborn/tiles/TileAlloySmelter.java b/src/main/java/techreborn/tiles/TileAlloySmelter.java index eb9b1a329..f1adbf279 100644 --- a/src/main/java/techreborn/tiles/TileAlloySmelter.java +++ b/src/main/java/techreborn/tiles/TileAlloySmelter.java @@ -147,8 +147,8 @@ public class TileAlloySmelter extends TilePowerAcceptor implements IWrenchable, // ISidedInventory @Override - public int[] getAccessibleSlotsFromSide(int side) { - return side == EnumFacing.DOWN.ordinal() ? new int[]{0, 1, 2} : new int[]{0, 1, 2}; + public int[] getSlotsForFace(EnumFacing side) { + return side == EnumFacing.DOWN ? new int[]{0, 1, 2} : new int[]{0, 1, 2}; } @Override diff --git a/src/main/java/techreborn/tiles/TileAssemblingMachine.java b/src/main/java/techreborn/tiles/TileAssemblingMachine.java index 6720f2280..442b7aa5a 100644 --- a/src/main/java/techreborn/tiles/TileAssemblingMachine.java +++ b/src/main/java/techreborn/tiles/TileAssemblingMachine.java @@ -132,8 +132,8 @@ public class TileAssemblingMachine extends TilePowerAcceptor implements IWrencha // ISidedInventory @Override - public int[] getAccessibleSlotsFromSide(int side) { - return side == EnumFacing.DOWN.ordinal() ? new int[]{0, 1, 2} : new int[]{0, 1, 2}; + public int[] getSlotsForFace(EnumFacing side) { + return side == EnumFacing.DOWN ? new int[]{0, 1, 2} : new int[]{0, 1, 2}; } @Override diff --git a/src/main/java/techreborn/tiles/TileBlastFurnace.java b/src/main/java/techreborn/tiles/TileBlastFurnace.java index fc30d6907..2d8e8229b 100644 --- a/src/main/java/techreborn/tiles/TileBlastFurnace.java +++ b/src/main/java/techreborn/tiles/TileBlastFurnace.java @@ -12,6 +12,7 @@ import net.minecraft.network.play.server.S35PacketUpdateTileEntity; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.util.IChatComponent; import reborncore.common.misc.Location; import reborncore.common.multiblock.IMultiblockPart; import reborncore.common.util.Inventory; @@ -95,7 +96,8 @@ public class TileBlastFurnace extends TilePowerAcceptor implements IWrenchable, } for (IMultiblockPart part : casing.connectedParts) { - heat += BlockMachineCasing.getHeatFromMeta(part.getWorld().getBlockMetadata(part.getWorldLocation().x, part.getWorldLocation().y, part.getWorldLocation().z)); +// heat += BlockMachineCasing.getHeatFromMeta(part.getWorld().getBlockMetadata(part.getWorldLocation().x, part.getWorldLocation().y, part.getWorldLocation().z)); + //TODO meta fix } if (worldObj.getBlockState(new BlockPos(location.getX(), location.getY(), location.getZ())).getBlock().getUnlocalizedName().equals("tile.lava") && worldObj.getBlockState(new BlockPos(location.getX(), location.getY() + 1, location.getZ())).getBlock().getUnlocalizedName().equals("tile.lava")) { @@ -213,8 +215,8 @@ public class TileBlastFurnace extends TilePowerAcceptor implements IWrenchable, // ISidedInventory @Override - public int[] getAccessibleSlotsFromSide(int side) { - return side == EnumFacing.DOWN.ordinal() ? new int[]{0, 1, 2, 3} : new int[]{0, 1, 2, 3}; + public int[] getSlotsForFace(EnumFacing side) { + return side == EnumFacing.DOWN ? new int[]{0, 1, 2, 3} : new int[]{0, 1, 2, 3}; } @Override @@ -260,4 +262,19 @@ public class TileBlastFurnace extends TilePowerAcceptor implements IWrenchable, public double getMaxInput() { return 128; } + + @Override + public String getCommandSenderName() { + return inventory.getCommandSenderName(); + } + + @Override + public boolean hasCustomName() { + return inventory.hasCustomName(); + } + + @Override + public IChatComponent getDisplayName() { + return inventory.getDisplayName(); + } } diff --git a/src/main/java/techreborn/tiles/TileCentrifuge.java b/src/main/java/techreborn/tiles/TileCentrifuge.java index 556ae8c47..3a6faa08b 100644 --- a/src/main/java/techreborn/tiles/TileCentrifuge.java +++ b/src/main/java/techreborn/tiles/TileCentrifuge.java @@ -140,16 +140,6 @@ public class TileCentrifuge extends TilePowerAcceptor implements IWrenchable, II return inventory.isUseableByPlayer(player); } - @Override - public void openInventory() { - inventory.openInventory(); - } - - @Override - public void closeInventory() { - inventory.closeInventory(); - } - @Override public boolean isItemValidForSlot(int slot, ItemStack stack) { return inventory.isItemValidForSlot(slot, stack); @@ -157,8 +147,8 @@ public class TileCentrifuge extends TilePowerAcceptor implements IWrenchable, II // ISidedInventory @Override - public int[] getAccessibleSlotsFromSide(EnumFacing side) { - return side == EnumFacing.DOWN.ordinal() ? new int[]{0, 1, 2, 3, 4, 5} : new int[]{0, 1, 2, 3, 4, 5}; + public int[] getSlotsForFace(EnumFacing side) { + return side == EnumFacing.DOWN ? new int[]{0, 1, 2, 3, 4, 5} : new int[]{0, 1, 2, 3, 4, 5}; } @Override diff --git a/src/main/java/techreborn/tiles/TileChargeBench.java b/src/main/java/techreborn/tiles/TileChargeBench.java index ed9917e37..dd164734e 100644 --- a/src/main/java/techreborn/tiles/TileChargeBench.java +++ b/src/main/java/techreborn/tiles/TileChargeBench.java @@ -133,8 +133,8 @@ public class TileChargeBench extends TilePowerAcceptor implements IWrenchable, I // ISidedInventory @Override - public int[] getAccessibleSlotsFromSide(int side) { - return side == EnumFacing.DOWN.ordinal() ? new int[]{0, 1, 2, 3, 4, 5} : new int[]{0, 1, 2, 3, 4, 5}; + public int[] getSlotsForFace(EnumFacing side) { + return side == EnumFacing.DOWN ? new int[]{0, 1, 2, 3, 4, 5} : new int[]{0, 1, 2, 3, 4, 5}; } @Override diff --git a/src/main/java/techreborn/tiles/TileChemicalReactor.java b/src/main/java/techreborn/tiles/TileChemicalReactor.java index 634d65619..27d6f6e61 100644 --- a/src/main/java/techreborn/tiles/TileChemicalReactor.java +++ b/src/main/java/techreborn/tiles/TileChemicalReactor.java @@ -124,16 +124,6 @@ public class TileChemicalReactor extends TilePowerAcceptor implements IWrenchabl return inventory.isUseableByPlayer(player); } - @Override - public void openInventory() { - inventory.openInventory(); - } - - @Override - public void closeInventory() { - inventory.closeInventory(); - } - @Override public boolean isItemValidForSlot(int slot, ItemStack stack) { return inventory.isItemValidForSlot(slot, stack); @@ -141,8 +131,8 @@ public class TileChemicalReactor extends TilePowerAcceptor implements IWrenchabl // ISidedInventory @Override - public int[] getAccessibleSlotsFromSide(int side) { - return side == EnumFacing.DOWN.ordinal() ? new int[]{0, 1, 2} : new int[]{0, 1, 2}; + public int[] getSlotsForFace(EnumFacing side) { + return side == EnumFacing.DOWN ? new int[]{0, 1, 2} : new int[]{0, 1, 2}; } @Override diff --git a/src/main/java/techreborn/tiles/TileDragonEggSiphoner.java b/src/main/java/techreborn/tiles/TileDragonEggSiphoner.java index 8e2aa9c63..3e538177a 100644 --- a/src/main/java/techreborn/tiles/TileDragonEggSiphoner.java +++ b/src/main/java/techreborn/tiles/TileDragonEggSiphoner.java @@ -6,6 +6,7 @@ import net.minecraft.init.Blocks; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.util.IChatComponent; import reborncore.common.util.Inventory; @@ -15,7 +16,7 @@ import techreborn.powerSystem.TilePowerAcceptor; public class TileDragonEggSiphoner extends TilePowerAcceptor implements IWrenchable, IInventory { - public Inventory inventory = new Inventory(3, "TileAlloySmelter", 64); + public Inventory inventory = new Inventory(3, "TileAlloySmelter", 64, this); public static final int euTick = ConfigTechReborn.DragoneggsiphonerOutput; public TileDragonEggSiphoner() { @@ -27,7 +28,7 @@ public class TileDragonEggSiphoner extends TilePowerAcceptor implements IWrencha super.updateEntity(); if (!worldObj.isRemote) { - if (worldObj.getBlock(getPos().getX(), getPos().getY() + 1, getPos().getZ()) == Blocks.dragon_egg) { + if (worldObj.getBlockState(new BlockPos(getPos().getX(), getPos().getY() + 1, getPos().getZ())).getBlock() == Blocks.dragon_egg) { addEnergy(euTick); } } diff --git a/src/main/java/techreborn/tiles/TileGrinder.java b/src/main/java/techreborn/tiles/TileGrinder.java index 742b181ff..ed8fc9b66 100644 --- a/src/main/java/techreborn/tiles/TileGrinder.java +++ b/src/main/java/techreborn/tiles/TileGrinder.java @@ -270,8 +270,8 @@ public class TileGrinder extends TilePowerAcceptor implements IWrenchable, IFlui // ISidedInventory @Override - public int[] getAccessibleSlotsFromSide(int side) { - return side == EnumFacing.DOWN.ordinal() ? new int[]{0, 1, 2, 3, 4, 5} : new int[]{0, 1, 2, 3, 4, 5}; + public int[] getSlotsForFace(EnumFacing side) { + return side == EnumFacing.DOWN ? new int[]{0, 1, 2, 3, 4, 5} : new int[]{0, 1, 2, 3, 4, 5}; } @Override diff --git a/src/main/java/techreborn/tiles/TileHeatGenerator.java b/src/main/java/techreborn/tiles/TileHeatGenerator.java index 7dcdf682a..2e0eedbd4 100644 --- a/src/main/java/techreborn/tiles/TileHeatGenerator.java +++ b/src/main/java/techreborn/tiles/TileHeatGenerator.java @@ -4,6 +4,7 @@ import ic2.api.tile.IWrenchable; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; +import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; import techreborn.config.ConfigTechReborn; import techreborn.init.ModBlocks; @@ -22,15 +23,15 @@ public class TileHeatGenerator extends TilePowerAcceptor implements IWrenchable super.updateEntity(); if (!worldObj.isRemote) { - if (worldObj.getBlock(getPos().getX() + 1, getPos().getY(), getPos().getZ()) == Blocks.lava) { + if (worldObj.getBlockState(new BlockPos(getPos().getX() + 1, getPos().getY(), getPos().getZ())).getBlock() == Blocks.lava) { addEnergy(euTick); - } else if (worldObj.getBlock(getPos().getX(), getPos().getY(), getPos().getZ() + 1) == Blocks.lava) { + } else if (worldObj.getBlockState(new BlockPos(getPos().getX(), getPos().getY(), getPos().getZ() + 1)).getBlock() == Blocks.lava) { addEnergy(euTick); - } else if (worldObj.getBlock(getPos().getX(), getPos().getY(), getPos().getZ() - 1) == Blocks.lava) { + } else if (worldObj.getBlockState(new BlockPos(getPos().getX(), getPos().getY(), getPos().getZ() - 1)).getBlock() == Blocks.lava) { addEnergy(euTick); - } else if (worldObj.getBlock(getPos().getX() - 1, getPos().getY(), getPos().getZ()) == Blocks.lava) { + } else if (worldObj.getBlockState(new BlockPos(getPos().getX() - 1, getPos().getY(), getPos().getZ())).getBlock() == Blocks.lava) { addEnergy(euTick); - } else if (worldObj.getBlock(getPos().getX(), getPos().getY() - 1, getPos().getZ()) == Blocks.lava) { + } else if (worldObj.getBlockState(new BlockPos(getPos().getX(), getPos().getY() - 1, getPos().getZ())).getBlock() == Blocks.lava) { addEnergy(euTick); } diff --git a/src/main/java/techreborn/tiles/TileImplosionCompressor.java b/src/main/java/techreborn/tiles/TileImplosionCompressor.java index 2034c800f..468e7ee4a 100644 --- a/src/main/java/techreborn/tiles/TileImplosionCompressor.java +++ b/src/main/java/techreborn/tiles/TileImplosionCompressor.java @@ -207,8 +207,8 @@ public class TileImplosionCompressor extends TilePowerAcceptor implements IWrenc // ISidedInventory @Override - public int[] getAccessibleSlotsFromSide(int side) { - return side == EnumFacing.DOWN.ordinal() ? new int[]{0, 1, 2, 3} : new int[]{0, 1, 2, 3}; + public int[] getSlotsForFace(EnumFacing side) { + return side == EnumFacing.DOWN ? new int[]{0, 1, 2, 3} : new int[]{0, 1, 2, 3}; } @Override diff --git a/src/main/java/techreborn/tiles/TileIndustrialElectrolyzer.java b/src/main/java/techreborn/tiles/TileIndustrialElectrolyzer.java index fe246a376..70767f375 100644 --- a/src/main/java/techreborn/tiles/TileIndustrialElectrolyzer.java +++ b/src/main/java/techreborn/tiles/TileIndustrialElectrolyzer.java @@ -182,16 +182,6 @@ public class TileIndustrialElectrolyzer extends TilePowerAcceptor implements IWr return inventory.isUseableByPlayer(player); } - @Override - public void openInventory() { - inventory.openInventory(); - } - - @Override - public void closeInventory() { - inventory.closeInventory(); - } - @Override public boolean isItemValidForSlot(int slot, ItemStack stack) { return inventory.isItemValidForSlot(slot, stack); @@ -199,8 +189,8 @@ public class TileIndustrialElectrolyzer extends TilePowerAcceptor implements IWr // ISidedInventory @Override - public int[] getAccessibleSlotsFromSide(int side) { - return side == EnumFacing.DOWN.ordinal() ? new int[]{0, 1, 2, 3, 4, 5} : new int[]{0, 1, 2, 3, 4, 5}; + public int[] getSlotsForFace(EnumFacing side) { + return side == EnumFacing.DOWN ? new int[]{0, 1, 2, 3, 4, 5} : new int[]{0, 1, 2, 3, 4, 5}; } @Override diff --git a/src/main/java/techreborn/tiles/TileIndustrialSawmill.java b/src/main/java/techreborn/tiles/TileIndustrialSawmill.java index 902acd843..6a3af9131 100644 --- a/src/main/java/techreborn/tiles/TileIndustrialSawmill.java +++ b/src/main/java/techreborn/tiles/TileIndustrialSawmill.java @@ -260,8 +260,8 @@ public class TileIndustrialSawmill extends TilePowerAcceptor implements IWrencha // ISidedInventory @Override - public int[] getAccessibleSlotsFromSide(int side) { - return side == EnumFacing.DOWN.ordinal() ? new int[]{0, 1, 2, 3, 4} : new int[]{0, 1, 2, 3, 4}; + public int[] getSlotsForFace(EnumFacing side) { + return side == EnumFacing.DOWN ? new int[]{0, 1, 2, 3, 4} : new int[]{0, 1, 2, 3, 4}; } @Override diff --git a/src/main/java/techreborn/tiles/TileMatterFabricator.java b/src/main/java/techreborn/tiles/TileMatterFabricator.java index 0875d0fda..9e1428056 100644 --- a/src/main/java/techreborn/tiles/TileMatterFabricator.java +++ b/src/main/java/techreborn/tiles/TileMatterFabricator.java @@ -1,7 +1,6 @@ package techreborn.tiles; -import ic2.api.recipe.RecipeOutput; -import ic2.api.recipe.Recipes; + import ic2.api.tile.IWrenchable; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; @@ -165,8 +164,8 @@ public class TileMatterFabricator extends TilePowerAcceptor implements IWrenchab // ISidedInventory @Override - public int[] getAccessibleSlotsFromSide(int side) { - return side == EnumFacing.DOWN.ordinal() ? new int[]{0, 1, 2, 3, 4, 5, 6} : new int[]{0, 1, 2, 3, 4, 5, 6}; + public int[] getSlotsForFace(EnumFacing side) { + return side == EnumFacing.DOWN ? new int[]{0, 1, 2, 3, 4, 5, 6} : new int[]{0, 1, 2, 3, 4, 5, 6}; } @Override @@ -252,18 +251,19 @@ public class TileMatterFabricator extends TilePowerAcceptor implements IWrenchab } } + //TODO ic2 public int getValue(ItemStack itemStack) { - int value = getValue(Recipes.matterAmplifier.getOutputFor(itemStack, false)); - return value; - } - - private static Integer getValue(RecipeOutput output) { - if (output != null && output.metadata != null) { - return output.metadata.getInteger("amplification"); - } + // int value = getValue(Recipes.matterAmplifier.getOutputFor(itemStack, false)); return 0; } + // private static Integer getValue(RecipeOutput output) { +// if (output != null && output.metadata != null) { +// return output.metadata.getInteger("amplification"); +// } + // return 0; + // } + @Override public double getMaxPower() { return 100000000; diff --git a/src/main/java/techreborn/tiles/idsu/TileIDSU.java b/src/main/java/techreborn/tiles/idsu/TileIDSU.java index ed7355465..dea24f47e 100644 --- a/src/main/java/techreborn/tiles/idsu/TileIDSU.java +++ b/src/main/java/techreborn/tiles/idsu/TileIDSU.java @@ -5,7 +5,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumFacing; import org.apache.commons.lang3.StringUtils; -import reborncore.common.misc.Functions; import techreborn.config.ConfigTechReborn; import techreborn.init.ModBlocks; import techreborn.powerSystem.TilePowerAcceptor;