diff options
| author | bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> | 2019-01-17 19:46:22 +0100 |
|---|---|---|
| committer | bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> | 2019-01-17 19:46:22 +0100 |
| commit | 9c979f540c6ccdb6676c3e89c36601d5aa4fc258 (patch) | |
| tree | bffc6547276187e5dd38c5949310db58b096fe20 /src/main | |
| parent | baa391cc662db69168abb05630d757d225d45aa9 (diff) | |
| download | GT5-Unofficial-9c979f540c6ccdb6676c3e89c36601d5aa4fc258.tar.gz GT5-Unofficial-9c979f540c6ccdb6676c3e89c36601d5aa4fc258.tar.bz2 GT5-Unofficial-9c979f540c6ccdb6676c3e89c36601d5aa4fc258.zip | |
Acid Gen Update
+Added Simple Wind Meter for the Windmill
+Added Tooltips
+Changed Windmill Texture
+Changed Windmill boni
+hopefully fixed circuit programmer
+version increase
Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com>
Diffstat (limited to 'src/main')
13 files changed, 572 insertions, 224 deletions
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/AcidGenFuelAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/AcidGenFuelAdder.java new file mode 100644 index 0000000000..0f181a3559 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/AcidGenFuelAdder.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.API; + +import com.github.bartimaeusnek.bartworks.util.BWRecipes; +import gregtech.api.enums.Materials; +import net.minecraftforge.fluids.FluidStack; + +public final class AcidGenFuelAdder { + + public static boolean addLiquidFuel(Materials M, int burn) { + return ((BWRecipes.BW_Recipe_Map_LiquidFuel) BWRecipes.instance.getMappingsFor((byte) 2)).addLiquidFuel(M, burn) != null; + } + + public static boolean addLiquidFuel(FluidStack fluidStack, int burn) { + return ((BWRecipes.BW_Recipe_Map_LiquidFuel) BWRecipes.instance.getMappingsFor((byte) 2)).addLiquidFuel(fluidStack, burn) != null; + } + + public static boolean addMoltenFuel(Materials M, int burn) { + return ((BWRecipes.BW_Recipe_Map_LiquidFuel) BWRecipes.instance.getMappingsFor((byte) 2)).addMoltenFuel(M, burn) != null; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index c2a42579df..3f3fc8d9a5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -91,5 +91,4 @@ public final class MainMod { new GTNHBlocks().run(); } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java index 69621bc1b5..b4f28fd33a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java @@ -32,10 +32,10 @@ import javax.annotation.Nonnull; import java.io.File; public class ConfigHandler { - private static final int IDU = GT_Values.VN.length * 8 - 3; + private static final int IDU = GT_Values.VN.length * 8 + 1; public static int IDOffset = 12600; public static boolean teslastaff = false; - public static long energyPerCell = 100000L; + public static long energyPerCell = 1000000L; public static boolean newStuff = true; public static boolean BioLab = true; public static Configuration c; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java new file mode 100644 index 0000000000..f526e5a601 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.items; + +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ic2.core.WorldData; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ChatComponentText; +import net.minecraft.world.World; + +import java.util.List; + +public class BW_SimpleWindMeter extends Item { + + public BW_SimpleWindMeter() { + this.maxStackSize = 1; + this.setMaxDamage(15); + this.setCreativeTab(MainMod.BWT); + this.hasSubtypes = false; + this.setUnlocalizedName("BW_SimpleWindMeter"); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister p_94581_1_) { + this.itemIcon = p_94581_1_.registerIcon(MainMod.modID + ":BW_SimpleWindMeter"); + } + + @Override + public void addInformation(ItemStack itemStack, EntityPlayer entityPlayer, List list, boolean p_77624_4_) { + super.addInformation(itemStack, entityPlayer, list, p_77624_4_); + list.add("A simple Windmeter to choose a place for the Windmill."); + list.add("Uses left: " + (this.getMaxDamage() - this.getDamage(itemStack)) + "/" + this.getMaxDamage()); + list.add("Added by" + ChatColorHelper.DARKGREEN + " BartWorks"); + } + + @Override + public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer) { + if (entityPlayer.worldObj.isRemote || world == null || WorldData.get(world) == null || WorldData.get(world).windSim == null) + return itemStack; + + float windStrength = (float) WorldData.get(world).windSim.getWindAt(entityPlayer.posY); + String windS = windStrength < 1f ? "non existant" : windStrength < 10f ? "pretty low" : windStrength < 20f ? "common" : windStrength < 30f ? "rather strong" : windStrength < 50f ? "very strong" : "too strong"; + entityPlayer.addChatMessage(new ChatComponentText("The wind here seems to be " + windS + ".")); + itemStack.damageItem(1, entityPlayer); + return itemStack; + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java index edb2f32e77..2227cae93e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java @@ -76,6 +76,9 @@ public class BW_Stonage_Rotors extends Item implements IKineticRotor { } else if (Minecraft.getMinecraft().currentScreen instanceof GuiWindKineticGenerator) { type = WIND; } + info.add("Diameter: " + this.DiaMinMax[0]); + info.add("Durability: " + (this.getMaxDamage() - this.getDamage(itemStack)) + "/" + this.getMaxDamage()); + info.add("Efficiency: " + this.eff); if (type != null) { info.add(StatCollector.translateToLocal(("ic2.itemrotor.fitsin." + this.isAcceptedType(itemStack, type)))); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java index fffcf974de..d90b99029d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java @@ -28,6 +28,7 @@ import com.github.bartimaeusnek.bartworks.common.blocks.BW_TileEntityContainer; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.items.*; import com.github.bartimaeusnek.bartworks.common.tileentities.BW_RotorBlock; +import com.github.bartimaeusnek.bartworks.common.tileentities.GT_MetaTileEntity_AcidGenerator; import com.github.bartimaeusnek.bartworks.common.tileentities.GT_MetaTileEntity_Diode; import com.github.bartimaeusnek.bartworks.common.tileentities.GT_MetaTileEntity_EnergyDistributor; import cpw.mods.fml.common.registry.GameRegistry; @@ -61,6 +62,7 @@ public class ItemRegistry implements Runnable { public static final Item CombinedRotor = new BW_Stonage_Rotors(11, 0.22f, 1, 50, 5800, IKineticRotor.GearboxType.WIND, new ResourceLocation(MainMod.modID, "textures/items/rotors/rotorCombined.png"), "BW_CombinedRotor", "rotors/itemRotorCombined"); public static final Item craftingParts = new SimpleSubItemClass(new String[]{"grindstone_top", "grindstone_bottom", "completed_grindstone", "rotors/leatherParts", "rotors/woolParts", "rotors/paperParts", "rotors/combinedParts"}); public static final Item tab = new SimpleIconItem("GT2Coin"); + public static final Item WINDMETER = new BW_SimpleWindMeter(); public static final Block[] BW_BLOCKS = { new BW_Blocks("BW_ItemBlocks", new String[] { @@ -86,6 +88,7 @@ public class ItemRegistry implements Runnable { public static ItemStack[] Diode12A = new ItemStack[GT_Values.VN.length]; public static ItemStack[] Diode16A = new ItemStack[GT_Values.VN.length]; public static ItemStack[] EnergyDistributor = new ItemStack[GT_Values.VN.length]; + public static ItemStack[] AcidGens = new ItemStack[3]; @Override public void run() { @@ -100,6 +103,7 @@ public class ItemRegistry implements Runnable { GameRegistry.registerItem(craftingParts, "craftingParts"); GameRegistry.registerTileEntity(BW_RotorBlock.class, "BWRotorBlockTE"); GameRegistry.registerBlock(ROTORBLOCK, "BWRotorBlock"); + GameRegistry.registerItem(WINDMETER, "BW_SimpleWindMeter"); for (int i = 0; i < GT_Values.VN.length; i++) { ItemRegistry.Diode2A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length + 1 + i, "Cable Diode 2A " + GT_Values.VN[i], "Cable Diode 2A " + GT_Values.VN[i], i, 2).getStackForm(1L); @@ -110,6 +114,10 @@ public class ItemRegistry implements Runnable { ItemRegistry.EnergyDistributor[i] = new GT_MetaTileEntity_EnergyDistributor(ConfigHandler.IDOffset + 1 + i, "Energy Distributor " + GT_Values.VN[i], "Energy Distributor " + GT_Values.VN[i], i, "Splits Amperage into several Sides").getStackForm(1L); } + for (int i = 0; i < 3; i++) { + ItemRegistry.AcidGens[i] = new GT_MetaTileEntity_AcidGenerator(ConfigHandler.IDOffset + GT_Values.VN.length * 8 - 2 + i, "Acid Generator " + GT_Values.VN[i + 2], "Acid Generator " + GT_Values.VN[i + 2], i + 2, new String[]{"An Acid Generator", "Creates Power from Chemical Energy Potentials."}).getStackForm(1); + } + } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index 271f59c4c6..6a651b3c2b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -182,9 +182,42 @@ public class RecipeLoader implements Runnable { }); if (newStuff) { + + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.WINDMETER), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[]{ + "SWF", + "Sf ", + "Ss ", + 'S', "stickWood", + 'W', new ItemStack(Blocks.wool, 1, Short.MAX_VALUE), + 'F', new ItemStack(Items.string), + } + ); + Materials[] cables = {Materials.Lead, Materials.Tin, Materials.AnnealedCopper, Materials.Gold, Materials.Aluminium, Materials.Tungsten, Materials.VanadiumGallium, Materials.Naquadah, Materials.NaquadahAlloy, Materials.Superconductor}; Materials[] hulls = {Materials.WroughtIron, Materials.Steel, Materials.Aluminium, Materials.StainlessSteel, Materials.Titanium, Materials.TungstenSteel, Materials.Chrome, Materials.Iridium, Materials.Osmium, Materials.Naquadah}; + ItemStack[] bats = {ItemList.Battery_Hull_LV.get(1L), ItemList.Battery_Hull_MV.get(1L), ItemList.Battery_Hull_HV.get(1L)}; + ItemStack[] chreac = {ItemList.Machine_MV_ChemicalReactor.get(1L), ItemList.Machine_HV_ChemicalReactor.get(1L), ItemList.Machine_EV_ChemicalReactor.get(1L)}; + for (int i = 0; i < 3; i++) { + Materials cable = cables[i + 2]; + ItemStack machinehull = ItemList.MACHINE_HULLS[i + 2].get(1L); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.AcidGens[i], + RecipeLoader.BITSD, + new Object[]{ + "HRH", + "HCH", + "HKH", + 'H', bats[i], + 'K', GT_OreDictUnificator.get(OrePrefixes.cableGt01, cable, 1L), + 'C', machinehull, + 'R', chreac[i] + } + ); + } for (int i = 0; i < GT_Values.VN.length; i++) { try { @@ -385,7 +418,7 @@ public class RecipeLoader implements Runnable { for (String stone : stones) { GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.craftingParts, 1, 0), - RecipeLoader.BITSD, + GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ "SSS", "DfD", @@ -396,7 +429,7 @@ public class RecipeLoader implements Runnable { ); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.craftingParts, 1, 1), - RecipeLoader.BITSD, + GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ "hDf", "SSS", @@ -406,7 +439,7 @@ public class RecipeLoader implements Runnable { ); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.craftingParts, 1, 0), - RecipeLoader.BITSD, + GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ "SSS", "DfD", @@ -417,7 +450,7 @@ public class RecipeLoader implements Runnable { ); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.craftingParts, 1, 1), - RecipeLoader.BITSD, + GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ "hDf", "SSS", @@ -428,7 +461,7 @@ public class RecipeLoader implements Runnable { } GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.craftingParts, 1, 2), - RecipeLoader.BITSD, + GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ "STS", "h f", @@ -441,7 +474,7 @@ public class RecipeLoader implements Runnable { } GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.craftingParts, 1, 2), - RecipeLoader.BITSD, + GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ "STS", "h f", @@ -453,7 +486,7 @@ public class RecipeLoader implements Runnable { ); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.craftingParts, 1, 3), - RecipeLoader.BITSD, + GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ "WLs", "WLh", @@ -464,7 +497,7 @@ public class RecipeLoader implements Runnable { ); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.craftingParts, 1, 4), - RecipeLoader.BITSD, + GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ "WLs", "WLh", @@ -475,7 +508,7 @@ public class RecipeLoader implements Runnable { ); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.craftingParts, 1, 5), - RecipeLoader.BITSD, + GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ "WLs", "WLh", @@ -486,7 +519,7 @@ public class RecipeLoader implements Runnable { ); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.craftingParts, 1, 6), - RecipeLoader.BITSD, + GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ "WEs", "WZh", @@ -499,7 +532,7 @@ public class RecipeLoader implements Runnable { ); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.LeatherRotor), - RecipeLoader.BITSD, + GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ "hPf", "PWP", @@ -510,7 +543,7 @@ public class RecipeLoader implements Runnable { ); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.WoolRotor), - RecipeLoader.BITSD, + GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ "hPf", "PWP", @@ -521,7 +554,7 @@ public class RecipeLoader implements Runnable { ); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.PaperRotor), - RecipeLoader.BITSD, + GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ "hPf", "PWP", @@ -532,7 +565,7 @@ public class RecipeLoader implements Runnable { ); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.CombinedRotor), - RecipeLoader.BITSD, + GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ "hPf", "PWP", @@ -553,7 +586,6 @@ public class RecipeLoader implements Runnable { 'G', GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), } ); - //next free ID: ConfigHandler.IDOffset+GT_Values.VN.length*6+3 } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_AcidGenerator.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_AcidGenerator.java new file mode 100644 index 0000000000..f893779b81 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_AcidGenerator.java @@ -0,0 +1,113 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.tileentities; + +import com.github.bartimaeusnek.bartworks.util.BWRecipes; +import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Recipe; + +public class GT_MetaTileEntity_AcidGenerator extends GT_MetaTileEntity_BasicGenerator { + + public GT_MetaTileEntity_AcidGenerator(int aID, String aName, String aNameRegional, int aTier, String[] aDescription, ITexture... aTextures) { + super(aID, aName, aNameRegional, aTier, aDescription, aTextures); + } + + public GT_MetaTileEntity_AcidGenerator(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); + } + + @Override + public int getPollution() { + return 0; + } + + @Override + public GT_Recipe.GT_Recipe_Map getRecipes() { + return BWRecipes.instance.getMappingsFor((byte) 2); + } + + @Override + public int getEfficiency() { + return 100 - 3 * mTier; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { + return new GT_MetaTileEntity_AcidGenerator(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); + } + + public ITexture[] getFront(byte aColor) { + return new ITexture[]{super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]}; + } + + public ITexture[] getBack(byte aColor) { + return new ITexture[]{super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD)}; + } + + public ITexture[] getBottom(byte aColor) { + return new ITexture[]{super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD)}; + } + + public ITexture[] getTop(byte aColor) { + return new ITexture[]{super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT"))}; + } + + public ITexture[] getSides(byte aColor) { + return new ITexture[]{super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD)}; + } + + public ITexture[] getFrontActive(byte aColor) { + return new ITexture[]{super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]}; + } + + public ITexture[] getBackActive(byte aColor) { + return new ITexture[]{super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD)}; + } + + public ITexture[] getBottomActive(byte aColor) { + return new ITexture[]{super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD)}; + } + + public ITexture[] getTopActive(byte aColor) { + return new ITexture[]{super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE"))}; + } + + public ITexture[] getSidesActive(byte aColor) { + return new ITexture[]{super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD)}; + } + + public boolean isOutputFacing(byte aSide) { + return aSide == this.getBaseMetaTileEntity().getFrontFacing(); + } + + public String[] getDescription() { + return new String[]{mDescription, "Voltage: " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], "Efficiency: " + ChatColorHelper.YELLOW + getEfficiency(), "Amperage OUT: " + ChatColorHelper.YELLOW + maxAmperesOut(), "Added by bartimaeusnek via " + ChatColorHelper.DARKGREEN + "BartWorks"}; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_Windmill.java index 31018d73f7..555d9f4511 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_Windmill.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_Windmill.java @@ -24,14 +24,15 @@ package com.github.bartimaeusnek.bartworks.common.tileentities; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.client.gui.BW_GUIContainer_Windmill; +import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.enums.Dyes; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.SubTag; +import gregtech.api.enums.Textures; import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -53,6 +54,7 @@ import net.minecraft.tileentity.TileEntityDispenser; import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.util.ForgeDirection; +import scala.actors.threadpool.Arrays; import java.util.ArrayList; @@ -91,6 +93,11 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { return true; } + @Override + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return true; + } + public boolean recipe_fallback(ItemStack aStack) { //sight... fallback to the macerator recipes GT_Recipe.GT_Recipe_Map tMap = GT_Recipe.GT_Recipe_Map.sMaceratorRecipes; @@ -106,7 +113,18 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { if (new XSTR().nextInt(2) == 0) { if (tRecipe.getOutput(1) != null) mOutputItems[1] = tRecipe.getOutput(1); - else if (GT_OreDictUnificator.getAssociation(aStack) == null || GT_OreDictUnificator.getAssociation(aStack).mMaterial == null || GT_OreDictUnificator.getAssociation(aStack).mMaterial.mMaterial == null) + else if (GT_OreDictUnificator.getAssociation(aStack) == null || GT_OreDictUnificator.getAssociation(aStack).mMaterial == null || GT_OreDictUnificator.getAssociation(aStack).mMaterial.mMaterial == null || + BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.Flint || + BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.Sugar || + BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.Wheat || + BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.Wood || + BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.Clay || + BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.Ash || + BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.Snow || + BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.Stone || + BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.MeatRaw|| + BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.MeatCooked + ) mOutputItems[1] = tRecipe.getOutput(0); } } @@ -168,7 +186,10 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.clay) || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.hardened_clay) || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.stained_hardened_clay)) { itemStack.stackSize -= 1; this.mMaxProgresstime = 60 * 20 * 100; - this.mOutputItems[0] = Materials.Clay.getDust(1); + if (new XSTR().nextInt(2) == 0) + this.mOutputItems[0] = Materials.Clay.getDust(2); + else + this.mOutputItems[0] = Materials.Clay.getDust(1); return true; } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.redstone_block)) { itemStack.stackSize -= 1; @@ -349,14 +370,12 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { - /* * offset x1 = 3x3 * offset x2 = 5x5 * offset x3 = 7x7 * etc. */ - int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 3; int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 3; @@ -541,7 +560,7 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { "WxHxL: 7x12x7", "Layer 1: 7x7 Bricks, corners are air, controller at front centered.", "Layer 2-5: 5x5 Hardened Clay, corners are air, can contain one door,", - "hollow, must contain at least one Dispenser", + "hollow, Wall must contain at least one Dispenser", "Layer 6: 5x5 Wood Planks. Corners are filled, hollow.", "Layer 7: 7x7 Wood Planks. Corners are air, hollow.", "Layer 8: 7x7 Wood Planks. Corners are air, hollow,", @@ -605,17 +624,22 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - ITexture[] ret = new ITexture[0]; + ITexture[] ret = new ITexture[6]; if (isClientSide()) { - iTextures[0] = new GT_RenderedTexture(iIconContainers[0], Dyes.getModulation(0, Dyes.MACHINE_METAL.mRGBa)); - ret = new ITexture[6]; - for (int i = 0; i < 6; i++) { - ret[i] = iTextures[0]; + Arrays.fill(ret, new GT_RenderedTexture(Textures.BlockIcons.COVER_WOOD_PLATE)); + + if (aFacing == aSide || aSide == 0) { + iTextures[0] = new GT_RenderedTexture(iIconContainers[0]); + + ret = new ITexture[6]; + for (int i = 0; i < 6; i++) { + ret[i] = iTextures[0]; + } } if (aSide == 1) { - iTextures[1] = new GT_RenderedTexture(iIconContainers[1], Dyes.getModulation(0, Dyes.MACHINE_METAL.mRGBa)); + iTextures[1] = new GT_RenderedTexture(iIconContainers[1]); ret = new ITexture[6]; for (int i = 0; i < 6; i++) { @@ -624,8 +648,6 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { } } - - return ret; } diff --git a/src/main/java/com/git |
