diff options
7 files changed, 373 insertions, 12 deletions
diff --git a/src/main/java/GoodGenerator/Blocks/RegularBlock/TEBlock.java b/src/main/java/GoodGenerator/Blocks/RegularBlock/TEBlock.java index ec23abde91..ffea651383 100644 --- a/src/main/java/GoodGenerator/Blocks/RegularBlock/TEBlock.java +++ b/src/main/java/GoodGenerator/Blocks/RegularBlock/TEBlock.java @@ -12,12 +12,14 @@ import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.EnumCreatureType; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import thaumcraft.api.aspects.IEssentiaContainerItem; import java.util.List; @@ -27,7 +29,7 @@ public class TEBlock extends BlockContainer { protected IIcon[] texture; String[] textureNames; protected String name; - int index; + protected int index; public TEBlock(String name, String[] texture, CreativeTabs Tab){ super(Material.iron); @@ -63,6 +65,10 @@ public class TEBlock extends BlockContainer { GregTech_API.registerMachineBlock(this, -1); } + public int getIndex() { + return this.index; + } + @Override public int damageDropped(int meta) { return meta; @@ -135,6 +141,30 @@ public class TEBlock extends BlockContainer { } @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) { + if (world.isRemote) { + return false; + } else { + TileEntity tile = world.getTileEntity(x, y, z); + if (index == 1) { + if (tile instanceof EssentiaHatch) { + ItemStack tItemStack = player.getHeldItem(); + if (tItemStack != null) { + Item tItem = tItemStack.getItem(); + if (tItem instanceof IEssentiaContainerItem) + ((EssentiaHatch) tile).setLockedAspect(((IEssentiaContainerItem) tItem).getAspects(player.getHeldItem()).getAspects()[0]); + } + else ((EssentiaHatch) tile).setLockedAspect(null); + world.markBlockForUpdate(x, y, z); + return true; + } + else return false; + } + else return false; + } + } + + @Override public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { return null; } diff --git a/src/main/java/GoodGenerator/Blocks/TEs/EssentiaHatch.java b/src/main/java/GoodGenerator/Blocks/TEs/EssentiaHatch.java index 2a86d374e8..13843ecb77 100644 --- a/src/main/java/GoodGenerator/Blocks/TEs/EssentiaHatch.java +++ b/src/main/java/GoodGenerator/Blocks/TEs/EssentiaHatch.java @@ -17,17 +17,19 @@ import java.util.ArrayList; public class EssentiaHatch extends TileEntity implements IAspectContainer, IEssentiaTransport { - public int facing; - public boolean isOn; + private Aspect mLocked; private AspectList current = new AspectList(); + public void setLockedAspect(Aspect aAspect) { + this.mLocked = aAspect; + } + @Override public void readFromNBT(NBTTagCompound tagCompound) { super.readFromNBT(tagCompound); - this.facing = tagCompound.getInteger("facing"); - this.isOn = tagCompound.getBoolean("isOn"); + this.mLocked = Aspect.getAspect(tagCompound.getString("mLocked")); current = new AspectList(); NBTTagList tlist = tagCompound.getTagList("Aspects", 10); @@ -43,8 +45,7 @@ public class EssentiaHatch extends TileEntity implements IAspectContainer, IEsse public void writeToNBT(NBTTagCompound tagCompound) { super.writeToNBT(tagCompound); - tagCompound.setInteger("facing", this.facing); - tagCompound.setBoolean("isOn", this.isOn); + tagCompound.setString("mLocked", this.mLocked == null ? "" : this.mLocked.getTag()); NBTTagList tlist = new NBTTagList(); Aspect[] aspectA = current.getAspects(); @@ -92,8 +93,12 @@ public class EssentiaHatch extends TileEntity implements IAspectContainer, IEsse if (!pipe.canOutputTo(ForgeDirection.VALID_DIRECTIONS[i])) { return; } - if ((pipe.getEssentiaType(ForgeDirection.VALID_DIRECTIONS[i]) != null) && (pipe.getSuctionAmount(ForgeDirection.VALID_DIRECTIONS[i]) < getSuctionAmount(ForgeDirection.VALID_DIRECTIONS[i]))) { - addToContainer(pipe.getEssentiaType(ForgeDirection.VALID_DIRECTIONS[i]), pipe.takeEssentia(pipe.getEssentiaType(ForgeDirection.VALID_DIRECTIONS[i]), 1, ForgeDirection.VALID_DIRECTIONS[i])); + if ((pipe.getEssentiaType(ForgeDirection.VALID_DIRECTIONS[i].getOpposite()) != null) && (pipe.getSuctionAmount(ForgeDirection.VALID_DIRECTIONS[i]) < getSuctionAmount(ForgeDirection.VALID_DIRECTIONS[i]))) { + if (mLocked != null && pipe.getEssentiaType(ForgeDirection.VALID_DIRECTIONS[i].getOpposite()) == mLocked) { + addToContainer(mLocked, pipe.takeEssentia(mLocked, 1, ForgeDirection.VALID_DIRECTIONS[i])); + } + if (mLocked == null) + addToContainer(pipe.getEssentiaType(ForgeDirection.VALID_DIRECTIONS[i]), pipe.takeEssentia(pipe.getEssentiaType(ForgeDirection.VALID_DIRECTIONS[i]), 1, ForgeDirection.VALID_DIRECTIONS[i])); } } } @@ -111,12 +116,13 @@ public class EssentiaHatch extends TileEntity implements IAspectContainer, IEsse @Override public boolean doesContainerAccept(Aspect aspect) { - return true; + return mLocked == null || mLocked.equals(aspect); } @Override public int addToContainer(Aspect aspect, int i) { current.add(aspect, i); + this.markDirty(); return 0; } @@ -168,7 +174,7 @@ public class EssentiaHatch extends TileEntity implements IAspectContainer, IEsse @Override public Aspect getSuctionType(ForgeDirection forgeDirection) { - return null; + return this.mLocked; } @Override diff --git a/src/main/java/GoodGenerator/Items/MyItemBlocks.java b/src/main/java/GoodGenerator/Items/MyItemBlocks.java index 38082cda0b..15014099d1 100644 --- a/src/main/java/GoodGenerator/Items/MyItemBlocks.java +++ b/src/main/java/GoodGenerator/Items/MyItemBlocks.java @@ -1,5 +1,7 @@ package GoodGenerator.Items; +import GoodGenerator.Blocks.RegularBlock.TEBlock; +import GoodGenerator.util.DescTextLocalization; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.util.GT_LanguageManager; @@ -10,6 +12,9 @@ import GoodGenerator.Main.GoodGenerator; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; +import java.util.Arrays; +import java.util.List; + public class MyItemBlocks extends ItemBlock { private final String mNoMobsToolTip = GT_LanguageManager.addStringLocalization("gt.nomobspawnsonthisblock", "Mobs cannot Spawn on this Block"); private final String mNoTileEntityToolTip = GT_LanguageManager.addStringLocalization("gt.notileentityinthisblock", "This is NOT a TileEntity!"); @@ -49,4 +54,18 @@ public class MyItemBlocks extends ItemBlock { public IIcon getIconFromDamageForRenderPass(int p_77618_1_, int p_77618_2_) { return this.field_150939_a.getIcon(0, p_77618_2_); } + + @Override + @SuppressWarnings({"unchecked"}) + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List p_77624_3_, boolean p_77624_4_) { + if (p_77624_1_ == null) return; + p_77624_3_.add(mNoMobsToolTip); + if (Block.getBlockFromItem(p_77624_1_.getItem()) instanceof TEBlock) { + TEBlock tile = (TEBlock) Block.getBlockFromItem(p_77624_1_.getItem()); + if (tile.getIndex() == 1) + p_77624_3_.addAll(Arrays.asList(DescTextLocalization.addText("EssentiaHatch.tooltip", 2))); + } + else p_77624_3_.add(mNoTileEntityToolTip); + } } diff --git a/src/main/java/GoodGenerator/Items/MyItems.java b/src/main/java/GoodGenerator/Items/MyItems.java index e6c8568482..bfd1d5b661 100644 --- a/src/main/java/GoodGenerator/Items/MyItems.java +++ b/src/main/java/GoodGenerator/Items/MyItems.java @@ -44,6 +44,7 @@ public class MyItems extends Item { } @SideOnly(Side.CLIENT) + @SuppressWarnings({"unchecked"}) public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List p_77624_3_, boolean p_77624_4_) { if (tooltips.size() > 0) { p_77624_3_.addAll(tooltips); diff --git a/src/main/java/GoodGenerator/Items/MyMaterial.java b/src/main/java/GoodGenerator/Items/MyMaterial.java index 65913501ba..1194336ae4 100644 --- a/src/main/java/GoodGenerator/Items/MyMaterial.java +++ b/src/main/java/GoodGenerator/Items/MyMaterial.java @@ -606,6 +606,309 @@ public class MyMaterial implements Runnable { OffsetID + 52, TextureSet.SET_SHINY ); + + //Naquadah Rework Materials + public static final Werkstoff naquadahEarth = new Werkstoff( + new short[]{0x4c,0x4c,0x4c}, + "Naquadah Earth", + subscriptNumbers("??NqTiGaAd??"), + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + OffsetID + 53, + TextureSet.SET_METALLIC + ); + + public static final Werkstoff titaniumTrifluoride = new Werkstoff( + new short[]{0xc0,0x92,0xa8}, + "Titanium Trifluoride", + subscriptNumbers("TiF3"), + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + OffsetID + 54, + TextureSet.SET_METALLIC, + new Pair<> (Titanium, 1), + new Pair<> (Fluorine, 3) + ); + + public static final Werkstoff lowQualityNaquadahEmulsion = new Werkstoff( + new short[]{0x4c,0x4c,0x4c}, + "Low Quality Naquadah Emulsion", + subscriptNumbers("??NqGaAd??"), + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().addCells(), + OffsetID + 55, + TextureSet.SET_FLUID + ); + + public static final Werkstoff galliumHydroxide = new Werkstoff( + new short[]{0xa6,0xa6,0xa6}, + "Gallium Hydroxide", + subscriptNumbers("Ga(OH)3"), + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + OffsetID + 56, + TextureSet.SET_DULL, + new Pair<> (Gallium, 1), + new Pair<> (Oxygen, 3), + new Pair<> (Hydrogen, 3) + ); + + public static final Werkstoff lowQualityNaquadahSolution = new Werkstoff( + new short[]{0x71,0x62,0x62}, + "Low Quality Naquadah Solution", + subscriptNumbers("~??NqAd??~"), + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().addCells(), + OffsetID + 57, + TextureSet.SET_FLUID + ); + + public static final Werkstoff towEthyl1Hexanol = new Werkstoff( + new short[]{0x80,0xb5,0x57}, + "2-Ethyl-1-Hexanol", + subscriptNumbers("C8H18O"), + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().addCells(), + OffsetID + 58, + TextureSet.SET_FLUID, + new Pair<> (Carbon, 8), + new Pair<> (Oxygen, 1), + new Pair<> (Hydrogen, 18) + ); + + public static final Werkstoff P507 = new Werkstoff( + new short[]{0x29,0xc2,0x2a}, + "P-507", + subscriptNumbers("(C8H17)2PO3H"), + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().addCells(), + OffsetID + 59, + TextureSet.SET_FLUID, + new Pair<> (Carbon, 16), + new Pair<> (Phosphorus, 1), + new Pair<> (Oxygen, 3), + new Pair<> (Hydrogen, 35) + ); + + public static final Werkstoff naquadahAdamantiumSolution = new Werkstoff( + new short[]{0x3d,0x38,0x38}, + "Naquadah-Adamantium Solution", + subscriptNumbers("~NqAd~"), + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().addCells(), + OffsetID + 60, + TextureSet.SET_FLUID + ); + + public static final Werkstoff naquadahRichSolution = new Werkstoff( + new short[]{0x33,0x33,0x33}, + "Naquadah-Rich Solution", + subscriptNumbers("~?Nq?~"), + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().addCells(), + OffsetID + 61, + TextureSet.SET_FLUID + ); + + public static final Werkstoff naquadahine = new Werkstoff( + new short[]{0x33,0x33,0x33}, + "Naquadahine", + subscriptNumbers("NqO2"), + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + OffsetID + 62, + TextureSet.SET_METALLIC, + new Pair<> (Naquadah, 1), + new Pair<> (Oxygen, 2) + ); + + public static final Werkstoff fluorineRichWasteLiquid = new Werkstoff( + new short[]{0x13,0x68,0x62}, + "Fluorine-Rich Waste Liquid", + new Werkstoff.Stats().setToxic(true), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().addCells(), + OffsetID + 63, + TextureSet.SET_FLUID + ); + + public static final Werkstoff wasteLiquid = new Werkstoff( + new short[]{0x14,0x1c,0x68}, + "Waste Liquid", + new Werkstoff.Stats().setToxic(true), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().addCells(), + OffsetID + 64, + TextureSet.SET_FLUID + ); + + public static final Werkstoff adamantine = new Werkstoff( + new short[]{0xb7,0xb7,0xb7}, + "Adamantine", + subscriptNumbers("Ad2O3"), + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + OffsetID + 65, + TextureSet.SET_DULL, + new Pair<> (Adamantium, 2), + new Pair<> (Oxygen, 3) + ); + + public static final Werkstoff enrichedNaquadahEarth = new Werkstoff( + new short[]{0x82,0x68,0x68}, + "Enriched-Naquadah Earth", + subscriptNumbers("??KeNq") + CharExchanger.shifter(8314) + "??", + new Werkstoff.Stats().setRadioactive(true), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + OffsetID + 66, + TextureSet.SET_METALLIC + ); + + public static final Werkstoff triniumSulphate = new Werkstoff( + new short[]{0xda,0xda,0xda}, + "Trinium Sulphate", + subscriptNumbers("KeSO4"), + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + OffsetID + 67, + TextureSet.SET_METALLIC, + new Pair<> (Trinium, 1), + new Pair<> (Sulfur, 1), + new Pair<> (Oxygen, 4) + ); + + public static final Werkstoff enrichedNaquadahRichSolution = new Werkstoff( + new short[]{0x52,0x39,0x39}, + "Enriched-Naquadah-Rich Solution", + subscriptNumbers("~?Nq") + CharExchanger.shifter(8314) + "?~", + new Werkstoff.Stats().setRadioactive(true), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().addCells(), + OffsetID + 68, + TextureSet.SET_FLUID + ); + + public static final Werkstoff concentratedEnrichedNaquadahSludge = new Werkstoff( + new short[]{0x52,0x39,0x39}, + "Concentrated Enriched-Naquadah Sludge", + subscriptNumbers("?Nq") + CharExchanger.shifter(8314) + "?", + new Werkstoff.Stats().setRadioactive(true), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + OffsetID + 69, + TextureSet.SET_METALLIC + ); + + public static final Werkstoff enrichedNaquadahSulphate = new Werkstoff( + new short[]{0x52,0x39,0x39}, + "Enriched-Naquadah Sulphate", + "Nq" + CharExchanger.shifter(8314) + subscriptNumbers("(SO4)2"), + new Werkstoff.Stats().setRadioactive(true).setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + OffsetID + 70, + TextureSet.SET_DULL, + new Pair<>(NaquadahEnriched, 1), + new Pair<>(Sulfur, 2), + new Pair<>(Oxygen, 8) + ); + + public static final Werkstoff naquadriaEarth = new Werkstoff( + new short[]{0x4d,0x4d,0x55}, + "Naquadria Earth", + subscriptNumbers("??Nq*BaIn??"), + new Werkstoff.Stats().setRadioactive(true).setToxic(true), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + OffsetID + 71, + TextureSet.SET_METALLIC + ); + + public static final Werkstoff indiumPhosphate = new Werkstoff( + new short[]{0x2b,0x2e,0x70}, + "Indium Phosphate", + subscriptNumbers("InPO4"), + new Werkstoff.Stats().setToxic(true).setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + OffsetID + 72, + TextureSet.SET_DULL, + new Pair<>(Indium, 1), + new Pair<>(Phosphorus, 1), + new Pair<>(Oxygen, 4) + ); + + public static final Werkstoff lowQualityNaquadriaPhosphate = new Werkstoff( + new short[]{0x4d,0x4d,0x55}, + "Low Quality Naquadria Phosphate", + subscriptNumbers("??Nq*3(PO4)4??"), + new Werkstoff.Stats().setRadioactive(true).setToxic(true), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + OffsetID + 73, + TextureSet.SET_DULL + ); + + public static final Werkstoff naquadriaRichSolution = new Werkstoff( + new short[]{0x1f,0x1e,0x33}, + "Naquadria-Rich Solution", + subscriptNumbers("~?Nq*?~"), + new Werkstoff.Stats().setRadioactive(true).setToxic(true), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().addCells(), + OffsetID + 74, + TextureSet.SET_FLUID + ); + + public static final Werkstoff lowQualityNaquadriaSulphate = new Werkstoff( + new short[]{0x73,0x72,0x84}, + "Low Quality Naquadria Sulphate", + subscriptNumbers("??Nq*(SO4)2??"), + new Werkstoff.Stats().setRadioactive(true).setToxic(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + OffsetID + 75, + TextureSet.SET_METALLIC + ); + + public static final Werkstoff lowQualityNaquadriaSolution = new Werkstoff( + new short[]{0x73,0x72,0x84}, + "Low Quality Naquadria Sulphate", + subscriptNumbers("~??Nq*??~"), + new Werkstoff.Stats().setRadioactive(true).setToxic(true), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().addCells(), + OffsetID + 76, + TextureSet.SET_FLUID + ); + + public static final Werkstoff naquadriaSulphate = new Werkstoff( + new short[]{0x1f,0x1e,0x33}, + "Naquadria Sulphate", + subscriptNumbers("Nq*(SO4)2"), + new Werkstoff.Stats().setRadioactive(true).setToxic(true).setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + OffsetID + 77, + TextureSet.SET_METALLIC, + new Pair<>(Naquadria, 1), + new Pair<>(Sulfur, 2), + new Pair<>(Oxygen, 8) + ); + @Override public void run() { } } diff --git a/src/main/java/GoodGenerator/Loader/RecipeLoader.java b/src/main/java/GoodGenerator/Loader/RecipeLoader.java index cbccde048e..03c7f4ad27 100644 --- a/src/main/java/GoodGenerator/Loader/RecipeLoader.java +++ b/src/main/java/GoodGenerator/Loader/RecipeLoader.java @@ -1570,7 +1570,7 @@ public class RecipeLoader { ItemRefer.Inverter.get(1), ItemList.Hull_EV.get(1L), GT_OreDictUnificator.get(OrePrefixes.cableGt01, Materials.Aluminium,2), - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.AnySyntheticRubber,1), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.StyreneButadieneRubber,1), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.IronMagnetic,4), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.TungstenCarbide,2), ItemList.Electric_Motor_EV.get(2), diff --git a/src/main/resources/assets/goodgenerator/lang/en_US.lang b/src/main/resources/assets/goodgenerator/lang/en_US.lang index 235ac95aab..db3e2d2468 100644 --- a/src/main/resources/assets/goodgenerator/lang/en_US.lang +++ b/src/main/resources/assets/goodgenerator/lang/en_US.lang @@ -44,6 +44,8 @@ item.neutronSource.name=Neutron Source Case #Tooltip inverter.tooltip.0=Turn DC into AC +EssentiaHatch.tooltip.0=You can right click it with an Essentia Jar to set Essentia Filter. +EssentiaHatch.tooltip.1=Right click it with empty hands to clear the Filter. #Fluids fluid.lightlyCrackedNaquadahGas=Lightly Cracked Naquadah Gas |