diff options
Diffstat (limited to 'src/main/java/gregtech/common')
336 files changed, 31761 insertions, 13291 deletions
diff --git a/src/main/java/gregtech/common/GT_Client.java b/src/main/java/gregtech/common/GT_Client.java index be253742e2..15901703af 100644 --- a/src/main/java/gregtech/common/GT_Client.java +++ b/src/main/java/gregtech/common/GT_Client.java @@ -5,6 +5,8 @@ package gregtech.common; +import static org.lwjgl.opengl.GL11.GL_LINE_LOOP; + import codechicken.lib.vec.Rotation; import codechicken.lib.vec.Scale; import codechicken.lib.vec.Transformation; @@ -31,11 +33,11 @@ import gregtech.api.util.ColorsMetadataSection; import gregtech.api.util.ColorsMetadataSectionSerializer; import gregtech.api.util.GT_ClientPreference; import gregtech.api.util.GT_Log; +import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_PlayedSound; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.api.util.WorldSpawnedEventBuilder; -import gregtech.api.util.GT_ModHandler; import gregtech.common.entities.GT_Entity_Arrow; import gregtech.common.entities.GT_Entity_Arrow_Potion; import gregtech.common.net.MessageUpdateFluidDisplayItem; @@ -44,6 +46,14 @@ import gregtech.common.render.items.GT_MetaGenerated_Item_Renderer; import gregtech.loaders.ExtraIcons; import gregtech.loaders.preload.GT_PreLoad; import ic2.api.tile.IWrenchable; +import java.net.URL; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Scanner; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.GLAllocation; @@ -63,64 +73,65 @@ import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.oredict.OreDictionary; import org.lwjgl.opengl.GL11; -import java.net.URL; -import java.util.Arrays; -import java.util.Collections; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Scanner; - -import static org.lwjgl.opengl.GL11.GL_LINE_LOOP; - // Referenced classes of package gregtech.common: // GT_Proxy -public class GT_Client extends GT_Proxy - implements Runnable { +public class GT_Client extends GT_Proxy implements Runnable { - public static final String GTNH_CAPE_LIST_URL = "https://raw.githubusercontent.com/GTNewHorizons/CustomGTCapeHook-Cape-List/master/capes.txt"; - public static final String GT_CAPE_LIST_URL = "http://gregtech.overminddl1.com/com/gregoriust/gregtech/supporterlist.txt"; + public static final String GTNH_CAPE_LIST_URL = + "https://raw.githubusercontent.com/GTNewHorizons/CustomGTCapeHook-Cape-List/master/capes.txt"; + public static final String GT_CAPE_LIST_URL = + "http://gregtech.overminddl1.com/com/gregoriust/gregtech/supporterlist.txt"; private static final List<Block> ROTATABLE_VANILLA_BLOCKS; - private static final int[][] GRID_SWITCH_TABLE = new int[][]{ - {0, 5, 3, 1, 2, 4}, - {5, 0, 1, 3, 2, 4}, - {1, 3, 0, 5, 2, 4}, - {3, 1, 5, 0, 2, 4}, - {4, 2, 3, 1, 0, 5}, - {2, 4, 3, 1, 5, 0}, + private static final int[][] GRID_SWITCH_TABLE = new int[][] { + {0, 5, 3, 1, 2, 4}, + {5, 0, 1, 3, 2, 4}, + {1, 3, 0, 5, 2, 4}, + {3, 1, 5, 0, 2, 4}, + {4, 2, 3, 1, 0, 5}, + {2, 4, 3, 1, 5, 0}, }; // don't ask. these "just works" private static final Transformation ROTATION_MARKER_TRANSFORM_CENTER = new Scale(0.5); private static final Transformation[] ROTATION_MARKER_TRANSFORMS_SIDES_TRANSFORMS = { - new Scale(0.25).with(new Translation(0, 0, 0.375)).compile(), - new Scale(0.25).with(new Translation(0.375, 0, 0)).compile(), - new Scale(0.25).with(new Translation(0, 0, -0.375)).compile(), - new Scale(0.25).with(new Translation(-0.375, 0, 0)).compile(), + new Scale(0.25).with(new Translation(0, 0, 0.375)).compile(), + new Scale(0.25).with(new Translation(0.375, 0, 0)).compile(), + new Scale(0.25).with(new Translation(0, 0, -0.375)).compile(), + new Scale(0.25).with(new Translation(-0.375, 0, 0)).compile(), }; private static final int[] ROTATION_MARKER_TRANSFORMS_SIDES = { - -1, -1, 2, 0, 3, 1, - -1, -1, 0, 2, 3, 1, - 0, 2, -1, -1, 3, 1, - 2, 0, -1, -1, 3, 1, - 1, 3, 2, 0, -1, -1, - 3, 1, 2, 0, -1, -1 + -1, -1, 2, 0, 3, 1, + -1, -1, 0, 2, 3, 1, + 0, 2, -1, -1, 3, 1, + 2, 0, -1, -1, 3, 1, + 1, 3, 2, 0, -1, -1, + 3, 1, 2, 0, -1, -1 }; private static final Transformation[] ROTATION_MARKER_TRANSFORMS_CORNER = { - new Scale(0.25).with(new Translation(0.375, 0, 0.375)).compile(), - new Scale(0.25).with(new Translation(-0.375, 0, 0.375)).compile(), - new Scale(0.25).with(new Translation(0.375, 0, -0.375)).compile(), - new Scale(0.25).with(new Translation(-0.375, 0, -0.375)).compile(), + new Scale(0.25).with(new Translation(0.375, 0, 0.375)).compile(), + new Scale(0.25).with(new Translation(-0.375, 0, 0.375)).compile(), + new Scale(0.25).with(new Translation(0.375, 0, -0.375)).compile(), + new Scale(0.25).with(new Translation(-0.375, 0, -0.375)).compile(), }; private static int rotationMarkerDisplayList; private static boolean rotationMarkerDisplayListCompiled = false; static { - ROTATABLE_VANILLA_BLOCKS = Arrays.asList(Blocks.piston, Blocks.sticky_piston, Blocks.furnace, Blocks.lit_furnace, Blocks.dropper, Blocks.dispenser, Blocks.chest, Blocks.trapped_chest, Blocks.ender_chest, Blocks.hopper, - Blocks.pumpkin, Blocks.lit_pumpkin); + ROTATABLE_VANILLA_BLOCKS = Arrays.asList( + Blocks.piston, + Blocks.sticky_piston, + Blocks.furnace, + Blocks.lit_furnace, + Blocks.dropper, + Blocks.dispenser, + Blocks.chest, + Blocks.trapped_chest, + Blocks.ender_chest, + Blocks.hopper, + Blocks.pumpkin, + Blocks.lit_pumpkin); } private final HashSet<String> mCapeList = new HashSet<>(); @@ -147,6 +158,7 @@ public class GT_Client extends GT_Proxy * This is the place to def the value used below **/ private long afterSomeTime; + private boolean mAnimationDirection; private int mLastUpdatedBlockX; private int mLastUpdatedBlockY; @@ -160,38 +172,134 @@ public class GT_Client extends GT_Proxy mCapeRenderer = new GT_CapeRenderer(mCapeList); mAnimationTick = 0L; mAnimationDirection = false; - mPosR = Arrays.asList(Materials.Enderium, Materials.Vinteum, Materials.Uranium235, Materials.InfusedGold, Materials.Plutonium241, Materials.NaquadahEnriched, Materials.Naquadria, Materials.InfusedOrder, Materials.Force, - Materials.Pyrotheum, Materials.Sunnarium, Materials.Glowstone, Materials.Thaumium, Materials.InfusedVis, Materials.InfusedAir, Materials.InfusedFire, Materials.FierySteel, Materials.Firestone); - mPosG = Arrays.asList(Materials.Enderium, Materials.Vinteum, Materials.Uranium235, Materials.InfusedGold, Materials.Plutonium241, Materials.NaquadahEnriched, Materials.Naquadria, Materials.InfusedOrder, Materials.Force, - Materials.Pyrotheum, Materials.Sunnarium, Materials.Glowstone, Materials.InfusedAir, Materials.InfusedEarth); - mPosB = Arrays.asList(Materials.Enderium, Materials.Vinteum, Materials.Uranium235, Materials.InfusedGold, Materials.Plutonium241, Materials.NaquadahEnriched, Materials.Naquadria, Materials.InfusedOrder, Materials.InfusedVis, - Materials.InfusedWater, Materials.Thaumium); + mPosR = Arrays.asList( + Materials.Enderium, + Materials.Vinteum, + Materials.Uranium235, + Materials.InfusedGold, + Materials.Plutonium241, + Materials.NaquadahEnriched, + Materials.Naquadria, + Materials.InfusedOrder, + Materials.Force, + Materials.Pyrotheum, + Materials.Sunnarium, + Materials.Glowstone, + Materials.Thaumium, + Materials.InfusedVis, + Materials.InfusedAir, + Materials.InfusedFire, + Materials.FierySteel, + Materials.Firestone); + mPosG = Arrays.asList( + Materials.Enderium, + Materials.Vinteum, + Materials.Uranium235, + Materials.InfusedGold, + Materials.Plutonium241, + Materials.NaquadahEnriched, + Materials.Naquadria, + Materials.InfusedOrder, + Materials.Force, + Materials.Pyrotheum, + Materials.Sunnarium, + Materials.Glowstone, + Materials.InfusedAir, + Materials.InfusedEarth); + mPosB = Arrays.asList( + Materials.Enderium, + Materials.Vinteum, + Materials.Uranium235, + Materials.InfusedGold, + Materials.Plutonium241, + Materials.NaquadahEnriched, + Materials.Naquadria, + Materials.InfusedOrder, + Materials.InfusedVis, + Materials.InfusedWater, + Materials.Thaumium); mNegR = Arrays.asList(Materials.InfusedEntropy, Materials.NetherStar); mNegG = Arrays.asList(Materials.InfusedEntropy, Materials.NetherStar); mNegB = Arrays.asList(Materials.InfusedEntropy, Materials.NetherStar); - mMoltenPosR = Arrays.asList(Materials.Enderium, Materials.NetherStar, Materials.Vinteum, Materials.Uranium235, Materials.InfusedGold, Materials.Plutonium241, Materials.NaquadahEnriched, Materials.Naquadria, Materials.InfusedOrder, Materials.Force, - Materials.Pyrotheum, Materials.Sunnarium, Materials.Glowstone, Materials.Thaumium, Materials.InfusedVis, Materials.InfusedAir, Materials.InfusedFire, Materials.FierySteel, Materials.Firestone); - mMoltenPosG = Arrays.asList(Materials.Enderium, Materials.NetherStar, Materials.Vinteum, Materials.Uranium235, Materials.InfusedGold, Materials.Plutonium241, Materials.NaquadahEnriched, Materials.Naquadria, Materials.InfusedOrder, Materials.Force, - Materials.Pyrotheum, Materials.Sunnarium, Materials.Glowstone, Materials.InfusedAir, Materials.InfusedEarth); - mMoltenPosB = Arrays.asList(Materials.Enderium, Materials.NetherStar, Materials.Vinteum, Materials.Uranium235, Materials.InfusedGold, Materials.Plutonium241, Materials.NaquadahEnriched, Materials.Naquadria, Materials.InfusedOrder, Materials.InfusedVis, - Materials.InfusedWater, Materials.Thaumium); + mMoltenPosR = Arrays.asList( + Materials.Enderium, + Materials.NetherStar, + Materials.Vinteum, + Materials.Uranium235, + Materials.InfusedGold, + Materials.Plutonium241, + Materials.NaquadahEnriched, + Materials.Naquadria, + Materials.InfusedOrder, + Materials.Force, + Materials.Pyrotheum, + Materials.Sunnarium, + Materials.Glowstone, + Materials.Thaumium, + Materials.InfusedVis, + Materials.InfusedAir, + Materials.InfusedFire, + Materials.FierySteel, + Materials.Firestone); + mMoltenPosG = Arrays.asList( + Materials.Enderium, + Materials.NetherStar, + Materials.Vinteum, + Materials.Uranium235, + Materials.InfusedGold, + Materials.Plutonium241, + Materials.NaquadahEnriched, + Materials.Naquadria, + Materials.InfusedOrder, + Materials.Force, + Materials.Pyrotheum, + Materials.Sunnarium, + Materials.Glowstone, + Materials.InfusedAir, + Materials.InfusedEarth); + mMoltenPosB = Arrays.asList( + Materials.Enderium, + Materials.NetherStar, + Materials.Vinteum, + Materials.Uranium235, + Materials.InfusedGold, + Materials.Plutonium241, + Materials.NaquadahEnriched, + Materials.Naquadria, + Materials.InfusedOrder, + Materials.InfusedVis, + Materials.InfusedWater, + Materials.Thaumium); mMoltenNegR = Collections.singletonList(Materials.InfusedEntropy); mMoltenNegG = Collections.singletonList(Materials.InfusedEntropy); mMoltenNegB = Collections.singletonList(Materials.InfusedEntropy); } - private static boolean checkedForChicken = false; - private static void drawGrid(DrawBlockHighlightEvent aEvent, boolean showCoverConnections, boolean aIsWrench, boolean aIsSneaking) { + private static void drawGrid( + DrawBlockHighlightEvent aEvent, boolean showCoverConnections, boolean aIsWrench, boolean aIsSneaking) { if (!checkedForChicken) { - try {Class.forName("codechicken.lib.vec.Rotation");} catch (ClassNotFoundException e) {return;} + try { + Class.forName("codechicken.lib.vec.Rotation"); + } catch (ClassNotFoundException e) { + return; + } checkedForChicken = true; } GL11.glPushMatrix(); - GL11.glTranslated(-(aEvent.player.lastTickPosX + (aEvent.player.posX - aEvent.player.lastTickPosX) * (double) aEvent.partialTicks), -(aEvent.player.lastTickPosY + (aEvent.player.posY - aEvent.player.lastTickPosY) * (double) aEvent.partialTicks), -(aEvent.player.lastTickPosZ + (aEvent.player.posZ - aEvent.player.lastTickPosZ) * (double) aEvent.partialTicks)); - GL11.glTranslated((float) aEvent.target.blockX + 0.5F, (float) aEvent.target.blockY + 0.5F, (float) aEvent.target.blockZ + 0.5F); + GL11.glTranslated( + -(aEvent.player.lastTickPosX + + (aEvent.player.posX - aEvent.player.lastTickPosX) * (double) aEvent.partialTicks), + -(aEvent.player.lastTickPosY + + (aEvent.player.posY - aEvent.player.lastTickPosY) * (double) aEvent.partialTicks), + -(aEvent.player.lastTickPosZ + + (aEvent.player.posZ - aEvent.player.lastTickPosZ) * (double) aEvent.partialTicks)); + GL11.glTranslated( + (float) aEvent.target.blockX + 0.5F, + (float) aEvent.target.blockY + 0.5F, + (float) aEvent.target.blockZ + 0.5F); final int tSideHit = aEvent.target.sideHit; Rotation.sideRotations[tSideHit].glApply(); // draw grid @@ -207,18 +315,17 @@ public class GT_Client extends GT_Proxy GL11.glVertex3d(+.25D, .0D, +.50D); GL11.glVertex3d(-.25D, .0D, -.50D); GL11.glVertex3d(-.25D, .0D, +.50D); - final TileEntity tTile = aEvent.player.worldObj.getTileEntity(aEvent.target.blockX, aEvent.target.blockY, aEvent.target.blockZ); + final TileEntity tTile = + aEvent.player.worldObj.getTileEntity(aEvent.target.blockX, aEvent.target.blockY, aEvent.target.blockZ); // draw connection indicators byte tConnections = 0; if (tTile instanceof ICoverable) { if (showCoverConnections) { for (byte i = 0; i < 6; i++) { - if (((ICoverable) tTile).getCoverIDAtSide(i) > 0) - tConnections = (byte) (tConnections + (1 << i)); + if (((ICoverable) tTile).getCoverIDAtSide(i) > 0) tConnections = (byte) (tConnections + (1 << i)); } - } else if (tTile instanceof BaseMetaPipeEntity) - tConnections = ((BaseMetaPipeEntity) tTile).mConnections; + } else if (tTile instanceof BaseMetaPipeEntity) tConnections = ((BaseMetaPipeEntity) tTile).mConnections; } if (tConnections > 0) { @@ -280,7 +387,7 @@ public class GT_Client extends GT_Proxy GL11.glEnd(); // draw turning indicator if (aIsWrench && tTile instanceof IAlignmentProvider) { - final IAlignment tAlignment = ((IAlignmentProvider)(tTile)).getAlignment(); + final IAlignment tAlignment = ((IAlignmentProvider) (tTile)).getAlignment(); if (tAlignment != null) { final ForgeDirection direction = tAlignment.getDirection(); if (direction.ordinal() == tSideHit) @@ -290,7 +397,11 @@ public class GT_Client extends GT_Proxy drawExtendedRotationMarker(t, aIsSneaking, true); } } else { - drawExtendedRotationMarker(ROTATION_MARKER_TRANSFORMS_SIDES_TRANSFORMS[ROTATION_MARKER_TRANSFORMS_SIDES[tSideHit * 6 + direction.ordinal()]], aIsSneaking, true); + drawExtendedRotationMarker( + ROTATION_MARKER_TRANSFORMS_SIDES_TRANSFORMS[ + ROTATION_MARKER_TRANSFORMS_SIDES[tSideHit * 6 + direction.ordinal()]], + aIsSneaking, + true); } } } @@ -298,10 +409,8 @@ public class GT_Client extends GT_Proxy } private static void drawExtendedRotationMarker(Transformation transform, boolean sneaking, boolean small) { - if (sneaking) - drawFlipMarker(transform); - else - drawRotationMarker(transform); + if (sneaking) drawFlipMarker(transform); + else drawRotationMarker(transform); } private static void drawRotationMarker(Transformation transform) { @@ -320,10 +429,16 @@ public class GT_Client extends GT_Proxy GL11.glNewList(displayList, GL11.GL_COMPILE); GL11.glBegin(GL_LINE_LOOP); for (int i = 0; i <= ROTATION_MARKER_RESOLUTION; i++) { - GL11.glVertex3d(Math.cos(i * Math.PI * 1.75 / ROTATION_MARKER_RESOLUTION) * 0.4, 0, Math.sin(i * Math.PI * 1.75 / ROTATION_MARKER_RESOLUTION) * 0.4); + GL11.glVertex3d( + Math.cos(i * Math.PI * 1.75 / ROTATION_MARKER_RESOLUTION) * 0.4, + 0, + Math.sin(i * Math.PI * 1.75 / ROTATION_MARKER_RESOLUTION) * 0.4); } - for (int i = ROTATION_MARKER_RESOLUTION; i >=0; i--) { - GL11.glVertex3d(Math.cos(i * Math.PI * 1.75 / ROTATION_MARKER_RESOLUTION) * 0.24, 0, Math.sin(i * Math.PI * 1.75 / ROTATION_MARKER_RESOLUTION) * 0.24); + for (int i = ROTATION_MARKER_RESOLUTION; i >= 0; i--) { + GL11.glVertex3d( + Math.cos(i * Math.PI * 1.75 / ROTATION_MARKER_RESOLUTION) * 0.24, + 0, + Math.sin(i * Math.PI * 1.75 / ROTATION_MARKER_RESOLUTION) * 0.24); } GL11.glVertex3d(0.141114561800, 0, 0); GL11.glVertex3d(0.32, 0, -0.178885438199); @@ -403,22 +518,36 @@ public class GT_Client extends GT_Proxy super.onPreLoad(); MinecraftForge.EVENT_BUS.register(new ExtraIcons()); - Minecraft.getMinecraft().getResourcePackRepository().rprMetadataSerializer.registerMetadataSectionType(new ColorsMetadataSectionSerializer(), ColorsMetadataSection.class); + Minecraft.getMinecraft() + .getResourcePackRepository() + .rprMetadataSerializer + .registerMetadataSectionType(new ColorsMetadataSectionSerializer(), ColorsMetadataSection.class); final String[] arr = { - "renadi", "hanakocz", "MysteryDump", "Flaver4", "x_Fame", "Peluche321", "Goshen_Ithilien", "manf", "Bimgo", "leagris", - "IAmMinecrafter02", "Cerous", "Devilin_Pixy", "Bkarlsson87", "BadAlchemy", "CaballoCraft", "melanclock", "Resursator", "demanzke", "AndrewAmmerlaan", - "Deathlycraft", "Jirajha", "Axlegear", "kei_kouma", "Dracion", "dungi", "Dorfschwein", "Zero Tw0", "mattiagraz85", "sebastiank30", - "Plem", "invultri", "grillo126", "malcanteth", "Malevolence_", "Nicholas_Manuel", "Sirbab", "kehaan", "bpgames123", "semig0d", - "9000bowser", "Sovereignty89", "Kris1432", "xander_cage_", "samuraijp", "bsaa", "SpwnX", "tworf", "Kadah", "kanni", - "Stute", "Hegik", "Onlyme", "t3hero", "Hotchi", "jagoly", "Nullav", "BH5432", "Sibmer", "inceee", - "foxxx0", "Hartok", "TMSama", "Shlnen", "Carsso", "zessirb", "meep310", "Seldron", "yttr1um", "hohounk", - "freebug", "Sylphio", "jmarler", "Saberawr", "r00teniy", "Neonbeta", "yinscape", "voooon24", "Quintine", "peach774", - "lepthymo", "bildeman", "Kremnari", "Aerosalo", "OndraSter", "oscares91", "mr10movie", "Daxx367x2", "EGERTRONx", "aka13_404", - "Abouttabs", "Johnstaal", "djshiny99", "megatronp", "DZCreeper", "Kane_Hart", "Truculent", "vidplace7", "simon6689", "MomoNasty", - "UnknownXLV", "goreacraft", "Fluttermine", "Daddy_Cecil", "MrMaleficus", "TigersFangs", "cublikefoot", "chainman564", "NikitaBuker", "Misha999777", - "25FiveDetail", "AntiCivilBoy", "michaelbrady", "xXxIceFirexXx", "Speedynutty68", "GarretSidzaka", "HallowCharm977", "mastermind1919", "The_Hypersonic", "diamondguy2798", - "zF4ll3nPr3d4t0r", "CrafterOfMines57", "XxELIT3xSNIP3RxX", "SuterusuKusanagi", "xavier0014", "adamros", "alexbegt" + "renadi", "hanakocz", "MysteryDump", "Flaver4", "x_Fame", "Peluche321", "Goshen_Ithilien", "manf", "Bimgo", + "leagris", + "IAmMinecrafter02", "Cerous", "Devilin_Pixy", "Bkarlsson87", "BadAlchemy", "CaballoCraft", "melanclock", + "Resursator", "demanzke", "AndrewAmmerlaan", + "Deathlycraft", "Jirajha", "Axlegear", "kei_kouma", "Dracion", "dungi", "Dorfschwein", "Zero Tw0", + "mattiagraz85", "sebastiank30", + "Plem", "invultri", "grillo126", "malcanteth", "Malevolence_", "Nicholas_Manuel", "Sirbab", "kehaan", + "bpgames123", "semig0d", + "9000bowser", "Sovereignty89", "Kris1432", "xander_cage_", "samuraijp", "bsaa", "SpwnX", "tworf", "Kadah", + "kanni", + "Stute", "Hegik", "Onlyme", "t3hero", "Hotchi", "jagoly", "Nullav", "BH5432", "Sibmer", "inceee", + "foxxx0", "Hartok", "TMSama", "Shlnen", "Carsso", "zessirb", "meep310", "Seldron", "yttr1um", "hohounk", + "freebug", "Sylphio", "jmarler", "Saberawr", "r00teniy", "Neonbeta", "yinscape", "voooon24", "Quintine", + "peach774", + "lepthymo", "bildeman", "Kremnari", "Aerosalo", "OndraSter", "oscares91", "mr10movie", "Daxx367x2", + "EGERTRONx", "aka13_404", + "Abouttabs", "Johnstaal", "djshiny99", "megatronp", "DZCreeper", "Kane_Hart", "Truculent", "vidplace7", + "simon6689", "MomoNasty", + "UnknownXLV", "goreacraft", "Fluttermine", "Daddy_Cecil", "MrMaleficus", "TigersFangs", "cublikefoot", + "chainman564", "NikitaBuker", "Misha999777", + "25FiveDetail", "AntiCivilBoy", "michaelbrady", "xXxIceFirexXx", "Speedynutty68", "GarretSidzaka", + "HallowCharm977", "mastermind1919", "The_Hypersonic", "diamondguy2798", + "zF4ll3nPr3d4t0r", "CrafterOfMines57", "XxELIT3xSNIP3RxX", "SuterusuKusanagi", "xavier0014", "adamros", + "alexbegt" }; for (String tName : arr) { mCapeList.add(tName.toLowerCase()); @@ -449,12 +578,11 @@ public class GT_Client extends GT_Proxy try { for (int i = 1; i < GregTech_API.METATILEENTITIES.length; i++) { try { - if (GregTech_API.METATILEENTITIES[i] != null) { + if (GregTech_API.METATILEENTITIES[i] != null) { GregTech_API.METATILEENTITIES[i].getStackForm(1L).getTooltip(null, true); GT_Log.out.println("META " + i + " " + GregTech_API.METATILEENTITIES[i].getMetaName()); } - } - catch (Throwable e) { + } catch (Throwable e) { e.printStackTrace(GT_Log.err); } } @@ -463,10 +591,9 @@ public class GT_Client extends GT_Proxy } if (Loader.isModLoaded("Avaritia")) { - CosmicItemRendererGT.registerItemWithMeta(Item.getItemFromBlock( GregTech_API.sBlockCasings5), 14); + CosmicItemRendererGT.registerItemWithMeta(Item.getItemFromBlock(GregTech_API.sBlockCasings5), 14); CosmicItemRendererGT.init(); } - } @Override @@ -520,13 +647,38 @@ public class GT_Client extends GT_Proxy mFirstTick = false; GT_Values.NW.sendToServer(new GT_Packet_ClientPreference(mPreference)); - if(!Minecraft.getMinecraft().isSingleplayer()) { - //Check for more IC2 recipes to also catch MineTweaker additions - GT_ModHandler.addIC2RecipesToGT(GT_ModHandler.getMaceratorRecipeList(), GT_Recipe.GT_Recipe_Map.sMaceratorRecipes, true, true, true); - GT_ModHandler.addIC2RecipesToGT(GT_ModHandler.getCompressorRecipeList(), GT_Recipe.GT_Recipe_Map.sCompressorRecipes, true, true, true); - GT_ModHandler.addIC2RecipesToGT(GT_ModHandler.getExtractorRecipeList(), GT_Recipe.GT_Recipe_Map.sExtractorRecipes, true, true, true); - GT_ModHandler.addIC2RecipesToGT(GT_ModHandler.getOreWashingRecipeList(), GT_Recipe.GT_Recipe_Map.sOreWasherRecipes, false, true, true); - GT_ModHandler.addIC2RecipesToGT(GT_ModHandler.getThermalCentrifugeRecipeList(), GT_Recipe.GT_Recipe_Map.sThermalCentrifugeRecipes, true, true, true); + if (!Minecraft.getMinecraft().isSingleplayer()) { + // Check for more IC2 recipes to also catch MineTweaker additions + GT_ModHandler.addIC2RecipesToGT( + GT_ModHandler.getMaceratorRecipeList(), + GT_Recipe.GT_Recipe_Map.sMaceratorRecipes, + true, + true, + true); + GT_ModHandler.addIC2RecipesToGT( + GT_ModHandler.getCompressorRecipeList(), + GT_Recipe.GT_Recipe_Map.sCompressorRecipes, + true, + true, + true); + GT_ModHandler.addIC2RecipesToGT( + GT_ModHandler.getExtractorRecipeList(), + GT_Recipe.GT_Recipe_Map.sExtractorRecipes, + true, + true, + true); + GT_ModHandler.addIC2RecipesToGT( + GT_ModHandler.getOreWashingRecipeList(), + GT_Recipe.GT_Recipe_Map.sOreWasherRecipes, + false, + true, + true); + GT_ModHandler.addIC2RecipesToGT( + GT_ModHandler.getThermalCentrifugeRecipeList(), + GT_Recipe.GT_Recipe_Map.sThermalCentrifugeRecipes, + true, + true, + true); } } afterSomeTime++; @@ -535,12 +687,16 @@ public class GT_Client extends GT_Proxy StatFileWriter sfw = Minecraft.getMinecraft().thePlayer.getStatFileWriter(); try { for (GT_Recipe recipe : GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.mRecipeList) { - recipe.mHidden = GT_Values.hideAssLineRecipes && !sfw.hasAchievementUnlocked(GT_Mod.achievements.getAchievement(recipe.getOutput(0).getUnlocalizedName())); + recipe.mHidden = GT_Values.hideAssLineRecipes + && !sfw.hasAchievementUnlocked(GT_Mod.achievements.getAchievement( + recipe.getOutput(0).getUnlocalizedName())); } } catch (Exception ignored) { } } - for (Iterator<Map.Entry<GT_PlayedSound, Integer>> iterator = GT_Utility.sPlayedSoundMap.entrySet().iterator(); iterator.hasNext(); ) { + for (Iterator<Map.Entry<GT_PlayedSound, Integer>> iterator = + GT_Utility.sPlayedSoundMap.entrySet().iterator(); + iterator.hasNext(); ) { Map.Entry<GT_PlayedSound, Integer> tEntry = iterator.next(); if (tEntry.getValue() < 0) { iterator.remove(); @@ -551,18 +707,22 @@ public class GT_Client extends GT_Proxy if (!GregTech_API.mServerStarted) GregTech_API.mServerStarted = true; if (GT_Values.updateFluidDisplayItems) { final MovingObjectPosition trace = Minecraft.getMinecraft().objectMouseOver; - if (trace != null && trace.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK && - (mLastUpdatedBlockX != trace.blockX && - mLastUpdatedBlockY != trace.blockY && - mLastUpdatedBlockZ != trace.blockZ || afterSomeTime % 10 == 0)) { + if (trace != null + && trace.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK + && (mLastUpdatedBlockX != trace.blockX + && mLastUpdatedBlockY != trace.blockY + && mLastUpdatedBlockZ != trace.blockZ + || afterSomeTime % 10 == 0)) { mLastUpdatedBlockX = trace.blockX; mLastUpdatedBlockY = trace.blockY; mLastUpdatedBlockZ = trace.blockZ; - final TileEntity tileEntity = aEvent.player.worldObj.getTileEntity(trace.blockX, trace.blockY, trace.blockZ); + final TileEntity tileEntity = + aEvent.player.worldObj.getTileEntity(trace.blockX, trace.blockY, trace.blockZ); if (tileEntity instanceof IGregTechTileEntity) { final IGregTechTileEntity gtTile = (IGregTechTileEntity) tileEntity; if (gtTile.getMetaTileEntity() instanceof IHasFluidDisplayItem) { - GT_Values.NW.sendToServer(new MessageUpdateFluidDisplayItem(trace.blockX, trace.blockY, trace.blockZ, gtTile.getWorld().provider.dimensionId)); + GT_Values.NW.sendToServer(new MessageUpdateFluidDisplayItem( + trace.blockX, trace.blockY, trace.blockZ, gtTile.getWorld().provider.dimensionId)); } } } @@ -577,35 +737,36 @@ public class GT_Client extends GT_Proxy // refresh client preference and send to server, since it's the only config we allow changing at runtime. mPreference = new GT_ClientPreference(GregTech_API.sClientDataFile); GT_PreLoad.loadClientConfig(); - if (e.isWorldRunning) - GT_Values.NW.sendToServer(new GT_Packet_ClientPreference(mPreference)); + if (e.isWorldRunning) GT_Values.NW.sendToServer(new GT_Packet_ClientPreference(mPreference)); } } @SubscribeEvent public void onDrawBlockHighlight(DrawBlockHighlightEvent aEvent) { - final Block aBlock = aEvent.player.worldObj.getBlock(aEvent.target.blockX, aEvent.target.blockY, aEvent.target.blockZ); - final TileEntity aTileEntity = aEvent.player.worldObj.getTileEntity(aEvent.target.blockX, aEvent.target.blockY, aEvent.target.blockZ); + final Block aBlock = + aEvent.player.worldObj.getBlock(aEvent.target.blockX, aEvent.target.blockY, aEvent.target.blockZ); + final TileEntity aTileEntity = + aEvent.player.worldObj.getTileEntity(aEvent.target.blockX, aEvent.target.blockY, aEvent.target.blockZ); if (GT_Utility.isStackInList(aEvent.currentItem, GregTech_API.sWrenchList)) { - if (aTileEntity instanceof ITurnable || ROTATABLE_VANILLA_BLOCKS.contains(aBlock) || aTileEntity instanceof IWrenchable) - drawGrid(aEvent, false, true, aEvent.player.isSneaking()); + if (aTileEntity instanceof ITurnable + || ROTATABLE_VANILLA_BLOCKS.contains(aBlock) + || aTileEntity instanceof IWrenchable) drawGrid(aEvent, false, true, aEvent.player.isSneaking()); return; } - if (!(aTileEntity instanceof ICoverable)) - return; + if (!(aTileEntity instanceof ICoverable)) return; - if (GT_Utility.isStackInList(aEvent.currentItem, GregTech_API.sWireCutterList) || - GT_Utility.isStackInList(aEvent.currentItem, GregTech_API.sSolderingToolList)) { + if (GT_Utility.isStackInList(aEvent.currentItem, GregTech_API.sWireCutterList) + || GT_Utility.isStackInList(aEvent.currentItem, GregTech_API.sSolderingToolList)) { if (((ICoverable) aTileEntity).getCoverIDAtSide((byte) aEvent.target.sideHit) == 0) drawGrid(aEvent, false, false, aEvent.player.isSneaking()); return; } - if ((aEvent.currentItem == null && aEvent.player.isSneaking()) || - GT_Utility.isStackInList(aEvent.currentItem, GregTech_API.sCrowbarList) || - GT_Utility.isStackInList(aEvent.currentItem, GregTech_API.sScrewdriverList)) { + if ((aEvent.currentItem == null && aEvent.player.isSneaking()) + || GT_Utility.isStackInList(aEvent.currentItem, GregTech_API.sCrowbarList) + || GT_Utility.isStackInList(aEvent.currentItem, GregTech_API.sScrewdriverList)) { if (((ICoverable) aTileEntity).getCoverIDAtSide((byte) aEvent.target.sideHit) == 0) for (byte i = 0; i < 6; i++) if (((ICoverable) aTileEntity).getCoverIDAtSide(i) > 0) { @@ -710,7 +871,6 @@ public class GT_Client extends GT_Proxy for (Materials tMaterial : mMoltenNegA) { tMaterial.mMoltenRGBa[3] = getSafeRGBValue(tMaterial.mMoltenRGBa[3], -tDirection); } - } } @@ -723,14 +883,12 @@ public class GT_Client extends GT_Proxy @Override public void doSonictronSound(ItemStack aStack, World aWorld, double aX, double aY, double aZ) { - if (GT_Utility.isStackInvalid(aStack)) - return; + if (GT_Utility.isStackInvalid(aStack)) return; String tString = SoundResource.NOTE_HARP.toString(); int i = 0; int j = mSoundItems.size(); do { - if (i >= j) - break; + if (i >= j) break; if (GT_Utility.areStacksEqual(mSoundItems.get(i), aStack)) { tString = mSoundNames.get(i); break; @@ -738,10 +896,8 @@ public class GT_Client extends GT_Proxy i++; } while (true); if (tString.startsWith(SoundResource.RANDOM_EXPLODE.toString())) - if (aStack.stackSize == 3) - tString = SoundResource.RANDOM_FUSE.toString(); - else if (aStack.stackSize == 2) - tString = "random.old_explode"; + if (aStack.stackSize == 3) tString = SoundResource.RANDOM_FUSE.toString(); + else if (aStack.stackSize == 2) tString = "random.old_explode"; if (tString.startsWith("streaming.")) switch (aStack.stackSize) { case 1: // '\001' @@ -804,7 +960,10 @@ public class GT_Client extends GT_Proxy } else { new WorldSpawnedEventBuilder.SoundEventBuilder() .setVolume(3f) - .setPitch(tString.startsWith("note.") ? (float) Math.pow(2D, (double) (aStack.stackSize - 13) / 12D) : 1.0F) + .setPitch( + tString.startsWith("note.") + ? (float) Math.pow(2D, (double) (aStack.stackSize - 13) / 12D) + : 1.0F) .setIdentifier(tString) .setPosition(aX, aY, aZ) .run(); diff --git a/src/main/java/gregtech/common/GT_DummyWorld.java b/src/main/java/gregtech/common/GT_DummyWorld.java index 756e35863f..cfc89c9df6 100644 --- a/src/main/java/gregtech/common/GT_DummyWorld.java +++ b/src/main/java/gregtech/common/GT_DummyWorld.java @@ -1,5 +1,6 @@ package gregtech.common; +import java.io.File; import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.init.Blocks; @@ -16,67 +17,69 @@ import net.minecraft.world.storage.IPlayerFileData; import net.minecraft.world.storage.ISaveHandler; import net.minecraft.world.storage.WorldInfo; -import java.io.File; - public class GT_DummyWorld extends World { public GT_IteratorRandom mRandom = new GT_IteratorRandom(); public ItemStack mLastSetBlock = null; - public GT_DummyWorld(ISaveHandler saveHandler, String name, WorldProvider worldProvider, WorldSettings worldSettings, Profiler profiler) { + public GT_DummyWorld( + ISaveHandler saveHandler, + String name, + WorldProvider worldProvider, + WorldSettings worldSettings, + Profiler profiler) { super(saveHandler, name, worldSettings, worldProvider, profiler); this.rand = this.mRandom; } public GT_DummyWorld() { - this(new ISaveHandler() { - @Override - public void saveWorldInfoWithPlayer(WorldInfo worldInfo, NBTTagCompound nbtTagCompound) { - } - - @Override - public void saveWorldInfo(WorldInfo worldInfo) { - } - - @Override - public WorldInfo loadWorldInfo() { - return null; - } - - @Override - public IPlayerFileData getSaveHandler() { - return null; - } - - @Override - public File getMapFileFromName(String mapName) { - return null; - } - - @Override - public IChunkLoader getChunkLoader(WorldProvider worldProvider) { - return null; - } - - @Override - public void flush() { - } - - @Override - public void checkSessionLock() { - } - - @Override - public String getWorldDirectoryName() { - return null; - } - - @Override - public File getWorldDirectory() { - return null; - } - }, "DUMMY_DIMENSION", null, - - new WorldSettings(new WorldInfo(new NBTTagCompound())), new Profiler()); + this( + new ISaveHandler() { + @Override + public void saveWorldInfoWithPlayer(WorldInfo worldInfo, NBTTagCompound nbtTagCompound) {} + + @Override + public void saveWorldInfo(WorldInfo worldInfo) {} + + @Override + public WorldInfo loadWorldInfo() { + return null; + } + + @Override + public IPlayerFileData getSaveHandler() { + return null; + } + + @Override + public File getMapFileFromName(String mapName) { + return null; + } + + @Override + public IChunkLoader getChunkLoader(WorldProvider worldProvider) { + return null; + } + + @Override + public void flush() {} + + @Override + public void checkSessionLock() {} + + @Override + public String getWorldDirectoryName() { + return null; + } + + @Override + public File getWorldDirectory() { + return null; + } + }, + "DUMMY_DIMENSION", + null, + new WorldSettings(new WorldInfo(new NBTTagCompound())), + new Profiler()); } @Override diff --git a/src/main/java/gregtech/common/GT_Network.java b/src/main/java/gregtech/common/GT_Network.java index 8db38d86f7..39f50a9e04 100644 --- a/src/main/java/gregtech/common/GT_Network.java +++ b/src/main/java/gregtech/common/GT_Network.java @@ -1,5 +1,7 @@ package gregtech.common; +import static gregtech.GT_Mod.GT_FML_LOGGER; + import com.google.common.io.ByteArrayDataInput; import com.google.common.io.ByteStreams; import cpw.mods.fml.common.network.FMLEmbeddedChannel; @@ -18,16 +20,13 @@ import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.SimpleChannelInboundHandler; import io.netty.handler.codec.MessageToMessageCodec; +import java.util.EnumMap; +import java.util.List; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.world.World; import net.minecraft.world.chunk.Chunk; -import java.util.EnumMap; -import java.util.List; - -import static gregtech.GT_Mod.GT_FML_LOGGER; - @ChannelHandler.Sharable @SuppressWarnings("deprecation") public class GT_Network extends MessageToMessageCodec<FMLProxyPacket, GT_Packet> implements IGT_NetworkHandler { @@ -35,49 +34,49 @@ public class GT_Network extends MessageToMessageCodec<FMLProxyPacket, GT_Packet> private final GT_Packet[] mSubChannels; public GT_Network() { - this("GregTech", - new GT_Packet_TileEntity(), - new GT_Packet_Sound(), - new GT_Packet_Block_Event(), - new GT_Packet_Ores(), - new GT_Packet_Pollution(), - new MessageSetFlaskCapacity(), - new GT_Packet_TileEntityCover(), - new GT_Packet_TileEntityCoverGUI(), - new MessageUpdateFluidDisplayItem(), - new GT_Packet_ClientPreference(), - new GT_Packet_WirelessRedstoneCover(), - new GT_Packet_TileEntityCoverNew(), - new GT_Packet_SetConfigurationCircuit(), - new GT_Packet_UpdateItem(), - new GT_Packet_SetLockedFluid(), - new GT_Packet_GtTileEntityGuiRequest(), - new GT_Packet_SendCoverData(), - new GT_Packet_RequestCoverData() - ); + this( + "GregTech", + new GT_Packet_TileEntity(), + new GT_Packet_Sound(), + new GT_Packet_Block_Event(), + new GT_Packet_Ores(), + new GT_Packet_Pollution(), + new MessageSetFlaskCapacity(), + new GT_Packet_TileEntityCover(), + new GT_Packet_TileEntityCoverGUI(), + new MessageUpdateFluidDisplayItem(), + new GT_Packet_ClientPreference(), + new GT_Packet_WirelessRedstoneCover(), + new GT_Packet_TileEntityCoverNew(), + new GT_Packet_SetConfigurationCircuit(), + new GT_Packet_UpdateItem(), + new GT_Packet_SetLockedFluid(), + new GT_Packet_GtTileEntityGuiRequest(), + new GT_Packet_SendCoverData(), + new GT_Packet_RequestCoverData()); } - + public GT_Network(String channelName, GT_Packet... packetTypes) { this.mChannel = NetworkRegistry.INSTANCE.newChannel(channelName, this, new HandlerShared()); this.mSubChannels = new GT_Packet[packetTypes.length]; for (GT_Packet packetType : packetTypes) { final int pId = packetType.getPacketID(); - if (this.mSubChannels[pId] == null) - this.mSubChannels[pId] = packetType; - else - throw new IllegalArgumentException("Duplicate Packet ID! " + pId); + if (this.mSubChannels[pId] == null) this.mSubChannels[pId] = packetType; + else throw new IllegalArgumentException("Duplicate Packet ID! " + pId); } } - + @Override protected void encode(ChannelHandlerContext aContext, GT_Packet aPacket, List<Object> aOutput) throws Exception { ByteBuf tBuf = Unpooled.buffer().writeByte(aPacket.getPacketID()); aPacket.encode(tBuf); - aOutput.add(new FMLProxyPacket(tBuf, aContext.channel().attr(NetworkRegistry.FML_CHANNEL).get())); + aOutput.add(new FMLProxyPacket( + tBuf, aContext.channel().attr(NetworkRegistry.FML_CHANNEL).get())); } @Override - protected void decode(ChannelHandlerContext aContext, FMLProxyPacket aPacket, List<Object> aOutput) throws Exception { + protected void decode(ChannelHandlerContext aContext, FMLProxyPacket aPacket, List<Object> aOutput) + throws Exception { ByteArrayDataInput aData = ByteStreams.newDataInput(aPacket.payload().array()); GT_Packet tPacket = this.mSubChannels[aData.readByte()].decode(aData); tPacket.setINetHandler(aPacket.handler()); @@ -94,21 +93,36 @@ public class GT_Network extends MessageToMessageCodec<FMLProxyPacket, GT_Packet> GT_FML_LOGGER.info("player null"); return; } - this.mChannel.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.PLAYER); - this.mChannel.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(aPlayer); + this.mChannel + .get(Side.SERVER) + .attr(FMLOutboundHandler.FML_MESSAGETARGET) + .set(FMLOutboundHandler.OutboundTarget.PLAYER); + this.mChannel + .get(Side.SERVER) + .attr(FMLOutboundHandler.FML_MESSAGETARGETARGS) + .set(aPlayer); this.mChannel.get(Side.SERVER).writeAndFlush(aPacket); } @Override public void sendToAllAround(GT_Packet aPacket, NetworkRegistry.TargetPoint aPosition) { - this.mChannel.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.ALLAROUNDPOINT); - this.mChannel.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(aPosition); + this.mChannel + .get(Side.SERVER) + .attr(FMLOutboundHandler.FML_MESSAGETARGET) + .set(FMLOutboundHandler.OutboundTarget.ALLAROUNDPOINT); + this.mChannel + .get(Side.SERVER) + .attr(FMLOutboundHandler.FML_MESSAGETARGETARGS) + .set(aPosition); this.mChannel.get(Side.SERVER).writeAndFlush(aPacket); } @Override public void sendToServer(GT_Packet aPacket) { - this.mChannel.get(Side.CLIENT).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.TOSERVER); + this.mChannel + .get(Side.CLIENT) + .attr(FMLOutboundHandler.FML_MESSAGETARGET) + .set(FMLOutboundHandler.OutboundTarget.TOSERVER); this.mChannel.get(Side.CLIENT).writeAndFlush(aPacket); } @@ -121,7 +135,9 @@ public class GT_Network extends MessageToMessageCodec<FMLProxyPacket, GT_Packet> } EntityPlayerMP tPlayer = (EntityPlayerMP) tObject; Chunk tChunk = aWorld.getChunkFromBlockCoords(aX, aZ); - if (tPlayer.getServerForPlayer().getPlayerManager().isPlayerWatchingChunk(tPlayer, tChunk.xPosition, tChunk.zPosition)) { + if (tPlayer.getServerForPlayer() + .getPlayerManager() + .isPlayerWatchingChunk(tPlayer, tChunk.xPosition, tChunk.zPosition)) { sendToPlayer(aPacket, tPlayer); } } diff --git a/src/main/java/gregtech/common/GT_PlayerActivityLogger.java b/src/main/java/gregtech/common/GT_PlayerActivityLogger.java index c6b9cb60d2..49ddb9dc23 100644 --- a/src/main/java/gregtech/common/GT_PlayerActivityLogger.java +++ b/src/main/java/gregtech/common/GT_PlayerActivityLogger.java @@ -2,7 +2,6 @@ package gregtech.common; import gregtech.GT_Mod; import gregtech.api.util.GT_Log; - import java.util.ArrayList; public class GT_PlayerActivityLogger implements Runnable { diff --git a/src/main/java/gregtech/common/GT_Pollution.java b/src/main/java/gregtech/common/GT_Pollution.java index 49b33fb1cb..4d726a2a46 100644 --- a/src/main/java/gregtech/common/GT_Pollution.java +++ b/src/main/java/gregtech/common/GT_Pollution.java @@ -1,5 +1,8 @@ package gregtech.common; +import static gregtech.api.objects.XSTR.XSTR_INSTANCE; +import static gregtech.common.GT_Proxy.dimensionWisePollution; + import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.TickEvent; import cpw.mods.fml.common.network.NetworkRegistry; @@ -13,6 +16,16 @@ import gregtech.api.util.GT_ChunkAssociatedData; import gregtech.api.util.GT_Utility; import gregtech.common.render.GT_PollutionRenderer; import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_Cleanroom; +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.function.Consumer; +import javax.annotation.Nullable; +import javax.annotation.ParametersAreNonnullByDefault; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.EntityLivingBase; @@ -31,445 +44,455 @@ import net.minecraftforge.event.world.ChunkDataEvent; import net.minecraftforge.event.world.ChunkWatchEvent; import net.minecraftforge.event.world.WorldEvent; -import javax.annotation.Nullable; -import javax.annotation.ParametersAreNonnullByDefault; -import java.io.DataInput; -import java.io.DataOutput; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import java.util.function.Consumer; +public class GT_Pollution { + private static final Storage STORAGE = new Storage(); + /** + * Pollution dispersion until effects start: + * Calculation: ((Limit * 0.01) + 2000) * (4 <- spreading rate) + * <p> + * SMOG(500k) 466.7 pollution/sec + * Poison(750k) 633,3 pollution/sec + * Dying Plants(1mio) 800 pollution/sec + * Sour Rain(1.5mio) 1133.3 pollution/sec + * <p> + * Pollution producers (pollution/sec) + * Bronze Boiler(20) + * Lava Boiler(20) + * High Pressure Boiler(20) + * Bronze Blast Furnace(50) + * Diesel Generator(40/80/160) + * Gas Turbine(20/40/80) + * Charcoal Pile(100) + * <p> + * Large Diesel Engine(320) + * Electric Blast Furnace(100) + * Implosion Compressor(2000) + * Large Boiler(240) + * Large Gas Turbine(160) + * Multi Smelter(100) + * Pyrolyse Oven(400) + * <p> + * Machine Explosion(100,000) + * <p> + * Other Random Shit: lots and lots + * <p> + * Muffler Hatch Pollution reduction: ** inaccurate ** + * LV (0%), MV (30%), HV (52%), EV (66%), IV (76%), LuV (84%), ZPM (89%), UV (92%), MAX (95%) + */ + private List<ChunkCoordIntPair> pollutionList = new ArrayList<>(); // chunks left to process in this cycle + + private final Set<ChunkCoordIntPair> pollutedChunks = + new HashSet<>(); // a global list of all chunks with positive pollution + private int operationsPerTick = 0; // how much chunks should be processed in each cycle + private static final short cycleLen = 1200; + private final World world; + private boolean blank = true; + public static int mPlayerPollution; + + private static int POLLUTIONPACKET_MINVALUE = 1000; + + private static GT_PollutionEventHandler EVENT_HANDLER; + + public GT_Pollution(World world) { + this.world = world; + + if (EVENT_HANDLER == null) { + EVENT_HANDLER = new GT_PollutionEventHandler(); + MinecraftForge.EVENT_BUS.register(EVENT_HANDLER); + } + } + + public static void onWorldTick(TickEvent.WorldTickEvent aEvent) { // called from proxy + // return if pollution disabled + if (!GT_Mod.gregtechproxy.mPollution) return; + if (aEvent.phase == TickEvent.Phase.START) return; + final GT_Pollution pollutionInstance = dimensionWisePollution.get(aEvent.world.provider.dimensionId); + if (pollutionInstance == null) return; + pollutionInstance.tickPollutionInWorld((int) (aEvent.world.getTotalWorldTime() % cycleLen)); + } + + private void tickPollutionInWorld(int aTickID) { // called from method above + // gen data set + if (aTickID == 0 || blank) { + // make a snapshot of what to work on + pollutionList = new ArrayList<>(pollutedChunks); + // set operations per tick + if (pollutionList.size() > 0) operationsPerTick = Math.max(1, pollutionList.size() / cycleLen); + else operationsPerTick = 0; // SANity + blank = false; + } -import static gregtech.api.objects.XSTR.XSTR_INSTANCE; -import static gregtech.common.GT_Proxy.dimensionWisePollution; + for (int chunksProcessed = 0; chunksProcessed < operationsPerTick; chunksProcessed++) { + if (pollutionList.size() == 0) break; // no more stuff to do + ChunkCoordIntPair actualPos = pollutionList.remove(pollutionList.size() - 1); // faster + // get pollution + ChunkData currentData = STORAGE.get(world, actualPos); + int tPollution = currentData.getAmount(); + // remove some + tPollution = (int) (0.9945f * tPollution); + + if (tPollution > 400000) { // Spread Pollution + + ChunkCoordIntPair[] tNeighbors = new ChunkCoordIntPair[4]; // array is faster + tNeighbors[0] = (new ChunkCoordIntPair(actualPos.chunkXPos + 1, actualPos.chunkZPos)); + tNeighbors[1] = (new ChunkCoordIntPair(actualPos.chunkXPos - 1, actualPos.chunkZPos)); + tNeighbors[2] = (new ChunkCoordIntPair(actualPos.chunkXPos, actualPos.chunkZPos + 1)); + tNeighbors[3] = (new ChunkCoordIntPair(actualPos.chunkXPos, actualPos.chunkZPos - 1)); + for (ChunkCoordIntPair neighborPosition : tNeighbors) { + ChunkData neighbor = STORAGE.get(world, neighborPosition); + int neighborPollution = neighbor.getAmount(); + if (neighborPollution * 6 < tPollution * 5) { // MATHEMATICS... + int tDiff = tPollution - neighborPollution; + tDiff = tDiff / 20; + neighborPollution = GT_Utility.safeInt((long) neighborPollution + tDiff); // tNPol += tDiff; + tPollution -= tDiff; + setChunkPollution(neighborPosition, neighborPollution); + } + } + + // Create Pollution effects + // Smog filter TODO + if (tPollution > GT_Mod.gregtechproxy.mPollutionSmogLimit) { + AxisAlignedBB chunk = AxisAlignedBB.getBoundingBox( + actualPos.chunkXPos << 4, + 0, + actualPos.chunkZPos << 4, + (actualPos.chunkXPos << 4) + 16, + 256, + (actualPos.chunkZPos << 4) + 16); + List<EntityLivingBase> tEntitys = world.getEntitiesWithinAABB(EntityLivingBase.class, chunk); + for (EntityLivingBase tEnt : tEntitys) { + if (tEnt instanceof EntityPlayerMP && ((EntityPlayerMP) tEnt).capabilities.isCreativeMode) + continue; + if (!(GT_Utility.isWearingFullGasHazmat(tEnt))) { + switch (XSTR_INSTANCE.nextInt(3)) { + default: + tEnt.addPotionEffect(new PotionEffect( + Potion.digSlowdown.id, + Math.min(tPollution / 1000, 1000), + tPollution / 400000)); + case 1: + tEnt.addPotionEffect(new PotionEffect( + Potion.weakness.id, + Math.min(tPollution / 1000, 1000), + tPollution / 400000)); + case 2: + tEnt.addPotionEffect(new PotionEffect( + Potion.moveSlowdown.id, + Math.min(tPollution / 1000, 1000), + tPollution / 400000)); + } + } + } + + // Poison effects + if (tPollution > GT_Mod.gregtechproxy.mPollutionPoisonLimit) { + // AxisAlignedBB chunk = AxisAlignedBB.getBoundingBox(tPos.chunkPosX*16, 0, tPos.chunkPosZ*16, + // tPos.chunkPosX*16+16, 256, tPos.chunkPosZ*16+16); + // List<EntityLiving> tEntitys = aWorld.getEntitiesWithinAABB(EntityLiving.class, chunk); + for (EntityLivingBase tEnt : tEntitys) { + if (tEnt instanceof EntityPlayerMP && ((EntityPlayerMP) tEnt).capabilities.isCreativeMode) + continue; + if (!GT_Utility.isWearingFullGasHazmat(tEnt)) { + switch (XSTR_INSTANCE.nextInt(4)) { + default: + tEnt.addPotionEffect(new PotionEffect(Potion.hunger.id, tPollution / 500000)); + case 1: + tEnt.addPotionEffect(new PotionEffect( + Potion.confusion.id, Math.min(tPollution / 2000, 1000), 1)); + case 2: + tEnt.addPotionEffect(new PotionEffect( + Potion.poison.id, + Math.min(tPollution / 4000, 1000), + tPollution / 500000)); + case 3: + tEnt.addPotionEffect(new PotionEffect( + Potion.blindness.id, Math.min(tPollution / 2000, 1000), 1)); + } + } + } + + // killing plants + if (tPollution > GT_Mod.gregtechproxy.mPollutionVegetationLimit) { + int f = 20; + for (; f < (tPollution / 25000); f++) { + int x = (actualPos.chunkXPos << 4) + XSTR_INSTANCE.nextInt(16); + int y = 60 + (-f + XSTR_INSTANCE.nextInt(f * 2 + 1)); + int z = (actualPos.chunkZPos << 4) + XSTR_INSTANCE.nextInt(16); + damageBlock(world, x, y, z, tPollution > GT_Mod.gregtechproxy.mPollutionSourRainLimit); + } + } + } + } + } + // Write new pollution to Hashmap !!! + setChunkPollution(actualPos, tPollution); + + // Send new value to players nearby + if (tPollution > POLLUTIONPACKET_MINVALUE) { + NetworkRegistry.TargetPoint point = new NetworkRegistry.TargetPoint( + world.provider.dimensionId, (actualPos.chunkXPos << 4), 64, (actualPos.chunkZPos << 4), 256); + GT_Values.NW.sendToAllAround(new GT_Packet_Pollution(actualPos, tPollution), point); + } + } + } + + private void setChunkPollution(ChunkCoordIntPair coord, int pollution) { + mutatePollution(world, coord.chunkXPos, coord.chunkZPos, c -> c.setAmount(pollution), pollutedChunks); + } + + private static void damageBlock(World world, int x, int y, int z, boolean sourRain) { + if (world.isRemote) return; + Block tBlock = world.getBlock(x, y, z); + int tMeta = world.getBlockMetadata(x, y, z); + if (tBlock == Blocks.air || tBlock == Blocks.stone || tBlock == Blocks.sand || tBlock == Blocks.deadbush) + return; + + if (tBlock == Blocks.leaves || tBlock == Blocks.leaves2 || tBlock.getMaterial() == Material.leaves) + world.setBlockToAir(x, y, z); + if (tBlock == Blocks.reeds) { + tBlock.dropBlockAsItem(world, x, y, z, tMeta, 0); + world.setBlockToAir(x, y, z); + } + if (tBlock == Blocks.tallgrass) world.setBlock(x, y, z, Blocks.deadbush); + if (tBlock == Blocks.vine) { + tBlock.dropBlockAsItem(world, x, y, z, tMeta, 0); + world.setBlockToAir(x, y, z); + } + if (tBlock == Blocks.waterlily + || tBlock == Blocks.wheat + || tBlock == Blocks.cactus + || tBlock.getMaterial() == Material.cactus + || tBlock == Blocks.melon_block + || tBlock == Blocks.melon_stem) { + tBlock.dropBlockAsItem(world, x, y, z, tMeta, 0); + world.setBlockToAir(x, y, z); + } + if (tBlock == Blocks.red_flower + || tBlock == Blocks.yellow_flower + || tBlock == Blocks.carrots + || tBlock == Blocks.potatoes + || tBlock == Blocks.pumpkin + || tBlock == Blocks.pumpkin_stem) { + tBlock.dropBlockAsItem(world, x, y, z, tMeta, 0); + world.setBlockToAir(x, y, z); + } + if (tBlock == Blocks.sapling || tBlock.getMaterial() == Material.plants) + world.setBlock(x, y, z, Blocks.deadbush); + if (tBlock == Blocks.cocoa) { + tBlock.dropBlockAsItem(world, x, y, z, tMeta, 0); + world.setBlockToAir(x, y, z); + } + if (tBlock == Blocks.mossy_cobblestone) world.setBlock(x, y, z, Blocks.cobblestone); + if (tBlock == Blocks.grass || tBlock.getMaterial() == Material.grass) world.setBlock(x, y, z, Blocks.dirt); + if (tBlock == Blocks.farmland || tBlock == Blocks.dirt) { + world.setBlock(x, y, z, Blocks.sand); + } + + if (sourRain + && world.isRaining() + && (tBlock == Blocks.stone || tBlock == Blocks.gravel || tBlock == Blocks.cobblestone) + && world.getBlock(x, y + 1, z) == Blocks.air + && world.canBlockSeeTheSky(x, y, z)) { + if (tBlock == Blocks.stone) { + world.setBlock(x, y, z, Blocks.cobblestone); + } else if (tBlock == Blocks.cobblestone) { + world.setBlock(x, y, z, Blocks.gravel); + } else if (tBlock == Blocks.gravel) { + world.setBlock(x, y, z, Blocks.sand); + } + } + } + private static GT_Pollution getPollutionManager(World world) { + return dimensionWisePollution.computeIfAbsent(world.provider.dimensionId, i -> new GT_Pollution(world)); + } -public class GT_Pollution { - private static final Storage STORAGE = new Storage(); - /** - * Pollution dispersion until effects start: - * Calculation: ((Limit * 0.01) + 2000) * (4 <- spreading rate) - * <p> - * SMOG(500k) 466.7 pollution/sec - * Poison(750k) 633,3 pollution/sec - * Dying Plants(1mio) 800 pollution/sec - * Sour Rain(1.5mio) 1133.3 pollution/sec - * <p> - * Pollution producers (pollution/sec) - * Bronze Boiler(20) - * Lava Boiler(20) - * High Pressure Boiler(20) - * Bronze Blast Furnace(50) - * Diesel Generator(40/80/160) - * Gas Turbine(20/40/80) - * Charcoal Pile(100) - * <p> - * Large Diesel Engine(320) - * Electric Blast Furnace(100) - * Implosion Compressor(2000) - * Large Boiler(240) - * Large Gas Turbine(160) - * Multi Smelter(100) - * Pyrolyse Oven(400) - * <p> - * Machine Explosion(100,000) - * <p> - * Other Random Shit: lots and lots - * <p> - * Muffler Hatch Pollution reduction: ** inaccurate ** - * LV (0%), MV (30%), HV (52%), EV (66%), IV (76%), LuV (84%), ZPM (89%), UV (92%), MAX (95%) - */ - private List<ChunkCoordIntPair> pollutionList = new ArrayList<>();//chunks left to process in this cycle - private final Set<ChunkCoordIntPair> pollutedChunks = new HashSet<>();// a global list of all chunks with positive pollution - private int operationsPerTick = 0;//how much chunks should be processed in each cycle - private static final short cycleLen = 1200; - private final World world; - private boolean blank = true; - public static int mPlayerPollution; - - private static int POLLUTIONPACKET_MINVALUE = 1000; - - private static GT_PollutionEventHandler EVENT_HANDLER; - - public GT_Pollution(World world) { - this.world = world; - - if (EVENT_HANDLER == null) { - EVENT_HANDLER = new GT_PollutionEventHandler(); - MinecraftForge.EVENT_BUS.register(EVENT_HANDLER); - } - } - - public static void onWorldTick(TickEvent.WorldTickEvent aEvent) {//called from proxy - //return if pollution disabled - if (!GT_Mod.gregtechproxy.mPollution) return; - if (aEvent.phase == TickEvent.Phase.START) return; - final GT_Pollution pollutionInstance = dimensionWisePollution.get(aEvent.world.provider.dimensionId); - if (pollutionInstance == null) return; - pollutionInstance.tickPollutionInWorld((int) (aEvent.world.getTotalWorldTime() % cycleLen)); - } - - private void tickPollutionInWorld(int aTickID) {//called from method above - //gen data set - if (aTickID == 0 || blank) { - // make a snapshot of what to work on - pollutionList = new ArrayList<>(pollutedChunks); - //set operations per tick - if (pollutionList.size() > 0) - operationsPerTick = Math.max(1, pollutionList.size() / cycleLen); - else - operationsPerTick = 0; //SANity - blank = false; - } - - for (int chunksProcessed = 0; chunksProcessed < operationsPerTick; chunksProcessed++) { - if (pollutionList.size() == 0) break;//no more stuff to do - ChunkCoordIntPair actualPos = pollutionList.remove(pollutionList.size() - 1);//faster - //get pollution - ChunkData currentData = STORAGE.get(world, actualPos); - int tPollution = currentData.getAmount(); - //remove some - tPollution = (int) (0.9945f * tPollution); - - if (tPollution > 400000) {//Spread Pollution - - ChunkCoordIntPair[] tNeighbors = new ChunkCoordIntPair[4];//array is faster - tNeighbors[0] = (new ChunkCoordIntPair(actualPos.chunkXPos + 1, actualPos.chunkZPos)); - tNeighbors[1] = (new ChunkCoordIntPair(actualPos.chunkXPos - 1, actualPos.chunkZPos)); - tNeighbors[2] = (new ChunkCoordIntPair(actualPos.chunkXPos, actualPos.chunkZPos + 1)); - tNeighbors[3] = (new ChunkCoordIntPair(actualPos.chunkXPos, actualPos.chunkZPos - 1)); - for (ChunkCoordIntPair neighborPosition : tNeighbors) { - ChunkData neighbor = STORAGE.get(world, neighborPosition); - int neighborPollution = neighbor.getAmount(); - if (neighborPollution * 6 < tPollution * 5) {//MATHEMATICS... - int tDiff = tPollution - neighborPollution; - tDiff = tDiff / 20; - neighborPollution = GT_Utility.safeInt((long) neighborPollution + tDiff);//tNPol += tDiff; - tPollution -= tDiff; - setChunkPollution(neighborPosition, neighborPollution); - } - } - - - //Create Pollution effects - //Smog filter TODO - if (tPollution > GT_Mod.gregtechproxy.mPollutionSmogLimit) { - AxisAlignedBB chunk = AxisAlignedBB.getBoundingBox(actualPos.chunkXPos << 4, 0, actualPos.chunkZPos << 4, (actualPos.chunkXPos << 4) + 16, 256, (actualPos.chunkZPos << 4) + 16); - List<EntityLivingBase> tEntitys = world.getEntitiesWithinAABB(EntityLivingBase.class, chunk); - for (EntityLivingBase tEnt : tEntitys) { - if (tEnt instanceof EntityPlayerMP && ((EntityPlayerMP) tEnt).capabilities.isCreativeMode) - continue; - if (!(GT_Utility.isWearingFullGasHazmat(tEnt))) { - switch (XSTR_INSTANCE.nextInt(3)) { - default: - tEnt.addPotionEffect(new PotionEffect(Potion.digSlowdown.id, Math.min(tPollution / 1000, 1000), tPollution / 400000)); - case 1: - tEnt.addPotionEffect(new PotionEffect(Potion.weakness.id, Math.min(tPollution / 1000, 1000), tPollution / 400000)); - case 2: - tEnt.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, Math.min(tPollution / 1000, 1000), tPollution / 400000)); - } - } - } - - - // Poison effects - if (tPollution > GT_Mod.gregtechproxy.mPollutionPoisonLimit) { - //AxisAlignedBB chunk = AxisAlignedBB.getBoundingBox(tPos.chunkPosX*16, 0, tPos.chunkPosZ*16, tPos.chunkPosX*16+16, 256, tPos.chunkPosZ*16+16); - //List<EntityLiving> tEntitys = aWorld.getEntitiesWithinAABB(EntityLiving.class, chunk); - for (EntityLivingBase tEnt : tEntitys) { - if (tEnt instanceof EntityPlayerMP && ((EntityPlayerMP) tEnt).capabilities.isCreativeMode) - continue; - if (!GT_Utility.isWearingFullGasHazmat(tEnt)) { - switch (XSTR_INSTANCE.nextInt(4)) { - default: - tEnt.addPotionEffect(new PotionEffect(Potion.hunger.id, tPollution / 500000)); - case 1: - tEnt.addPotionEffect(new PotionEffect(Potion.confusion.id, Math.min(tPollution / 2000, 1000), 1)); - case 2: - tEnt.addPotionEffect(new PotionEffect(Potion.poison.id, Math.min(tPollution / 4000, 1000), tPollution / 500000)); - case 3: - tEnt.addPotionEffect(new PotionEffect(Potion.blindness.id, Math.min(tPollution / 2000, 1000), 1)); - } - } - } - - - // killing plants - if (tPollution > GT_Mod.gregtechproxy.mPollutionVegetationLimit) { - int f = 20; - for (; f < (tPollution / 25000); f++) { - int x = (actualPos.chunkXPos << 4) + XSTR_INSTANCE.nextInt(16); - int y = 60 + (-f + XSTR_INSTANCE.nextInt(f * 2 + 1)); - int z = (actualPos.chunkZPos << 4) + XSTR_INSTANCE.nextInt(16); - damageBlock(world, x, y, z, tPollution > GT_Mod.gregtechproxy.mPollutionSourRainLimit); - } - } - } - } - } - //Write new pollution to Hashmap !!! - setChunkPollution(actualPos, tPollution); - - //Send new value to players nearby - if (tPollution > POLLUTIONPACKET_MINVALUE) { - NetworkRegistry.TargetPoint point = new NetworkRegistry.TargetPoint(world.provider.dimensionId, (actualPos.chunkXPos << 4), 64, (actualPos.chunkZPos << 4), 256); - GT_Values.NW.sendToAllAround(new GT_Packet_Pollution(actualPos, tPollution), point); - } - } - } - - private void setChunkPollution(ChunkCoordIntPair coord, int pollution) { - mutatePollution(world, coord.chunkXPos, coord.chunkZPos, c -> c.setAmount(pollution), pollutedChunks); - } - - private static void damageBlock(World world, int x, int y, int z, boolean sourRain) { - if (world.isRemote) return; - Block tBlock = world.getBlock(x, y, z); - int tMeta = world.getBlockMetadata(x, y, z); - if (tBlock == Blocks.air || tBlock == Blocks.stone || tBlock == Blocks.sand || tBlock == Blocks.deadbush) - return; - - if (tBlock == Blocks.leaves || tBlock == Blocks.leaves2 || tBlock.getMaterial() == Material.leaves) - world.setBlockToAir(x, y, z); - if (tBlock == Blocks.reeds) { - tBlock.dropBlockAsItem(world, x, y, z, tMeta, 0); - world.setBlockToAir(x, y, z); - } - if (tBlock == Blocks.tallgrass) - world.setBlock(x, y, z, Blocks.deadbush); - if (tBlock == Blocks.vine) { - tBlock.dropBlockAsItem(world, x, y, z, tMeta, 0); - world.setBlockToAir(x, y, z); - } - if (tBlock == Blocks.waterlily || tBlock == Blocks.wheat || tBlock == Blocks.cactus || - tBlock.getMaterial() == Material.cactus || tBlock == Blocks.melon_block || tBlock == Blocks.melon_stem) { - tBlock.dropBlockAsItem(world, x, y, z, tMeta, 0); - world.setBlockToAir(x, y, z); - } - if (tBlock == Blocks.red_flower || tBlock == Blocks.yellow_flower || tBlock == Blocks.carrots || - tBlock == Blocks.potatoes || tBlock == Blocks.pumpkin || tBlock == Blocks.pumpkin_stem) { - tBlock.dropBlockAsItem(world, x, y, z, tMeta, 0); - world.setBlockToAir(x, y, z); - } - if (tBlock == Blocks.sapling || tBlock.getMaterial() == Material.plants) - world.setBlock(x, y, z, Blocks.deadbush); - if (tBlock == Blocks.cocoa) { - tBlock.dropBlockAsItem(world, x, y, z, tMeta, 0); - world.setBlockToAir(x, y, z); - } - if (tBlock == Blocks.mossy_cobblestone) - world.setBlock(x, y, z, Blocks.cobblestone); - if (tBlock == Blocks.grass || tBlock.getMaterial() == Material.grass) - world.setBlock(x, y, z, Blocks.dirt); - if (tBlock == Blocks.farmland || tBlock == Blocks.dirt) { - world.setBlock(x, y, z, Blocks.sand); - } - - if (sourRain && world.isRaining() && (tBlock == Blocks.stone || tBlock == Blocks.gravel || tBlock == Blocks.cobblestone) && - world.getBlock(x, y + 1, z) == Blocks.air && world.canBlockSeeTheSky(x, y, z)) { - if (tBlock == Blocks.stone) { - world.setBlock(x, y, z, Blocks.cobblestone); - } else if (tBlock == Blocks.cobblestone) { - world.setBlock(x, y, z, Blocks.gravel); - } else if (tBlock == Blocks.gravel) { - world.setBlock(x, y, z, Blocks.sand); - } - } - } - - private static GT_Pollution getPollutionManager(World world) { - return dimensionWisePollution.computeIfAbsent(world.provider.dimensionId, i -> new GT_Pollution(world)); - } - - /** @see #addPollution(World, int, int, int) */ - @SuppressWarnings("rawtypes") - public static void addPollution(IGregTechTileEntity te, int aPollution) { - if (!GT_Mod.gregtechproxy.mPollution || aPollution == 0 || te.isClientSide()) return; + /** @see #addPollution(World, int, int, int) */ + @SuppressWarnings("rawtypes") + public static void addPollution(IGregTechTileEntity te, int aPollution) { + if (!GT_Mod.gregtechproxy.mPollution || aPollution == 0 || te.isClientSide()) return; IMetaTileEntity iMetaTileEntity = te.getMetaTileEntity(); - if (iMetaTileEntity instanceof IMachineCallback) { - if (((IMachineCallback) iMetaTileEntity).getCallbackBase() instanceof GT_MetaTileEntity_Cleanroom) { - if (aPollution > 0) { - ((GT_MetaTileEntity_Cleanroom) ((IMachineCallback) iMetaTileEntity).getCallbackBase()).doMaintenanceIssue(); + if (iMetaTileEntity instanceof IMachineCallback) { + if (((IMachineCallback) iMetaTileEntity).getCallbackBase() instanceof GT_MetaTileEntity_Cleanroom) { + if (aPollution > 0) { + ((GT_MetaTileEntity_Cleanroom) ((IMachineCallback) iMetaTileEntity).getCallbackBase()) + .doMaintenanceIssue(); } } } - mutatePollution(te.getWorld(), te.getXCoord() >> 4, te.getZCoord() >> 4, d -> d.changeAmount(aPollution), null); - } - - /** @see #addPollution(World, int, int, int) */ - public static void addPollution(Chunk ch, int aPollution) { - if (!GT_Mod.gregtechproxy.mPollution || aPollution == 0 || ch.worldObj.isRemote) return; - mutatePollution(ch.worldObj, ch.xPosition, ch.zPosition, d -> d.changeAmount(aPollution), null); - } - - /** - * Add some pollution to given chunk. Can pass in negative to remove pollution. - * Will clamp the final pollution number to 0 if it would be changed into negative. - * - * @param w world to modify. do nothing if it's a client world - * @param chunkX chunk coordinate X, i.e. blockX >> 4 - * @param chunkZ chunk coordinate Z, i.e. blockZ >> 4 - * @param aPollution desired delta. Positive means the pollution in chunk would go higher. - */ - public static void addPollution(World w, int chunkX, int chunkZ, int aPollution) { - if (!GT_Mod.gregtechproxy.mPollution || aPollution == 0 || w.isRemote) return; - mutatePollution(w, chunkX, chunkZ, d -> d.changeAmount(aPollution), null); - } - - private static void mutatePollution(World world, int x, int z, Consumer<ChunkData> mutator, @Nullable Set<ChunkCoordIntPair> chunks) { - ChunkData data = STORAGE.get(world, x, z); - boolean hadPollution = data.getAmount() > 0; - mutator.accept(data); - boolean hasPollution = data.getAmount() > 0; - if (hasPollution != hadPollution) { - if (chunks == null) - chunks = getPollutionManager(world).pollutedChunks; - if (hasPollution) - chunks.add(new ChunkCoordIntPair(x, z)); - else - chunks.remove(new ChunkCoordIntPair(x, z)); - } - } - - /** @see #getPollution(World, int, int) */ - public static int getPollution(IGregTechTileEntity te) { - return getPollution(te.getWorld(), te.getXCoord() >> 4, te.getZCoord() >> 4); - } - - /** @see #getPollution(World, int, int) */ - public static int getPollution(Chunk ch) { - return getPollution(ch.worldObj, ch.xPosition, ch.zPosition); - } - - /** - * Get the pollution in specified chunk - * @param w world to look in. can be a client world, but that limits the knowledge to what server side send us - * @param chunkX chunk coordinate X, i.e. blockX >> 4 - * @param chunkZ chunk coordinate Z, i.e. blockZ >> 4 - * @return pollution amount. may be 0 if pollution is disabled, or if it's a client world and server did not send - * us info about this chunk - */ - public static int getPollution(World w, int chunkX, int chunkZ) { - if (!GT_Mod.gregtechproxy.mPollution) - return 0; - if (w.isRemote) - // it really should be querying the client side stuff instead - return GT_PollutionRenderer.getKnownPollution(chunkX << 4, chunkZ << 4); - return STORAGE.get(w, chunkX, chunkZ).getAmount(); - } - - @Deprecated - public static int getPollution(ChunkCoordIntPair aCh, int aDim) { - return getPollution(DimensionManager.getWorld(aDim), aCh.chunkXPos, aCh.chunkZPos); - } - - public static boolean hasPollution(Chunk ch) { - if (!GT_Mod.gregtechproxy.mPollution) - return false; - return STORAGE.isCreated(ch.worldObj, ch.getChunkCoordIntPair()) && STORAGE.get(ch).getAmount() > 0; - } - - //Add compatibility with old code - @Deprecated /*Don't use it... too weird way of passing position*/ - public static void addPollution(World aWorld, ChunkPosition aPos, int aPollution) { - //The abuse of ChunkPosition to store block position and dim... - //is just bad especially when that is both used to store ChunkPos and BlockPos depending on context - addPollution(aWorld.getChunkFromBlockCoords(aPos.chunkPosX, aPos.chunkPosZ), aPollution); - } - - static void migrate(ChunkDataEvent.Load e) { - addPollution(e.getChunk(), e.getData().getInteger("GTPOLLUTION")); - } - - public static class GT_PollutionEventHandler { - @SubscribeEvent - public void chunkWatch(ChunkWatchEvent.Watch event) { - if (!GT_Mod.gregtechproxy.mPollution) return; - World world = event.player.worldObj; - if (STORAGE.isCreated(world, event.chunk)) { - int pollution = STORAGE.get(world, event.chunk).getAmount(); - if (pollution > POLLUTIONPACKET_MINVALUE) - GT_Values.NW.sendToPlayer(new GT_Packet_Pollution(event.chunk, pollution), event.player); - } - } - - @SubscribeEvent - public void onWorldLoad(WorldEvent.Load e) { - // super class loads everything lazily. We force it to load them all. - if (!e.world.isRemote) - STORAGE.loadAll(e.world); - } - } - - @ParametersAreNonnullByDefault - private static final class Storage extends GT_ChunkAssociatedData<ChunkData> { - private Storage() { - super("Pollution", ChunkData.class, 64, (byte) 0, false); - } - - @Override - protected void writeElement(DataOutput output, ChunkData element, World world, int chunkX, int chunkZ) throws IOException { - output.writeInt(element.getAmount()); - } - - @Override - protected ChunkData readElement(DataInput input, int version, World world, int chunkX, int chunkZ) throws IOException { - if (version != 0) - throw new IOException("Region file corrupted"); - ChunkData data = new ChunkData(input.readInt()); - if (data.getAmount() > 0) - getPollutionManager(world).pollutedChunks.add(new ChunkCoordIntPair(chunkX, chunkZ)); - return data; - } - - @Override - protected ChunkData createElement(World world, int chunkX, int chunkZ) { - return new ChunkData(); - } - - @Override - public void loadAll(World w) { - super.loadAll(w); - } - - public boolean isCreated(World world, ChunkCoordIntPair coord) { - return isCreated(world.provider.dimensionId, coord.chunkXPos, coord.chunkZPos); - } - } - - private static final class ChunkData implements GT_ChunkAssociatedData.IData { - public int amount; - - private ChunkData() { - this(0); - } - - private ChunkData(int amount) { - this.amount = Math.max(0, amount); - } - - /** - * Current pollution amount. - */ - public int getAmount() { - return amount; - } - - public void setAmount(int amount) { - this.amount = Math.max(amount, 0); - } - - public void changeAmount(int delta) { - this.amount = Math.max(GT_Utility.safeInt(amount + (long) delta, 0), 0); - } - - @Override - public boolean isSameAsDefault() { - return amount == 0; - } - } + mutatePollution(te.getWorld(), te.getXCoord() >> 4, te.getZCoord() >> 4, d -> d.changeAmount(aPollution), null); + } + + /** @see #addPollution(World, int, int, int) */ + public static void addPollution(Chunk ch, int aPollution) { + if (!GT_Mod.gregtechproxy.mPollution || aPollution == 0 || ch.worldObj.isRemote) return; + mutatePollution(ch.worldObj, ch.xPosition, ch.zPosition, d -> d.changeAmount(aPollution), null); + } + + /** + * Add some pollution to given chunk. Can pass in negative to remove pollution. + * Will clamp the final pollution number to 0 if it would be changed into negative. + * + * @param w world to modify. do nothing if it's a client world + * @param chunkX chunk coordinate X, i.e. blockX >> 4 + * @param chunkZ chunk coordinate Z, i.e. blockZ >> 4 + * @param aPollution desired delta. Positive means the pollution in chunk would go higher. + */ + public static void addPollution(World w, int chunkX, int chunkZ, int aPollution) { + if (!GT_Mod.gregtechproxy.mPollution || aPollution == 0 || w.isRemote) return; + mutatePollution(w, chunkX, chunkZ, d -> d.changeAmount(aPollution), null); + } + + private static void mutatePollution( + World world, int x, int z, Consumer<ChunkData> mutator, @Nullable Set<ChunkCoordIntPair> chunks) { + ChunkData data = STORAGE.get(world, x, z); + boolean hadPollution = data.getAmount() > 0; + mutator.accept(data); + boolean hasPollution = data.getAmount() > 0; + if (hasPollution != hadPollution) { + if (chunks == null) chunks = getPollutionManager(world).pollutedChunks; + if (hasPollution) chunks.add(new ChunkCoordIntPair(x, z)); + else chunks.remove(new ChunkCoordIntPair(x, z)); + } + } + + /** @see #getPollution(World, int, int) */ + public static int getPollution(IGregTechTileEntity te) { + return getPollution(te.getWorld(), te.getXCoord() >> 4, te.getZCoord() >> 4); + } + + /** @see #getPollution(World, int, int) */ + public static int getPollution(Chunk ch) { + return getPollution(ch.worldObj, ch.xPosition, ch.zPosition); + } + + /** + * Get the pollution in specified chunk + * @param w world to look in. can be a client world, but that limits the knowledge to what server side send us + * @param chunkX chunk coordinate X, i.e. blockX >> 4 + * @param chunkZ chunk coordinate Z, i.e. blockZ >> 4 + * @return pollution amount. may be 0 if pollution is disabled, or if it's a client world and server did not send + * us info about this chunk + */ + public static int getPollution(World w, int chunkX, int chunkZ) { + if (!GT_Mod.gregtechproxy.mPollution) return 0; + if (w.isRemote) + // it really should be querying the client side stuff instead + return GT_PollutionRenderer.getKnownPollution(chunkX << 4, chunkZ << 4); + return STORAGE.get(w, chunkX, chunkZ).getAmount(); + } + + @Deprecated + public static int getPollution(ChunkCoordIntPair aCh, int aDim) { + return getPollution(DimensionManager.getWorld(aDim), aCh.chunkXPos, aCh.chunkZPos); + } + + public static boolean hasPollution(Chunk ch) { + if (!GT_Mod.gregtechproxy.mPollution) return false; + return STORAGE.isCreated(ch.worldObj, ch.getChunkCoordIntPair()) + && STORAGE.get(ch).getAmount() > 0; + } + + // Add compatibility with old code + @Deprecated /*Don't use it... too weird way of passing position*/ + public static void addPollution(World aWorld, ChunkPosition aPos, int aPollution) { + // The abuse of ChunkPosition to store block position and dim... + // is just bad especially when that is both used to store ChunkPos and BlockPos depending on context + addPollution(aWorld.getChunkFromBlockCoords(aPos.chunkPosX, aPos.chunkPosZ), aPollution); + } + + static void migrate(ChunkDataEvent.Load e) { + addPollution(e.getChunk(), e.getData().getInteger("GTPOLLUTION")); + } + + public static class GT_PollutionEventHandler { + @SubscribeEvent + public void chunkWatch(ChunkWatchEvent.Watch event) { + if (!GT_Mod.gregtechproxy.mPollution) return; + World world = event.player.worldObj; + if (STORAGE.isCreated(world, event.chunk)) { + int pollution = STORAGE.get(world, event.chunk).getAmount(); + if (pollution > POLLUTIONPACKET_MINVALUE) + GT_Values.NW.sendToPlayer(new GT_Packet_Pollution(event.chunk, pollution), event.player); + } + } + + @SubscribeEvent + public void onWorldLoad(WorldEvent.Load e) { + // super class loads everything lazily. We force it to load them all. + if (!e.world.isRemote) STORAGE.loadAll(e.world); + } + } + + @ParametersAreNonnullByDefault + private static final class Storage extends GT_ChunkAssociatedData<ChunkData> { + private Storage() { + super("Pollution", ChunkData.class, 64, (byte) 0, false); + } + + @Override + protected void writeElement(DataOutput output, ChunkData element, World world, int chunkX, int chunkZ) + throws IOException { + output.writeInt(element.getAmount()); + } + + @Override + protected ChunkData readElement(DataInput input, int version, World world, int chunkX, int chunkZ) + throws IOException { + if (version != 0) throw new IOException("Region file corrupted"); + ChunkData data = new ChunkData(input.readInt()); + if (data.getAmount() > 0) + getPollutionManager(world).pollutedChunks.add(new ChunkCoordIntPair(chunkX, chunkZ)); + return data; + } + + @Override + protected ChunkData createElement(World world, int chunkX, int chunkZ) { + return new ChunkData(); + } + + @Override + public void loadAll(World w) { + super.loadAll(w); + } + + public boolean isCreated(World world, ChunkCoordIntPair coord) { + return isCreated(world.provider.dimensionId, coord.chunkXPos, coord.chunkZPos); + } + } + + private static final class ChunkData implements GT_ChunkAssociatedData.IData { + public int amount; + + private ChunkData() { + this(0); + } + + private ChunkData(int amount) { + this.amount = Math.max(0, amount); + } + + /** + * Current pollution amount. + */ + public int getAmount() { + return amount; + } + + public void setAmount(int amount) { + this.amount = Math.max(amount, 0); + } + + public void changeAmount(int delta) { + this.amount = Math.max(GT_Utility.safeInt(amount + (long) delta, 0), 0); + } + + @Override + public boolean isSameAsDefault() { + return amount == 0; + } + } } diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index b222ba1570..0a529cfa3b 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -1,5 +1,14 @@ package gregtech.common; +import static gregtech.GT_Mod.GT_FML_LOGGER; +import static gregtech.api.enums.GT_Values.MOD_ID_RC; +import static gregtech.api.enums.GT_Values.MOD_ID_TC; +import static gregtech.api.enums.GT_Values.MOD_ID_TE; +import static gregtech.api.enums.GT_Values.MOD_ID_TF; +import static gregtech.api.enums.GT_Values.W; +import static gregtech.api.enums.GT_Values.debugEntityCramming; +import static gregtech.api.util.GT_Util.LAST_BROKEN_TILEENTITY; + import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.IFuelHandler; import cpw.mods.fml.common.Loader; @@ -60,6 +69,25 @@ import gregtech.common.gui.GT_ContainerVolumetricFlask; import gregtech.common.gui.GT_GUIContainerVolumetricFlask; import gregtech.common.items.GT_MetaGenerated_Item_98; import gregtech.common.items.GT_MetaGenerated_Tool_01; +import java.io.File; +import java.lang.reflect.InvocationTargetException; +import java.text.DateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Date; +import java.util.EnumSet; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.UUID; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.locks.ReentrantLock; +import java.util.stream.Collectors; import net.minecraft.block.Block; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentHelper; @@ -110,40 +138,14 @@ import net.minecraftforge.oredict.ShapedOreRecipe; import net.minecraftforge.oredict.ShapelessOreRecipe; import org.apache.commons.lang3.text.WordUtils; -import java.io.File; -import java.lang.reflect.InvocationTargetException; -import java.text.DateFormat; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Date; -import java.util.EnumSet; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.UUID; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ConcurrentMap; -import java.util.concurrent.locks.ReentrantLock; -import java.util.stream.Collectors; - -import static gregtech.GT_Mod.GT_FML_LOGGER; -import static gregtech.api.enums.GT_Values.MOD_ID_RC; -import static gregtech.api.enums.GT_Values.MOD_ID_TC; -import static gregtech.api.enums.GT_Values.MOD_ID_TE; -import static gregtech.api.enums.GT_Values.MOD_ID_TF; -import static gregtech.api.enums.GT_Values.W; -import static gregtech.api.enums.GT_Values.debugEntityCramming; -import static gregtech.api.util.GT_Util.LAST_BROKEN_TILEENTITY; - - public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IGlobalWirelessEnergy { - private static final EnumSet<OreGenEvent.GenerateMinable.EventType> PREVENTED_ORES = EnumSet.of(OreGenEvent.GenerateMinable.EventType.COAL, - OreGenEvent.GenerateMinable.EventType.IRON, OreGenEvent.GenerateMinable.EventType.GOLD, - OreGenEvent.GenerateMinable.EventType.DIAMOND, OreGenEvent.GenerateMinable.EventType.REDSTONE, OreGenEvent.GenerateMinable.EventType.LAPIS, + private static final EnumSet<OreGenEvent.GenerateMinable.EventType> PREVENTED_ORES = EnumSet.of( + OreGenEvent.GenerateMinable.EventType.COAL, + OreGenEvent.GenerateMinable.EventType.IRON, + OreGenEvent.GenerateMinable.EventType.GOLD, + OreGenEvent.GenerateMinable.EventType.DIAMOND, + OreGenEvent.GenerateMinable.EventType.REDSTONE, + OreGenEvent.GenerateMinable.EventType.LAPIS, OreGenEvent.GenerateMinable.EventType.QUARTZ); public final HashSet<ItemStack> mRegisteredOres = new HashSet<>(10000); public final ArrayList<String> mSoundNames = new ArrayList<>(); @@ -151,48 +153,343 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG public final ArrayList<Integer> mSoundCounts = new ArrayList<>(); private final Collection<OreDictEventContainer> mEvents = new HashSet<>(); private final Collection<String> mIgnoredItems = new HashSet<>(Arrays.asList( - "itemGhastTear", "itemFlint", "itemClay", "itemBucketSaltWater", - "itemBucketFreshWater", "itemBucketWater", "itemRock", "itemReed", "itemArrow", "itemSaw", "itemKnife", "itemHammer", "itemChisel", "itemRubber", - "itemEssence", "itemIlluminatedPanel", "itemSkull", "itemRawRubber", "itemBacon", "itemJetpackAccelerator", "itemLazurite", "itemIridium", - "itemTear", "itemClaw", "itemFertilizer", "itemTar", "itemSlimeball", "itemCoke", "itemBeeswax", "itemBeeQueen", "itemForcicium", "itemForcillium", - "itemRoyalJelly", "itemHoneydew", "itemHoney", "itemPollen", "itemReedTypha", "itemSulfuricAcid", "itemPotash", "itemCompressedCarbon", - "itemBitumen", "itemBioFuel", "itemCokeSugar", "itemCokeCactus", "itemCharcoalSugar", "itemCharcoalCactus", "itemSludge", "itemEnrichedAlloy", - "itemQuicksilver", "itemMercury", "itemOsmium", "itemUltimateCircuit", "itemEnergizedStar", "itemAntimatterMolecule", "itemAntimatterGlob", - "itemCoal", "itemBoat", "itemHerbalMedicineCake", "itemCakeSponge", "itemFishandPumpkinCakeSponge", "itemSoulCleaver", "itemInstantCake", - "itemWhippingCream", "itemGlisteningWhippingCream", "itemCleaver", "itemHerbalMedicineWhippingCream", "itemStrangeWhippingCream", - "itemBlazeCleaver", "itemBakedCakeSponge", "itemMagmaCake", "itemGlisteningCake", "itemOgreCleaver", "itemFishandPumpkinCake", - "itemMagmaWhippingCream", "itemMultimeter", "itemSuperconductor")); - private final Collection<String> mIgnoredNames = new HashSet<>(Arrays.asList("grubBee", "chainLink", "candyCane", "bRedString", "bVial", - "bFlask", "anorthositeSmooth", "migmatiteSmooth", "slateSmooth", "travertineSmooth", "limestoneSmooth", "orthogneissSmooth", "marbleSmooth", - "honeyDrop", "lumpClay", "honeyEqualssugar", "flourEqualswheat", "bluestoneInsulated", "blockWaterstone", "blockSand", "blockTorch", - "blockPumpkin", "blockClothRock", "blockStainedHardenedClay", "blockQuartzPillar", "blockQuartzChiselled", "blockSpawner", "blockCloth", "mobHead", - "mobEgg", "enderFlower", "enderChest", "clayHardened", "dayGemMaterial", "nightGemMaterial", "snowLayer", "bPlaceholder", "hardenedClay", - "eternalLifeEssence", "sandstone", "wheatRice", "transdimBlock", "bambooBasket", "lexicaBotania", "livingwoodTwig", "redstoneCrystal", - "pestleAndMortar", "glowstone", "whiteStone", "stoneSlab", "transdimBlock", "clayBowl", "clayPlate", "ceramicBowl", "ceramicPlate", "ovenRack", - "clayCup", "ceramicCup", "batteryBox", "transmutationStone", "torchRedstoneActive", "coal", "charcoal", "cloth", "cobblestoneSlab", - "stoneBrickSlab", "cobblestoneWall", "stoneBrickWall", "cobblestoneStair", "stoneBrickStair", "blockCloud", "blockDirt", "blockTyrian", - "blockCarpet", "blockFft", "blockLavastone", "blockHolystone", "blockConcrete", "sunnariumPart", "brSmallMachineCyaniteProcessor", "meteoriteCoal", - "blockCobble", "pressOreProcessor", "crusherOreProcessor", "grinderOreProcessor", "blockRubber", "blockHoney", "blockHoneydew", "blockPeat", - "blockRadioactive", "blockSlime", "blockCocoa", "blockSugarCane", "blockLeather", "blockClayBrick", "solarPanelHV", "cableRedNet", "stoneBowl", - "crafterWood", "taintedSoil", "brickXyEngineering", "breederUranium", "wireMill", "chunkLazurite", "aluminumNatural", "aluminiumNatural", - "naturalAluminum", "naturalAluminium", "antimatterMilligram", "antimatterGram", "strangeMatter", "coalGenerator", "electricFurnace", - "unfinishedTank", "valvePart", "aquaRegia", "leatherSeal", "leatherSlimeSeal", "hambone", "slimeball", "clay", "enrichedUranium", "camoPaste", - "antiBlock", "burntQuartz", "salmonRaw", "blockHopper", "blockEnderObsidian", "blockIcestone", "blockMagicWood", "blockEnderCore", "blockHeeEndium", - "oreHeeEndPowder", "oreHeeStardust", "oreHeeIgneousRock", "oreHeeInstabilityOrb", "crystalPureFluix", "shardNether", "gemFluorite", - "stickObsidian", "caveCrystal", "shardCrystal", "dyeCrystal", "shardFire", "shardWater", "shardAir", "shardEarth", "ingotRefinedIron", "blockMarble", "ingotUnstable")); - private final Collection<String> mInvalidNames = new HashSet<>(Arrays.asList("diamondShard", "redstoneRoot", "obsidianStick", "bloodstoneOre", - "universalCable", "bronzeTube", "ironTube", "netherTube", "obbyTube", "infiniteBattery", "eliteBattery", "advancedBattery", "10kEUStore", - "blueDye", "MonazitOre", "quartzCrystal", "whiteLuminiteCrystal", "darkStoneIngot", "invisiumIngot", "demoniteOrb", "enderGem", "starconiumGem", - "osmoniumIngot", "tapaziteGem", "zectiumIngot", "foolsRubyGem", "rubyGem", "meteoriteGem", "adamiteShard", "sapphireGem", "copperIngot", - "ironStick", "goldStick", "diamondStick", "reinforcedStick", "draconicStick", "emeraldStick", "copperStick", "tinStick", "silverStick", - "bronzeStick", "steelStick", "leadStick", "manyullynStick", "arditeStick", "cobaltStick", "aluminiumStick", "alumiteStick", "oilsandsOre", - "copperWire", "superconductorWire", "sulfuricAcid", "conveyorBelt", "ironWire", "aluminumWire", "aluminiumWire", "silverWire", "tinWire", - "dustSiliconSmall", "AluminumOre", "plateHeavyT2", "blockWool", "alloyPlateEnergizedHardened", "gasWood", "alloyPlateEnergized", "SilverOre", - "LeadOre", "TinOre", "CopperOre", "silverOre", "leadOre", "tinOre", "copperOre", "bauxiteOre", "HSLivingmetalIngot", "oilMoving", "oilStill", - "oilBucket", "petroleumOre", "dieselFuel", "diamondNugget", "planks", "wood", "stick", "sticks", "naquadah", "obsidianRod", "stoneRod", - "thaumiumRod", "steelRod", "netherrackRod", "woodRod", "ironRod", "cactusRod", "flintRod", "copperRod", "cobaltRod", "alumiteRod", "blueslimeRod", - "arditeRod", "manyullynRod", "bronzeRod", "boneRod", "slimeRod", "redalloyBundled", "bluestoneBundled", "infusedteslatiteInsulated", - "redalloyInsulated", "infusedteslatiteBundled")); + "itemGhastTear", + "itemFlint", + "itemClay", + "itemBucketSaltWater", + "itemBucketFreshWater", + "itemBucketWater", + "itemRock", + "itemReed", + "itemArrow", + "itemSaw", + "itemKnife", + "itemHammer", + "itemChisel", + "itemRubber", + "itemEssence", + "itemIlluminatedPanel", + "itemSkull", + "itemRawRubber", + "itemBacon", + "itemJetpackAccelerator", + "itemLazurite", + "itemIridium", + "itemTear", + "itemClaw", + "itemFertilizer", + "itemTar", + "itemSlimeball", + "itemCoke", + "itemBeeswax", + "itemBeeQueen", + "itemForcicium", + "itemForcillium", + "itemRoyalJelly", + "itemHoneydew", + "itemHoney", + "itemPollen", + "itemReedTypha", + "itemSulfuricAcid", + "itemPotash", + "itemCompressedCarbon", + "itemBitumen", + "itemBioFuel", + "itemCokeSugar", + "itemCokeCactus", + "itemCharcoalSugar", + "itemCharcoalCactus", + "itemSludge", + "itemEnrichedAlloy", + "itemQuicksilver", + "itemMercury", + "itemOsmium", + "itemUltimateCircuit", + "itemEnergizedStar", + "itemAntimatterMolecule", + "itemAntimatterGlob", + "itemCoal", + "itemBoat", + "itemHerbalMedicineCake", + "itemCakeSponge", + "itemFishandPumpkinCakeSponge", + "itemSoulCleaver", + "itemInstantCake", + "itemWhippingCream", + "itemGlisteningWhippingCream", + "itemCleaver", + "itemHerbalMedicineWhippingCream", + "itemStrangeWhippingCream", + "itemBlazeCleaver", + "itemBakedCakeSponge", + "itemMagmaCake", + "itemGlisteningCake", + "itemOgreCleaver", + "itemFishandPumpkinCake", + "itemMagmaWhippingCream", + "itemMultimeter", + "itemSuperconductor")); + private final Collection<String> mIgnoredNames = new HashSet<>(Arrays.asList( + "grubBee", + "chainLink", + "candyCane", + "bRedString", + "bVial", + "bFlask", + "anorthositeSmooth", + "migmatiteSmooth", + "slateSmooth", + "travertineSmooth", + "limestoneSmooth", + "orthogneissSmooth", + "marbleSmooth", + "honeyDrop", + "lumpClay", + "honeyEqualssugar", + "flourEqualswheat", + "bluestoneInsulated", + "blockWaterstone", + "blockSand", + "blockTorch", + "blockPumpkin", + "blockClothRock", + "blockStainedHardenedClay", + "blockQuartzPillar", + "blockQuartzChiselled", + "blockSpawner", + "blockCloth", + "mobHead", + "mobEgg", + "enderFlower", + "enderChest", + "clayHardened", + "dayGemMaterial", + "nightGemMaterial", + "snowLayer", + "bPlaceholder", + "hardenedClay", + "eternalLifeEssence", + "sandstone", + "wheatRice", + "transdimBlock", + "bambooBasket", + "lexicaBotania", + "livingwoodTwig", + "redstoneCrystal", + "pestleAndMortar", + "glowstone", + "whiteStone", + "stoneSlab", + "transdimBlock", + "clayBowl", + "clayPlate", + "ceramicBowl", + "ceramicPlate", + "ovenRack", + "clayCup", + "ceramicCup", + "batteryBox", + "transmutationStone", + "torchRedstoneActive", + "coal", + "charcoal", + "cloth", + "cobblestoneSlab", + "stoneBrickSlab", + "cobblestoneWall", + "stoneBrickWall", + "cobblestoneStair", + "stoneBrickStair", + "blockCloud", + "blockDirt", + "blockTyrian", + "blockCarpet", + "blockFft", + "blockLavastone", + "blockHolystone", + "blockConcrete", + "sunnariumPart", + "brSmallMachineCyaniteProcessor", + "meteoriteCoal", + "blockCobble", + "pressOreProcessor", + "crusherOreProcessor", + "grinderOreProcessor", + "blockRubber", + "blockHoney", + "blockHoneydew", + "blockPeat", + "blockRadioactive", + "blockSlime", + "blockCocoa", + "blockSugarCane", + "blockLeather", + "blockClayBrick", + "solarPanelHV", + "cableRedNet", + "stoneBowl", + "crafterWood", + "taintedSoil", + "brickXyEngineering", + "breederUranium", + "wireMill", + "chunkLazurite", + "aluminumNatural", + "aluminiumNatural", + "naturalAluminum", + "naturalAluminium", + "antimatterMilligram", + "antimatterGram", + "strangeMatter", + "coalGenerator", + "electricFurnace", + "unfinishedTank", + "valvePart", + "aquaRegia", + "leatherSeal", + "leatherSlimeSeal", + "hambone", + "slimeball", + "clay", + "enrichedUranium", + "camoPaste", + "antiBlock", + "burntQuartz", + "salmonRaw", + "blockHopper", + "blockEnderObsidian", + "blockIcestone", + "blockMagicWood", + "blockEnderCore", + "blockHeeEndium", + "oreHeeEndPowder", + "oreHeeStardust", + "oreHeeIgneousRock", + "oreHeeInstabilityOrb", + "crystalPureFluix", + "shardNether", + "gemFluorite", + "stickObsidian", + "caveCrystal", + "shardCrystal", + "dyeCrystal", + "shardFire", + "shardWater", + "shardAir", + "shardEarth", + "ingotRefinedIron", + "blockMarble", + "ingotUnstable")); + private final Collection<String> mInvalidNames = new HashSet<>(Arrays.asList( + "diamondShard", + "redstoneRoot", + "obsidianStick", + "bloodstoneOre", + "universalCable", + "bronzeTube", + "ironTube", + "netherTube", + "obbyTube", + "infiniteBattery", + "eliteBattery", + "advancedBattery", + "10kEUStore", + "blueDye", + "MonazitOre", + "quartzCrystal", + "whiteLuminiteCrystal", + "darkStoneIngot", + "invisiumIngot", + "demoniteOrb", + "enderGem", + "starconiumGem", + "osmoniumIngot", + "tapaziteGem", + "zectiumIngot", + "foolsRubyGem", + "rubyGem", + "meteoriteGem", + "adamiteShard", + "sapphireGem", + "copperIngot", + "ironStick", + "goldStick", + "diamondStick", + "reinforcedStick", + "draconicStick", + "emeraldStick", + "copperStick", + "tinStick", + "silverStick", + "bronzeStick", + "steelStick", + "leadStick", + "manyullynStick", + "arditeStick", + "cobaltStick", + "aluminiumStick", + "alumiteStick", + "oilsandsOre", + "copperWire", + "superconductorWire", + "sulfuricAcid", + "conveyorBelt", + "ironWire", + "aluminumWire", + "aluminiumWire", + "silverWire", + "tinWire", + "dustSiliconSmall", + "AluminumOre", + "plateHeavyT2", + "blockWool", + "alloyPlateEnergizedHardened", + "gasWood", + "alloyPlateEnergized", + "SilverOre", + "LeadOre", + "TinOre", + "CopperOre", + "silverOre", + "leadOre", + "tinOre", + "copperOre", + "bauxiteOre", + "HSLivingmetalIngot", + "oilMoving", + "oilStill", + "oilBucket", + "petroleumOre", + "dieselFuel", + "diamondNugget", + "planks", + "wood", + "stick", + "sticks", + "naquadah", + "obsidianRod", + "stoneRod", + "thaumiumRod", + "steelRod", + "netherrackRod", + "woodRod", + "ironRod", + "cactusRod", + "flintRod", + "copperRod", + "cobaltRod", + "alumiteRod", + "blueslimeRod", + "arditeRod", + "manyullynRod", + "bronzeRod", + "boneRod", + "slimeRod", + "redalloyBundled", + "bluestoneBundled", + "infusedteslatiteInsulated", + "redalloyInsulated", + "infusedteslatiteBundled")); private final DateFormat mDateFormat = DateFormat.getInstance(); public ArrayList<String> mBufferedPlayerActivity = new ArrayList<>(); public final GT_BlockMap<Boolean> mCTMBlockCache = new GT_BlockMap<>(); @@ -222,7 +519,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG private boolean isFirstServerWorldTick = true; private boolean isFirstWorldTick = true; private boolean mOreDictActivated = false; - public boolean mChangeHarvestLevels=false; + public boolean mChangeHarvestLevels = false; public boolean mNerfedCombs = true; public boolean mNerfedCrops = true; public boolean mGTBees = true; @@ -236,9 +533,9 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG public int mFlintChance = 30; public int mItemDespawnTime = 6000; public int mUpgradeCount = 4; - public int[] mHarvestLevel= new int[1000]; - public int mGraniteHavestLevel=3; - public int mMaxHarvestLevel=7; + public int[] mHarvestLevel = new int[1000]; + public int mGraniteHavestLevel = 3; + public int mMaxHarvestLevel = 7; public int mWireHeatingTicks = 4; public int mPollutionSmogLimit = 550000; public int mPollutionPoisonLimit = 750000; @@ -255,7 +552,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG public int mPollutionLargeSteelBoilerPerSecond = 2000; public int mPollutionLargeTitaniumBoilerPerSecond = 3000; public int mPollutionLargeTungstenSteelBoilerPerSecond = 4000; - public double mPollutionReleasedByThrottle = 1.0/24.0; // divided by 24 because 24 circuit conf + public double mPollutionReleasedByThrottle = 1.0 / 24.0; // divided by 24 because 24 circuit conf public int mPollutionLargeGasTurbinePerSecond = 300; public int mPollutionMultiSmelterPerSecond = 400; public int mPollutionPyrolyseOvenPerSecond = 300; @@ -263,9 +560,9 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG public int mPollutionHighPressureLavaBoilerPerSecond = 20; public int mPollutionHighPressureCoalBoilerPerSecond = 30; public int mPollutionBaseDieselGeneratorPerSecond = 200; - public double[] mPollutionDieselGeneratorReleasedByTier = new double[]{0.1, 1.0, 0.9, 0.8}; + public double[] mPollutionDieselGeneratorReleasedByTier = new double[] {0.1, 1.0, 0.9, 0.8}; public int mPollutionBaseGasTurbinePerSecond = 200; - public double[] mPollutionGasTurbineReleasedByTier = new double[]{0.1, 1.0, 0.9, 0.8}; + public double[] mPollutionGasTurbineReleasedByTier = new double[] {0.1, 1.0, 0.9, 0.8}; public final GT_UO_DimensionList mUndergroundOil = new GT_UO_DimensionList(); public int mTicksUntilNextCraftSound = 0; public double mMagneticraftBonusOutputPercent = 0d; @@ -436,29 +733,31 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG oreDictBurnTimes.put("dustTinyDiamond", 11378); } - - public GT_Proxy() { GameRegistry.registerFuelHandler(this); MinecraftForge.EVENT_BUS.register(this); MinecraftForge.ORE_GEN_BUS.register(this); FMLCommonHandler.instance().bus().register(this); - GregTech_API.sThaumcraftCompat = (IThaumcraftCompat) GT_Utility.callConstructor("gregtech.common.GT_ThaumcraftCompat", 0, null, GT_Values.D1, - new Object[0]); - for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) { + GregTech_API.sThaumcraftCompat = (IThaumcraftCompat) + GT_Utility.callConstructor("gregtech.common.GT_ThaumcraftCompat", 0, null, GT_Values.D1, new Object[0]); + for (FluidContainerRegistry.FluidContainerData tData : + FluidContainerRegistry.getRegisteredFluidContainerData()) { onFluidContainerRegistration(new FluidContainerRegistry.FluidContainerRegisterEvent(tData)); } try { for (String tOreName : OreDictionary.getOreNames()) { ItemStack tOreStack; - for (Iterator i$ = OreDictionary.getOres(tOreName).iterator(); i$.hasNext(); registerOre(new OreDictionary.OreRegisterEvent(tOreName, tOreStack))) { + for (Iterator i$ = OreDictionary.getOres(tOreName).iterator(); + i$.hasNext(); + registerOre(new OreDictionary.OreRegisterEvent(tOreName, tOreStack))) { tOreStack = (ItemStack) i$.next(); } } - } catch (Throwable e) {e.printStackTrace(GT_Log.err);} + } catch (Throwable e) { + e.printStackTrace(GT_Log.err); + } } - public void onPreLoad() { GT_Log.out.println("GT_Mod: Preload-Phase started!"); GT_Log.ore.println("GT_Mod: Preload-Phase started!"); @@ -467,7 +766,8 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG this.mIgnoreTcon = GregTech_API.sOPStuff.get(ConfigCategories.general, "ignoreTConstruct", true); this.mWireHeatingTicks = GregTech_API.sOPStuff.get(ConfigCategories.general, "WireHeatingTicks", 4); NetworkRegistry.INSTANCE.registerGuiHandler(GT_Values.GT, this); - for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) { + for (FluidContainerRegistry.FluidContainerData tData : + FluidContainerRegistry.getRegisteredFluidContainerData()) { if ((tData.filledContainer.getItem() == Items.potionitem) && (tData.filledContainer.getItemDamage() == 0)) { tData.fluid.amount = 0; break; @@ -515,7 +815,8 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG ItemList.FR_Bee_Drone.set(GT_ModHandler.getModItem(aTextForestry, "beeDroneGE", 1L)); ItemList.FR_Bee_Princess.set(GT_ModHandler.getModItem(aTextForestry, "beePrincessGE", 1L)); ItemList.FR_Bee_Queen.set(GT_ModHandler.getModItem(aTextForestry, "beeQueenGE", 1L)); - ItemList.FR_Tree_Sapling.set(GT_ModHandler.getModItem(aTextForestry, "sapling", 1L, GT_ModHandler.getModItem(aTextForestry, "saplingGE", 1L))); + ItemList.FR_Tree_Sapling.set(GT_ModHandler.getModItem( + aTextForestry, "sapling", 1L, GT_ModHandler.getModItem(aTextForestry, "saplingGE", 1L))); ItemList.FR_Butterfly.set(GT_ModHandler.getModItem(aTextForestry, "butterflyGE", 1L)); ItemList.FR_Larvae.set(GT_ModHandler.getModItem(aTextForestry, "beeLarvaeGE", 1L)); ItemList.FR_Serum.set(GT_ModHandler.getModItem(aTextForestry, "serumGE", 1L)); @@ -529,10 +830,12 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG ItemList.Bottle_Empty.set(new ItemStack(Items.glass_bottle, 1)); ItemList.Cell_Universal_Fluid.set(GT_ModHandler.getIC2Item("FluidCell", 1L)); - ItemList.Cell_Empty.set(GT_ModHandler.getIC2Item("cell", 1L, GT_ModHandler.getIC2Item("cellEmpty", 1L, GT_ModHandler.getIC2Item("emptyCell", 1L)))); + ItemList.Cell_Empty.set(GT_ModHandler.getIC2Item( + "cell", 1L, GT_ModHandler.getIC2Item("cellEmpty", 1L, GT_ModHandler.getIC2Item("emptyCell", 1L)))); ItemList.Cell_Water.set(GT_ModHandler.getIC2Item("waterCell", 1L, GT_ModHandler.getIC2Item("cellWater", 1L))); ItemList.Cell_Lava.set(GT_ModHandler.getIC2Item("lavaCell", 1L, GT_ModHandler.getIC2Item("cellLava", 1L))); - ItemList.Cell_Air.set(GT_ModHandler.getIC2Item("airCell", 1L, GT_ModHandler.getIC2Item("cellAir", 1L, GT_ModHandler.getIC2Item("cellOxygen", 1L)))); + ItemList.Cell_Air.set(GT_ModHandler.getIC2Item( + "airCell", 1L, GT_ModHandler.getIC2Item("cellAir", 1L, GT_ModHandler.getIC2Item("cellOxygen", 1L)))); ItemList.IC2_Item_Casing_Iron.set(GT_ModHandler.getIC2Item("casingiron", 1L)); ItemList.IC2_Item_Casing_Gold.set(GT_ModHandler.getIC2Item("casinggold", 1L)); @@ -542,7 +845,10 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG ItemList.IC2_Item_Casing_Lead.set(GT_ModHandler.getIC2Item("casinglead", 1L)); ItemList.IC2_Item_Casing_Steel.set(GT_ModHandler.getIC2Item("casingadviron", 1L)); ItemList.IC2_Spray_WeedEx.set(GT_ModHandler.getIC2Item("weedEx", 1L)); - ItemList.IC2_Fuel_Can_Empty.set(GT_ModHandler.getIC2Item("fuelCan", 1L, GT_ModHandler.getIC2Item("fuelCanEmpty", 1L, GT_ModHandler.getIC2Item("emptyFuelCan", 1L)))); + ItemList.IC2_Fuel_Can_Empty.set(GT_ModHandler.getIC2Item( + "fuelCan", + 1L, + GT_ModHandler.getIC2Item("fuelCanEmpty", 1L, GT_ModHandler.getIC2Item("emptyFuelCan", 1L)))); ItemList.IC2_Fuel_Can_Filled.set(GT_ModHandler.getIC2Item("filledFuelCan", 1L)); ItemList.IC2_Mixed_Metal_Ingot.set(GT_ModHandler.getIC2Item("mixedMetalIngot", 1L)); ItemList.IC2_Fertilizer.set(GT_ModHandler.getIC2Item("fertilizer", 1L)); @@ -551,7 +857,8 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG ItemList.IC2_Hops.set(GT_ModHandler.getIC2Item("hops", 1L)); ItemList.IC2_Resin.set(GT_ModHandler.getIC2Item("resin", 1L)); ItemList.IC2_Plantball.set(GT_ModHandler.getIC2Item("plantBall", 1L)); - ItemList.IC2_PlantballCompressed.set(GT_ModHandler.getIC2Item("compressedPlantBall", 1L, ItemList.IC2_Plantball.get(1L))); + ItemList.IC2_PlantballCompressed.set( + GT_ModHandler.getIC2Item("compressedPlantBall", 1L, ItemList.IC2_Plantball.get(1L))); ItemList.IC2_Crop_Seeds.set(GT_ModHandler.getIC2Item("cropSeed", 1L)); ItemList.IC2_Grin_Powder.set(GT_ModHandler.getIC2Item("grinPowder", 1L)); ItemList.IC2_Energium_Dust.set(GT_ModHandler.getIC2Item("energiumDust", 1L)); @@ -561,7 +868,8 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG ItemList.IC2_Food_Can_Empty.set(GT_ModHandler.getIC2Item("tinCan", 1L)); ItemList.IC2_Food_Can_Filled.set(GT_ModHandler.getIC2Item("filledTinCan", 1L, 0)); ItemList.IC2_Food_Can_Spoiled.set(GT_ModHandler.getIC2Item("filledTinCan", 1L, 1)); - ItemList.IC2_Industrial_Diamond.set(GT_ModHandler.getIC2Item("industrialDiamond", 1L, new ItemStack(Items.diamond, 1))); + ItemList.IC2_Industrial_Diamond.set( + GT_ModHandler.getIC2Item("industrialDiamond", 1L, new ItemStack(Items.diamond, 1))); ItemList.IC2_Compressed_Coal_Ball.set(GT_ModHandler.getIC2Item("compressedCoalBall", 1L)); ItemList.IC2_Compressed_Coal_Chunk.set(GT_ModHandler.getIC2Item("coalChunk", 1L)); ItemList.IC2_ShaftIron.set(GT_ModHandler.getIC2Item("ironshaft", 1L)); @@ -606,8 +914,6 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG OrePrefixes.cellMolten.mContainerItem = ItemList.Cell_Empty.get(1L); OrePrefixes.cell.mContainerItem = ItemList.Cell_Empty.get(1L); - - GT_ModHandler.sNonReplaceableItems.add(new ItemStack(Items.bow, 1, 32767)); GT_ModHandler.sNonReplaceableItems.add(new ItemStack(Items.fishing_rod, 1, 32767)); GT_ModHandler.sNonReplaceableItems.add(ItemList.IC2_ForgeHammer.getWithDamage(1L, 32767L)); @@ -630,7 +936,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("orangePainter", 1L, 32767)); GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("whitePainter", 1L, 32767)); GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("cfPack", 1L, 32767)); - //GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("jetpack", 1L, 32767)); + // GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("jetpack", 1L, 32767)); GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("treetap", 1L, 32767)); GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("weedEx", 1L, 32767)); GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("staticBoots", 1L, 32767)); @@ -655,8 +961,10 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(MOD_ID_TF, "item.yetiPlate", 1L, 32767)); GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(MOD_ID_TF, "item.yetiLegs", 1L, 32767)); GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(MOD_ID_TF, "item.yetiBoots", 1L, 32767)); - GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem("appliedenergistics2", "item.ToolCertusQuartzCuttingKnife", 1L, 32767)); - GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem("appliedenergistics2", "item.ToolNetherQuartzCuttingKnife", 1L, 32767)); + GT_ModHandler.sNonReplaceableItems.add( + GT_ModHandler.getModItem("appliedenergistics2", "item.ToolCertusQuartzCuttingKnife", 1L, 32767)); + GT_ModHandler.sNonReplaceableItems.add( + GT_ModHandler.getModItem("appliedenergistics2", "item.ToolNetherQuartzCuttingKnife", 1L, 32767)); GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(aTextForestry, "apiaristHelmet", 1L, 32767)); GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(aTextForestry, "apiaristChest", 1L, 32767)); GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(aTextForestry, "apiaristLegs", 1L, 32767)); @@ -665,11 +973,21 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(aTextForestry, "frameImpregnated", 1L, 32767)); GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(aTextForestry, "frameProven", 1L, 32767)); GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(aTextForestry, "waxCast", 1L, 32767)); - GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem("GalacticraftCore", "item.sensorGlasses", 1L, 32767)); - GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem("IC2NuclearControl", "ItemToolThermometer", 1L, 32767)); - - RecipeSorter.register("gregtech:shaped", GT_Shaped_Recipe.class, RecipeSorter.Category.SHAPED, "after:minecraft:shaped before:minecraft:shapeless"); - RecipeSorter.register("gregtech:shapeless", GT_Shapeless_Recipe.class, RecipeSorter.Category.SHAPELESS, "after:minecraft:shapeless"); + GT_ModHandler.sNonReplaceableItems.add( + GT_ModHandler.getModItem("GalacticraftCore", "item.sensorGlasses", 1L, 32767)); + GT_ModHandler.sNonReplaceableItems.add( + GT_ModHandler.getModItem("IC2NuclearControl", "ItemToolThermometer", 1L, 32767)); + + RecipeSorter.register( + "gregtech:shaped", + GT_Shaped_Recipe.class, + RecipeSorter.Category.SHAPED, + "after:minecraft:shaped before:minecraft:shapeless"); + RecipeSorter.register( + "gregtech:shapeless", + GT_Shapeless_Recipe.class, + RecipeSorter.Category.SHAPELESS, + "after:minecraft:shapeless"); // Register chunk manager with Forge GT_ChunkManager.init(); @@ -678,24 +996,39 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG public void onLoad() { GT_Log.out.println("GT_Mod: Beginning Load-Phase."); GT_Log.ore.println("GT_Mod: Beginning Load-Phase."); - GT_OreDictUnificator.registerOre("cropChilipepper", GT_ModHandler.getModItem("magicalcrops", "magicalcrops_CropProduce", 1L, 2)); - GT_OreDictUnificator.registerOre("cropTomato", GT_ModHandler.getModItem("magicalcrops", "magicalcrops_CropProduce", 1L, 8)); - GT_OreDictUnificator.registerOre("cropGrape", GT_ModHandler.getModItem("magicalcrops", "magicalcrops_CropProduce", 1L, 4)); + GT_OreDictUnificator.registerOre( + "cropChilipepper", GT_ModHandler.getModItem("magicalcrops", "magicalcrops_CropProduce", 1L, 2)); + GT_OreDictUnificator.registerOre( + "cropTomato", GT_ModHandler.getModItem("magicalcrops", "magicalcrops_CropProduce", 1L, 8)); + GT_OreDictUnificator.registerOre( + "cropGrape", GT_ModHandler.getModItem("magicalcrops", "magicalcrops_CropProduce", 1L, 4)); GT_OreDictUnificator.registerOre("cropTea", GT_ModHandler.getModItem("ganyssurface", "teaLeaves", 1L, 0)); // Clay buckets, which don't get registered until Iguana Tweaks pre-init if (Loader.isModLoaded("IguanaTweaksTConstruct")) { - OrePrefixes.bucketClay.mContainerItem = GT_ModHandler.getModItem("IguanaTweaksTConstruct", "clayBucketFired", 1L, 0); - GT_OreDictUnificator.set(OrePrefixes.bucketClay, Materials.Empty, GT_ModHandler.getModItem("IguanaTweaksTConstruct", "clayBucketFired", 1L, 0)); - GT_OreDictUnificator.set(OrePrefixes.bucketClay, Materials.Water, GT_ModHandler.getModItem("IguanaTweaksTConstruct", "clayBucketWater", 1L, 0)); - GT_OreDictUnificator.set(OrePrefixes.bucketClay, Materials.Lava, GT_ModHandler.getModItem("IguanaTweaksTConstruct", "clayBucketLava", 1L, 0)); - GT_OreDictUnificator.set(OrePrefixes.bucketClay, Materials.Milk, GT_ModHandler.getModItem("IguanaTweaksTConstruct", "clayBucketMilk", 1L, 0)); - - FluidContainerRegistry.registerFluidContainer( - new FluidContainerRegistry.FluidContainerData( - Materials.Milk.getFluid(1000L), - GT_OreDictUnificator.get(OrePrefixes.bucketClay, Materials.Milk, 1L), - GT_OreDictUnificator.get(OrePrefixes.bucketClay, Materials.Empty, 1L))); + OrePrefixes.bucketClay.mContainerItem = + GT_ModHandler.getModItem("IguanaTweaksTConstruct", "clayBucketFired", 1L, 0); + GT_OreDictUnificator.set( + OrePrefixes.bucketClay, + Materials.Empty, + GT_ModHandler.getModItem("IguanaTweaksTConstruct", "clayBucketFired", 1L, 0)); + GT_OreDictUnificator.set( + OrePrefixes.bucketClay, + Materials.Water, + GT_ModHandler.getModItem("IguanaTweaksTConstruct", "clayBucketWater", 1L, 0)); + GT_OreDictUnificator.set( + OrePrefixes.bucketClay, + Materials.Lava, + GT_ModHandler.getModItem("IguanaTweaksTConstruct", "clayBucketLava", 1L, 0)); + GT_OreDictUnificator.set( + OrePrefixes.bucketClay, + Materials.Milk, + GT_ModHandler.getModItem("IguanaTweaksTConstruct", "clayBucketMilk", 1L, 0)); + + FluidContainerRegistry.registerFluidContainer(new FluidContainerRegistry.FluidContainerData( + Materials.Milk.getFluid(1000L), + GT_OreDictUnificator.get(OrePrefixes.bucketClay, Materials.Milk, 1L), + GT_OreDictUnificator.get(OrePrefixes.bucketClay, Materials.Empty, 1L))); } // IC2 Hazmat @@ -712,7 +1045,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG addFullHazmatToIC2Item("quantumLeggings"); addFullHazmatToIC2Item("quantumBoots"); - //GraviSuite Hazmat + // GraviSuite Hazmat addFullHazmatToGeneralItem("GraviSuite", "graviChestPlate", 1L); addFullHazmatToGeneralItem("GraviSuite", "advNanoChestPlate", 1L); @@ -736,12 +1069,12 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG addFullHazmatToGeneralItem("DraconicEvolution", "wyvernLeggs", 1L, 0); addFullHazmatToGeneralItem("DraconicEvolution", "wyvernChest", 1L, 0); - //AdvancedSolarPanel + // AdvancedSolarPanel addFullHazmatToGeneralItem("AdvancedSolarPanel", "advanced_solar_helmet", 1L); addFullHazmatToGeneralItem("AdvancedSolarPanel", "hybrid_solar_helmet", 1L); addFullHazmatToGeneralItem("AdvancedSolarPanel", "ultimate_solar_helmet", 1L); - //TaintedMagic Hazmat + // TaintedMagic Hazmat addFullHazmatToGeneralItem("TaintedMagic", "ItemVoidwalkerBoots", 1L); addFullHazmatToGeneralItem("TaintedMagic", "ItemShadowFortressHelmet", 1L); addFullHazmatToGeneralItem("TaintedMagic", "ItemShadowFortressChestplate", 1L); @@ -751,19 +1084,19 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG addFullHazmatToGeneralItem("TaintedMagic", "ItemVoidFortressLeggings", 1L); addFullHazmatToGeneralItem("TaintedMagic", "ItemVoidmetalGoggles", 1L); - //WitchingGadgets Hazmat + // WitchingGadgets Hazmat addFullHazmatToGeneralItem("WitchingGadgets", "item.WG_PrimordialHelm", 1L); addFullHazmatToGeneralItem("WitchingGadgets", "item.WG_PrimordialChest", 1L); addFullHazmatToGeneralItem("WitchingGadgets", "item.WG_PrimordialLegs", 1L); addFullHazmatToGeneralItem("WitchingGadgets", "item.WG_PrimordialBoots", 1L); - //ThaumicTinkerer Hazmat + // ThaumicTinkerer Hazmat addFullHazmatToGeneralItem("ThaumicTinkerer", "ichorclothChestGem", 1L); addFullHazmatToGeneralItem("ThaumicTinkerer", "ichorclothBootsGem", 1L); addFullHazmatToGeneralItem("ThaumicTinkerer", "ichorclothHelmGem", 1L); addFullHazmatToGeneralItem("ThaumicTinkerer", "ichorclothLegsGem", 1L); - //GalaxySpace Hazmat + // GalaxySpace Hazmat addFullHazmatToGeneralItem("GalaxySpace", "item.spacesuit_helmet", 1L); addFullHazmatToGeneralItem("GalaxySpace", "item.spacesuit_helmetglasses", 1L); addFullHazmatToGeneralItem("GalaxySpace", "item.spacesuit_plate", 1L); @@ -772,20 +1105,21 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG addFullHazmatToGeneralItem("GalaxySpace", "item.spacesuit_boots", 1L); addFullHazmatToGeneralItem("GalaxySpace", "item.spacesuit_gravityboots", 1L); - //Extra Hazmat + // Extra Hazmat GregTech_API.sElectroHazmatList.add(new ItemStack(Items.chainmail_helmet, 1, W)); GregTech_API.sElectroHazmatList.add(new ItemStack(Items.chainmail_chestplate, 1, W)); GregTech_API.sElectroHazmatList.add(new ItemStack(Items.chainmail_leggings, 1, W)); GregTech_API.sElectroHazmatList.add(new ItemStack(Items.chainmail_boots, 1, W)); - //Infinity Hazmat + // Infinity Hazmat addFullHazmatToGeneralItem("Avaritia", "Infinity_Helm", 1L); addFullHazmatToGeneralItem("Avaritia", "Infinity_Chest", 1L); addFullHazmatToGeneralItem("Avaritia", "Infinity_Pants", 1L); addFullHazmatToGeneralItem("Avaritia", "Infinity_Shoes", 1L); GregTech_API.sLoadStarted = true; - for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) { + for (FluidContainerRegistry.FluidContainerData tData : + FluidContainerRegistry.getRegisteredFluidContainerData()) { if ((tData.filledContainer.getItem() == Items.potionitem) && (tData.filledContainer.getItemDamage() == 0)) { tData.fluid.amount = 0; break; @@ -794,7 +1128,11 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG GT_LanguageManager.writePlaceholderStrings(); } - public static long tBits = GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.ONLY_ADD_IF_RESULT_IS_NOT_NULL | GT_ModHandler.RecipeBits.NOT_REMOVABLE; + public static long tBits = GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED + | GT_ModHandler.RecipeBits.ONLY_ADD_IF_RESULT_IS_NOT_NULL + | GT_ModHandler.RecipeBits.NOT_REMOVABLE; + public void onPostLoad() { GT_Log.out.println("GT_Mod: Beginning PostLoad-Phase."); GT_Log.ore.println("GT_Mod: Beginning PostLoad-Phase."); @@ -808,8 +1146,10 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG GT_MetaGenerated_Item_98.init(); GT_OreDictUnificator.addItemData(new ItemStack(Items.iron_door, 1), new ItemData(Materials.Iron, 21772800L)); - GT_OreDictUnificator.addItemData(new ItemStack(Items.wooden_door, 1, 32767), new ItemData(Materials.Wood, 21772800L)); - for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) { + GT_OreDictUnificator.addItemData( + new ItemStack(Items.wooden_door, 1, 32767), new ItemData(Materials.Wood, 21772800L)); + for (FluidContainerRegistry.FluidContainerData tData : + FluidContainerRegistry.getRegisteredFluidContainerData()) { if ((tData.filledContainer.getItem() == Items.potionitem) && (tData.filledContainer.getItemDamage() == 0)) { tData.fluid.amount = 0; break; @@ -824,44 +1164,74 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG } } } - } catch (Throwable e) {e.printStackTrace(GT_Log.err);} + } catch (Throwable e) { + e.printStackTrace(GT_Log.err); + } GT_Log.out.println("GT_Mod: Adding Tool Usage Crafting Recipes for OreDict Items."); for (Materials aMaterial : Materials.values()) { if ((aMaterial.mUnificatable) && (aMaterial.mMaterialInto == aMaterial)) { - GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial.mMacerateInto, 1L), tBits, new Object[]{"h", "X", - 'X', OrePrefixes.crushedCentrifuged.get(aMaterial)}); - GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial.mMacerateInto, 1L), tBits, new Object[]{"h", "X", - 'X', OrePrefixes.crystalline.get(aMaterial)}); - GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial.mMacerateInto, 1L), tBits, new Object[]{"h", "X", - 'X', OrePrefixes.crystal.get(aMaterial)}); - GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dustPure, aMaterial.mMacerateInto, 1L), tBits, new Object[]{"h", "X", - 'X', OrePrefixes.crushedPurified.get(aMaterial)}); - GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dustPure, aMaterial.mMacerateInto, 1L), tBits, new Object[]{"h", "X", - 'X', OrePrefixes.cleanGravel.get(aMaterial)}); - GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dustPure, aMaterial.mMacerateInto, 1L), tBits, new Object[]{"h", "X", - 'X', OrePrefixes.reduced.get(aMaterial)}); - GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dustImpure, aMaterial.mMacerateInto, 1L), tBits, new Object[]{"h", "X", - 'X', OrePrefixes.clump.get(aMaterial)}); - GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dustImpure, aMaterial.mMacerateInto, 1L), tBits, new Object[]{"h", "X", - 'X', OrePrefixes.shard.get(aMaterial)}); - GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dustImpure, aMaterial.mMacerateInto, 1L), tBits, new Object[]{"h", "X", - 'X', OrePrefixes.crushed.get(aMaterial)}); - GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dustImpure, aMaterial.mMacerateInto, 1L), tBits, new Object[]{"h", "X", - 'X', OrePrefixes.dirtyGravel.get(aMaterial)}); - GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dustSmall, aMaterial, 4L), tBits, - new Object[]{" X ", 'X', OrePrefixes.dust.get(aMaterial)}); - GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dustTiny, aMaterial, 9L), tBits, - new Object[]{"X ", 'X', OrePrefixes.dust.get(aMaterial)}); - GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial, 1L), tBits, - new Object[]{"XX", "XX", 'X', OrePrefixes.dustSmall.get(aMaterial)}); - GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial, 1L), tBits, - new Object[]{"XXX", "XXX", "XXX", 'X', OrePrefixes.dustTiny.get(aMaterial)}); + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial.mMacerateInto, 1L), + tBits, + new Object[] {"h", "X", 'X', OrePrefixes.crushedCentrifuged.get(aMaterial)}); + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial.mMacerateInto, 1L), + tBits, + new Object[] {"h", "X", 'X', OrePrefixes.crystalline.get(aMaterial)}); + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial.mMacerateInto, 1L), + tBits, + new Object[] {"h", "X", 'X', OrePrefixes.crystal.get(aMaterial)}); + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.dustPure, aMaterial.mMacerateInto, 1L), + tBits, + new Object[] {"h", "X", 'X', OrePrefixes.crushedPurified.get(aMaterial)}); + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.dustPure, aMaterial.mMacerateInto, 1L), + tBits, + new Object[] {"h", "X", 'X', OrePrefixes.cleanGravel.get(aMaterial)}); + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.dustPure, aMaterial.mMacerateInto, 1L), + tBits, + new Object[] {"h", "X", 'X', OrePrefixes.reduced.get(aMaterial)}); + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.dustImpure, aMaterial.mMacerateInto, 1L), + tBits, + new Object[] {"h", "X", 'X', OrePrefixes.clump.get(aMaterial)}); + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.dustImpure, aMaterial.mMacerateInto, 1L), + tBits, + new Object[] {"h", "X", 'X', OrePrefixes.shard.get(aMaterial)}); + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.dustImpure, aMaterial.mMacerateInto, 1L), + tBits, + new Object[] {"h", "X", 'X', OrePrefixes.crushed.get(aMaterial)}); + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.dustImpure, aMaterial.mMacerateInto, 1L), + tBits, + new Object[] {"h", "X", 'X', OrePrefixes.dirtyGravel.get(aMaterial)}); + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.dustSmall, aMaterial, 4L), + tBits, + new Object[] {" X ", 'X', OrePrefixes.dust.get(aMaterial)}); + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.dustTiny, aMaterial, 9L), + tBits, + new Object[] {"X ", 'X', OrePrefixes.dust.get(aMaterial)}); + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial, 1L), + tBits, + new Object[] {"XX", "XX", 'X', OrePrefixes.dustSmall.get(aMaterial)}); + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial, 1L), + tBits, + new Object[] {"XXX", "XXX", "XXX", 'X', OrePrefixes.dustTiny.get(aMaterial)}); } } } - public void onServerAboutToStart(){ - dimensionWisePollution.clear();//!!! IMPORTANT for map switching... + public void onServerAboutToStart() { + dimensionWisePollution.clear(); // !!! IMPORTANT for map switching... GT_ChunkAssociatedData.clearAll(); } @@ -871,7 +1241,8 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG this.mUniverse = null; this.isFirstServerWorldTick = true; - for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) { + for (FluidContainerRegistry.FluidContainerData tData : + FluidContainerRegistry.getRegisteredFluidContainerData()) { if ((tData.filledContainer.getItem() == Items.potionitem) && (tData.filledContainer.getItemDamage() == 0)) { tData.fluid.amount = 0; break; @@ -885,14 +1256,17 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG } } } - } catch (Throwable e) {e.printStackTrace(GT_Log.err);} + } catch (Throwable e) { + e.printStackTrace(GT_Log.err); + } } public void onServerStarted() { GregTech_API.sWirelessRedstone.clear(); GT_FluidStack.fixAllThoseFuckingFluidIDs(); - GT_Log.out.println("GT_Mod: Cleaning up all OreDict Crafting Recipes, which have an empty List in them, since they are never meeting any Condition."); + GT_Log.out.println( + "GT_Mod: Cleaning up all OreDict Crafting Recipes, which have an empty List in them, since they are never meeting any Condition."); List tList = CraftingManager.getInstance().getRecipeList(); for (int i = 0; i < tList.size(); i++) { if ((tList.get(i) instanceof ShapedOreRecipe)) { @@ -927,16 +1301,17 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG } } } - } catch (Throwable e) {e.printStackTrace(GT_Log.err);} + } catch (Throwable e) { + e.printStackTrace(GT_Log.err); + } } this.mUniverse = null; - //GT_ChunkAssociatedData.saveAll(); todo: figure out if this is needed + // GT_ChunkAssociatedData.saveAll(); todo: figure out if this is needed } @SubscribeEvent - public void onClientConnectedToServerEvent(FMLNetworkEvent.ClientConnectedToServerEvent aEvent) { - } + public void onClientConnectedToServerEvent(FMLNetworkEvent.ClientConnectedToServerEvent aEvent) {} public int getReloadCount() { return 0; @@ -944,9 +1319,11 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG @SubscribeEvent public void onArrowNockEvent(ArrowNockEvent aEvent) { - if ((!aEvent.isCanceled()) && (GT_Utility.isStackValid(aEvent.result)) + if ((!aEvent.isCanceled()) + && (GT_Utility.isStackValid(aEvent.result)) && (GT_Utility.getProjectile(SubTag.PROJECTILE_ARROW, aEvent.entityPlayer.inventory) != null)) { - aEvent.entityPlayer.setItemInUse(aEvent.result, aEvent.result.getItem().getMaxItemUseDuration(aEvent.result)); + aEvent.entityPlayer.setItemInUse( + aEvent.result, aEvent.result.getItem().getMaxItemUseDuration(aEvent.result)); aEvent.setCanceled(true); } } @@ -954,7 +1331,10 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG @SubscribeEvent public void onArrowLooseEvent(ArrowLooseEvent aEvent) { ItemStack aArrow = GT_Utility.getProjectile(SubTag.PROJECTILE_ARROW, aEvent.entityPlayer.inventory); - if ((!aEvent.isCanceled()) && (GT_Utility.isStackValid(aEvent.bow)) && (aArrow != null) && ((aEvent.bow.getItem() instanceof ItemBow))) { + if ((!aEvent.isCanceled()) + && (GT_Utility.isStackValid(aEvent.bow)) + && (aArrow != null) + && ((aEvent.bow.getItem() instanceof ItemBow))) { float tSpeed = aEvent.charge / 20.0F; tSpeed = (tSpeed * tSpeed + tSpeed * 2.0F) / 3.0F; if (tSpeed < 0.1D) { @@ -963,8 +1343,13 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG if (tSpeed > 1.0D) { tSpeed = 1.0F; } - EntityArrow tArrowEntity = ((IProjectileItem) aArrow.getItem()).getProjectile(SubTag.PROJECTILE_ARROW, aArrow, aEvent.entityPlayer.worldObj, - aEvent.entityPlayer, tSpeed * 2.0F); + EntityArrow tArrowEntity = ((IProjectileItem) aArrow.getItem()) + .getProjectile( + SubTag.PROJECTILE_ARROW, + aArrow, + aEvent.entityPlayer.worldObj, + aEvent.entityPlayer, + tSpeed * 2.0F); if (tSpeed >= 1.0F) { tArrowEntity.setIsCritical(true); } @@ -1007,7 +1392,8 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG @SubscribeEvent public void onEndermanTeleportEvent(EnderTeleportEvent aEvent) { - if (((aEvent.entityLiving instanceof EntityEnderman)) && (aEvent.entityLiving.getActivePotionEffect(Potion.weakness) != null)) { + if (((aEvent.entityLiving instanceof EntityEnderman)) + && (aEvent.entityLiving.getActivePotionEffect(Potion.weakness) != null)) { aEvent.setCanceled(true); } } @@ -1016,13 +1402,17 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG public void onEntitySpawningEvent(EntityJoinWorldEvent aEvent) { if ((aEvent.entity != null) && (!aEvent.entity.worldObj.isRemote)) { if ((aEvent.entity instanceof EntityItem)) { - ((EntityItem) aEvent.entity).setEntityItemStack(GT_OreDictUnificator.get(((EntityItem) aEvent.entity).getEntityItem())); + ((EntityItem) aEvent.entity) + .setEntityItemStack(GT_OreDictUnificator.get(((EntityItem) aEvent.entity).getEntityItem())); } - if ((this.mSkeletonsShootGTArrows > 0) && (aEvent.entity.getClass() == EntityArrow.class) + if ((this.mSkeletonsShootGTArrows > 0) + && (aEvent.entity.getClass() == EntityArrow.class) && (aEvent.entity.worldObj.rand.nextInt(this.mSkeletonsShootGTArrows) == 0) && ((((EntityArrow) aEvent.entity).shootingEntity instanceof EntitySkeleton))) { - aEvent.entity.worldObj.spawnEntityInWorld(new GT_Entity_Arrow((EntityArrow) aEvent.entity, OrePrefixes.arrowGtWood.mPrefixedItems - .get(aEvent.entity.worldObj.rand.nextInt(OrePrefixes.arrowGtWood.mPrefixedItems.size())))); + aEvent.entity.worldObj.spawnEntityInWorld(new GT_Entity_Arrow( + (EntityArrow) aEvent.entity, + OrePrefixes.arrowGtWood.mPrefixedItems.get( + aEvent.entity.worldObj.rand.nextInt(OrePrefixes.arrowGtWood.mPrefixedItems.size())))); aEvent.entity.setDead(); } } @@ -1030,7 +1420,9 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG @SubscribeEvent public void onOreGenEvent(OreGenEvent.GenerateMinable aGenerator) { - if ((this.mDisableVanillaOres) && ((aGenerator.generator instanceof WorldGenMinable)) && (PREVENTED_ORES.contains(aGenerator.type))) { + if ((this.mDisableVanillaOres) + && ((aGenerator.generator instanceof WorldGenMinable)) + && (PREVENTED_ORES.contains(aGenerator.type))) { aGenerator.setResult(Result.DENY); } } @@ -1041,18 +1433,28 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG @SubscribeEvent public void onPlayerInteraction(PlayerInteractEvent aEvent) { - if ((aEvent.entityPlayer == null) || (aEvent.entityPlayer.worldObj == null) || (aEvent.action == null) || (aEvent.world.provider == null)) { + if ((aEvent.entityPlayer == null) + || (aEvent.entityPlayer.worldObj == null) + || (aEvent.action == null) + || (aEvent.world.provider == null)) { return; } - if ((!aEvent.entityPlayer.worldObj.isRemote) && (aEvent.action != PlayerInteractEvent.Action.RIGHT_CLICK_AIR) + if ((!aEvent.entityPlayer.worldObj.isRemote) + && (aEvent.action != PlayerInteractEvent.Action.RIGHT_CLICK_AIR) && (GT_Log.pal != null)) { - this.mBufferedPlayerActivity.add(getDataAndTime() + ";" + aEvent.action.name() + ";" + aEvent.entityPlayer.getDisplayName() + ";DIM:" - + aEvent.world.provider.dimensionId + ";" + aEvent.x + ";" + aEvent.y + ";" + aEvent.z + ";|;" + aEvent.x / 10 + ";" + aEvent.y / 10 + ";" - + aEvent.z / 10); + this.mBufferedPlayerActivity.add( + getDataAndTime() + ";" + aEvent.action.name() + ";" + aEvent.entityPlayer.getDisplayName() + ";DIM:" + + aEvent.world.provider.dimensionId + ";" + aEvent.x + ";" + aEvent.y + ";" + aEvent.z + + ";|;" + aEvent.x / 10 + ";" + aEvent.y / 10 + ";" + + aEvent.z / 10); } ItemStack aStack = aEvent.entityPlayer.getCurrentEquippedItem(); - if ((aStack != null) && (aEvent.action == PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK) && (aStack.getItem() == Items.flint_and_steel)) { - if ((!aEvent.world.isRemote) && (!aEvent.entityPlayer.capabilities.isCreativeMode) && (aEvent.world.rand.nextInt(100) >= this.mFlintChance)) { + if ((aStack != null) + && (aEvent.action == PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK) + && (aStack.getItem() == Items.flint_and_steel)) { + if ((!aEvent.world.isRemote) + && (!aEvent.entityPlayer.capabilities.isCreativeMode) + && (aEvent.world.rand.nextInt(100) >= this.mFlintChance)) { aEvent.setCanceled(true); aStack.damageItem(1, aEvent.entityPlayer); if (aStack.getItemDamage() >= aStack.getMaxDamage()) { @@ -1070,15 +1472,28 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG public void onBlockHarvestingEvent(BlockEvent.HarvestDropsEvent aEvent) { if (aEvent.harvester != null) { if ((!aEvent.world.isRemote) && (GT_Log.pal != null)) { - this.mBufferedPlayerActivity.add(getDataAndTime() + ";HARVEST_BLOCK;" + aEvent.harvester.getDisplayName() + ";DIM:" - + aEvent.world.provider.dimensionId + ";" + aEvent.x + ";" + aEvent.y + ";" + aEvent.z + ";|;" + aEvent.x / 10 + ";" + aEvent.y / 10 - + ";" + aEvent.z / 10); + this.mBufferedPlayerActivity.add( + getDataAndTime() + ";HARVEST_BLOCK;" + aEvent.harvester.getDisplayName() + ";DIM:" + + aEvent.world.provider.dimensionId + ";" + aEvent.x + ";" + aEvent.y + ";" + aEvent.z + + ";|;" + aEvent.x / 10 + ";" + aEvent.y / 10 + + ";" + aEvent.z / 10); } ItemStack aStack = aEvent.harvester.getCurrentEquippedItem(); if (aStack != null) { if ((aStack.getItem() instanceof GT_MetaGenerated_Tool)) { - ((GT_MetaGenerated_Tool) aStack.getItem()).onHarvestBlockEvent(aEvent.drops, aStack, aEvent.harvester, aEvent.block, aEvent.x, aEvent.y, - aEvent.z, (byte) aEvent.blockMetadata, aEvent.fortuneLevel, aEvent.isSilkTouching, aEvent); + ((GT_MetaGenerated_Tool) aStack.getItem()) + .onHarvestBlockEvent( + aEvent.drops, + aStack, + aEvent.harvester, + aEvent.block, + aEvent.x, + aEvent.y, + aEvent.z, + (byte) aEvent.blockMetadata, + aEvent.fortuneLevel, + aEvent.isSilkTouching, + aEvent); } if (EnchantmentHelper.getEnchantmentLevel(Enchantment.fireAspect.effectId, aStack) > 2) { try { @@ -1090,7 +1505,9 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG GT_Utility.setStack(tDrop, tSmeltingOutput); } } - } catch (Throwable e) {e.printStackTrace(GT_Log.err);} + } catch (Throwable e) { + e.printStackTrace(GT_Log.err); + } } } } @@ -1106,13 +1523,17 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG } else if (aMod.equals("gregtech")) { aMod = "UNKNOWN"; } - if ((aEvent == null) || (aEvent.Ore == null) || (aEvent.Ore.getItem() == null) || (aEvent.Name == null) || (aEvent.Name.isEmpty()) + if ((aEvent == null) + || (aEvent.Ore == null) + || (aEvent.Ore.getItem() == null) + || (aEvent.Name == null) + || (aEvent.Name.isEmpty()) || (aEvent.Name.replaceAll("_", "").length() - aEvent.Name.length() == 9)) { if (aOriginalMod.equals("gregtech")) { aOriginalMod = "UNKNOWN"; } - GT_Log.ore - .println(aOriginalMod + GT_Log.ore.println( + aOriginalMod + " did something very bad! The registration is too invalid to even be shown properly. This happens only if you register null, invalid Items, empty Strings or even nonexisting Events to the OreDict."); throw new IllegalArgumentException( aOriginalMod @@ -1121,8 +1542,10 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG try { aEvent.Ore.stackSize = 1; if (this.mIgnoreTcon || aEvent.Ore.getUnlocalizedName().startsWith("item.oreberry")) { - if ((aOriginalMod.toLowerCase(Locale.ENGLISH).contains("xycraft")) || (aOriginalMod.toLowerCase(Locale.ENGLISH).contains("tconstruct")) - || ((aOriginalMod.toLowerCase(Locale.ENGLISH).contains("natura")) && (!aOriginalMod.toLowerCase(Locale.ENGLISH).contains("natural")))) { + if ((aOriginalMod.toLowerCase(Locale.ENGLISH).contains("xycraft")) + || (aOriginalMod.toLowerCase(Locale.ENGLISH).contains("tconstruct")) + || ((aOriginalMod.toLowerCase(Locale.ENGLISH).contains("natura")) + && (!aOriginalMod.toLowerCase(Locale.ENGLISH).contains("natural")))) { if (GT_Values.D1) { GT_Log.ore.println(aMod + " -> " + aEvent.Name + " is getting ignored, because of racism. :P"); } @@ -1130,10 +1553,13 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG } } String tModToName = aMod + " -> " + aEvent.Name; - if ((this.mOreDictActivated) || (GregTech_API.sPostloadStarted) || ((this.mSortToTheEnd) && (GregTech_API.sLoadFinished))) { + if ((this.mOreDictActivated) + || (GregTech_API.sPostloadStarted) + || ((this.mSortToTheEnd) && (GregTech_API.sLoadFinished))) { tModToName = aOriginalMod + " --Late--> " + aEvent.Name; } - if (((aEvent.Ore.getItem() instanceof ItemBlock)) || (GT_Utility.getBlockFromStack(aEvent.Ore) != Blocks.air)) { + if (((aEvent.Ore.getItem() instanceof ItemBlock)) + || (GT_Utility.getBlockFromStack(aEvent.Ore) != Blocks.air)) { GT_OreDictUnificator.addToBlacklist(aEvent.Ore); } this.mRegisteredOres.add(aEvent.Ore); @@ -1148,98 +1574,87 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG } return; } - }else if(this.mIgnoredNames.contains(aEvent.Name)){ + } else if (this.mIgnoredNames.contains(aEvent.Name)) { GT_Log.ore.println(tModToName + " is getting ignored via hardcode."); return; - } - else if (aEvent.Name.equals("stone")) { + } else if (aEvent.Name.equals("stone")) { GT_OreDictUnificator.registerOre("stoneSmooth", aEvent.Ore); return; - } - else if (aEvent.Name.equals("cobblestone")) { + } else if (aEvent.Name.equals("cobblestone")) { GT_OreDictUnificator.registerOre("stoneCobble", aEvent.Ore); return; - } - else if ((aEvent.Name.contains("|")) || (aEvent.Name.contains("*")) || (aEvent.Name.contains(":")) || (aEvent.Name.contains(".")) + } else if ((aEvent.Name.contains("|")) + || (aEvent.Name.contains("*")) + || (aEvent.Name.contains(":")) + || (aEvent.Name.contains(".")) || (aEvent.Name.contains("$"))) { GT_Log.ore.println(tModToName + " is using a private Prefix and is therefor getting ignored properly."); return; - } - else if (aEvent.Name.equals("copperWire")) { + } else if (aEvent.Name.equals("copperWire")) { GT_OreDictUnificator.registerOre(OreDictNames.craftingWireCopper, aEvent.Ore); - } - else if (aEvent.Name.equals("oreHeeEndrium")) { + } else if (aEvent.Name.equals("oreHeeEndrium")) { GT_OreDictUnificator.registerOre(OrePrefixes.ore, Materials.HeeEndium, aEvent.Ore); - } - else if (aEvent.Name.equals("sheetPlastic")) { + } else if (aEvent.Name.equals("sheetPlastic")) { GT_OreDictUnificator.registerOre(OrePrefixes.plate, Materials.Plastic, aEvent.Ore); - } - else if (aEvent.Name.startsWith("shard")) { + } else if (aEvent.Name.startsWith("shard")) { if (aEvent.Name.equals("shardAir")) { GT_OreDictUnificator.registerOre(OrePrefixes.gem, Materials.InfusedAir, aEvent.Ore); return; - } - else if (aEvent.Name.equals("shardWater")) { + } else if (aEvent.Name.equals("shardWater")) { GT_OreDictUnificator.registerOre(OrePrefixes.gem, Materials.InfusedWater, aEvent.Ore); return; - } - else if (aEvent.Name.equals("shardFire")) { + } else if (aEvent.Name.equals("shardFire")) { GT_OreDictUnificator.registerOre(OrePrefixes.gem, Materials.InfusedFire, aEvent.Ore); return; - } - else if (aEvent.Name.equals("shardEarth")) { + } else if (aEvent.Name.equals("shardEarth")) { GT_OreDictUnificator.registerOre(OrePrefixes.gem, Materials.InfusedEarth, aEvent.Ore); return; - } - else if (aEvent.Name.equals("shardOrder")) { + } else if (aEvent.Name.equals("shardOrder")) { GT_OreDictUnificator.registerOre(OrePrefixes.gem, Materials.InfusedOrder, aEvent.Ore); return; - } - else if (aEvent.Name.equals("shardEntropy")) { + } else if (aEvent.Name.equals("shardEntropy")) { GT_OreDictUnificator.registerOre(OrePrefixes.gem, Materials.InfusedEntropy, aEvent.Ore); return; } } else if (aEvent.Name.equals("fieryIngot")) { GT_OreDictUnificator.registerOre(OrePrefixes.ingot, Materials.FierySteel, aEvent.Ore); return; - } - else if (aEvent.Name.equals("ironwood")) { + } else if (aEvent.Name.equals("ironwood")) { GT_OreDictUnificator.registerOre(OrePrefixes.ingot, Materials.IronWood, aEvent.Ore); return; - } - else if (aEvent.Name.equals("steeleaf")) { + } else if (aEvent.Name.equals("steeleaf")) { GT_OreDictUnificator.registerOre(OrePrefixes.ingot, Materials.Steeleaf, aEvent.Ore); return; - } - else if (aEvent.Name.equals("knightmetal")) { + } else if (aEvent.Name.equals("knightmetal")) { GT_OreDictUnificator.registerOre(OrePrefixes.ingot, Materials.Knightmetal, aEvent.Ore); return; - } - else if (aEvent.Name.equals("compressedAluminum")) { + } else if (aEvent.Name.equals("compressedAluminum")) { GT_OreDictUnificator.registerOre(OrePrefixes.compressed, Materials.Aluminium, aEvent.Ore); return; - } - else if (aEvent.Name.contains(" ")) { - GT_Log.ore.println(tModToName + " is getting re-registered because the OreDict Name containing invalid spaces."); - GT_OreDictUnificator.registerOre(aEvent.Name.replaceAll(" ", ""), GT_Utility.copyAmount(1L, aEvent.Ore)); + } else if (aEvent.Name.contains(" ")) { + GT_Log.ore.println( + tModToName + " is getting re-registered because the OreDict Name containing invalid spaces."); + GT_OreDictUnificator.registerOre( + aEvent.Name.replaceAll(" ", ""), GT_Utility.copyAmount(1L, aEvent.Ore)); aEvent.Ore.setStackDisplayName("Invalid OreDictionary Tag"); return; - } - else if (this.mInvalidNames.contains(aEvent.Name)) { + } else if (this.mInvalidNames.contains(aEvent.Name)) { GT_Log.ore.println(tModToName + " is wrongly registered and therefor getting ignored."); return; } OrePrefixes aPrefix = OrePrefixes.getOrePrefix(aEvent.Name); Materials aMaterial = Materials._NULL; - if ((aPrefix == OrePrefixes.nugget) && (aMod.equals("Thaumcraft")) && (aEvent.Ore.getItem().getUnlocalizedName().contains("ItemResource"))) { + if ((aPrefix == OrePrefixes.nugget) + && (aMod.equals("Thaumcraft")) + && (aEvent.Ore.getItem().getUnlocalizedName().contains("ItemResource"))) { return; } if (aPrefix == null) { if (aEvent.Name.toLowerCase().equals(aEvent.Name)) { GT_Log.ore.println(tModToName + " is invalid due to being solely lowercased."); return; - }else if (aEvent.Name.toUpperCase().equals(aEvent.Name)) { + } else if (aEvent.Name.toUpperCase().equals(aEvent.Name)) { GT_Log.ore.println(tModToName + " is invalid due to being solely uppercased."); return; } else if (Character.isUpperCase(aEvent.Name.charAt(0))) { @@ -1252,7 +1667,8 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG if (aPrefix != aPrefix.mPrefixInto) { String tNewName = aEvent.Name.replaceFirst(aPrefix.toString(), aPrefix.mPrefixInto.toString()); if (!GT_OreDictUnificator.isRegisteringOres()) { - GT_Log.ore.println(tModToName + " uses a depricated Prefix, and is getting re-registered as " + tNewName); + GT_Log.ore.println( + tModToName + " uses a depricated Prefix, and is getting re-registered as " + tNewName); } GT_OreDictUnificator.registerOre(tNewName, aEvent.Ore); return; @@ -1260,14 +1676,18 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG String tName = aEvent.Name.replaceFirst(aPrefix.toString(), ""); if (tName.length() > 0) { char firstChar = tName.charAt(0); - if (Character.isUpperCase(firstChar) || Character.isLowerCase(firstChar) || firstChar == '_' || Character.isDigit(firstChar)) { + if (Character.isUpperCase(firstChar) + || Character.isLowerCase(firstChar) + || firstChar == '_' + || Character.isDigit(firstChar)) { if (aPrefix.mIsMaterialBased) { aMaterial = Materials.get(tName); if (aMaterial != aMaterial.mMaterialInto) { GT_OreDictUnificator.registerOre(aPrefix, aMaterial.mMaterialInto, aEvent.Ore); if (!GT_OreDictUnificator.isRegisteringOres()) { - GT_Log.ore.println(tModToName + " uses a deprecated Material and is getting re-registered as " - + aPrefix.get(aMaterial.mMaterialInto)); + GT_Log.ore.println( + tModToName + " uses a deprecated Material and is getting re-registered as " + + aPrefix.get(aMaterial.mMaterialInto)); } return; } @@ -1276,22 +1696,30 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG } if (aMaterial != Materials._NULL) { Materials tReRegisteredMaterial; - for (Iterator i$ = aMaterial.mOreReRegistrations.iterator(); i$.hasNext(); GT_OreDictUnificator.registerOre(aPrefix, - tReRegisteredMaterial, aEvent.Ore)) { + for (Iterator i$ = aMaterial.mOreReRegistrations.iterator(); + i$.hasNext(); + GT_OreDictUnificator.registerOre(aPrefix, tReRegisteredMaterial, aEvent.Ore)) { tReRegisteredMaterial = (Materials) i$.next(); } aMaterial.add(GT_Utility.copyAmount(1L, aEvent.Ore)); - if (GregTech_API.sThaumcraftCompat != null && aPrefix.doGenerateItem(aMaterial) && !aPrefix.isIgnored(aMaterial)) { + if (GregTech_API.sThaumcraftCompat != null + && aPrefix.doGenerateItem(aMaterial) + && !aPrefix.isIgnored(aMaterial)) { List<TC_AspectStack> tAspects = new ArrayList<>(); for (TC_AspectStack tAspect : aPrefix.mAspects) tAspect.addToAspectList(tAspects); - if (aPrefix.mMaterialAmount >= 3628800 || aPrefix.mMaterialAmount < 0) for (TC_AspectStack tAspect : aMaterial.mAspects) tAspect.addToAspectList(tAspects); - GregTech_API.sThaumcraftCompat.registerThaumcraftAspectsToItem(GT_Utility.copyAmount(1, aEvent.Ore), tAspects, aEvent.Name); + if (aPrefix.mMaterialAmount >= 3628800 || aPrefix.mMaterialAmount < 0) + for (TC_AspectStack tAspect : aMaterial.mAspects) + tAspect.addToAspectList(tAspects); + GregTech_API.sThaumcraftCompat.registerThaumcraftAspectsToItem( + GT_Utility.copyAmount(1, aEvent.Ore), tAspects, aEvent.Name); } switch (aPrefix) { case crystal: - if ((aMaterial == Materials.CertusQuartz) || (aMaterial == Materials.NetherQuartz) || (aMaterial == Materials.Fluix)) { + if ((aMaterial == Materials.CertusQuartz) + || (aMaterial == Materials.NetherQuartz) + || (aMaterial == Materials.Fluix)) { GT_OreDictUnificator.registerOre(OrePrefixes.gem, aMaterial, aEvent.Ore); } break; @@ -1300,16 +1728,28 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG GT_OreDictUnificator.registerOre(Dyes.dyeBlue, aEvent.Ore); } else if (aMaterial == Materials.Lazurite) { GT_OreDictUnificator.registerOre(Dyes.dyeCyan, aEvent.Ore); - } else if (aMaterial == Materials.InfusedAir || aMaterial == Materials.InfusedWater || aMaterial == Materials.InfusedFire || aMaterial == Materials.InfusedEarth || aMaterial == Materials.InfusedOrder || aMaterial == Materials.InfusedEntropy) { - GT_OreDictUnificator.registerOre(aMaterial.mName.replaceFirst("Infused", "shard"), aEvent.Ore); + } else if (aMaterial == Materials.InfusedAir + || aMaterial == Materials.InfusedWater + || aMaterial == Materials.InfusedFire + || aMaterial == Materials.InfusedEarth + || aMaterial == Materials.InfusedOrder + || aMaterial == Materials.InfusedEntropy) { + GT_OreDictUnificator.registerOre( + aMaterial.mName.replaceFirst("Infused", "shard"), aEvent.Ore); } else if (aMaterial == Materials.Chocolate) { GT_OreDictUnificator.registerOre(Dyes.dyeBrown, aEvent.Ore); - } else if (aMaterial == Materials.CertusQuartz || aMaterial == Materials.NetherQuartz) { - GT_OreDictUnificator.registerOre(OrePrefixes.item.get(aMaterial), aEvent.Ore); - GT_OreDictUnificator.registerOre(OrePrefixes.crystal, aMaterial, aEvent.Ore); + } else if (aMaterial == Materials.CertusQuartz + || aMaterial == Materials.NetherQuartz) { + GT_OreDictUnificator.registerOre( + OrePrefixes.item.get(aMaterial), aEvent.Ore); + GT_OreDictUnificator.registerOre( + OrePrefixes.crystal, aMaterial, aEvent.Ore); GT_OreDictUnificator.registerOre(OreDictNames.craftingQuartz, aEvent.Ore); - } else if (aMaterial == Materials.Fluix || aMaterial == Materials.Quartz || aMaterial == Materials.Quartzite) { - GT_OreDictUnificator.registerOre(OrePrefixes.crystal, aMaterial, aEvent.Ore); + } else if (aMaterial == Materials.Fluix + || aMaterial == Materials.Quartz + || aMaterial == Materials.Quartzite) { + GT_OreDictUnificator.registerOre( + OrePrefixes.crystal, aMaterial, aEvent.Ore); GT_OreDictUnificator.registerOre(OreDictNames.craftingQuartz, aEvent.Ore); } break; @@ -1317,7 +1757,8 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG if (aMaterial == Materials.Tin) { GT_OreDictUnificator.registerOre(OreDictNames.craftingWireTin, aEvent.Ore); } else if (aMaterial == Materials.AnyCopper) { - GT_OreDictUnificator.registerOre(OreDictNames.craftingWireCopper, aEvent.Ore); + GT_OreDictUnificator.registerOre( + OreDictNames.craftingWireCopper, aEvent.Ore); } else if (aMaterial == Materials.Gold) { GT_OreDictUnificator.registerOre(OreDictNames.craftingWireGold, aEvent.Ore); } else if (aMaterial == Materials.AnyIron) { @@ -1325,8 +1766,15 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG } break; case lens: - if ((aMaterial.contains(SubTag.TRANSPARENT)) && (aMaterial.mColor != Dyes._NULL)) { - GT_OreDictUnificator.registerOre("craftingLens" + aMaterial.mColor.toString().replaceFirst("dye", ""), aEvent.Ore); + if ((aMaterial.contains(SubTag.TRANSPARENT)) + && (aMaterial.mColor != Dyes._NULL)) { + GT_OreDictUnificator.registerOre( + "craftingLens" + + aMaterial + .mColor + .toString() + .replaceFirst("dye", ""), + aEvent.Ore); } break; case plate: @@ -1352,8 +1800,11 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG GT_RecipeRegistrator.sRodMaterialList.add(aMaterial); } else if (aMaterial == Materials.Wood) { GT_OreDictUnificator.addToBlacklist(aEvent.Ore); - } else if ((aMaterial == Materials.Tin) || (aMaterial == Materials.Lead) || (aMaterial == Materials.SolderingAlloy)) { - GT_OreDictUnificator.registerOre(ToolDictNames.craftingToolSolderingMetal, aEvent.Ore); + } else if ((aMaterial == Materials.Tin) + || (aMaterial == Materials.Lead) + || (aMaterial == Materials.SolderingAlloy)) { + GT_OreDictUnificator.registerOre( + ToolDictNames.craftingToolSolderingMetal, aEvent.Ore); } break; case dust: @@ -1391,20 +1842,44 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG GT_OreDictUnificator.registerOre("steeleaf", aEvent.Ore); } else if (aMaterial == Materials.Knightmetal) { GT_OreDictUnificator.registerOre("knightmetal", aEvent.Ore); - } else if ((aMaterial == Materials.Brass) && (aEvent.Ore.getItemDamage() == 2) - && (aEvent.Ore.getUnlocalizedName().equals("item.ingotBrass")) - && (new ItemStack(aEvent.Ore.getItem(), 1, 0).getUnlocalizedName().contains("red"))) { - GT_OreDictUnificator.set(OrePrefixes.ingot, Materials.RedAlloy, new ItemStack(aEvent.Ore.getItem(), 1, 0)); - GT_OreDictUnificator.set(OrePrefixes.ingot, Materials.BlueAlloy, new ItemStack(aEvent.Ore.getItem(), 1, 1)); - GT_OreDictUnificator.set(OrePrefixes.ingot, Materials.Brass, new ItemStack(aEvent.Ore.getItem(), 1, 2)); + } else if ((aMaterial == Materials.Brass) + && (aEvent.Ore.getItemDamage() == 2) + && (aEvent.Ore + .getUnlocalizedName() + .equals("item.ingotBrass")) + && (new ItemStack(aEvent.Ore.getItem(), 1, 0) + .getUnlocalizedName() + .contains("red"))) { + GT_OreDictUnificator.set( + OrePrefixes.ingot, + Materials.RedAlloy, + new ItemStack(aEvent.Ore.getItem(), 1, 0)); + GT_OreDictUnificator.set( + OrePrefixes.ingot, + Materials.BlueAlloy, + new ItemStack(aEvent.Ore.getItem(), 1, 1)); + GT_OreDictUnificator.set( + OrePrefixes.ingot, + Materials.Brass, + new ItemStack(aEvent.Ore.getItem(), 1, 2)); if (!mDisableIC2Cables) { - GT_Values.RA.addWiremillRecipe(GT_ModHandler.getIC2Item("copperCableItem", 3L), new ItemStack(aEvent.Ore.getItem(), 1, - 8), 400, 1); - GT_Values.RA.addWiremillRecipe(GT_ModHandler.getIC2Item("ironCableItem", 6L), - new ItemStack(aEvent.Ore.getItem(), 1, 9), 400, 2); + GT_Values.RA.addWiremillRecipe( + GT_ModHandler.getIC2Item("copperCableItem", 3L), + new ItemStack(aEvent.Ore.getItem(), 1, 8), + 400, + 1); + GT_Values.RA.addWiremillRecipe( + GT_ModHandler.getIC2Item("ironCableItem", 6L), + new ItemStack(aEvent.Ore.getItem(), 1, 9), + 400, + 2); } - GT_Values.RA.addCutterRecipe(new ItemStack(aEvent.Ore.getItem(), 1, 3), new ItemStack(aEvent.Ore.getItem(), 16, 4), - null, 400, 8); + GT_Values.RA.addCutterRecipe( + new ItemStack(aEvent.Ore.getItem(), 1, 3), + new ItemStack(aEvent.Ore.getItem(), 16, 4), + null, + 400, + 8); } break; default: @@ -1417,12 +1892,18 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG for (Dyes tDye : Dyes.VALUES) { if (aEvent.Name.endsWith(tDye.name().replaceFirst("dye", ""))) { GT_OreDictUnificator.addToBlacklist(aEvent.Ore); - GT_Log.ore.println(tModToName + " Oh man, why the fuck would anyone need a OreDictified Color for this, that is even too much for GregTech... do not report this, this is just a random Comment about how ridiculous this is."); + GT_Log.ore.println( + tModToName + + " Oh man, why the fuck would anyone need a OreDictified Color for this, that is even too much for GregTech... do not report this, this is just a random Comment about how ridiculous this is."); return; } } -// GT_FML_LOGGER.info("Material Name: "+aEvent.Name+ " !!!Unknown Material detected!!! Please report to GregTech Intergalactical for additional compatiblity. This is not an Error, an Issue nor a Lag Source, it is just an Information, which you should pass to me."); -// GT_Log.ore.println(tModToName + " uses an unknown Material. Report this to GregTech."); + // GT_FML_LOGGER.info("Material Name: "+aEvent.Name+ " + // !!!Unknown Material detected!!! Please report to GregTech Intergalactical for + // additional compatiblity. This is not an Error, an Issue nor a Lag Source, it is just + // an Information, which you should pass to me."); + // GT_Log.ore.println(tModToName + " uses an unknown + // Material. Report this to GregTech."); return; } } else { @@ -1505,16 +1986,19 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG } @SuppressWarnings("deprecated") - public static void stepMaterialsVanilla(Collection<GT_Proxy.OreDictEventContainer> mEvents, ProgressManager.ProgressBar progressBar){ + public static void stepMaterialsVanilla( + Collection<GT_Proxy.OreDictEventContainer> mEvents, ProgressManager.ProgressBar progressBar) { int size = 5; int sizeStep = mEvents.size() / 20 - 1; GT_Proxy.OreDictEventContainer tEvent; - for (Iterator<GT_Proxy.OreDictEventContainer> i$ = mEvents.iterator(); i$.hasNext(); GT_Proxy.registerRecipes(tEvent)) { + for (Iterator<GT_Proxy.OreDictEventContainer> i$ = mEvents.iterator(); + i$.hasNext(); + GT_Proxy.registerRecipes(tEvent)) { tEvent = i$.next(); sizeStep--; - if(sizeStep == 0) { + if (sizeStep == 0) { GT_FML_LOGGER.info("Baking : " + size + "%", new Object[0]); - sizeStep = mEvents.size()/20-1; + sizeStep = mEvents.size() / 20 - 1; size += 5; } progressBar.step(tEvent.mMaterial == null ? "" : tEvent.mMaterial.toString()); @@ -1525,15 +2009,19 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG @SubscribeEvent public void onLivingUpdate(LivingUpdateEvent aEvent) { if (aEvent.entityLiving.onGround) { - int tX = MathHelper.floor_double(aEvent.entityLiving.posX), tY = MathHelper.floor_double(aEvent.entityLiving.boundingBox.minY-0.001F), tZ = MathHelper.floor_double(aEvent.entityLiving.posZ); + int tX = MathHelper.floor_double(aEvent.entityLiving.posX), + tY = MathHelper.floor_double(aEvent.entityLiving.boundingBox.minY - 0.001F), + tZ = MathHelper.floor_double(aEvent.entityLiving.posZ); Block tBlock = aEvent.entityLiving.worldObj.getBlock(tX, tY, tZ); - if (tBlock instanceof IBlockOnWalkOver) ((IBlockOnWalkOver)tBlock).onWalkOver(aEvent.entityLiving, aEvent.entityLiving.worldObj, tX, tY, tZ); + if (tBlock instanceof IBlockOnWalkOver) + ((IBlockOnWalkOver) tBlock).onWalkOver(aEvent.entityLiving, aEvent.entityLiving.worldObj, tX, tY, tZ); } } @SubscribeEvent public void onFluidContainerRegistration(FluidContainerRegistry.FluidContainerRegisterEvent aFluidEvent) { - if ((aFluidEvent.data.filledContainer.getItem() == Items.potionitem) && (aFluidEvent.data.filledContainer.getItemDamage() == 0)) { + if ((aFluidEvent.data.filledContainer.getItem() == Items.potionitem) + && (aFluidEvent.data.filledContainer.getItemDamage() == 0)) { aFluidEvent.data.fluid.amount = 0; } GT_OreDictUnificator.addToBlacklist(aFluidEvent.data.emptyContainer); @@ -1553,18 +2041,14 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG // Making sure it is being freed up in order to prevent exploits or Garbage Collection mishaps. LAST_BROKEN_TILEENTITY.set(null); - } - } @SubscribeEvent public void onWorldTickEvent(TickEvent.WorldTickEvent aEvent) { - if(aEvent.world.provider.dimensionId == 0) - mTicksUntilNextCraftSound--; + if (aEvent.world.provider.dimensionId == 0) mTicksUntilNextCraftSound--; if (isFirstWorldTick) { - for (Runnable runnable : GregTech_API.sFirstWorldTick) - runnable.run(); + for (Runnable runnable : GregTech_API.sFirstWorldTick) runnable.run(); isFirstWorldTick = false; GT_Values.worldTickHappened = true; } @@ -1582,23 +2066,32 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG tMetaTileEntity.onWorldLoad(tSaveDiretory); } } - } catch (Throwable e) {e.printStackTrace(GT_Log.err);} + } catch (Throwable e) { + e.printStackTrace(GT_Log.err); + } } } - if ((aEvent.world.getTotalWorldTime() % 100L == 0L) && ((this.mItemDespawnTime != 6000) || (this.mMaxEqualEntitiesAtOneSpot > 0))) { + if ((aEvent.world.getTotalWorldTime() % 100L == 0L) + && ((this.mItemDespawnTime != 6000) || (this.mMaxEqualEntitiesAtOneSpot > 0))) { long startTime = System.nanoTime(); - double oldX=0, oldY=0, oldZ=0; - if (debugEntityCramming && (aEvent.world.loadedEntityList.size()!=0)) { + double oldX = 0, oldY = 0, oldZ = 0; + if (debugEntityCramming && (aEvent.world.loadedEntityList.size() != 0)) { GT_Log.out.println("CRAM: Entity list size " + aEvent.world.loadedEntityList.size()); } for (int i = 0; i < aEvent.world.loadedEntityList.size(); i++) { if ((aEvent.world.loadedEntityList.get(i) instanceof Entity)) { Entity tEntity = (Entity) aEvent.world.loadedEntityList.get(i); - if (((tEntity instanceof EntityItem)) && (this.mItemDespawnTime != 6000) && (((EntityItem) tEntity).lifespan == 6000)) { + if (((tEntity instanceof EntityItem)) + && (this.mItemDespawnTime != 6000) + && (((EntityItem) tEntity).lifespan == 6000)) { ((EntityItem) tEntity).lifespan = this.mItemDespawnTime; - } else if (((tEntity instanceof EntityLivingBase)) && (this.mMaxEqualEntitiesAtOneSpot > 0) && (!(tEntity instanceof EntityPlayer)) - && (tEntity.canBePushed()) && (((EntityLivingBase) tEntity).getHealth() > 0.0F)) { - List tList = tEntity.worldObj.getEntitiesWithinAABBExcludingEntity(tEntity, + } else if (((tEntity instanceof EntityLivingBase)) + && (this.mMaxEqualEntitiesAtOneSpot > 0) + && (!(tEntity instanceof EntityPlayer)) + && (tEntity.canBePushed()) + && (((EntityLivingBase) tEntity).getHealth() > 0.0F)) { + List tList = tEntity.worldObj.getEntitiesWithinAABBExcludingEntity( + tEntity, tEntity.boundingBox.expand(0.20000000298023224D, 0.0D, 0.20000000298023224D)); Class tClass = tEntity.getClass(); int tEntityCount = 1; @@ -1613,22 +2106,23 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG if (debugEntityCramming) { // Cheeseball way of not receiving a bunch of spam caused by 1 location // obviously fails if there are crammed entities in more than one spot. - if( tEntity.posX != oldX - && tEntity.posY != oldY - && tEntity.posZ != oldZ ) { - GT_Log.out.println("CRAM: Excess entities: " + tEntityCount + " at X " + tEntity.posX + " Y " + tEntity.posY + " Z " + tEntity.posZ); + if (tEntity.posX != oldX && tEntity.posY != oldY && tEntity.posZ != oldZ) { + GT_Log.out.println("CRAM: Excess entities: " + tEntityCount + " at X " + + tEntity.posX + " Y " + tEntity.posY + " Z " + tEntity.posZ); oldX = tEntity.posX; oldY = tEntity.posY; oldZ = tEntity.posZ; } } - tEntity.attackEntityFrom(DamageSource.inWall, tEntityCount - this.mMaxEqualEntitiesAtOneSpot); + tEntity.attackEntityFrom( + DamageSource.inWall, tEntityCount - this.mMaxEqualEntitiesAtOneSpot); } } } } - if(debugEntityCramming && (aEvent.world.loadedEntityList.size()!=0)) { - GT_Log.out.println("CRAM: Time spent checking " + (System.nanoTime() - startTime )/1000 + " microseconds" ); + if (debugEntityCramming && (aEvent.world.loadedEntityList.size() != 0)) { + GT_Log.out.println( + "CRAM: Time spent checking " + (System.nanoTime() - startTime) / 1000 + " microseconds"); } } @@ -1645,24 +2139,43 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG } if (aOre.mPrefix != null) { if (!aOre.mPrefix.isIgnored(aOre.mMaterial)) { - aOre.mPrefix.processOre(aOre.mMaterial == null ? Materials._NULL : aOre.mMaterial, aOre.mEvent.Name, aOre.mModID, GT_Utility.copyAmount(1L, aOre.mEvent.Ore)); + aOre.mPrefix.processOre( + aOre.mMaterial == null ? Materials._NULL : aOre.mMaterial, + aOre.mEvent.Name, + aOre.mModID, + GT_Utility.copyAmount(1L, aOre.mEvent.Ore)); } } else { -// GT_FML_LOGGER.info("Thingy Name: "+ aOre.mEvent.Name+ " !!!Unknown 'Thingy' detected!!! This Object seems to probably not follow a valid OreDictionary Convention, or I missed a Convention. Please report to GregTech Intergalactical for additional compatiblity. This is not an Error, an Issue nor a Lag Source, it is just an Information, which you should pass to me."); + // GT_FML_LOGGER.info("Thingy Name: "+ aOre.mEvent.Name+ " !!!Unknown 'Thingy' detected!!! This + // Object seems to probably not follow a valid OreDictionary Convention, or I missed a Convention. Please + // report to GregTech Intergalactical for additional compatiblity. This is not an Error, an Issue nor a Lag + // Source, it is just an Information, which you should pass to me."); } } @SubscribeEvent public void onPlayerTickEventServer(TickEvent.PlayerTickEvent aEvent) { if ((aEvent.side.isServer()) && (aEvent.phase == TickEvent.Phase.END) && (!aEvent.player.isDead)) { - if ((aEvent.player.ticksExisted % 200 == 0) && (aEvent.player.capabilities.allowEdit) && (!aEvent.player.capabilities.isCreativeMode) + if ((aEvent.player.ticksExisted % 200 == 0) + && (aEvent.player.capabilities.allowEdit) + && (!aEvent.player.capabilities.isCreativeMode) && (this.mSurvivalIntoAdventure)) { aEvent.player.setGameType(GameType.ADVENTURE); aEvent.player.capabilities.allowEdit = false; if (this.mAxeWhenAdventure) { - GT_Utility.sendChatToPlayer(aEvent.player, GT_LanguageManager.addStringLocalization("Interaction_DESCRIPTION_Index_097", "It's dangerous to go alone! Take this.", false)); - aEvent.player.worldObj.spawnEntityInWorld(new EntityItem(aEvent.player.worldObj, aEvent.player.posX, aEvent.player.posY, - aEvent.player.posZ, GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.AXE, 1, Materials.Flint, Materials.Wood, null))); + GT_Utility.sendChatToPlayer( + aEvent.player, + GT_LanguageManager.addStringLocalization( + "Interaction_DESCRIPTION_Index_097", + "It's dangerous to go alone! Take this.", + false)); + aEvent.player.worldObj.spawnEntityInWorld(new EntityItem( + aEvent.player.worldObj, + aEvent.player.posX, + aEvent.player.posY, + aEvent.player.posZ, + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.AXE, 1, Materials.Flint, Materials.Wood, null))); } } boolean tHungerEffect = (this.mHungerEffect) && (aEvent.player.ticksExisted % 2400 == 1200); @@ -1672,7 +2185,8 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG ItemStack tStack; if ((tStack = aEvent.player.inventory.getStackInSlot(i)) != null) { if (!aEvent.player.capabilities.isCreativeMode) { - GT_Utility.applyRadioactivity(aEvent.player, GT_Utility.getRadioactivityLevel(tStack), tStack.stackSize); + GT_Utility.applyRadioactivity( + aEvent.player, GT_Utility.getRadioactivityLevel(tStack), tStack.stackSize); float tHeat = GT_Utility.getHeatDamageFromItem(tStack); if (tHeat != 0.0F) { if (tHeat > 0.0F) { @@ -1687,24 +2201,33 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG } if (this.mInventoryUnification) { - if (tStack.getTagCompound()!= null && (tStack.getTagCompound().getTag("Mate")!= null || tStack.getTagCompound().getTag("Genome")!= null )) { + if (tStack.getTagCompound() != null + && (tStack.getTagCompound().getTag("Mate") != null + || tStack.getTagCompound().getTag("Genome") != null)) { String orgMate = ""; - if(tStack.getTagCompound().getTag("Mate")!= null) - orgMate = (tStack.getTagCompound().getCompoundTag("Mate")).getTagList("Chromosomes",10).getCompoundTagAt(0).getString("UID1"); + if (tStack.getTagCompound().getTag("Mate") != null) + orgMate = (tStack.getTagCompound().getCompoundTag("Mate")) + .getTagList("Chromosomes", 10) + .getCompoundTagAt(0) + .getString("UID1"); String orgGen = orgMate; - if(tStack.getTagCompound().getTag("Genome")!= null) - orgGen = (tStack.getTagCompound().getCompoundTag("Genome")).getTagList("Chromosomes",10).getCompoundTagAt(0).getString("UID1"); + if (tStack.getTagCompound().getTag("Genome") != null) + orgGen = (tStack.getTagCompound().getCompoundTag("Genome")) + .getTagList("Chromosomes", 10) + .getCompoundTagAt(0) + .getString("UID1"); - final boolean[] yn = {orgMate.contains("gendustry"),orgGen.contains("gendustry")}; + final boolean[] yn = {orgMate.contains("gendustry"), orgGen.contains("gendustry")}; if (yn[0] || yn[1]) { - final NBTTagCompound NBTTAGCOMPOUND = (NBTTagCompound) tStack.getTagCompound().copy(); + final NBTTagCompound NBTTAGCOMPOUND = (NBTTagCompound) + tStack.getTagCompound().copy(); - //MATE + // MATE if (yn[0]) { final NBTTagCompound MATE = NBTTAGCOMPOUND.getCompoundTag("Mate"); final NBTTagList chromosomesMate = MATE.getTagList("Chromosomes", 10); @@ -1712,17 +2235,17 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG String ident1 = species.getString("UID1"); final String[] split = ident1.split("[.]"); - ident1 = "gregtech.bee.species" + WordUtils.capitalize(split[2].toLowerCase(Locale.ENGLISH)); + ident1 = "gregtech.bee.species" + + WordUtils.capitalize(split[2].toLowerCase(Locale.ENGLISH)); - if (AlleleManager.alleleRegistry.getAllele(ident1) == null) - return; + if (AlleleManager.alleleRegistry.getAllele(ident1) == null) return; String ident2 = species.getString("UID0"); final String[] split2 = ident2.split("[.]"); - ident2 = "gregtech.bee.species"+WordUtils.capitalize(split2[2].toLowerCase(Locale.ENGLISH)); + ident2 = "gregtech.bee.species" + + WordUtils.capitalize(split2[2].toLowerCase(Locale.ENGLISH)); - if (AlleleManager.alleleRegistry.getAllele(ident2) == null) - return; + if (AlleleManager.alleleRegistry.getAllele(ident2) == null) return; final NBTTagCompound nuspeciesmate = new NBTTagCompound(); nuspeciesmate.setString("UID1", ident1); @@ -1742,24 +2265,24 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG NBTTAGCOMPOUND.setTag("Mate", nuMate2); } if (yn[1]) { - //Genome + // Genome final NBTTagCompound genome = NBTTAGCOMPOUND.getCompoundTag("Genome"); final NBTTagList chromosomesGenome = genome.getTagList("Chromosomes", 10); final NBTTagCompound speciesGenome = chromosomesGenome.getCompoundTagAt(0); String ident1Genome = speciesGenome.getString("UID1"); final String[] splitGenome = ident1Genome.split("[.]"); - ident1Genome = "gregtech.bee.species" + WordUtils.capitalize(splitGenome[2].toLowerCase(Locale.ENGLISH)); + ident1Genome = "gregtech.bee.species" + + WordUtils.capitalize(splitGenome[2].toLowerCase(Locale.ENGLISH)); - if (AlleleManager.alleleRegistry.getAllele(ident1Genome) == null) - return; + if (AlleleManager.alleleRegistry.getAllele(ident1Genome) == null) return; String ident2Genome = speciesGenome.getString("UID0"); final String[] splitGenome2 = ident2Genome.split("[.]"); - ident2Genome = "gregtech.bee.species" + WordUtils.capitalize(splitGenome2[2].toLowerCase(Locale.ENGLISH)); + ident2Genome = "gregtech.bee.species" + + WordUtils.capitalize(splitGenome2[2].toLowerCase(Locale.ENGLISH)); - if (AlleleManager.alleleRegistry.getAllele(ident2Genome) == null) - return; + if (AlleleManager.alleleRegistry.getAllele(ident2Genome) == null) return; final NBTTagCompound nuspeciesgenome = new NBTTagCompound(); nuspeciesgenome.setString("UID1", ident1Genome); @@ -1780,8 +2303,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG } tStack.setTagCompound(new NBTTagCompound()); tStack.setTagCompound(NBTTAGCOMPOUND); - } - else return; + } else return; } GT_OreDictUnificator.setStack(true, tStack); @@ -1792,7 +2314,8 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG ItemStack tStack; if ((tStack = aEvent.player.inventory.armorInventory[i]) != null) { if (!aEvent.player.capabilities.isCreativeMode) { - GT_Utility.applyRadioactivity(aEvent.player, GT_Utility.getRadioactivityLevel(tStack), tStack.stackSize); + GT_Utility.applyRadioactivity( + aEvent.player, GT_Utility.getRadioactivityLevel(tStack), tStack.stackSize); float tHeat = GT_Utility.getHeatDamageFromItem(tStack); if (tHeat != 0.0F) { if (tHeat > 0.0F) { @@ -1824,8 +2347,8 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG @Override public Object getServerGuiElement(int aID, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ) { - if(aID>=1000){ - int ID = aID-1000; + if (aID >= 1000) { + int ID = aID - 1000; if (ID == 10) { return new GT_ContainerVolumetricFlask(aPlayer.inventory); } @@ -1833,7 +2356,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG } TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); if ((tTileEntity instanceof IGregTechTileEntity)) { - if (GUI_ID_COVER_SIDE_BASE <= aID && aID < GUI_ID_COVER_SIDE_BASE+6) { + if (GUI_ID_COVER_SIDE_BASE <= aID && aID < GUI_ID_COVER_SIDE_BASE + 6) { return null; } IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity(); @@ -1846,8 +2369,8 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG @Override public Object getClientGuiElement(int aID, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ) { - if(aID>=1000){ - int ID = aID-1000; + if (aID >= 1000) { + int ID = aID - 1000; if (ID == 10) { return new GT_GUIContainerVolumetricFlask(new GT_ContainerVolumetricFlask(aPlayer.inventory)); } @@ -1857,12 +2380,18 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG if ((tTileEntity instanceof IGregTechTileEntity)) { IGregTechTileEntity tile = (IGregTechTileEntity) tTileEntity; - if (GUI_ID_COVER_SIDE_BASE <= aID && aID < GUI_ID_COVER_SIDE_BASE+6) { + if (GUI_ID_COVER_SIDE_BASE <= aID && aID < GUI_ID_COVER_SIDE_BASE + 6) { byte side = (byte) (aID - GT_Proxy.GUI_ID_COVER_SIDE_BASE); GT_CoverBehaviorBase<?> cover = tile.getCoverBehaviorAtSideNew(side); if (cover.hasCoverGUI()) { - return cover.getClientGUI(side, tile.getCoverIDAtSide(side), tile.getComplexCoverDataAtSide(side), tile, aPlayer, aWorld); + return cover.getClientGUI( + side, + tile.getCoverIDAtSide(side), + tile.getComplexCoverDataAtSide(side), + tile, + aPlayer, + aWorld); } return null; } @@ -1875,10 +2404,11 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG } private static List<String> getOreDictNames(ItemStack stack) { - return Arrays.stream(OreDictionary.getOreIDs(stack)).mapToObj(OreDictionary::getOreName).collect(Collectors.toList()); + return Arrays.stream(OreDictionary.getOreIDs(stack)) + .mapToObj(OreDictionary::getOreName) + .collect(Collectors.toList()); } - @Override public int getBurnTime(ItemStack aFuel) { if ((aFuel == null) || (aFuel.getItem() == null)) { @@ -1898,64 +2428,113 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG rFuelValue = Math.max(rFuelValue, tValue); } else { // If not check the ore dict - rFuelValue = Math.max(rFuelValue, getOreDictNames(aFuel).stream().mapToInt(f -> oreDictBurnTimes.getOrDefault(f, 0)).max().orElse(0)); + rFuelValue = Math.max( + rFuelValue, + getOreDictNames(aFuel).stream() + .mapToInt(f -> oreDictBurnTimes.getOrDefault(f, 0)) + .max() + .orElse(0)); } // If we have something from the GT MetaGenerated_Item, ItemFuelValue, or OreDict return if (rFuelValue > 0) return rFuelValue; // Otherwise, a few more checks - if (GT_Utility.areStacksEqual(aFuel, new ItemStack(Blocks.wooden_button, 1))) return 150; - else if (GT_Utility.areStacksEqual(aFuel, new ItemStack(Blocks.ladder, 1))) return 100; - else if (GT_Utility.areStacksEqual(aFuel, new ItemStack(Items.sign, 1))) return 600; - else if (GT_Utility.areStacksEqual(aFuel, new ItemStack(Items.wooden_door, 1))) return 600; - else if (GT_Utility.areStacksEqual(aFuel, ItemList.Block_MSSFUEL.get(1))) return 150000; - else if (GT_Utility.areStacksEqual(aFuel, ItemList.Block_SSFUEL.get(1))) return 100000; + if (GT_Utility.areStacksEqual(aFuel, new ItemStack(Blocks.wooden_button, 1))) return 150; + else if (GT_Utility.areStacksEqual(aFuel, new ItemStack(Blocks.ladder, 1))) return 100; + else if (GT_Utility.areStacksEqual(aFuel, new ItemStack(Items.sign, 1))) return 600; + else if (GT_Utility.areStacksEqual(aFuel, new ItemStack(Items.wooden_door, 1))) return 600; + else if (GT_Utility.areStacksEqual(aFuel, ItemList.Block_MSSFUEL.get(1))) return 150000; + else if (GT_Utility.areStacksEqual(aFuel, ItemList.Block_SSFUEL.get(1))) return 100000; return 0; } - // ------------------------ Adds all fluids corresponding to materials ------------------------ - public Fluid addAutoGeneratedCorrespondingFluid(Materials aMaterial){ + public Fluid addAutoGeneratedCorrespondingFluid(Materials aMaterial) { // If the fluid is registered as custom inside the Material's constructor then to add custom fluid - // textures go to blocks/fluids and place the .png. File should be called fluid.fluid.{unlocalised_name}.png. All lower case. - String fluidTexture = aMaterial.mIconSet.is_custom ? ("fluid." + aMaterial.mName.toLowerCase()) : "autogenerated"; - return addFluid(aMaterial.mName.toLowerCase(Locale.ENGLISH), fluidTexture, aMaterial.mDefaultLocalName, aMaterial, - aMaterial.mRGBa, 1, aMaterial.getLiquidTemperature(), GT_OreDictUnificator.get(OrePrefixes.cell, aMaterial, 1L), ItemList.Cell_Empty.get(1L), 1000); - } + // textures go to blocks/fluids and place the .png. File should be called fluid.fluid.{unlocalised_name}.png. + // All lower case. + String fluidTexture = + aMaterial.mIconSet.is_custom ? ("fluid." + aMaterial.mName.toLowerCase()) : "autogenerated"; + return addFluid( + aMaterial.mName.toLowerCase(Locale.ENGLISH), + fluidTexture, + aMaterial.mDefaultLocalName, + aMaterial, + aMaterial.mRGBa, + 1, + aMaterial.getLiquidTemperature(), + GT_OreDictUnificator.get(OrePrefixes.cell, aMaterial, 1L), + ItemList.Cell_Empty.get(1L), + 1000); + } public Fluid addAutoGeneratedCorrespondingGas(Materials aMaterial) { // If the fluid is registered as custom inside the Material's constructor then to add custom fluid - // textures go to blocks/fluids and place the .png. File should be called fluid.gas.{unlocalised_name}.png. All lower case. + // textures go to blocks/fluids and place the .png. File should be called fluid.gas.{unlocalised_name}.png. All + // lower case. String fluidTexture = aMaterial.mIconSet.is_custom ? ("gas." + aMaterial.mName.toLowerCase()) : "autogenerated"; - return addFluid(aMaterial.mName.toLowerCase(Locale.ENGLISH), fluidTexture, aMaterial.mDefaultLocalName, aMaterial, - aMaterial.mRGBa, 2, aMaterial.getGasTemperature(), GT_OreDictUnificator.get(OrePrefixes.cell, aMaterial, 1L), ItemList.Cell_Empty.get(1L), 1000); + return addFluid( + aMaterial.mName.toLowerCase(Locale.ENGLISH), + fluidTexture, + aMaterial.mDefaultLocalName, + aMaterial, + aMaterial.mRGBa, + 2, + aMaterial.getGasTemperature(), + GT_OreDictUnificator.get(OrePrefixes.cell, aMaterial, 1L), + ItemList.Cell_Empty.get(1L), + 1000); } public Fluid addAutogeneratedPlasmaFluid(Materials aMaterial) { // If the fluid is registered as custom inside the Material's constructor then to add custom fluid - // textures go to blocks/fluids and place the .png. File should be called fluid.plasma.{unlocalised_name}.png. All lower case. - String fluidTexture = aMaterial.mIconSet.is_custom ? ("plasma." + aMaterial.mName.toLowerCase()) : "plasma.autogenerated"; - return addFluid("plasma." + aMaterial.mName.toLowerCase(Locale.ENGLISH), fluidTexture, aMaterial.mDefaultLocalName + " Plasma", aMaterial, - aMaterial.mMoltenRGBa, 3, 10000, GT_OreDictUnificator.get(OrePrefixes.cellPlasma, aMaterial, 1L), ItemList.Cell_Empty.get(1L), aMaterial.getMolten(1) != null ? 144 : 1000); + // textures go to blocks/fluids and place the .png. File should be called fluid.plasma.{unlocalised_name}.png. + // All lower case. + String fluidTexture = + aMaterial.mIconSet.is_custom ? ("plasma." + aMaterial.mName.toLowerCase()) : "plasma.autogenerated"; + return addFluid( + "plasma." + aMaterial.mName.toLowerCase(Locale.ENGLISH), + fluidTexture, + aMaterial.mDefaultLocalName + " Plasma", + aMaterial, + aMaterial.mMoltenRGBa, + 3, + 10000, + GT_OreDictUnificator.get(OrePrefixes.cellPlasma, aMaterial, 1L), + ItemList.Cell_Empty.get(1L), + aMaterial.getMolten(1) != null ? 144 : 1000); } public Fluid addAutogeneratedMoltenFluid(Materials aMaterial) { // If the fluid is registered as custom inside the Material's constructor then to add custom fluid - // textures go to blocks/fluids and place the .png. File should be called fluid.molten.{unlocalised_name}.png. All lower case. - String fluidTexture = aMaterial.mIconSet.is_custom ? ("molten." + aMaterial.mName.toLowerCase()) : "molten.autogenerated"; - return addFluid("molten." + aMaterial.mName.toLowerCase(Locale.ENGLISH), fluidTexture, "Molten " + aMaterial.mDefaultLocalName, aMaterial, - aMaterial.mMoltenRGBa, 4, aMaterial.mMeltingPoint < 0 ? 1000 : aMaterial.mMeltingPoint, GT_OreDictUnificator.get(OrePrefixes.cellMolten, aMaterial, 1L), ItemList.Cell_Empty.get(1L), 144); + // textures go to blocks/fluids and place the .png. File should be called fluid.molten.{unlocalised_name}.png. + // All lower case. + String fluidTexture = + aMaterial.mIconSet.is_custom ? ("molten." + aMaterial.mName.toLowerCase()) : "molten.autogenerated"; + return addFluid( + "molten." + aMaterial.mName.toLowerCase(Locale.ENGLISH), + fluidTexture, + "Molten " + aMaterial.mDefaultLocalName, + aMaterial, + aMaterial.mMoltenRGBa, + 4, + aMaterial.mMeltingPoint < 0 ? 1000 : aMaterial.mMeltingPoint, + GT_OreDictUnificator.get(OrePrefixes.cellMolten, aMaterial, 1L), + ItemList.Cell_Empty.get(1L), + 144); } // ------------------------------------------------------------------------------------------------------------ - public void addAutoGeneratedHydroCrackedFluids(Materials aMaterial){ + public void addAutoGeneratedHydroCrackedFluids(Materials aMaterial) { Fluid[] crackedFluids = new Fluid[3]; - String[] namePrefixes = { "lightlyhydrocracked.", "moderatelyhydrocracked.", "severelyhydrocracked." }; - OrePrefixes[] orePrefixes = { OrePrefixes.cellHydroCracked1, OrePrefixes.cellHydroCracked2, OrePrefixes.cellHydroCracked3 }; + String[] namePrefixes = {"lightlyhydrocracked.", "moderatelyhydrocracked.", "severelyhydrocracked."}; + OrePrefixes[] orePrefixes = { + OrePrefixes.cellHydroCracked1, OrePrefixes.cellHydroCracked2, OrePrefixes.cellHydroCracked3 + }; GT_Fluid uncrackedFluid = null; if (aMaterial.mFluid != null) { uncrackedFluid = (GT_Fluid) aMaterial.mFluid; @@ -1964,27 +2543,51 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG } for (int i = 0; i < 3; i++) { crackedFluids[i] = addFluid( - namePrefixes[i] + aMaterial.mName.toLowerCase(Locale.ENGLISH), uncrackedFluid.mTextureName, + namePrefixes[i] + aMaterial.mName.toLowerCase(Locale.ENGLISH), + uncrackedFluid.mTextureName, orePrefixes[i].mLocalizedMaterialPre + aMaterial.mDefaultLocalName, - null, aMaterial.mRGBa, 2, 775, + null, + aMaterial.mRGBa, + 2, + 775, GT_OreDictUnificator.get(orePrefixes[i], aMaterial, 1L), - ItemList.Cell_Empty.get(1L), 1000); + ItemList.Cell_Empty.get(1L), + 1000); int hydrogenAmount = 2 * i + 2; - GT_Values.RA.addCrackingRecipe(i + 1, new FluidStack(uncrackedFluid, 1000), Materials.Hydrogen.getGas(hydrogenAmount * 800), - new FluidStack(crackedFluids[i], 1000), 20 + 20 * i, 240); - GT_Values.RA.addChemicalRecipe(Materials.Hydrogen.getCells(hydrogenAmount), GT_Utility.getIntegratedCircuit(i + 1), new FluidStack(uncrackedFluid, 1000), - new FluidStack(crackedFluids[i], 800), Materials.Empty.getCells(hydrogenAmount), 160 + 80 * i, 30); - GT_Values.RA.addChemicalRecipe(aMaterial.getCells(1), GT_Utility.getIntegratedCircuit(i + 1), Materials.Hydrogen.getGas(hydrogenAmount * 1000), - new FluidStack(crackedFluids[i], 800), Materials.Empty.getCells(1), 160 + 80 * i, 30); + GT_Values.RA.addCrackingRecipe( + i + 1, + new FluidStack(uncrackedFluid, 1000), + Materials.Hydrogen.getGas(hydrogenAmount * 800), + new FluidStack(crackedFluids[i], 1000), + 20 + 20 * i, + 240); + GT_Values.RA.addChemicalRecipe( + Materials.Hydrogen.getCells(hydrogenAmount), + GT_Utility.getIntegratedCircuit(i + 1), + new FluidStack(uncrackedFluid, 1000), + new FluidStack(crackedFluids[i], 800), + Materials.Empty.getCells(hydrogenAmount), + 160 + 80 * i, + 30); + GT_Values.RA.addChemicalRecipe( + aMaterial.getCells(1), + GT_Utility.getIntegratedCircuit(i + 1), + Materials.Hydrogen.getGas(hydrogenAmount * 1000), + new FluidStack(crackedFluids[i], 800), + Materials.Empty.getCells(1), + 160 + 80 * i, + 30); } aMaterial.setHydroCrackedFluids(crackedFluids); } - public void addAutoGeneratedSteamCrackedFluids(Materials aMaterial){ + public void addAutoGeneratedSteamCrackedFluids(Materials aMaterial) { Fluid[] crackedFluids = new Fluid[3]; - String[] namePrefixes = { "lightlysteamcracked.", "moderatelysteamcracked.", "severelysteamcracked." }; - OrePrefixes[] orePrefixes = { OrePrefixes.cellSteamCracked1, OrePrefixes.cellSteamCracked2, OrePrefixes.cellSteamCracked3 }; + String[] namePrefixes = {"lightlysteamcracked.", "moderatelysteamcracked.", "severelysteamcracked."}; + OrePrefixes[] orePrefixes = { + OrePrefixes.cellSteamCracked1, OrePrefixes.cellSteamCracked2, OrePrefixes.cellSteamCracked3 + }; GT_Fluid uncrackedFluid = null; if (aMaterial.mFluid != null) { uncrackedFluid = (GT_Fluid) aMaterial.mFluid; @@ -1993,18 +2596,40 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG } for (int i = 0; i < 3; i++) { crackedFluids[i] = addFluid( - namePrefixes[i] + aMaterial.mName.toLowerCase(Locale.ENGLISH), uncrackedFluid.mTextureName, + namePrefixes[i] + aMaterial.mName.toLowerCase(Locale.ENGLISH), + uncrackedFluid.mTextureName, orePrefixes[i].mLocalizedMaterialPre + aMaterial.mDefaultLocalName, - null, aMaterial.mRGBa, 2, 775, + null, + aMaterial.mRGBa, + 2, + 775, GT_OreDictUnificator.get(orePrefixes[i], aMaterial, 1L), - ItemList.Cell_Empty.get(1L), 1000); - - GT_Values.RA.addCrackingRecipe(i + 1, new FluidStack(uncrackedFluid, 1000), GT_ModHandler.getSteam(1000), - new FluidStack(crackedFluids[i], 1200), 20 + 20 * i, 240); - GT_Values.RA.addChemicalRecipe(GT_ModHandler.getIC2Item("steamCell", 1L), GT_Utility.getIntegratedCircuit(i + 1), new FluidStack(uncrackedFluid, 1000), - new FluidStack(crackedFluids[i], 800), Materials.Empty.getCells(1), 160 + 80 * i, 30); - GT_Values.RA.addChemicalRecipe(aMaterial.getCells(1), GT_Utility.getIntegratedCircuit(i + 1), GT_ModHandler.getSteam(1000), - new FluidStack(crackedFluids[i], 800), Materials.Empty.getCells(1), 160 + 80 * i, 30); + ItemList.Cell_Empty.get(1L), + 1000); + + GT_Values.RA.addCrackingRecipe( + i + 1, + new FluidStack(uncrackedFluid, 1000), + GT_ModHandler.getSteam(1000), + new FluidStack(crackedFluids[i], 1200), + 20 + 20 * i, + 240); + GT_Values.RA.addChemicalRecipe( + GT_ModHandler.getIC2Item("steamCell", 1L), + GT_Utility.getIntegratedCircuit(i + 1), + new FluidStack(uncrackedFluid, 1000), + new FluidStack(crackedFluids[i], 800), + Materials.Empty.getCells(1), + 160 + 80 * i, + 30); + GT_Values.RA.addChemicalRecipe( + aMaterial.getCells(1), + GT_Utility.getIntegratedCircuit(i + 1), + GT_ModHandler.getSteam(1000), + new FluidStack(crackedFluids[i], 800), + Materials.Empty.getCells(1), + 160 + 80 * i, + 30); } aMaterial.setSteamCrackedFluids(crackedFluids); } @@ -2013,13 +2638,39 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG return addFluid(aName, aLocalized, aMaterial, aState, aTemperatureK, null, null, 0); } - public Fluid addFluid(String aName, String aLocalized, Materials aMaterial, int aState, int aTemperatureK, ItemStack aFullContainer, - ItemStack aEmptyContainer, int aFluidAmount) { - return addFluid(aName, aName.toLowerCase(Locale.ENGLISH), aLocalized, aMaterial, null, aState, aTemperatureK, aFullContainer, aEmptyContainer, aFluidAmount); + public Fluid addFluid( + String aName, + String aLocalized, + Materials aMaterial, + int aState, + int aTemperatureK, + ItemStack aFullContainer, + ItemStack aEmptyContainer, + int aFluidAmount) { + return addFluid( + aName, + aName.toLowerCase(Locale.ENGLISH), + aLocalized, + aMaterial, + null, + aState, + aTemperatureK, + aFullContainer, + aEmptyContainer, + aFluidAmount); } - public Fluid addFluid(String aName, String aTexture, String aLocalized, Materials aMaterial, short[] aRGBa, int aState, int aTemperatureK, - ItemStack aFullContainer, ItemStack aEmptyContainer, int aFluidAmount) { + public Fluid addFluid( + String aName, + String aTexture, + String aLocalized, + Materials aMaterial, + short[] aRGBa, + int aState, + int aTemperatureK, + ItemStack aFullContainer, + ItemStack aEmptyContainer, + int aFluidAmount) { aName = aName.toLowerCase(Locale.ENGLISH); Fluid rFluid = new GT_Fluid(aName, aTexture, aRGBa != null ? aRGBa : Dyes._NULL.getRGBA()); @@ -2070,9 +2721,15 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG aMaterial.mStandardMoltenFluid = rFluid; } } - if ((aFullContainer != null) && (aEmptyContainer != null) - && (!FluidContainerRegistry.registerFluidContainer(new FluidStack(rFluid, aFluidAmount), aFullContainer, aEmptyContainer))) { - GT_Values.RA.addFluidCannerRecipe(aFullContainer, GT_Utility.getContainerItem(aFullContainer, false), null, new FluidStack(rFluid, aFluidAmount)); + if ((aFullContainer != null) + && (aEmptyContainer != null) + && (!FluidContainerRegistry.registerFluidContainer( + new FluidStack(rFluid, aFluidAmount), aFullContainer, aEmptyContainer))) { + GT_Values.RA.addFluidCannerRecipe( + aFullContainer, + GT_Utility.getContainerItem(aFullContainer, false), + null, + new FluidStack(rFluid, aFluidAmount)); } return rFluid; } @@ -2086,61 +2743,255 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG GregTech_API.sUnification.mConfig.load(); GT_OreDictUnificator.resetUnificationEntries(); for (OreDictEventContainer tOre : this.mEvents) { - if ((!(tOre.mEvent.Ore.getItem() instanceof GT_MetaGenerated_Item)) && (tOre.mPrefix != null) && (tOre.mPrefix.mIsUnificatable) && (tOre.mMaterial != null)) { + if ((!(tOre.mEvent.Ore.getItem() instanceof GT_MetaGenerated_Item)) + && (tOre.mPrefix != null) + && (tOre.mPrefix.mIsUnificatable) + && (tOre.mMaterial != null)) { boolean chkmi = tOre.mModID != null; if (chkmi) { - if (tOre.mModID.equalsIgnoreCase("enderio") && tOre.mPrefix == OrePrefixes.ingot && tOre.mMaterial == Materials.DarkSteel) { + if (tOre.mModID.equalsIgnoreCase("enderio") + && tOre.mPrefix == OrePrefixes.ingot + && tOre.mMaterial == Materials.DarkSteel) { GT_OreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false); - GT_OreDictUnificator.set(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, (GregTech_API.sUnification.get(new StringBuilder().append(ConfigCategories.specialunificationtargets).append(".").append(tOre.mModID).toString(), tOre.mEvent.Name, true)), true);continue; - } else if (tOre.mModID.equalsIgnoreCase("thermalfoundation") && tOre.mPrefix == OrePrefixes.dust && tOre.mMaterial == Materials.Blizz) { + GT_OreDictUnificator.set( + tOre.mPrefix, + tOre.mMaterial, + tOre.mEvent.Ore, + (GregTech_API.sUnification.get( + new StringBuilder() + .append(ConfigCategories.specialunificationtargets) + .append(".") + .append(tOre.mModID) + .toString(), + tOre.mEvent.Name, + true)), + true); + continue; + } else if (tOre.mModID.equalsIgnoreCase("thermalfoundation") + && tOre.mPrefix == OrePrefixes.dust + && tOre.mMaterial == Materials.Blizz) { GT_OreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false); - GT_OreDictUnificator.set(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, (GregTech_API.sUnification.get(new StringBuilder().append(ConfigCategories.specialunificationtargets).append(".").append(tOre.mModID).toString(), tOre.mEvent.Name, true)), true);continue; - } else if (tOre.mModID.equalsIgnoreCase("thermalfoundation") && tOre.mPrefix == OrePrefixes.dust && tOre.mMaterial == Materials.Pyrotheum) { + GT_OreDictUnificator.set( + tOre.mPrefix, + tOre.mMaterial, + tOre.mEvent.Ore, + (GregTech_API.sUnification.get( + new StringBuilder() + .append(ConfigCategories.specialunificationtargets) + .append(".") + .append(tOre.mModID) + .toString(), + tOre.mEvent.Name, + true)), + true); + continue; + } else if (tOre.mModID.equalsIgnoreCase("thermalfoundation") + && tOre.mPrefix == OrePrefixes.dust + && tOre.mMaterial == Materials.Pyrotheum) { GT_OreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false); - GT_OreDictUnificator.set(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, (GregTech_API.sUnification.get(new StringBuilder().append(ConfigCategories.specialunificationtargets).append(".").append(tOre.mModID).toString(), tOre.mEvent.Name, true)), true);continue; - } else if (tOre.mModID.equalsIgnoreCase(aTextArsmagica2) && tOre.mPrefix == OrePrefixes.dust && tOre.mMaterial == Materials.Vinteum) { + GT_OreDictUnificator.set( + tOre.mPrefix, + tOre.mMaterial, + tOre.mEvent.Ore, + (GregTech_API.sUnification.get( + new StringBuilder() + .append(ConfigCategories.specialunificationtargets) + .append(".") + .append(tOre.mModID) + .toString(), + tOre.mEvent.Name, + true)), + true); + continue; + } else if (tOre.mModID.equalsIgnoreCase(aTextArsmagica2) + && tOre.mPrefix == OrePrefixes.dust + && tOre.mMaterial == Materials.Vinteum) { GT_OreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false); - GT_OreDictUnificator.set(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, (GregTech_API.sUnification.get(new StringBuilder().append(ConfigCategories.specialunificationtargets).append(".").append(tOre.mModID).toString(), tOre.mEvent.Name, true)), true);continue; - } else if (tOre.mModID.equalsIgnoreCase(aTextArsmagica2) && tOre.mPrefix == OrePrefixes.gem && tOre.mMaterial == Materials.BlueTopaz) { + GT_OreDictUnificator.set( + tOre.mPrefix, + tOre.mMaterial, + tOre.mEvent.Ore, + (GregTech_API.sUnification.get( + new StringBuilder() + .append(ConfigCategories.specialunificationtargets) + .append(".") + .append(tOre.mModID) + .toString(), + tOre.mEvent.Name, + true)), + true); + continue; + } else if (tOre.mModID.equalsIgnoreCase(aTextArsmagica2) + && tOre.mPrefix == OrePrefixes.gem + && tOre.mMaterial == Materials.BlueTopaz) { GT_OreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false); - GT_OreDictUnificator.set(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, (GregTech_API.sUnification.get(new StringBuilder().append(ConfigCategories.specialunificationtargets).append(".").append(tOre.mModID).toString(), tOre.mEvent.Name, true)), true);continue; - } else if (tOre.mModID.equalsIgnoreCase(aTextArsmagica2) && tOre.mPrefix == OrePrefixes.gem && tOre.mMaterial == Materials.Chimerite) { + GT_OreDictUnificator.set( + tOre.mPrefix, + tOre.mMaterial, + tOre.mEvent.Ore, + (GregTech_API.sUnification.get( + new StringBuilder() + .append(ConfigCategories.specialunificationtargets) + .append(".") + .append(tOre.mModID) + .toString(), + tOre.mEvent.Name, + true)), + true); + continue; + } else if (tOre.mModID.equalsIgnoreCase(aTextArsmagica2) + && tOre.mPrefix == OrePrefixes.gem + && tOre.mMaterial == Materials.Chimerite) { GT_OreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false); - GT_OreDictUnificator.set(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, (GregTech_API.sUnification.get(new StringBuilder().append(ConfigCategories.specialunificationtargets).append(".").append(tOre.mModID).toString(), tOre.mEvent.Name, true)), true);continue; - } else if (tOre.mModID.equalsIgnoreCase(aTextArsmagica2) && tOre.mPrefix == OrePrefixes.gem && tOre.mMaterial == Materials.Moonstone) { + GT_OreDictUnificator.set( + tOre.mPrefix, + tOre.mMaterial, + tOre.mEvent.Ore, + (GregTech_API.sUnification.get( + new StringBuilder() + .append(ConfigCategories.specialunificationtargets) + .append(".") + .append(tOre.mModID) + .toString(), + tOre.mEvent.Name, + true)), + true); + continue; + } else if (tOre.mModID.equalsIgnoreCase(aTextArsmagica2) + && tOre.mPrefix == OrePrefixes.gem + && tOre.mMaterial == Materials.Moonstone) { GT_OreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false); - GT_OreDictUnificator.set(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, (GregTech_API.sUnification.get(new StringBuilder().append(ConfigCategories.specialunificationtargets).append(".").append(tOre.mModID).toString(), tOre.mEvent.Name, true)), true);continue; - } else if (tOre.mModID.equalsIgnoreCase(aTextArsmagica2) && tOre.mPrefix == OrePrefixes.gem && tOre.mMaterial == Materials.Sunstone) { + GT_OreDictUnificator.set( + tOre.mPrefix, + tOre.mMaterial, + tOre.mEvent.Ore, + (GregTech_API.sUnification.get( + new StringBuilder() + .append(ConfigCategories.specialunificationtargets) + .append(".") + .append(tOre.mModID) + .toString(), + tOre.mEvent.Name, + true)), + true); + continue; + } else if (tOre.mModID.equalsIgnoreCase(aTextArsmagica2) + && tOre.mPrefix == OrePrefixes.gem + && tOre.mMaterial == Materials.Sunstone) { GT_OreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false); - GT_OreDictUnificator.set(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, (GregTech_API.sUnification.get(new StringBuilder().append(ConfigCategories.specialunificationtargets).append(".").append(tOre.mModID).toString(), tOre.mEvent.Name, true)), true);continue; - } else if (tOre.mModID.equalsIgnoreCase("rotarycraft") && tOre.mPrefix == OrePrefixes.ingot && tOre.mMaterial == Materials.HSLA) { + GT_OreDictUnificator.set( + tOre.mPrefix, + tOre.mMaterial, + tOre.mEvent.Ore, + (GregTech_API.sUnification.get( + new StringBuilder() + .append(ConfigCategories.specialunificationtargets) + .append(".") + .append(tOre.mModID) + .toString(), + tOre.mEvent.Name, + true)), + true); + continue; + } else if (tOre.mModID.equalsIgnoreCase("rotarycraft") + && tOre.mPrefix == OrePrefixes.ingot + && tOre.mMaterial == Materials.HSLA) { GT_OreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false); - GT_OreDictUnificator.set(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, (GregTech_API.sUnification.get(new StringBuilder().append(ConfigCategories.specialunificationtargets).append(".").append(tOre.mModID).toString(), tOre.mEvent.Name, true)), true);continue; - } else if (tOre.mModID.equalsIgnoreCase("appliedenergistics2") && tOre.mPrefix == OrePrefixes.gem && tOre.mMaterial == Materials.CertusQuartz) { + GT_OreDictUnificator.set( + tOre.mPrefix, + tOre.mMaterial, + tOre.mEvent.Ore, + (GregTech_API.sUnification.get( + new StringBuilder() + .append(ConfigCategories.specialunificationtargets) + .append(".") + .append(tOre.mModID) + .toString(), + tOre.mEvent.Name, + true)), + true); + continue; + } else if (tOre.mModID.equalsIgnoreCase("appliedenergistics2") + && tOre.mPrefix == OrePrefixes.gem + && tOre.mMaterial == Materials.CertusQuartz) { GT_OreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false); - GT_OreDictUnificator.set(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, (GregTech_API.sUnification.get(new StringBuilder().append(ConfigCategories.specialunificationtargets).append(".").append(tOre.mModID).toString(), tOre.mEvent.Name, true)), true);continue; - } else if (tOre.mModID.equalsIgnoreCase("appliedenergistics2") && tOre.mPrefix == OrePrefixes.dust && tOre.mMaterial == Materials.CertusQuartz) { + GT_OreDictUnificator.set( + tOre.mPrefix, + tOre.mMaterial, + tOre.mEvent.Ore, + (GregTech_API.sUnification.get( + new StringBuilder() + .append(ConfigCategories.specialunificationtargets) + .append(".") + .append(tOre.mModID) + .toString(), + tOre.mEvent.Name, + true)), + true); + continue; + } else if (tOre.mModID.equalsIgnoreCase("appliedenergistics2") + && tOre.mPrefix == OrePrefixes.dust + && tOre.mMaterial == Materials.CertusQuartz) { GT_OreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false); - GT_OreDictUnificator.set(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, (GregTech_API.sUnification.get(new StringBuilder().append(ConfigCategories.specialunificationtargets).append(".").append(tOre.mModID).toString(), tOre.mEvent.Name, true)), true);continue; + GT_OreDictUnificator.set( + tOre.mPrefix, + tOre.mMaterial, + tOre.mEvent.Ore, + (GregTech_API.sUnification.get( + new StringBuilder() + .append(ConfigCategories.specialunificationtargets) + .append(".") + .append(tOre.mModID) + .toString(), + tOre.mEvent.Name, + true)), + true); + continue; } } if (GT_OreDictUnificator.isBlacklisted(tOre.mEvent.Ore)) { GT_OreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, true); } else { GT_OreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false); - GT_OreDictUnificator.set(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, (chkmi) && (GregTech_API.sUnification.get(new StringBuilder().append(ConfigCategories.specialunificationtargets).append(".").append(tOre.mModID).toString(), tOre.mEvent.Name, false)), true); + GT_OreDictUnificator.set( + tOre.mPrefix, + tOre.mMaterial, + tOre.mEvent.Ore, + (chkmi) + && (GregTech_API.sUnification.get( + new StringBuilder() + .append(ConfigCategories.specialunificationtargets) + .append(".") + .append(tOre.mModID) + .toString(), + tOre.mEvent.Name, + false)), + true); } } } for (OreDictEventContainer tOre : this.mEvents) { - if (((tOre.mEvent.Ore.getItem() instanceof GT_MetaGenerated_Item)) && (tOre.mPrefix != null) && (tOre.mPrefix.mIsUnificatable) + if (((tOre.mEvent.Ore.getItem() instanceof GT_MetaGenerated_Item)) + && (tOre.mPrefix != null) + && (tOre.mPrefix.mIsUnificatable) && (tOre.mMaterial != null)) { if (GT_OreDictUnificator.isBlacklisted(tOre.mEvent.Ore)) { GT_OreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, true); } else { GT_OreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false); - GT_OreDictUnificator.set(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, (tOre.mModID != null) && - (GregTech_API.sUnification.get(new StringBuilder().append(ConfigCategories.specialunificationtargets).append(".").append(tOre.mModID), tOre.mEvent.Name, false)), true); + GT_OreDictUnificator.set( + tOre.mPrefix, + tOre.mMaterial, + tOre.mEvent.Ore, + (tOre.mModID != null) + && (GregTech_API.sUnification.get( + new StringBuilder() + .append(ConfigCategories.specialunificationtargets) + .append(".") + .append(tOre.mModID), + tOre.mEvent.Name, + false)), + true); } } } @@ -2154,32 +3005,38 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG this.mOreDictActivated = true; ProgressManager.ProgressBar progressBar = ProgressManager.push("Register materials", mEvents.size()); - if (Loader.isModLoaded("betterloadingscreen")){ + if (Loader.isModLoaded("betterloadingscreen")) { GT_Values.cls_enabled = true; try { GT_CLS_Compat.stepMaterialsCLS(mEvents, progressBar); } catch (IllegalAccessException | InvocationTargetException e) { GT_FML_LOGGER.catching(e); } - } - else - GT_Proxy.stepMaterialsVanilla(this.mEvents,progressBar); - + } else GT_Proxy.stepMaterialsVanilla(this.mEvents, progressBar); } @Deprecated - public static final HashMap<Integer,HashMap<ChunkCoordIntPair,int []>> dimensionWiseChunkData = new HashMap<>(16);//stores chunk data that is loaded/saved - public static final HashMap<Integer,GT_Pollution> dimensionWisePollution = new HashMap<>(16);//stores GT_Polluttors objects - public static final byte GTOIL=3,GTOILFLUID=2,GTPOLLUTION=1,GTMETADATA=0,NOT_LOADED=0,LOADED=1;//consts - - //TO get default's fast + public static final HashMap<Integer, HashMap<ChunkCoordIntPair, int[]>> dimensionWiseChunkData = + new HashMap<>(16); // stores chunk data that is loaded/saved + + public static final HashMap<Integer, GT_Pollution> dimensionWisePollution = + new HashMap<>(16); // stores GT_Polluttors objects + public static final byte GTOIL = 3, + GTOILFLUID = 2, + GTPOLLUTION = 1, + GTMETADATA = 0, + NOT_LOADED = 0, + LOADED = 1; // consts + + // TO get default's fast @Deprecated - public static int[] getDefaultChunkDataOnCreation(){ - return new int[]{NOT_LOADED,0,-1,-1}; + public static int[] getDefaultChunkDataOnCreation() { + return new int[] {NOT_LOADED, 0, -1, -1}; } + @Deprecated - public static int[] getDefaultChunkDataOnLoad(){ - return new int[]{LOADED,0,-1,-1}; + public static int[] getDefaultChunkDataOnLoad() { + return new int[] {LOADED, 0, -1, -1}; } @SubscribeEvent @@ -2189,18 +3046,25 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG } @SubscribeEvent - public void onBlockBreakSpeedEvent(PlayerEvent.BreakSpeed aEvent) - { - if (aEvent.newSpeed > 0.0F) - { - if (aEvent.entityPlayer != null) - { - ItemStack aStack = aEvent.entityPlayer.getCurrentEquippedItem(); - if ((aStack != null) && ((aStack.getItem() instanceof GT_MetaGenerated_Tool))) { - aEvent.newSpeed = ((GT_MetaGenerated_Tool)aStack.getItem()).onBlockBreakSpeedEvent(aEvent.newSpeed, aStack, aEvent.entityPlayer, aEvent.block, aEvent.x, aEvent.y, aEvent.z, (byte)aEvent.metadata, aEvent); - } + public void onBlockBreakSpeedEvent(PlayerEvent.BreakSpeed aEvent) { + if (aEvent.newSpeed > 0.0F) { + if (aEvent.entityPlayer != null) { + ItemStack aStack = aEvent.entityPlayer.getCurrentEquippedItem(); + if ((aStack != null) && ((aStack.getItem() instanceof GT_MetaGenerated_Tool))) { + aEvent.newSpeed = ((GT_MetaGenerated_Tool) aStack.getItem()) + .onBlockBreakSpeedEvent( + aEvent.newSpeed, + aStack, + aEvent.entityPlayer, + aEvent.block, + aEvent.x, + aEvent.y, + aEvent.z, + (byte) aEvent.metadata, + aEvent); + } + } } - } } public static class OreDictEventContainer { @@ -2209,7 +3073,8 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG public final Materials mMaterial; public final String mModID; - public OreDictEventContainer(OreDictionary.OreRegisterEvent aEvent, OrePrefixes aPrefix, Materials aMaterial, String aModID) { + public OreDictEventContainer( + OreDictionary.OreRegisterEvent aEvent, OrePrefixes aPrefix, Materials aMaterial, String aModID) { this.mEvent = aEvent; this.mPrefix = aPrefix; this.mMaterial = aMaterial; @@ -2218,27 +3083,27 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG } @SubscribeEvent - public void onBlockEvent(BlockEvent event) { + public void onBlockEvent(BlockEvent event) { if (event.block.getUnlocalizedName().equals("blockAlloyGlass")) GregTech_API.causeMachineUpdate(event.world, event.x, event.y, event.z); } - public static void addFullHazmatToGeneralItem(String aModID, String aItem, long aAmount, int aMeta){ + public static void addFullHazmatToGeneralItem(String aModID, String aItem, long aAmount, int aMeta) { ItemStack item = GT_ModHandler.getModItem(aModID, aItem, aAmount, aMeta); addItemToHazmatLists(item); } - public static void addFullHazmatToGeneralItem(String aModID, String aItem, long aAmount){ + public static void addFullHazmatToGeneralItem(String aModID, String aItem, long aAmount) { ItemStack item = GT_ModHandler.getModItem(aModID, aItem, aAmount, W); addItemToHazmatLists(item); } - public static void addFullHazmatToIC2Item(String aItem){ + public static void addFullHazmatToIC2Item(String aItem) { ItemStack item = GT_ModHandler.getIC2Item(aItem, 1L, W); addItemToHazmatLists(item); } - private static void addItemToHazmatLists(ItemStack item){ + private static void addItemToHazmatLists(ItemStack item) { GregTech_API.sGasHazmatList.add(item); GregTech_API.sBioHazmatList.add(item); GregTech_API.sFrostHazmatList.add(item); @@ -2247,7 +3112,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG GregTech_API.sElectroHazmatList.add(item); } - public static boolean providesProtection(ItemStack aStack){ + public static boolean providesProtection(ItemStack aStack) { boolean isGas = GT_Utility.isStackInList(aStack, GregTech_API.sGasHazmatList); boolean isBio = GT_Utility.isStackInList(aStack, GregTech_API.sBioHazmatList); boolean isFrost = GT_Utility.isStackInList(aStack, GregTech_API.sFrostHazmatList); @@ -2261,8 +3126,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG public void onItemTooltip(ItemTooltipEvent event) { if (event.itemStack == null) { return; - } - else { + } else { ItemStack aStackTemp = event.itemStack; GT_ItemStack aStack = new GT_ItemStack(aStackTemp); if (providesProtection(aStackTemp)) { diff --git a/src/main/java/gregtech/common/GT_RecipeAdder.java b/src/main/java/gregtech/common/GT_RecipeAdder.java index db36458769..a3fd8013c2 100644 --- a/src/main/java/gregtech/common/GT_RecipeAdder.java +++ b/src/main/java/gregtech/common/GT_RecipeAdder.java @@ -1,5 +1,7 @@ package gregtech.common; +import static gregtech.GT_Mod.GT_FML_LOGGER; + import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.GT_Mod; @@ -14,6 +16,10 @@ import gregtech.api.objects.ItemData; import gregtech.api.util.*; import gregtech.api.util.GT_Recipe.GT_Recipe_AssemblyLine; import gregtech.common.items.GT_IntegratedCircuit_Item; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Comparator; +import java.util.List; import mods.railcraft.common.blocks.aesthetics.cube.EnumCube; import mods.railcraft.common.items.RailcraftToolItems; import net.minecraft.init.Blocks; @@ -23,84 +29,201 @@ import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Comparator; -import java.util.List; - -import static gregtech.GT_Mod.GT_FML_LOGGER; - public class GT_RecipeAdder implements IGT_RecipeAdder { - @Override @Deprecated - public boolean addFusionReactorRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, int aEUt, int aStartEU) { + public boolean addFusionReactorRecipe( + ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, int aEUt, int aStartEU) { return false; } - @Override //Really? - public boolean addFusionReactorRecipe(FluidStack aInput1, FluidStack aInput2, FluidStack aOutput1, int aDuration, int aEUt, int aStartEU) { + @Override // Really? + public boolean addFusionReactorRecipe( + FluidStack aInput1, FluidStack aInput2, FluidStack aOutput1, int aDuration, int aEUt, int aStartEU) { if (aInput1 == null || aInput2 == null || aOutput1 == null || aDuration < 1 || aEUt < 1 || aStartEU < 1) { return false; } - if ((aOutput1 != null) && ((aDuration = GregTech_API.sRecipeFile.get("fusion", aOutput1.getFluid().getName(), aDuration)) <= 0)) { + if ((aOutput1 != null) + && ((aDuration = GregTech_API.sRecipeFile.get( + "fusion", aOutput1.getFluid().getName(), aDuration)) + <= 0)) { return false; } - GT_Recipe.GT_Recipe_Map.sFusionRecipes.addRecipe(null, new FluidStack[]{aInput1, aInput2}, new FluidStack[]{aOutput1}, aDuration, aEUt, aStartEU); + GT_Recipe.GT_Recipe_Map.sFusionRecipes.addRecipe( + null, new FluidStack[] {aInput1, aInput2}, new FluidStack[] {aOutput1}, aDuration, aEUt, aStartEU); return true; } @Override - public boolean addFusionReactorRecipe(FluidStack[] FluidInputArray, FluidStack[] FluidOutputArray, int aFusionDurationInTicks, int aFusionEnergyPerTick, int aEnergyNeededForStartingFusion) { - if (FluidInputArray.length == 0) - return false; + public boolean addFusionReactorRecipe( + FluidStack[] FluidInputArray, + FluidStack[] FluidOutputArray, + int aFusionDurationInTicks, + int aFusionEnergyPerTick, + int aEnergyNeededForStartingFusion) { + if (FluidInputArray.length == 0) return false; - if (FluidOutputArray.length == 0) - return false; + if (FluidOutputArray.length == 0) return false; // If the recipe has more than 2 inputs or 2 outputs it is added to a different recipe map. // This is so NEI can function properly and understand the recipe. Otherwise it gets cut off. if ((FluidInputArray.length > 2) || (FluidInputArray.length > 2)) { - GT_Recipe.GT_Recipe_Map.sComplexFusionRecipes.addRecipe(null, FluidInputArray, FluidOutputArray, aFusionDurationInTicks, aFusionEnergyPerTick, aEnergyNeededForStartingFusion); + GT_Recipe.GT_Recipe_Map.sComplexFusionRecipes.addRecipe( + null, + FluidInputArray, + FluidOutputArray, + aFusionDurationInTicks, + aFusionEnergyPerTick, + aEnergyNeededForStartingFusion); return true; } - GT_Recipe.GT_Recipe_Map.sFusionRecipes.addRecipe(null, FluidInputArray, FluidOutputArray, aFusionDurationInTicks, aFusionEnergyPerTick, aEnergyNeededForStartingFusion); - return true; - } - - - @Override - public boolean addCentrifugeRecipe(ItemStack aInput1, int aInput2, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, ItemStack aOutput6, int aDuration) { - return addCentrifugeRecipe(aInput1, aInput2 < 0 ? ItemList.IC2_Fuel_Can_Empty.get(-aInput2, new Object[0]) : aInput2 > 0 ? ItemList.Cell_Empty.get(aInput2, new Object[0]) : null, null, null, aOutput1, aOutput2, aOutput3, aOutput4, aOutput5, aOutput6, null, aDuration, 5); - } - - @Override - public boolean addCentrifugeRecipe(ItemStack aInput1, int aInput2, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, ItemStack aOutput6, int aDuration, int aEUt) { - return addCentrifugeRecipe(aInput1, aInput2 < 0 ? ItemList.IC2_Fuel_Can_Empty.get(-aInput2, new Object[0]) : aInput2 > 0 ? ItemList.Cell_Empty.get(aInput2, new Object[0]) : null, null, null, aOutput1, aOutput2, aOutput3, aOutput4, aOutput5, aOutput6, null, aDuration, aEUt); - } - - @Override - public boolean addCentrifugeRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, ItemStack aOutput6, int[] aChances, int aDuration, int aEUt) { - return addCentrifugeRecipe(aInput1, aInput2, aFluidInput, aFluidOutput, aOutput1, aOutput2, aOutput3, aOutput4, aOutput5, aOutput6, aChances, aDuration, aEUt, false); - } - - @Override - public boolean addCentrifugeRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, ItemStack aOutput6, int[] aChances, int aDuration, int aEUt, boolean aCleanroom) { + GT_Recipe.GT_Recipe_Map.sFusionRecipes.addRecipe( + null, + FluidInputArray, + FluidOutputArray, + aFusionDurationInTicks, + aFusionEnergyPerTick, + aEnergyNeededForStartingFusion); + return true; + } + + @Override + public boolean addCentrifugeRecipe( + ItemStack aInput1, + int aInput2, + ItemStack aOutput1, + ItemStack aOutput2, + ItemStack aOutput3, + ItemStack aOutput4, + ItemStack aOutput5, + ItemStack aOutput6, + int aDuration) { + return addCentrifugeRecipe( + aInput1, + aInput2 < 0 + ? ItemList.IC2_Fuel_Can_Empty.get(-aInput2, new Object[0]) + : aInput2 > 0 ? ItemList.Cell_Empty.get(aInput2, new Object[0]) : null, + null, + null, + aOutput1, + aOutput2, + aOutput3, + aOutput4, + aOutput5, + aOutput6, + null, + aDuration, + 5); + } + + @Override + public boolean addCentrifugeRecipe( + ItemStack aInput1, + int aInput2, + ItemStack aOutput1, + ItemStack aOutput2, + ItemStack aOutput3, + ItemStack aOutput4, + ItemStack aOutput5, + ItemStack aOutput6, + int aDuration, + int aEUt) { + return addCentrifugeRecipe( + aInput1, + aInput2 < 0 + ? ItemList.IC2_Fuel_Can_Empty.get(-aInput2, new Object[0]) + : aInput2 > 0 ? ItemList.Cell_Empty.get(aInput2, new Object[0]) : null, + null, + null, + aOutput1, + aOutput2, + aOutput3, + aOutput4, + aOutput5, + aOutput6, + null, + aDuration, + aEUt); + } + + @Override + public boolean addCentrifugeRecipe( + ItemStack aInput1, + ItemStack aInput2, + FluidStack aFluidInput, + FluidStack aFluidOutput, + ItemStack aOutput1, + ItemStack aOutput2, + ItemStack aOutput3, + ItemStack aOutput4, + ItemStack aOutput5, + ItemStack aOutput6, + int[] aChances, + int aDuration, + int aEUt) { + return addCentrifugeRecipe( + aInput1, + aInput2, + aFluidInput, + aFluidOutput, + aOutput1, + aOutput2, + aOutput3, + aOutput4, + aOutput5, + aOutput6, + aChances, + aDuration, + aEUt, + false); + } + + @Override + public boolean addCentrifugeRecipe( + ItemStack aInput1, + ItemStack aInput2, + FluidStack aFluidInput, + FluidStack aFluidOutput, + ItemStack aOutput1, + ItemStack aOutput2, + ItemStack aOutput3, + ItemStack aOutput4, + ItemStack aOutput5, + ItemStack aOutput6, + int[] aChances, + int aDuration, + int aEUt, + boolean aCleanroom) { if (((aInput1 == null) && (aFluidInput == null)) || ((aOutput1 == null) && (aFluidOutput == null))) { return false; } if ((aInput1 != null) && ((aDuration = GregTech_API.sRecipeFile.get("centrifuge", aInput1, aDuration)) <= 0)) { return false; } - if ((aFluidInput != null) && ((aDuration = GregTech_API.sRecipeFile.get("centrifuge", aFluidInput.getFluid().getName(), aDuration)) <= 0)) { + if ((aFluidInput != null) + && ((aDuration = GregTech_API.sRecipeFile.get( + "centrifuge", aFluidInput.getFluid().getName(), aDuration)) + <= 0)) { return false; } if (!GT_Mod.gregtechproxy.mEnableCleanroom) { aCleanroom = false; } - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2}, new ItemStack[]{aOutput1, aOutput2, aOutput3, aOutput4, aOutput5, aOutput6,}, null, aChances, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUt, aCleanroom ? -100 : 0); + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe( + true, + new ItemStack[] {aInput1, aInput2}, + new ItemStack[] { + aOutput1, aOutput2, aOutput3, aOutput4, aOutput5, aOutput6, + }, + null, + aChances, + new FluidStack[] {aFluidInput}, + new FluidStack[] {aFluidOutput}, + aDuration, + aEUt, + aCleanroom ? -100 : 0); return true; } @@ -112,27 +235,80 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { if ((aInput1 != null) && ((aDuration = GregTech_API.sRecipeFile.get("compressor", aInput1, aDuration)) <= 0)) { return false; } - GT_Recipe.GT_Recipe_Map.sCompressorRecipes.addRecipe(true, new ItemStack[]{aInput1}, new ItemStack[]{aOutput1}, null, null, null, aDuration, aEUt, 0); - return true; - } - - @Override - public boolean addElectrolyzerRecipe(ItemStack aInput1, int aInput2, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, ItemStack aOutput6, int aDuration, int aEUt) { - return addElectrolyzerRecipe(aInput1, aInput2 < 0 ? ItemList.IC2_Fuel_Can_Empty.get(-aInput2, new Object[0]) : aInput2 > 0 ? ItemList.Cell_Empty.get(aInput2, new Object[0]) : null, null, null, aOutput1, aOutput2, aOutput3, aOutput4, aOutput5, aOutput6, null, aDuration, aEUt); - } - - @Override - public boolean addElectrolyzerRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, ItemStack aOutput6, int[] aChances, int aDuration, int aEUt) { + GT_Recipe.GT_Recipe_Map.sCompressorRecipes.addRecipe( + true, new ItemStack[] {aInput1}, new ItemStack[] {aOutput1}, null, null, null, aDuration, aEUt, 0); + return true; + } + + @Override + public boolean addElectrolyzerRecipe( + ItemStack aInput1, + int aInput2, + ItemStack aOutput1, + ItemStack aOutput2, + ItemStack aOutput3, + ItemStack aOutput4, + ItemStack aOutput5, + ItemStack aOutput6, + int aDuration, + int aEUt) { + return addElectrolyzerRecipe( + aInput1, + aInput2 < 0 + ? ItemList.IC2_Fuel_Can_Empty.get(-aInput2, new Object[0]) + : aInput2 > 0 ? ItemList.Cell_Empty.get(aInput2, new Object[0]) : null, + null, + null, + aOutput1, + aOutput2, + aOutput3, + aOutput4, + aOutput5, + aOutput6, + null, + aDuration, + aEUt); + } + + @Override + public boolean addElectrolyzerRecipe( + ItemStack aInput1, + ItemStack aInput2, + FluidStack aFluidInput, + FluidStack aFluidOutput, + ItemStack aOutput1, + ItemStack aOutput2, + ItemStack aOutput3, + ItemStack aOutput4, + ItemStack aOutput5, + ItemStack aOutput6, + int[] aChances, + int aDuration, + int aEUt) { if (((aInput1 == null) && (aFluidInput == null)) || ((aOutput1 == null) && (aFluidOutput == null))) { return false; } - if ((aInput1 != null) && ((aDuration = GregTech_API.sRecipeFile.get("electrolyzer", aInput1, aDuration)) <= 0)) { + if ((aInput1 != null) + && ((aDuration = GregTech_API.sRecipeFile.get("electrolyzer", aInput1, aDuration)) <= 0)) { return false; } - if ((aFluidInput != null) && ((aDuration = GregTech_API.sRecipeFile.get("electrolyzer", aFluidInput.getFluid().getName(), aDuration)) <= 0)) { + if ((aFluidInput != null) + && ((aDuration = GregTech_API.sRecipeFile.get( + "electrolyzer", aFluidInput.getFluid().getName(), aDuration)) + <= 0)) { return false; } - GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2}, new ItemStack[]{aOutput1, aOutput2, aOutput3, aOutput4, aOutput5, aOutput6}, null, aChances, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0); + GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.addRecipe( + true, + new ItemStack[] {aInput1, aInput2}, + new ItemStack[] {aOutput1, aOutput2, aOutput3, aOutput4, aOutput5, aOutput6}, + null, + aChances, + new FluidStack[] {aFluidInput}, + new FluidStack[] {aFluidOutput}, + aDuration, + aEUt, + 0); return true; } @@ -147,34 +323,78 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { } @Override - public boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration) { + public boolean addChemicalRecipe( + ItemStack aInput1, + ItemStack aInput2, + FluidStack aFluidInput, + FluidStack aFluidOutput, + ItemStack aOutput, + int aDuration) { return addChemicalRecipe(aInput1, aInput2, aFluidInput, aFluidOutput, aOutput, aDuration, 30); } @Override - public boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, ItemStack aOutput2, int aDuration) { + public boolean addChemicalRecipe( + ItemStack aInput1, + ItemStack aInput2, + FluidStack aFluidInput, + FluidStack aFluidOutput, + ItemStack aOutput, + ItemStack aOutput2, + int aDuration) { return addChemicalRecipe(aInput1, aInput2, aFluidInput, aFluidOutput, aOutput, aOutput2, aDuration, 30); } @Override - public boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUTick) { - return addChemicalRecipe(aInput1, aInput2, aFluidInput, aFluidOutput, aOutput, GT_Values.NI, aDuration, aEUTick); + public boolean addChemicalRecipe( + ItemStack aInput1, + ItemStack aInput2, + FluidStack aFluidInput, + FluidStack aFluidOutput, + ItemStack aOutput, + int aDuration, + int aEUTick) { + return addChemicalRecipe( + aInput1, aInput2, aFluidInput, aFluidOutput, aOutput, GT_Values.NI, aDuration, aEUTick); } @Override - public boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, ItemStack aOutput2, int aDuration, int aEUtick) { - return addChemicalRecipe(aInput1, aInput2, aFluidInput, aFluidOutput, aOutput, aOutput2, aDuration, aEUtick, false); + public boolean addChemicalRecipe( + ItemStack aInput1, + ItemStack aInput2, + FluidStack aFluidInput, + FluidStack aFluidOutput, + ItemStack aOutput, + ItemStack aOutput2, + int aDuration, + int aEUtick) { + return addChemicalRecipe( + aInput1, aInput2, aFluidInput, aFluidOutput, aOutput, aOutput2, aDuration, aEUtick, false); } @Override - public boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, ItemStack aOutput2, int aDuration, int aEUtick, boolean aCleanroom) { - if (((aInput1 == null) && (aFluidInput == null)) || ((aOutput == null) && (aOutput2 == null) && (aFluidOutput == null))) { + public boolean addChemicalRecipe( + ItemStack aInput1, + ItemStack aInput2, + FluidStack aFluidInput, + FluidStack aFluidOutput, + ItemStack aOutput, + ItemStack aOutput2, + int aDuration, + int aEUtick, + boolean aCleanroom) { + if (((aInput1 == null) && (aFluidInput == null)) + || ((aOutput == null) && (aOutput2 == null) && (aFluidOutput == null))) { return false; } - if ((aOutput != null || aOutput2 != null) && ((aDuration = GregTech_API.sRecipeFile.get("chemicalreactor", aOutput, aDuration)) <= 0)) { + if ((aOutput != null || aOutput2 != null) + && ((aDuration = GregTech_API.sRecipeFile.get("chemicalreactor", aOutput, aDuration)) <= 0)) { return false; } - if ((aFluidOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get("chemicalreactor", aFluidOutput.getFluid().getName(), aDuration)) <= 0)) { + if ((aFluidOutput != null) + && ((aDuration = GregTech_API.sRecipeFile.get( + "chemicalreactor", aFluidOutput.getFluid().getName(), aDuration)) + <= 0)) { return false; } if (aEUtick <= 0) { @@ -183,99 +403,261 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { if (!GT_Mod.gregtechproxy.mEnableCleanroom) { aCleanroom = false; } - GT_Recipe.GT_Recipe_Map.sChemicalRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2}, new ItemStack[]{aOutput, aOutput2}, null, null, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUtick, aCleanroom ? -200 : 0); - if (!(aInput1 != null && aInput1.getItem() instanceof GT_IntegratedCircuit_Item && aInput1.getItemDamage() >= 10) - && !(aInput2 != null && aInput2.getItem() instanceof GT_IntegratedCircuit_Item && aInput2.getItemDamage() >= 10)) { - GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes.addRecipe(false, new ItemStack[]{aInput1, aInput2}, new ItemStack[]{aOutput, aOutput2}, null, null, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUtick, 0); - } - return true; - } - - @Override - public boolean addMultiblockChemicalRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, ItemStack[] aOutputs, int aDuration, int aEUtick) { + GT_Recipe.GT_Recipe_Map.sChemicalRecipes.addRecipe( + true, + new ItemStack[] {aInput1, aInput2}, + new ItemStack[] {aOutput, aOutput2}, + null, + null, + new FluidStack[] {aFluidInput}, + new FluidStack[] {aFluidOutput}, + aDuration, + aEUtick, + aCleanroom ? -200 : 0); + if (!(aInput1 != null + && aInput1.getItem() instanceof GT_IntegratedCircuit_Item + && aInput1.getItemDamage() >= 10) + && !(aInput2 != null + && aInput2.getItem() instanceof GT_IntegratedCircuit_Item + && aInput2.getItemDamage() >= 10)) { + GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes.addRecipe( + false, + new ItemStack[] {aInput1, aInput2}, + new ItemStack[] {aOutput, aOutput2}, + null, + null, + new FluidStack[] {aFluidInput}, + new FluidStack[] {aFluidOutput}, + aDuration, + aEUtick, + 0); + } + return true; + } + + @Override + public boolean addMultiblockChemicalRecipe( + ItemStack[] aInputs, + FluidStack[] aFluidInputs, + FluidStack[] aFluidOutputs, + ItemStack[] aOutputs, + int aDuration, + int aEUtick) { if (areItemsAndFluidsBothNull(aInputs, aFluidInputs) || areItemsAndFluidsBothNull(aOutputs, aFluidOutputs)) { return false; } if (aEUtick <= 0) { return false; } - GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes.addRecipe(false, aInputs, aOutputs, null, null, aFluidInputs, aFluidOutputs, aDuration, aEUtick, 0); + GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes.addRecipe( + false, aInputs, aOutputs, null, null, aFluidInputs, aFluidOutputs, aDuration, aEUtick, 0); return true; } @Override - public boolean addChemicalRecipeForBasicMachineOnly(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, ItemStack aOutput2, int aDuration, int aEUtick) { - if (((aInput1 == null) && (aFluidInput == null)) || ((aOutput == null) && (aOutput2 == null) && (aFluidOutput == null))) { + public boolean addChemicalRecipeForBasicMachineOnly( + ItemStack aInput1, + ItemStack aInput2, + FluidStack aFluidInput, + FluidStack aFluidOutput, + ItemStack aOutput, + ItemStack aOutput2, + int aDuration, + int aEUtick) { + if (((aInput1 == null) && (aFluidInput == null)) + || ((aOutput == null) && (aOutput2 == null) && (aFluidOutput == null))) { return false; } - if ((aOutput != null || aOutput2 != null) && ((aDuration = GregTech_API.sRecipeFile.get("chemicalreactor", aOutput, aDuration)) <= 0)) { + if ((aOutput != null || aOutput2 != null) + && ((aDuration = GregTech_API.sRecipeFile.get("chemicalreactor", aOutput, aDuration)) <= 0)) { return false; } - if ((aFluidOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get("chemicalreactor", aFluidOutput.getFluid().getName(), aDuration)) <= 0)) { + if ((aFluidOutput != null) + && ((aDuration = GregTech_API.sRecipeFile.get( + "chemicalreactor", aFluidOutput.getFluid().getName(), aDuration)) + <= 0)) { return false; } if (aEUtick <= 0) { return false; } - GT_Recipe.GT_Recipe_Map.sChemicalRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2}, new ItemStack[]{aOutput, aOutput2}, null, null, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUtick, 0); + GT_Recipe.GT_Recipe_Map.sChemicalRecipes.addRecipe( + true, + new ItemStack[] {aInput1, aInput2}, + new ItemStack[] {aOutput, aOutput2}, + null, + null, + new FluidStack[] {aFluidInput}, + new FluidStack[] {aFluidOutput}, + aDuration, + aEUtick, + 0); return true; } @Override public void addDefaultPolymerizationRecipes(Fluid aBasicMaterial, ItemStack aBasicMaterialCell, Fluid aPolymer) { - //Oxygen/Titaniumtetrafluoride -> +50% Output each - addChemicalRecipe(ItemList.Cell_Air.get(1, new Object[0]), GT_Utility.getIntegratedCircuit(1), new GT_FluidStack(aBasicMaterial, 144), new GT_FluidStack(aPolymer, 144), Materials.Empty.getCells(1), 160); - addChemicalRecipe(Materials.Oxygen.getCells(1), GT_Utility.getIntegratedCircuit(1), new GT_FluidStack(aBasicMaterial, 144), new GT_FluidStack(aPolymer, 216), Materials.Empty.getCells(1), 160); - addChemicalRecipe(aBasicMaterialCell, GT_Utility.getIntegratedCircuit(1), Materials.Air.getGas(14000), new GT_FluidStack(aPolymer, 1000), Materials.Empty.getCells(1), 1120); - addChemicalRecipe(aBasicMaterialCell, GT_Utility.getIntegratedCircuit(1), Materials.Oxygen.getGas(7000), new GT_FluidStack(aPolymer, 1500), Materials.Empty.getCells(1), 1120); - addMultiblockChemicalRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(2)}, - new FluidStack[]{new GT_FluidStack(aBasicMaterial, 2160), Materials.Air.getGas(7500), Materials.Titaniumtetrachloride.getFluid(100)}, - new FluidStack[]{new GT_FluidStack(aPolymer, 3240)}, null, 800, 30); - addMultiblockChemicalRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(2)}, - new FluidStack[]{new GT_FluidStack(aBasicMaterial, 2160), Materials.Oxygen.getGas(7500), Materials.Titaniumtetrachloride.getFluid(100)}, - new FluidStack[]{new GT_FluidStack(aPolymer, 4320)}, null, 800, 30); - } - - - @Override - public boolean addBlastRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt, int aLevel) { + // Oxygen/Titaniumtetrafluoride -> +50% Output each + addChemicalRecipe( + ItemList.Cell_Air.get(1, new Object[0]), + GT_Utility.getIntegratedCircuit(1), + new GT_FluidStack(aBasicMaterial, 144), + new GT_FluidStack(aPolymer, 144), + Materials.Empty.getCells(1), + 160); + addChemicalRecipe( + Materials.Oxygen.getCells(1), + GT_Utility.getIntegratedCircuit(1), + new GT_FluidStack(aBasicMaterial, 144), + new GT_FluidStack(aPolymer, 216), + Materials.Empty.getCells(1), + 160); + addChemicalRecipe( + aBasicMaterialCell, + GT_Utility.getIntegratedCircuit(1), + Materials.Air.getGas(14000), + new GT_FluidStack(aPolymer, 1000), + Materials.Empty.getCells(1), + 1120); + addChemicalRecipe( + aBasicMaterialCell, + GT_Utility.getIntegratedCircuit(1), + Materials.Oxygen.getGas(7000), + new GT_FluidStack(aPolymer, 1500), + Materials.Empty.getCells(1), + 1120); + addMultiblockChemicalRecipe( + new ItemStack[] {GT_Utility.getIntegratedCircuit(2)}, + new FluidStack[] { + new GT_FluidStack(aBasicMaterial, 2160), + Materials.Air.getGas(7500), + Materials.Titaniumtetrachloride.getFluid(100) + }, + new FluidStack[] {new GT_FluidStack(aPolymer, 3240)}, + null, + 800, + 30); + addMultiblockChemicalRecipe( + new ItemStack[] {GT_Utility.getIntegratedCircuit(2)}, + new FluidStack[] { + new GT_FluidStack(aBasicMaterial, 2160), + Materials.Oxygen.getGas(7500), + Materials.Titaniumtetrachloride.getFluid(100) + }, + new FluidStack[] {new GT_FluidStack(aPolymer, 4320)}, + null, + 800, + 30); + } + + @Override + public boolean addBlastRecipe( + ItemStack aInput1, + ItemStack aInput2, + ItemStack aOutput1, + ItemStack aOutput2, + int aDuration, + int aEUt, + int aLevel) { return addBlastRecipe(aInput1, aInput2, null, null, aOutput1, aOutput2, aDuration, aEUt, aLevel); } @Override - public boolean addBlastRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt, int aLevel) { + public boolean addBlastRecipe( + ItemStack aInput1, + ItemStack aInput2, + FluidStack aFluidInput, + FluidStack aFluidOutput, + ItemStack aOutput1, + ItemStack aOutput2, + int aDuration, + int aEUt, + int aLevel) { if ((aInput1 == null) || (aOutput1 == null)) { return false; } if ((aDuration = GregTech_API.sRecipeFile.get("blastfurnace", aInput1, aDuration)) <= 0) { return false; } - GT_Recipe.GT_Recipe_Map.sBlastRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2}, new ItemStack[]{aOutput1, aOutput2}, null, null, - new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUt, aLevel); - return true; - } - - public boolean addBlastRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aInput3, ItemStack aInput4, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, int aDuration, int aEUt, int aLevel) { + GT_Recipe.GT_Recipe_Map.sBlastRecipes.addRecipe( + true, + new ItemStack[] {aInput1, aInput2}, + new ItemStack[] {aOutput1, aOutput2}, + null, + null, + new FluidStack[] {aFluidInput}, + new FluidStack[] {aFluidOutput}, + aDuration, + aEUt, + aLevel); + return true; + } + + public boolean addBlastRecipe( + ItemStack aInput1, + ItemStack aInput2, + ItemStack aInput3, + ItemStack aInput4, + FluidStack aFluidInput, + FluidStack aFluidOutput, + ItemStack aOutput1, + ItemStack aOutput2, + ItemStack aOutput3, + ItemStack aOutput4, + int aDuration, + int aEUt, + int aLevel) { if ((aInput1 == null) || (aOutput1 == null)) { return false; } if ((aDuration = GregTech_API.sRecipeFile.get("blastfurnace", aInput1, aDuration)) <= 0) { return false; } - GT_Recipe.GT_Recipe_Map.sBlastRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2, aInput3, aInput4}, new ItemStack[]{aOutput1, aOutput2, aOutput3, aOutput4}, null, null, - new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUt, aLevel); - return true; - } - - @Override - public boolean addPlasmaForgeRecipe(ItemStack[] ItemInputArray, FluidStack[] FluidInputArray, ItemStack[] OutputItemArray, FluidStack[] FluidOutputArray, int aDuration, int aEUt, int coil_heat_level) { - GT_Recipe.GT_Recipe_Map.sPlasmaForgeRecipes.addRecipe(false, ItemInputArray, OutputItemArray, null, null, - FluidInputArray, FluidOutputArray, aDuration, aEUt, coil_heat_level); - return true; - } - - @Override - public boolean addPrimitiveBlastRecipe(ItemStack aInput1, ItemStack aInput2, int aCoalAmount, ItemStack aOutput1, ItemStack aOutput2, int aDuration) { + GT_Recipe.GT_Recipe_Map.sBlastRecipes.addRecipe( + true, + new ItemStack[] {aInput1, aInput2, aInput3, aInput4}, + new ItemStack[] {aOutput1, aOutput2, aOutput3, aOutput4}, + null, + null, + new FluidStack[] {aFluidInput}, + new FluidStack[] {aFluidOutput}, + aDuration, + aEUt, + aLevel); + return true; + } + + @Override + public boolean addPlasmaForgeRecipe( + ItemStack[] ItemInputArray, + FluidStack[] FluidInputArray, + ItemStack[] OutputItemArray, + FluidStack[] FluidOutputArray, + int aDuration, + int aEUt, + int coil_heat_level) { + GT_Recipe.GT_Recipe_Map.sPlasmaForgeRecipes.addRecipe( + false, + ItemInputArray, + OutputItemArray, + null, + null, + FluidInputArray, + FluidOutputArray, + aDuration, + aEUt, + coil_heat_level); + return true; + } + + @Override + public boolean addPrimitiveBlastRecipe( + ItemStack aInput1, + ItemStack aInput2, + int aCoalAmount, + ItemStack aOutput1, + ItemStack aOutput2, + int aDuration) { if ((aInput1 == null && aInput2 == null) || (aOutput1 == null && aOutput2 == null)) { return false; } @@ -285,37 +667,124 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { if ((aDuration = GregTech_API.sRecipeFile.get("primitiveblastfurnace", aInput1, aDuration)) <= 0) { return false; } - Materials[] coals = new Materials[]{Materials.Coal, Materials.Charcoal}; + Materials[] coals = new Materials[] {Materials.Coal, Materials.Charcoal}; for (Materials coal : coals) { - GT_Recipe.GT_Recipe_Map.sPrimitiveBlastRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2, coal.getGems(aCoalAmount)}, new ItemStack[]{aOutput1, aOutput2, Materials.DarkAsh.getDustTiny(aCoalAmount)}, null, null, null, null, aDuration, 0, 0); - GT_Recipe.GT_Recipe_Map.sPrimitiveBlastRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2, coal.getDust(aCoalAmount)}, new ItemStack[]{aOutput1, aOutput2, Materials.DarkAsh.getDustTiny(aCoalAmount)}, null, null, null, null, aDuration, 0, 0); + GT_Recipe.GT_Recipe_Map.sPrimitiveBlastRecipes.addRecipe( + true, + new ItemStack[] {aInput1, aInput2, coal.getGems(aCoalAmount)}, + new ItemStack[] {aOutput1, aOutput2, Materials.DarkAsh.getDustTiny(aCoalAmount)}, + null, + null, + null, + null, + aDuration, + 0, + 0); + GT_Recipe.GT_Recipe_Map.sPrimitiveBlastRecipes.addRecipe( + true, + new ItemStack[] {aInput1, aInput2, coal.getDust(aCoalAmount)}, + new ItemStack[] {aOutput1, aOutput2, Materials.DarkAsh.getDustTiny(aCoalAmount)}, + null, + null, + null, + null, + aDuration, + 0, + 0); } if (Loader.isModLoaded("Railcraft")) { - GT_Recipe.GT_Recipe_Map.sPrimitiveBlastRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2, RailcraftToolItems.getCoalCoke(aCoalAmount / 2)}, new ItemStack[]{aOutput1, aOutput2, Materials.Ash.getDustTiny(aCoalAmount / 2)}, null, null, null, null, aDuration * 2 / 3, 0, 0); + GT_Recipe.GT_Recipe_Map.sPrimitiveBlastRecipes.addRecipe( + true, + new ItemStack[] {aInput1, aInput2, RailcraftToolItems.getCoalCoke(aCoalAmount / 2)}, + new ItemStack[] {aOutput1, aOutput2, Materials.Ash.getDustTiny(aCoalAmount / 2)}, + null, + null, + null, + null, + aDuration * 2 / 3, + 0, + 0); } if (Loader.isModLoaded("miscutils")) { - GT_Recipe.GT_Recipe_Map.sPrimitiveBlastRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2, GT_ModHandler.getModItem("miscutils", "itemCactusCoke", (aCoalAmount * 2))}, new ItemStack[]{aOutput1, aOutput2, Materials.Ash.getDustTiny(aCoalAmount * 2)}, null, null, null, null, aDuration * 2 / 3, 0, 0); - GT_Recipe.GT_Recipe_Map.sPrimitiveBlastRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2, GT_ModHandler.getModItem("miscutils", "itemSugarCoke", (aCoalAmount * 2))}, new ItemStack[]{aOutput1, aOutput2, Materials.Ash.getDustTiny(aCoalAmount * 2)}, null, null, null, null, aDuration * 2 / 3, 0, 0); - } - if ((aInput1 == null || aInput1.stackSize <= 6) && (aInput2 == null || aInput2.stackSize <= 6) && - (aOutput1 == null || aOutput1.stackSize <= 6) && (aOutput2 == null || aOutput2.stackSize <= 6)) { + GT_Recipe.GT_Recipe_Map.sPrimitiveBlastRecipes.addRecipe( + true, + new ItemStack[] { + aInput1, aInput2, GT_ModHandler.getModItem("miscutils", "itemCactusCoke", (aCoalAmount * 2)) + }, + new ItemStack[] {aOutput1, aOutput2, Materials.Ash.getDustTiny(aCoalAmount * 2)}, + null, + null, + null, + null, + aDuration * 2 / 3, + 0, + 0); + GT_Recipe.GT_Recipe_Map.sPrimitiveBlastRecipes.addRecipe( + true, + new ItemStack[] { + aInput1, aInput2, GT_ModHandler.getModItem("miscutils", "itemSugarCoke", (aCoalAmount * 2)) + }, + new ItemStack[] {aOutput1, aOutput2, Materials.Ash.getDustTiny(aCoalAmount * 2)}, + null, + null, + null, + null, + aDuration * 2 / 3, + 0, + 0); + } + if ((aInput1 == null || aInput1.stackSize <= 6) + && (aInput2 == null || aInput2.stackSize <= 6) + && (aOutput1 == null || aOutput1.stackSize <= 6) + && (aOutput2 == null || aOutput2.stackSize <= 6)) { aInput1 = aInput1 == null ? null : GT_Utility.copyAmount(aInput1.stackSize * 10, aInput1); aInput2 = aInput2 == null ? null : GT_Utility.copyAmount(aInput2.stackSize * 10, aInput2); aOutput1 = aOutput1 == null ? null : GT_Utility.copyAmount(aOutput1.stackSize * 10, aOutput1); aOutput2 = aOutput2 == null ? null : GT_Utility.copyAmount(aOutput2.stackSize * 10, aOutput2); for (Materials coal : coals) { - GT_Recipe.GT_Recipe_Map.sPrimitiveBlastRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2, coal.getBlocks(aCoalAmount)}, new ItemStack[]{aOutput1, aOutput2, Materials.DarkAsh.getDust(aCoalAmount)}, null, null, null, null, aDuration * 10, 0, 0); - GT_Recipe.GT_Recipe_Map.sPrimitiveBlastRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2, coal.getBlocks(aCoalAmount)}, new ItemStack[]{aOutput1, aOutput2, Materials.DarkAsh.getDust(aCoalAmount)}, null, null, null, null, aDuration * 10, 0, 0); + GT_Recipe.GT_Recipe_Map.sPrimitiveBlastRecipes.addRecipe( + true, + new ItemStack[] {aInput1, aInput2, coal.getBlocks(aCoalAmount)}, + new ItemStack[] {aOutput1, aOutput2, Materials.DarkAsh.getDust(aCoalAmount)}, + null, + null, + null, + null, + aDuration * 10, + 0, + 0); + GT_Recipe.GT_Recipe_Map.sPrimitiveBlastRecipes.addRecipe( + true, + new ItemStack[] {aInput1, aInput2, coal.getBlocks(aCoalAmount)}, + new ItemStack[] {aOutput1, aOutput2, Materials.DarkAsh.getDust(aCoalAmount)}, + null, + null, + null, + null, + aDuration * 10, + 0, + 0); } if (Loader.isModLoaded("Railcraft")) { - GT_Recipe.GT_Recipe_Map.sPrimitiveBlastRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2, EnumCube.COKE_BLOCK.getItem(aCoalAmount / 2)}, new ItemStack[]{aOutput1, aOutput2, Materials.Ash.getDust(aCoalAmount / 2)}, null, null, null, null, aDuration * 20 / 3, 0, 0); + GT_Recipe.GT_Recipe_Map.sPrimitiveBlastRecipes.addRecipe( + true, + new ItemStack[] {aInput1, aInput2, EnumCube.COKE_BLOCK.getItem(aCoalAmount / 2)}, + new ItemStack[] {aOutput1, aOutput2, Materials.Ash.getDust(aCoalAmount / 2)}, + null, + null, + null, + null, + aDuration * 20 / 3, + 0, + 0); } } return true; } @Override - public boolean addCannerRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt) { + public boolean addCannerRecipe( + ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt) { if ((aInput1 == null) || (aOutput1 == null)) { return false; } @@ -327,19 +796,25 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { } @Override - public boolean addAlloySmelterRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, int aEUt) { + public boolean addAlloySmelterRecipe( + ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, int aEUt) { return addAlloySmelterRecipe(aInput1, aInput2, aOutput1, aDuration, aEUt, false); } @Override - public boolean addAlloySmelterRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, int aEUt, boolean hidden) { + public boolean addAlloySmelterRecipe( + ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, int aEUt, boolean hidden) { if ((aInput1 == null) || (aOutput1 == null || Materials.Graphite.contains(aInput1))) { return false; } - if ((aInput2 == null) && ((OrePrefixes.ingot.contains(aInput1)) || (OrePrefixes.dust.contains(aInput1)) || (OrePrefixes.gem.contains(aInput1)))) { + if ((aInput2 == null) + && ((OrePrefixes.ingot.contains(aInput1)) + || (OrePrefixes.dust.contains(aInput1)) + || (OrePrefixes.gem.contains(aInput1)))) { return false; } - if ((aDuration = GregTech_API.sRecipeFile.get("alloysmelting", aInput2 == null ? aInput1 : aOutput1, aDuration)) <= 0) { + if ((aDuration = GregTech_API.sRecipeFile.get("alloysmelting", aInput2 == null ? aInput1 : aOutput1, aDuration)) + <= 0) { return false; } GT_Recipe tRecipe = new GT_Recipe(aInput1, aInput2, aEUt, aDuration, aOutput1); @@ -374,28 +849,48 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { } @Override - public boolean addCutterRecipe(ItemStack aInput, FluidStack aLubricant, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt) { + public boolean addCutterRecipe( + ItemStack aInput, FluidStack aLubricant, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt) { if ((aInput == null) || (aLubricant == null) || (aOutput1 == null)) { return false; } if ((aDuration = GregTech_API.sRecipeFile.get("cutting", aInput, aDuration)) <= 0) { return false; } - GT_Recipe.GT_Recipe_Map.sCutterRecipes.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput1, aOutput2}, null, new FluidStack[]{aLubricant}, null, aDuration, aEUt, 0); + GT_Recipe.GT_Recipe_Map.sCutterRecipes.addRecipe( + true, + new ItemStack[] {aInput}, + new ItemStack[] {aOutput1, aOutput2}, + null, + new FluidStack[] {aLubricant}, + null, + aDuration, + aEUt, + 0); return true; } @Override - public boolean addCutterRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt, boolean aCleanroom) { + public boolean addCutterRecipe( + ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt, boolean aCleanroom) { return addCutterRecipe(aInput, null, aOutput1, aOutput2, aDuration, aEUt, aCleanroom); } - public boolean addCutterRecipe(ItemStack aInput, int aCircuit, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt) { + public boolean addCutterRecipe( + ItemStack aInput, int aCircuit, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt) { return addCutterRecipe(aInput, aCircuit, aOutput1, aOutput2, aDuration, aEUt, false); } - public boolean addCutterRecipe(ItemStack aInput, int aCircuit, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt, boolean aCleanroom) { - return addCutterRecipe(aInput, GT_Utility.getIntegratedCircuit(aCircuit), aOutput1, aOutput2, aDuration, aEUt, aCleanroom); + public boolean addCutterRecipe( + ItemStack aInput, + int aCircuit, + ItemStack aOutput1, + ItemStack aOutput2, + int aDuration, + int aEUt, + boolean aCleanroom) { + return addCutterRecipe( + aInput, GT_Utility.getIntegratedCircuit(aCircuit), aOutput1, aOutput2, aDuration, aEUt, aCleanroom); } @Override @@ -404,16 +899,30 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { } @Override - public boolean addCutterRecipe(ItemStack aInput, ItemStack aCircuit, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt) { + public boolean addCutterRecipe( + ItemStack aInput, ItemStack aCircuit, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt) { return addCutterRecipe(aInput, aCircuit, aOutput1, aOutput2, aDuration, aEUt, false); } @Override - public boolean addCutterRecipe(ItemStack aInput, ItemStack aCircuit, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt, boolean aCleanroom) { - return addCutterRecipe(new ItemStack[]{aInput, aCircuit}, new ItemStack[]{aOutput1, aOutput2}, aDuration, aEUt, aCleanroom ? -200 : 0); + public boolean addCutterRecipe( + ItemStack aInput, + ItemStack aCircuit, + ItemStack aOutput1, + ItemStack aOutput2, + int aDuration, + int aEUt, + boolean aCleanroom) { + return addCutterRecipe( + new ItemStack[] {aInput, aCircuit}, + new ItemStack[] {aOutput1, aOutput2}, + aDuration, + aEUt, + aCleanroom ? -200 : 0); } - public boolean addCutterRecipe(ItemStack[] aInputs, ItemStack[] aOutputs, int aDuration, int aEUt, boolean aCleanroom) { + public boolean addCutterRecipe( + ItemStack[] aInputs, ItemStack[] aOutputs, int aDuration, int aEUt, boolean aCleanroom) { return addCutterRecipe(aInputs, aOutputs, aDuration, aEUt, aCleanroom ? -200 : 0); } @@ -428,24 +937,65 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { if (!GT_Mod.gregtechproxy.mEnableCleanroom && aSpecial == -200) { aSpecial = 0; } - GT_Recipe.GT_Recipe_Map.sCutterRecipes.addRecipe(true, aInputs, aOutputs, null, new FluidStack[]{Materials.Water.getFluid(Math.max(4, Math.min(1000, aDuration * aEUt / 320)))}, null, aDuration * 2, aEUt, aSpecial); - GT_Recipe.GT_Recipe_Map.sCutterRecipes.addRecipe(true, aInputs, aOutputs, null, new FluidStack[]{GT_ModHandler.getDistilledWater(Math.max(3, Math.min(750, aDuration * aEUt / 426)))}, null, aDuration * 2, aEUt, aSpecial); - GT_Recipe.GT_Recipe_Map.sCutterRecipes.addRecipe(true, aInputs, aOutputs, null, new FluidStack[]{Materials.Lubricant.getFluid(Math.max(1, Math.min(250, aDuration * aEUt / 1280)))}, null, aDuration, aEUt, aSpecial); - return true; - } - - - @Override - public boolean addAssemblerRecipe(ItemStack aInput1, Object aOreDict, int aAmount, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt) { + GT_Recipe.GT_Recipe_Map.sCutterRecipes.addRecipe( + true, + aInputs, + aOutputs, + null, + new FluidStack[] {Materials.Water.getFluid(Math.max(4, Math.min(1000, aDuration * aEUt / 320)))}, + null, + aDuration * 2, + aEUt, + aSpecial); + GT_Recipe.GT_Recipe_Map.sCutterRecipes.addRecipe( + true, + aInputs, + aOutputs, + null, + new FluidStack[] {GT_ModHandler.getDistilledWater(Math.max(3, Math.min(750, aDuration * aEUt / 426)))}, + null, + aDuration * 2, + aEUt, + aSpecial); + GT_Recipe.GT_Recipe_Map.sCutterRecipes.addRecipe( + true, + aInputs, + aOutputs, + null, + new FluidStack[] {Materials.Lubricant.getFluid(Math.max(1, Math.min(250, aDuration * aEUt / 1280)))}, + null, + aDuration, + aEUt, + aSpecial); + return true; + } + + @Override + public boolean addAssemblerRecipe( + ItemStack aInput1, + Object aOreDict, + int aAmount, + FluidStack aFluidInput, + ItemStack aOutput1, + int aDuration, + int aEUt) { for (ItemStack tStack : GT_OreDictUnificator.getOresImmutable(aOreDict)) { if (GT_Utility.isStackValid(tStack)) - addAssemblerRecipe(aInput1, GT_Utility.copyAmount(aAmount, tStack), aFluidInput, aOutput1, aDuration, aEUt); + addAssemblerRecipe( + aInput1, GT_Utility.copyAmount(aAmount, tStack), aFluidInput, aOutput1, aDuration, aEUt); } return true; } @Override - public boolean addAssemblerRecipe(ItemStack[] aInputs, Object aOreDict, int aAmount, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt) { + public boolean addAssemblerRecipe( + ItemStack[] aInputs, + Object aOreDict, + int aAmount, + FluidStack aFluidInput, + ItemStack aOutput1, + int aDuration, + int aEUt) { for (ItemStack tStack : GT_OreDictUnificator.getOresImmutable(aOreDict)) { if (GT_Utility.isStackValid(tStack)) { ItemStack[] extendedInputs = new ItemStack[aInputs.length + 1]; @@ -458,31 +1008,49 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { } @Override - public boolean addAssemblerRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, int aEUt) { - return addAssemblerRecipe(new ItemStack[]{aInput1, aInput2 == null ? aInput1 : aInput2}, null, aOutput1, aDuration, aEUt, false); + public boolean addAssemblerRecipe( + ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, int aEUt) { + return addAssemblerRecipe( + new ItemStack[] {aInput1, aInput2 == null ? aInput1 : aInput2}, null, aOutput1, aDuration, aEUt, false); } @Override - public boolean addAssemblerRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt) { - return addAssemblerRecipe(new ItemStack[]{aInput1, aInput2}, aFluidInput, aOutput1, aDuration, aEUt); + public boolean addAssemblerRecipe( + ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt) { + return addAssemblerRecipe(new ItemStack[] {aInput1, aInput2}, aFluidInput, aOutput1, aDuration, aEUt); } @Override - public boolean addAssemblerRecipe(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt) { + public boolean addAssemblerRecipe( + ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt) { return addAssemblerRecipe(aInputs, aFluidInput, aOutput1, aDuration, aEUt, false); } @Override - public boolean addAssemblerRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt, boolean aCleanroom) { + public boolean addAssemblerRecipe( + ItemStack aInput1, + ItemStack aInput2, + FluidStack aFluidInput, + ItemStack aOutput1, + int aDuration, + int aEUt, + boolean aCleanroom) { if (aInput2 == null) - return addAssemblerRecipe(new ItemStack[]{aInput1}, aFluidInput, aOutput1, aDuration, aEUt, aCleanroom); - return addAssemblerRecipe(new ItemStack[]{aInput1, aInput2}, aFluidInput, aOutput1, aDuration, aEUt, aCleanroom); + return addAssemblerRecipe(new ItemStack[] {aInput1}, aFluidInput, aOutput1, aDuration, aEUt, aCleanroom); + return addAssemblerRecipe( + new ItemStack[] {aInput1, aInput2}, aFluidInput, aOutput1, aDuration, aEUt, aCleanroom); } @Override - public boolean addAssemblerRecipe(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt, boolean aCleanroom) { + public boolean addAssemblerRecipe( + ItemStack[] aInputs, + FluidStack aFluidInput, + ItemStack aOutput1, + int aDuration, + int aEUt, + boolean aCleanroom) { - if (areItemsAndFluidsBothNull(aInputs, new FluidStack[]{aFluidInput})) { + if (areItemsAndFluidsBothNull(aInputs, new FluidStack[] {aFluidInput})) { return false; } @@ -513,15 +1081,30 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { } if (!ret) { - GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.addRecipe(true, aInputs, new ItemStack[]{aOutput1}, null, new FluidStack[]{aFluidInput}, null, aDuration, aEUt, aCleanroom ? -200 : 0); + GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.addRecipe( + true, + aInputs, + new ItemStack[] {aOutput1}, + null, + new FluidStack[] {aFluidInput}, + null, + aDuration, + aEUt, + aCleanroom ? -200 : 0); ret = true; } return ret; } - public boolean addAssemblerRecipeNonOD(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt, boolean aCleanroom) { - if (areItemsAndFluidsBothNull(aInputs, new FluidStack[]{aFluidInput})) { + public boolean addAssemblerRecipeNonOD( + ItemStack[] aInputs, + FluidStack aFluidInput, + ItemStack aOutput1, + int aDuration, + int aEUt, + boolean aCleanroom) { + if (areItemsAndFluidsBothNull(aInputs, new FluidStack[] {aFluidInput})) { return false; } @@ -537,11 +1120,19 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return false; } - GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.addRecipe(true, aInputs, new ItemStack[]{aOutput1}, null, new FluidStack[]{aFluidInput}, null, aDuration, aEUt, aCleanroom ? -200 : 0); + GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.addRecipe( + true, + aInputs, + new ItemStack[] {aOutput1}, + null, + new FluidStack[] {aFluidInput}, + null, + aDuration, + aEUt, + aCleanroom ? -200 : 0); return true; } - @Override public boolean addWiremillRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEUt) { if ((aInput == null) || (aOutput == null)) { @@ -550,7 +1141,8 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { if ((aDuration = GregTech_API.sRecipeFile.get("wiremill", aInput, aDuration)) <= 0) { return false; } - GT_Recipe.GT_Recipe_Map.sWiremillRecipes.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput}, null, null, null, aDuration, aEUt, 0); + GT_Recipe.GT_Recipe_Map.sWiremillRecipes.addRecipe( + true, new ItemStack[] {aInput}, new ItemStack[] {aOutput}, null, null, null, aDuration, aEUt, 0); return true; } @@ -562,7 +1154,8 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { if ((aDuration = GregTech_API.sRecipeFile.get("polarizer", aInput, aDuration)) <= 0) { return false; } - GT_Recipe.GT_Recipe_Map.sPolarizerRecipes.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput}, null, null, null, aDuration, aEUt, 0); + GT_Recipe.GT_Recipe_Map.sPolarizerRecipes.addRecipe( + true, new ItemStack[] {aInput}, new ItemStack[] {aOutput}, null, null, null, aDuration, aEUt, 0); return true; } @@ -586,7 +1179,16 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { if ((aDuration = GregTech_API.sRecipeFile.get("bender", aInput1, aDuration)) <= 0) { return false; } - GT_Recipe tRecipe = new GT_Recipe(new ItemStack[]{aInput1, aCircuit}, new ItemStack[]{aOutput1}, null, null, null, null, aDuration, Math.max(aEUt, 1), 0); + GT_Recipe tRecipe = new GT_Recipe( + new ItemStack[] {aInput1, aCircuit}, + new ItemStack[] {aOutput1}, + null, + null, + null, + null, + aDuration, + Math.max(aEUt, 1), + 0); GT_Recipe.GT_Recipe_Map.sBenderRecipes.addRecipe(tRecipe); return true; } @@ -599,7 +1201,16 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { if ((aDuration = GregTech_API.sRecipeFile.get("extruder", aOutput, aDuration)) <= 0) { return false; } - GT_Recipe.GT_Recipe_Map.sExtruderRecipes.addRecipe(true, new ItemStack[]{aInput, aShape}, new ItemStack[]{aOutput}, null, null, null, aDuration, aEUt, 0); + GT_Recipe.GT_Recipe_Map.sExtruderRecipes.addRecipe( + true, + new ItemStack[] {aInput, aShape}, + new ItemStack[] {aOutput}, + null, + null, + null, + aDuration, + aEUt, + 0); return true; } @@ -611,36 +1222,81 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { if ((aDuration = GregTech_API.sRecipeFile.get("slicer", aOutput, aDuration)) <= 0) { return false; } - GT_Recipe.GT_Recipe_Map.sSlicerRecipes.addRecipe(true, new ItemStack[]{aInput, aShape}, new ItemStack[]{aOutput}, null, null, null, aDuration, aEUt, 0); + GT_Recipe.GT_Recipe_Map.sSlicerRecipes.addRecipe( + true, + new ItemStack[] {aInput, aShape}, + new ItemStack[] {aOutput}, + null, + null, + null, + aDuration, + aEUt, + 0); return true; } @Override - public boolean addOreWasherRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, FluidStack aFluidInput, int aDuration, int aEUt) { - if ((aInput == null) || (aFluidInput == null) || ((aOutput1 == null) || (aOutput2 == null) || (aOutput3 == null))) { + public boolean addOreWasherRecipe( + ItemStack aInput, + ItemStack aOutput1, + ItemStack aOutput2, + ItemStack aOutput3, + FluidStack aFluidInput, + int aDuration, + int aEUt) { + if ((aInput == null) + || (aFluidInput == null) + || ((aOutput1 == null) || (aOutput2 == null) || (aOutput3 == null))) { return false; } if ((aDuration = GregTech_API.sRecipeFile.get("orewasher", aInput, aDuration)) <= 0) { return false; } - GT_Recipe.GT_Recipe_Map.sOreWasherRecipes.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput1, aOutput2, aOutput3}, null, new FluidStack[]{aFluidInput}, null, aDuration, aEUt, 0); + GT_Recipe.GT_Recipe_Map.sOreWasherRecipes.addRecipe( + true, + new ItemStack[] {aInput}, + new ItemStack[] {aOutput1, aOutput2, aOutput3}, + null, + new FluidStack[] {aFluidInput}, + null, + aDuration, + aEUt, + 0); return true; } @Override - public boolean addOreWasherRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, FluidStack aFluidInput, int[] aChances, int aDuration, int aEUt) { - if ((aInput == null) || (aFluidInput == null) || ((aOutput1 == null) || (aOutput2 == null) || (aOutput3 == null))) { + public boolean addOreWasherRecipe( + ItemStack aInput, + ItemStack aOutput1, + ItemStack aOutput2, + ItemStack aOutput3, + FluidStack aFluidInput, + int[] aChances, + int aDuration, + int aEUt) { + if ((aInput == null) + || (aFluidInput == null) + || ((aOutput1 == null) || (aOutput2 == null) || (aOutput3 == null))) { return false; } if ((aDuration = GregTech_API.sRecipeFile.get("orewasher", aInput, aDuration)) <= 0) { return false; } - GT_Recipe.GT_Recipe_Map.sOreWasherRecipes.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput1, aOutput2, aOutput3}, null, aChances, new FluidStack[]{aFluidInput}, null, aDuration, aEUt, 0); + GT_Recipe.GT_Recipe_Map.sOreWasherRecipes.addRecipe( + true, + new ItemStack[] {aInput}, + new ItemStack[] {aOutput1, aOutput2, aOutput3}, + null, + aChances, + new FluidStack[] {aFluidInput}, + null, + aDuration, + aEUt, + 0); return true; } - - @Override public boolean addImplosionRecipe(ItemStack aInput1, int aInput2, ItemStack aOutput1, ItemStack aOutput2) { if ((aInput1 == null) || (aOutput1 == null)) { @@ -650,65 +1306,144 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return false; } int tExplosives = aInput2 > 0 ? aInput2 < 64 ? aInput2 : 64 : 1; - int tGunpowder = tExplosives<<1;//Worst - int tDynamite = Math.max(1, tExplosives>>1);//good - int tTNT = tExplosives;//Slightly better - int tITNT = Math.max(1, tExplosives>>2);//the best - //new GT_Recipe(aInput1, aInput2, aOutput1, aOutput2); - if(tGunpowder<65){ - GT_Recipe.GT_Recipe_Map.sImplosionRecipes.addRecipe(true, new ItemStack[]{aInput1, ItemList.Block_Powderbarrel.get(tGunpowder, new Object[0])}, new ItemStack[]{aOutput1, aOutput2}, null, null, null, null, 20, 30, 0); - } - if(tDynamite<17){ - GT_Recipe.GT_Recipe_Map.sImplosionRecipes.addRecipe(true, new ItemStack[]{aInput1, GT_ModHandler.getIC2Item("dynamite", tDynamite, null)}, new ItemStack[]{aOutput1, aOutput2}, null, null, null, null, 20, 30, 0); - } - GT_Recipe.GT_Recipe_Map.sImplosionRecipes.addRecipe(true, new ItemStack[]{aInput1, new ItemStack(Blocks.tnt,tTNT)}, new ItemStack[]{aOutput1, aOutput2}, null, null, null, null, 20, 30, 0); - GT_Recipe.GT_Recipe_Map.sImplosionRecipes.addRecipe(true, new ItemStack[]{aInput1, GT_ModHandler.getIC2Item("industrialTnt", tITNT, null)}, new ItemStack[]{aOutput1, aOutput2}, null, null, null, null, 20, 30, 0); + int tGunpowder = tExplosives << 1; // Worst + int tDynamite = Math.max(1, tExplosives >> 1); // good + int tTNT = tExplosives; // Slightly better + int tITNT = Math.max(1, tExplosives >> 2); // the best + // new GT_Recipe(aInput1, aInput2, aOutput1, aOutput2); + if (tGunpowder < 65) { + GT_Recipe.GT_Recipe_Map.sImplosionRecipes.addRecipe( + true, + new ItemStack[] {aInput1, ItemList.Block_Powderbarrel.get(tGunpowder, new Object[0])}, + new ItemStack[] {aOutput1, aOutput2}, + null, + null, + null, + null, + 20, + 30, + 0); + } + if (tDynamite < 17) { + GT_Recipe.GT_Recipe_Map.sImplosionRecipes.addRecipe( + true, + new ItemStack[] {aInput1, GT_ModHandler.getIC2Item("dynamite", tDynamite, null)}, + new ItemStack[] {aOutput1, aOutput2}, + null, + null, + null, + null, + 20, + 30, + 0); + } + GT_Recipe.GT_Recipe_Map.sImplosionRecipes.addRecipe( + true, + new ItemStack[] {aInput1, new ItemStack(Blocks.tnt, tTNT)}, + new ItemStack[] {aOutput1, aOutput2}, + null, + null, + null, + null, + 20, + 30, + 0); + GT_Recipe.GT_Recipe_Map.sImplosionRecipes.addRecipe( + true, + new ItemStack[] {aInput1, GT_ModHandler.getIC2Item("industrialTnt", tITNT, null)}, + new ItemStack[] {aOutput1, aOutput2}, + null, + null, + null, + null, + 20, + 30, + 0); return true; } @Override @Deprecated - public boolean addDistillationRecipe(ItemStack aInput1, int aInput2, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, int aDuration, int aEUt) { + public boolean addDistillationRecipe( + ItemStack aInput1, + int aInput2, + ItemStack aOutput1, + ItemStack aOutput2, + ItemStack aOutput3, + ItemStack aOutput4, + int aDuration, + int aEUt) { return false; } @Override - public boolean addUniversalDistillationRecipe(FluidStack aInput, FluidStack[] aOutputs, ItemStack aOutput2, int aDuration, int aEUt) { + public boolean addUniversalDistillationRecipe( + FluidStack aInput, FluidStack[] aOutputs, ItemStack aOutput2, int aDuration, int aEUt) { for (int i = 0; i < Math.min(aOutputs.length, 11); i++) { addDistilleryRecipe(i + 1, aInput, aOutputs[i], aOutput2, aDuration * 2, aEUt / 4, false); - } return addDistillationTowerRecipe(aInput, aOutputs, aOutput2, aDuration, aEUt); } @Override - public boolean addDistillationTowerRecipe(FluidStack aInput, FluidStack[] aOutputs, ItemStack aOutput2, int aDuration, int aEUt) { + public boolean addDistillationTowerRecipe( + FluidStack aInput, FluidStack[] aOutputs, ItemStack aOutput2, int aDuration, int aEUt) { if (aInput == null || aOutputs == null || aOutputs.length < 1 || aOutputs.length > 11) { return false; } if ((aDuration = GregTech_API.sRecipeFile.get("distillation", aInput.getUnlocalizedName(), aDuration)) <= 0) { return false; } - GT_Recipe.GT_Recipe_Map.sDistillationRecipes.addRecipe(false, null, new ItemStack[]{aOutput2}, null, new FluidStack[]{aInput}, aOutputs, Math.max(1, aDuration), Math.max(1, aEUt), 0); + GT_Recipe.GT_Recipe_Map.sDistillationRecipes.addRecipe( + false, + null, + new ItemStack[] {aOutput2}, + null, + new FluidStack[] {aInput}, + aOutputs, + Math.max(1, aDuration), + Math.max(1, aEUt), + 0); return false; } @Override - public boolean addDistillationTowerRecipe(FluidStack aInput, ItemStack[] aCircuit, FluidStack[] aOutputs, ItemStack aOutput2, int aDuration, int aEUt) { + public boolean addDistillationTowerRecipe( + FluidStack aInput, + ItemStack[] aCircuit, + FluidStack[] aOutputs, + ItemStack aOutput2, + int aDuration, + int aEUt) { if (aInput == null || aOutputs == null || aOutputs.length < 1 || aOutputs.length > 11) { return false; } if ((aDuration = GregTech_API.sRecipeFile.get("distillation", aInput.getUnlocalizedName(), aDuration)) <= 0) { return false; } - GT_Recipe.GT_Recipe_Map.sDistillationRecipes.addRecipe(false, aCircuit, new ItemStack[]{aOutput2}, null, new FluidStack[]{aInput}, aOutputs, Math.max(1, aDuration), Math.max(1, aEUt), 0); + GT_Recipe.GT_Recipe_Map.sDistillationRecipes.addRecipe( + false, + aCircuit, + new ItemStack[] {aOutput2}, + null, + new FluidStack[] {aInput}, + aOutputs, + Math.max(1, aDuration), + Math.max(1, aEUt), + 0); return false; } @Override - public boolean addUniversalDistillationRecipewithCircuit(FluidStack aInput, ItemStack[] aCircuit, FluidStack[] aOutputs, ItemStack aOutput2, int aDuration, int aEUt) { + public boolean addUniversalDistillationRecipewithCircuit( + FluidStack aInput, + ItemStack[] aCircuit, + FluidStack[] aOutputs, + ItemStack aOutput2, + int aDuration, + int aEUt) { for (int i = 0; i < Math.min(aOutputs.length, 11); i++) { addDistilleryRecipe(i + 1, aInput, aOutputs[i], aOutput2, aDuration * 2, aEUt / 4, false); } @@ -723,7 +1458,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { if ((aDuration = GregTech_API.sRecipeFile.get("vacuumfreezer", aInput1, aDuration)) <= 0) { return false; } - new GT_Recipe(aInput1, aOutput1, aDuration, aEUt, 0);//Since all other methods are taken + new GT_Recipe(aInput1, aOutput1, aDuration, aEUt, 0); // Since all other methods are taken FluidStack tInputFluid = GT_Utility.getFluidForFilledItem(aInput1, true); FluidStack tOutputFluid = GT_Utility.getFluidForFilledItem(aOutput1, true); if (tInputFluid != null && tOutputFluid != null) { @@ -755,20 +1490,40 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return false; } - new GT_Recipe(aInput1, aOutput1, aDuration, aEUt); + new GT_Recipe(aInput1, aOutput1, aDuration, aEUt); return true; } @Override - public boolean addVacuumFreezerRecipe(ItemStack[] aItemInput, FluidStack[] aFluidInput, ItemStack[] aItemOutput, FluidStack[] aFluidOutput, int aDuration, int aEUt) { - GT_Recipe.GT_Recipe_Map.sVacuumRecipes.addRecipe(false, aItemInput, aItemOutput, null, aFluidInput, aFluidOutput, Math.max(1, aDuration), Math.max(1, aEUt), 0); + public boolean addVacuumFreezerRecipe( + ItemStack[] aItemInput, + FluidStack[] aFluidInput, + ItemStack[] aItemOutput, + FluidStack[] aFluidOutput, + int aDuration, + int aEUt) { + GT_Recipe.GT_Recipe_Map.sVacuumRecipes.addRecipe( + false, + aItemInput, + aItemOutput, + null, + aFluidInput, + aFluidOutput, + Math.max(1, aDuration), + Math.max(1, aEUt), + 0); return true; } - @Override @Deprecated - public boolean addGrinderRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4) { + public boolean addGrinderRecipe( + ItemStack aInput1, + ItemStack aInput2, + ItemStack aOutput1, + ItemStack aOutput2, + ItemStack aOutput3, + ItemStack aOutput4) { return false; } @@ -797,7 +1552,16 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { } @Override - public boolean addChemicalBathRecipe(ItemStack aInput, FluidStack aBathingFluid, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, FluidStack aFluidOutput, int[] aChances, int aDuration, int aEUt) { + public boolean addChemicalBathRecipe( + ItemStack aInput, + FluidStack aBathingFluid, + ItemStack aOutput1, + ItemStack aOutput2, + ItemStack aOutput3, + FluidStack aFluidOutput, + int[] aChances, + int aDuration, + int aEUt) { return false; } @@ -809,55 +1573,103 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { if (!GregTech_API.sRecipeFile.get("forgehammer", aOutput1, true)) { return false; } - GT_Recipe.GT_Recipe_Map.sHammerRecipes.addRecipe(true, new ItemStack[]{aInput1}, new ItemStack[]{aOutput1}, null, null, null, aDuration, aEUt, 0); + GT_Recipe.GT_Recipe_Map.sHammerRecipes.addRecipe( + true, new ItemStack[] {aInput1}, new ItemStack[] {aOutput1}, null, null, null, aDuration, aEUt, 0); return true; } @Override - public boolean addBoxingRecipe(ItemStack aContainedItem, ItemStack aEmptyBox, ItemStack aFullBox, int aDuration, int aEUt) { + public boolean addBoxingRecipe( + ItemStack aContainedItem, ItemStack aEmptyBox, ItemStack aFullBox, int aDuration, int aEUt) { if ((aContainedItem == null) || (aFullBox == null)) { return false; } if (!GregTech_API.sRecipeFile.get("boxing", aFullBox, true)) { return false; } - GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes.addRecipe(true, new ItemStack[]{aContainedItem, aEmptyBox}, new ItemStack[]{aFullBox}, null, null, null, aDuration, aEUt, 0); + GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes.addRecipe( + true, + new ItemStack[] {aContainedItem, aEmptyBox}, + new ItemStack[] {aFullBox}, + null, + null, + null, + aDuration, + aEUt, + 0); return true; } @Override - public boolean addUnboxingRecipe(ItemStack aFullBox, ItemStack aContainedItem, ItemStack aEmptyBox, int aDuration, int aEUt) { + public boolean addUnboxingRecipe( + ItemStack aFullBox, ItemStack aContainedItem, ItemStack aEmptyBox, int aDuration, int aEUt) { if ((aFullBox == null) || (aContainedItem == null)) { return false; } if (!GregTech_API.sRecipeFile.get("unboxing", aFullBox, true)) { return false; } - GT_Recipe.GT_Recipe_Map.sUnboxinatorRecipes.addRecipe(true, new ItemStack[]{aFullBox}, new ItemStack[]{aContainedItem, aEmptyBox}, null, null, null, aDuration, aEUt, 0); + GT_Recipe.GT_Recipe_Map.sUnboxinatorRecipes.addRecipe( + true, + new ItemStack[] {aFullBox}, + new ItemStack[] {aContainedItem, aEmptyBox}, + null, + null, + null, + aDuration, + aEUt, + 0); return true; } @Override - public boolean addThermalCentrifugeRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, int aDuration, int aEUt) { + public boolean addThermalCentrifugeRecipe( + ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, int aDuration, int aEUt) { if ((aInput == null) || (aOutput1 == null)) { return false; } if (!GregTech_API.sRecipeFile.get("thermalcentrifuge", aInput, true)) { return false; } - GT_Recipe.GT_Recipe_Map.sThermalCentrifugeRecipes.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput1, aOutput2, aOutput3}, null, null, null, aDuration, aEUt, 0); + GT_Recipe.GT_Recipe_Map.sThermalCentrifugeRecipes.addRecipe( + true, + new ItemStack[] {aInput}, + new ItemStack[] {aOutput1, aOutput2, aOutput3}, + null, + null, + null, + aDuration, + aEUt, + 0); return true; } @Override - public boolean addThermalCentrifugeRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, int[] aChances, int aDuration, int aEUt) { + public boolean addThermalCentrifugeRecipe( + ItemStack aInput, + ItemStack aOutput1, + ItemStack aOutput2, + ItemStack aOutput3, + int[] aChances, + int aDuration, + int aEUt) { if ((aInput == null) || (aOutput1 == null)) { return false; } if (!GregTech_API.sRecipeFile.get("thermalcentrifuge", aInput, true)) { return false; } - GT_Recipe.GT_Recipe_Map.sThermalCentrifugeRecipes.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput1, aOutput2, aOutput3}, null, aChances, null, null, aDuration, aEUt, 0); + GT_Recipe.GT_Recipe_Map.sThermalCentrifugeRecipes.addRecipe( + true, + new ItemStack[] {aInput}, + new ItemStack[] {aOutput1, aOutput2, aOutput3}, + null, + aChances, + null, + null, + aDuration, + aEUt, + 0); return true; } @@ -869,19 +1681,38 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { if ((aDuration = GregTech_API.sRecipeFile.get("amplifier", aAmplifierItem, aDuration)) <= 0) { return false; } - GT_Recipe.GT_Recipe_Map.sAmplifiers.addRecipe(true, new ItemStack[]{aAmplifierItem}, null, null, null, new FluidStack[]{Materials.UUAmplifier.getFluid(aAmplifierAmountOutputted)}, aDuration, 30, 0); + GT_Recipe.GT_Recipe_Map.sAmplifiers.addRecipe( + true, + new ItemStack[] {aAmplifierItem}, + null, + null, + null, + new FluidStack[] {Materials.UUAmplifier.getFluid(aAmplifierAmountOutputted)}, + aDuration, + 30, + 0); return true; } @Override - public boolean addBrewingRecipe(ItemStack aIngredient, Fluid aInput, Fluid aOutput, int aDuration, int aEUt, boolean aHidden) { + public boolean addBrewingRecipe( + ItemStack aIngredient, Fluid aInput, Fluid aOutput, int aDuration, int aEUt, boolean aHidden) { if ((aIngredient == null) || (aInput == null) || (aOutput == null)) { return false; } if (!GregTech_API.sRecipeFile.get("brewing", aOutput.getUnlocalizedName(), true)) { return false; } - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sBrewingRecipes.addRecipe(false, new ItemStack[]{aIngredient}, null, null, new FluidStack[]{new FluidStack(aInput, 750)}, new FluidStack[]{new FluidStack(aOutput, 750)}, aDuration, aEUt, 0); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sBrewingRecipes.addRecipe( + false, + new ItemStack[] {aIngredient}, + null, + null, + new FluidStack[] {new FluidStack(aInput, 750)}, + new FluidStack[] {new FluidStack(aOutput, 750)}, + aDuration, + aEUt, + 0); if ((aHidden) && (tRecipe != null)) { tRecipe.mHidden = true; } @@ -894,14 +1725,24 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { } @Override - public boolean addBrewingRecipeCustom(ItemStack aIngredient, FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt, boolean aHidden) { + public boolean addBrewingRecipeCustom( + ItemStack aIngredient, FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt, boolean aHidden) { if ((aInput == null) || (aOutput == null)) { return false; } if (!GregTech_API.sRecipeFile.get("brewing", aOutput.getUnlocalizedName(), true)) { return false; } - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sBrewingRecipes.addRecipe(false, new ItemStack[]{aIngredient}, null, null, new FluidStack[]{aInput}, new FluidStack[]{aOutput}, aDuration, aEUt, 0); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sBrewingRecipes.addRecipe( + false, + new ItemStack[] {aIngredient}, + null, + null, + new FluidStack[] {aInput}, + new FluidStack[] {aOutput}, + aDuration, + aEUt, + 0); if ((aHidden) && (tRecipe != null)) { tRecipe.mHidden = true; } @@ -909,14 +1750,18 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { } @Override - public boolean addFermentingRecipe(FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt, boolean aHidden) { + public boolean addFermentingRecipe( + FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt, boolean aHidden) { if ((aInput == null) || (aOutput == null)) { return false; } - if ((aDuration = GregTech_API.sRecipeFile.get("fermenting", aOutput.getFluid().getUnlocalizedName(), aDuration)) <= 0) { + if ((aDuration = GregTech_API.sRecipeFile.get( + "fermenting", aOutput.getFluid().getUnlocalizedName(), aDuration)) + <= 0) { return false; } - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sFermentingRecipes.addRecipe(false, null, null, null, new FluidStack[]{aInput}, new FluidStack[]{aOutput}, aDuration, aEUt, 0); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sFermentingRecipes.addRecipe( + false, null, null, null, new FluidStack[] {aInput}, new FluidStack[] {aOutput}, aDuration, aEUt, 0); if ((aHidden) && (tRecipe != null)) { tRecipe.mHidden = true; } @@ -929,18 +1774,27 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { } @Override - public boolean addDistilleryRecipe(ItemStack aCircuit, FluidStack aInput, FluidStack aOutput, ItemStack aSolidOutput, int aDuration, int aEUt, boolean aHidden) { + public boolean addDistilleryRecipe( + ItemStack aCircuit, + FluidStack aInput, + FluidStack aOutput, + ItemStack aSolidOutput, + int aDuration, + int aEUt, + boolean aHidden) { if ((aInput == null) || (aOutput == null)) { return false; } - if ((aDuration = GregTech_API.sRecipeFile.get("distillery", aOutput.getFluid().getUnlocalizedName(), aDuration)) <= 0) { + if ((aDuration = GregTech_API.sRecipeFile.get( + "distillery", aOutput.getFluid().getUnlocalizedName(), aDuration)) + <= 0) { return false; } - //reduce the batch size if fluid amount is exceeding + // reduce the batch size if fluid amount is exceeding int tScale = (Math.max(aInput.amount, aOutput.amount) + 999) / 1000; if (tScale <= 0) tScale = 1; - if (tScale > 1){ - //trying to find whether there is a better factor + if (tScale > 1) { + // trying to find whether there is a better factor for (int i = tScale; i <= 5; i++) { if (aInput.amount % i == 0 && aDuration % i == 0) { tScale = i; @@ -957,8 +1811,11 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { aOutput = new FluidStack(aOutput.getFluid(), aOutput.amount / tScale); if (aSolidOutput != null) { ItemData tData = GT_OreDictUnificator.getItemData(aSolidOutput); - if (tData != null && (tData.mPrefix == OrePrefixes.dust || OrePrefixes.dust.mFamiliarPrefixes.contains(tData.mPrefix))) - aSolidOutput = GT_OreDictUnificator.getDust(tData.mMaterial.mMaterial, tData.mMaterial.mAmount * aSolidOutput.stackSize / tScale); + if (tData != null + && (tData.mPrefix == OrePrefixes.dust + || OrePrefixes.dust.mFamiliarPrefixes.contains(tData.mPrefix))) + aSolidOutput = GT_OreDictUnificator.getDust( + tData.mMaterial.mMaterial, tData.mMaterial.mAmount * aSolidOutput.stackSize / tScale); else { if (aSolidOutput.stackSize / tScale == 0) aSolidOutput = GT_Values.NI; else aSolidOutput = new ItemStack(aSolidOutput.getItem(), aSolidOutput.stackSize / tScale); @@ -967,30 +1824,57 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { aDuration = (aDuration + tScale - 1) / tScale; } - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sDistilleryRecipes.addRecipe(true, new ItemStack[]{aCircuit}, new ItemStack[]{aSolidOutput}, null, new FluidStack[]{aInput}, new FluidStack[]{aOutput}, aDuration, aEUt, 0); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sDistilleryRecipes.addRecipe( + true, + new ItemStack[] {aCircuit}, + new ItemStack[] {aSolidOutput}, + null, + new FluidStack[] {aInput}, + new FluidStack[] {aOutput}, + aDuration, + aEUt, + 0); if ((aHidden) && (tRecipe != null)) { tRecipe.mHidden = true; } return true; - } + @Override - public boolean addDistilleryRecipe(ItemStack aCircuit, FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt, boolean aHidden) { + public boolean addDistilleryRecipe( + ItemStack aCircuit, FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt, boolean aHidden) { return addDistilleryRecipe(aCircuit, aInput, aOutput, null, aDuration, aEUt, aHidden); } @Override - public boolean addDistilleryRecipe(int circuitConfig, FluidStack aInput, FluidStack aOutput, ItemStack aSolidOutput, int aDuration, int aEUt, boolean aHidden) { - return addDistilleryRecipe(GT_Utility.getIntegratedCircuit(circuitConfig), aInput, aOutput, aSolidOutput, aDuration, aEUt, aHidden); + public boolean addDistilleryRecipe( + int circuitConfig, + FluidStack aInput, + FluidStack aOutput, + ItemStack aSolidOutput, + int aDuration, + int aEUt, + boolean aHidden) { + return addDistilleryRecipe( + GT_Utility.getIntegratedCircuit(circuitConfig), + aInput, + aOutput, + aSolidOutput, + aDuration, + aEUt, + aHidden); } @Override - public boolean addDistilleryRecipe(int circuitConfig, FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt, boolean aHidden) { - return addDistilleryRecipe(GT_Utility.getIntegratedCircuit(circuitConfig), aInput, aOutput, aDuration, aEUt, aHidden); + public boolean addDistilleryRecipe( + int circuitConfig, FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt, boolean aHidden) { + return addDistilleryRecipe( + GT_Utility.getIntegratedCircuit(circuitConfig), aInput, aOutput, aDuration, aEUt, aHidden); } @Override - public boolean addFluidSolidifierRecipe(ItemStack aMold, FluidStack aInput, ItemStack aOutput, int aDuration, int aEUt) { + public boolean addFluidSolidifierRecipe( + ItemStack aMold, FluidStack aInput, ItemStack aOutput, int aDuration, int aEUt) { if ((aMold == null) || (aInput == null) || (aOutput == null)) { return false; } @@ -1003,17 +1887,34 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { if ((aDuration = GregTech_API.sRecipeFile.get("fluidsolidifier", aOutput, aDuration)) <= 0) { return false; } - GT_Recipe.GT_Recipe_Map.sFluidSolidficationRecipes.addRecipe(true, new ItemStack[]{aMold}, new ItemStack[]{aOutput}, null, new FluidStack[]{aInput}, null, aDuration, aEUt, 0); + GT_Recipe.GT_Recipe_Map.sFluidSolidficationRecipes.addRecipe( + true, + new ItemStack[] {aMold}, + new ItemStack[] {aOutput}, + null, + new FluidStack[] {aInput}, + null, + aDuration, + aEUt, + 0); return true; } @Override - public boolean addFluidSmelterRecipe(ItemStack aInput, ItemStack aRemains, FluidStack aOutput, int aChance, int aDuration, int aEUt) { + public boolean addFluidSmelterRecipe( + ItemStack aInput, ItemStack aRemains, FluidStack aOutput, int aChance, int aDuration, int aEUt) { return addFluidSmelterRecipe(aInput, aRemains, aOutput, aChance, aDuration, aEUt, false); } @Override - public boolean addFluidSmelterRecipe(ItemStack aInput, ItemStack aRemains, FluidStack aOutput, int aChance, int aDuration, int aEUt, boolean hidden) { + public boolean addFluidSmelterRecipe( + ItemStack aInput, + ItemStack aRemains, + FluidStack aOutput, + int aChance, + int aDuration, + int aEUt, + boolean hidden) { if ((aInput == null) || (aOutput == null)) { return false; } @@ -1026,7 +1927,17 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { if ((aDuration = GregTech_API.sRecipeFile.get("fluidsmelter", aInput, aDuration)) <= 0) { return false; } - GT_Recipe tRecipe =GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aRemains}, null, new int[]{aChance}, null, new FluidStack[]{aOutput}, aDuration, aEUt, 0); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes.addRecipe( + true, + new ItemStack[] {aInput}, + new ItemStack[] {aRemains}, + null, + new int[] {aChance}, + null, + new FluidStack[] {aOutput}, + aDuration, + aEUt, + 0); if ((hidden) && (tRecipe != null)) { tRecipe.mHidden = true; } @@ -1034,7 +1945,8 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { } @Override - public boolean addFluidExtractionRecipe(ItemStack aInput, ItemStack aRemains, FluidStack aOutput, int aChance, int aDuration, int aEUt) { + public boolean addFluidExtractionRecipe( + ItemStack aInput, ItemStack aRemains, FluidStack aOutput, int aChance, int aDuration, int aEUt) { if ((aInput == null) || (aOutput == null)) { return false; } @@ -1047,13 +1959,24 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { if ((aDuration = GregTech_API.sRecipeFile.get("fluidextractor", aInput, aDuration)) <= 0) { return false; } - GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aRemains}, null, new int[]{aChance}, null, new FluidStack[]{aOutput}, aDuration, aEUt, 0); + GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes.addRecipe( + true, + new ItemStack[] {aInput}, + new ItemStack[] {aRemains}, + null, + new int[] {aChance}, + null, + new FluidStack[] {aOutput}, + aDuration, + aEUt, + 0); return true; } @Override - public boolean addFluidCannerRecipe(ItemStack aInput, ItemStack aOutput, FluidStack aFluidInput, FluidStack aFluidOutput) { - int aDuration= aFluidOutput == null ? aFluidInput.amount / 62 : aFluidOutput.amount / 62; + public boolean addFluidCannerRecipe( + ItemStack aInput, ItemStack aOutput, FluidStack aFluidInput, FluidStack aFluidOutput) { + int aDuration = aFluidOutput == null ? aFluidInput.amount / 62 : aFluidOutput.amount / 62; if (aInput == null || aOutput == null) { return false; @@ -1064,12 +1987,27 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { if ((aDuration = GregTech_API.sRecipeFile.get("fluidcanner", aInput, aDuration)) <= 0) { return false; } - GT_Recipe.GT_Recipe_Map.sFluidCannerRecipes.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput}, null, new FluidStack[]{aFluidInput == null ? null : aFluidInput}, new FluidStack[]{aFluidOutput == null ? null : aFluidOutput}, aDuration, 1, 0); + GT_Recipe.GT_Recipe_Map.sFluidCannerRecipes.addRecipe( + true, + new ItemStack[] {aInput}, + new ItemStack[] {aOutput}, + null, + new FluidStack[] {aFluidInput == null ? null : aFluidInput}, + new FluidStack[] {aFluidOutput == null ? null : aFluidOutput}, + aDuration, + 1, + 0); return true; } @Override - public boolean addFluidCannerRecipe(ItemStack aInput, ItemStack aOutput, FluidStack aFluidInput, FluidStack aFluidOutput, int aDuration, int aEUt) { + public boolean addFluidCannerRecipe( + ItemStack aInput, + ItemStack aOutput, + FluidStack aFluidInput, + FluidStack aFluidOutput, + int aDuration, + int aEUt) { if (aInput == null || aOutput == null) { return false; } @@ -1079,42 +2017,106 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { if ((aDuration = GregTech_API.sRecipeFile.get("fluidcanner", aInput, aDuration)) <= 0) { return false; } - GT_Recipe.GT_Recipe_Map.sFluidCannerRecipes.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput}, null, new FluidStack[]{aFluidInput == null ? null : aFluidInput}, new FluidStack[]{aFluidOutput == null ? null : aFluidOutput}, aDuration, aEUt, 0); + GT_Recipe.GT_Recipe_Map.sFluidCannerRecipes.addRecipe( + true, + new ItemStack[] {aInput}, + new ItemStack[] {aOutput}, + null, + new FluidStack[] {aFluidInput == null ? null : aFluidInput}, + new FluidStack[] {aFluidOutput == null ? null : aFluidOutput}, + aDuration, + aEUt, + 0); return true; } + @Override - public boolean addChemicalBathRecipe(ItemStack aInput, FluidStack aBathingFluid, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, int[] aChances, int aDuration, int aEUt) { + public boolean addChemicalBathRecipe( + ItemStack aInput, + FluidStack aBathingFluid, + ItemStack aOutput1, + ItemStack aOutput2, + ItemStack aOutput3, + int[] aChances, + int aDuration, + int aEUt) { if ((aInput == null) || (aBathingFluid == null) || (aOutput1 == null)) { return false; } if ((aDuration = GregTech_API.sRecipeFile.get("chemicalbath", aInput, aDuration)) <= 0) { return false; } - GT_Recipe.GT_Recipe_Map.sChemicalBathRecipes.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput1, aOutput2, aOutput3}, null, aChances, new FluidStack[]{aBathingFluid}, null, aDuration, aEUt, 0); + GT_Recipe.GT_Recipe_Map.sChemicalBathRecipes.addRecipe( + true, + new ItemStack[] {aInput}, + new ItemStack[] {aOutput1, aOutput2, aOutput3}, + null, + aChances, + new FluidStack[] {aBathingFluid}, + null, + aDuration, + aEUt, + 0); return true; } @Override - public boolean addChemicalBathRecipe(ItemStack aInput, FluidStack aBathingFluid, FluidStack aFluidOutput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, int[] aChances, int aDuration, int aEUt) { + public boolean addChemicalBathRecipe( + ItemStack aInput, + FluidStack aBathingFluid, + FluidStack aFluidOutput, + ItemStack aOutput1, + ItemStack aOutput2, + ItemStack aOutput3, + int[] aChances, + int aDuration, + int aEUt) { if ((aInput == null) || (aBathingFluid == null) || (aOutput1 == null)) { return false; } if ((aDuration = GregTech_API.sRecipeFile.get("chemicalbath", aInput, aDuration)) <= 0) { return false; } - GT_Recipe.GT_Recipe_Map.sChemicalBathRecipes.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput1, aOutput2, aOutput3}, null, aChances, new FluidStack[]{aBathingFluid}, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0); + GT_Recipe.GT_Recipe_Map.sChemicalBathRecipes.addRecipe( + true, + new ItemStack[] {aInput}, + new ItemStack[] {aOutput1, aOutput2, aOutput3}, + null, + aChances, + new FluidStack[] {aBathingFluid}, + new FluidStack[] {aFluidOutput}, + aDuration, + aEUt, + 0); return true; } @Override - public boolean addElectromagneticSeparatorRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, int[] aChances, int aDuration, int aEUt) { + public boolean addElectromagneticSeparatorRecipe( + ItemStack aInput, + ItemStack aOutput1, + ItemStack aOutput2, + ItemStack aOutput3, + int[] aChances, + int aDuration, + int aEUt) { if ((aInput == null) || (aOutput1 == null)) { return false; } if ((aDuration = GregTech_API.sRecipeFile.get("electromagneticseparator", aInput, aDuration)) <= 0) { return false; } - GT_Recipe.GT_Recipe_Map.sElectroMagneticSeparatorRecipes.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput1, aOutput2, aOutput3}, null, aChances, null, null, aDuration, aEUt, 0); + GT_Recipe.GT_Recipe_Map.sElectroMagneticSeparatorRecipes.addRecipe( + true, + new ItemStack[] {aInput}, + new ItemStack[] {aOutput1, aOutput2, aOutput3}, + null, + aChances, + null, + null, + aDuration, + aEUt, + 0); return true; } @@ -1126,198 +2128,470 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { if ((aDuration = GregTech_API.sRecipeFile.get("extractor", aInput, aDuration)) <= 0) { return false; } - GT_Recipe.GT_Recipe_Map.sExtractorRecipes.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput}, null, null, null, aDuration, aEUt, 0); + GT_Recipe.GT_Recipe_Map.sExtractorRecipes.addRecipe( + true, new ItemStack[] {aInput}, new ItemStack[] {aOutput}, null, null, null, aDuration, aEUt, 0); return true; } @Override - public boolean addPrinterRecipe(ItemStack aInput, FluidStack aFluid, ItemStack aSpecialSlot, ItemStack aOutput, int aDuration, int aEUt) { + public boolean addPrinterRecipe( + ItemStack aInput, FluidStack aFluid, ItemStack aSpecialSlot, ItemStack aOutput, int aDuration, int aEUt) { if ((aInput == null) || (aFluid == null) || (aOutput == null)) { return false; } if ((aDuration = GregTech_API.sRecipeFile.get("printer", aInput, aDuration)) <= 0) { return false; } - GT_Recipe.GT_Recipe_Map.sPrinterRecipes.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput}, aSpecialSlot, null, new FluidStack[]{aFluid}, null, aDuration, aEUt, 0); + GT_Recipe.GT_Recipe_Map.sPrinterRecipes.addRecipe( + true, + new ItemStack[] {aInput}, + new ItemStack[] {aOutput}, + aSpecialSlot, + null, + new FluidStack[] {aFluid}, + null, + aDuration, + aEUt, + 0); return true; } @Override - public boolean addAutoclaveRecipe(ItemStack aInput, FluidStack aFluid, ItemStack aOutput, int aChance, int aDuration, int aEUt, boolean aCleanroom) { - return addAutoclaveRecipe(aInput, aFluid, aOutput,aChance, aDuration, aEUt); + public boolean addAutoclaveRecipe( + ItemStack aInput, + FluidStack aFluid, + ItemStack aOutput, + int aChance, + int aDuration, + int aEUt, + boolean aCleanroom) { + return addAutoclaveRecipe(aInput, aFluid, aOutput, aChance, aDuration, aEUt); } @Override - public boolean addAutoclaveRecipe(ItemStack aInput, FluidStack aFluid, ItemStack aOutput, int aChance, int aDuration, int aEUt) { + public boolean addAutoclaveRecipe( + ItemStack aInput, FluidStack aFluid, ItemStack aOutput, int aChance, int aDuration, int aEUt) { return addAutoclaveRecipe(aInput, null, aFluid, aOutput, aChance, aDuration, aEUt, false); } - public boolean addAutoclaveRecipe(ItemStack aInput, ItemStack aCircuit, FluidStack aFluid, ItemStack aOutput, int aChance, int aDuration, int aEUt) { + public boolean addAutoclaveRecipe( + ItemStack aInput, + ItemStack aCircuit, + FluidStack aFluid, + ItemStack aOutput, + int aChance, + int aDuration, + int aEUt) { return addAutoclaveRecipe(aInput, aCircuit, aFluid, aOutput, aChance, aDuration, aEUt, false); } @Override - public boolean addAutoclaveRecipe(ItemStack aInput, ItemStack aCircuit, FluidStack aFluidIn, ItemStack aOutput, int aChance, int aDuration, int aEUt, boolean aCleanroom) { - return addAutoclaveRecipe(aInput, aCircuit, aFluidIn, null, aOutput, aChance, aDuration, aEUt,aCleanroom); + public boolean addAutoclaveRecipe( + ItemStack aInput, + ItemStack aCircuit, + FluidStack aFluidIn, + ItemStack aOutput, + int aChance, + int aDuration, + int aEUt, + boolean aCleanroom) { + return addAutoclaveRecipe(aInput, aCircuit, aFluidIn, null, aOutput, aChance, aDuration, aEUt, aCleanroom); } @Override - public boolean addAutoclaveRecipe(ItemStack aInput, ItemStack aCircuit, FluidStack aFluidIn, FluidStack aFluidOut, ItemStack aOutput, int aChance, int aDuration, int aEUt, boolean aCleanroom) { + public boolean addAutoclaveRecipe( + ItemStack aInput, + ItemStack aCircuit, + FluidStack aFluidIn, + FluidStack aFluidOut, + ItemStack aOutput, + int aChance, + int aDuration, + int aEUt, + boolean aCleanroom) { if ((aInput == null) || (aFluidIn == null) || (aOutput == null)) { return false; } if ((aDuration = GregTech_API.sRecipeFile.get("autoclave", aInput, aDuration)) <= 0) { return false; } - if (!GT_Mod.gregtechproxy.mEnableCleanroom){ + if (!GT_Mod.gregtechproxy.mEnableCleanroom) { aCleanroom = false; } - GT_Recipe.GT_Recipe_Map.sAutoclaveRecipes.addRecipe(true, new ItemStack[]{aInput, aCircuit}, new ItemStack[]{aOutput}, null, new int[]{aChance}, new FluidStack[]{aFluidIn}, new FluidStack[]{aFluidOut}, aDuration, aEUt, aCleanroom ? -200 : 0); - return true; - } - - @Override - public boolean addAutoclaveSpaceRecipe(ItemStack aInput, FluidStack aFluid, ItemStack aOutput, int aChance, int aDuration, int aEUt, boolean aCleanroom) { + GT_Recipe.GT_Recipe_Map.sAutoclaveRecipes.addRecipe( + true, + new ItemStack[] {aInput, aCircuit}, + new ItemStack[] {aOutput}, + null, + new int[] {aChance}, + new FluidStack[] {aFluidIn}, + new FluidStack[] {aFluidOut}, + aDuration, + aEUt, + aCleanroom ? -200 : 0); + return true; + } + + @Override + public boolean addAutoclaveSpaceRecipe( + ItemStack aInput, + FluidStack aFluid, + ItemStack aOutput, + int aChance, + int aDuration, + int aEUt, + boolean aCleanroom) { return addAutoclaveRecipe(aInput, aFluid, aOutput, aChance, aDuration, aEUt, aCleanroom); } @Override - public boolean addAutoclaveSpaceRecipe(ItemStack aInput, ItemStack aCircuit, FluidStack aFluid, ItemStack aOutput, int aChance, int aDuration, int aEUt, boolean aCleanroom) { + public boolean addAutoclaveSpaceRecipe( + ItemStack aInput, + ItemStack aCircuit, + FluidStack aFluid, + ItemStack aOutput, + int aChance, + int aDuration, + int aEUt, + boolean aCleanroom) { if ((aInput == null) || (aFluid == null) || (aOutput == null)) { return false; } if ((aDuration = GregTech_API.sRecipeFile.get("autoclave", aInput, aDuration)) <= 0) { return false; } - if (!GT_Mod.gregtechproxy.mEnableCleanroom){ + if (!GT_Mod.gregtechproxy.mEnableCleanroom) { aCleanroom = false; } - GT_Recipe.GT_Recipe_Map.sAutoclaveRecipes.addRecipe(true, new ItemStack[]{aInput, aCircuit}, new ItemStack[]{aOutput}, null, new int[]{aChance}, new FluidStack[]{aFluid}, null, aDuration, aEUt, aCleanroom ? -100 : 0); - return true; - } - @Override - public boolean addAutoclave4Recipe(ItemStack aInput, ItemStack aCircuit, FluidStack aFluidIn, FluidStack aFluidOut, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt, boolean aCleanroom) { + GT_Recipe.GT_Recipe_Map.sAutoclaveRecipes.addRecipe( + true, + new ItemStack[] {aInput, aCircuit}, + new ItemStack[] {aOutput}, + null, + new int[] {aChance}, + new FluidStack[] {aFluid}, + null, + aDuration, + aEUt, + aCleanroom ? -100 : 0); + return true; + } + + @Override + public boolean addAutoclave4Recipe( + ItemStack aInput, + ItemStack aCircuit, + FluidStack aFluidIn, + FluidStack aFluidOut, + ItemStack[] aOutputs, + int[] aChances, + int aDuration, + int aEUt, + boolean aCleanroom) { if ((aInput == null) || (aFluidIn == null) || (aOutputs == null)) { return false; } if ((aDuration = GregTech_API.sRecipeFile.get("autoclave", aInput, aDuration)) <= 0) { return false; } - if (!GT_Mod.gregtechproxy.mEnableCleanroom){ + if (!GT_Mod.gregtechproxy.mEnableCleanroom) { aCleanroom = false; } - GT_Recipe.GT_Recipe_Map.sAutoclaveRecipes.addRecipe(true, new ItemStack[] {aInput, aCircuit} , aOutputs, null, aChances, new FluidStack[]{aFluidIn}, new FluidStack[]{aFluidOut}, aDuration, aEUt, aCleanroom ? -200 : 0); + GT_Recipe.GT_Recipe_Map.sAutoclaveRecipes.addRecipe( + true, + new ItemStack[] {aInput, aCircuit}, + aOutputs, + null, + aChances, + new FluidStack[] {aFluidIn}, + new FluidStack[] {aFluidOut}, + aDuration, + aEUt, + aCleanroom ? -200 : 0); return true; } @Deprecated @Override - public boolean addMixerRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aInput3, ItemStack aInput4, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt) { - return addMixerRecipe(aInput1, aInput2, aInput3, aInput4, null, null, null, null, null, aFluidInput, aFluidOutput, aOutput, aDuration, aEUt); - + public boolean addMixerRecipe( + ItemStack aInput1, + ItemStack aInput2, + ItemStack aInput3, + ItemStack aInput4, + FluidStack aFluidInput, + FluidStack aFluidOutput, + ItemStack aOutput, + int aDuration, + int aEUt) { + return addMixerRecipe( + aInput1, + aInput2, + aInput3, + aInput4, + null, + null, + null, + null, + null, + aFluidInput, + aFluidOutput, + aOutput, + aDuration, + aEUt); } @Deprecated @Override - public boolean addMixerRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aInput3, ItemStack aInput4, ItemStack aInput5, ItemStack aInput6, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt) { - return addMixerRecipe(aInput1, aInput2, aInput3, aInput4, aInput5, aInput6, null, null, null, aFluidInput, aFluidOutput, aOutput, aDuration, aEUt); - + public boolean addMixerRecipe( + ItemStack aInput1, + ItemStack aInput2, + ItemStack aInput3, + ItemStack aInput4, + ItemStack aInput5, + ItemStack aInput6, + FluidStack aFluidInput, + FluidStack aFluidOutput, + ItemStack aOutput, + int aDuration, + int aEUt) { + return addMixerRecipe( + aInput1, + aInput2, + aInput3, + aInput4, + aInput5, + aInput6, + null, + null, + null, + aFluidInput, + aFluidOutput, + aOutput, + aDuration, + aEUt); } @Deprecated @Override - public boolean addMixerRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aInput3, ItemStack aInput4, ItemStack aInput5, ItemStack aInput6, ItemStack aInput7, ItemStack aInput8, ItemStack aInput9, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt) { + public boolean addMixerRecipe( + ItemStack aInput1, + ItemStack aInput2, + ItemStack aInput3, + ItemStack aInput4, + ItemStack aInput5, + ItemStack aInput6, + ItemStack aInput7, + ItemStack aInput8, + ItemStack aInput9, + FluidStack aFluidInput, + FluidStack aFluidOutput, + ItemStack aOutput, + int aDuration, + int aEUt) { if (((aInput1 == null) && (aFluidInput == null)) || ((aOutput == null) && (aFluidOutput == null))) { return false; } if ((aOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get("mixer", aOutput, aDuration)) <= 0)) { return false; } - if ((aFluidOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get("mixer", aFluidOutput.getFluid().getName(), aDuration)) <= 0)) { + if ((aFluidOutput != null) + && ((aDuration = GregTech_API.sRecipeFile.get( + "mixer", aFluidOutput.getFluid().getName(), aDuration)) + <= 0)) { return false; } - GT_Recipe.GT_Recipe_Map.sMixerRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2, aInput3, aInput4, aInput5, aInput6, aInput7, aInput8, aInput9}, new ItemStack[]{aOutput}, null, null, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0); + GT_Recipe.GT_Recipe_Map.sMixerRecipes.addRecipe( + true, + new ItemStack[] {aInput1, aInput2, aInput3, aInput4, aInput5, aInput6, aInput7, aInput8, aInput9}, + new ItemStack[] {aOutput}, + null, + null, + new FluidStack[] {aFluidInput}, + new FluidStack[] {aFluidOutput}, + aDuration, + aEUt, + 0); return true; } @Override - public boolean addMixerRecipe(ItemStack[] ItemInputArray, FluidStack[] FluidInputArray, ItemStack[] ItemOutputArray, FluidStack[] FluidOutputArray, int aDuration, int aEUt) { - GT_Recipe.GT_Recipe_Map.sMixerRecipes.addRecipe(false, ItemInputArray, ItemOutputArray, null, null, FluidInputArray, FluidOutputArray, aDuration, aEUt, 0); + public boolean addMixerRecipe( + ItemStack[] ItemInputArray, + FluidStack[] FluidInputArray, + ItemStack[] ItemOutputArray, + FluidStack[] FluidOutputArray, + int aDuration, + int aEUt) { + GT_Recipe.GT_Recipe_Map.sMixerRecipes.addRecipe( + false, + ItemInputArray, + ItemOutputArray, + null, + null, + FluidInputArray, + FluidOutputArray, + aDuration, + aEUt, + 0); return true; } @Deprecated @Override - public boolean addMixerRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aInput3, ItemStack aInput4, ItemStack aInput5, ItemStack aInput6, ItemStack aInput7, ItemStack aInput8, ItemStack aInput9, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, int aDuration, int aEUt) { + public boolean addMixerRecipe( + ItemStack aInput1, + ItemStack aInput2, + ItemStack aInput3, + ItemStack aInput4, + ItemStack aInput5, + ItemStack aInput6, + ItemStack aInput7, + ItemStack aInput8, + ItemStack aInput9, + FluidStack aFluidInput, + FluidStack aFluidOutput, + ItemStack aOutput1, + ItemStack aOutput2, + ItemStack aOutput3, + ItemStack aOutput4, + int aDuration, + int aEUt) { if (((aInput1 == null) && (aFluidInput == null)) || ((aOutput1 == null) && (aFluidOutput == null))) { return false; } if ((aOutput1 != null) && ((aDuration = GregTech_API.sRecipeFile.get("mixer", aOutput1, aDuration)) <= 0)) { return false; } - if ((aFluidOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get("mixer", aFluidOutput.getFluid().getName(), aDuration)) <= 0)) { + if ((aFluidOutput != null) + && ((aDuration = GregTech_API.sRecipeFile.get( + "mixer", aFluidOutput.getFluid().getName(), aDuration)) + <= 0)) { return false; } - GT_Recipe.GT_Recipe_Map.sMixerRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2, aInput3, aInput4, aInput5, aInput6, aInput7, aInput8, aInput9}, new ItemStack[]{aOutput1, aOutput2, aOutput3, aOutput4}, null, null, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0); + GT_Recipe.GT_Recipe_Map.sMixerRecipes.addRecipe( + true, + new ItemStack[] {aInput1, aInput2, aInput3, aInput4, aInput5, aInput6, aInput7, aInput8, aInput9}, + new ItemStack[] {aOutput1, aOutput2, aOutput3, aOutput4}, + null, + null, + new FluidStack[] {aFluidInput}, + new FluidStack[] {aFluidOutput}, + aDuration, + aEUt, + 0); return true; } @Deprecated @Override - public boolean addLaserEngraverRecipe(ItemStack aItemToEngrave, ItemStack aLens, ItemStack aEngravedItem, int aDuration, int aEUt) { - return addLaserEngraverRecipe( aItemToEngrave, aLens, aEngravedItem, aDuration, aEUt, false); + public boolean addLaserEngraverRecipe( + ItemStack aItemToEngrave, ItemStack aLens, ItemStack aEngravedItem, int aDuration, int aEUt) { + return addLaserEngraverRecipe(aItemToEngrave, aLens, aEngravedItem, aDuration, aEUt, false); } @Deprecated @Override - public boolean addLaserEngraverRecipe(ItemStack aItemToEngrave, ItemStack aLens, ItemStack aEngravedItem, int aDuration, int aEUt, boolean aCleanroom) { + public boolean addLaserEngraverRecipe( + ItemStack aItemToEngrave, + ItemStack aLens, + ItemStack aEngravedItem, + int aDuration, + int aEUt, + boolean aCleanroom) { if ((aItemToEngrave == null) || (aLens == null) || (aEngravedItem == null)) { return false; } if ((aDuration = GregTech_API.sRecipeFile.get("laserengraving", aEngravedItem, aDuration)) <= 0) { return false; } - if (!GT_Mod.gregtechproxy.mEnableCleanroom){ + if (!GT_Mod.gregtechproxy.mEnableCleanroom) { aCleanroom = false; } - GT_Recipe.GT_Recipe_Map.sLaserEngraverRecipes.addRecipe(true, new ItemStack[]{aItemToEngrave, aLens}, new ItemStack[]{aEngravedItem}, null, null, null, aDuration, aEUt, aCleanroom ? -200 : 0); - return true; - } - - - @Override - public boolean addLaserEngraverRecipe(ItemStack[] ItemInputArray, FluidStack[] FluidInputArray, ItemStack[] OutputItemArray, FluidStack[] FluidOutputArray, int aDuration, int aEUt, boolean aCleanroom) { - GT_Recipe.GT_Recipe_Map.sLaserEngraverRecipes.addRecipe(false, ItemInputArray, OutputItemArray, null, null, - FluidInputArray, FluidOutputArray, aDuration, aEUt, aCleanroom ? -200 : 0); - return true; - } - - @Override - public boolean addFormingPressRecipe(ItemStack aItemToImprint, ItemStack aForm, ItemStack aImprintedItem, int aDuration, int aEUt) { + GT_Recipe.GT_Recipe_Map.sLaserEngraverRecipes.addRecipe( + true, + new ItemStack[] {aItemToEngrave, aLens}, + new ItemStack[] {aEngravedItem}, + null, + null, + null, + aDuration, + aEUt, + aCleanroom ? -200 : 0); + return true; + } + + @Override + public boolean addLaserEngraverRecipe( + ItemStack[] ItemInputArray, + FluidStack[] FluidInputArray, + ItemStack[] OutputItemArray, + FluidStack[] FluidOutputArray, + int aDuration, + int aEUt, + boolean aCleanroom) { + GT_Recipe.GT_Recipe_Map.sLaserEngraverRecipes.addRecipe( + false, + ItemInputArray, + OutputItemArray, + null, + null, + FluidInputArray, + FluidOutputArray, + aDuration, + aEUt, + aCleanroom ? -200 : 0); + return true; + } + + @Override + public boolean addFormingPressRecipe( + ItemStack aItemToImprint, ItemStack aForm, ItemStack aImprintedItem, int aDuration, int aEUt) { if ((aItemToImprint == null) || (aForm == null) || (aImprintedItem == null)) { return false; } if ((aDuration = GregTech_API.sRecipeFile.get("press", aImprintedItem, aDuration)) <= 0) { return false; } - GT_Recipe.GT_Recipe_Map.sPressRecipes.addRecipe(true, new ItemStack[]{aItemToImprint, aForm}, new ItemStack[]{aImprintedItem}, null, null, null, aDuration, aEUt, 0); + GT_Recipe.GT_Recipe_Map.sPressRecipes.addRecipe( + true, + new ItemStack[] {aItemToImprint, aForm}, + new ItemStack[] {aImprintedItem}, + null, + null, + null, + aDuration, + aEUt, + 0); return true; } @Override - public boolean addFluidHeaterRecipe(ItemStack aCircuit, FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt) { + public boolean addFluidHeaterRecipe( + ItemStack aCircuit, FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt) { if ((aInput == null) || (aOutput == null)) { return false; } - if ((aDuration = GregTech_API.sRecipeFile.get("fluidheater", aOutput.getFluid().getUnlocalizedName(), aDuration)) <= 0) { + if ((aDuration = GregTech_API.sRecipeFile.get( + "fluidheater", aOutput.getFluid().getUnlocalizedName(), aDuration)) + <= 0) { return false; } - GT_Recipe.GT_Recipe_Map.sFluidHeaterRecipes.addRecipe(true, new ItemStack[]{aCircuit}, null, null, new FluidStack[]{aInput}, new FluidStack[]{aOutput}, aDuration, aEUt, 0); + GT_Recipe.GT_Recipe_Map.sFluidHeaterRecipes.addRecipe( + true, + new ItemStack[] {aCircuit}, + null, + null, + new FluidStack[] {aInput}, + new FluidStack[] {aOutput}, + aDuration, + aEUt, + 0); return true; } @Override - public boolean addSifterRecipe(ItemStack aItemToSift, ItemStack[] aSiftedItems, int[] aChances, int aDuration, int aEUt) { + public boolean addSifterRecipe( + ItemStack aItemToSift, ItemStack[] aSiftedItems, int[] aChances, int aDuration, int aEUt) { if ((aItemToSift == null) || (aSiftedItems == null)) { return false; } @@ -1326,7 +2600,17 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { if ((aDuration = GregTech_API.sRecipeFile.get("sifter", aItemToSift, aDuration)) <= 0) { return false; } - GT_Recipe.GT_Recipe_Map.sSifterRecipes.addRecipe(true, new ItemStack[]{aItemToSift}, aSiftedItems, null, aChances, null, null, aDuration, aEUt, 0); + GT_Recipe.GT_Recipe_Map.sSifterRecipes.addRecipe( + true, + new ItemStack[] {aItemToSift}, + aSiftedItems, + null, + aChances, + null, + null, + aDuration, + aEUt, + 0); return true; } } @@ -1334,12 +2618,14 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { } @Override - public boolean addArcFurnaceRecipe(ItemStack aInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt) { - return addArcFurnaceRecipe(aInput, aOutputs, aChances, aDuration, aEUt, false); + public boolean addArcFurnaceRecipe( + ItemStack aInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt) { + return addArcFurnaceRecipe(aInput, aOutputs, aChances, aDuration, aEUt, false); } @Override - public boolean addArcFurnaceRecipe(ItemStack aInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt, boolean hidden) { + public boolean addArcFurnaceRecipe( + ItemStack aInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt, boolean hidden) { if ((aInput == null) || (aOutputs == null)) { return false; } @@ -1348,14 +2634,34 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { if ((aDuration = GregTech_API.sRecipeFile.get("arcfurnace", aInput, aDuration)) <= 0) { return false; } - GT_Recipe sRecipe = GT_Recipe.GT_Recipe_Map.sArcFurnaceRecipes.addRecipe(true, new ItemStack[]{aInput}, aOutputs, null, aChances, new FluidStack[]{Materials.Oxygen.getGas(aDuration)}, null, Math.max(1, aDuration), Math.max(1, aEUt), 0); + GT_Recipe sRecipe = GT_Recipe.GT_Recipe_Map.sArcFurnaceRecipes.addRecipe( + true, + new ItemStack[] {aInput}, + aOutputs, + null, + aChances, + new FluidStack[] {Materials.Oxygen.getGas(aDuration)}, + null, + Math.max(1, aDuration), + Math.max(1, aEUt), + 0); if ((hidden) && (sRecipe != null)) { sRecipe.mHidden = true; } - for (Materials tMaterial : new Materials[]{Materials.Argon, Materials.Nitrogen}) { + for (Materials tMaterial : new Materials[] {Materials.Argon, Materials.Nitrogen}) { if (tMaterial.mPlasma != null) { int tPlasmaAmount = (int) Math.max(1L, aDuration / (tMaterial.getMass() * 16L)); - GT_Recipe tRecipe =GT_Recipe.GT_Recipe_Map.sPlasmaArcFurnaceRecipes.addRecipe(true, new ItemStack[]{aInput}, aOutputs, null, aChances, new FluidStack[]{tMaterial.getPlasma(tPlasmaAmount)}, new FluidStack[]{tMaterial.getGas(tPlasmaAmount)}, Math.max(1, aDuration / 16), Math.max(1, aEUt / 3), 0); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sPlasmaArcFurnaceRecipes.addRecipe( + true, + new ItemStack[] {aInput}, + aOutputs, + null, + aChances, + new FluidStack[] {tMaterial.getPlasma(tPlasmaAmount)}, + new FluidStack[] {tMaterial.getGas(tPlasmaAmount)}, + Math.max(1, aDuration / 16), + Math.max(1, aEUt / 3), + 0); if ((hidden) && (tRecipe != null)) { tRecipe.mHidden = true; } @@ -1368,7 +2674,8 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { } @Override - public boolean addSimpleArcFurnaceRecipe(ItemStack aInput, FluidStack aFluidInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt) { + public boolean addSimpleArcFurnaceRecipe( + ItemStack aInput, FluidStack aFluidInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt) { if ((aInput == null) || (aOutputs == null) || aFluidInput == null) { return false; } @@ -1377,7 +2684,17 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { if ((aDuration = GregTech_API.sRecipeFile.get("arcfurnace", aInput, aDuration)) <= 0) { return false; } - GT_Recipe.GT_Recipe_Map.sArcFurnaceRecipes.addRecipe(true, new ItemStack[]{aInput}, aOutputs, null, aChances, new FluidStack[]{aFluidInput}, null, Math.max(1, aDuration), Math.max(1, aEUt), 0); + GT_Recipe.GT_Recipe_Map.sArcFurnaceRecipes.addRecipe( + true, + new ItemStack[] {aInput}, + aOutputs, + null, + aChances, + new FluidStack[] {aFluidInput}, + null, + Math.max(1, aDuration), + Math.max(1, aEUt), + 0); return true; } } @@ -1385,7 +2702,8 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { } @Override - public boolean addPlasmaArcFurnaceRecipe(ItemStack aInput, FluidStack aFluidInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt) { + public boolean addPlasmaArcFurnaceRecipe( + ItemStack aInput, FluidStack aFluidInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt) { if ((aInput == null) || (aOutputs == null) || aFluidInput == null) { return false; } @@ -1394,7 +2712,17 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { if ((aDuration = GregTech_API.sRecipeFile.get("arcfurnace", aInput, aDuration)) <= 0) { return false; } - GT_Recipe.GT_Recipe_Map.sPlasmaArcFurnaceRecipes.addRecipe(true, new ItemStack[]{aInput}, aOutputs, null, aChances, new FluidStack[]{aFluidInput}, null, Math.max(1, aDuration), Math.max(1, aEUt), 0); + GT_Recipe.GT_Recipe_Map.sPlasmaArcFurnaceRecipes.addRecipe( + true, + new ItemStack[] {aInput}, + aOutputs, + null, + aChances, + new FluidStack[] {aFluidInput}, + null, + Math.max(1, aDuration), + Math.max(1, aEUt), + 0); return true; } } @@ -1402,7 +2730,14 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { } @Override - public boolean addPlasmaArcFurnaceRecipe(ItemStack aInput, FluidStack aFluidInput, ItemStack[] aOutputs, FluidStack aFluidOutput, int[] aChances, int aDuration, int aEUt) { + public boolean addPlasmaArcFurnaceRecipe( + ItemStack aInput, + FluidStack aFluidInput, + ItemStack[] aOutputs, + FluidStack aFluidOutput, + int[] aChances, + int aDuration, + int aEUt) { if ((aInput == null) || (aOutputs == null) || aFluidInput == null) { return false; } @@ -1411,7 +2746,17 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { if ((aDuration = GregTech_API.sRecipeFile.get("arcfurnace", aInput, aDuration)) <= 0) { return false; } - GT_Recipe.GT_Recipe_Map.sPlasmaArcFurnaceRecipes.addRecipe(true, new ItemStack[]{aInput}, aOutputs, null, aChances, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, Math.max(1, aDuration), Math.max(1, aEUt), 0); + GT_Recipe.GT_Recipe_Map.sPlasmaArcFurnaceRecipes.addRecipe( + true, + new ItemStack[] {aInput}, + aOutputs, + null, + aChances, + new FluidStack[] {aFluidInput}, + new FluidStack[] {aFluidOutput}, + Math.max(1, aDuration), + Math.max(1, aEUt), + 0); return true; } } @@ -1419,12 +2764,14 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { } @Override - public boolean addPulveriserRecipe(ItemStack aInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt) { + public boolean addPulveriserRecipe( + ItemStack aInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt) { return addPulveriserRecipe(aInput, aOutputs, aChances, aDuration, aEUt, false); } @Override - public boolean addPulveriserRecipe(ItemStack aInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt, boolean hidden) { + public boolean addPulveriserRecipe( + ItemStack aInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt, boolean hidden) { if ((aInput == null) || (aOutputs == null)) { return false; } @@ -1433,7 +2780,8 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { if ((aDuration = GregTech_API.sRecipeFile.get("pulveriser", aInput, aDuration)) <= 0) { return false; } - GT_Recipe tRecipe =GT_Recipe.GT_Recipe_Map.sMaceratorRecipes.addRecipe(true, new ItemStack[]{aInput}, aOutputs, null, aChances, null, null, aDuration, aEUt, 0); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sMaceratorRecipes.addRecipe( + true, new ItemStack[] {aInput}, aOutputs, null, aChances, null, null, aDuration, aEUt, 0); if ((hidden) && (tRecipe != null)) { tRecipe.mHidden = true; } @@ -1444,14 +2792,31 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { } @Override - public boolean addPyrolyseRecipe(ItemStack aInput, FluidStack aFluidInput, int intCircuit, ItemStack aOutput, FluidStack aFluidOutput, int aDuration, int aEUt) { + public boolean addPyrolyseRecipe( + ItemStack aInput, + FluidStack aFluidInput, + int intCircuit, + ItemStack aOutput, + FluidStack aFluidOutput, + int aDuration, + int aEUt) { if (aInput == null) { return false; } if ((aDuration = GregTech_API.sRecipeFile.get("pyrolyse", aInput, aDuration)) <= 0) { return false; } - GT_Recipe.GT_Recipe_Map.sPyrolyseRecipes.addRecipe(false, new ItemStack[]{aInput, ItemList.Circuit_Integrated.getWithDamage(0L, intCircuit, new Object[0])}, new ItemStack[]{aOutput}, null, null, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0); + GT_Recipe.GT_Recipe_Map.sPyrolyseRecipes.addRecipe( + false, + new ItemStack[] {aInput, ItemList.Circuit_Integrated.getWithDamage(0L, intCircuit, new Object[0])}, + new ItemStack[] {aOutput}, + null, + null, + new FluidStack[] {aFluidInput}, + new FluidStack[] {aFluidOutput}, + aDuration, + aEUt, + 0); return true; } @@ -1462,42 +2827,97 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { } @Override - public boolean addCrackingRecipe(int circuitConfig, FluidStack aInput, FluidStack aInput2, FluidStack aOutput, int aDuration, int aEUt) { + public boolean addCrackingRecipe( + int circuitConfig, FluidStack aInput, FluidStack aInput2, FluidStack aOutput, int aDuration, int aEUt) { if ((aInput == null && aInput2 == null) || (aOutput == null)) { return false; } if ((aDuration = GregTech_API.sRecipeFile.get("cracking", aInput.getUnlocalizedName(), aDuration)) <= 0) { return false; } - GT_Recipe.GT_Recipe_Map.sCrakingRecipes.addRecipe(false, new ItemStack[]{GT_Utility.getIntegratedCircuit(circuitConfig)}, null, null, null, - new FluidStack[]{aInput, aInput2}, new FluidStack[]{aOutput}, aDuration, aEUt, 0); + GT_Recipe.GT_Recipe_Map.sCrakingRecipes.addRecipe( + false, + new ItemStack[] {GT_Utility.getIntegratedCircuit(circuitConfig)}, + null, + null, + null, + new FluidStack[] {aInput, aInput2}, + new FluidStack[] {aOutput}, + aDuration, + aEUt, + 0); return true; } @Override - public boolean addAssemblylineRecipe(ItemStack aResearchItem, int aResearchTime, ItemStack[] aInputs, FluidStack[] aFluidInputs, ItemStack aOutput, int aDuration, int aEUt) { - if ((aResearchItem==null)||(aResearchTime<=0)||(aInputs == null) || (aOutput == null) || aInputs.length>15 || aInputs.length<4) { + public boolean addAssemblylineRecipe( + ItemStack aResearchItem, + int aResearchTime, + ItemStack[] aInputs, + FluidStack[] aFluidInputs, + ItemStack aOutput, + int aDuration, + int aEUt) { + if ((aResearchItem == null) + || (aResearchTime <= 0) + || (aInputs == null) + || (aOutput == null) + || aInputs.length > 15 + || aInputs.length < 4) { return false; } if ((aDuration = GregTech_API.sRecipeFile.get("assemblingline", aOutput, aDuration)) <= 0) { return false; } - for(ItemStack tItem : aInputs){ - if(tItem==null){ - GT_FML_LOGGER.info("addAssemblingLineRecipe "+aResearchItem.getDisplayName()+" --> "+aOutput.getUnlocalizedName()+" there is some null item in that recipe"); + for (ItemStack tItem : aInputs) { + if (tItem == null) { + GT_FML_LOGGER.info("addAssemblingLineRecipe " + aResearchItem.getDisplayName() + " --> " + + aOutput.getUnlocalizedName() + " there is some null item in that recipe"); } } - GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{aResearchItem}, new ItemStack[]{aOutput}, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Writes Research result", new Object[0])}, null, null, aResearchTime, 30, -201); - GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.addFakeRecipe(false, aInputs, new ItemStack[]{aOutput}, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Reads Research result", new Object[0])}, aFluidInputs, null, aDuration, aEUt, 0,true); - GT_Recipe_AssemblyLine tRecipe = new GT_Recipe_AssemblyLine(aResearchItem, aResearchTime, aInputs, aFluidInputs, aOutput, aDuration, aEUt); + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe( + false, + new ItemStack[] {aResearchItem}, + new ItemStack[] {aOutput}, + new ItemStack[] {ItemList.Tool_DataStick.getWithName(1L, "Writes Research result", new Object[0])}, + null, + null, + aResearchTime, + 30, + -201); + GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.addFakeRecipe( + false, + aInputs, + new ItemStack[] {aOutput}, + new ItemStack[] {ItemList.Tool_DataStick.getWithName(1L, "Reads Research result", new Object[0])}, + aFluidInputs, + null, + aDuration, + aEUt, + 0, + true); + GT_Recipe_AssemblyLine tRecipe = new GT_Recipe_AssemblyLine( + aResearchItem, aResearchTime, aInputs, aFluidInputs, aOutput, aDuration, aEUt); GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.add(tRecipe); GT_AssemblyLineUtils.addRecipeToCache(tRecipe); return true; } @Override - public boolean addAssemblylineRecipe(ItemStack aResearchItem, int aResearchTime, Object[] aInputs, FluidStack[] aFluidInputs, ItemStack aOutput, int aDuration, int aEUt) { - if ((aResearchItem==null)||(aResearchTime<=0)||(aInputs == null) || (aOutput == null) || aInputs.length>15 || aInputs.length<4) { + public boolean addAssemblylineRecipe( + ItemStack aResearchItem, + int aResearchTime, + Object[] aInputs, + FluidStack[] aFluidInputs, + ItemStack aOutput, + int aDuration, + int aEUt) { + if ((aResearchItem == null) + || (aResearchTime <= 0) + || (aInputs == null) + || (aOutput == null) + || aInputs.length > 15 + || aInputs.length < 4) { return false; } if ((aDuration = GregTech_API.sRecipeFile.get("assemblingline", aOutput, aDuration)) <= 0) { @@ -1506,81 +2926,110 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { ItemStack[] tInputs = new ItemStack[aInputs.length]; ItemStack[][] tAlts = new ItemStack[aInputs.length][]; int tPersistentHash = 1; - for(int i = 0; i < aInputs.length; i++){ - Object obj = aInputs[i]; - if (obj instanceof ItemStack) { - tInputs[i] = (ItemStack) obj; - tAlts[i] = null; + for (int i = 0; i < aInputs.length; i++) { + Object obj = aInputs[i]; + if (obj instanceof ItemStack) { + tInputs[i] = (ItemStack) obj; + tAlts[i] = null; tPersistentHash = tPersistentHash * 31 + GT_Utility.persistentHash(tInputs[i], true, false); - continue; - } else if (obj instanceof ItemStack[]) { - ItemStack[] aStacks = (ItemStack[]) obj; - if (aStacks.length > 0) { - tInputs[i] = aStacks[0]; - tAlts[i] = (ItemStack[]) Arrays.copyOf(aStacks, aStacks.length); + continue; + } else if (obj instanceof ItemStack[]) { + ItemStack[] aStacks = (ItemStack[]) obj; + if (aStacks.length > 0) { + tInputs[i] = aStacks[0]; + tAlts[i] = (ItemStack[]) Arrays.copyOf(aStacks, aStacks.length); for (ItemStack tAlt : tAlts[i]) { tPersistentHash = tPersistentHash * 31 + GT_Utility.persistentHash(tAlt, true, false); } tPersistentHash *= 31; - continue; - } - } else if (obj instanceof Object[]) { - Object[] objs = (Object[]) obj; - List<ItemStack> tList; - if (objs.length >= 2 && !(tList = GT_OreDictUnificator.getOres(objs[0])).isEmpty()) { - try { + continue; + } + } else if (obj instanceof Object[]) { + Object[] objs = (Object[]) obj; + List<ItemStack> tList; + if (objs.length >= 2 && !(tList = GT_OreDictUnificator.getOres(objs[0])).isEmpty()) { + try { // sort the output, so the hash code is stable across launches - tList.sort(Comparator.<ItemStack, String>comparing(s -> GameRegistry.findUniqueIdentifierFor(s.getItem()).modId) + tList.sort(Comparator.<ItemStack, String>comparing( + s -> GameRegistry.findUniqueIdentifierFor(s.getItem()).modId) .thenComparing(s -> GameRegistry.findUniqueIdentifierFor(s.getItem()).modId) .thenComparingInt(Items.feather::getDamage) .thenComparingInt(s -> s.stackSize)); - int tAmount = ((Number) objs[1]).intValue(); - List<ItemStack> uList = new ArrayList<>(); - for (ItemStack tStack : tList) { - ItemStack uStack = GT_Utility.copyAmount(tAmount, tStack); - if (GT_Utility.isStackValid(uStack)) { - uList.add(uStack); - if (tInputs[i] == null) - tInputs[i] = uStack; - } - } - tAlts[i] = uList.toArray(new ItemStack[0]); + int tAmount = ((Number) objs[1]).intValue(); + List<ItemStack> uList = new ArrayList<>(); + for (ItemStack tStack : tList) { + ItemStack uStack = GT_Utility.copyAmount(tAmount, tStack); + if (GT_Utility.isStackValid(uStack)) { + uList.add(uStack); + if (tInputs[i] == null) tInputs[i] = uStack; + } + } + tAlts[i] = uList.toArray(new ItemStack[0]); tPersistentHash = tPersistentHash * 31 + (objs[0] == null ? "" : objs[0].toString()).hashCode(); tPersistentHash = tPersistentHash * 31 + tAmount; - continue; - } catch (Exception t) {} - } - } - GT_FML_LOGGER.info("addAssemblingLineRecipe "+aResearchItem.getDisplayName()+" --> "+aOutput.getUnlocalizedName()+" there is some null item in that recipe"); + continue; + } catch (Exception t) { + } + } + } + GT_FML_LOGGER.info("addAssemblingLineRecipe " + aResearchItem.getDisplayName() + " --> " + + aOutput.getUnlocalizedName() + " there is some null item in that recipe"); } tPersistentHash = tPersistentHash * 31 + GT_Utility.persistentHash(aResearchItem, true, false); tPersistentHash = tPersistentHash * 31 + GT_Utility.persistentHash(aOutput, true, false); for (FluidStack tFluidInput : aFluidInputs) { - if (tFluidInput == null) - continue; + if (tFluidInput == null) continue; tPersistentHash = tPersistentHash * 31 + GT_Utility.persistentHash(tFluidInput, true, false); } tPersistentHash = tPersistentHash * 31 + aResearchTime; tPersistentHash = tPersistentHash * 31 + aDuration; tPersistentHash = tPersistentHash * 31 + aEUt; - GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{aResearchItem}, new ItemStack[]{aOutput}, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Writes Research result", new Object[0])}, null, null, aResearchTime, 30, -201); - GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.addFakeRecipe(false,tInputs,new ItemStack[]{aOutput},new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Reads Research result", new Object[0])},aFluidInputs,null,aDuration,aEUt,0,tAlts,true); - GT_Recipe_AssemblyLine tRecipe = new GT_Recipe_AssemblyLine(aResearchItem, aResearchTime, tInputs, aFluidInputs, aOutput, aDuration, aEUt, tAlts); + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe( + false, + new ItemStack[] {aResearchItem}, + new ItemStack[] {aOutput}, + new ItemStack[] {ItemList.Tool_DataStick.getWithName(1L, "Writes Research result", new Object[0])}, + null, + null, + aResearchTime, + 30, + -201); + GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.addFakeRecipe( + false, + tInputs, + new ItemStack[] {aOutput}, + new ItemStack[] {ItemList.Tool_DataStick.getWithName(1L, "Reads Research result", new Object[0])}, + aFluidInputs, + null, + aDuration, + aEUt, + 0, + tAlts, + true); + GT_Recipe_AssemblyLine tRecipe = new GT_Recipe_AssemblyLine( + aResearchItem, aResearchTime, tInputs, aFluidInputs, aOutput, aDuration, aEUt, tAlts); tRecipe.setPersistentHash(tPersistentHash); GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.add(tRecipe); GT_AssemblyLineUtils.addRecipeToCache(tRecipe); return true; - } + } @Override - public boolean addCircuitAssemblerRecipe(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput, int aDuration, int aEUt) { - return addCircuitAssemblerRecipe(aInputs, aFluidInput, aOutput,aDuration,aEUt, false); + public boolean addCircuitAssemblerRecipe( + ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput, int aDuration, int aEUt) { + return addCircuitAssemblerRecipe(aInputs, aFluidInput, aOutput, aDuration, aEUt, false); } @Override - public boolean addCircuitAssemblerRecipe(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput, int aDuration, int aEUt, boolean aCleanroom) { + public boolean addCircuitAssemblerRecipe( + ItemStack[] aInputs, + FluidStack aFluidInput, + ItemStack aOutput, + int aDuration, + int aEUt, + boolean aCleanroom) { - if (this.areItemsAndFluidsBothNull(aInputs, new FluidStack[]{aFluidInput})) { + if (this.areItemsAndFluidsBothNull(aInputs, new FluidStack[] {aFluidInput})) { return false; } @@ -1597,30 +3046,56 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { } for (int oreID : OreDictionary.getOreIDs(aOutput)) { - if (OreDictionary.getOreName(oreID).startsWith("circuit")){ - return this.addCircuitAssemblerRecipeNonOredicted(aInputs, aFluidInput, aOutput, aDuration, aEUt, aCleanroom); + if (OreDictionary.getOreName(oreID).startsWith("circuit")) { + return this.addCircuitAssemblerRecipeNonOredicted( + aInputs, aFluidInput, aOutput, aDuration, aEUt, aCleanroom); } } - GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.addRecipe(true, aInputs, new ItemStack[]{aOutput}, null, new FluidStack[]{aFluidInput}, null, aDuration, aEUt, aCleanroom ? -200 : 0); + GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.addRecipe( + true, + aInputs, + new ItemStack[] {aOutput}, + null, + new FluidStack[] {aFluidInput}, + null, + aDuration, + aEUt, + aCleanroom ? -200 : 0); return true; } - public boolean addCircuitAssemblerRecipeNonOredicted(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput, int aDuration, int aEUt, boolean aCleanroom) { - if ((aInputs == null) || (aOutput == null) || aInputs.length>6 || aInputs.length<1) { + public boolean addCircuitAssemblerRecipeNonOredicted( + ItemStack[] aInputs, + FluidStack aFluidInput, + ItemStack aOutput, + int aDuration, + int aEUt, + boolean aCleanroom) { + if ((aInputs == null) || (aOutput == null) || aInputs.length > 6 || aInputs.length < 1) { return false; } if ((aDuration = GregTech_API.sRecipeFile.get("circuitassembler", aOutput, aDuration)) <= 0) { return false; } - if (!GT_Mod.gregtechproxy.mEnableCleanroom){ + if (!GT_Mod.gregtechproxy.mEnableCleanroom) { aCleanroom = false; } - GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.addRecipe(true, aInputs, new ItemStack[]{aOutput}, null, null, new FluidStack[]{aFluidInput}, null, aDuration, aEUt, aCleanroom ? -200 : 0); + GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.addRecipe( + true, + aInputs, + new ItemStack[] {aOutput}, + null, + null, + new FluidStack[] {aFluidInput}, + null, + aDuration, + aEUt, + aCleanroom ? -200 : 0); return true; } - private boolean areItemsAndFluidsBothNull(ItemStack[] items, FluidStack[] fluids){ + private boolean areItemsAndFluidsBothNull(ItemStack[] items, FluidStack[] fluids) { boolean itemsNull = true; if (items != null) { for (ItemStack itemStack : items) { @@ -1640,6 +3115,5 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { } } return itemsNull && fluidsNull; - } } diff --git a/src/main/java/gregtech/common/GT_Server.java b/src/main/java/gregtech/common/GT_Server.java index 51bf9e898b..75d98e27a1 100644 --- a/src/main/java/gregtech/common/GT_Server.java +++ b/src/main/java/gregtech/common/GT_Server.java @@ -21,8 +21,7 @@ public class GT_Server extends GT_Proxy { } @Override - public void doSonictronSound(ItemStack aStack, World aWorld, double aX, double aY, double aZ) { - } + public void doSonictronSound(ItemStack aStack, World aWorld, double aX, double aY, double aZ) {} @Override public int addArmor(String aPrefix) { diff --git a/src/main/java/gregtech/common/GT_ThaumcraftCompat.java b/src/main/java/gregtech/common/GT_ThaumcraftCompat.java index e4472824e7..1f7e8f4de9 100644 --- a/src/main/java/gregtech/common/GT_ThaumcraftCompat.java +++ b/src/main/java/gregtech/common/GT_ThaumcraftCompat.java @@ -6,6 +6,9 @@ import gregtech.api.enums.TC_Aspects; import gregtech.api.interfaces.internal.IThaumcraftCompat; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Utility; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; @@ -23,10 +26,6 @@ import thaumcraft.api.research.ResearchCategoryList; import thaumcraft.api.research.ResearchItem; import thaumcraft.api.research.ResearchPage; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - public class GT_ThaumcraftCompat implements IThaumcraftCompat { public GT_ThaumcraftCompat() { TC_Aspects.AER.mAspect = Aspect.AIR; @@ -79,11 +78,36 @@ public class GT_ThaumcraftCompat implements IThaumcraftCompat { TC_Aspects.VITREUS.mAspect = Aspect.CRYSTAL; TC_Aspects.VOLATUS.mAspect = Aspect.FLIGHT; - TC_Aspects.STRONTIO.mAspect = new Aspect("strontio", 15647411, new Aspect[]{Aspect.MIND, Aspect.ENTROPY}, new ResourceLocation("gregtech:textures/aspects/" + TC_Aspects.STRONTIO.name() + ".png"), 1); - TC_Aspects.NEBRISUM.mAspect = new Aspect("nebrisum", 15658622, new Aspect[]{Aspect.MINE, Aspect.GREED}, new ResourceLocation("gregtech:textures/aspects/" + TC_Aspects.NEBRISUM.name() + ".png"), 1); - TC_Aspects.ELECTRUM.mAspect = new Aspect("electrum", 12644078, new Aspect[]{Aspect.ENERGY, Aspect.MECHANISM}, new ResourceLocation("gregtech:textures/aspects/" + TC_Aspects.ELECTRUM.name() + ".png"), 1); - TC_Aspects.MAGNETO.mAspect = new Aspect("magneto", 12632256, new Aspect[]{Aspect.METAL, Aspect.TRAVEL}, new ResourceLocation("gregtech:textures/aspects/" + TC_Aspects.MAGNETO.name() + ".png"), 1); - TC_Aspects.RADIO.mAspect = new Aspect("radio", 12648384, new Aspect[]{Aspect.LIGHT, Aspect.ENERGY}, new ResourceLocation("gregtech:textures/aspects/" + TC_Aspects.RADIO.name() + ".png"), 1); + TC_Aspects.STRONTIO.mAspect = new Aspect( + "strontio", + 15647411, + new Aspect[] {Aspect.MIND, Aspect.ENTROPY}, + new ResourceLocation("gregtech:textures/aspects/" + TC_Aspects.STRONTIO.name() + ".png"), + 1); + TC_Aspects.NEBRISUM.mAspect = new Aspect( + "nebrisum", + 15658622, + new Aspect[] {Aspect.MINE, Aspect.GREED}, + new ResourceLocation("gregtech:textures/aspects/" + TC_Aspects.NEBRISUM.name() + ".png"), + 1); + TC_Aspects.ELECTRUM.mAspect = new Aspect( + "electrum", + 12644078, + new Aspect[] {Aspect.ENERGY, Aspect.MECHANISM}, + new ResourceLocation("gregtech:textures/aspects/" + TC_Aspects.ELECTRUM.name() + ".png"), + 1); + TC_Aspects.MAGNETO.mAspect = new Aspect( + "magneto", + 12632256, + new Aspect[] {Aspect.METAL, Aspect.TRAVEL}, + new ResourceLocation("gregtech:textures/aspects/" + TC_Aspects.MAGNETO.name() + ".png"), + 1); + TC_Aspects.RADIO.mAspect = new Aspect( + "radio", + 12648384, + new Aspect[] {Aspect.LIGHT, Aspect.ENERGY}, + new ResourceLocation("gregtech:textures/aspects/" + TC_Aspects.RADIO.name() + ".png"), + 1); GT_LanguageManager.addStringLocalization("tc.aspect.strontio", "Stupidness, Incompetence"); GT_LanguageManager.addStringLocalization("tc.aspect.nebrisum", "Cheatyness, Raiding"); @@ -95,14 +119,29 @@ public class GT_ThaumcraftCompat implements IThaumcraftCompat { private static final AspectList getAspectList(List<TC_Aspects.TC_AspectStack> aAspects) { AspectList rAspects = new AspectList(); TC_Aspects.TC_AspectStack tAspect; - for (Iterator i$ = aAspects.iterator(); i$.hasNext(); rAspects.add((Aspect) tAspect.mAspect.mAspect, (int) tAspect.mAmount)) { + for (Iterator i$ = aAspects.iterator(); + i$.hasNext(); + rAspects.add((Aspect) tAspect.mAspect.mAspect, (int) tAspect.mAmount)) { tAspect = (TC_Aspects.TC_AspectStack) i$.next(); } return rAspects; } @Override - public Object addResearch(String aResearch, String aName, String aText, String[] aParentResearches, String aCategory, ItemStack aIcon, int aComplexity, int aType, int aX, int aY, List<TC_Aspects.TC_AspectStack> aAspects, ItemStack[] aResearchTriggers, Object[] aPages) { + public Object addResearch( + String aResearch, + String aName, + String aText, + String[] aParentResearches, + String aCategory, + ItemStack aIcon, + int aComplexity, + int aType, + int aX, + int aY, + List<TC_Aspects.TC_AspectStack> aAspects, + ItemStack[] aResearchTriggers, + Object[] aPages) { if (!GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.researches, aResearch, true)) { return null; } @@ -117,7 +156,8 @@ public class GT_ThaumcraftCompat implements IThaumcraftCompat { aY += (aY > 0 ? 5 : -5); } } - ResearchItem rResearch = new ResearchItem(aResearch, aCategory, getAspectList(aAspects), aX, aY, aComplexity, aIcon); + ResearchItem rResearch = + new ResearchItem(aResearch, aCategory, getAspectList(aAspects), aX, aY, aComplexity, aIcon); ArrayList<ResearchPage> tPages = new ArrayList(aPages.length); GT_LanguageManager.addStringLocalization("tc.research_name." + aResearch, aName); GT_LanguageManager.addStringLocalization("tc.research_text." + aResearch, "[GT] " + aText); @@ -178,41 +218,69 @@ public class GT_ThaumcraftCompat implements IThaumcraftCompat { } @Override - public Object addCrucibleRecipe(String aResearch, Object aInput, ItemStack aOutput, List<TC_Aspects.TC_AspectStack> aAspects) { - if ((GT_Utility.isStringInvalid(aResearch)) || (aInput == null) || (aOutput == null) || (aAspects == null) || (aAspects.isEmpty())) { + public Object addCrucibleRecipe( + String aResearch, Object aInput, ItemStack aOutput, List<TC_Aspects.TC_AspectStack> aAspects) { + if ((GT_Utility.isStringInvalid(aResearch)) + || (aInput == null) + || (aOutput == null) + || (aAspects == null) + || (aAspects.isEmpty())) { return null; } - return ThaumcraftApi.addCrucibleRecipe(aResearch, GT_Utility.copyOrNull(aOutput), ((aInput instanceof ItemStack)) || ((aInput instanceof ArrayList)) ? aInput : aInput.toString(), getAspectList(aAspects)); + return ThaumcraftApi.addCrucibleRecipe( + aResearch, + GT_Utility.copyOrNull(aOutput), + ((aInput instanceof ItemStack)) || ((aInput instanceof ArrayList)) ? aInput : aInput.toString(), + getAspectList(aAspects)); } @Override - public Object addInfusionRecipe(String aResearch, ItemStack aMainInput, ItemStack[] aSideInputs, ItemStack aOutput, int aInstability, List<TC_Aspects.TC_AspectStack> aAspects) { - if ((GT_Utility.isStringInvalid(aResearch)) || (aMainInput == null) || (aSideInputs == null) || (aOutput == null) || (aAspects == null) || (aAspects.isEmpty())) { + public Object addInfusionRecipe( + String aResearch, + ItemStack aMainInput, + ItemStack[] aSideInputs, + ItemStack aOutput, + int aInstability, + List<TC_Aspects.TC_AspectStack> aAspects) { + if ((GT_Utility.isStringInvalid(aResearch)) + || (aMainInput == null) + || (aSideInputs == null) + || (aOutput == null) + || (aAspects == null) + || (aAspects.isEmpty())) { return null; } - return ThaumcraftApi.addInfusionCraftingRecipe(aResearch, GT_Utility.copyOrNull(aOutput), aInstability, getAspectList(aAspects), aMainInput, aSideInputs); + return ThaumcraftApi.addInfusionCraftingRecipe( + aResearch, + GT_Utility.copyOrNull(aOutput), + aInstability, + getAspectList(aAspects), + aMainInput, + aSideInputs); + } + + @Override + public boolean registerThaumcraftAspectsToItem( + ItemStack aExampleStack, List<TC_Aspects.TC_AspectStack> aAspects, String aOreDict) { + if (aAspects.isEmpty()) return false; + ThaumcraftApi.registerObjectTag(aOreDict, (AspectList) getAspectList(aAspects)); + return true; } - - @Override - public boolean registerThaumcraftAspectsToItem(ItemStack aExampleStack, List<TC_Aspects.TC_AspectStack> aAspects, String aOreDict) { - if (aAspects.isEmpty()) return false; - ThaumcraftApi.registerObjectTag(aOreDict, (AspectList)getAspectList(aAspects)); - return true; - } - @Override - public boolean registerThaumcraftAspectsToItem(ItemStack aStack, List<TC_Aspects.TC_AspectStack> aAspects, boolean aAdditive) { - if (aAspects.isEmpty()) return false; - if (aAdditive) { - ThaumcraftApi.registerComplexObjectTag(aStack, (AspectList)getAspectList(aAspects)); - return true; - } - AspectList tAlreadyRegisteredAspects = ThaumcraftApiHelper.getObjectAspects(aStack); - if (tAlreadyRegisteredAspects == null || tAlreadyRegisteredAspects.size() <= 0) { - ThaumcraftApi.registerObjectTag(aStack, (AspectList)getAspectList(aAspects)); - } - return true; - } + @Override + public boolean registerThaumcraftAspectsToItem( + ItemStack aStack, List<TC_Aspects.TC_AspectStack> aAspects, boolean aAdditive) { + if (aAspects.isEmpty()) return false; + if (aAdditive) { + ThaumcraftApi.registerComplexObjectTag(aStack, (AspectList) getAspectList(aAspects)); + return true; + } + AspectList tAlreadyRegisteredAspects = ThaumcraftApiHelper.getObjectAspects(aStack); + if (tAlreadyRegisteredAspects == null || tAlreadyRegisteredAspects.size() <= 0) { + ThaumcraftApi.registerObjectTag(aStack, (AspectList) getAspectList(aAspects)); + } + return true; + } @Override public boolean registerPortholeBlacklistedBlock(Block aBlock) { diff --git a/src/main/java/gregtech/common/GT_UndergroundOil.java b/src/main/java/gregtech/common/GT_UndergroundOil.java index 0010de8223..e7351af7c3 100644 --- a/src/main/java/gregtech/common/GT_UndergroundOil.java +++ b/src/main/java/gregtech/common/GT_UndergroundOil.java @@ -1,11 +1,20 @@ package gregtech.common; +import static gregtech.api.objects.XSTR.XSTR_INSTANCE; + import gregtech.GT_Mod; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.objects.GT_UO_Dimension; import gregtech.api.objects.GT_UO_Fluid; import gregtech.api.objects.XSTR; import gregtech.api.util.GT_ChunkAssociatedData; +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; +import java.util.Objects; +import java.util.WeakHashMap; +import javax.annotation.Nullable; +import javax.annotation.ParametersAreNonnullByDefault; import net.minecraft.world.World; import net.minecraft.world.chunk.Chunk; import net.minecraftforge.event.world.ChunkDataEvent; @@ -13,21 +22,11 @@ import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; import org.apache.commons.lang3.tuple.Pair; -import javax.annotation.Nullable; -import javax.annotation.ParametersAreNonnullByDefault; -import java.io.DataInput; -import java.io.DataOutput; -import java.io.IOException; -import java.util.Objects; -import java.util.WeakHashMap; - -import static gregtech.api.objects.XSTR.XSTR_INSTANCE; - /** * Created by Tec on 29.04.2017. */ public class GT_UndergroundOil { - public static final short DIVIDER=5000; + public static final short DIVIDER = 5000; private static final GT_UndergroundOilStore STORAGE = new GT_UndergroundOilStore(); private static final ChunkData NIL_FLUID_STACK = new ChunkData(-1, null, null, false); @@ -35,8 +34,8 @@ public class GT_UndergroundOil { * Effectively just call {@code undergroundOil(te, -1)} for you * @see #undergroundOil(World, int, int, float) */ - public static FluidStack undergroundOilReadInformation(IGregTechTileEntity te){ - return undergroundOil(te.getWorld().getChunkFromBlockCoords(te.getXCoord(),te.getZCoord()),-1); + public static FluidStack undergroundOilReadInformation(IGregTechTileEntity te) { + return undergroundOil(te.getWorld().getChunkFromBlockCoords(te.getXCoord(), te.getZCoord()), -1); } /** @@ -44,16 +43,17 @@ public class GT_UndergroundOil { * @see #undergroundOil(World, int, int, float) */ public static FluidStack undergroundOilReadInformation(Chunk chunk) { - return undergroundOil(chunk,-1); + return undergroundOil(chunk, -1); } /** @see #undergroundOil(World, int, int, float) */ - public static FluidStack undergroundOil(IGregTechTileEntity te, float readOrDrainCoefficient){ - return undergroundOil(te.getWorld().getChunkFromBlockCoords(te.getXCoord(),te.getZCoord()),readOrDrainCoefficient); + public static FluidStack undergroundOil(IGregTechTileEntity te, float readOrDrainCoefficient) { + return undergroundOil( + te.getWorld().getChunkFromBlockCoords(te.getXCoord(), te.getZCoord()), readOrDrainCoefficient); } - //Returns whole content for information purposes -> when drainSpeedCoefficient < 0 - //Else returns extracted fluidStack if amount > 0, or null otherwise + // Returns whole content for information purposes -> when drainSpeedCoefficient < 0 + // Else returns extracted fluidStack if amount > 0, or null otherwise /** @see #undergroundOil(World, int, int, float) */ public static FluidStack undergroundOil(Chunk chunk, float readOrDrainCoefficient) { return undergroundOil(chunk.worldObj, chunk.xPosition, chunk.zPosition, readOrDrainCoefficient); @@ -68,37 +68,38 @@ public class GT_UndergroundOil { * @return null if nothing here, or depleted already, or a client side world */ public static FluidStack undergroundOil(World w, int chunkX, int chunkZ, float readOrDrainCoefficient) { - if (w.isRemote) - return null; // troublemakers go away + if (w.isRemote) return null; // troublemakers go away ChunkData chunkData = STORAGE.get(w, chunkX, chunkZ); if (chunkData.getVein() == null || chunkData.getFluid() == null) // nothing here... - return null; - //do stuff on it if needed + return null; + // do stuff on it if needed FluidStack fluidInChunk = new FluidStack(chunkData.getFluid(), 0); - if(readOrDrainCoefficient>=0){ + if (readOrDrainCoefficient >= 0) { int fluidExtracted = (int) Math.floor(chunkData.getAmount() * (double) readOrDrainCoefficient / DIVIDER); double averageDecrease = chunkData.getVein().DecreasePerOperationAmount * (double) readOrDrainCoefficient; - int decrease=(int)Math.ceil(averageDecrease); - if (fluidExtracted <= 0 || chunkData.amount <= decrease) {//decrease - here it is max value of extraction for easy check + int decrease = (int) Math.ceil(averageDecrease); + if (fluidExtracted <= 0 + || chunkData.amount <= decrease) { // decrease - here it is max value of extraction for easy check chunkData.setAmount(0); - }else{ - fluidInChunk.amount = fluidExtracted;//give appropriate amount + } else { + fluidInChunk.amount = fluidExtracted; // give appropriate amount if (XSTR_INSTANCE.nextFloat() < (decrease - averageDecrease)) - decrease--;//use XSTR_INSTANCE to "subtract double from int" - //ex. + decrease--; // use XSTR_INSTANCE to "subtract double from int" + // ex. // averageDecrease=3.9 // decrease= ceil from 3.9 = 4 // decrease-averageDecrease=0.1 -> chance to subtract 1 // if XSTR_INSTANCE is < chance then subtract 1 - chunkData.changeAmount(-decrease);//diminish amount, "randomly" adjusted to double value (averageDecrease) + chunkData.changeAmount( + -decrease); // diminish amount, "randomly" adjusted to double value (averageDecrease) } - } - else {//just get info + } else { // just get info if (chunkData.amount <= DIVIDER) { chunkData.setAmount(0); } else { - //get the expected current output - fluidInChunk.amount = (int) Math.floor(chunkData.getAmount() * (double) -readOrDrainCoefficient / DIVIDER); + // get the expected current output + fluidInChunk.amount = + (int) Math.floor(chunkData.getAmount() * (double) -readOrDrainCoefficient / DIVIDER); } } return fluidInChunk; @@ -172,7 +173,8 @@ public class GT_UndergroundOil { } @Override - protected void writeElement(DataOutput output, ChunkData element, World world, int chunkX, int chunkZ) throws IOException { + protected void writeElement(DataOutput output, ChunkData element, World world, int chunkX, int chunkZ) + throws IOException { /* see class javadoc for explanation */ output.writeInt(element.getVeinHash()); if (element.getVeinKey() == null) return; @@ -185,10 +187,10 @@ public class GT_UndergroundOil { } @Override - protected GT_UndergroundOil.ChunkData readElement(DataInput input, int version, World world, int chunkX, int chunkZ) throws IOException { + protected GT_UndergroundOil.ChunkData readElement( + DataInput input, int version, World world, int chunkX, int chunkZ) throws IOException { /* see class javadoc for explanation */ - if (version != 0) - throw new IOException("Region file corrupted"); + if (version != 0) throw new IOException("Region file corrupted"); GT_UndergroundOil.ChunkData pristine = createElement(world, chunkX, chunkZ); int hash = input.readInt(); String veinKey = hash != 0 ? input.readUTF() : null; @@ -197,24 +199,28 @@ public class GT_UndergroundOil { // vein config changed. use regen-ed data. return pristine; } - if (hash == 0) - return NIL_FLUID_STACK; - return new GT_UndergroundOil.ChunkData(amount, GT_Mod.gregtechproxy.mUndergroundOil.GetDimension(world.provider.dimensionId).getUOFluid(veinKey), veinKey); + if (hash == 0) return NIL_FLUID_STACK; + return new GT_UndergroundOil.ChunkData( + amount, + GT_Mod.gregtechproxy + .mUndergroundOil + .GetDimension(world.provider.dimensionId) + .getUOFluid(veinKey), + veinKey); } @Override protected GT_UndergroundOil.ChunkData createElement(World world, int chunkX, int chunkZ) { Pair<GT_UO_Fluid, Integer> pristine = getPristineAmount(world, chunkX, chunkZ); - if (pristine == null) - return NIL_FLUID_STACK; + if (pristine == null) return NIL_FLUID_STACK; int dimensionId = world.provider.dimensionId; GT_UO_Dimension dimension = GT_Mod.gregtechproxy.mUndergroundOil.GetDimension(dimensionId); - return new GT_UndergroundOil.ChunkData(pristine.getRight(), pristine.getLeft(), dimension.getUOFluidKey(pristine.getLeft()), false); + return new GT_UndergroundOil.ChunkData( + pristine.getRight(), pristine.getLeft(), dimension.getUOFluidKey(pristine.getLeft()), false); } private static int hash(@Nullable GT_UO_Fluid fluid) { - if (fluid == null) - return 0; + if (fluid == null) return 0; int result = fluid.Registry.hashCode(); result = 31 * result + fluid.MaxAmount; result = 31 * result + fluid.MinAmount; @@ -222,7 +228,6 @@ public class GT_UndergroundOil { result = 31 * result + fluid.DecreasePerOperationAmount; return result == 0 ? 1 : result; } - } /** @@ -230,8 +235,10 @@ public class GT_UndergroundOil { */ private static final class ChunkData implements GT_ChunkAssociatedData.IData { private final Fluid fluid; + @Nullable private final GT_UO_Fluid vein; + private final String veinKey; private final int veinHash; private int amount; @@ -272,14 +279,12 @@ public class GT_UndergroundOil { } public void setAmount(int amount) { - if (this.amount != amount) - dirty = true; + if (this.amount != amount) dirty = true; this.amount = Math.max(0, amount); } public void changeAmount(int delta) { - if (delta != 0) - dirty = true; + if (delta != 0) dirty = true; this.amount = Math.max(amount + delta, 0); } diff --git a/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_Layer.java b/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_Layer.java index 214661ae67..2a66514fe5 100644 --- a/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_Layer.java +++ b/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_Layer.java @@ -1,23 +1,22 @@ package gregtech.common; +import static gregtech.api.enums.GT_Values.debugOrevein; +import static gregtech.api.enums.GT_Values.oreveinPlacerOres; +import static gregtech.api.enums.GT_Values.oreveinPlacerOresMultiplier; + import gregtech.api.GregTech_API; import gregtech.api.enums.Materials; import gregtech.api.util.GT_Log; import gregtech.api.world.GT_Worldgen; import gregtech.common.blocks.GT_TileEntity_Ores; +import java.util.ArrayList; +import java.util.Random; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.util.MathHelper; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; -import java.util.ArrayList; -import java.util.Random; - -import static gregtech.api.enums.GT_Values.debugOrevein; -import static gregtech.api.enums.GT_Values.oreveinPlacerOres; -import static gregtech.api.enums.GT_Values.oreveinPlacerOresMultiplier; - public class GT_Worldgen_GT_Ore_Layer extends GT_Worldgen { public static ArrayList<GT_Worldgen_GT_Ore_Layer> sList = new ArrayList(); public static int sWeight = 0; @@ -30,51 +29,72 @@ public class GT_Worldgen_GT_Ore_Layer extends GT_Worldgen { public final short mSecondaryMeta; public final short mBetweenMeta; public final short mSporadicMeta; - //public final String mBiome; + // public final String mBiome; public final String mRestrictBiome; public final boolean mOverworld; public final boolean mNether; public final boolean mEnd; public final boolean mEndAsteroid; - public static final int WRONG_BIOME=0; - public static final int WRONG_DIMENSION=1; - public static final int NO_ORE_IN_BOTTOM_LAYER=2; - public static final int NO_OVERLAP=3; - public static final int ORE_PLACED=4; - public static final int NO_OVERLAP_AIR_BLOCK=5; + public static final int WRONG_BIOME = 0; + public static final int WRONG_DIMENSION = 1; + public static final int NO_ORE_IN_BOTTOM_LAYER = 2; + public static final int NO_OVERLAP = 3; + public static final int ORE_PLACED = 4; + public static final int NO_OVERLAP_AIR_BLOCK = 5; public final boolean mMoon = false, mMars = false, mAsteroid = false; public final String aTextWorldgen = "worldgen."; - @Deprecated - public GT_Worldgen_GT_Ore_Layer(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, int aSize, boolean aOverworld, boolean aNether, boolean aEnd, boolean GC_UNUSED1, boolean GC_UNUSED2, boolean GC_UNUSED3, int aPrimary, int aSecondary, int aBetween, int aSporadic) { + public GT_Worldgen_GT_Ore_Layer( + String aName, + boolean aDefault, + int aMinY, + int aMaxY, + int aWeight, + int aDensity, + int aSize, + boolean aOverworld, + boolean aNether, + boolean aEnd, + boolean GC_UNUSED1, + boolean GC_UNUSED2, + boolean GC_UNUSED3, + int aPrimary, + int aSecondary, + int aBetween, + int aSporadic) { super(aName, sList, aDefault); this.mOverworld = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Overworld", aOverworld); this.mNether = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Nether", aNether); this.mEnd = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "TheEnd", aEnd); this.mEndAsteroid = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "EndAsteroid", aEnd); - //this.mMoon = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Moon", aMoon); - //this.mMars = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Mars", aMars); - //this.mAsteroid = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Asteroid", aAsteroid); + // this.mMoon = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Moon", aMoon); + // this.mMars = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Mars", aMars); + // this.mAsteroid = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Asteroid", aAsteroid); this.mMinY = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "MinHeight", aMinY)); short mMaxY = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "MaxHeight", aMaxY)); - if (mMaxY < (this.mMinY + 9)) { - GT_Log.out.println( - "Oremix " + this.mWorldGenName + - " has invalid Min/Max heights!" - ); + if (mMaxY < (this.mMinY + 9)) { + GT_Log.out.println("Oremix " + this.mWorldGenName + " has invalid Min/Max heights!"); mMaxY = (short) (this.mMinY + 9); } this.mMaxY = mMaxY; - this.mWeight = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "RandomWeight", aWeight)); - this.mDensity = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Density", aDensity)); - this.mSize = ((short) Math.max(1, GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Size", aSize))); - this.mPrimaryMeta = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OrePrimaryLayer", aPrimary)); - this.mSecondaryMeta = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OreSecondaryLayer", aSecondary)); - this.mBetweenMeta = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OreSporadiclyInbetween", aBetween)); - this.mSporadicMeta = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OreSporaticlyAround", aSporadic)); - this.mRestrictBiome = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "RestrictToBiomeName", "None"); + this.mWeight = + ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "RandomWeight", aWeight)); + this.mDensity = + ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Density", aDensity)); + this.mSize = ((short) + Math.max(1, GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Size", aSize))); + this.mPrimaryMeta = ((short) + GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OrePrimaryLayer", aPrimary)); + this.mSecondaryMeta = ((short) + GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OreSecondaryLayer", aSecondary)); + this.mBetweenMeta = ((short) + GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OreSporadiclyInbetween", aBetween)); + this.mSporadicMeta = ((short) + GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OreSporaticlyAround", aSporadic)); + this.mRestrictBiome = + GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "RestrictToBiomeName", "None"); if (this.mEnabled) { sWeight += this.mWeight; @@ -82,11 +102,56 @@ public class GT_Worldgen_GT_Ore_Layer extends GT_Worldgen { } @Deprecated - public GT_Worldgen_GT_Ore_Layer(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, int aSize, boolean aOverworld, boolean aNether, boolean aEnd, boolean GC_UNUSED1, boolean GC_UNUSED2, boolean GC_UNUSED3, Materials aPrimary, Materials aSecondary, Materials aBetween, Materials aSporadic) { - this(aName, aDefault, aMinY, aMaxY, aWeight, aDensity, aSize, aOverworld, aNether, aEnd, aPrimary, aSecondary, aBetween, aSporadic); + public GT_Worldgen_GT_Ore_Layer( + String aName, + boolean aDefault, + int aMinY, + int aMaxY, + int aWeight, + int aDensity, + int aSize, + boolean aOverworld, + boolean aNether, + boolean aEnd, + boolean GC_UNUSED1, + boolean GC_UNUSED2, + boolean GC_UNUSED3, + Materials aPrimary, + Materials aSecondary, + Materials aBetween, + Materials aSporadic) { + this( + aName, + aDefault, + aMinY, + aMaxY, + aWeight, + aDensity, + aSize, + aOverworld, + aNether, + aEnd, + aPrimary, + aSecondary, + aBetween, + aSporadic); } - public GT_Worldgen_GT_Ore_Layer(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, int aSize, boolean aOverworld, boolean aNether, boolean aEnd, Materials aPrimary, Materials aSecondary, Materials aBetween, Materials aSporadic) { + public GT_Worldgen_GT_Ore_Layer( + String aName, + boolean aDefault, + int aMinY, + int aMaxY, + int aWeight, + int aDensity, + int aSize, + boolean aOverworld, + boolean aNether, + boolean aEnd, + Materials aPrimary, + Materials aSecondary, + Materials aBetween, + Materials aSporadic) { super(aName, sList, aDefault); this.mOverworld = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Overworld", aOverworld); this.mNether = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Nether", aNether); @@ -94,38 +159,58 @@ public class GT_Worldgen_GT_Ore_Layer extends GT_Worldgen { this.mEndAsteroid = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "EndAsteroid", aEnd); this.mMinY = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "MinHeight", aMinY)); short mMaxY = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "MaxHeight", aMaxY)); - if (mMaxY < (this.mMinY + 9)) { - GT_Log.out.println( - "Oremix " + this.mWorldGenName + - " has invalid Min/Max heights!" - ); + if (mMaxY < (this.mMinY + 9)) { + GT_Log.out.println("Oremix " + this.mWorldGenName + " has invalid Min/Max heights!"); mMaxY = (short) (this.mMinY + 9); } this.mMaxY = mMaxY; - this.mWeight = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "RandomWeight", aWeight)); - this.mDensity = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Density", aDensity)); - this.mSize = ((short) Math.max(1, GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Size", aSize))); - this.mPrimaryMeta = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OrePrimaryLayer", aPrimary.mMetaItemSubID)); - this.mSecondaryMeta = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OreSecondaryLayer", aSecondary.mMetaItemSubID)); - this.mBetweenMeta = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OreSporadiclyInbetween", aBetween.mMetaItemSubID)); - this.mSporadicMeta = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OreSporaticlyAround", aSporadic.mMetaItemSubID)); - this.mRestrictBiome = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "RestrictToBiomeName", "None"); - + this.mWeight = + ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "RandomWeight", aWeight)); + this.mDensity = + ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Density", aDensity)); + this.mSize = ((short) + Math.max(1, GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Size", aSize))); + this.mPrimaryMeta = ((short) GregTech_API.sWorldgenFile.get( + aTextWorldgen + this.mWorldGenName, "OrePrimaryLayer", aPrimary.mMetaItemSubID)); + this.mSecondaryMeta = ((short) GregTech_API.sWorldgenFile.get( + aTextWorldgen + this.mWorldGenName, "OreSecondaryLayer", aSecondary.mMetaItemSubID)); + this.mBetweenMeta = ((short) GregTech_API.sWorldgenFile.get( + aTextWorldgen + this.mWorldGenName, "OreSporadiclyInbetween", aBetween.mMetaItemSubID)); + this.mSporadicMeta = ((short) GregTech_API.sWorldgenFile.get( + aTextWorldgen + this.mWorldGenName, "OreSporaticlyAround", aSporadic.mMetaItemSubID)); + this.mRestrictBiome = + GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "RestrictToBiomeName", "None"); + if (this.mEnabled) { sWeight += this.mWeight; } } @Override - public int executeWorldgenChunkified(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, int aChunkZ, int aSeedX, int aSeedZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { - if( mWorldGenName.equals("NoOresInVein") ) { - if (debugOrevein) GT_Log.out.println( - " NoOresInVein" - ); + public int executeWorldgenChunkified( + World aWorld, + Random aRandom, + String aBiome, + int aDimensionType, + int aChunkX, + int aChunkZ, + int aSeedX, + int aSeedZ, + IChunkProvider aChunkGenerator, + IChunkProvider aChunkProvider) { + if (mWorldGenName.equals("NoOresInVein")) { + if (debugOrevein) GT_Log.out.println(" NoOresInVein"); // This is a special empty orevein return ORE_PLACED; } - if (!isGenerationAllowed(aWorld, aDimensionType, ((aDimensionType == -1) && (this.mNether)) || ((aDimensionType == 0) && (this.mOverworld)) || ((aDimensionType == 1) && (this.mEnd)) ? aDimensionType : aDimensionType ^ 0xFFFFFFFF)) { + if (!isGenerationAllowed( + aWorld, + aDimensionType, + ((aDimensionType == -1) && (this.mNether)) + || ((aDimensionType == 0) && (this.mOverworld)) + || ((aDimensionType == 1) && (this.mEnd)) + ? aDimensionType + : aDimensionType ^ 0xFFFFFFFF)) { /* // Debug code, but spams log if (debugOrevein) { GT_Log.out.println( @@ -136,34 +221,34 @@ public class GT_Worldgen_GT_Ore_Layer extends GT_Worldgen { return WRONG_DIMENSION; } /*if (!((aWorld.provider.getDimensionName().equalsIgnoreCase("Overworld")) || (aWorld.provider.getDimensionName().equalsIgnoreCase("Nether"))||(aWorld.provider.getDimensionName().equalsIgnoreCase("Underdark"))||(aWorld.provider.getDimensionName().equalsIgnoreCase("Twilight Forest"))||(aWorld.provider.getDimensionName().equalsIgnoreCase("Underdark"))||(aWorld.provider.getDimensionName().equalsIgnoreCase("The End")))) - return WRONG_DIMENSION;*/ - + return WRONG_DIMENSION;*/ + if (!this.mRestrictBiome.equals("None") && !(this.mRestrictBiome.equals(aBiome))) { return WRONG_BIOME; } // For optimal performance, this should be done upstream. Meh String tDimensionName = aWorld.provider.getDimensionName(); boolean isUnderdark = tDimensionName.equals("Underdark"); - - int[] placeCount=new int[4]; + + int[] placeCount = new int[4]; int tMinY = mMinY + aRandom.nextInt(mMaxY - mMinY - 5); // Determine West/East ends of orevein - int wXVein = aSeedX - aRandom.nextInt(mSize); // West side + int wXVein = aSeedX - aRandom.nextInt(mSize); // West side int eXVein = aSeedX + 16 + aRandom.nextInt(mSize); // Limit Orevein to only blocks present in current chunk - int wX = Math.max( wXVein, aChunkX + 2); // Bias placement by 2 blocks to prevent worldgen cascade. - int eX = Math.min( eXVein, aChunkX + 2 + 16); + int wX = Math.max(wXVein, aChunkX + 2); // Bias placement by 2 blocks to prevent worldgen cascade. + int eX = Math.min(eXVein, aChunkX + 2 + 16); // Get a block at the center of the chunk and the bottom of the orevein. Block tBlock = aWorld.getBlock(aChunkX + 7, tMinY, aChunkZ + 9); - if (wX >= eX) { //No overlap between orevein and this chunk exists in X - if (tBlock.isReplaceableOreGen(aWorld, aChunkX+7, tMinY, aChunkZ + 9, Blocks.stone) || - tBlock.isReplaceableOreGen(aWorld, aChunkX+7, tMinY, aChunkZ + 9, Blocks.netherrack) || - tBlock.isReplaceableOreGen(aWorld, aChunkX+7, tMinY, aChunkZ + 9, Blocks.end_stone) || - tBlock.isReplaceableOreGen(aWorld, aChunkX+7, tMinY, aChunkZ + 9, GregTech_API.sBlockGranites) || - tBlock.isReplaceableOreGen(aWorld, aChunkX+7, tMinY, aChunkZ + 9, GregTech_API.sBlockStones) ) { + if (wX >= eX) { // No overlap between orevein and this chunk exists in X + if (tBlock.isReplaceableOreGen(aWorld, aChunkX + 7, tMinY, aChunkZ + 9, Blocks.stone) + || tBlock.isReplaceableOreGen(aWorld, aChunkX + 7, tMinY, aChunkZ + 9, Blocks.netherrack) + || tBlock.isReplaceableOreGen(aWorld, aChunkX + 7, tMinY, aChunkZ + 9, Blocks.end_stone) + || tBlock.isReplaceableOreGen(aWorld, aChunkX + 7, tMinY, aChunkZ + 9, GregTech_API.sBlockGranites) + || tBlock.isReplaceableOreGen(aWorld, aChunkX + 7, tMinY, aChunkZ + 9, GregTech_API.sBlockStones)) { // Didn't reach, but could have placed. Save orevein for future use. return NO_OVERLAP; } else { @@ -174,15 +259,15 @@ public class GT_Worldgen_GT_Ore_Layer extends GT_Worldgen { // Determine North/Sound ends of orevein int nZVein = aSeedZ - aRandom.nextInt(mSize); int sZVein = aSeedZ + 16 + aRandom.nextInt(mSize); - - int nZ = Math.max(nZVein, aChunkZ + 2); // Bias placement by 2 blocks to prevent worldgen cascade. + + int nZ = Math.max(nZVein, aChunkZ + 2); // Bias placement by 2 blocks to prevent worldgen cascade. int sZ = Math.min(sZVein, aChunkZ + 2 + 16); - if (nZ >= sZ) { //No overlap between orevein and this chunk exists in Z - if (tBlock.isReplaceableOreGen(aWorld, aChunkX+7, tMinY, aChunkZ + 9, Blocks.stone) || - tBlock.isReplaceableOreGen(aWorld, aChunkX+7, tMinY, aChunkZ + 9, Blocks.netherrack) || - tBlock.isReplaceableOreGen(aWorld, aChunkX+7, tMinY, aChunkZ + 9, Blocks.end_stone) || - tBlock.isReplaceableOreGen(aWorld, aChunkX+7, tMinY, aChunkZ + 9, GregTech_API.sBlockGranites) || - tBlock.isReplaceableOreGen(aWorld, aChunkX+7, tMinY, aChunkZ + 9, GregTech_API.sBlockStones) ) { + if (nZ >= sZ) { // No overlap between orevein and this chunk exists in Z + if (tBlock.isReplaceableOreGen(aWorld, aChunkX + 7, tMinY, aChunkZ + 9, Blocks.stone) + || tBlock.isReplaceableOreGen(aWorld, aChunkX + 7, tMinY, aChunkZ + 9, Blocks.netherrack) + || tBlock.isReplaceableOreGen(aWorld, aChunkX + 7, tMinY, aChunkZ + 9, Blocks.end_stone) + || tBlock.isReplaceableOreGen(aWorld, aChunkX + 7, tMinY, aChunkZ + 9, GregTech_API.sBlockGranites) + || tBlock.isReplaceableOreGen(aWorld, aChunkX + 7, tMinY, aChunkZ + 9, GregTech_API.sBlockStones)) { // Didn't reach, but could have placed. Save orevein for future use. return NO_OVERLAP; } else { @@ -192,214 +277,256 @@ public class GT_Worldgen_GT_Ore_Layer extends GT_Worldgen { } if (debugOrevein) { - GT_Log.out.print( - "Trying Orevein:" + this.mWorldGenName + - " Dimension=" + tDimensionName + - " mX="+aChunkX/16+ - " mZ="+aChunkZ/16+ - " oreseedX="+ aSeedX/16 + - " oreseedZ="+ aSeedZ/16 + - " cY="+tMinY - ); + GT_Log.out.print("Trying Orevein:" + this.mWorldGenName + " Dimension=" + + tDimensionName + " mX=" + + aChunkX / 16 + " mZ=" + + aChunkZ / 16 + " oreseedX=" + + aSeedX / 16 + " oreseedZ=" + + aSeedZ / 16 + " cY=" + + tMinY); } - // Adjust the density down the more chunks we are away from the oreseed. The 5 chunks surrounding the seed should always be max density due to truncation of Math.sqrt(). - int localDensity = Math.max(1, this.mDensity / ((int)Math.sqrt(2 + Math.pow(aChunkX/16 - aSeedX/16, 2) + Math.pow(aChunkZ/16 - aSeedZ/16, 2))) ); + // Adjust the density down the more chunks we are away from the oreseed. The 5 chunks surrounding the seed + // should always be max density due to truncation of Math.sqrt(). + int localDensity = Math.max( + 1, + this.mDensity + / ((int) Math.sqrt(2 + + Math.pow(aChunkX / 16 - aSeedX / 16, 2) + + Math.pow(aChunkZ / 16 - aSeedZ / 16, 2)))); - // To allow for early exit due to no ore placed in the bottom layer (probably because we are in the sky), unroll 1 pass through the loop + // To allow for early exit due to no ore placed in the bottom layer (probably because we are in the sky), unroll + // 1 pass through the loop // Now we do bottom-level-first oregen, and work our way upwards. // Layer -1 Secondary and Sporadic - int level = tMinY - 1; //Dunno why, but the first layer is actually played one below tMinY. Go figure. - for (int tX = wX; tX < eX; tX++) { - int placeX = Math.max(1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX))/localDensity); - for (int tZ = nZ; tZ < sZ; tZ++) { - int placeZ = Math.max(1, Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ))/localDensity); - if ( ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSecondaryMeta > 0) ) { - if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mSecondaryMeta, false, isUnderdark)) { - placeCount[1]++; - } - } - else if ((aRandom.nextInt(7) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSporadicMeta > 0) ) { // Sporadics are reduce by 1/7 to compensate - if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, isUnderdark)) - placeCount[3]++; + int level = tMinY - 1; // Dunno why, but the first layer is actually played one below tMinY. Go figure. + for (int tX = wX; tX < eX; tX++) { + int placeX = Math.max( + 1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX)) / localDensity); + for (int tZ = nZ; tZ < sZ; tZ++) { + int placeZ = Math.max( + 1, Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ)) / localDensity); + if (((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSecondaryMeta > 0)) { + if (GT_TileEntity_Ores.setOreBlock( + aWorld, tX, level, tZ, this.mSecondaryMeta, false, isUnderdark)) { + placeCount[1]++; } + } else if ((aRandom.nextInt(7) == 0) + && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) + && (this.mSporadicMeta > 0)) { // Sporadics are reduce by 1/7 to compensate + if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, isUnderdark)) + placeCount[3]++; } } - if ((placeCount[1]+placeCount[3])==0) { - if (debugOrevein) GT_Log.out.println( - " No ore in bottom layer" - ); - return NO_ORE_IN_BOTTOM_LAYER; // Exit early, didn't place anything in the bottom layer + } + if ((placeCount[1] + placeCount[3]) == 0) { + if (debugOrevein) GT_Log.out.println(" No ore in bottom layer"); + return NO_ORE_IN_BOTTOM_LAYER; // Exit early, didn't place anything in the bottom layer } // Layers 0 & 1 Secondary and Sporadic - for (level = tMinY; level < (tMinY+2); level++) { + for (level = tMinY; level < (tMinY + 2); level++) { for (int tX = wX; tX < eX; tX++) { - int placeX = Math.max(1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX))/localDensity); + int placeX = Math.max( + 1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX)) / localDensity); for (int tZ = nZ; tZ < sZ; tZ++) { - int placeZ = Math.max(1, Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ))/localDensity); - if ( ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSecondaryMeta > 0) ) { - if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mSecondaryMeta, false, isUnderdark)) { + int placeZ = Math.max( + 1, + Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ)) / localDensity); + if (((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) + && (this.mSecondaryMeta > 0)) { + if (GT_TileEntity_Ores.setOreBlock( + aWorld, tX, level, tZ, this.mSecondaryMeta, false, isUnderdark)) { placeCount[1]++; } - } - else if ((aRandom.nextInt(7) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSporadicMeta > 0) ) { // Sporadics are reduce by 1/7 to compensate - if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, isUnderdark)) - placeCount[3]++; + } else if ((aRandom.nextInt(7) == 0) + && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) + && (this.mSporadicMeta > 0)) { // Sporadics are reduce by 1/7 to compensate + if (GT_TileEntity_Ores.setOreBlock( + aWorld, tX, level, tZ, this.mSporadicMeta, false, isUnderdark)) placeCount[3]++; } } } } // Layer 2 is Secondary, in-between, and sporadic - for (int tX = wX; tX < eX; tX++) { - int placeX = Math.max(1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX))/localDensity); - for (int tZ = nZ; tZ < sZ; tZ++) { - int placeZ = Math.max(1, Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ))/localDensity); - if ((aRandom.nextInt(2) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mBetweenMeta > 0) ) { // Between are reduce by 1/2 to compensate - if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mBetweenMeta, false, isUnderdark)) { - placeCount[2]++; - } - } - else if ( ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSecondaryMeta > 0) ) { - if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mSecondaryMeta, false, isUnderdark)) { - placeCount[1]++; - } + for (int tX = wX; tX < eX; tX++) { + int placeX = Math.max( + 1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX)) / localDensity); + for (int tZ = nZ; tZ < sZ; tZ++) { + int placeZ = Math.max( + 1, Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ)) / localDensity); + if ((aRandom.nextInt(2) == 0) + && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) + && (this.mBetweenMeta > 0)) { // Between are reduce by 1/2 to compensate + if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mBetweenMeta, false, isUnderdark)) { + placeCount[2]++; } - else if ((aRandom.nextInt(7) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSporadicMeta > 0) ) { // Sporadics are reduce by 1/7 to compensate - if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, isUnderdark)) - placeCount[3]++; + } else if (((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) + && (this.mSecondaryMeta > 0)) { + if (GT_TileEntity_Ores.setOreBlock( + aWorld, tX, level, tZ, this.mSecondaryMeta, false, isUnderdark)) { + placeCount[1]++; } + } else if ((aRandom.nextInt(7) == 0) + && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) + && (this.mSporadicMeta > 0)) { // Sporadics are reduce by 1/7 to compensate + if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, isUnderdark)) + placeCount[3]++; } } + } level++; // Increment level to next layer // Layer 3 is In-between, and sporadic - for (int tX = wX; tX < eX; tX++) { - int placeX = Math.max(1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX))/localDensity); - for (int tZ = nZ; tZ < sZ; tZ++) { - int placeZ = Math.max(1, Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ))/localDensity); - if ((aRandom.nextInt(2) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mBetweenMeta > 0) ) { // Between are reduce by 1/2 to compensate - if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mBetweenMeta, false, isUnderdark)) { - placeCount[2]++; - } - } - else if ((aRandom.nextInt(7) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSporadicMeta > 0) ) { // Sporadics are reduce by 1/7 to compensate - if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, isUnderdark)) - placeCount[3]++; + for (int tX = wX; tX < eX; tX++) { + int placeX = Math.max( + 1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX)) / localDensity); + for (int tZ = nZ; tZ < sZ; tZ++) { + int placeZ = Math.max( + 1, Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ)) / localDensity); + if ((aRandom.nextInt(2) == 0) + && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) + && (this.mBetweenMeta > 0)) { // Between are reduce by 1/2 to compensate + if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mBetweenMeta, false, isUnderdark)) { + placeCount[2]++; } + } else if ((aRandom.nextInt(7) == 0) + && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) + && (this.mSporadicMeta > 0)) { // Sporadics are reduce by 1/7 to compensate + if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, isUnderdark)) + placeCount[3]++; } } + } level++; // Increment level to next layer // Layer 4 is In-between, Primary and sporadic - for (int tX = wX; tX < eX; tX++) { - int placeX = Math.max(1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX))/localDensity); - for (int tZ = nZ; tZ < sZ; tZ++) { - int placeZ = Math.max(1, Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ))/localDensity); - if ((aRandom.nextInt(2) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mBetweenMeta > 0) ) { // Between are reduce by 1/2 to compensate - if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mBetweenMeta, false, isUnderdark)) { - placeCount[2]++; - } - } - else if ( ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mPrimaryMeta > 0) ) { - if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mPrimaryMeta, false, isUnderdark)) { - placeCount[1]++; - } + for (int tX = wX; tX < eX; tX++) { + int placeX = Math.max( + 1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX)) / localDensity); + for (int tZ = nZ; tZ < sZ; tZ++) { + int placeZ = Math.max( + 1, Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ)) / localDensity); + if ((aRandom.nextInt(2) == 0) + && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) + && (this.mBetweenMeta > 0)) { // Between are reduce by 1/2 to compensate + if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mBetweenMeta, false, isUnderdark)) { + placeCount[2]++; } - else if ((aRandom.nextInt(7) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSporadicMeta > 0) ) { // Sporadics are reduce by 1/7 to compensate - if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, isUnderdark)) - placeCount[3]++; + } else if (((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) + && (this.mPrimaryMeta > 0)) { + if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mPrimaryMeta, false, isUnderdark)) { + placeCount[1]++; } + } else if ((aRandom.nextInt(7) == 0) + && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) + && (this.mSporadicMeta > 0)) { // Sporadics are reduce by 1/7 to compensate + if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, isUnderdark)) + placeCount[3]++; } } + } level++; // Increment level to next layer // Layer 5 is In-between, Primary and sporadic - for (int tX = wX; tX < eX; tX++) { - int placeX = Math.max(1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX))/localDensity); - for (int tZ = nZ; tZ < sZ; tZ++) { - int placeZ = Math.max(1, Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ))/localDensity); - if ((aRandom.nextInt(2) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mBetweenMeta > 0) ) { // Between are reduce by 1/2 to compensate - if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mBetweenMeta, false, isUnderdark)) { - placeCount[2]++; - } + for (int tX = wX; tX < eX; tX++) { + int placeX = Math.max( + 1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX)) / localDensity); + for (int tZ = nZ; tZ < sZ; tZ++) { + int placeZ = Math.max( + 1, Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ)) / localDensity); + if ((aRandom.nextInt(2) == 0) + && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) + && (this.mBetweenMeta > 0)) { // Between are reduce by 1/2 to compensate + if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mBetweenMeta, false, isUnderdark)) { + placeCount[2]++; } - else if ( ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mPrimaryMeta > 0) ) { - if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mPrimaryMeta, false, isUnderdark)) { - placeCount[1]++; - } - } - else if ((aRandom.nextInt(7) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSporadicMeta > 0) ) { // Sporadics are reduce by 1/7 to compensate - if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, isUnderdark)) - placeCount[3]++; + } else if (((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) + && (this.mPrimaryMeta > 0)) { + if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mPrimaryMeta, false, isUnderdark)) { + placeCount[1]++; } + } else if ((aRandom.nextInt(7) == 0) + && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) + && (this.mSporadicMeta > 0)) { // Sporadics are reduce by 1/7 to compensate + if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, isUnderdark)) + placeCount[3]++; } } + } level++; // Increment level to next layer // Layer 6 is Primary and sporadic - for (int tX = wX; tX < eX; tX++) { - int placeX = Math.max(1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX))/localDensity); - for (int tZ = nZ; tZ < sZ; tZ++) { - int placeZ = Math.max(1, Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ))/localDensity); - if ( ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mPrimaryMeta > 0) ) { - if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mPrimaryMeta, false, isUnderdark)) { - placeCount[1]++; - } - } - else if ((aRandom.nextInt(7) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSporadicMeta > 0) ) { // Sporadics are reduce by 1/7 to compensate - if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, isUnderdark)) - placeCount[3]++; + for (int tX = wX; tX < eX; tX++) { + int placeX = Math.max( + 1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX)) / localDensity); + for (int tZ = nZ; tZ < sZ; tZ++) { + int placeZ = Math.max( + 1, Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ)) / localDensity); + if (((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mPrimaryMeta > 0)) { + if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mPrimaryMeta, false, isUnderdark)) { + placeCount[1]++; } + } else if ((aRandom.nextInt(7) == 0) + && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) + && (this.mSporadicMeta > 0)) { // Sporadics are reduce by 1/7 to compensate + if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, isUnderdark)) + placeCount[3]++; } } + } level++; // Increment level to next layer // Layer 7 is Primary and sporadic - for (int tX = wX; tX < eX; tX++) { - int placeX = Math.max(1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX))/localDensity); - for (int tZ = nZ; tZ < sZ; tZ++) { - int placeZ = Math.max(1, Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ))/localDensity); - if ( ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mPrimaryMeta > 0) ) { - if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mPrimaryMeta, false, isUnderdark)) { - placeCount[1]++; - } - } - else if ((aRandom.nextInt(7) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSporadicMeta > 0) ) { // Sporadics are reduce by 1/7 to compensate - if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, isUnderdark)) - placeCount[3]++; + for (int tX = wX; tX < eX; tX++) { + int placeX = Math.max( + 1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX)) / localDensity); + for (int tZ = nZ; tZ < sZ; tZ++) { + int placeZ = Math.max( + 1, Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ)) / localDensity); + if (((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mPrimaryMeta > 0)) { + if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mPrimaryMeta, false, isUnderdark)) { + placeCount[1]++; } + } else if ((aRandom.nextInt(7) == 0) + && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) + && (this.mSporadicMeta > 0)) { // Sporadics are reduce by 1/7 to compensate + if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, isUnderdark)) + placeCount[3]++; } } - //Place small ores for the vein - if( oreveinPlacerOres ) { - int nSmallOres = (eX-wX)*(sZ-nZ)*this.mDensity/10 * oreveinPlacerOresMultiplier; - //Small ores are placed in the whole chunk in which the vein appears. - for( int nSmallOresCount = 0; nSmallOresCount < nSmallOres; nSmallOresCount++) { + } + // Place small ores for the vein + if (oreveinPlacerOres) { + int nSmallOres = (eX - wX) * (sZ - nZ) * this.mDensity / 10 * oreveinPlacerOresMultiplier; + // Small ores are placed in the whole chunk in which the vein appears. + for (int nSmallOresCount = 0; nSmallOresCount < nSmallOres; nSmallOresCount++) { int tX = aRandom.nextInt(16) + aChunkX + 2; int tZ = aRandom.nextInt(16) + aChunkZ + 2; int tY = aRandom.nextInt(160) + 10; // Y height can vary from 10 to 170 for small ores. - if (this.mPrimaryMeta > 0 ) GT_TileEntity_Ores.setOreBlock(aWorld, tX, tY, tZ, this.mPrimaryMeta, true, isUnderdark); + if (this.mPrimaryMeta > 0) + GT_TileEntity_Ores.setOreBlock(aWorld, tX, tY, tZ, this.mPrimaryMeta, true, isUnderdark); tX = aRandom.nextInt(16) + aChunkX + 2; tZ = aRandom.nextInt(16) + aChunkZ + 2; tY = aRandom.nextInt(160) + 10; // Y height can vary from 10 to 170 for small ores. - if (this.mSecondaryMeta > 0 ) GT_TileEntity_Ores.setOreBlock(aWorld, tX, tY, tZ, this.mSecondaryMeta, true, isUnderdark); + if (this.mSecondaryMeta > 0) + GT_TileEntity_Ores.setOreBlock(aWorld, tX, tY, tZ, this.mSecondaryMeta, true, isUnderdark); tX = aRandom.nextInt(16) + aChunkX + 2; tZ = aRandom.nextInt(16) + aChunkZ + 2; tY = aRandom.nextInt(160) + 10; // Y height can vary from 10 to 170 for small ores. - if (this.mBetweenMeta > 0 ) GT_TileEntity_Ores.setOreBlock(aWorld, tX, tY, tZ, this.mBetweenMeta, true, isUnderdark); + if (this.mBetweenMeta > 0) + GT_TileEntity_Ores.setOreBlock(aWorld, tX, tY, tZ, this.mBetweenMeta, true, isUnderdark); tX = aRandom.nextInt(16) + aChunkX + 2; tZ = aRandom.nextInt(16) + aChunkZ + 2; tY = aRandom.nextInt(190) + 10; // Y height can vary from 10 to 200 for small ores. - if (this.mSporadicMeta > 0 ) GT_TileEntity_Ores.setOreBlock(aWorld, tX, tY, tZ, this.mSporadicMeta, true, isUnderdark); + if (this.mSporadicMeta > 0) + GT_TileEntity_Ores.setOreBlock(aWorld, tX, tY, tZ, this.mSporadicMeta, true, isUnderdark); } } if (debugOrevein) { - GT_Log.out.println( - " wXVein" + wXVein + - " eXVein" + eXVein + - " nZVein" + nZVein + - " sZVein" + sZVein + - " locDen=" + localDensity + - " Den=" + this.mDensity + - " Sec="+placeCount[1]+ - " Spo="+placeCount[3]+ - " Bet="+placeCount[2]+ - " Pri="+placeCount[0] - ); + GT_Log.out.println(" wXVein" + wXVein + " eXVein" + + eXVein + " nZVein" + + nZVein + " sZVein" + + sZVein + " locDen=" + + localDensity + " Den=" + + this.mDensity + " Sec=" + + placeCount[1] + " Spo=" + + placeCount[3] + " Bet=" + + placeCount[2] + " Pri=" + + placeCount[0]); } // Something (at least the bottom layer must have 1 block) must have been placed, return true return ORE_PLACED; diff --git a/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_SmallPieces.java b/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_SmallPieces.java index 2e17873980..55bd77f474 100644 --- a/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_SmallPieces.java +++ b/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_SmallPieces.java @@ -1,20 +1,18 @@ package gregtech.common; +import static gregtech.api.enums.GT_Values.debugSmallOres; + import gregtech.api.GregTech_API; import gregtech.api.enums.Materials; import gregtech.api.util.GT_Log; import gregtech.api.world.GT_Worldgen; import gregtech.common.blocks.GT_TileEntity_Ores; -import net.minecraft.world.World; -import net.minecraft.world.chunk.IChunkProvider; - import java.util.ArrayList; import java.util.Random; +import net.minecraft.world.World; +import net.minecraft.world.chunk.IChunkProvider; -import static gregtech.api.enums.GT_Values.debugSmallOres; - -public class GT_Worldgen_GT_Ore_SmallPieces - extends GT_Worldgen { +public class GT_Worldgen_GT_Ore_SmallPieces extends GT_Worldgen { public final short mMinY; public final short mMaxY; public final short mAmount; @@ -26,63 +24,111 @@ public class GT_Worldgen_GT_Ore_SmallPieces public final String mBiome; public final String aTextWorldgen = "worldgen."; public static ArrayList<GT_Worldgen_GT_Ore_SmallPieces> sList = new ArrayList<GT_Worldgen_GT_Ore_SmallPieces>(); - - //TODO CHECK IF INSTANTIATION IS CORRECT - public GT_Worldgen_GT_Ore_SmallPieces(String aName, boolean aDefault, int aMinY, int aMaxY, int aAmount, boolean aOverworld, boolean aNether, boolean aEnd, Materials aPrimary) { + + // TODO CHECK IF INSTANTIATION IS CORRECT + public GT_Worldgen_GT_Ore_SmallPieces( + String aName, + boolean aDefault, + int aMinY, + int aMaxY, + int aAmount, + boolean aOverworld, + boolean aNether, + boolean aEnd, + Materials aPrimary) { super(aName, GregTech_API.sWorldgenList, aDefault); this.mOverworld = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Overworld", aOverworld); this.mNether = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Nether", aNether); this.mEnd = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "TheEnd", aEnd); this.mMinY = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "MinHeight", aMinY)); - this.mMaxY = ((short) Math.max(this.mMinY + 1, GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "MaxHeight", aMaxY))); - this.mAmount = ((short) Math.max(1, GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Amount", aAmount))); - this.mMeta = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Ore", aPrimary.mMetaItemSubID)); + this.mMaxY = ((short) Math.max( + this.mMinY + 1, + GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "MaxHeight", aMaxY))); + this.mAmount = ((short) + Math.max(1, GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Amount", aAmount))); + this.mMeta = ((short) + GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Ore", aPrimary.mMetaItemSubID)); this.mBiome = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "BiomeName", "None"); sList.add(this); } - - public GT_Worldgen_GT_Ore_SmallPieces(String aName, boolean aDefault, int aMinY, int aMaxY, int aAmount, boolean aOverworld, boolean aNether, boolean aEnd, boolean GC_UNUSED1, boolean GC_UNUSED2, boolean GC_UNUSED3, Materials aPrimary) { - super(aName, GregTech_API.sWorldgenList, aDefault); - this.mOverworld = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Overworld", aOverworld); - this.mNether = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Nether", aNether); - this.mEnd = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "TheEnd", aEnd); - this.mMinY = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "MinHeight", aMinY)); - this.mMaxY = ((short) Math.max(this.mMinY + 1, GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "MaxHeight", aMaxY))); - this.mAmount = ((short) Math.max(1, GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Amount", aAmount))); - this.mMeta = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Ore", aPrimary.mMetaItemSubID)); - this.mBiome = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "BiomeName", "None"); - sList.add(this); + + public GT_Worldgen_GT_Ore_SmallPieces( + String aName, + boolean aDefault, + int aMinY, + int aMaxY, + int aAmount, + boolean aOverworld, + boolean aNether, + boolean aEnd, + boolean GC_UNUSED1, + boolean GC_UNUSED2, + boolean GC_UNUSED3, + Materials aPrimary) { + super(aName, GregTech_API.sWorldgenList, aDefault); + this.mOverworld = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Overworld", aOverworld); + this.mNether = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Nether", aNether); + this.mEnd = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "TheEnd", aEnd); + this.mMinY = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "MinHeight", aMinY)); + this.mMaxY = ((short) Math.max( + this.mMinY + 1, + GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "MaxHeight", aMaxY))); + this.mAmount = ((short) + Math.max(1, GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Amount", aAmount))); + this.mMeta = ((short) + GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Ore", aPrimary.mMetaItemSubID)); + this.mBiome = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "BiomeName", "None"); + sList.add(this); } - - @Override - public boolean executeWorldgen(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { + @Override + public boolean executeWorldgen( + World aWorld, + Random aRandom, + String aBiome, + int aDimensionType, + int aChunkX, + int aChunkZ, + IChunkProvider aChunkGenerator, + IChunkProvider aChunkProvider) { if (!this.mBiome.equals("None") && !(this.mBiome.equals(aBiome))) { - return false; //Not the correct biome for ore mix + return false; // Not the correct biome for ore mix } - if (!isGenerationAllowed(aWorld, aDimensionType, ((aDimensionType == -1) && (this.mNether)) || ((aDimensionType == 0) && (this.mOverworld)) || ((aDimensionType == 1) && (this.mEnd)) ? aDimensionType : aDimensionType ^ 0xFFFFFFFF)) { + if (!isGenerationAllowed( + aWorld, + aDimensionType, + ((aDimensionType == -1) && (this.mNether)) + || ((aDimensionType == 0) && (this.mOverworld)) + || ((aDimensionType == 1) && (this.mEnd)) + ? aDimensionType + : aDimensionType ^ 0xFFFFFFFF)) { return false; } - int count=0; + int count = 0; // For optimal performance, this should be done upstream. Meh String tDimensionName = aWorld.provider.getDimensionName(); boolean isUnderdark = tDimensionName.equals("Underdark"); if (this.mMeta > 0) { int j = Math.max(1, this.mAmount / 2 + aRandom.nextInt(this.mAmount) / 2); - for ( int i = 0; i < j; i++) { - GT_TileEntity_Ores.setOreBlock(aWorld, aChunkX + 8 + aRandom.nextInt(16), this.mMinY + aRandom.nextInt(Math.max(1, this.mMaxY - this.mMinY)), aChunkZ + 8 + aRandom.nextInt(16), this.mMeta, true, isUnderdark); + for (int i = 0; i < j; i++) { + GT_TileEntity_Ores.setOreBlock( + aWorld, + aChunkX + 8 + aRandom.nextInt(16), + this.mMinY + aRandom.nextInt(Math.max(1, this.mMaxY - this.mMinY)), + aChunkZ + 8 + aRandom.nextInt(16), + this.mMeta, + true, + isUnderdark); count++; } } - if(debugSmallOres){ - GT_Log.out.println( - "Small Ore:" + this.mWorldGenName + - " @ dim="+aDimensionType+ - " mX="+aChunkX/16+ - " mZ="+aChunkZ/16+ - " ore="+count - ); + if (debugSmallOres) { + GT_Log.out.println("Small Ore:" + this.mWorldGenName + " @ dim=" + + aDimensionType + " mX=" + + aChunkX / 16 + " mZ=" + + aChunkZ / 16 + " ore=" + + count); } return true; } diff --git a/src/main/java/gregtech/common/GT_Worldgen_Stone.java b/src/main/java/gregtech/common/GT_Worldgen_Stone.java index d4992c3c16..5ea16eae89 100644 --- a/src/main/java/gregtech/common/GT_Worldgen_Stone.java +++ b/src/main/java/gregtech/common/GT_Worldgen_Stone.java @@ -1,91 +1,133 @@ package gregtech.common; +import static gregtech.api.enums.GT_Values.debugStones; + import gregtech.api.GregTech_API; import gregtech.api.objects.XSTR; import gregtech.api.util.GT_Log; import gregtech.api.world.GT_Worldgen_Ore; import gregtech.common.blocks.GT_Block_Ores_Abstract; import gregtech.common.blocks.GT_TileEntity_Ores; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Hashtable; +import java.util.Random; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Hashtable; -import java.util.Random; - -import static gregtech.api.enums.GT_Values.debugStones; - public class GT_Worldgen_Stone extends GT_Worldgen_Ore { - static final double sizeConversion[] = { 1, 1, 1.333333, 1.333333, 2, 2, 2, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }; // Bias the sizes towards skinnier boulders, ie more "shafts" than dikes or sills. + static final double sizeConversion[] = {1, 1, 1.333333, 1.333333, 2, 2, 2, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 + }; // Bias the sizes towards skinnier boulders, ie more "shafts" than dikes or sills. public Hashtable<Long, StoneSeeds> validStoneSeeds = new Hashtable(1024); class StoneSeeds { public boolean mExists; - StoneSeeds( boolean exists ) { + StoneSeeds(boolean exists) { mExists = exists; } - }; + } + ; class ValidSeeds { public int mX; public int mZ; - ValidSeeds( int x, int z) { + + ValidSeeds(int x, int z) { this.mX = x; this.mZ = z; } - }; - public GT_Worldgen_Stone(String aName, boolean aDefault, Block aBlock, int aBlockMeta, int aDimensionType, int aAmount, int aSize, int aProbability, int aMinY, int aMaxY, Collection<String> aBiomeList, boolean aAllowToGenerateinVoid) { - super(aName, aDefault, aBlock, aBlockMeta, aDimensionType, aAmount, aSize, aProbability, aMinY, aMaxY, aBiomeList, aAllowToGenerateinVoid); + } + ; + + public GT_Worldgen_Stone( + String aName, + boolean aDefault, + Block aBlock, + int aBlockMeta, + int aDimensionType, + int aAmount, + int aSize, + int aProbability, + int aMinY, + int aMaxY, + Collection<String> aBiomeList, + boolean aAllowToGenerateinVoid) { + super( + aName, + aDefault, + aBlock, + aBlockMeta, + aDimensionType, + aAmount, + aSize, + aProbability, + aMinY, + aMaxY, + aBiomeList, + aAllowToGenerateinVoid); } @Override - public boolean executeWorldgen(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { + public boolean executeWorldgen( + World aWorld, + Random aRandom, + String aBiome, + int aDimensionType, + int aChunkX, + int aChunkZ, + IChunkProvider aChunkGenerator, + IChunkProvider aChunkProvider) { XSTR stoneRNG = new XSTR(); ArrayList<ValidSeeds> stones = new ArrayList(); - - if ( !isGenerationAllowed(aWorld, aDimensionType, this.mDimensionType)) { + + if (!isGenerationAllowed(aWorld, aDimensionType, this.mDimensionType)) { return false; } - if ( !(this.mBiomeList.isEmpty() || this.mBiomeList.contains(aBiome)) ) { + if (!(this.mBiomeList.isEmpty() || this.mBiomeList.contains(aBiome))) { return false; } - // I think the real size of the balls is mSize/8, but the original code was difficult to understand. - // Overall there will be less GT stones since they aren't spheres any more. /16 since this code uses it as a radius. - double realSize = mSize/16; - int windowWidth = ((int)realSize)/16 + 1; // Width of chunks to check for a potential stoneseed + // I think the real size of the balls is mSize/8, but the original code was difficult to understand. + // Overall there will be less GT stones since they aren't spheres any more. /16 since this code uses it as a + // radius. + double realSize = mSize / 16; + int windowWidth = ((int) realSize) / 16 + 1; // Width of chunks to check for a potential stoneseed // Check stone seeds to see if they have been added - for( int x = aChunkX/16 - windowWidth; x < (aChunkX/16 + windowWidth + 1); x++ ) { - for( int z = aChunkZ/16 - windowWidth; z < (aChunkZ/16 + windowWidth + 1); z++ ) { - long hash = ((long)((aWorld.provider.dimensionId & 0xffL)<<56) |( ((long)x & 0x000000000fffffffL) << 28) | ( (long)z & 0x000000000fffffffL )); - if( !validStoneSeeds.containsKey(hash) ) { + for (int x = aChunkX / 16 - windowWidth; x < (aChunkX / 16 + windowWidth + 1); x++) { + for (int z = aChunkZ / 16 - windowWidth; z < (aChunkZ / 16 + windowWidth + 1); z++) { + long hash = ((long) ((aWorld.provider.dimensionId & 0xffL) << 56) + | (((long) x & 0x000000000fffffffL) << 28) + | ((long) z & 0x000000000fffffffL)); + if (!validStoneSeeds.containsKey(hash)) { // Determine if RNG says to add stone at this chunk - stoneRNG.setSeed((long)aWorld.getSeed() ^ hash + Math.abs(mBlockMeta) + Math.abs(mSize) + ((GregTech_API.sBlockGranites==mBlock)?(32768):(0))); //Don't judge me. Want different values for different block types - if ( (this.mProbability <= 1) || (stoneRNG.nextInt(this.mProbability) == 0) ) { + stoneRNG.setSeed((long) aWorld.getSeed() + ^ hash + + Math.abs(mBlockMeta) + + Math.abs(mSize) + + ((GregTech_API.sBlockGranites == mBlock) + ? (32768) + : (0))); // Don't judge me. Want different values for different block types + if ((this.mProbability <= 1) || (stoneRNG.nextInt(this.mProbability) == 0)) { // Add stone at this chunk - validStoneSeeds.put( hash, new StoneSeeds(true) ); + validStoneSeeds.put(hash, new StoneSeeds(true)); // Add to generation list - stones.add( new ValidSeeds(x,z) ); - if (debugStones) GT_Log.out.println( - "New stoneseed="+mWorldGenName+ - " x="+x+ - " z="+z+ - " realSize="+realSize - ); + stones.add(new ValidSeeds(x, z)); + if (debugStones) + GT_Log.out.println( + "New stoneseed=" + mWorldGenName + " x=" + x + " z=" + z + " realSize=" + realSize); } else { - validStoneSeeds.put( hash, new StoneSeeds(false) ); + validStoneSeeds.put(hash, new StoneSeeds(false)); } } else { // This chunk has already been checked, check to see if a boulder exists here - if( validStoneSeeds.get(hash).mExists ) { + if (validStoneSeeds.get(hash).mExists) { // Add to generation list - stones.add( new ValidSeeds(x,z) ); + stones.add(new ValidSeeds(x, z)); } } } @@ -96,101 +138,115 @@ public class GT_Worldgen_Stone extends GT_Worldgen_Ore { result = false; } // Now process each oreseed vs this requested chunk - for( ; stones.size() != 0; stones.remove(0) ) { - int x = stones.get(0).mX*16; - int z = stones.get(0).mZ*16; - - stoneRNG.setSeed((long)aWorld.getSeed() ^ ((long)((aWorld.provider.dimensionId & 0xffL)<<56) |( ((long)x & 0x000000000fffffffL)<< 28) | ( (long)z & 0x000000000fffffffL )) + Math.abs(mBlockMeta) + Math.abs(mSize) + ((GregTech_API.sBlockGranites==mBlock)?(32768):(0))); //Don't judge me - for (int i = 0; i < this.mAmount; i++) { // Not sure why you would want more than one in a chunk! Left alone though. - // Locate the stoneseed XYZ. Original code would request an isAir at the seed location, causing a chunk generation request. - // To reduce potential worldgen cascade, we just always try to place a ball and use the check inside the for loop to prevent + for (; stones.size() != 0; stones.remove(0)) { + int x = stones.get(0).mX * 16; + int z = stones.get(0).mZ * 16; + + stoneRNG.setSeed((long) aWorld.getSeed() + ^ ((long) ((aWorld.provider.dimensionId & 0xffL) << 56) + | (((long) x & 0x000000000fffffffL) << 28) + | ((long) z & 0x000000000fffffffL)) + + Math.abs(mBlockMeta) + + Math.abs(mSize) + + ((GregTech_API.sBlockGranites == mBlock) ? (32768) : (0))); // Don't judge me + for (int i = 0; + i < this.mAmount; + i++) { // Not sure why you would want more than one in a chunk! Left alone though. + // Locate the stoneseed XYZ. Original code would request an isAir at the seed location, causing a chunk + // generation request. + // To reduce potential worldgen cascade, we just always try to place a ball and use the check inside the + // for loop to prevent // placement instead. int tX = x + stoneRNG.nextInt(16); int tY = mMinY + stoneRNG.nextInt(mMaxY - mMinY); int tZ = z + stoneRNG.nextInt(16); - //Determine the XYZ sizes of the stoneseed + // Determine the XYZ sizes of the stoneseed double xSize = sizeConversion[stoneRNG.nextInt(sizeConversion.length)]; - double ySize = sizeConversion[stoneRNG.nextInt(sizeConversion.length)/2]; // Skew the ySize towards the larger sizes, more long skinny pipes + double ySize = sizeConversion[ + stoneRNG.nextInt(sizeConversion.length) + / 2]; // Skew the ySize towards the larger sizes, more long skinny pipes double zSize = sizeConversion[stoneRNG.nextInt(sizeConversion.length)]; - //Equation for an ellipsoid centered around 0,0,0 + // Equation for an ellipsoid centered around 0,0,0 // Sx, Sy, and Sz are size controls (size = 1/S_) // 1 = full size, 1.333 = 75%, 2 = 50%, 4 = 25% // (x * Sx)^2 + (y * Sy)^2 + (z * sZ)^2 <= (mSize)^2 - - //So, we setup the intial boundaries to be the size of the boulder plus a block in each direction - int tMinX = tX-(int)(realSize/xSize-1.0); - int tMaxX = tX+(int)(realSize/xSize+2.0); - int tMinY = tY-(int)(realSize/ySize-1.0); - int tMaxY = tY+(int)(realSize/ySize+2.0); - int tMinZ = tZ-(int)(realSize/zSize-1.0); - int tMaxZ = tZ+(int)(realSize/zSize+2.0); + + // So, we setup the intial boundaries to be the size of the boulder plus a block in each direction + int tMinX = tX - (int) (realSize / xSize - 1.0); + int tMaxX = tX + (int) (realSize / xSize + 2.0); + int tMinY = tY - (int) (realSize / ySize - 1.0); + int tMaxY = tY + (int) (realSize / ySize + 2.0); + int tMinZ = tZ - (int) (realSize / zSize - 1.0); + int tMaxZ = tZ + (int) (realSize / zSize + 2.0); // If the (tY-ySize) of the stoneseed is air in the current chunk, mark the seed empty and move on. - if(aWorld.getBlock(aChunkX + 8, tMinY, aChunkZ + 8).isAir(aWorld, aChunkX + 8, tMinY, aChunkZ + 8)) { - if (debugStones) GT_Log.out.println( - mWorldGenName + - " tX=" + tX + - " tY=" + tY + - " tZ=" + tZ + - " realSize=" + realSize + - " xSize=" + realSize/xSize + - " ySize=" + realSize/ySize + - " zSize=" + realSize/zSize + - " tMinY=" + tMinY + - " tMaxY=" + tMaxY + - " - Skipped because first requesting chunk would not contain this stone" - ); - long hash = ((long)((aWorld.provider.dimensionId & 0xffL)<<56) |( ((long)x & 0x000000000fffffffL) << 28) | ( (long)z & 0x000000000fffffffL )); + if (aWorld.getBlock(aChunkX + 8, tMinY, aChunkZ + 8).isAir(aWorld, aChunkX + 8, tMinY, aChunkZ + 8)) { + if (debugStones) + GT_Log.out.println(mWorldGenName + " tX=" + + tX + " tY=" + + tY + " tZ=" + + tZ + " realSize=" + + realSize + " xSize=" + + realSize / xSize + " ySize=" + + realSize / ySize + " zSize=" + + realSize / zSize + " tMinY=" + + tMinY + " tMaxY=" + + tMaxY + " - Skipped because first requesting chunk would not contain this stone"); + long hash = ((long) ((aWorld.provider.dimensionId & 0xffL) << 56) + | (((long) x & 0x000000000fffffffL) << 28) + | ((long) z & 0x000000000fffffffL)); validStoneSeeds.remove(hash); - validStoneSeeds.put( hash, new StoneSeeds(false) ); + validStoneSeeds.put(hash, new StoneSeeds(false)); } - //Chop the boundaries by the parts that intersect with the current chunk - int wX = Math.max( tMinX, aChunkX + 8); - int eX = Math.min( tMaxX, aChunkX + 8 + 16 ); - - int sZ = Math.max( tMinZ, aChunkZ + 8); - int nZ = Math.min( tMaxZ, aChunkZ + 8 + 16 ); - - if (debugStones) GT_Log.out.println( - mWorldGenName + - " tX=" + tX + - " tY=" + tY + - " tZ=" + tZ + - " realSize=" + realSize + - " xSize=" + realSize/xSize + - " ySize=" + realSize/ySize + - " zSize=" + realSize/zSize + - " wX=" + wX + - " eX=" + eX + - " tMinY=" + tMinY + - " tMaxY=" + tMaxY + - " sZ=" + sZ + - " nZ=" + nZ - ); - - double rightHandSide = realSize*realSize + 1; //Precalc the right hand side - for( int iY = tMinY; iY < tMaxY; iY++) { // Do placement from the bottom up layer up. Maybe better on cache usage? - double yCalc = ( (double)(iY-tY)*ySize ); + // Chop the boundaries by the parts that intersect with the current chunk + int wX = Math.max(tMinX, aChunkX + 8); + int eX = Math.min(tMaxX, aChunkX + 8 + 16); + + int sZ = Math.max(tMinZ, aChunkZ + 8); + int nZ = Math.min(tMaxZ, aChunkZ + 8 + 16); + + if (debugStones) + GT_Log.out.println(mWorldGenName + " tX=" + + tX + " tY=" + + tY + " tZ=" + + tZ + " realSize=" + + realSize + " xSize=" + + realSize / xSize + " ySize=" + + realSize / ySize + " zSize=" + + realSize / zSize + " wX=" + + wX + " eX=" + + eX + " tMinY=" + + tMinY + " tMaxY=" + + tMaxY + " sZ=" + + sZ + " nZ=" + + nZ); + + double rightHandSide = realSize * realSize + 1; // Precalc the right hand side + for (int iY = tMinY; + iY < tMaxY; + iY++) { // Do placement from the bottom up layer up. Maybe better on cache usage? + double yCalc = ((double) (iY - tY) * ySize); yCalc = yCalc * yCalc; // (y*Sy)^2 double leftHandSize = yCalc; - if( leftHandSize > rightHandSide ) { + if (leftHandSize > rightHandSide) { continue; // If Y alone is larger than the RHS, skip the rest of the loops } - for( int iX = wX; iX < eX; iX++) { - double xCalc = ( (double)(iX-tX)*xSize ); + for (int iX = wX; iX < eX; iX++) { + double xCalc = ((double) (iX - tX) * xSize); xCalc = xCalc * xCalc; leftHandSize = yCalc + xCalc; - if( leftHandSize > rightHandSide ) { // Again, if X and Y is larger than the RHS, skip to the next value + if (leftHandSize + > rightHandSide) { // Again, if X and Y is larger than the RHS, skip to the next value continue; } - for( int iZ = sZ; iZ < nZ; iZ++ ) { - double zCalc = ( (double)(iZ-tZ)*zSize ); + for (int iZ = sZ; iZ < nZ; iZ++) { + double zCalc = ((double) (iZ - tZ) * zSize); zCalc = zCalc * zCalc; leftHandSize = zCalc + xCalc + yCalc; - if( leftHandSize > rightHandSide ) { + if (leftHandSize > rightHandSide) { continue; } else { // Yay! We can actually place a block now. (this part copied from original code) @@ -201,9 +257,26 @@ public class GT_Worldgen_Stone extends GT_Worldgen_Ore { if (tTargetedBlock != GregTech_API.sBlockOres1) { ((GT_TileEntity_Ores) tTileEntity).convertOreBlock(aWorld, iX, iY, iZ); } - ((GT_TileEntity_Ores)tTileEntity).overrideOreBlockMaterial(this.mBlock, (byte) this.mBlockMeta); + ((GT_TileEntity_Ores) tTileEntity) + .overrideOreBlockMaterial(this.mBlock, (byte) this.mBlockMeta); } - } else if (((this.mAllowToGenerateinVoid) && (aWorld.getBlock(iX, iY, iZ).isAir(aWorld, iX, iY, iZ))) || ((tTargetedBlock != null) && ((tTargetedBlock.isReplaceableOreGen(aWorld, iX, iY, iZ, Blocks.stone)) || (tTargetedBlock.isReplaceableOreGen(aWorld, iX, iY, iZ, Blocks.stained_hardened_clay)) || (tTargetedBlock.isReplaceableOreGen(aWorld, iX, iY, iZ, Blocks.cobblestone)) || (tTargetedBlock.isReplaceableOreGen(aWorld, iX, iY, iZ, Blocks.end_stone)) || (tTargetedBlock.isReplaceableOreGen(aWorld, iX, iY, iZ, Blocks.netherrack)) || (tTargetedBlock.isReplaceableOreGen(aWorld, iX, iY, iZ, GregTech_API.sBlockGranites)) || (tTargetedBlock.isReplaceableOreGen(aWorld, iX, iY, iZ, GregTech_API.sBlockStones))))) { + } else if (((this.mAllowToGenerateinVoid) + && (aWorld.getBlock(iX, iY, iZ).isAir(aWorld, iX, iY, iZ))) + || ((tTargetedBlock != null) + && ((tTargetedBlock.isReplaceableOreGen( + aWorld, iX, iY, iZ, Blocks.stone)) + || (tTargetedBlock.isReplaceableOreGen( + aWorld, iX, iY, iZ, Blocks.stained_hardened_clay)) + || (tTargetedBlock.isReplaceableOreGen( + aWorld, iX, iY, iZ, Blocks.cobblestone)) + || (tTargetedBlock.isReplaceableOreGen( + aWorld, iX, iY, iZ, Blocks.end_stone)) + || (tTargetedBlock.isReplaceableOreGen( + aWorld, iX, iY, iZ, Blocks.netherrack)) + || (tTargetedBlock.isReplaceableOreGen( + aWorld, iX, iY, iZ, GregTech_API.sBlockGranites)) + || (tTargetedBlock.isReplaceableOreGen( + aWorld, iX, iY, iZ, GregTech_API.sBlockStones))))) { aWorld.setBlock(iX, iY, iZ, this.mBlock, this.mBlockMeta, 0); } } diff --git a/src/main/java/gregtech/common/GT_Worldgenerator.java b/src/main/java/gregtech/common/GT_Worldgenerator.java index aa6dfa2a41..fe02ed010c 100644 --- a/src/main/java/gregtech/common/GT_Worldgenerator.java +++ b/src/main/java/gregtech/common/GT_Worldgenerator.java @@ -1,5 +1,11 @@ package gregtech.common; +import static gregtech.api.enums.GT_Values.debugOrevein; +import static gregtech.api.enums.GT_Values.debugWorldGen; +import static gregtech.api.enums.GT_Values.oreveinAttempts; +import static gregtech.api.enums.GT_Values.oreveinMaxPlacementAttempts; +import static gregtech.api.enums.GT_Values.oreveinPercentage; + import cpw.mods.fml.common.IWorldGenerator; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.GregTech_API; @@ -8,23 +14,16 @@ import gregtech.api.objects.XSTR; import gregtech.api.util.GT_Log; import gregtech.api.world.GT_Worldgen; import gregtech.common.blocks.GT_TileEntity_Ores; -import net.minecraft.init.Blocks; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import net.minecraft.world.chunk.Chunk; -import net.minecraft.world.chunk.IChunkProvider; - import java.util.ArrayList; import java.util.HashSet; import java.util.Hashtable; import java.util.List; import java.util.Random; - -import static gregtech.api.enums.GT_Values.debugOrevein; -import static gregtech.api.enums.GT_Values.debugWorldGen; -import static gregtech.api.enums.GT_Values.oreveinAttempts; -import static gregtech.api.enums.GT_Values.oreveinMaxPlacementAttempts; -import static gregtech.api.enums.GT_Values.oreveinPercentage; +import net.minecraft.init.Blocks; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.IChunkProvider; public class GT_Worldgenerator implements IWorldGenerator { private static int mEndAsteroidProbability = 300; @@ -34,13 +33,27 @@ public class GT_Worldgenerator implements IWorldGenerator { private static boolean endAsteroids = true; public static List<Runnable> mList = new ArrayList(); public static HashSet<Long> ProcChunks = new HashSet<Long>(); - // This is probably not going to work. Trying to create a fake orevein to put into hashtable when there will be no ores in a vein. - public static GT_Worldgen_GT_Ore_Layer noOresInVein = new GT_Worldgen_GT_Ore_Layer( "NoOresInVein", false, 0, 255, 0, 255, 16, false, false, false, Materials.Aluminium, Materials.Aluminium, Materials.Aluminium, Materials.Aluminium); + // This is probably not going to work. Trying to create a fake orevein to put into hashtable when there will be no + // ores in a vein. + public static GT_Worldgen_GT_Ore_Layer noOresInVein = new GT_Worldgen_GT_Ore_Layer( + "NoOresInVein", + false, + 0, + 255, + 0, + 255, + 16, + false, + false, + false, + Materials.Aluminium, + Materials.Aluminium, + Materials.Aluminium, + Materials.Aluminium); public static Hashtable<Long, GT_Worldgen_GT_Ore_Layer> validOreveins = new Hashtable(1024); public boolean mIsGenerating = false; public static final Object listLock = new Object(); - public GT_Worldgenerator() { endAsteroids = GregTech_API.sWorldgenFile.get("endasteroids", "GenerateAsteroids", true); endMinSize = GregTech_API.sWorldgenFile.get("endasteroids", "AsteroidMinSize", 50); @@ -48,42 +61,51 @@ public class GT_Worldgenerator implements IWorldGenerator { mEndAsteroidProbability = GregTech_API.sWorldgenFile.get("endasteroids", "AsteroidProbability", 300); GameRegistry.registerWorldGenerator(this, 1073741823); if (debugWorldGen) { - GT_Log.out.println( - "GT_Worldgenerator created" - ); + GT_Log.out.println("GT_Worldgenerator created"); } } @Override - public void generate(Random aRandom, int aX, int aZ, World aWorld, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { - synchronized (listLock) - { - mList.add(new WorldGenContainer(new XSTR(Math.abs(aRandom.nextInt()) +1), aX, aZ, aWorld.provider.dimensionId, aWorld, aChunkGenerator, aChunkProvider, aWorld.getBiomeGenForCoords(aX * 16 + 8, aZ * 16 + 8).biomeName)); - if (debugWorldGen) GT_Log.out.println( - "ADD WorldSeed:"+aWorld.getSeed() + - " DimId" + aWorld.provider.dimensionId + - " chunk x:" + aX + - " z:" + aZ + - " SIZE: " + mList.size() - ); + public void generate( + Random aRandom, + int aX, + int aZ, + World aWorld, + IChunkProvider aChunkGenerator, + IChunkProvider aChunkProvider) { + synchronized (listLock) { + mList.add(new WorldGenContainer( + new XSTR(Math.abs(aRandom.nextInt()) + 1), + aX, + aZ, + aWorld.provider.dimensionId, + aWorld, + aChunkGenerator, + aChunkProvider, + aWorld.getBiomeGenForCoords(aX * 16 + 8, aZ * 16 + 8).biomeName)); + if (debugWorldGen) + GT_Log.out.println("ADD WorldSeed:" + aWorld.getSeed() + " DimId" + + aWorld.provider.dimensionId + " chunk x:" + + aX + " z:" + + aZ + " SIZE: " + + mList.size()); } if (!this.mIsGenerating) { this.mIsGenerating = true; - int mList_sS= mList.size(); - mList_sS = Math.min(mList_sS, 5); // Run a maximum of 5 chunks at a time through worldgen. Extra chunks get done later. + int mList_sS = mList.size(); + mList_sS = Math.min( + mList_sS, 5); // Run a maximum of 5 chunks at a time through worldgen. Extra chunks get done later. for (int i = 0; i < mList_sS; i++) { WorldGenContainer toRun = (WorldGenContainer) mList.get(0); - if (debugWorldGen) GT_Log.out.println( - "RUN WorldSeed:"+aWorld.getSeed()+ - " DimId" + aWorld.provider.dimensionId + - " chunk x:" + toRun.mX + - " z:" + toRun.mZ + - " SIZE: " + mList.size() + - " i: " + i - ); - synchronized (listLock) - { + if (debugWorldGen) + GT_Log.out.println("RUN WorldSeed:" + aWorld.getSeed() + " DimId" + + aWorld.provider.dimensionId + " chunk x:" + + toRun.mX + " z:" + + toRun.mZ + " SIZE: " + + mList.size() + " i: " + + i); + synchronized (listLock) { mList.remove(0); } toRun.run(); @@ -92,8 +114,7 @@ public class GT_Worldgenerator implements IWorldGenerator { } } - public static class WorldGenContainer - implements Runnable { + public static class WorldGenContainer implements Runnable { public final Random mRandom; public final int mX; public final int mZ; @@ -105,12 +126,12 @@ public class GT_Worldgenerator implements IWorldGenerator { // Used for outputting orevein weights and bins // static int test=0; - // Local class to track which orevein seeds must be checked when doing chunkified worldgen class NearbySeeds { public int mX; public int mZ; - NearbySeeds( int x, int z) { + + NearbySeeds(int x, int z) { this.mX = x; this.mZ = z; } @@ -119,7 +140,8 @@ public class GT_Worldgenerator implements IWorldGenerator { public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof GT_Worldgenerator.WorldGenContainer.NearbySeeds)) return false; - GT_Worldgenerator.WorldGenContainer.NearbySeeds that = (GT_Worldgenerator.WorldGenContainer.NearbySeeds) o; + GT_Worldgenerator.WorldGenContainer.NearbySeeds that = + (GT_Worldgenerator.WorldGenContainer.NearbySeeds) o; if (this.mX != that.mX) return false; return this.mZ == that.mZ; } @@ -130,12 +152,21 @@ public class GT_Worldgenerator implements IWorldGenerator { result = 31 * result + this.mZ; return result; } - }; + } + ; public static ArrayList<GT_Worldgenerator.WorldGenContainer.NearbySeeds> seedList = new ArrayList(); // aX and aZ are now the by-chunk X and Z for the chunk of interest - public WorldGenContainer(Random aRandom, int aX, int aZ, int aDimensionType, World aWorld, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider, String aBiome) { + public WorldGenContainer( + Random aRandom, + int aX, + int aZ, + int aDimensionType, + World aWorld, + IChunkProvider aChunkGenerator, + IChunkProvider aChunkProvider, + String aBiome) { this.mRandom = aRandom; this.mX = aX; this.mZ = aZ; @@ -170,31 +201,44 @@ public class GT_Worldgenerator implements IWorldGenerator { // in the dimension. For example veins that range above and below the average height // will be less, and veins that are completely above the average height will be much less. - public void worldGenFindVein( int oreseedX, int oreseedZ) { + public void worldGenFindVein(int oreseedX, int oreseedZ) { // Explanation of oreveinseed implementation. - // (long)this.mWorld.getSeed()<<16) Deep Dark does two oregen passes, one with getSeed set to +1 the original world seed. This pushes that +1 off the low bits of oreseedZ, so that the hashes are far apart for the two passes. - // ((this.mWorld.provider.dimensionId & 0xffL)<<56) Puts the dimension in the top bits of the hash, to make sure to get unique hashes per dimension - // ((long)oreseedX & 0x000000000fffffffL) << 28) Puts the chunk X in the bits 29-55. Cuts off the top few bits of the chunk so we have bits for dimension. - // ( (long)oreseedZ & 0x000000000fffffffL )) Puts the chunk Z in the bits 0-27. Cuts off the top few bits of the chunk so we have bits for dimension. - long oreveinSeed = ((long)this.mWorld.getSeed()<<16) ^ ((long)((this.mWorld.provider.dimensionId & 0xffL)<<56) |( ((long)oreseedX & 0x000000000fffffffL) << 28) | ( (long)oreseedZ & 0x000000000fffffffL )); // Use an RNG that is identical every time it is called for this oreseed. - XSTR oreveinRNG = new XSTR( oreveinSeed ); + // (long)this.mWorld.getSeed()<<16) Deep Dark does two oregen passes, one with getSeed set to +1 the + // original world seed. This pushes that +1 off the low bits of oreseedZ, so that the hashes are far apart + // for the two passes. + // ((this.mWorld.provider.dimensionId & 0xffL)<<56) Puts the dimension in the top bits of the hash, to + // make sure to get unique hashes per dimension + // ((long)oreseedX & 0x000000000fffffffL) << 28) Puts the chunk X in the bits 29-55. Cuts off the top few + // bits of the chunk so we have bits for dimension. + // ( (long)oreseedZ & 0x000000000fffffffL )) Puts the chunk Z in the bits 0-27. Cuts off the top few bits + // of the chunk so we have bits for dimension. + long oreveinSeed = ((long) this.mWorld.getSeed() << 16) + ^ ((long) ((this.mWorld.provider.dimensionId & 0xffL) << 56) + | (((long) oreseedX & 0x000000000fffffffL) << 28) + | ((long) oreseedZ + & 0x000000000fffffffL)); // Use an RNG that is identical every time it is called for + // this oreseed. + XSTR oreveinRNG = new XSTR(oreveinSeed); int oreveinPercentageRoll = oreveinRNG.nextInt(100); // Roll the dice, see if we get an orevein here at all - int noOrePlacedCount=0; + int noOrePlacedCount = 0; String tDimensionName = ""; - if (debugOrevein) { tDimensionName = this.mWorld.provider.getDimensionName(); } + if (debugOrevein) { + tDimensionName = this.mWorld.provider.getDimensionName(); + } - if (debugOrevein) GT_Log.out.println( - " Finding oreveins for oreveinSeed="+ oreveinSeed + - " mX="+ this.mX + - " mZ="+ this.mZ + - " oreseedX="+ oreseedX + - " oreseedZ="+ oreseedZ + - " worldSeed="+this.mWorld.getSeed() - ); + if (debugOrevein) + GT_Log.out.println(" Finding oreveins for oreveinSeed=" + oreveinSeed + " mX=" + + this.mX + " mZ=" + + this.mZ + " oreseedX=" + + oreseedX + " oreseedZ=" + + oreseedZ + " worldSeed=" + + this.mWorld.getSeed()); // Search for a valid orevein for this dimension - if( !validOreveins.containsKey(oreveinSeed) ) { - if ( (oreveinPercentageRoll<oreveinPercentage) && (GT_Worldgen_GT_Ore_Layer.sWeight > 0) && (GT_Worldgen_GT_Ore_Layer.sList.size() > 0)) { + if (!validOreveins.containsKey(oreveinSeed)) { + if ((oreveinPercentageRoll < oreveinPercentage) + && (GT_Worldgen_GT_Ore_Layer.sWeight > 0) + && (GT_Worldgen_GT_Ore_Layer.sList.size() > 0)) { int placementAttempts = 0; boolean oreveinFound = false; int i; @@ -214,24 +258,41 @@ public class GT_Worldgenerator implements IWorldGenerator { } } */ - for( i = 0; (i < oreveinAttempts) && (!oreveinFound) && (placementAttempts<oreveinMaxPlacementAttempts); i++ ) { + for (i = 0; + (i < oreveinAttempts) + && (!oreveinFound) + && (placementAttempts < oreveinMaxPlacementAttempts); + i++) { int tRandomWeight = oreveinRNG.nextInt(GT_Worldgen_GT_Ore_Layer.sWeight); for (GT_Worldgen_GT_Ore_Layer tWorldGen : GT_Worldgen_GT_Ore_Layer.sList) { - tRandomWeight -= ( tWorldGen).mWeight; + tRandomWeight -= (tWorldGen).mWeight; if (tRandomWeight <= 0) { try { - // Adjust the seed so that this layer has a series of unique random numbers. Otherwise multiple attempts at this same oreseed will get the same offset and X/Z values. If an orevein failed, any orevein with the - // same minimum heights would fail as well. This prevents that, giving each orevein a unique height each pass through here. - int placementResult = tWorldGen.executeWorldgenChunkified(this.mWorld, new XSTR( oreveinSeed ^ (tWorldGen.mPrimaryMeta)), this.mBiome, this.mDimensionType, this.mX*16, this.mZ*16, oreseedX*16, oreseedZ*16, this.mChunkGenerator, this.mChunkProvider); - switch(placementResult) { + // Adjust the seed so that this layer has a series of unique random numbers. + // Otherwise multiple attempts at this same oreseed will get the same offset and X/Z + // values. If an orevein failed, any orevein with the + // same minimum heights would fail as well. This prevents that, giving each orevein + // a unique height each pass through here. + int placementResult = tWorldGen.executeWorldgenChunkified( + this.mWorld, + new XSTR(oreveinSeed ^ (tWorldGen.mPrimaryMeta)), + this.mBiome, + this.mDimensionType, + this.mX * 16, + this.mZ * 16, + oreseedX * 16, + oreseedZ * 16, + this.mChunkGenerator, + this.mChunkProvider); + switch (placementResult) { case GT_Worldgen_GT_Ore_Layer.ORE_PLACED: - if (debugOrevein) GT_Log.out.println( - " Added near oreveinSeed=" + oreveinSeed + " " + - ( tWorldGen).mWorldGenName + - " tries at oremix=" + i + - " placementAttempts=" + placementAttempts + - " dimensionName=" + tDimensionName - ); + if (debugOrevein) + GT_Log.out.println(" Added near oreveinSeed=" + oreveinSeed + " " + + (tWorldGen).mWorldGenName + + " tries at oremix=" + + i + " placementAttempts=" + + placementAttempts + " dimensionName=" + + tDimensionName); validOreveins.put(oreveinSeed, tWorldGen); oreveinFound = true; break; @@ -240,90 +301,92 @@ public class GT_Worldgenerator implements IWorldGenerator { // SHould do retry in this case until out of chances break; case GT_Worldgen_GT_Ore_Layer.NO_OVERLAP: - if (debugOrevein) GT_Log.out.println( - " Added far oreveinSeed=" + oreveinSeed + " " + - ( tWorldGen).mWorldGenName + - " tries at oremix=" + i + - " placementAttempts=" + placementAttempts + - " dimensionName=" + tDimensionName - ); + if (debugOrevein) + GT_Log.out.println(" Added far oreveinSeed=" + oreveinSeed + " " + + (tWorldGen).mWorldGenName + + " tries at oremix=" + + i + " placementAttempts=" + + placementAttempts + " dimensionName=" + + tDimensionName); validOreveins.put(oreveinSeed, tWorldGen); oreveinFound = true; break; case GT_Worldgen_GT_Ore_Layer.NO_OVERLAP_AIR_BLOCK: - if (debugOrevein) GT_Log.out.println( - " No overlap and air block in test spot=" + oreveinSeed + " " + - ( tWorldGen).mWorldGenName + - " tries at oremix=" + i + - " placementAttempts=" + placementAttempts + - " dimensionName=" + tDimensionName - ); + if (debugOrevein) + GT_Log.out.println(" No overlap and air block in test spot=" + + oreveinSeed + " " + (tWorldGen).mWorldGenName + + " tries at oremix=" + + i + " placementAttempts=" + + placementAttempts + " dimensionName=" + + tDimensionName); // SHould do retry in this case until out of chances placementAttempts++; break; } break; // Try the next orevein } catch (Throwable e) { - if (debugOrevein) GT_Log.out.println( - "Exception occurred on oreVein" + tWorldGen + - " oreveinSeed="+ oreveinSeed + - " mX="+ this.mX + - " mZ="+ this.mZ + - " oreseedX="+ oreseedX + - " oreseedZ="+ oreseedZ - ); + if (debugOrevein) + GT_Log.out.println("Exception occurred on oreVein" + tWorldGen + " oreveinSeed=" + + oreveinSeed + " mX=" + + this.mX + " mZ=" + + this.mZ + " oreseedX=" + + oreseedX + " oreseedZ=" + + oreseedZ); e.printStackTrace(GT_Log.err); } } } } // Only add an empty orevein if unable to place a vein at the oreseed chunk. - if ((!oreveinFound) && (this.mX == oreseedX) && (this.mZ == oreseedZ)){ - if (debugOrevein) GT_Log.out.println( - " Empty oreveinSeed="+ oreveinSeed + - " mX="+ this.mX + - " mZ="+ this.mZ + - " oreseedX="+ oreseedX + - " oreseedZ="+ oreseedZ + - " tries at oremix=" + i + - " placementAttempts=" + placementAttempts + - " dimensionName=" + tDimensionName - ); - validOreveins.put(oreveinSeed, noOresInVein ); + if ((!oreveinFound) && (this.mX == oreseedX) && (this.mZ == oreseedZ)) { + if (debugOrevein) + GT_Log.out.println(" Empty oreveinSeed=" + oreveinSeed + " mX=" + + this.mX + " mZ=" + + this.mZ + " oreseedX=" + + oreseedX + " oreseedZ=" + + oreseedZ + " tries at oremix=" + + i + " placementAttempts=" + + placementAttempts + " dimensionName=" + + tDimensionName); + validOreveins.put(oreveinSeed, noOresInVein); } - } else if(oreveinPercentageRoll >= oreveinPercentage) { - if (debugOrevein) GT_Log.out.println( - " Skipped oreveinSeed="+ oreveinSeed + - " mX="+ this.mX + - " mZ="+ this.mZ + - " oreseedX=" + oreseedX + - " oreseedZ=" + oreseedZ + - " RNG=" + oreveinPercentageRoll + - " %=" + oreveinPercentage+ - " dimensionName=" + tDimensionName - ); + } else if (oreveinPercentageRoll >= oreveinPercentage) { + if (debugOrevein) + GT_Log.out.println(" Skipped oreveinSeed=" + oreveinSeed + " mX=" + + this.mX + " mZ=" + + this.mZ + " oreseedX=" + + oreseedX + " oreseedZ=" + + oreseedZ + " RNG=" + + oreveinPercentageRoll + " %=" + + oreveinPercentage + " dimensionName=" + + tDimensionName); validOreveins.put(oreveinSeed, noOresInVein); } - }else { + } else { // oreseed is located in the previously processed table - if (debugOrevein) GT_Log.out.print( - " Valid oreveinSeed="+ oreveinSeed + - " validOreveins.size()=" + validOreveins.size() + " " - ); + if (debugOrevein) + GT_Log.out.print(" Valid oreveinSeed=" + oreveinSeed + " validOreveins.size()=" + + validOreveins.size() + " "); GT_Worldgen_GT_Ore_Layer tWorldGen = validOreveins.get(oreveinSeed); - oreveinRNG.setSeed(oreveinSeed ^ (tWorldGen.mPrimaryMeta)); // Reset RNG to only be based on oreseed X/Z and type of vein - int placementResult = tWorldGen.executeWorldgenChunkified(this.mWorld, oreveinRNG, this.mBiome, this.mDimensionType, this.mX*16, this.mZ*16, oreseedX*16, oreseedZ*16, this.mChunkGenerator, this.mChunkProvider); - switch( placementResult ) - { + oreveinRNG.setSeed(oreveinSeed + ^ (tWorldGen.mPrimaryMeta)); // Reset RNG to only be based on oreseed X/Z and type of vein + int placementResult = tWorldGen.executeWorldgenChunkified( + this.mWorld, + oreveinRNG, + this.mBiome, + this.mDimensionType, + this.mX * 16, + this.mZ * 16, + oreseedX * 16, + oreseedZ * 16, + this.mChunkGenerator, + this.mChunkProvider); + switch (placementResult) { case GT_Worldgen_GT_Ore_Layer.NO_ORE_IN_BOTTOM_LAYER: - if (debugOrevein) GT_Log.out.println( - " No ore in bottom layer" - ); + if (debugOrevein) GT_Log.out.println(" No ore in bottom layer"); break; case GT_Worldgen_GT_Ore_Layer.NO_OVERLAP: - if (debugOrevein) GT_Log.out.println( - " No overlap" - ); + if (debugOrevein) GT_Log.out.println(" No overlap"); } } } @@ -341,7 +404,15 @@ public class GT_Worldgenerator implements IWorldGenerator { "tWorldGen.mWorldGenName="+tWorldGen.mWorldGenName ); */ - tWorldGen.executeWorldgen(this.mWorld, this.mRandom, this.mBiome, this.mDimensionType, this.mX*16, this.mZ*16, this.mChunkGenerator, this.mChunkProvider); + tWorldGen.executeWorldgen( + this.mWorld, + this.mRandom, + this.mBiome, + this.mDimensionType, + this.mX * 16, + this.mZ * 16, + this.mChunkGenerator, + this.mChunkProvider); } } catch (Throwable e) { e.printStackTrace(GT_Log.err); @@ -350,48 +421,47 @@ public class GT_Worldgenerator implements IWorldGenerator { // Determine bounding box on how far out to check for oreveins affecting this chunk // For now, manually reducing oreveinMaxSize when not in the Underdark for performance - if(this.mWorld.provider.getDimensionName().equals("Underdark") ) { - oreveinMaxSize=32; // Leave Deep Dark/Underdark max oregen at 32, instead of 64 + if (this.mWorld.provider.getDimensionName().equals("Underdark")) { + oreveinMaxSize = 32; // Leave Deep Dark/Underdark max oregen at 32, instead of 64 } else { - oreveinMaxSize=32; + oreveinMaxSize = 32; } - int wXbox = this.mX - (oreveinMaxSize/16); - int eXbox = this.mX + (oreveinMaxSize/16 + 1); // Need to add 1 since it is compared using a < - int nZbox = this.mZ - (oreveinMaxSize/16); - int sZbox = this.mZ + (oreveinMaxSize/16 + 1); + int wXbox = this.mX - (oreveinMaxSize / 16); + int eXbox = this.mX + (oreveinMaxSize / 16 + 1); // Need to add 1 since it is compared using a < + int nZbox = this.mZ - (oreveinMaxSize / 16); + int sZbox = this.mZ + (oreveinMaxSize / 16 + 1); // Search for orevein seeds and add to the list; - for( int x = wXbox; x < eXbox; x++ ) { - for( int z = nZbox; z < sZbox; z++ ) { + for (int x = wXbox; x < eXbox; x++) { + for (int z = nZbox; z < sZbox; z++) { // Determine if this X/Z is an orevein seed - if ( ( (Math.abs(x)%3) == 1) && ( (Math.abs(z)%3) == 1 ) ) { - if (debugWorldGen) GT_Log.out.println( - "Adding seed x="+x+ - " z="+z - ); - seedList.add( new GT_Worldgenerator.WorldGenContainer.NearbySeeds(x,z) ); + if (((Math.abs(x) % 3) == 1) && ((Math.abs(z) % 3) == 1)) { + if (debugWorldGen) GT_Log.out.println("Adding seed x=" + x + " z=" + z); + seedList.add(new GT_Worldgenerator.WorldGenContainer.NearbySeeds(x, z)); } } } // Now process each oreseed vs this requested chunk - for( ; seedList.size() != 0; seedList.remove(0) ) { - if (debugWorldGen) GT_Log.out.println( - "Processing seed x="+seedList.get(0).mX+ - " z="+seedList.get(0).mZ - ); - worldGenFindVein( seedList.get(0).mX, seedList.get(0).mZ ); + for (; seedList.size() != 0; seedList.remove(0)) { + if (debugWorldGen) + GT_Log.out.println("Processing seed x=" + seedList.get(0).mX + " z=" + seedList.get(0).mZ); + worldGenFindVein(seedList.get(0).mX, seedList.get(0).mZ); } long oregenTime = System.nanoTime(); - //Asteroid Worldgen + // Asteroid Worldgen int tDimensionType = this.mWorld.provider.dimensionId; - //String tDimensionName = this.mWorld.provider.getDimensionName(); + // String tDimensionName = this.mWorld.provider.getDimensionName(); Random aRandom = new Random(); - //if (((tDimensionType == 1) && endAsteroids && ((mEndAsteroidProbability <= 1) || (aRandom.nextInt(mEndAsteroidProbability) == 0))) || ((tDimensionName.equals("Asteroids")) && gcAsteroids && ((mGCAsteroidProbability <= 1) || (aRandom.nextInt(mGCAsteroidProbability) == 0)))) { - if (((tDimensionType == 1) && endAsteroids && ((mEndAsteroidProbability <= 1) || (aRandom.nextInt(mEndAsteroidProbability) == 0)))) { + // if (((tDimensionType == 1) && endAsteroids && ((mEndAsteroidProbability <= 1) || + // (aRandom.nextInt(mEndAsteroidProbability) == 0))) || ((tDimensionName.equals("Asteroids")) && gcAsteroids + // && ((mGCAsteroidProbability <= 1) || (aRandom.nextInt(mGCAsteroidProbability) == 0)))) { + if (((tDimensionType == 1) + && endAsteroids + && ((mEndAsteroidProbability <= 1) || (aRandom.nextInt(mEndAsteroidProbability) == 0)))) { short primaryMeta = 0; short secondaryMeta = 0; short betweenMeta = 0; @@ -405,7 +475,8 @@ public class GT_Worldgenerator implements IWorldGenerator { tRandomWeight -= ((GT_Worldgen_GT_Ore_Layer) tWorldGen).mWeight; if (tRandomWeight <= 0) { try { - //if ((tWorldGen.mEndAsteroid && tDimensionType == 1) || (tWorldGen.mAsteroid && tDimensionType == -30)) { + // if ((tWorldGen.mEndAsteroid && tDimensionType == 1) || (tWorldGen.mAsteroid && + // tDimensionType == -30)) { if (tWorldGen.mEndAsteroid && tDimensionType == 1) { primaryMeta = tWorldGen.mPrimaryMeta; secondaryMeta = tWorldGen.mSecondaryMeta; @@ -421,13 +492,13 @@ public class GT_Worldgenerator implements IWorldGenerator { } } } - //if(GT_Values.D1)GT_FML_LOGGER.info("do asteroid gen: "+this.mX+" "+this.mZ); + // if(GT_Values.D1)GT_FML_LOGGER.info("do asteroid gen: "+this.mX+" "+this.mZ); int tX = mX * 16 + aRandom.nextInt(16); int tY = 50 + aRandom.nextInt(200 - 50); int tZ = mZ * 16 + aRandom.nextInt(16); if (tDimensionType == 1) { mSize = aRandom.nextInt((int) (endMaxSize - endMinSize)); - //} else if (tDimensionName.equals("Asteroids")) { + // } else if (tDimensionName.equals("Asteroids")) { // mSize = aRandom.nextInt((int) (gcMaxSize - gcMinSize)); } if ((mWorld.getBlock(tX, tY, tZ).isAir(mWorld, tX, tY, tZ))) { @@ -459,16 +530,22 @@ public class GT_Worldgenerator implements IWorldGenerator { if (xChance * xChance + yChance * yChance < 1.0D) { for (int eZ = tMinZ; eZ <= tMaxZ; eZ++) { double zChance = (eZ + 0.5D - zCenter) / (halfLength / 2.0D); - if ((xChance * xChance + yChance * yChance + zChance * zChance < 1.0D) && (mWorld.getBlock(tX, tY, tZ).isAir(mWorld, tX, tY, tZ))) { + if ((xChance * xChance + yChance * yChance + zChance * zChance < 1.0D) + && (mWorld.getBlock(tX, tY, tZ) + .isAir(mWorld, tX, tY, tZ))) { int ranOre = aRandom.nextInt(50); if (ranOre < 3) { - GT_TileEntity_Ores.setOreBlock(mWorld, eX, eY, eZ, primaryMeta, false); + GT_TileEntity_Ores.setOreBlock( + mWorld, eX, eY, eZ, primaryMeta, false); } else if (ranOre < 6) { - GT_TileEntity_Ores.setOreBlock(mWorld, eX, eY, eZ, secondaryMeta, false); + GT_TileEntity_Ores.setOreBlock( + mWorld, eX, eY, eZ, secondaryMeta, false); } else if (ranOre < 8) { - GT_TileEntity_Ores.setOreBlock(mWorld, eX, eY, eZ, betweenMeta, false); + GT_TileEntity_Ores.setOreBlock( + mWorld, eX, eY, eZ, betweenMeta, false); } else if (ranOre < 10) { - GT_TileEntity_Ores.setOreBlock(mWorld, eX, eY, eZ, sporadicMeta, false); + GT_TileEntity_Ores.setOreBlock( + mWorld, eX, eY, eZ, sporadicMeta, false); } else { mWorld.setBlock(eX, eY, eZ, Blocks.end_stone, 0, 0); } @@ -480,10 +557,8 @@ public class GT_Worldgenerator implements IWorldGenerator { } } } - } - Chunk tChunk = this.mWorld.getChunkFromBlockCoords(this.mX, this.mZ); if (tChunk != null) { tChunk.isModified = true; @@ -491,12 +566,9 @@ public class GT_Worldgenerator implements IWorldGenerator { long endTime = System.nanoTime(); long duration = (endTime - startTime); if (debugWorldGen) { - GT_Log.out.println( - " Oregen took " + (oregenTime-leftOverTime)+ - " Leftover gen took " + (leftOverTime - startTime) + - " Worldgen took " + duration + - " nanoseconds" - ); + GT_Log.out.println(" Oregen took " + (oregenTime - leftOverTime) + " Leftover gen took " + + (leftOverTime - startTime) + " Worldgen took " + + duration + " nanoseconds"); } } } diff --git a/src/main/java/gregtech/common/bees/GT_AlleleBeeSpecies.java b/src/main/java/gregtech/common/bees/GT_AlleleBeeSpecies.java index 41726b4fc5..8c8852c189 100644 --- a/src/main/java/gregtech/common/bees/GT_AlleleBeeSpecies.java +++ b/src/main/java/gregtech/common/bees/GT_AlleleBeeSpecies.java @@ -5,45 +5,53 @@ import forestry.api.apiculture.IAlleleBeeSpeciesCustom; import forestry.api.genetics.AlleleManager; import forestry.api.genetics.IClassification; import forestry.apiculture.genetics.alleles.AlleleBeeSpecies; +import java.awt.*; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; -import java.awt.*; - public class GT_AlleleBeeSpecies extends AlleleBeeSpecies { - public GT_AlleleBeeSpecies(String uid, - boolean dominant, - String unlocalizedName, - String authority, - String unlocalizedDescription, - IClassification branch, - String binomial, - Color primaryColor, - Color secondaryColor) { - super(uid, unlocalizedName, authority, unlocalizedDescription, dominant, branch, binomial, primaryColor.getRGB(), secondaryColor.getRGB()); + public GT_AlleleBeeSpecies( + String uid, + boolean dominant, + String unlocalizedName, + String authority, + String unlocalizedDescription, + IClassification branch, + String binomial, + Color primaryColor, + Color secondaryColor) { + super( + uid, + unlocalizedName, + authority, + unlocalizedDescription, + dominant, + branch, + binomial, + primaryColor.getRGB(), + secondaryColor.getRGB()); AlleleManager.alleleRegistry.registerAllele(this, EnumBeeChromosome.SPECIES); } @Override public IAlleleBeeSpeciesCustom addProduct(ItemStack product, Float chance) { if (product == null || product.getItem() == null) { - product=new ItemStack(Items.boat); + product = new ItemStack(Items.boat); } if (chance <= 0.0f || chance > 1.0f) { chance = 0.1f; } - return super.addProduct(product,chance); + return super.addProduct(product, chance); } @Override public IAlleleBeeSpeciesCustom addSpecialty(ItemStack specialty, Float chance) { if (specialty == null || specialty.getItem() == null) { - specialty=new ItemStack(Items.boat); + specialty = new ItemStack(Items.boat); } if (chance <= 0.0f || chance > 1.0f) { chance = 0.1f; } return super.addSpecialty(specialty, chance); } - } diff --git a/src/main/java/gregtech/common/bees/GT_AlleleHelper.java b/src/main/java/gregtech/common/bees/GT_AlleleHelper.java index 4a47bfa46e..46175730e9 100644 --- a/src/main/java/gregtech/common/bees/GT_AlleleHelper.java +++ b/src/main/java/gregtech/common/bees/GT_AlleleHelper.java @@ -10,12 +10,11 @@ import forestry.core.genetics.alleles.*; import forestry.core.utils.vect.IVect; import forestry.plugins.PluginManager; import gregtech.GT_Mod; -import org.apache.commons.lang3.reflect.FieldUtils; - import java.util.EnumMap; import java.util.HashMap; import java.util.Locale; import java.util.Map; +import org.apache.commons.lang3.reflect.FieldUtils; public class GT_AlleleHelper extends AlleleHelper { @@ -31,35 +30,28 @@ public class GT_AlleleHelper extends AlleleHelper { } if (PluginManager.Module.APICULTURE.isEnabled() || PluginManager.Module.ARBORICULTURE.isEnabled()) { - createAlleles(EnumAllele.Territory.class, - EnumBeeChromosome.TERRITORY, - EnumTreeChromosome.TERRITORY - ); + createAlleles(EnumAllele.Territory.class, EnumBeeChromosome.TERRITORY, EnumTreeChromosome.TERRITORY); - AlleleManager.alleleRegistry.registerDeprecatedAlleleReplacement("forestry.territoryDefault", get(EnumAllele.Territory.AVERAGE)); + AlleleManager.alleleRegistry.registerDeprecatedAlleleReplacement( + "forestry.territoryDefault", get(EnumAllele.Territory.AVERAGE)); } if (PluginManager.Module.APICULTURE.isEnabled() || PluginManager.Module.LEPIDOPTEROLOGY.isEnabled()) { - createAlleles(EnumAllele.Speed.class, - EnumBeeChromosome.SPEED, - EnumButterflyChromosome.SPEED - ); - createAlleles(EnumAllele.Lifespan.class, - EnumBeeChromosome.LIFESPAN, - EnumButterflyChromosome.LIFESPAN - ); - createAlleles(EnumAllele.Tolerance.class, + createAlleles(EnumAllele.Speed.class, EnumBeeChromosome.SPEED, EnumButterflyChromosome.SPEED); + createAlleles(EnumAllele.Lifespan.class, EnumBeeChromosome.LIFESPAN, EnumButterflyChromosome.LIFESPAN); + createAlleles( + EnumAllele.Tolerance.class, EnumBeeChromosome.TEMPERATURE_TOLERANCE, EnumBeeChromosome.HUMIDITY_TOLERANCE, EnumButterflyChromosome.TEMPERATURE_TOLERANCE, - EnumButterflyChromosome.HUMIDITY_TOLERANCE - ); - createAlleles(EnumAllele.Flowers.class, + EnumButterflyChromosome.HUMIDITY_TOLERANCE); + createAlleles( + EnumAllele.Flowers.class, EnumBeeChromosome.FLOWER_PROVIDER, - EnumButterflyChromosome.FLOWER_PROVIDER - ); + EnumButterflyChromosome.FLOWER_PROVIDER); - AlleleManager.alleleRegistry.registerDeprecatedAlleleReplacement("forestry.speedNorm", get(EnumAllele.Speed.NORMAL)); + AlleleManager.alleleRegistry.registerDeprecatedAlleleReplacement( + "forestry.speedNorm", get(EnumAllele.Speed.NORMAL)); } if (PluginManager.Module.ARBORICULTURE.isEnabled()) { @@ -70,18 +62,30 @@ public class GT_AlleleHelper extends AlleleHelper { createAlleles(EnumAllele.Maturation.class, EnumTreeChromosome.MATURATION); createAlleles(EnumAllele.Sappiness.class, EnumTreeChromosome.SAPPINESS); - AlleleManager.alleleRegistry.registerDeprecatedAlleleReplacement("forestry.heightMax10", get(EnumAllele.Height.AVERAGE)); - AlleleManager.alleleRegistry.registerDeprecatedAlleleReplacement("forestry.saplingsDefault", get(EnumAllele.Saplings.AVERAGE)); - AlleleManager.alleleRegistry.registerDeprecatedAlleleReplacement("forestry.saplingsDouble", get(EnumAllele.Saplings.HIGH)); - AlleleManager.alleleRegistry.registerDeprecatedAlleleReplacement("forestry.saplingsTriple", get(EnumAllele.Saplings.HIGHER)); - AlleleManager.alleleRegistry.registerDeprecatedAlleleReplacement("forestry.yieldDefault", get(EnumAllele.Yield.AVERAGE)); - AlleleManager.alleleRegistry.registerDeprecatedAlleleReplacement("forestry.maturitySlowest", get(EnumAllele.Maturation.SLOWEST)); - AlleleManager.alleleRegistry.registerDeprecatedAlleleReplacement("forestry.maturitySlower", get(EnumAllele.Maturation.SLOWER)); - AlleleManager.alleleRegistry.registerDeprecatedAlleleReplacement("forestry.maturitySlow", get(EnumAllele.Maturation.SLOW)); - AlleleManager.alleleRegistry.registerDeprecatedAlleleReplacement("forestry.maturityAverage", get(EnumAllele.Maturation.AVERAGE)); - AlleleManager.alleleRegistry.registerDeprecatedAlleleReplacement("forestry.maturityFast", get(EnumAllele.Maturation.FAST)); - AlleleManager.alleleRegistry.registerDeprecatedAlleleReplacement("forestry.maturityFaster", get(EnumAllele.Maturation.FASTER)); - AlleleManager.alleleRegistry.registerDeprecatedAlleleReplacement("forestry.maturityFastest", get(EnumAllele.Maturation.FASTEST)); + AlleleManager.alleleRegistry.registerDeprecatedAlleleReplacement( + "forestry.heightMax10", get(EnumAllele.Height.AVERAGE)); + AlleleManager.alleleRegistry.registerDeprecatedAlleleReplacement( + "forestry.saplingsDefault", get(EnumAllele.Saplings.AVERAGE)); + AlleleManager.alleleRegistry.registerDeprecatedAlleleReplacement( + "forestry.saplingsDouble", get(EnumAllele.Saplings.HIGH)); + AlleleManager.alleleRegistry.registerDeprecatedAlleleReplacement( + "forestry.saplingsTriple", get(EnumAllele.Saplings.HIGHER)); + AlleleManager.alleleRegistry.registerDeprecatedAlleleReplacement( + "forestry.yieldDefault", get(EnumAllele.Yield.AVERAGE)); + AlleleManager.alleleRegistry.registerDeprecatedAlleleReplacement( + "forestry.maturitySlowest", get(EnumAllele.Maturation.SLOWEST)); + AlleleManager.alleleRegistry.registerDeprecatedAlleleReplacement( + "forestry.maturitySlower", get(EnumAllele.Maturation.SLOWER)); + AlleleManager.alleleRegistry.registerDeprecatedAlleleReplacement( + "forestry.maturitySlow", get(EnumAllele.Maturation.SLOW)); + AlleleManager.alleleRegistry.registerDeprecatedAlleleReplacement( + "forestry.maturityAverage", get(EnumAllele.Maturation.AVERAGE)); + AlleleManager.alleleRegistry.registerDeprecatedAlleleReplacement( + "forestry.maturityFast", get(EnumAllele.Maturation.FAST)); + AlleleManager.alleleRegistry.registerDeprecatedAlleleReplacement( + "forestry.maturityFaster", get(EnumAllele.Maturation.FASTER)); + AlleleManager.alleleRegistry.registerDeprecatedAlleleReplacement( + "forestry.maturityFastest", get(EnumAllele.Maturation.FASTEST)); } if (PluginManager.Module.LEPIDOPTEROLOGY.isEnabled()) { @@ -91,11 +95,11 @@ public class GT_AlleleHelper extends AlleleHelper { Map<Integer, IAlleleInteger> integers = new HashMap<>(); for (int i = 1; i <= 10; i++) { IAlleleInteger alleleInteger = new AlleleInteger(modId, "i", i + "d", i, true); - AlleleManager.alleleRegistry.registerAllele(alleleInteger, + AlleleManager.alleleRegistry.registerAllele( + alleleInteger, EnumTreeChromosome.GIRTH, EnumButterflyChromosome.METABOLISM, - EnumButterflyChromosome.FERTILITY - ); + EnumButterflyChromosome.FERTILITY); integers.put(i, alleleInteger); } alleleMaps.put(Integer.class, integers); @@ -104,34 +108,31 @@ public class GT_AlleleHelper extends AlleleHelper { booleans.put(true, new AlleleBoolean(modId, "bool", true, false)); booleans.put(false, new AlleleBoolean(modId, "bool", false, false)); for (IAlleleBoolean alleleBoolean : booleans.values()) { - AlleleManager.alleleRegistry.registerAllele(alleleBoolean, + AlleleManager.alleleRegistry.registerAllele( + alleleBoolean, EnumBeeChromosome.NOCTURNAL, EnumBeeChromosome.TOLERANT_FLYER, EnumBeeChromosome.CAVE_DWELLING, EnumButterflyChromosome.NOCTURNAL, EnumButterflyChromosome.TOLERANT_FLYER, - EnumButterflyChromosome.FIRE_RESIST - ); + EnumButterflyChromosome.FIRE_RESIST); } alleleMaps.put(Boolean.class, booleans); } + @SuppressWarnings("unchecked") - public static void initialisation(){ + public static void initialisation() { GT_AlleleHelper helper = new GT_AlleleHelper(); try { - helper.alleleMaps = (Map<Class<?>, Map<?, ? extends IAllele>>) - FieldUtils.readField( - FieldUtils.getField(AlleleHelper.class,"alleleMaps",true), - AlleleHelper.instance, - true - ); + helper.alleleMaps = (Map<Class<?>, Map<?, ? extends IAllele>>) FieldUtils.readField( + FieldUtils.getField(AlleleHelper.class, "alleleMaps", true), AlleleHelper.instance, true); } catch (IllegalAccessException e) { e.printStackTrace(); } AlleleHelper.instance = helper; - //AlleleHelper.instance.init(); + // AlleleHelper.instance.init(); } @Override @@ -143,14 +144,15 @@ public class GT_AlleleHelper extends AlleleHelper { } if (!chromosomeType.getAlleleClass().isInstance(allele)) { - GT_Mod.GT_FML_LOGGER.info("chromosomeType is not an instance of allele!"+allele.getName()); + GT_Mod.GT_FML_LOGGER.info("chromosomeType is not an instance of allele!" + allele.getName()); return; } // uncomment this once all addon mods are using the allele registration with IChromosomeType // Collection<IChromosomeType> validTypes = AlleleManager.alleleRegistry.getChromosomeTypes(allele); // if (validTypes.size() > 0 && !validTypes.contains(chromosomeType)) { - // throw new IllegalArgumentException("Allele can't applied to this Chromosome type. Expected: " + validTypes + " Got: " + chromosomeType); + // throw new IllegalArgumentException("Allele can't applied to this Chromosome type. Expected: " + validTypes + // + " Got: " + chromosomeType); // } alleles[chromosomeType.ordinal()] = allele; @@ -213,7 +215,9 @@ public class GT_AlleleHelper extends AlleleHelper { } alleleMaps.put(enumClass, map); } - private static <K extends IAlleleValue<V>, V> IAllele createAllele(String category, K enumValue, IChromosomeType... types) { + + private static <K extends IAlleleValue<V>, V> IAllele createAllele( + String category, K enumValue, IChromosomeType... types) { V value = enumValue.getValue(); boolean isDominant = enumValue.isDominant(); String name = enumValue.toString().toLowerCase(Locale.ENGLISH); @@ -225,15 +229,18 @@ public class GT_AlleleHelper extends AlleleHelper { return AlleleManager.alleleFactory.createInteger(modId, category, name, (Integer) value, isDominant, types); } else if (IVect.class.isAssignableFrom(valueClass)) { IVect area = (IVect) value; - return AlleleManager.alleleFactory.createArea(modId, category, name, area.getX(), area.getY(), area.getZ(), isDominant, types); + return AlleleManager.alleleFactory.createArea( + modId, category, name, area.getX(), area.getY(), area.getZ(), isDominant, types); } else if (Boolean.class.isAssignableFrom(valueClass)) { return AlleleManager.alleleFactory.createBoolean(modId, category, (Boolean) value, isDominant, types); } else if (EnumTolerance.class.isAssignableFrom(valueClass)) { - IAlleleTolerance alleleTolerance = new AlleleTolerance(modId, category, name, (EnumTolerance) value, isDominant); + IAlleleTolerance alleleTolerance = + new AlleleTolerance(modId, category, name, (EnumTolerance) value, isDominant); AlleleManager.alleleRegistry.registerAllele(alleleTolerance, types); return alleleTolerance; } else if (FlowerProvider.class.isAssignableFrom(valueClass)) { - return AlleleManager.alleleFactory.createFlowers(modId, category, name, (FlowerProvider) value, isDominant, types); + return AlleleManager.alleleFactory.createFlowers( + modId, category, name, (FlowerProvider) value, isDominant, types); } throw new RuntimeException("could not create allele for category: " + category + " and value " + valueClass); } diff --git a/src/main/java/gregtech/common/bees/GT_Bee_Mutation.java b/src/main/java/gregtech/common/bees/GT_Bee_Mutation.java index a4a162ddae..357c7b9c36 100644 --- a/src/main/java/gregtech/common/bees/GT_Bee_Mutation.java +++ b/src/main/java/gregtech/common/bees/GT_Bee_Mutation.java @@ -7,14 +7,12 @@ import forestry.api.genetics.IGenome; import forestry.api.genetics.IMutationCondition; import forestry.apiculture.genetics.BeeMutation; import forestry.core.genetics.mutations.Mutation; +import java.lang.reflect.Field; +import java.util.List; import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.World; import org.apache.commons.lang3.reflect.FieldUtils; -import java.lang.reflect.Field; -import java.util.List; - - public class GT_Bee_Mutation extends BeeMutation { private final float split; @@ -31,7 +29,12 @@ public class GT_Bee_Mutation extends BeeMutation { } @Override - public float getChance(IBeeHousing housing, IAlleleBeeSpecies allele0, IAlleleBeeSpecies allele1, IBeeGenome genome0, IBeeGenome genome1) { + public float getChance( + IBeeHousing housing, + IAlleleBeeSpecies allele0, + IAlleleBeeSpecies allele1, + IBeeGenome genome0, + IBeeGenome genome1) { World world = housing != null ? housing.getWorld() : null; ChunkCoordinates housingCoordinates = housing != null ? housing.getCoordinates() : null; int x = housingCoordinates != null ? housingCoordinates.posX : 0; @@ -45,7 +48,8 @@ public class GT_Bee_Mutation extends BeeMutation { } IBeeModifier beeHousingModifier = BeeManager.beeRoot.createBeeHousingModifier(housing); - IBeeModifier beeModeModifier = BeeManager.beeRoot.getBeekeepingMode(world).getBeeModifier(); + IBeeModifier beeModeModifier = + BeeManager.beeRoot.getBeekeepingMode(world).getBeeModifier(); processedChance *= beeHousingModifier.getMutationModifier(genome0, genome1, processedChance); processedChance *= beeModeModifier.getMutationModifier(genome0, genome1, processedChance); @@ -54,14 +58,21 @@ public class GT_Bee_Mutation extends BeeMutation { } @SuppressWarnings("unchecked") - private float getBasicChance(World world, int x, int y, int z, IAllele allele0, IAllele allele1, IGenome genome0, IGenome genome1, IClimateProvider climate) { + private float getBasicChance( + World world, + int x, + int y, + int z, + IAllele allele0, + IAllele allele1, + IGenome genome0, + IGenome genome1, + IClimateProvider climate) { float mutationChance = this.getBaseChance(); List<IMutationCondition> mutationConditions = null; Field f = FieldUtils.getDeclaredField(Mutation.class, "mutationConditions", true); - if (f == null) - f = FieldUtils.getField(Mutation.class, "mutationConditions", true); - if (f == null) - return mutationChance; + if (f == null) f = FieldUtils.getField(Mutation.class, "mutationConditions", true); + if (f == null) return mutationChance; try { mutationConditions = f.get(this) instanceof List ? (List<IMutationCondition>) f.get(this) : null; } catch (IllegalAccessException e) { @@ -70,7 +81,8 @@ public class GT_Bee_Mutation extends BeeMutation { if (mutationConditions != null) for (IMutationCondition mutationCondition : mutationConditions) { - mutationChance *= mutationCondition.getChance(world, x, y, z, allele0, allele1, genome0, genome1, climate); + mutationChance *= + mutationCondition.getChance(world, x, y, z, allele0, allele1, genome0, genome1, climate); if (mutationChance == 0) { return 0; } diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Casings1.java b/src/main/java/gregtech/common/blocks/GT_Block_Casings1.java index 5ed40ec1a3..cbd2d86093 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Casings1.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Casings1.java @@ -9,21 +9,19 @@ import net.minecraft.world.IBlockAccess; public class GT_Block_Casings1 extends GT_Block_Casings_Abstract { - /** - * Texture Index Information - * Textures.BlockIcons.casingTexturePages[0][0-63] - Gregtech - * Textures.BlockIcons.casingTexturePages[0][64-127] - GT++ - * Textures.BlockIcons.casingTexturePages[1][0-127] - Gregtech - * Textures.BlockIcons.casingTexturePages[2][0-127] - Free - * Textures.BlockIcons.casingTexturePages[3][0-127] - Free - * Textures.BlockIcons.casingTexturePages[4][0-127] - Free - * Textures.BlockIcons.casingTexturePages[5][0-127] - Free - * Textures.BlockIcons.casingTexturePages[6][0-127] - Free - * Textures.BlockIcons.casingTexturePages[7][0-127] - Free - * Textures.BlockIcons.casingTexturePages[8][0-127] - TecTech - */ - - + /** + * Texture Index Information + * Textures.BlockIcons.casingTexturePages[0][0-63] - Gregtech + * Textures.BlockIcons.casingTexturePages[0][64-127] - GT++ + * Textures.BlockIcons.casingTexturePages[1][0-127] - Gregtech + * Textures.BlockIcons.casingTexturePages[2][0-127] - Free + * Textures.BlockIcons.casingTexturePages[3][0-127] - Free + * Textures.BlockIcons.casingTexturePages[4][0-127] - Free + * Textures.BlockIcons.casingTexturePages[5][0-127] - Free + * Textures.BlockIcons.casingTexturePages[6][0-127] - Free + * Textures.BlockIcons.casingTexturePages[7][0-127] - Free + * Textures.BlockIcons.casingTexturePages[8][0-127] - TecTech + */ public GT_Block_Casings1() { super(GT_Item_Casings1.class, "gt.blockcasings", GT_Material_Casings.INSTANCE, 16); @@ -39,7 +37,8 @@ public class GT_Block_Casings1 extends GT_Block_Casings_Abstract { GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".9.name", "UHV Machine Casing"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".10.name", "Bronze Plated Bricks"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".11.name", "Heat Proof Machine Casing"); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".12.name", "Dimensionally Transcendent Casing"); + GT_LanguageManager.addStringLocalization( + getUnlocalizedName() + ".12.name", "Dimensionally Transcendent Casing"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".13.name", "Dimensional Injection Casing"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".14.name", "Dimensional Bridge"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".15.name", "Superconducting Coil Block"); @@ -96,6 +95,10 @@ public class GT_Block_Casings1 extends GT_Block_Casings_Abstract { @Override public int colorMultiplier(IBlockAccess aWorld, int aX, int aY, int aZ) { - return aWorld.getBlockMetadata(aX, aY, aZ) > 9 ? super.colorMultiplier(aWorld, aX, aY, aZ) : gregtech.api.enums.Dyes.MACHINE_METAL.mRGBa[0] << 16 | gregtech.api.enums.Dyes.MACHINE_METAL.mRGBa[1] << 8 | gregtech.api.enums.Dyes.MACHINE_METAL.mRGBa[2]; + return aWorld.getBlockMetadata(aX, aY, aZ) > 9 + ? super.colorMultiplier(aWorld, aX, aY, aZ) + : gregtech.api.enums.Dyes.MACHINE_METAL.mRGBa[0] << 16 + | gregtech.api.enums.Dyes.MACHINE_METAL.mRGBa[1] << 8 + | gregtech.api.enums.Dyes.MACHINE_METAL.mRGBa[2]; } } diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Casings2.java b/src/main/java/gregtech/common/blocks/GT_Block_Casings2.java index 1b6ac42ee2..7ee9472308 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Casings2.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Casings2.java @@ -16,8 +16,12 @@ import net.minecraftforge.common.util.ForgeDirection; public class GT_Block_Casings2 extends GT_Block_Casings_Abstract { public GT_Block_Casings2() { super(GT_Item_Casings2.class, "gt.blockcasings2", GT_Material_Casings.INSTANCE, 96); - //Special handler for Pyrolyse Oven Casing on hatches... - Textures.BlockIcons.casingTexturePages[0][22] = TextureFactory.of(Block.getBlockFromItem(ItemList.Casing_ULV.get(1).getItem()), 0, ForgeDirection.UNKNOWN, Dyes.MACHINE_METAL.mRGBa); + // Special handler for Pyrolyse Oven Casing on hatches... + Textures.BlockIcons.casingTexturePages[0][22] = TextureFactory.of( + Block.getBlockFromItem(ItemList.Casing_ULV.get(1).getItem()), + 0, + ForgeDirection.UNKNOWN, + Dyes.MACHINE_METAL.mRGBa); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "Solid Steel Machine Casing"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".1.name", "Frost Proof Machine Casing"); @@ -98,7 +102,10 @@ public class GT_Block_Casings2 extends GT_Block_Casings_Abstract { } @Override - public float getExplosionResistance(Entity aTNT, World aWorld, int aX, int aY, int aZ, double eX, double eY, double eZ) { - return aWorld.getBlockMetadata(aX, aY, aZ) == 8 ? Blocks.bedrock.getExplosionResistance(aTNT) : super.getExplosionResistance(aTNT, aWorld, aX, aY, aZ, eX, eY, eZ); + public float getExplosionResistance( + Entity aTNT, World aWorld, int aX, int aY, int aZ, double eX, double eY, double eZ) { + return aWorld.getBlockMetadata(aX, aY, aZ) == 8 + ? Blocks.bedrock.getExplosionResistance(aTNT) + : super.getExplosionResistance(aTNT, aWorld, aX, aY, aZ, eX, eY, eZ); } } diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Casings3.java b/src/main/java/gregtech/common/blocks/GT_Block_Casings3.java index cc9bbd25f8..677c457678 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Casings3.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Casings3.java @@ -78,11 +78,17 @@ public class GT_Block_Casings3 extends GT_Block_Casings_Abstract { case 12: return Textures.BlockIcons.MACHINE_CASING_RADIATIONPROOF.getIcon(); case 13: - return aSide > 1 ? Textures.BlockIcons.MACHINE_CASING_FIREBOX_BRONZE.getIcon() : Textures.BlockIcons.MACHINE_BRONZEPLATEDBRICKS.getIcon(); + return aSide > 1 + ? Textures.BlockIcons.MACHINE_CASING_FIREBOX_BRONZE.getIcon() + : Textures.BlockIcons.MACHINE_BRONZEPLATEDBRICKS.getIcon(); case 14: - return aSide > 1 ? Textures.BlockIcons.MACHINE_CASING_FIREBOX_STEEL.getIcon() : Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon(); + return aSide > 1 + ? Textures.BlockIcons.MACHINE_CASING_FIREBOX_STEEL.getIcon() + : Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon(); case 15: - return aSide > 1 ? Textures.BlockIcons.MACHINE_CASING_FIREBOX_TUNGSTENSTEEL.getIcon() : Textures.BlockIcons.MACHINE_CASING_ROBUST_TUNGSTENSTEEL.getIcon(); + return aSide > 1 + ? Textures.BlockIcons.MACHINE_CASING_FIREBOX_TUNGSTENSTEEL.getIcon() + : Textures.BlockIcons.MACHINE_CASING_ROBUST_TUNGSTENSTEEL.getIcon(); } return Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon(); } diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Casings4.java b/src/main/java/gregtech/common/blocks/GT_Block_Casings4.java index 90f568b73f..f5618c23b4 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Casings4.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Casings4.java @@ -22,24 +22,45 @@ public class GT_Block_Casings4 extends GT_Block_Casings_Abstract { * The exact meaning of these numbers are like black magic. Read the original getIcon implementation to understand why * it is 0, 1, etc, if that if ladder is even intelligible. */ - private static final int[][] mapping = new int[][]{ - {7, 7, 7, 7, 0, 7, 0, 7, 1, 7, 1, 7, 8, 7, 8, 7, 0, 7, 0, 7, 0, 7, 0, 7, 9, 7, 9, 7, 3, 7, 3, 7, 1, 7, 1, 7, 11, 7, 11, 7, 1, 7, 1, 7, 2, 7, 2, 7, 10, 7, 10, 7, 5, 7, 5, 7, 4, 7, 4, 7, 6, 7, 6, 7}, - {7, 7, 7, 7, 0, 0, 7, 7, 1, 1, 7, 7, 8, 8, 7, 7, 0, 0, 7, 7, 0, 0, 7, 7, 9, 9, 7, 7, 3, 3, 7, 7, 1, 1, 7, 7, 11, 11, 7, 7, 1, 1, 7, 7, 2, 2, 7, 7, 10, 10, 7, 7, 5, 5, 7, 7, 4, 4, 7, 7, 6, 6, 7, 7}, - {7, 1, 1, 1, 0, 9, 10, 4, 7, 1, 1, 1, 0, 9, 10, 4, 0, 8, 11, 2, 0, 3, 5, 6, 0, 8, 11, 2, 0, 3, 5, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7}, - {7, 1, 1, 1, 0, 8, 11, 2, 7, 7, 7, 7, 7, 7, 7, 7, 0, 9, 10, 4, 0, 3, 5, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 1, 1, 1, 0, 8, 11, 2, 7, 7, 7, 7, 7, 7, 7, 7, 0, 9, 10, 4, 0, 3, 5, 6, 7, 7, 7, 7, 7, 7, 7, 7}, - {7, 1, 1, 1, 7, 1, 1, 1, 0, 8, 11, 2, 0, 8, 11, 2, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 9, 10, 4, 0, 9, 10, 4, 0, 3, 5, 6, 0, 3, 5, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7}, - {7, 1, 1, 1, 7, 7, 7, 7, 0, 9, 10, 4, 7, 7, 7, 7, 7, 1, 1, 1, 7, 7, 7, 7, 0, 9, 10, 4, 7, 7, 7, 7, 0, 8, 11, 2, 7, 7, 7, 7, 0, 3, 5, 6, 7, 7, 7, 7, 0, 8, 11, 2, 7, 7, 7, 7, 0, 3, 5, 6, 7, 7, 7, 7}, + private static final int[][] mapping = new int[][] { + { + 7, 7, 7, 7, 0, 7, 0, 7, 1, 7, 1, 7, 8, 7, 8, 7, 0, 7, 0, 7, 0, 7, 0, 7, 9, 7, 9, 7, 3, 7, 3, 7, 1, 7, 1, 7, + 11, 7, 11, 7, 1, 7, 1, 7, 2, 7, 2, 7, 10, 7, 10, 7, 5, 7, 5, 7, 4, 7, 4, 7, 6, 7, 6, 7 + }, + { + 7, 7, 7, 7, 0, 0, 7, 7, 1, 1, 7, 7, 8, 8, 7, 7, 0, 0, 7, 7, 0, 0, 7, 7, 9, 9, 7, 7, 3, 3, 7, 7, 1, 1, 7, 7, + 11, 11, 7, 7, 1, 1, 7, 7, 2, 2, 7, 7, 10, 10, 7, 7, 5, 5, 7, 7, 4, 4, 7, 7, 6, 6, 7, 7 + }, + { + 7, 1, 1, 1, 0, 9, 10, 4, 7, 1, 1, 1, 0, 9, 10, 4, 0, 8, 11, 2, 0, 3, 5, 6, 0, 8, 11, 2, 0, 3, 5, 6, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 + }, + { + 7, 1, 1, 1, 0, 8, 11, 2, 7, 7, 7, 7, 7, 7, 7, 7, 0, 9, 10, 4, 0, 3, 5, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 1, 1, + 1, 0, 8, 11, 2, 7, 7, 7, 7, 7, 7, 7, 7, 0, 9, 10, 4, 0, 3, 5, 6, 7, 7, 7, 7, 7, 7, 7, 7 + }, + { + 7, 1, 1, 1, 7, 1, 1, 1, 0, 8, 11, 2, 0, 8, 11, 2, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 9, 10, + 4, 0, 9, 10, 4, 0, 3, 5, 6, 0, 3, 5, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 + }, + { + 7, 1, 1, 1, 7, 7, 7, 7, 0, 9, 10, 4, 7, 7, 7, 7, 7, 1, 1, 1, 7, 7, 7, 7, 0, 9, 10, 4, 7, 7, 7, 7, 0, 8, 11, + 2, 7, 7, 7, 7, 0, 3, 5, 6, 7, 7, 7, 7, 0, 8, 11, 2, 7, 7, 7, 7, 0, 3, 5, 6, 7, 7, 7, 7 + }, }; + public static boolean mConnectedMachineTextures = true; public GT_Block_Casings4() { super(GT_Item_Casings4.class, "gt.blockcasings4", GT_Material_Casings.INSTANCE, 16); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "Robust Tungstensteel Machine Casing"); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".1.name", "Clean Stainless Steel Machine Casing"); + GT_LanguageManager.addStringLocalization( + getUnlocalizedName() + ".0.name", "Robust Tungstensteel Machine Casing"); + GT_LanguageManager.addStringLocalization( + getUnlocalizedName() + ".1.name", "Clean Stainless Steel Machine Casing"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".2.name", "Stable Titanium Machine Casing"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".3.name", "Titanium Firebox Casing"); -// GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".4.name", "Fusion Casing"); -// GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".5.name", "Fusion Casing"); + // GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".4.name", "Fusion Casing"); + // GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".5.name", "Fusion Casing"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".6.name", "Fusion Machine Casing"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".7.name", "Fusion Coil Block"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".8.name", "Fusion Machine Casing MK II"); @@ -88,12 +109,14 @@ public class GT_Block_Casings4 extends GT_Block_Casings_Abstract { case 11: return Textures.BlockIcons.MACHINE_CASING_STABLE_TITANIUM.getIcon(); case 3: - return aSide > 1 ? Textures.BlockIcons.MACHINE_CASING_FIREBOX_TITANIUM.getIcon() : Textures.BlockIcons.MACHINE_CASING_STABLE_TITANIUM.getIcon(); + return aSide > 1 + ? Textures.BlockIcons.MACHINE_CASING_FIREBOX_TITANIUM.getIcon() + : Textures.BlockIcons.MACHINE_CASING_STABLE_TITANIUM.getIcon(); case 4: - //Do not overwrite! + // Do not overwrite! return Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW.getIcon(); case 5: - //Do not overwrite! + // Do not overwrite! return Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS.getIcon(); case 6: return Textures.BlockIcons.MACHINE_CASING_FUSION.getIcon(); @@ -117,26 +140,50 @@ public class GT_Block_Casings4 extends GT_Block_Casings_Abstract { public IIcon getTurbineCasing(int meta, int iconIndex, boolean active) { switch (meta) { case 10: - return active ? Textures.BlockIcons.TURBINE_ACTIVE1[iconIndex].getIcon() : Textures.BlockIcons.TURBINE1[iconIndex].getIcon(); + return active + ? Textures.BlockIcons.TURBINE_ACTIVE1[iconIndex].getIcon() + : Textures.BlockIcons.TURBINE1[iconIndex].getIcon(); case 11: - return active ? Textures.BlockIcons.TURBINE_ACTIVE2[iconIndex].getIcon() : Textures.BlockIcons.TURBINE2[iconIndex].getIcon(); + return active + ? Textures.BlockIcons.TURBINE_ACTIVE2[iconIndex].getIcon() + : Textures.BlockIcons.TURBINE2[iconIndex].getIcon(); case 12: - return active ? Textures.BlockIcons.TURBINE_ACTIVE3[iconIndex].getIcon() : Textures.BlockIcons.TURBINE3[iconIndex].getIcon(); + return active + ? Textures.BlockIcons.TURBINE_ACTIVE3[iconIndex].getIcon() + : Textures.BlockIcons.TURBINE3[iconIndex].getIcon(); default: - return active ? Textures.BlockIcons.TURBINE_ACTIVE[iconIndex].getIcon() : Textures.BlockIcons.TURBINE[iconIndex].getIcon(); + return active + ? Textures.BlockIcons.TURBINE_ACTIVE[iconIndex].getIcon() + : Textures.BlockIcons.TURBINE[iconIndex].getIcon(); } } public IIcon getTurbineCasing(int meta, int iconIndex, boolean active, boolean hasTurbine) { switch (meta) { case 10: - return active ? Textures.BlockIcons.TURBINE_ACTIVE1[iconIndex].getIcon() : hasTurbine ? Textures.BlockIcons.TURBINE1[iconIndex].getIcon() : Textures.BlockIcons.TURBINE_EMPTY1[iconIndex].getIcon(); + return active + ? Textures.BlockIcons.TURBINE_ACTIVE1[iconIndex].getIcon() + : hasTurbine + ? Textures.BlockIcons.TURBINE1[iconIndex].getIcon() + : Textures.BlockIcons.TURBINE_EMPTY1[iconIndex].getIcon(); case 11: - return active ? Textures.BlockIcons.TURBINE_ACTIVE2[iconIndex].getIcon() : hasTurbine ? Textures.BlockIcons.TURBINE2[iconIndex].getIcon() : Textures.BlockIcons.TURBINE_EMPTY2[iconIndex].getIcon(); + return active + ? Textures.BlockIcons.TURBINE_ACTIVE2[iconIndex].getIcon() + : hasTurbine + ? Textures.BlockIcons.TURBINE2[iconIndex].getIcon() + : Textures.BlockIcons.TURBINE_EMPTY2[iconIndex].getIcon(); case 12: - return active ? Textures.BlockIcons.TURBINE_ACTIVE3[iconIndex].getIcon() : hasTurbine ? Textures.BlockIcons.TURBINE3[iconIndex].getIcon() : Textures.BlockIcons.TURBINE_EMPTY3[iconIndex].getIcon(); + return active + ? Textures.BlockIcons.TURBINE_ACTIVE3[iconIndex].getIcon() + : hasTurbine + ? Textures.BlockIcons.TURBINE3[iconIndex].getIcon() + : Textures.BlockIcons.TURBINE_EMPTY3[iconIndex].getIcon(); default: - return active ? Textures.BlockIcons.TURBINE_ACTIVE[iconIndex].getIcon() : hasTurbine ? Textures.BlockIcons.TURBINE[iconIndex].getIcon() : Textures.BlockIcons.TURBINE_EMPTY[iconIndex].getIcon(); + return active + ? Textures.BlockIcons.TURBINE_ACTIVE[iconIndex].getIcon() + : hasTurbine + ? Textures.BlockIcons.TURBINE[iconIndex].getIcon() + : Textures.BlockIcons.TURBINE_EMPTY[iconIndex].getIcon(); } } @@ -156,7 +203,8 @@ public class GT_Block_Casings4 extends GT_Block_Casings_Abstract { public IIcon getIcon(IBlockAccess aWorld, int xCoord, int yCoord, int zCoord, int aSide) { aWorld = GT_RenderingWorld.getInstance(aWorld); int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord); - if (tMeta != 6 && tMeta != 8 && tMeta != 9 && tMeta != 10 && tMeta != 11 && tMeta != 12 || !mConnectedMachineTextures) { + if (tMeta != 6 && tMeta != 8 && tMeta != 9 && tMeta != 10 && tMeta != 11 && tMeta != 12 + || !mConnectedMachineTextures) { return getIcon(aSide, tMeta); } if (tMeta > 8 && tMeta < 13) { @@ -165,10 +213,10 @@ public class GT_Block_Casings4 extends GT_Block_Casings_Abstract { case 0: for (int i = -1; i < 2; i++) { for (int j = -1; j < 2; j++) { - if (i == 0 && j == 0) - continue; + if (i == 0 && j == 0) continue; int tState; - if ((tState = isTurbineControllerWithSide(aWorld, xCoord + j, yCoord, zCoord + i, aSide)) != 0) { + if ((tState = isTurbineControllerWithSide(aWorld, xCoord + j, yCoord, zCoord + i, aSide)) + != 0) { return getTurbineCasing(tMeta, 4 - i * 3 - j, tState == 1, tState == 2); } } @@ -177,11 +225,12 @@ public class GT_Block_Casings4 extends GT_Block_Casings_Abstract { case 1: for (int i = -1; i < 2; i++) { for (int j = -1; j < 2; j++) { - if (i == 0 && j == 0) - continue; + if (i == 0 && j == 0) continue; int tState; - if ((tState = isTurbineControllerWithSide(aWorld, xCoord + j, yCoord + i, zCoord, aSide)) != 0) { - return getTurbineCasing(tMeta, 4 + i * 3 - j * tInvertLeftRightMod, tState == 1, tState == 2); + if ((tState = isTurbineControllerWithSide(aWorld, xCoord + j, yCoord + i, zCoord, aSide)) + != 0) { + return getTurbineCasing( + tMeta, 4 + i * 3 - j * tInvertLeftRightMod, tState == 1, tState == 2); } } } @@ -189,11 +238,12 @@ public class GT_Block_Casings4 extends GT_Block_Casings_Abstract { case 2: for (int i = -1; i < 2; i++) { for (int j = -1; j < 2; j++) { - if (i == 0 && j == 0) - continue; + if (i == 0 && j == 0) continue; int tState; - if ((tState = isTurbineControllerWithSide(aWorld, xCoord, yCoord + i, zCoord + j, aSide)) != 0) { - return getTurbineCasing(tMeta, 4 + i * 3 + j * tInvertLeftRightMod, tState == 1, tState == 2); + if ((tState = isTurbineControllerWithSide(aWorld, xCoord, yCoord + i, zCoord + j, aSide)) + != 0) { + return getTurbineCasing( + tMeta, 4 + i * 3 + j * tInvertLeftRightMod, tState == 1, tState == 2); } } } diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Casings5.java b/src/main/java/gregtech/common/blocks/GT_Block_Casings5.java index 4de58c3a35..a3ef59de4f 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Casings5.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Casings5.java @@ -1,5 +1,7 @@ package gregtech.common.blocks; +import static gregtech.api.enums.HeatingCoilLevel.*; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.HeatingCoilLevel; @@ -7,13 +9,10 @@ import gregtech.api.enums.ItemList; import gregtech.api.enums.Textures; import gregtech.api.interfaces.IHeatingCoil; import gregtech.api.util.GT_LanguageManager; +import java.util.function.Consumer; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; -import java.util.function.Consumer; - -import static gregtech.api.enums.HeatingCoilLevel.*; - public class GT_Block_Casings5 extends GT_Block_Casings_Abstract implements IHeatingCoil { public GT_Block_Casings5() { @@ -33,7 +32,6 @@ public class GT_Block_Casings5 extends GT_Block_Casings_Abstract implements IHea GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".12.name", "Hypogen Coil Block"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".13.name", "Eternal Coil Block"); - ItemList.Casing_Coil_Cupronickel.set(new ItemStack(this, 1, 0)); ItemList.Casing_Coil_Kanthal.set(new ItemStack(this, 1, 1)); ItemList.Casing_Coil_Nichrome.set(new ItemStack(this, 1, 2)); @@ -52,7 +50,7 @@ public class GT_Block_Casings5 extends GT_Block_Casings_Abstract implements IHea @Override public int getTextureIndex(int aMeta) { - return (1 << 7 ) | aMeta; + return (1 << 7) | aMeta; } @Override @@ -163,8 +161,6 @@ public class GT_Block_Casings5 extends GT_Block_Casings_Abstract implements IHea } } - - @Override public HeatingCoilLevel getCoilHeat(int meta) { getOnCoilCheck().accept(this); diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Casings6.java b/src/main/java/gregtech/common/blocks/GT_Block_Casings6.java index 30b8751406..0b6b89198a 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Casings6.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Casings6.java @@ -96,6 +96,8 @@ public class GT_Block_Casings6 extends GT_Block_Casings_Abstract { @Override public int colorMultiplier(IBlockAccess aWorld, int aX, int aY, int aZ) { - return gregtech.api.enums.Dyes.MACHINE_METAL.mRGBa[0] << 16 | gregtech.api.enums.Dyes.MACHINE_METAL.mRGBa[1] << 8 | gregtech.api.enums.Dyes.MACHINE_METAL.mRGBa[2]; + return gregtech.api.enums.Dyes.MACHINE_METAL.mRGBa[0] << 16 + | gregtech.api.enums.Dyes.MACHINE_METAL.mRGBa[1] << 8 + | gregtech.api.enums.Dyes.MACHINE_METAL.mRGBa[2]; } } diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Casings8.java b/src/main/java/gregtech/common/blocks/GT_Block_Casings8.java index e8ccc47b3d..65583eaa28 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Casings8.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Casings8.java @@ -16,7 +16,7 @@ import net.minecraft.world.IBlockAccess; public class GT_Block_Casings8 extends GT_Block_Casings_Abstract { public static boolean mConnectedMachineTextures = true; - //WATCH OUT FOR TEXTURE ID's + // WATCH OUT FOR TEXTURE ID's public GT_Block_Casings8() { super(GT_Item_Casings8.class, "gt.blockcasings8", GT_Material_Casings.INSTANCE, 10); /* @@ -29,9 +29,12 @@ public class GT_Block_Casings8 extends GT_Block_Casings_Abstract { GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".2.name", "Mining Neutronium Casing"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".3.name", "Mining Black Plutonium Casing"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".4.name", "Extreme Engine Intake Casing"); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".5.name", "Europium Reinforced Radiation Proof Machine Casing"); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".6.name", "Advanced Rhodium Plated Palladium Machine Casing"); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".7.name", "Advanced Iridium Plated Machine Casing"); + GT_LanguageManager.addStringLocalization( + getUnlocalizedName() + ".5.name", "Europium Reinforced Radiation Proof Machine Casing"); + GT_LanguageManager.addStringLocalization( + getUnlocalizedName() + ".6.name", "Advanced Rhodium Plated Palladium Machine Casing"); + GT_LanguageManager.addStringLocalization( + getUnlocalizedName() + ".7.name", "Advanced Iridium Plated Machine Casing"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".8.name", "Magical Machine Casing"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".9.name", "HSS-S Turbine Casing"); @@ -56,26 +59,27 @@ public class GT_Block_Casings8 extends GT_Block_Casings_Abstract { @SideOnly(Side.CLIENT) public IIcon getIcon(int aSide, int aMeta) { switch (aMeta) { - case 0: - return Textures.BlockIcons.MACHINE_CASING_CHEMICALLY_INERT.getIcon(); - case 1: - return Textures.BlockIcons.MACHINE_CASING_PIPE_POLYTETRAFLUOROETHYLENE.getIcon(); - case 2: - return Textures.BlockIcons.MACHINE_CASING_MINING_NEUTRONIUM.getIcon(); - case 3: - return Textures.BlockIcons.MACHINE_CASING_MINING_BLACKPLUTONIUM.getIcon(); - case 4: - return Textures.BlockIcons.MACHINE_CASING_EXTREME_ENGINE_INTAKE.getIcon();//changed color in a terrible way - case 5: - return Textures.BlockIcons.MACHINE_CASING_ADVANCEDRADIATIONPROOF.getIcon(); - case 6: - return Textures.BlockIcons.MACHINE_CASING_RHODIUM_PALLADIUM.getIcon(); - case 7: - return Textures.BlockIcons.MACHINE_CASING_IRIDIUM.getIcon(); - case 8: - return Textures.BlockIcons.MACHINE_CASING_MAGICAL.getIcon(); - case 9: - return Textures.BlockIcons.MACHINE_CASING_ADVANCEDGAS.getIcon(); + case 0: + return Textures.BlockIcons.MACHINE_CASING_CHEMICALLY_INERT.getIcon(); + case 1: + return Textures.BlockIcons.MACHINE_CASING_PIPE_POLYTETRAFLUOROETHYLENE.getIcon(); + case 2: + return Textures.BlockIcons.MACHINE_CASING_MINING_NEUTRONIUM.getIcon(); + case 3: + return Textures.BlockIcons.MACHINE_CASING_MINING_BLACKPLUTONIUM.getIcon(); + case 4: + return Textures.BlockIcons.MACHINE_CASING_EXTREME_ENGINE_INTAKE + .getIcon(); // changed color in a terrible way + case 5: + return Textures.BlockIcons.MACHINE_CASING_ADVANCEDRADIATIONPROOF.getIcon(); + case 6: + return Textures.BlockIcons.MACHINE_CASING_RHODIUM_PALLADIUM.getIcon(); + case 7: + return Textures.BlockIcons.MACHINE_CASING_IRIDIUM.getIcon(); + case 8: + return Textures.BlockIcons.MACHINE_CASING_MAGICAL.getIcon(); + case 9: + return Textures.BlockIcons.MACHINE_CASING_ADVANCEDGAS.getIcon(); } return Textures.BlockIcons.MACHINE_CASING_ROBUST_TUNGSTENSTEEL.getIcon(); } @@ -84,18 +88,30 @@ public class GT_Block_Casings8 extends GT_Block_Casings_Abstract { public IIcon getTurbineCasing(int meta, int iconIndex, boolean active) { switch (meta) { case 9: - return active ? Textures.BlockIcons.TURBINE_ADVGASACTIVE[iconIndex].getIcon() : Textures.BlockIcons.TURBINEADVGAS[iconIndex].getIcon(); + return active + ? Textures.BlockIcons.TURBINE_ADVGASACTIVE[iconIndex].getIcon() + : Textures.BlockIcons.TURBINEADVGAS[iconIndex].getIcon(); default: - return active ? Textures.BlockIcons.TURBINE_ACTIVE[iconIndex].getIcon() : Textures.BlockIcons.TURBINE[iconIndex].getIcon(); + return active + ? Textures.BlockIcons.TURBINE_ACTIVE[iconIndex].getIcon() + : Textures.BlockIcons.TURBINE[iconIndex].getIcon(); } } public IIcon getTurbineCasing(int meta, int iconIndex, boolean active, boolean hasTurbine) { switch (meta) { case 9: - return active ? Textures.BlockIcons.TURBINE_ADVGASACTIVE[iconIndex].getIcon() : hasTurbine ? Textures.BlockIcons.TURBINEADVGAS[iconIndex].getIcon() : Textures.BlockIcons.TURBINE_ADVGASEMPTY[iconIndex].getIcon(); + return active + ? Textures.BlockIcons.TURBINE_ADVGASACTIVE[iconIndex].getIcon() + : hasTurbine + ? Textures.BlockIcons.TURBINEADVGAS[iconIndex].getIcon() + : Textures.BlockIcons.TURBINE_ADVGASEMPTY[iconIndex].getIcon(); default: - return active ? Textures.BlockIcons.TURBINE_ACTIVE[iconIndex].getIcon() : hasTurbine ? Textures.BlockIcons.TURBINE[iconIndex].getIcon() : Textures.BlockIcons.TURBINE_EMPTY[iconIndex].getIcon(); + return active + ? Textures.BlockIcons.TURBINE_ACTIVE[iconIndex].getIcon() + : hasTurbine + ? Textures.BlockIcons.TURBINE[iconIndex].getIcon() + : Textures.BlockIcons.TURBINE_EMPTY[iconIndex].getIcon(); } } @@ -124,10 +140,10 @@ public class GT_Block_Casings8 extends GT_Block_Casings_Abstract { case 0: for (int i = -1; i < 2; i++) { for (int j = -1; j < 2; j++) { - if (i == 0 && j == 0) - continue; + if (i == 0 && j == 0) continue; int tState; - if ((tState = isTurbineControllerWithSide(aWorld, xCoord + j, yCoord, zCoord + i, aSide)) != 0) { + if ((tState = isTurbineControllerWithSide(aWorld, xCoord + j, yCoord, zCoord + i, aSide)) + != 0) { return getTurbineCasing(tMeta, 4 - i * 3 - j, tState == 1, tState == 2); } } @@ -136,11 +152,12 @@ public class GT_Block_Casings8 extends GT_Block_Casings_Abstract { case 1: for (int i = -1; i < 2; i++) { for (int j = -1; j < 2; j++) { - if (i == 0 && j == 0) - continue; + if (i == 0 && j == 0) continue; int tState; - if ((tState = isTurbineControllerWithSide(aWorld, xCoord + j, yCoord + i, zCoord, aSide)) != 0) { - return getTurbineCasing(tMeta, 4 + i * 3 - j * tInvertLeftRightMod, tState == 1, tState == 2); + if ((tState = isTurbineControllerWithSide(aWorld, xCoord + j, yCoord + i, zCoord, aSide)) + != 0) { + return getTurbineCasing( + tMeta, 4 + i * 3 - j * tInvertLeftRightMod, tState == 1, tState == 2); } } } @@ -148,11 +165,12 @@ public class GT_Block_Casings8 extends GT_Block_Casings_Abstract { case 2: for (int i = -1; i < 2; i++) { for (int j = -1; j < 2; j++) { - if (i == 0 && j == 0) - continue; + if (i == 0 && j == 0) continue; int tState; - if ((tState = isTurbineControllerWithSide(aWorld, xCoord, yCoord + i, zCoord + j, aSide)) != 0) { - return getTurbineCasing(tMeta, 4 + i * 3 + j * tInvertLeftRightMod, tState == 1, tState == 2); + if ((tState = isTurbineControllerWithSide(aWorld, xCoord, yCoord + i, zCoord + j, aSide)) + != 0) { + return getTurbineCasing( + tMeta, 4 + i * 3 + j * tInvertLeftRightMod, tState == 1, tState == 2); } } } diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Casings_Abstract.java b/src/main/java/gregtech/common/blocks/GT_Block_Casings_Abstract.java index 7045949920..452ed16d44 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Casings_Abstract.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Casings_Abstract.java @@ -7,6 +7,7 @@ import gregtech.api.enums.Textures; import gregtech.api.items.GT_Generic_Block; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_LanguageManager; +import java.util.List; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -21,9 +22,8 @@ import net.minecraft.util.StatCollector; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import java.util.List; - -public abstract class GT_Block_Casings_Abstract extends GT_Generic_Block implements gregtech.api.interfaces.IHasIndexedTexture { +public abstract class GT_Block_Casings_Abstract extends GT_Generic_Block + implements gregtech.api.interfaces.IHasIndexedTexture { public GT_Block_Casings_Abstract(Class<? extends ItemBlock> aItemClass, String aName, Material aMaterial) { super(aItemClass, aName, aMaterial); setStepSound(soundTypeMetal); @@ -32,7 +32,8 @@ public abstract class GT_Block_Casings_Abstract extends GT_Generic_Block impleme GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + 32767 + ".name", "Any Sub Block of this"); } - public GT_Block_Casings_Abstract(Class<? extends ItemBlock> aItemClass, String aName, Material aMaterial, int aMaxMeta) { + public GT_Block_Casings_Abstract( + Class<? extends ItemBlock> aItemClass, String aName, Material aMaterial, int aMaxMeta) { this(aItemClass, aName, aMaterial); for (int i = 0; i < aMaxMeta; i++) { Textures.BlockIcons.setCasingTextureForId(getTextureIndex(i), TextureFactory.of(this, i)); @@ -115,8 +116,7 @@ public abstract class GT_Block_Casings_Abstract extends GT_Generic_Block impleme @Override @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister aIconRegister) { - } + public void registerBlockIcons(IIconRegister aIconRegister) {} @Override @SideOnly(Side.CLIENT) diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Concretes.java b/src/main/java/gregtech/common/blocks/GT_Block_Concretes.java index 0c98bab9c0..7debd01173 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Concretes.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Concretes.java @@ -11,11 +11,11 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.world.World; -public class GT_Block_Concretes extends GT_Block_Stones_Abstract implements IBlockOnWalkOver{ +public class GT_Block_Concretes extends GT_Block_Stones_Abstract implements IBlockOnWalkOver { public GT_Block_Concretes() { super(GT_Item_Concretes.class, "gt.blockconcretes"); setResistance(20.0F); - //this.slipperiness = 0.9F; + // this.slipperiness = 0.9F; GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "Dark Concrete"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".1.name", "Dark Concrete Cobblestone"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".2.name", "Mossy Dark Concrete Cobblestone"); @@ -70,9 +70,13 @@ public class GT_Block_Concretes extends GT_Block_Stones_Abstract implements IBlo @Override public void onWalkOver(EntityLivingBase aEntity, World aWorld, int aX, int aY, int aZ) { - if ((aEntity.motionX != 0 || aEntity.motionZ != 0) && !aEntity.isInWater() && !aEntity.isWet() && !aEntity.isSneaking()) { - double tSpeed = (aWorld.getBlock(aX, aY-1, aZ).slipperiness >= 0.8 ? 1.5 : 1.2); - aEntity.motionX *= tSpeed; aEntity.motionZ *= tSpeed; + if ((aEntity.motionX != 0 || aEntity.motionZ != 0) + && !aEntity.isInWater() + && !aEntity.isWet() + && !aEntity.isSneaking()) { + double tSpeed = (aWorld.getBlock(aX, aY - 1, aZ).slipperiness >= 0.8 ? 1.5 : 1.2); + aEntity.motionX *= tSpeed; + aEntity.motionZ *= tSpeed; } } } diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Machines.java b/src/main/java/gregtech/common/blocks/GT_Block_Machines.java index 63626928bf..ea1df39932 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Machines.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Machines.java @@ -1,4 +1,7 @@ package gregtech.common.blocks; + +import static gregtech.GT_Mod.GT_FML_LOGGER; +import static gregtech.api.enums.GT_Values.SIDE_UP; import static gregtech.api.objects.XSTR.XSTR_INSTANCE; import com.cricketcraft.chisel.api.IFacade; @@ -23,6 +26,10 @@ import gregtech.api.util.GT_Utility; import gregtech.common.render.GT_Renderer_Block; import gregtech.common.tileentities.storage.GT_MetaTileEntity_QuantumChest; import gregtech.common.tileentities.storage.GT_MetaTileEntity_SuperChest; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Random; import net.minecraft.block.Block; import net.minecraft.block.ITileEntityProvider; import net.minecraft.client.renderer.texture.IIconRegister; @@ -39,22 +46,12 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.IIcon; -import net.minecraft.util.MathHelper; import net.minecraft.util.StatCollector; import net.minecraft.world.Explosion; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Random; - -import static gregtech.GT_Mod.GT_FML_LOGGER; -import static gregtech.api.enums.GT_Values.SIDE_UP; -import static gregtech.api.objects.XSTR.XSTR_INSTANCE; - @Optional.Interface(iface = "com.cricketcraft.chisel.api.IFacade", modid = "ChiselAPI") public class GT_Block_Machines extends GT_Generic_Block implements IDebugableBlock, ITileEntityProvider, IFacade { private static final ThreadLocal<IGregTechTileEntity> mTemporaryTileEntity = new ThreadLocal<>(); @@ -231,8 +228,8 @@ public class GT_Block_Machines extends GT_Generic_Block implements IDebugableBlo public void addCollisionBoxesToList( World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, List outputAABB, Entity collider) { final TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if (tTileEntity instanceof IGregTechTileEntity && - ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null) { + if (tTileEntity instanceof IGregTechTileEntity + && ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null) { ((IGregTechTileEntity) tTileEntity) .addCollisionBoxesToList(aWorld, aX, aY, aZ, inputAABB, outputAABB, collider); return; @@ -243,8 +240,8 @@ public class GT_Block_Machines extends GT_Generic_Block implements IDebugableBlo @Override public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) { final TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if (tTileEntity instanceof IGregTechTileEntity && - ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null) { + if (tTileEntity instanceof IGregTechTileEntity + && ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null) { return ((IGregTechTileEntity) tTileEntity).getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ); } return super.getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ); @@ -254,19 +251,21 @@ public class GT_Block_Machines extends GT_Generic_Block implements IDebugableBlo @SideOnly(Side.CLIENT) public AxisAlignedBB getSelectedBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) { final TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if (tTileEntity instanceof IGregTechTileEntity && - ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null) { + if (tTileEntity instanceof IGregTechTileEntity + && ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null) { return ((IGregTechTileEntity) tTileEntity).getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ); } return super.getSelectedBoundingBoxFromPool(aWorld, aX, aY, aZ); } - @Override //THIS + @Override // THIS public void setBlockBoundsBasedOnState(IBlockAccess blockAccess, int aX, int aY, int aZ) { final TileEntity tTileEntity = blockAccess.getTileEntity(aX, aY, aZ); - if (tTileEntity instanceof IGregTechTileEntity && (((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null)) { - final AxisAlignedBB bbb = ((IGregTechTileEntity) tTileEntity).getCollisionBoundingBoxFromPool(((IGregTechTileEntity) tTileEntity).getWorld(), 0, 0, 0); - minX = bbb.minX; //This essentially sets block bounds + if (tTileEntity instanceof IGregTechTileEntity + && (((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null)) { + final AxisAlignedBB bbb = ((IGregTechTileEntity) tTileEntity) + .getCollisionBoundingBoxFromPool(((IGregTechTileEntity) tTileEntity).getWorld(), 0, 0, 0); + minX = bbb.minX; // This essentially sets block bounds minY = bbb.minY; minZ = bbb.minZ; maxX = bbb.maxX; @@ -285,8 +284,8 @@ public class GT_Block_Machines extends GT_Generic_Block implements IDebugableBlo @Override public void onEntityCollidedWithBlock(World aWorld, int aX, int aY, int aZ, Entity collider) { final TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if (tTileEntity instanceof IGregTechTileEntity && - ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null) { + if (tTileEntity instanceof IGregTechTileEntity + && ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null) { ((IGregTechTileEntity) tTileEntity).onEntityCollidedWithBlock(aWorld, aX, aY, aZ, collider); return; } @@ -334,27 +333,35 @@ public class GT_Block_Machines extends GT_Generic_Block implements IDebugableBlo @Override public float getPlayerRelativeBlockHardness(EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ) { final TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - return tTileEntity instanceof BaseMetaTileEntity && - ((BaseMetaTileEntity) tTileEntity).privateAccess() && - !((BaseMetaTileEntity) tTileEntity).playerOwnsThis(aPlayer, true) ? - -1.0F : super.getPlayerRelativeBlockHardness(aPlayer, aWorld, aX, aY, aZ); - } - - @Override - public boolean onBlockActivated(World aWorld, int aX, int aY, int aZ, EntityPlayer aPlayer, int aSide, float aOffsetX, float aOffsetY, float aOffsetZ) { + return tTileEntity instanceof BaseMetaTileEntity + && ((BaseMetaTileEntity) tTileEntity).privateAccess() + && !((BaseMetaTileEntity) tTileEntity).playerOwnsThis(aPlayer, true) + ? -1.0F + : super.getPlayerRelativeBlockHardness(aPlayer, aWorld, aX, aY, aZ); + } + + @Override + public boolean onBlockActivated( + World aWorld, + int aX, + int aY, + int aZ, + EntityPlayer aPlayer, + int aSide, + float aOffsetX, + float aOffsetY, + float aOffsetZ) { final TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); if (tTileEntity == null) { return false; } if (aPlayer.isSneaking()) { final ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem(); - if ( - tCurrentItem != null && - !GT_Utility.isStackInList(tCurrentItem, GregTech_API.sScrewdriverList) && - !GT_Utility.isStackInList(tCurrentItem, GregTech_API.sWrenchList) && - !GT_Utility.isStackInList(tCurrentItem, GregTech_API.sWireCutterList) && - !GT_Utility.isStackInList(tCurrentItem, GregTech_API.sSolderingToolList) - ) return false; + if (tCurrentItem != null + && !GT_Utility.isStackInList(tCurrentItem, GregTech_API.sScrewdriverList) + && !GT_Utility.isStackInList(tCurrentItem, GregTech_API.sWrenchList) + && !GT_Utility.isStackInList(tCurrentItem, GregTech_API.sWireCutterList) + && !GT_Utility.isStackInList(tCurrentItem, GregTech_API.sSolderingToolList)) return false; } if ((tTileEntity instanceof IGregTechTileEntity)) { if (((IGregTechTileEntity) tTileEntity).getTimer() < 50L) { @@ -363,7 +370,8 @@ public class GT_Block_Machines extends GT_Generic_Block implements IDebugableBlo if ((!aWorld.isRemote) && !((IGregTechTileEntity) tTileEntity).isUseableByPlayer(aPlayer)) { return true; } - return ((IGregTechTileEntity) tTileEntity).onRightclick(aPlayer, (byte) aSide, aOffsetX, aOffsetY, aOffsetZ); + return ((IGregTechTileEntity) tTileEntity) + .onRightclick(aPlayer, (byte) aSide, aOffsetX, aOffsetY, aOffsetZ); } return false; } @@ -389,7 +397,9 @@ public class GT_Block_Machines extends GT_Generic_Block implements IDebugableBlo public void onBlockExploded(World aWorld, int aX, int aY, int aZ, Explosion aExplosion) { final TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); if (tTileEntity instanceof BaseMetaTileEntity) { - GT_Log.exp.printf("Explosion at : %d | %d | %d DIMID: %s due to near explosion!%n", aX, aY, aZ, aWorld.provider.dimensionId); + GT_Log.exp.printf( + "Explosion at : %d | %d | %d DIMID: %s due to near explosion!%n", + aX, aY, aZ, aWorld.provider.dimensionId); ((BaseMetaTileEntity) tTileEntity).doEnergyExplosion(); } super.onBlockExploded(aWorld, aX, aY, aZ, aExplosion); @@ -402,18 +412,20 @@ public class GT_Block_Machines extends GT_Generic_Block implements IDebugableBlo if (tTileEntity instanceof IGregTechTileEntity) { final IGregTechTileEntity tGregTechTileEntity = (IGregTechTileEntity) tTileEntity; mTemporaryTileEntity.set(tGregTechTileEntity); - if (!(tGregTechTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_SuperChest || tGregTechTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_QuantumChest)) { + if (!(tGregTechTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_SuperChest + || tGregTechTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_QuantumChest)) { for (int i = 0; i < tGregTechTileEntity.getSizeInventory(); i++) { final ItemStack tItem = tGregTechTileEntity.getStackInSlot(i); if ((tItem != null) && (tItem.stackSize > 0) && (tGregTechTileEntity.isValidSlot(i))) { final EntityItem tItemEntity = new EntityItem( - aWorld, - aX + XSTR_INSTANCE.nextFloat() * 0.8F + 0.1F, - aY + XSTR_INSTANCE.nextFloat() * 0.8F + 0.1F, - aZ + XSTR_INSTANCE.nextFloat() * 0.8F + 0.1F, - new ItemStack(tItem.getItem(), tItem.stackSize, tItem.getItemDamage())); + aWorld, + aX + XSTR_INSTANCE.nextFloat() * 0.8F + 0.1F, + aY + XSTR_INSTANCE.nextFloat() * 0.8F + 0.1F, + aZ + XSTR_INSTANCE.nextFloat() * 0.8F + 0.1F, + new ItemStack(tItem.getItem(), tItem.stackSize, tItem.getItemDamage())); if (tItem.hasTagCompound()) { - tItemEntity.getEntityItem().setTagCompound((NBTTagCompound) tItem.getTagCompound().copy()); + tItemEntity.getEntityItem().setTagCompound((NBTTagCompound) + tItem.getTagCompound().copy()); } tItemEntity.motionX = (XSTR_INSTANCE.nextGaussian() * 0.05D); tItemEntity.motionY = (XSTR_INSTANCE.nextGaussian() * 0.25D); @@ -492,12 +504,14 @@ public class GT_Block_Machines extends GT_Generic_Block implements IDebugableBlo } @Override - public void dropBlockAsItemWithChance(World aWorld, int aX, int aY, int aZ, int aMetadata, float chance, int aFortune) { + public void dropBlockAsItemWithChance( + World aWorld, int aX, int aY, int aZ, int aMetadata, float chance, int aFortune) { if (!aWorld.isRemote) { final TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); if (tTileEntity != null && (chance < 1.0F)) { if (tTileEntity instanceof BaseMetaTileEntity && (GregTech_API.sMachineNonWrenchExplosions)) { - GT_Log.exp.printf("Explosion at : %d | %d | %d DIMID: %s NonWrench picking/Rain!%n", + GT_Log.exp.printf( + "Explosion at : %d | %d | %d DIMID: %s NonWrench picking/Rain!%n", aX, aY, aZ, aWorld.provider.dimensionId); ((BaseMetaTileEntity) tTileEntity).doEnergyExplosion(); } @@ -517,12 +531,12 @@ public class GT_Block_Machines extends GT_Generic_Block implements IDebugableBlo if (tTileEntity instanceof BaseMetaTileEntity) { return true; } - if (tTileEntity instanceof BaseMetaPipeEntity && - (((BaseMetaPipeEntity) tTileEntity).mConnections & 0xFFFFFFC0) != 0) { + if (tTileEntity instanceof BaseMetaPipeEntity + && (((BaseMetaPipeEntity) tTileEntity).mConnections & 0xFFFFFFC0) != 0) { return true; } - return tTileEntity instanceof ICoverable && - ((ICoverable) tTileEntity).getCoverIDAtSide((byte) aSide.ordinal()) != 0; + return tTileEntity instanceof ICoverable + && ((ICoverable) tTileEntity).getCoverIDAtSide((byte) aSide.ordinal()) != 0; } return false; } @@ -537,8 +551,7 @@ public class GT_Block_Machines extends GT_Generic_Block implements IDebugableBlo */ @SideOnly(Side.CLIENT) @Override - public float getAmbientOcclusionLightValue() - { + public float getAmbientOcclusionLightValue() { return this.renderAsNormalBlock() ? 0.2F : 0.5F; } @@ -582,8 +595,14 @@ public class GT_Block_Machines extends GT_Generic_Block implements IDebugableBlo @Override public float getExplosionResistance( - Entity entity, World aWorld, int aX, int aY, int aZ, - double explosionX, double explosionY, double explosionZ) { + Entity entity, + World aWorld, + int aX, + int aY, + int aZ, + double explosionX, + double explosionY, + double explosionZ) { final TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); if (tTileEntity instanceof IGregTechTileEntity) { return ((IGregTechTileEntity) tTileEntity).getBlastResistance((byte) 6); @@ -607,7 +626,8 @@ public class GT_Block_Machines extends GT_Generic_Block implements IDebugableBlo final TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); if (!(tTileEntity instanceof IGregTechTileEntity)) return; final IGregTechTileEntity iGregTechTileEntity = (IGregTechTileEntity) tTileEntity; - iGregTechTileEntity.setFrontFacing(BaseTileEntity.getSideForPlayerPlacing(aPlayer, SIDE_UP, iGregTechTileEntity.getValidFacings())); + iGregTechTileEntity.setFrontFacing( + BaseTileEntity.getSideForPlayerPlacing(aPlayer, SIDE_UP, iGregTechTileEntity.getValidFacings())); } @Override @@ -639,13 +659,16 @@ public class GT_Block_Machines extends GT_Generic_Block implements IDebugableBlo final byte aSide = (byte) side; final CoverableTileEntity tile = (CoverableTileEntity) tTileEntity; if (side != -1) { - final Block facadeBlock = tile.getCoverBehaviorAtSideNew(aSide).getFacadeBlock(aSide, tile.getCoverIDAtSide(aSide), tile.getComplexCoverDataAtSide(aSide), tile); + final Block facadeBlock = tile.getCoverBehaviorAtSideNew(aSide) + .getFacadeBlock( + aSide, tile.getCoverIDAtSide(aSide), tile.getComplexCoverDataAtSide(aSide), tile); if (facadeBlock != null) return facadeBlock; } else { // we do not allow more than one type of facade per block, so no need to check every side // see comment in gregtech.common.covers.GT_Cover_FacadeBase.isCoverPlaceable for (byte i = 0; i < 6; i++) { - final Block facadeBlock = tile.getCoverBehaviorAtSideNew(i).getFacadeBlock(i, tile.getCoverIDAtSide(i), tile.getComplexCoverDataAtSide(i), tile); + final Block facadeBlock = tile.getCoverBehaviorAtSideNew(i) + .getFacadeBlock(i, tile.getCoverIDAtSide(i), tile.getComplexCoverDataAtSide(i), tile); if (facadeBlock != null) { return facadeBlock; } @@ -662,16 +685,22 @@ public class GT_Block_Machines extends GT_Generic_Block implements IDebugableBlo final byte aSide = (byte) side; final CoverableTileEntity tile = (CoverableTileEntity) tTileEntity; if (side != -1) { - final Block facadeBlock = tile.getCoverBehaviorAtSideNew(aSide).getFacadeBlock(aSide, tile.getCoverIDAtSide(aSide), tile.getComplexCoverDataAtSide(aSide), tile); + final Block facadeBlock = tile.getCoverBehaviorAtSideNew(aSide) + .getFacadeBlock( + aSide, tile.getCoverIDAtSide(aSide), tile.getComplexCoverDataAtSide(aSide), tile); if (facadeBlock != null) - return tile.getCoverBehaviorAtSideNew(aSide).getFacadeMeta(aSide, tile.getCoverIDAtSide(aSide), tile.getComplexCoverDataAtSide(aSide), tile); + return tile.getCoverBehaviorAtSideNew(aSide) + .getFacadeMeta( + aSide, tile.getCoverIDAtSide(aSide), tile.getComplexCoverDataAtSide(aSide), tile); } else { // we do not allow more than one type of facade per block, so no need to check every side // see comment in gregtech.common.covers.GT_Cover_FacadeBase.isCoverPlaceable for (byte i = 0; i < 6; i++) { - final Block facadeBlock = tile.getCoverBehaviorAtSideNew(i).getFacadeBlock(i, tile.getCoverIDAtSide(i), tile.getComplexCoverDataAtSide(i), tile); + final Block facadeBlock = tile.getCoverBehaviorAtSideNew(i) + .getFacadeBlock(i, tile.getCoverIDAtSide(i), tile.getComplexCoverDataAtSide(i), tile); if (facadeBlock != null) { - return tile.getCoverBehaviorAtSideNew(i).getFacadeMeta(i, tile.getCoverIDAtSide(i), tile.getComplexCoverDataAtSide(i), tile); + return tile.getCoverBehaviorAtSideNew(i) + .getFacadeMeta(i, tile.getCoverIDAtSide(i), tile.getComplexCoverDataAtSide(i), tile); } } } diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Metal.java b/src/main/java/gregtech/common/blocks/GT_Block_Metal.java index 7fcfd7a29a..2bb703a2f9 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Metal.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Metal.java @@ -26,11 +26,13 @@ public class GT_Block_Metal extends GT_Block_Storage { for (int i = 0; i < aMats.length; i++) { if (aMats[i].mMetaItemSubID > 0 && aMats[i].mHasParentMod) { - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + i + ".name", "Block of " + (GT_LanguageManager.i18nPlaceholder ? "%material" : aMats[i].mDefaultLocalName)); + GT_LanguageManager.addStringLocalization( + getUnlocalizedName() + "." + i + ".name", + "Block of " + (GT_LanguageManager.i18nPlaceholder ? "%material" : aMats[i].mDefaultLocalName)); GT_OreDictUnificator.registerOre(aPrefix, aMats[i], new ItemStack(this, 1, i)); } } - if (aMats.length<16 && mNEIisLoaded) { + if (aMats.length < 16 && mNEIisLoaded) { for (int i = aMats.length; i < 16; i++) codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i)); } } diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Ores.java b/src/main/java/gregtech/common/blocks/GT_Block_Ores.java index 3af861e167..3f0c829b50 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Ores.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Ores.java @@ -1,5 +1,10 @@ package gregtech.common.blocks; +import static gregtech.api.enums.Textures.BlockIcons.BASALT_STONE; +import static gregtech.api.enums.Textures.BlockIcons.GRANITE_BLACK_STONE; +import static gregtech.api.enums.Textures.BlockIcons.GRANITE_RED_STONE; +import static gregtech.api.enums.Textures.BlockIcons.MARBLE_STONE; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.GT_Mod; @@ -8,6 +13,7 @@ import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.interfaces.ITexture; import gregtech.api.render.TextureFactory; +import java.util.Arrays; import net.minecraft.block.Block; import net.minecraft.block.material.MapColor; import net.minecraft.block.material.Material; @@ -16,13 +22,6 @@ import net.minecraft.util.IIcon; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import java.util.Arrays; - -import static gregtech.api.enums.Textures.BlockIcons.BASALT_STONE; -import static gregtech.api.enums.Textures.BlockIcons.GRANITE_BLACK_STONE; -import static gregtech.api.enums.Textures.BlockIcons.GRANITE_RED_STONE; -import static gregtech.api.enums.Textures.BlockIcons.MARBLE_STONE; - public class GT_Block_Ores extends GT_Block_Ores_Abstract { private static final String UNLOCALIZED_NAME = "gt.blockores"; @@ -36,8 +35,18 @@ public class GT_Block_Ores extends GT_Block_Ores_Abstract { } @Override - public OrePrefixes[] getProcessingPrefix() { //Must have 8 entries; an entry can be null to disable automatic recipes. - return new OrePrefixes[]{OrePrefixes.ore, OrePrefixes.oreNetherrack, OrePrefixes.oreEndstone, OrePrefixes.oreBlackgranite, OrePrefixes.oreRedgranite, OrePrefixes.oreMarble, OrePrefixes.oreBasalt, null}; + public OrePrefixes[] + getProcessingPrefix() { // Must have 8 entries; an entry can be null to disable automatic recipes. + return new OrePrefixes[] { + OrePrefixes.ore, + OrePrefixes.oreNetherrack, + OrePrefixes.oreEndstone, + OrePrefixes.oreBlackgranite, + OrePrefixes.oreRedgranite, + OrePrefixes.oreMarble, + OrePrefixes.oreBasalt, + null + }; } @Override @@ -100,25 +109,49 @@ public class GT_Block_Ores extends GT_Block_Ores_Abstract { } @Override - public Materials[] getDroppedDusts() { //Must have 8 entries; can be null. - return new Materials[]{Materials.Stone, Materials.Netherrack, Materials.Endstone, Materials.GraniteBlack, Materials.GraniteRed, Materials.Marble, Materials.Basalt, Materials.Stone}; + public Materials[] getDroppedDusts() { // Must have 8 entries; can be null. + return new Materials[] { + Materials.Stone, + Materials.Netherrack, + Materials.Endstone, + Materials.GraniteBlack, + Materials.GraniteRed, + Materials.Marble, + Materials.Basalt, + Materials.Stone + }; } @Override public boolean[] getEnabledMetas() { - return new boolean[]{true, true, true, GT_Mod.gregtechproxy.enableBlackGraniteOres, GT_Mod.gregtechproxy.enableRedGraniteOres, GT_Mod.gregtechproxy.enableMarbleOres, GT_Mod.gregtechproxy.enableBasaltOres, true}; + return new boolean[] { + true, + true, + true, + GT_Mod.gregtechproxy.enableBlackGraniteOres, + GT_Mod.gregtechproxy.enableRedGraniteOres, + GT_Mod.gregtechproxy.enableMarbleOres, + GT_Mod.gregtechproxy.enableBasaltOres, + true + }; } @Override public ITexture[] getTextureSet() { - final ITexture[] rTextures = new ITexture[16]; //Must have 16 entries. + final ITexture[] rTextures = new ITexture[16]; // Must have 16 entries. Arrays.fill(rTextures, TextureFactory.of(Blocks.stone)); rTextures[1] = TextureFactory.of(Blocks.netherrack); rTextures[2] = TextureFactory.of(Blocks.end_stone); - rTextures[3] = TextureFactory.builder().addIcon(GRANITE_BLACK_STONE).stdOrient().build(); - rTextures[4] = TextureFactory.builder().addIcon(GRANITE_RED_STONE).stdOrient().build(); - rTextures[5] = TextureFactory.builder().addIcon(MARBLE_STONE).stdOrient().build(); - rTextures[6] = TextureFactory.builder().addIcon(BASALT_STONE).stdOrient().build(); + rTextures[3] = TextureFactory.builder() + .addIcon(GRANITE_BLACK_STONE) + .stdOrient() + .build(); + rTextures[4] = + TextureFactory.builder().addIcon(GRANITE_RED_STONE).stdOrient().build(); + rTextures[5] = + TextureFactory.builder().addIcon(MARBLE_STONE).stdOrient().build(); + rTextures[6] = + TextureFactory.builder().addIcon(BASALT_STONE).stdOrient().build(); return rTextures; } } diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Ores_Abstract.java b/src/main/java/gregtech/common/blocks/GT_Block_Ores_Abstract.java index 3a7f231761..93aa9992ea 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Ores_Abstract.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Ores_Abstract.java @@ -14,6 +14,10 @@ import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; import gregtech.common.render.GT_Renderer_Block; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; import net.minecraft.block.Block; import net.minecraft.block.ITileEntityProvider; import net.minecraft.block.material.Material; @@ -33,11 +37,6 @@ import net.minecraft.util.StatCollector; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements ITileEntityProvider { private static final String DOT_NAME = ".name"; public static ThreadLocal<GT_TileEntity_Ores> mTemporaryTileEntity = new ThreadLocal<>(); @@ -45,7 +44,8 @@ public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements public static boolean tHideOres; public static Set<Materials> aBlockedOres = new HashSet<>(); - protected GT_Block_Ores_Abstract(String aUnlocalizedName, int aOreMetaCount, boolean aHideFirstMeta, Material aMaterial) { + protected GT_Block_Ores_Abstract( + String aUnlocalizedName, int aOreMetaCount, boolean aHideFirstMeta, Material aMaterial) { super(GT_Item_Ores.class, aUnlocalizedName, aMaterial); this.isBlockContainer = true; setStepSound(soundTypeStone); @@ -60,10 +60,24 @@ public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements if (GregTech_API.sGeneratedMaterials[i] != null) { for (int j = 0; j < aOreMetaCount; j++) { if (!this.getEnabledMetas()[j]) continue; - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + (j * 1000)) + DOT_NAME, GT_LanguageManager.i18nPlaceholder ? getLocalizedNameFormat(GregTech_API.sGeneratedMaterials[i]) : getLocalizedName(GregTech_API.sGeneratedMaterials[i])); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + ((i + 16000) + (j * 1000)) + DOT_NAME, "Small " + (GT_LanguageManager.i18nPlaceholder ? getLocalizedNameFormat(GregTech_API.sGeneratedMaterials[i]) : getLocalizedName(GregTech_API.sGeneratedMaterials[i]))); - if ((GregTech_API.sGeneratedMaterials[i].mTypes & 0x8) != 0 && !aBlockedOres.contains(GregTech_API.sGeneratedMaterials[i])) { - GT_OreDictUnificator.registerOre(this.getProcessingPrefix()[j] != null ? this.getProcessingPrefix()[j].get(GregTech_API.sGeneratedMaterials[i]) : "", new ItemStack(this, 1, i + (j * 1000))); + GT_LanguageManager.addStringLocalization( + getUnlocalizedName() + "." + (i + (j * 1000)) + DOT_NAME, + GT_LanguageManager.i18nPlaceholder + ? getLocalizedNameFormat(GregTech_API.sGeneratedMaterials[i]) + : getLocalizedName(GregTech_API.sGeneratedMaterials[i])); + GT_LanguageManager.addStringLocalization( + getUnlocalizedName() + "." + ((i + 16000) + (j * 1000)) + DOT_NAME, + "Small " + + (GT_LanguageManager.i18nPlaceholder + ? getLocalizedNameFormat(GregTech_API.sGeneratedMaterials[i]) + : getLocalizedName(GregTech_API.sGeneratedMaterials[i]))); + if ((GregTech_API.sGeneratedMaterials[i].mTypes & 0x8) != 0 + && !aBlockedOres.contains(GregTech_API.sGeneratedMaterials[i])) { + GT_OreDictUnificator.registerOre( + this.getProcessingPrefix()[j] != null + ? this.getProcessingPrefix()[j].get(GregTech_API.sGeneratedMaterials[i]) + : "", + new ItemStack(this, 1, i + (j * 1000))); if (tHideOres) { if (!(j == 0 && !aHideFirstMeta)) { codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + (j * 1000))); @@ -138,7 +152,16 @@ public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements } @Override - public boolean onBlockActivated(World aWorld, int aX, int aY, int aZ, EntityPlayer aPlayer, int aSide, float aOffsetX, float aOffsetY, float aOffsetZ) { + public boolean onBlockActivated( + World aWorld, + int aX, + int aY, + int aZ, + EntityPlayer aPlayer, + int aSide, + float aOffsetX, + float aOffsetY, + float aOffsetZ) { if (!aPlayer.isSneaking() || !aPlayer.capabilities.isCreativeMode) { return false; } @@ -154,7 +177,8 @@ public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements } @Override - public boolean onBlockEventReceived(World p_149696_1_, int p_149696_2_, int p_149696_3_, int p_149696_4_, int p_149696_5_, int p_149696_6_) { + public boolean onBlockEventReceived( + World p_149696_1_, int p_149696_2_, int p_149696_3_, int p_149696_4_, int p_149696_5_, int p_149696_6_) { super.onBlockEventReceived(p_149696_1_, p_149696_2_, p_149696_3_, p_149696_4_, p_149696_5_, p_149696_6_); TileEntity tileentity = p_149696_1_.getTileEntity(p_149696_2_, p_149696_3_, p_149696_4_); return tileentity != null && tileentity.receiveClientEvent(p_149696_5_, p_149696_6_); @@ -181,7 +205,15 @@ public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements } @Override - public float getExplosionResistance(Entity entity, World aWorld, int aX, int aY, int aZ, double explosionX, double explosionY, double explosionZ) { + public float getExplosionResistance( + Entity entity, + World aWorld, + int aX, + int aY, + int aZ, + double explosionX, + double explosionY, + double explosionZ) { return 1.0F + getHarvestLevel(aWorld.getBlockMetadata(aX, aY, aZ)) * 1.0F; } @@ -240,13 +272,13 @@ public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements @Override @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister aIconRegister) { - } + public void registerBlockIcons(IIconRegister aIconRegister) {} @Override @SideOnly(Side.CLIENT) public boolean addHitEffects(World worldObj, MovingObjectPosition target, EffectRenderer effectRenderer) { - GT_Renderer_Block.addHitEffects(effectRenderer, this, worldObj, target.blockX, target.blockY, target.blockZ, target.sideHit); + GT_Renderer_Block.addHitEffects( + effectRenderer, this, worldObj, target.blockX, target.blockY, target.blockZ, target.sideHit); return true; } @@ -276,13 +308,14 @@ public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements aWorld.removeTileEntity(aX, aY, aZ); } - public abstract OrePrefixes[] getProcessingPrefix(); //Must have 8 entries; an entry can be null to disable automatic recipes. + public abstract OrePrefixes[] + getProcessingPrefix(); // Must have 8 entries; an entry can be null to disable automatic recipes. - public abstract boolean[] getEnabledMetas(); //Must have 8 entries. + public abstract boolean[] getEnabledMetas(); // Must have 8 entries. public abstract Block getDroppedBlock(); - public abstract Materials[] getDroppedDusts(); //Must have 8 entries; can be null. + public abstract Materials[] getDroppedDusts(); // Must have 8 entries; can be null. @Override public ArrayList<ItemStack> getDrops(World aWorld, int aX, int aY, int aZ, int aMeta, int aFortune) { @@ -290,7 +323,9 @@ public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements if ((tTileEntity instanceof GT_TileEntity_Ores)) { return ((GT_TileEntity_Ores) tTileEntity).getDrops(getDroppedBlock(), aFortune); } - return mTemporaryTileEntity.get() == null ? new ArrayList<>() : mTemporaryTileEntity.get().getDrops(getDroppedBlock(), aFortune); + return mTemporaryTileEntity.get() == null + ? new ArrayList<>() + : mTemporaryTileEntity.get().getDrops(getDroppedBlock(), aFortune); } @Override @@ -298,7 +333,7 @@ public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements return new GT_TileEntity_Ores(); } - public abstract ITexture[] getTextureSet(); //Must have 16 entries. + public abstract ITexture[] getTextureSet(); // Must have 16 entries. @SuppressWarnings({"unchecked"}) @Override diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB1.java b/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB1.java index f749b8ac5b..73fe674fbe 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB1.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB1.java @@ -25,10 +25,19 @@ public class GT_Block_Ores_UB1 extends GT_Block_Ores_Abstract { } @Override - public OrePrefixes[] getProcessingPrefix() { //Must have 8 entries. - return new OrePrefixes[]{OrePrefixes.oreRedgranite, OrePrefixes.oreBlackgranite, OrePrefixes.ore, OrePrefixes.ore, OrePrefixes.ore, OrePrefixes.oreBasalt, OrePrefixes.ore, OrePrefixes.ore}; + public OrePrefixes[] getProcessingPrefix() { // Must have 8 entries. + return new OrePrefixes[] { + OrePrefixes.oreRedgranite, + OrePrefixes.oreBlackgranite, + OrePrefixes.ore, + OrePrefixes.ore, + OrePrefixes.ore, + OrePrefixes.oreBasalt, + OrePrefixes.ore, + OrePrefixes.ore + }; } - + @Override public IIcon getIcon(int side, int meta) { return aUBBlock.getIcon(side, (meta / 1000) % 8); @@ -45,17 +54,43 @@ public class GT_Block_Ores_UB1 extends GT_Block_Ores_Abstract { } @Override - public Materials[] getDroppedDusts() { //Must have 8 entries; can be null. - return new Materials[]{Materials.Stone, Materials.Stone, Materials.Stone, Materials.Stone, Materials.Stone, Materials.Stone, Materials.Stone, Materials.Stone}; + public Materials[] getDroppedDusts() { // Must have 8 entries; can be null. + return new Materials[] { + Materials.Stone, + Materials.Stone, + Materials.Stone, + Materials.Stone, + Materials.Stone, + Materials.Stone, + Materials.Stone, + Materials.Stone + }; } @Override public boolean[] getEnabledMetas() { - return new boolean[]{true, true, true, true, true, true, true, true}; + return new boolean[] {true, true, true, true, true, true, true, true}; } @Override - public ITexture[] getTextureSet() { //Must have 16 entries. - return new ITexture[]{TextureFactory.of(aUBBlock, 0), TextureFactory.of(aUBBlock, 1), TextureFactory.of(aUBBlock, 2), TextureFactory.of(aUBBlock, 3), TextureFactory.of(aUBBlock, 4), TextureFactory.of(aUBBlock, 5), TextureFactory.of(aUBBlock, 6), TextureFactory.of(aUBBlock, 7), TextureFactory.of(aUBBlock, 0), TextureFactory.of(aUBBlock, 1), TextureFactory.of(aUBBlock, 2), TextureFactory.of(aUBBlock, 3), TextureFactory.of(aUBBlock, 4), TextureFactory.of(aUBBlock, 5), TextureFactory.of(aUBBlock, 6), TextureFactory.of(aUBBlock, 7)}; + public ITexture[] getTextureSet() { // Must have 16 entries. + return new ITexture[] { + TextureFactory.of(aUBBlock, 0), + TextureFactory.of(aUBBlock, 1), + TextureFactory.of(aUBBlock, 2), + TextureFactory.of(aUBBlock, 3), + TextureFactory.of(aUBBlock, 4), + TextureFactory.of(aUBBlock, 5), + TextureFactory.of(aUBBlock, 6), + TextureFactory.of(aUBBlock, 7), + TextureFactory.of(aUBBlock, 0), + TextureFactory.of(aUBBlock, 1), + TextureFactory.of(aUBBlock, 2), + TextureFactory.of(aUBBlock, 3), + TextureFactory.of(aUBBlock, 4), + TextureFactory.of(aUBBlock, 5), + TextureFactory.of(aUBBlock, 6), + TextureFactory.of(aUBBlock, 7) + }; } } diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB2.java b/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB2.java index a1e0f69637..0d7e2c3428 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB2.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB2.java @@ -25,10 +25,20 @@ public class GT_Block_Ores_UB2 extends GT_Block_Ores_Abstract { } @Override - public OrePrefixes[] getProcessingPrefix() { //Must have 8 entries; an entry can be null to disable automatic recipes. - return new OrePrefixes[]{OrePrefixes.ore, OrePrefixes.ore, OrePrefixes.oreMarble, OrePrefixes.ore, OrePrefixes.ore, OrePrefixes.ore, OrePrefixes.ore, OrePrefixes.ore}; + public OrePrefixes[] + getProcessingPrefix() { // Must have 8 entries; an entry can be null to disable automatic recipes. + return new OrePrefixes[] { + OrePrefixes.ore, + OrePrefixes.ore, + OrePrefixes.oreMarble, + OrePrefixes.ore, + OrePrefixes.ore, + OrePrefixes.ore, + OrePrefixes.ore, + OrePrefixes.ore + }; } - + @Override public IIcon getIcon(int side, int meta) { return aUBBlock.getIcon(side, (meta / 1000) % 8); @@ -45,17 +55,43 @@ public class GT_Block_Ores_UB2 extends GT_Block_Ores_Abstract { } @Override - public Materials[] getDroppedDusts() { //Must have 8 entries; can be null. - return new Materials[]{Materials.Stone, Materials.Stone, Materials.Stone, Materials.Stone, Materials.Stone, Materials.Stone, Materials.Stone, Materials.Stone}; + public Materials[] getDroppedDusts() { // Must have 8 entries; can be null. + return new Materials[] { + Materials.Stone, + Materials.Stone, + Materials.Stone, + Materials.Stone, + Materials.Stone, + Materials.Stone, + Materials.Stone, + Materials.Stone + }; } @Override public boolean[] getEnabledMetas() { - return new boolean[]{true, true, true, true, true, true, true, true}; + return new boolean[] {true, true, true, true, true, true, true, true}; } @Override - public ITexture[] getTextureSet() { //Must have 16 entries. - return new ITexture[]{TextureFactory.of(aUBBlock, 0), TextureFactory.of(aUBBlock, 1), TextureFactory.of(aUBBlock, 2), TextureFactory.of(aUBBlock, 3), TextureFactory.of(aUBBlock, 4), TextureFactory.of(aUBBlock, 5), TextureFactory.of(aUBBlock, 6), TextureFactory.of(aUBBlock, 7), TextureFactory.of(aUBBlock, 0), TextureFactory.of(aUBBlock, 1), TextureFactory.of(aUBBlock, 2), TextureFactory.of(aUBBlock, 3), TextureFactory.of(aUBBlock, 4), TextureFactory.of(aUBBlock, 5), TextureFactory.of(aUBBlock, 6), TextureFactory.of(aUBBlock, 7)}; + public ITexture[] getTextureSet() { // Must have 16 entries. + return new ITexture[] { + TextureFactory.of(aUBBlock, 0), + TextureFactory.of(aUBBlock, 1), + TextureFactory.of(aUBBlock, 2), + TextureFactory.of(aUBBlock, 3), + TextureFactory.of(aUBBlock, 4), + TextureFactory.of(aUBBlock, 5), + TextureFactory.of(aUBBlock, 6), + TextureFactory.of(aUBBlock, 7), + TextureFactory.of(aUBBlock, 0), + TextureFactory.of(aUBBlock, 1), + TextureFactory.of(aUBBlock, 2), + TextureFactory.of(aUBBlock, 3), + TextureFactory.of(aUBBlock, 4), + TextureFactory.of(aUBBlock, 5), + TextureFactory.of(aUBBlock, 6), + TextureFactory.of(aUBBlock, 7) + }; } } diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB3.java b/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB3.java index 280b6450df..5754f87454 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB3.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB3.java @@ -25,10 +25,20 @@ public class GT_Block_Ores_UB3 extends GT_Block_Ores_Abstract { } @Override - public OrePrefixes[] getProcessingPrefix() { //Must have 8 entries; an entry can be null to disable automatic recipes. - return new OrePrefixes[]{OrePrefixes.ore, OrePrefixes.ore, OrePrefixes.ore, OrePrefixes.ore, OrePrefixes.ore, OrePrefixes.ore, OrePrefixes.ore, OrePrefixes.ore}; + public OrePrefixes[] + getProcessingPrefix() { // Must have 8 entries; an entry can be null to disable automatic recipes. + return new OrePrefixes[] { + OrePrefixes.ore, + OrePrefixes.ore, + OrePrefixes.ore, + OrePrefixes.ore, + OrePrefixes.ore, + OrePrefixes.ore, + OrePrefixes.ore, + OrePrefixes.ore + }; } - + @Override public IIcon getIcon(int side, int meta) { return aUBBlock.getIcon(side, (meta / 1000) % 8); @@ -45,17 +55,43 @@ public class GT_Block_Ores_UB3 extends GT_Block_Ores_Abstract { } @Override - public Materials[] getDroppedDusts() { //Must have 8 entries; can be null. - return new Materials[]{Materials.Stone, Materials.Stone, Materials.Stone, Materials.Stone, Materials.Stone, Materials.Stone, Materials.Stone, Materials.Stone}; + public Materials[] getDroppedDusts() { // Must have 8 entries; can be null. + return new Materials[] { + Materials.Stone, + Materials.Stone, + Materials.Stone, + Materials.Stone, + Materials.Stone, + Materials.Stone, + Materials.Stone, + Materials.Stone + }; } @Override public boolean[] getEnabledMetas() { - return new boolean[]{true, true, true, true, true, true, true, true}; + return new boolean[] {true, true, true, true, true, true, true, true}; } @Override - public ITexture[] getTextureSet() { //Must have 16 entries. - return new ITexture[]{TextureFactory.of(aUBBlock, 0), TextureFactory.of(aUBBlock, 1), TextureFactory.of(aUBBlock, 2), TextureFactory.of(aUBBlock, 3), TextureFactory.of(aUBBlock, 4), TextureFactory.of(aUBBlock, 5), TextureFactory.of(aUBBlock, 6), TextureFactory.of(aUBBlock, 7), TextureFactory.of(aUBBlock, 0), TextureFactory.of(aUBBlock, 1), TextureFactory.of(aUBBlock, 2), TextureFactory.of(aUBBlock, 3), TextureFactory.of(aUBBlock, 4), TextureFactory.of(aUBBlock, 5), TextureFactory.of(aUBBlock, 6), TextureFactory.of(aUBBlock, 7)}; + public ITexture[] getTextureSet() { // Must have 16 entries. + return new ITexture[] { + TextureFactory.of(aUBBlock, 0), + TextureFactory.of(aUBBlock, 1), + TextureFactory.of(aUBBlock, 2), + TextureFactory.of(aUBBlock, 3), + TextureFactory.of(aUBBlock, 4), + TextureFactory.of(aUBBlock, 5), + TextureFactory.of(aUBBlock, 6), + TextureFactory.of(aUBBlock, 7), + TextureFactory.of(aUBBlock, 0), + TextureFactory.of(aUBBlock, 1), + TextureFactory.of(aUBBlock, 2), + TextureFactory.of(aUBBlock, 3), + TextureFactory.of(aUBBlock, 4), + TextureFactory.of(aUBBlock, 5), + TextureFactory.of(aUBBlock, 6), + TextureFactory.of(aUBBlock, 7) + }; } } diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java b/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java index 776580f77b..37887ac5f6 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java @@ -1,5 +1,7 @@ package gregtech.common.blocks; +import static gregtech.api.objects.XSTR.XSTR_INSTANCE; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.GregTech_API; @@ -9,6 +11,7 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.WorldSpawnedEventBuilder; +import java.util.List; import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; @@ -27,10 +30,6 @@ import net.minecraft.world.Explosion; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import java.util.List; - -import static gregtech.api.objects.XSTR.XSTR_INSTANCE; - public class GT_Block_Reinforced extends GT_Generic_Block { public GT_Block_Reinforced(String aName) { @@ -54,9 +53,11 @@ public class GT_Block_Reinforced extends GT_Generic_Block { GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".11.name", "Neutronium Reinforced Block"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".12.name", "Raw Deep Dark Portal Block"); ItemList.Block_BronzePlate.set(new ItemStack(this.setHardness(60.0f).setResistance(150.0f), 1, 0)); - ItemList.Block_IridiumTungstensteel.set(new ItemStack(this.setHardness(400.0f).setResistance(600.0f), 1, 1)); + ItemList.Block_IridiumTungstensteel.set( + new ItemStack(this.setHardness(400.0f).setResistance(600.0f), 1, 1)); ItemList.Block_Plascrete.set(new ItemStack(this.setHardness(5.0f).setResistance(6.0f), 1, 2)); - ItemList.Block_TungstenSteelReinforced.set(new ItemStack(this.setHardness(250.0f).setResistance(400.0f), 1, 3)); + ItemList.Block_TungstenSteelReinforced.set( + new ItemStack(this.setHardness(250.0f).setResistance(400.0f), 1, 3)); ItemList.Block_BrittleCharcoal.set(new ItemStack(this.setHardness(0.5f).setResistance(8.0f), 1, 4)); ItemList.Block_Powderbarrel.set(new ItemStack(this.setHardness(2.5f).setResistance(2.0f), 1, 5)); ItemList.Block_SSFUEL.set(new ItemStack(this.setHardness(2.5f).setResistance(2.0f), 1, 6)); @@ -64,11 +65,24 @@ public class GT_Block_Reinforced extends GT_Generic_Block { ItemList.Block_SteelPlate.set(new ItemStack(this.setHardness(150.0f).setResistance(200.0f), 1, 8)); ItemList.Block_TitaniumPlate.set(new ItemStack(this.setHardness(200.0f).setResistance(300.0f), 1, 9)); ItemList.Block_NaquadahPlate.set(new ItemStack(this.setHardness(500.0f).setResistance(1000.0f), 1, 10)); - ItemList.Block_NeutroniumPlate.set(new ItemStack(this.setHardness(750.0f).setResistance(2500.0f), 1, 11)); - ItemList.Block_BedrockiumCompressed.set(new ItemStack(this.setHardness(1500.0f).setResistance(5000.0f), 1, 12)); - GT_ModHandler.addShapelessCraftingRecipe(new ItemStack(Items.coal, 1, 1), new Object[]{ItemList.Block_BrittleCharcoal.get(1)}); - GT_ModHandler.addCraftingRecipe(ItemList.Block_Powderbarrel.get(1L),GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"WSW","GGG","WGW", 'W', OrePrefixes.plate.get(Materials.Wood), 'G', new ItemStack(Items.gunpowder,1),'S',new ItemStack(Items.string,1)}); - + ItemList.Block_NeutroniumPlate.set( + new ItemStack(this.setHardness(750.0f).setResistance(2500.0f), 1, 11)); + ItemList.Block_BedrockiumCompressed.set( + new ItemStack(this.setHardness(1500.0f).setResistance(5000.0f), 1, 12)); + GT_ModHandler.addShapelessCraftingRecipe( + new ItemStack(Items.coal, 1, 1), new Object[] {ItemList.Block_BrittleCharcoal.get(1)}); + GT_ModHandler.addCraftingRecipe( + ItemList.Block_Powderbarrel.get(1L), GT_ModHandler.RecipeBits.REVERSIBLE, new Object[] { + "WSW", + "GGG", + "WGW", + 'W', + OrePrefixes.plate.get(Materials.Wood), + 'G', + new ItemStack(Items.gunpowder, 1), + 'S', + new ItemStack(Items.string, 1) + }); } @Override @@ -80,10 +94,10 @@ public class GT_Block_Reinforced extends GT_Generic_Block { @Override public int getHarvestLevel(int aMeta) { - if (aMeta == 4||aMeta == 5 || aMeta == 6 || aMeta == 7) return 1; + if (aMeta == 4 || aMeta == 5 || aMeta == 6 || aMeta == 7) return 1; if (aMeta == 2) return 2; - if (aMeta == 9||aMeta == 3 || aMeta == 1) return 5; - if (aMeta == 10||aMeta == 11) return 7; + if (aMeta == 9 || aMeta == 3 || aMeta == 1) return 5; + if (aMeta == 10 || aMeta == 11) return 7; return 4; } @@ -102,11 +116,11 @@ public class GT_Block_Reinforced extends GT_Generic_Block { case 4: return Blocks.coal_block.getIcon(0, 0); case 5: - return Textures.BlockIcons.COVER_WOOD_PLATE.getIcon(); + return Textures.BlockIcons.COVER_WOOD_PLATE.getIcon(); case 6: - return Blocks.coal_block.getIcon(0, 0); + return Blocks.coal_block.getIcon(0, 0); case 7: - return Blocks.coal_block.getIcon(0, 0); + return Blocks.coal_block.getIcon(0, 0); case 8: return Textures.BlockIcons.BLOCK_STEELPREIN.getIcon(); case 9: @@ -143,7 +157,7 @@ public class GT_Block_Reinforced extends GT_Generic_Block { if (tMeta == 3) { return 250.0F; } - if (tMeta == 4||tMeta == 5 || tMeta == 6 || tMeta == 7) { + if (tMeta == 4 || tMeta == 5 || tMeta == 6 || tMeta == 7) { return 0.5F; } if (tMeta == 8) { @@ -162,7 +176,8 @@ public class GT_Block_Reinforced extends GT_Generic_Block { } @Override - public float getExplosionResistance(Entity entity, World world, int x, int y, int z, double explosionX, double explosionY, double explosionZ) { + public float getExplosionResistance( + Entity entity, World world, int x, int y, int z, double explosionX, double explosionY, double explosionZ) { if (world == null) { return 0.0F; } @@ -196,7 +211,6 @@ public class GT_Block_Reinforced extends GT_Generic_Block { } if (tMeta == 11) { return 2500.0F; - } return super.getExplosionResistance(entity, world, x, y, z, explosionX, explosionY, explosionZ); } @@ -237,7 +251,8 @@ public class GT_Block_Reinforced extends GT_Generic_Block { } @Override - public void dropBlockAsItemWithChance(World aWorld, int aX, int aY, int aZ, int aMetadata, float chance, int aFortune) { + public void dropBlockAsItemWithChance( + World aWorld, int aX, int aY, int aZ, int aMetadata, float chance, int aFortune) { if (aMetadata == 4) { this.dropBlockAsItem(aWorld, aX, aY, aZ, new ItemStack(Items.coal, XSTR_INSTANCE.nextInt(2) + 1, 1)); } else { @@ -246,67 +261,73 @@ public class GT_Block_Reinforced extends GT_Generic_Block { } @Override - public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z) - { - if(!world.isRemote && world.getBlockMetadata(x, y, z)==5){ - EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, x + 0.5F, y + 0.5F, z + 0.5F, player); - world.spawnEntityInWorld(entitytntprimed); - new WorldSpawnedEventBuilder.SoundAtEntityEventBuilder() - .setPitch(1f) - .setVolume(1f) - .setIdentifier(SoundResource.GAME_TNT_PRIMED) - .setEntity(entitytntprimed) - .setWorld(world) - .run(); - world.setBlockToAir(x, y, z); - return false; - } - return super.removedByPlayer(world, player, x, y, z); + public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z) { + if (!world.isRemote && world.getBlockMetadata(x, y, z) == 5) { + EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, x + 0.5F, y + 0.5F, z + 0.5F, player); + world.spawnEntityInWorld(entitytntprimed); + new WorldSpawnedEventBuilder.SoundAtEntityEventBuilder() + .setPitch(1f) + .setVolume(1f) + .setIdentifier(SoundResource.GAME_TNT_PRIMED) + .setEntity(entitytntprimed) + .setWorld(world) + .run(); + world.setBlockToAir(x, y, z); + return false; + } + return super.removedByPlayer(world, player, x, y, z); } @Override - public void onBlockAdded(World world, int x, int y, int z) - { - super.onBlockAdded(world, x, y, z); - if (world.isBlockIndirectlyGettingPowered(x, y, z)&&world.getBlockMetadata(x, y, z)==5) { - removedByPlayer(world, null, x, y, z); - } + public void onBlockAdded(World world, int x, int y, int z) { + super.onBlockAdded(world, x, y, z); + if (world.isBlockIndirectlyGettingPowered(x, y, z) && world.getBlockMetadata(x, y, z) == 5) { + removedByPlayer(world, null, x, y, z); + } } @Override - public void onNeighborBlockChange(World world, int x, int y, int z, Block neighbor) - { - if (world.isBlockIndirectlyGettingPowered(x, y, z)&&world.getBlockMetadata(x, y, z)==5) { - removedByPlayer(world, null, x, y, z); - } + public void onNeighborBlockChange(World world, int x, int y, int z, Block neighbor) { + if (world.isBlockIndirectlyGettingPowered(x, y, z) && world.getBlockMetadata(x, y, z) == 5) { + removedByPlayer(world, null, x, y, z); + } } @Override public void onBlockExploded(World world, int x, int y, int z, Explosion explosion) { - if (!world.isRemote && world.getBlockMetadata(x, y, z)==5){ - EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, x + 0.5F, y + 0.5F, z + 0.5F, explosion.getExplosivePlacedBy()); - entitytntprimed.fuse = (world.rand.nextInt(entitytntprimed.fuse / 4) + entitytntprimed.fuse / 8); - world.spawnEntityInWorld(entitytntprimed); - } - super.onBlockExploded(world, x, y, z, explosion); + if (!world.isRemote && world.getBlockMetadata(x, y, z) == 5) { + EntityTNTPrimed entitytntprimed = + new EntityTNTPrimed(world, x + 0.5F, y + 0.5F, z + 0.5F, explosion.getExplosivePlacedBy()); + entitytntprimed.fuse = (world.rand.nextInt(entitytntprimed.fuse / 4) + entitytntprimed.fuse / 8); + world.spawnEntityInWorld(entitytntprimed); + } + super.onBlockExploded(world, x, y, z, explosion); } @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float xOffset, float yOffset, float zOffset) - { - if ((player.getCurrentEquippedItem() != null) && (player.getCurrentEquippedItem().getItem() == Items.flint_and_steel)&&world.getBlockMetadata(x, y, z)==5) - { - removedByPlayer(world, player, x, y, z); + public boolean onBlockActivated( + World world, + int x, + int y, + int z, + EntityPlayer player, + int side, + float xOffset, + float yOffset, + float zOffset) { + if ((player.getCurrentEquippedItem() != null) + && (player.getCurrentEquippedItem().getItem() == Items.flint_and_steel) + && world.getBlockMetadata(x, y, z) == 5) { + removedByPlayer(world, player, x, y, z); - return true; - } - return super.onBlockActivated(world, x, y, z, player, side, xOffset, yOffset, zOffset); + return true; + } + return super.onBlockActivated(world, x, y, z, player, side, xOffset, yOffset, zOffset); } @Override @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister aIconRegister) { - } + public void registerBlockIcons(IIconRegister aIconRegister) {} @Override @SideOnly(Side.CLIENT) diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Stones.java b/src/main/java/gregtech/common/blocks/GT_Block_Stones.java index 3838f30f0b..1ee8e6df50 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Stones.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Stones.java @@ -29,10 +29,14 @@ public class GT_Block_Stones extends GT_Block_Stones_Abstract { GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".13.name", "Mossy Basalt Bricks"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".14.name", "Chiseled Basalt"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".15.name", "Smooth Basalt"); - for(int i = 0;i<16;i++){ - GT_OreDictUnificator.registerOre(OrePrefixes.stone, i < 8 ? Materials.Marble : Materials.Basalt, new ItemStack(this, 1, i)); - GT_OreDictUnificator.registerOre(OrePrefixes.block, i < 8 ? Materials.Marble : Materials.Basalt, new ItemStack(this, 1, i)); - GT_OreDictUnificator.registerOre((i < 8 ? Materials.Marble.mName.toLowerCase() : Materials.Basalt.mName.toLowerCase()), new ItemStack(this, 1, i)); + for (int i = 0; i < 16; i++) { + GT_OreDictUnificator.registerOre( + OrePrefixes.stone, i < 8 ? Materials.Marble : Materials.Basalt, new ItemStack(this, 1, i)); + GT_OreDictUnificator.registerOre( + OrePrefixes.block, i < 8 ? Materials.Marble : Materials.Basalt, new ItemStack(this, 1, i)); + GT_OreDictUnificator.registerOre( + (i < 8 ? Materials.Marble.mName.toLowerCase() : Materials.Basalt.mName.toLowerCase()), + new ItemStack(this, 1, i)); } } diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Stones_Abstract.java b/src/main/java/gregtech/common/blocks/GT_Block_Stones_Abstract.java index b3c0a1811c..f40a6b8173 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Stones_Abstract.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Stones_Abstract.java @@ -8,6 +8,7 @@ import gregtech.api.interfaces.IOreRecipeRegistrator; import gregtech.api.items.GT_Generic_Block; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Utility; +import java.util.List; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; @@ -21,8 +22,6 @@ import net.minecraft.util.StatCollector; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import java.util.List; - public class GT_Block_Stones_Abstract extends GT_Generic_Block implements IOreRecipeRegistrator { public GT_Block_Stones_Abstract(Class<? extends ItemBlock> aItemClass, String aName) { super(aItemClass, aName, Material.rock); @@ -45,59 +44,118 @@ public class GT_Block_Stones_Abstract extends GT_Generic_Block implements IOreRe GT_ModHandler.addSmeltingRecipe(new ItemStack(this, 1, 13), new ItemStack(this, 1, 8)); GT_ModHandler.addSmeltingRecipe(new ItemStack(this, 1, 14), new ItemStack(this, 1, 8)); GT_ModHandler.addSmeltingRecipe(new ItemStack(this, 1, 15), new ItemStack(this, 1, 8)); - GT_Values.RA.addAssemblerRecipe(new ItemStack(this, 1, 0), ItemList.Circuit_Integrated.getWithDamage(0L, 4L, new Object[0]), new ItemStack(this, 1, 3), 50, 4); - GT_Values.RA.addAssemblerRecipe(new ItemStack(this, 1, 8), ItemList.Circuit_Integrated.getWithDamage(0L, 4L, new Object[0]), new ItemStack(this, 1, 11), 50, 4); - GT_ModHandler.addCraftingRecipe(new ItemStack(this, 1, 6), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"f", "X", 'X', new ItemStack(this, 1, 7)}); - GT_ModHandler.addCraftingRecipe(new ItemStack(this, 1, 14), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"f", "X", 'X', new ItemStack(this, 1, 15)}); - GT_ModHandler.addCraftingRecipe(new ItemStack(this, 1, 4), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"h", "X", 'X', new ItemStack(this, 1, 3)}); - GT_ModHandler.addCraftingRecipe(new ItemStack(this, 1, 12), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"h", "X", 'X', new ItemStack(this, 1, 11)}); - GT_ModHandler.addCraftingRecipe(new ItemStack(this, 1, 1), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"h", "X", 'X', new ItemStack(this, 1, 0)}); - GT_ModHandler.addCraftingRecipe(new ItemStack(this, 1, 9), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"h", "X", 'X', new ItemStack(this, 1, 8)}); + GT_Values.RA.addAssemblerRecipe( + new ItemStack(this, 1, 0), + ItemList.Circuit_Integrated.getWithDamage(0L, 4L, new Object[0]), + new ItemStack(this, 1, 3), + 50, + 4); + GT_Values.RA.addAssemblerRecipe( + new ItemStack(this, 1, 8), + ItemList.Circuit_Integrated.getWithDamage(0L, 4L, new Object[0]), + new ItemStack(this, 1, 11), + 50, + 4); + GT_ModHandler.addCraftingRecipe( + new ItemStack(this, 1, 6), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] {"f", "X", 'X', new ItemStack(this, 1, 7)}); + GT_ModHandler.addCraftingRecipe( + new ItemStack(this, 1, 14), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] {"f", "X", 'X', new ItemStack(this, 1, 15)}); + GT_ModHandler.addCraftingRecipe( + new ItemStack(this, 1, 4), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] {"h", "X", 'X', new ItemStack(this, 1, 3)}); + GT_ModHandler.addCraftingRecipe( + new ItemStack(this, 1, 12), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] {"h", "X", 'X', new ItemStack(this, 1, 11)}); + GT_ModHandler.addCraftingRecipe( + new ItemStack(this, 1, 1), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] {"h", "X", 'X', new ItemStack(this, 1, 0)}); + GT_ModHandler.addCraftingRecipe( + new ItemStack(this, 1, 9), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] {"h", "X", 'X', new ItemStack(this, 1, 8)}); GT_Values.RA.addForgeHammerRecipe(new ItemStack(this, 1, 3), new ItemStack(this, 1, 4), 16, 10); GT_Values.RA.addForgeHammerRecipe(new ItemStack(this, 1, 11), new ItemStack(this, 1, 12), 16, 10); GT_Values.RA.addForgeHammerRecipe(new ItemStack(this, 1, 0), new ItemStack(this, 1, 1), 16, 10); GT_Values.RA.addForgeHammerRecipe(new ItemStack(this, 1, 8), new ItemStack(this, 1, 9), 16, 10); - GT_ModHandler.addCraftingRecipe(new ItemStack(this, 4, 3), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"XX", "XX", 'X', new ItemStack(this, 4, 0)}); - GT_ModHandler.addCraftingRecipe(new ItemStack(this, 4, 11), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"XX", "XX", 'X', new ItemStack(this, 4, 8)}); - GT_ModHandler.addCraftingRecipe(new ItemStack(this, 4, 3), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"XX", "XX", 'X', new ItemStack(this, 4, 7)}); - GT_ModHandler.addCraftingRecipe(new ItemStack(this, 4, 11), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"XX", "XX", 'X', new ItemStack(this, 4, 15)}); + GT_ModHandler.addCraftingRecipe( + new ItemStack(this, 4, 3), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] {"XX", "XX", 'X', new ItemStack(this, 4, 0)}); + GT_ModHandler.addCraftingRecipe( + new ItemStack(this, 4, 11), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] {"XX", "XX", 'X', new ItemStack(this, 4, 8)}); + GT_ModHandler.addCraftingRecipe( + new ItemStack(this, 4, 3), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] {"XX", "XX", 'X', new ItemStack(this, 4, 7)}); + GT_ModHandler.addCraftingRecipe( + new ItemStack(this, 4, 11), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] {"XX", "XX", 'X', new ItemStack(this, 4, 15)}); } @Override - public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) { + public void registerOre( + OrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) { if (aOreDictName.equals(OreDictNames.craftingLensWhite.toString())) { - GT_Values.RA.addLaserEngraverRecipe(new ItemStack(this, 1, 7), GT_Utility.copyAmount(0L, new Object[]{aStack}), new ItemStack(this, 1, 6), 50, 16); - GT_Values.RA.addLaserEngraverRecipe(new ItemStack(this, 1, 15), GT_Utility.copyAmount(0L, new Object[]{aStack}), new ItemStack(this, 1, 14), 50, 16); + GT_Values.RA.addLaserEngraverRecipe( + new ItemStack(this, 1, 7), + GT_Utility.copyAmount(0L, new Object[] {aStack}), + new ItemStack(this, 1, 6), + 50, + 16); + GT_Values.RA.addLaserEngraverRecipe( + new ItemStack(this, 1, 15), + GT_Utility.copyAmount(0L, new Object[] {aStack}), + new ItemStack(this, 1, 14), + 50, + 16); } } + @Override public String getHarvestTool(int aMeta) { return "pickaxe"; } + @Override public int getHarvestLevel(int aMeta) { return 1; } + @Override public float getBlockHardness(World aWorld, int aX, int aY, int aZ) { return this.blockHardness = Blocks.stone.getBlockHardness(aWorld, aX, aY, aZ) * 3.0F; } + @Override public String getUnlocalizedName() { return this.mUnlocalizedName; } + @Override public String getLocalizedName() { return StatCollector.translateToLocal(this.mUnlocalizedName + ".name"); } + @Override public boolean canBeReplacedByLeaves(IBlockAccess aWorld, int aX, int aY, int aZ) { return false; } + @Override public boolean isNormalCube(IBlockAccess aWorld, int aX, int aY, int aZ) { return true; } + @Override public IIcon getIcon(int aSide, int aMeta) { if ((aMeta >= 0) && (aMeta < 16)) { @@ -110,10 +168,12 @@ public class GT_Block_Stones_Abstract extends GT_Generic_Block implements IOreRe public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess world, int x, int y, int z) { return world.getBlockMetadata(x, y, z) % 8 < 3; } + @Override public int damageDropped(int metadata) { return metadata % 8 == 0 ? metadata + 1 : metadata; } + @Override public int getDamageValue(World aWorld, int aX, int aY, int aZ) { return aWorld.getBlockMetadata(aX, aY, aZ); @@ -121,8 +181,7 @@ public class GT_Block_Stones_Abstract extends GT_Generic_Block implements IOreRe @Override @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister aIconRegister) { - } + public void registerBlockIcons(IIconRegister aIconRegister) {} @Override @SideOnly(Side.CLIENT) diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Storage.java b/src/main/java/gregtech/common/blocks/GT_Block_Storage.java index 7cb495a3d9..f318eab8ff 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Storage.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Storage.java @@ -4,6 +4,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.GregTech_API; import gregtech.api.items.GT_Generic_Block; +import java.util.List; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; @@ -17,8 +18,6 @@ import net.minecraft.util.StatCollector; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import java.util.List; - public class GT_Block_Storage extends GT_Generic_Block { protected GT_Block_Storage(Class<? extends ItemBlock> aItemClass, String aName, Material aMaterial) { @@ -89,8 +88,7 @@ public class GT_Block_Storage extends GT_Generic_Block { @Override @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister aIconRegister) { - } + public void registerBlockIcons(IIconRegister aIconRegister) {} @Override @SideOnly(Side.CLIENT) diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Casings1.java b/src/main/java/gregtech/common/blocks/GT_Item_Casings1.java index f61f8360fa..70748d5f1a 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_Casings1.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_Casings1.java @@ -1,13 +1,6 @@ package gregtech.common.blocks; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; - -import java.util.List; public class GT_Item_Casings1 extends GT_Item_Casings_Abstract { public GT_Item_Casings1(Block block) { diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Casings2.java b/src/main/java/gregtech/common/blocks/GT_Item_Casings2.java index 11a3aed3af..5e77ace15d 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_Casings2.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_Casings2.java @@ -1,11 +1,10 @@ package gregtech.common.blocks; +import java.util.List; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import java.util.List; - public class GT_Item_Casings2 extends GT_Item_Casings_Abstract { public GT_Item_Casings2(Block block) { super(block); diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Casings5.java b/src/main/java/gregtech/common/blocks/GT_Item_Casings5.java index a0890ce154..7486d25ec5 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_Casings5.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_Casings5.java @@ -4,19 +4,20 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.HeatingCoilLevel; import gregtech.api.util.GT_LanguageManager; +import java.util.List; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import java.util.List; - public class GT_Item_Casings5 extends GT_Item_Casings_Abstract { public GT_Item_Casings5(Block block) { super(block); } - protected static final String mCoilHeatTooltip = GT_LanguageManager.addStringLocalization("gt.coilheattooltip", "Base Heating Capacity = "); - protected static final String mCoilUnitTooltip = GT_LanguageManager.addStringLocalization("gt.coilunittooltip", " Kelvin"); + protected static final String mCoilHeatTooltip = + GT_LanguageManager.addStringLocalization("gt.coilheattooltip", "Base Heating Capacity = "); + protected static final String mCoilUnitTooltip = + GT_LanguageManager.addStringLocalization("gt.coilunittooltip", " Kelvin"); @Override @SideOnly(Side.CLIENT) diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Casings_Abstract.java b/src/main/java/gregtech/common/blocks/GT_Item_Casings_Abstract.java index 33b428772d..bca2de6eb6 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_Casings_Abstract.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_Casings_Abstract.java @@ -2,29 +2,40 @@ package gregtech.common.blocks; import gregtech.api.GregTech_API; import gregtech.api.util.GT_LanguageManager; +import java.util.List; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; -import java.util.List; - public abstract class GT_Item_Casings_Abstract extends ItemBlock { - protected final String mNoMobsToolTip = GT_LanguageManager.addStringLocalization("gt.nomobspawnsonthisblock", "Mobs cannot Spawn on this Block"); - protected final String mNoTileEntityToolTip = GT_LanguageManager.addStringLocalization("gt.notileentityinthisblock", "This is NOT a TileEntity!"); - protected final String mCoil01Tooltip = GT_LanguageManager.addStringLocalization("gt.coil01tooltip", "Base Heating Capacity = 1800 Kelvin"); - protected final String mCoil02Tooltip = GT_LanguageManager.addStringLocalization("gt.coil02tooltip", "Base Heating Capacity = 2700 Kelvin"); - protected final String mCoil03Tooltip = GT_LanguageManager.addStringLocalization("gt.coil03tooltip", "Base Heating Capacity = 3600 Kelvin"); - protected final String mCoil04Tooltip = GT_LanguageManager.addStringLocalization("gt.coil04tooltip", "Base Heating Capacity = 4500 Kelvin"); - protected final String mCoil05Tooltip = GT_LanguageManager.addStringLocalization("gt.coil05tooltip", "Base Heating Capacity = 5400 Kelvin"); - protected final String mCoil06Tooltip = GT_LanguageManager.addStringLocalization("gt.coil06tooltip", "Base Heating Capacity = 7200 Kelvin"); - protected final String mCoil07Tooltip = GT_LanguageManager.addStringLocalization("gt.coil07tooltip", "Base Heating Capacity = 9001 Kelvin"); - protected final String mCoil08Tooltip = GT_LanguageManager.addStringLocalization("gt.coil08tooltip", "Base Heating Capacity = 9900 Kelvin"); - protected final String mCoil09Tooltip = GT_LanguageManager.addStringLocalization("gt.coil09tooltip", "Base Heating Capacity = 10800 Kelvin"); - protected final String mBlastProofTooltip = GT_LanguageManager.addStringLocalization("gt.blastprooftooltip", "This Block is Blast Proof"); + protected final String mNoMobsToolTip = + GT_LanguageManager.addStringLocalization("gt.nomobspawnsonthisblock", "Mobs cannot Spawn on this Block"); + protected final String mNoTileEntityToolTip = + GT_LanguageManager.addStringLocalization("gt.notileentityinthisblock", "This is NOT a TileEntity!"); + protected final String mCoil01Tooltip = + GT_LanguageManager.addStringLocalization("gt.coil01tooltip", "Base Heating Capacity = 1800 Kelvin"); + protected final String mCoil02Tooltip = + GT_LanguageManager.addStringLocalization("gt.coil02tooltip", "Base Heating Capacity = 2700 Kelvin"); + protected final String mCoil03Tooltip = + GT_LanguageManager.addStringLocalization("gt.coil03tooltip", "Base Heating Capacity = 3600 Kelvin"); + protected final String mCoil04Tooltip = + GT_LanguageManager.addStringLocalization("gt.coil04tooltip", "Base Heating Capacity = 4500 Kelvin"); + protected final String mCoil05Tooltip = + GT_LanguageManager.addStringLocalization("gt.coil05tooltip", "Base Heating Capacity = 5400 Kelvin"); + protected final String mCoil06Tooltip = + GT_LanguageManager.addStringLocalization("gt.coil06tooltip", "Base Heating Capacity = 7200 Kelvin"); + protected final String mCoil07Tooltip = + GT_LanguageManager.addStringLocalization("gt.coil07tooltip", "Base Heating Capacity = 9001 Kelvin"); + protected final String mCoil08Tooltip = + GT_LanguageManager.addStringLocalization("gt.coil08tooltip", "Base Heating Capacity = 9900 Kelvin"); + protected final String mCoil09Tooltip = + GT_LanguageManager.addStringLocalization("gt.coil09tooltip", "Base Heating Capacity = 10800 Kelvin"); + protected final String mBlastProofTooltip = + GT_LanguageManager.addStringLocalization("gt.blastprooftooltip", "This Block is Blast Proof"); public GT_Item_Casings_Abstract(Block block) { - super(block ); + super(block); setMaxDamage(0); setHasSubtypes(true); setCreativeTab(GregTech_API.TAB_GREGTECH_MATERIALS); diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Concretes.java b/src/main/java/gregtech/common/blocks/GT_Item_Concretes.java index 1417aa4c39..0ee92868e8 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_Concretes.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_Concretes.java @@ -1,14 +1,14 @@ package gregtech.common.blocks; import gregtech.api.util.GT_LanguageManager; +import java.util.List; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import java.util.List; - public class GT_Item_Concretes extends GT_Item_Stones_Abstract { - private final String mRunFasterToolTip = GT_LanguageManager.addStringLocalization("gt.runfastertooltip", "You can walk faster on this Block"); + private final String mRunFasterToolTip = + GT_LanguageManager.addStringLocalization("gt.runfastertooltip", "You can walk faster on this Block"); public GT_Item_Concretes(Block block) { super(block); diff --git a/src/main/java/gregtech/common/blocks/GT_Item_LongDistancePipe.java b/src/main/java/gregtech/common/blocks/GT_Item_LongDistancePipe.java index c63f10b8f4..eda3c9b01b 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_LongDistancePipe.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_LongDistancePipe.java @@ -2,16 +2,17 @@ package gregtech.common.blocks; import gregtech.api.GregTech_API; import gregtech.api.util.GT_LanguageManager; +import java.util.List; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; -import java.util.List; - public class GT_Item_LongDistancePipe extends ItemBlock { - protected final String mNoMobsToolTip = GT_LanguageManager.addStringLocalization("gt.nomobspawnsonthisblock", "Mobs cannot Spawn on this Block"); - protected final String mNoTileEntityToolTip = GT_LanguageManager.addStringLocalization("gt.notileentityinthisblock", "This is NOT a TileEntity!"); + protected final String mNoMobsToolTip = + GT_LanguageManager.addStringLocalization("gt.nomobspawnsonthisblock", "Mobs cannot Spawn on this Block"); + protected final String mNoTileEntityToolTip = + GT_LanguageManager.addStringLocalization("gt.notileentityinthisblock", "This is NOT a TileEntity!"); public GT_Item_LongDistancePipe(Block block) { super(block); diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Machines.java b/src/main/java/gregtech/common/blocks/GT_Item_Machines.java index 9cf4029934..95de8da0c2 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_Machines.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_Machines.java @@ -1,5 +1,7 @@ package gregtech.common.blocks; +import static gregtech.GT_Mod.GT_FML_LOGGER; + import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; @@ -8,18 +10,16 @@ import gregtech.api.interfaces.metatileentity.IConnectable; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.CoverableTileEntity; -import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Cable; import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Fluid; import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Frame; import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Item; -import gregtech.api.util.GT_CoverBehaviorBase; import gregtech.api.util.GT_ItsNotMyFaultException; import gregtech.api.util.GT_LanguageManager; -import gregtech.api.util.GT_Log; import gregtech.api.util.GT_Utility; -import gregtech.api.util.ISerializableObject; import gregtech.common.tileentities.storage.*; +import java.util.List; +import javax.annotation.Nullable; import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -34,11 +34,6 @@ import net.minecraft.world.World; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.IFluidContainerItem; -import javax.annotation.Nullable; -import java.util.List; - -import static gregtech.GT_Mod.GT_FML_LOGGER; - public class GT_Item_Machines extends ItemBlock implements IFluidContainerItem { public GT_Item_Machines(Block block) { super(block); @@ -47,15 +42,12 @@ public class GT_Item_Machines extends ItemBlock implements IFluidContainerItem { setCreativeTab(GregTech_API.TAB_GREGTECH); } - public static IMetaTileEntity getMetaTileEntity(ItemStack aStack) { - if (GT_Utility.isStackInvalid(aStack)) - return null; - if (!(aStack.getItem() instanceof GT_Item_Machines)) - return null; - if (aStack.getItemDamage() < 0 || aStack.getItemDamage() > GregTech_API.METATILEENTITIES.length) - return null; - return GregTech_API.METATILEENTITIES[aStack.getItemDamage()]; - } + public static IMetaTileEntity getMetaTileEntity(ItemStack aStack) { + if (GT_Utility.isStackInvalid(aStack)) return null; + if (!(aStack.getItem() instanceof GT_Item_Machines)) return null; + if (aStack.getItemDamage() < 0 || aStack.getItemDamage() > GregTech_API.METATILEENTITIES.length) return null; + return GregTech_API.METATILEENTITIES[aStack.getItemDamage()]; + } @Override @SuppressWarnings("unchecked") @@ -68,45 +60,84 @@ public class GT_Item_Machines extends ItemBlock implements IFluidContainerItem { if (GregTech_API.METATILEENTITIES[tDamage] != null) { final IGregTechTileEntity tTileEntity = GregTech_API.METATILEENTITIES[tDamage].getBaseMetaTileEntity(); - if (!GregTech_API.sPostloadFinished && tTileEntity.getMetaTileEntity() instanceof ISecondaryDescribable) { - final String[] tSecondaryDescription = ((ISecondaryDescribable) tTileEntity.getMetaTileEntity()).getSecondaryDescription(); + if (!GregTech_API.sPostloadFinished + && tTileEntity.getMetaTileEntity() instanceof ISecondaryDescribable) { + final String[] tSecondaryDescription = + ((ISecondaryDescribable) tTileEntity.getMetaTileEntity()).getSecondaryDescription(); addDescription(null, tSecondaryDescription, tDamage, "_Secondary", true); } { final IMetaTileEntity tMetaTileEntity = tTileEntity.getMetaTileEntity(); - final String tSuffix = (tMetaTileEntity instanceof ISecondaryDescribable && ((ISecondaryDescribable) tMetaTileEntity).isDisplaySecondaryDescription()) ? "_Secondary" : ""; - addDescription(aList, tTileEntity.getDescription(), tDamage, tSuffix, !GregTech_API.sPostloadFinished); + final String tSuffix = (tMetaTileEntity instanceof ISecondaryDescribable + && ((ISecondaryDescribable) tMetaTileEntity).isDisplaySecondaryDescription()) + ? "_Secondary" + : ""; + addDescription( + aList, tTileEntity.getDescription(), tDamage, tSuffix, !GregTech_API.sPostloadFinished); } if (tTileEntity.getEUCapacity() > 0L) { if (tTileEntity.getInputVoltage() > 0L) { final int inputTier = GT_Utility.getTier(tTileEntity.getInputVoltage()); - aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_IN", "Voltage IN: ", !GregTech_API.sPostloadFinished ) + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(tTileEntity.getInputVoltage()) + " (" + GT_Values.TIER_COLORS[inputTier] + GT_Values.VN[inputTier] + EnumChatFormatting.GREEN +")" + EnumChatFormatting.GRAY); + aList.add(GT_LanguageManager.addStringLocalization( + "TileEntity_EUp_IN", "Voltage IN: ", !GregTech_API.sPostloadFinished) + + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(tTileEntity.getInputVoltage()) + + " (" + GT_Values.TIER_COLORS[inputTier] + GT_Values.VN[inputTier] + + EnumChatFormatting.GREEN + ")" + EnumChatFormatting.GRAY); } if (tTileEntity.getOutputVoltage() > 0L) { final int outputTier = GT_Utility.getTier(tTileEntity.getOutputVoltage()); - aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_OUT", "Voltage OUT: ", !GregTech_API.sPostloadFinished ) + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(tTileEntity.getOutputVoltage()) + " (" + GT_Values.TIER_COLORS[outputTier] + GT_Values.VN[outputTier] + EnumChatFormatting.GREEN + ")" + EnumChatFormatting.GRAY); + aList.add(GT_LanguageManager.addStringLocalization( + "TileEntity_EUp_OUT", "Voltage OUT: ", !GregTech_API.sPostloadFinished) + + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(tTileEntity.getOutputVoltage()) + + " (" + GT_Values.TIER_COLORS[outputTier] + GT_Values.VN[outputTier] + + EnumChatFormatting.GREEN + ")" + EnumChatFormatting.GRAY); } if (tTileEntity.getOutputAmperage() > 1L) { - aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_AMOUNT", "Amperage: ", !GregTech_API.sPostloadFinished ) + EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(tTileEntity.getOutputAmperage()) + EnumChatFormatting.GRAY); + aList.add(GT_LanguageManager.addStringLocalization( + "TileEntity_EUp_AMOUNT", "Amperage: ", !GregTech_API.sPostloadFinished) + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(tTileEntity.getOutputAmperage()) + + EnumChatFormatting.GRAY); } - aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_STORE", "Capacity: ", !GregTech_API.sPostloadFinished ) + EnumChatFormatting.BLUE + GT_Utility.formatNumbers(tTileEntity.getEUCapacity()) + EnumChatFormatting.GRAY + " EU"); + aList.add(GT_LanguageManager.addStringLocalization( + "TileEntity_EUp_STORE", "Capacity: ", !GregTech_API.sPostloadFinished) + + EnumChatFormatting.BLUE + GT_Utility.formatNumbers(tTileEntity.getEUCapacity()) + + EnumChatFormatting.GRAY + " EU"); } - if (GregTech_API.METATILEENTITIES[tDamage] instanceof GT_MetaTileEntity_QuantumTank || GregTech_API.METATILEENTITIES[tDamage] instanceof GT_MetaTileEntity_SuperTank) { + if (GregTech_API.METATILEENTITIES[tDamage] instanceof GT_MetaTileEntity_QuantumTank + || GregTech_API.METATILEENTITIES[tDamage] instanceof GT_MetaTileEntity_SuperTank) { if (aStack.hasTagCompound() && aStack.stackTagCompound.hasKey("mFluid")) { - final FluidStack tContents = FluidStack.loadFluidStackFromNBT(aStack.stackTagCompound.getCompoundTag("mFluid")); + final FluidStack tContents = + FluidStack.loadFluidStackFromNBT(aStack.stackTagCompound.getCompoundTag("mFluid")); if (tContents != null && tContents.amount > 0) { - aList.add(GT_LanguageManager.addStringLocalization("TileEntity_TANK_INFO", "Contains Fluid: ", !GregTech_API.sPostloadFinished ) + EnumChatFormatting.YELLOW + tContents.getLocalizedName() + EnumChatFormatting.GRAY); - aList.add(GT_LanguageManager.addStringLocalization("TileEntity_TANK_AMOUNT", "Fluid Amount: ", !GregTech_API.sPostloadFinished ) + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(tContents.amount) + " L" + EnumChatFormatting.GRAY); + aList.add(GT_LanguageManager.addStringLocalization( + "TileEntity_TANK_INFO", "Contains Fluid: ", !GregTech_API.sPostloadFinished) + + EnumChatFormatting.YELLOW + + tContents.getLocalizedName() + + EnumChatFormatting.GRAY); + aList.add(GT_LanguageManager.addStringLocalization( + "TileEntity_TANK_AMOUNT", "Fluid Amount: ", !GregTech_API.sPostloadFinished) + + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(tContents.amount) + " L" + + EnumChatFormatting.GRAY); } } } if (GregTech_API.METATILEENTITIES[tDamage] instanceof GT_MetaTileEntity_DigitalChestBase) { if (aStack.hasTagCompound() && aStack.stackTagCompound.hasKey("mItemStack")) { - final ItemStack tContents = ItemStack.loadItemStackFromNBT(aStack.stackTagCompound.getCompoundTag("mItemStack")); + final ItemStack tContents = + ItemStack.loadItemStackFromNBT(aStack.stackTagCompound.getCompoundTag("mItemStack")); final int tSize = aStack.stackTagCompound.getInteger("mItemCount"); if (tContents != null && tSize > 0) { - aList.add(GT_LanguageManager.addStringLocalization("TileEntity_CHEST_INFO", "Contains Item: ", !GregTech_API.sPostloadFinished ) + EnumChatFormatting.YELLOW + tContents.getDisplayName() + EnumChatFormatting.GRAY); - aList.add(GT_LanguageManager.addStringLocalization("TileEntity_CHEST_AMOUNT", "Item Amount: ", !GregTech_API.sPostloadFinished ) + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(tSize) + EnumChatFormatting.GRAY); + aList.add(GT_LanguageManager.addStringLocalization( + "TileEntity_CHEST_INFO", "Contains Item: ", !GregTech_API.sPostloadFinished) + + EnumChatFormatting.YELLOW + + tContents.getDisplayName() + + EnumChatFormatting.GRAY); + aList.add(GT_LanguageManager.addStringLocalization( + "TileEntity_CHEST_AMOUNT", "Item Amount: ", !GregTech_API.sPostloadFinished) + + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(tSize) + + EnumChatFormatting.GRAY); } } } @@ -114,14 +145,20 @@ public class GT_Item_Machines extends ItemBlock implements IFluidContainerItem { final NBTTagCompound aNBT = aStack.getTagCompound(); if (aNBT != null) { if (aNBT.getBoolean("mMuffler")) { - aList.add(GT_LanguageManager.addStringLocalization("GT_TileEntity_MUFFLER", "has Muffler Upgrade", !GregTech_API.sPostloadFinished )); + aList.add(GT_LanguageManager.addStringLocalization( + "GT_TileEntity_MUFFLER", "has Muffler Upgrade", !GregTech_API.sPostloadFinished)); } if (aNBT.getBoolean("mSteamConverter")) { - aList.add(GT_LanguageManager.addStringLocalization("GT_TileEntity_STEAMCONVERTER", "has Steam Upgrade", !GregTech_API.sPostloadFinished )); + aList.add(GT_LanguageManager.addStringLocalization( + "GT_TileEntity_STEAMCONVERTER", "has Steam Upgrade", !GregTech_API.sPostloadFinished)); } int tAmount = 0; if ((tAmount = aNBT.getByte("mSteamTanks")) > 0) { - aList.add(tAmount + " " + GT_LanguageManager.addStringLocalization("GT_TileEntity_STEAMTANKS", "Steam Tank Upgrades", !GregTech_API.sPostloadFinished )); + aList.add(tAmount + " " + + GT_LanguageManager.addStringLocalization( + "GT_TileEntity_STEAMTANKS", + "Steam Tank Upgrades", + !GregTech_API.sPostloadFinished)); } CoverableTileEntity.addInstalledCoversInformation(aNBT, aList); @@ -131,7 +168,12 @@ public class GT_Item_Machines extends ItemBlock implements IFluidContainerItem { } } - private void addDescription(@Nullable List<String> aList, @Nullable String[] aDescription, int aDamage, String aSuffix, boolean aWriteIntoLangFile) { + private void addDescription( + @Nullable List<String> aList, + @Nullable String[] aDescription, + int aDamage, + String aSuffix, + boolean aWriteIntoLangFile) { if (aDescription == null) return; for (int i = 0, tLength = aDescription.length; i < tLength; i++) { String tDescLine = aDescription[i]; @@ -148,7 +190,9 @@ public class GT_Item_Machines extends ItemBlock implements IFluidContainerItem { tBuffer.append(" %s"); tRep[j / 2] = tSplitStrings[j]; } - final String tTranslated = String.format(GT_LanguageManager.addStringLocalization(tKey, tBuffer.toString(), aWriteIntoLangFile), (Object[]) tRep); + final String tTranslated = String.format( + GT_LanguageManager.addStringLocalization(tKey, tBuffer.toString(), aWriteIntoLangFile), + (Object[]) tRep); if (aList != null) aList.add(tTranslated); } else { String tTranslated = GT_LanguageManager.addStringLocalization(tKey, tDescLine, aWriteIntoLangFile); @@ -158,7 +202,17 @@ public class GT_Item_Machines extends ItemBlock implements IFluidContainerItem { } @Override - public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) { + public boolean onItemUseFirst( + ItemStack stack, + EntityPlayer player, + World world, + int x, + int y, + int z, + int side, + float hitX, + float hitY, + float hitZ) { return false; } @@ -176,37 +230,52 @@ public class GT_Item_Machines extends ItemBlock implements IFluidContainerItem { @Override public String getItemStackDisplayName(ItemStack aStack) { - String aName = super.getItemStackDisplayName(aStack); - final short aDamage = (short) getDamage(aStack); - if (aDamage >= 0 && aDamage < GregTech_API.METATILEENTITIES.length && GregTech_API.METATILEENTITIES[aDamage] != null) { + String aName = super.getItemStackDisplayName(aStack); + final short aDamage = (short) getDamage(aStack); + if (aDamage >= 0 + && aDamage < GregTech_API.METATILEENTITIES.length + && GregTech_API.METATILEENTITIES[aDamage] != null) { Materials aMaterial = null; if (GregTech_API.METATILEENTITIES[aDamage] instanceof GT_MetaPipeEntity_Item) { - aMaterial = ((GT_MetaPipeEntity_Item) GregTech_API.METATILEENTITIES[aDamage]).mMaterial; + aMaterial = ((GT_MetaPipeEntity_Item) GregTech_API.METATILEENTITIES[aDamage]).mMaterial; } else if (GregTech_API.METATILEENTITIES[aDamage] instanceof GT_MetaPipeEntity_Fluid) { - aMaterial = ((GT_MetaPipeEntity_Fluid) GregTech_API.METATILEENTITIES[aDamage]).mMaterial; + aMaterial = ((GT_MetaPipeEntity_Fluid) GregTech_API.METATILEENTITIES[aDamage]).mMaterial; } else if (GregTech_API.METATILEENTITIES[aDamage] instanceof GT_MetaPipeEntity_Cable) { - aMaterial = ((GT_MetaPipeEntity_Cable) GregTech_API.METATILEENTITIES[aDamage]).mMaterial; + aMaterial = ((GT_MetaPipeEntity_Cable) GregTech_API.METATILEENTITIES[aDamage]).mMaterial; } else if (GregTech_API.METATILEENTITIES[aDamage] instanceof GT_MetaPipeEntity_Frame) { - aMaterial = ((GT_MetaPipeEntity_Frame) GregTech_API.METATILEENTITIES[aDamage]).mMaterial; + aMaterial = ((GT_MetaPipeEntity_Frame) GregTech_API.METATILEENTITIES[aDamage]).mMaterial; } if (aMaterial != null) { - aName = aMaterial.getLocalizedNameForItem(aName); + aName = aMaterial.getLocalizedNameForItem(aName); } } - return aName; + return aName; } @Override public void onCreated(ItemStack aStack, World aWorld, EntityPlayer aPlayer) { super.onCreated(aStack, aWorld, aPlayer); final short tDamage = (short) getDamage(aStack); - if ((tDamage < 0) || ((tDamage >= GregTech_API.METATILEENTITIES.length) && (GregTech_API.METATILEENTITIES[tDamage] != null))) { + if ((tDamage < 0) + || ((tDamage >= GregTech_API.METATILEENTITIES.length) + && (GregTech_API.METATILEENTITIES[tDamage] != null))) { GregTech_API.METATILEENTITIES[tDamage].onCreated(aStack, aWorld, aPlayer); } } @Override - public boolean placeBlockAt(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int side, float hitX, float hitY, float hitZ, int aMeta) { + public boolean placeBlockAt( + ItemStack aStack, + EntityPlayer aPlayer, + World aWorld, + int aX, + int aY, + int aZ, + int side, + float hitX, + float hitY, + float hitZ, + int aMeta) { final short tDamage = (short) getDamage(aStack); if (tDamage > 0) { if (GregTech_API.METATILEENTITIES[tDamage] == null) { @@ -217,10 +286,12 @@ public class GT_Item_Machines extends ItemBlock implements IFluidContainerItem { return false; } if (aWorld.getBlock(aX, aY, aZ) != this.field_150939_a) { - throw new GT_ItsNotMyFaultException("Failed to place Block even though World.setBlock returned true. It COULD be MCPC/Bukkit causing that. In case you really have that installed, don't report this Bug to me, I don't know how to fix it."); + throw new GT_ItsNotMyFaultException( + "Failed to place Block even though World.setBlock returned true. It COULD be MCPC/Bukkit causing that. In case you really have that installed, don't report this Bug to me, I don't know how to fix it."); } if (aWorld.getBlockMetadata(aX, aY, aZ) != tMetaData) { - throw new GT_ItsNotMyFaultException("Failed to set the MetaValue of the Block even though World.setBlock returned true. It COULD be MCPC/Bukkit causing that. In case you really have that installed, don't report this Bug to me, I don't know how to fix it."); + throw new GT_ItsNotMyFaultException( + "Failed to set the MetaValue of the Block even though World.setBlock returned true. It COULD be MCPC/Bukkit causing that. In case you really have that installed, don't report this Bug to me, I don't know how to fix it."); } final IGregTechTileEntity tTileEntity = (IGregTechTileEntity) aWorld.getTileEntity(aX, aY, aZ); if (tTileEntity != null) { @@ -233,12 +304,12 @@ public class GT_Item_Machines extends ItemBlock implements IFluidContainerItem { final byte aSide = GT_Utility.getOppositeSide(side); if (tTileEntity.getMetaTileEntity() instanceof IConnectable) { // If we're connectable, try connecting to whatever we're up against - ((IConnectable) tTileEntity.getMetaTileEntity()).connect(aSide); + ((IConnectable) tTileEntity.getMetaTileEntity()).connect(aSide); } else if (aPlayer != null && aPlayer.isSneaking()) { // If we're being placed against something that is connectable, try telling it to connect to us final IGregTechTileEntity aTileEntity = tTileEntity.getIGregTechTileEntityAtSide(aSide); if (aTileEntity != null && aTileEntity.getMetaTileEntity() instanceof IConnectable) { - ((IConnectable) aTileEntity.getMetaTileEntity()).connect((byte)side); + ((IConnectable) aTileEntity.getMetaTileEntity()).connect((byte) side); } } } @@ -257,18 +328,19 @@ public class GT_Item_Machines extends ItemBlock implements IFluidContainerItem { super.onUpdate(aStack, aWorld, aPlayer, aTimer, aIsInHand); final short tDamage = (short) getDamage(aStack); final EntityLivingBase tPlayer = (EntityPlayer) aPlayer; - if (GregTech_API.METATILEENTITIES[tDamage] instanceof GT_MetaTileEntity_SuperChest || - GregTech_API.METATILEENTITIES[tDamage] instanceof GT_MetaTileEntity_QuantumChest || - GregTech_API.METATILEENTITIES[tDamage] instanceof GT_MetaTileEntity_SuperTank || - GregTech_API.METATILEENTITIES[tDamage] instanceof GT_MetaTileEntity_QuantumTank) { + if (GregTech_API.METATILEENTITIES[tDamage] instanceof GT_MetaTileEntity_SuperChest + || GregTech_API.METATILEENTITIES[tDamage] instanceof GT_MetaTileEntity_QuantumChest + || GregTech_API.METATILEENTITIES[tDamage] instanceof GT_MetaTileEntity_SuperTank + || GregTech_API.METATILEENTITIES[tDamage] instanceof GT_MetaTileEntity_QuantumTank) { final NBTTagCompound tNBT = aStack.stackTagCompound; if (tNBT == null) return; if (tNBT.hasNoTags()) { aStack.setTagCompound(null); return; } - if ((tNBT.hasKey("mItemCount") && tNBT.getInteger("mItemCount") > 0) || - (tNBT.hasKey("mFluid") && FluidStack.loadFluidStackFromNBT(tNBT.getCompoundTag("mFluid")).amount > 64000)) { + if ((tNBT.hasKey("mItemCount") && tNBT.getInteger("mItemCount") > 0) + || (tNBT.hasKey("mFluid") + && FluidStack.loadFluidStackFromNBT(tNBT.getCompoundTag("mFluid")).amount > 64000)) { final FluidStack tFluid = FluidStack.loadFluidStackFromNBT(tNBT.getCompoundTag("mFluid")); int tLasing = 1200; if (tFluid != null) { @@ -303,8 +375,7 @@ public class GT_Item_Machines extends ItemBlock implements IFluidContainerItem { if (container != null) { final int tDamage = container.getItemDamage(); final IMetaTileEntity tMetaTile = GregTech_API.METATILEENTITIES[tDamage]; - if (tMetaTile != null) - return tMetaTile.getCapacity(); + if (tMetaTile != null) return tMetaTile.getCapacity(); } return 0; } @@ -314,7 +385,8 @@ public class GT_Item_Machines extends ItemBlock implements IFluidContainerItem { if (container != null && resource != null) { final int tDamage = container.getItemDamage(); final IMetaTileEntity tMetaTile = GregTech_API.METATILEENTITIES[tDamage]; - if (!(tMetaTile instanceof GT_MetaTileEntity_QuantumTank || tMetaTile instanceof GT_MetaTileEntity_SuperTank)) { + if (!(tMetaTile instanceof GT_MetaTileEntity_QuantumTank + || tMetaTile instanceof GT_MetaTileEntity_SuperTank)) { return 0; } if (container.stackTagCompound == null) container.stackTagCompound = new NBTTagCompound(); @@ -346,7 +418,8 @@ public class GT_Item_Machines extends ItemBlock implements IFluidContainerItem { if (container != null && container.hasTagCompound()) { final int tDamage = container.getItemDamage(); final IMetaTileEntity tMetaTile = GregTech_API.METATILEENTITIES[tDamage]; - if (!(tMetaTile instanceof GT_MetaTileEntity_QuantumTank || tMetaTile instanceof GT_MetaTileEntity_SuperTank)) { + if (!(tMetaTile instanceof GT_MetaTileEntity_QuantumTank + || tMetaTile instanceof GT_MetaTileEntity_SuperTank)) { return null; } final FluidStack tStoredFluid = getFluid(container); @@ -357,8 +430,7 @@ public class GT_Item_Machines extends ItemBlock implements IFluidContainerItem { if (doDrain) { if (tNewFluid.amount <= 0) { container.stackTagCompound.removeTag("mFluid"); - if (container.stackTagCompound.hasNoTags()) - container.setTagCompound(null); + if (container.stackTagCompound.hasNoTags()) container.setTagCompound(null); } else { container.stackTagCompound.setTag("mFluid", tNewFluid.writeToNBT(new NBTTagCompound())); } diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Ores.java b/src/main/java/gregtech/common/blocks/GT_Item_Ores.java index 63c3babfbb..bcf088a621 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_Ores.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_Ores.java @@ -17,7 +17,17 @@ public class GT_Item_Ores extends ItemBlock { } @Override - public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) { + public boolean onItemUseFirst( + ItemStack stack, + EntityPlayer player, + World world, + int x, + int y, + int z, + int side, + float hitX, + float hitY, + float hitZ) { return false; } @@ -28,18 +38,37 @@ public class GT_Item_Ores extends ItemBlock { @Override public String getItemStackDisplayName(ItemStack aStack) { - String aName = super.getItemStackDisplayName(aStack); - if (this.field_150939_a instanceof GT_Block_Ores_Abstract) { - aName = Materials.getLocalizedNameForItem(aName, aStack.getItemDamage() % 1000); - } - return aName; + String aName = super.getItemStackDisplayName(aStack); + if (this.field_150939_a instanceof GT_Block_Ores_Abstract) { + aName = Materials.getLocalizedNameForItem(aName, aStack.getItemDamage() % 1000); + } + return aName; } @Override - public boolean placeBlockAt(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int side, float hitX, float hitY, float hitZ, int aMeta) { + public boolean placeBlockAt( + ItemStack aStack, + EntityPlayer aPlayer, + World aWorld, + int aX, + int aY, + int aZ, + int side, + float hitX, + float hitY, + float hitZ, + int aMeta) { short tDamage = (short) getDamage(aStack); if (tDamage > 0) { - if (!aWorld.setBlock(aX, aY, aZ, this.field_150939_a, GT_TileEntity_Ores.getHarvestData(tDamage, ((GT_Block_Ores_Abstract) field_150939_a).getBaseBlockHarvestLevel(aMeta % 16000 / 1000)), 3)) { + if (!aWorld.setBlock( + aX, + aY, + aZ, + this.field_150939_a, + GT_TileEntity_Ores.getHarvestData( + tDamage, + ((GT_Block_Ores_Abstract) field_150939_a).getBaseBlockHarvestLevel(aMeta % 16000 / 1000)), + 3)) { return false; } GT_TileEntity_Ores tTileEntity = (GT_TileEntity_Ores) aWorld.getTileEntity(aX, aY, aZ); diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Stones_Abstract.java b/src/main/java/gregtech/common/blocks/GT_Item_Stones_Abstract.java index b75743e110..b62c7c0232 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_Stones_Abstract.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_Stones_Abstract.java @@ -2,15 +2,15 @@ package gregtech.common.blocks; import gregtech.api.GregTech_API; import gregtech.api.util.GT_LanguageManager; +import java.util.List; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; -import java.util.List; - public class GT_Item_Stones_Abstract extends ItemBlock { - private final String mNoMobsToolTip = GT_LanguageManager.addStringLocalization("gt.nomobspawnsonthisblock", "Mobs cannot Spawn on this Block"); + private final String mNoMobsToolTip = + GT_LanguageManager.addStringLocalization("gt.nomobspawnsonthisblock", "Mobs cannot Spawn on this Block"); public GT_Item_Stones_Abstract(Block block) { super(block); diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Storage.java b/src/main/java/gregtech/common/blocks/GT_Item_Storage.java index 10cc3ea1ac..55c19ae48c 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_Storage.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_Storage.java @@ -1,13 +1,12 @@ package gregtech.common.blocks; import gregtech.api.GregTech_API; +import java.util.List; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; -import java.util.List; - public class GT_Item_Storage extends ItemBlock { public GT_Item_Storage(Block block) { super(block); @@ -23,14 +22,14 @@ public class GT_Item_Storage extends ItemBlock { @Override public String getItemStackDisplayName(ItemStack aStack) { - String aName = super.getItemStackDisplayName(aStack); - if (this.field_150939_a instanceof GT_Block_Metal) { - int aDamage = aStack.getItemDamage(); - if (aDamage >= 0 && aDamage < ((GT_Block_Metal) this.field_150939_a).mMats.length) { - aName = ((GT_Block_Metal) this.field_150939_a).mMats[aDamage].getLocalizedNameForItem(aName); - } - } - return aName; + String aName = super.getItemStackDisplayName(aStack); + if (this.field_150939_a instanceof GT_Block_Metal) { + int aDamage = aStack.getItemDamage(); + if (aDamage >= 0 && aDamage < ((GT_Block_Metal) this.field_150939_a).mMats.length) { + aName = ((GT_Block_Metal) this.field_150939_a).mMats[aDamage].getLocalizedNameForItem(aName); + } + } + return aName; } @Override diff --git a/src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java b/src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java index 4885910877..452e9db5d4 100644 --- a/src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java +++ b/src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java @@ -1,5 +1,7 @@ package gregtech.common.blocks; +import static gregtech.api.enums.TextureSet.SET_NONE; + import gregtech.GT_Mod; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; @@ -11,6 +13,8 @@ import gregtech.api.objects.XSTR; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; +import java.util.ArrayList; +import java.util.Random; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; @@ -19,11 +23,6 @@ import net.minecraft.network.Packet; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; -import java.util.ArrayList; -import java.util.Random; - -import static gregtech.api.enums.TextureSet.SET_NONE; - public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntity { public short mMetaData = 0; public boolean mNatural = false; @@ -31,9 +30,19 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit public static byte getHarvestData(short aMetaData, int aBaseBlockHarvestLevel) { Materials aMaterial = GregTech_API.sGeneratedMaterials[(aMetaData % 1000)]; - byte tByte = aMaterial == null ? 0 : (byte) Math.max(aBaseBlockHarvestLevel, Math.min(7, aMaterial.mToolQuality - (aMetaData < 16000 ? 0 : 1))); + byte tByte = aMaterial == null + ? 0 + : (byte) Math.max( + aBaseBlockHarvestLevel, Math.min(7, aMaterial.mToolQuality - (aMetaData < 16000 ? 0 : 1))); if (GT_Mod.gregtechproxy.mChangeHarvestLevels) { - tByte = aMaterial == null ? 0 : (byte) Math.max(aBaseBlockHarvestLevel, Math.min(GT_Mod.gregtechproxy.mMaxHarvestLevel, GT_Mod.gregtechproxy.mHarvestLevel[aMaterial.mMetaItemSubID] - (aMetaData < 16000 ? 0 : 1))); + tByte = aMaterial == null + ? 0 + : (byte) Math.max( + aBaseBlockHarvestLevel, + Math.min( + GT_Mod.gregtechproxy.mMaxHarvestLevel, + GT_Mod.gregtechproxy.mHarvestLevel[aMaterial.mMetaItemSubID] + - (aMetaData < 16000 ? 0 : 1))); } return tByte; } @@ -42,7 +51,8 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit return setOreBlock(aWorld, aX, aY, aZ, aMetaData, isSmallOre, true); } - public static boolean setOreBlock(World aWorld, int aX, int aY, int aZ, int aMetaData, boolean isSmallOre, boolean air) { + public static boolean setOreBlock( + World aWorld, int aX, int aY, int aZ, int aMetaData, boolean isSmallOre, boolean air) { if (!air) { aY = Math.min(aWorld.getActualHeight(), Math.max(aY, 1)); } @@ -53,8 +63,8 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit aMetaData += isSmallOre ? 16000 : 0; if ((aMetaData > 0) && ((tBlock != Blocks.air) || air)) { if (tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.stone)) { - //Do nothing, stone background is default background. - //Do this comparison first since stone is most common + // Do nothing, stone background is default background. + // Do this comparison first since stone is most common } else if (tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.netherrack)) { aMetaData += 1000; } else if (tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.end_stone)) { @@ -83,25 +93,33 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit if (GregTech_API.sBlockOresUb1 != null) { tOreBlock = GregTech_API.sBlockOresUb1; aMetaData += (BlockMeta * 1000); - //GT_FML_LOGGER.info("Block changed to UB1"); + // GT_FML_LOGGER.info("Block changed to UB1"); } } else if (BlockName.equals("tile.metamorphicStone")) { if (GregTech_API.sBlockOresUb2 != null) { tOreBlock = GregTech_API.sBlockOresUb2; aMetaData += (BlockMeta * 1000); - //GT_FML_LOGGER.info("Block changed to UB2"); + // GT_FML_LOGGER.info("Block changed to UB2"); } } else if (BlockName.equals("tile.sedimentaryStone")) { if (GregTech_API.sBlockOresUb3 != null) { tOreBlock = GregTech_API.sBlockOresUb3; aMetaData += (BlockMeta * 1000); - //GT_FML_LOGGER.info("Block changed to UB3"); + // GT_FML_LOGGER.info("Block changed to UB3"); } } else { return false; } - //GT_FML_LOGGER.info(tOreBlock); - aWorld.setBlock(aX, aY, aZ, tOreBlock, getHarvestData((short) aMetaData, ((GT_Block_Ores_Abstract) tOreBlock).getBaseBlockHarvestLevel(aMetaData % 16000 / 1000)), 0); + // GT_FML_LOGGER.info(tOreBlock); + aWorld.setBlock( + aX, + aY, + aZ, + tOreBlock, + getHarvestData( + (short) aMetaData, + ((GT_Block_Ores_Abstract) tOreBlock).getBaseBlockHarvestLevel(aMetaData % 16000 / 1000)), + 0); TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); if ((tTileEntity instanceof GT_TileEntity_Ores)) { ((GT_TileEntity_Ores) tTileEntity).mMetaData = ((short) aMetaData); @@ -129,22 +147,28 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit public void onUpdated() { if ((!this.worldObj.isRemote) && (this.mBlocked)) { this.mBlocked = false; - GT_Values.NW.sendPacketToAllPlayersInRange(this.worldObj, new GT_Packet_Ores(this.xCoord, (short) this.yCoord, this.zCoord, this.mMetaData), this.xCoord, this.zCoord); + GT_Values.NW.sendPacketToAllPlayersInRange( + this.worldObj, + new GT_Packet_Ores(this.xCoord, (short) this.yCoord, this.zCoord, this.mMetaData), + this.xCoord, + this.zCoord); } } @Override public Packet getDescriptionPacket() { if (!this.worldObj.isRemote) { - if (!(this.mBlocked = ( - GT_Utility.isOpaqueBlock(this.worldObj, this.xCoord + 1, this.yCoord, this.zCoord) && - GT_Utility.isOpaqueBlock(this.worldObj, this.xCoord - 1, this.yCoord, this.zCoord) && - GT_Utility.isOpaqueBlock(this.worldObj, this.xCoord, this.yCoord + 1, this.zCoord) && - GT_Utility.isOpaqueBlock(this.worldObj, this.xCoord, this.yCoord - 1, this.zCoord) && - GT_Utility.isOpaqueBlock(this.worldObj, this.xCoord, this.yCoord, this.zCoord + 1) && - GT_Utility.isOpaqueBlock(this.worldObj, this.xCoord, this.yCoord, this.zCoord - 1) - ))) { - GT_Values.NW.sendPacketToAllPlayersInRange(this.worldObj, new GT_Packet_Ores(this.xCoord, (short) this.yCoord, this.zCoord, this.mMetaData), this.xCoord, this.zCoord); + if (!(this.mBlocked = (GT_Utility.isOpaqueBlock(this.worldObj, this.xCoord + 1, this.yCoord, this.zCoord) + && GT_Utility.isOpaqueBlock(this.worldObj, this.xCoord - 1, this.yCoord, this.zCoord) + && GT_Utility.isOpaqueBlock(this.worldObj, this.xCoord, this.yCoord + 1, this.zCoord) + && GT_Utility.isOpaqueBlock(this.worldObj, this.xCoord, this.yCoord - 1, this.zCoord) + && GT_Utility.isOpaqueBlock(this.worldObj, this.xCoord, this.yCoord, this.zCoord + 1) + && GT_Utility.isOpaqueBlock(this.worldObj, this.xCoord, this.yCoord, this.zCoord - 1)))) { + GT_Values.NW.sendPacketToAllPlayersInRange( + this.worldObj, + new GT_Packet_Ores(this.xCoord, (short) this.yCoord, this.zCoord, this.mMetaData), + this.xCoord, + this.zCoord); } } return null; @@ -153,11 +177,14 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit public void overrideOreBlockMaterial(Block aOverridingStoneBlock, byte aOverridingStoneMeta) { if (this.worldObj == null || blockType == null) return; this.mMetaData = ((short) (int) (this.mMetaData % 1000L + this.mMetaData / 16000L * 16000L)); - if (aOverridingStoneBlock.isReplaceableOreGen(this.worldObj, this.xCoord, this.yCoord, this.zCoord, Blocks.netherrack)) { + if (aOverridingStoneBlock.isReplaceableOreGen( + this.worldObj, this.xCoord, this.yCoord, this.zCoord, Blocks.netherrack)) { this.mMetaData = ((short) (this.mMetaData + 1000)); - } else if (aOverridingStoneBlock.isReplaceableOreGen(this.worldObj, this.xCoord, this.yCoord, this.zCoord, Blocks.end_stone)) { + } else if (aOverridingStoneBlock.isReplaceableOreGen( + this.worldObj, this.xCoord, this.yCoord, this.zCoord, Blocks.end_stone)) { this.mMetaData = ((short) (this.mMetaData + 2000)); - } else if (aOverridingStoneBlock.isReplaceableOreGen(this.worldObj, this.xCoord, this.yCoord, this.zCoord, GregTech_API.sBlockGranites)) { + } else if (aOverridingStoneBlock.isReplaceableOreGen( + this.worldObj, this.xCoord, this.yCoord, this.zCoord, GregTech_API.sBlockGranites)) { if (aOverridingStoneBlock == GregTech_API.sBlockGranites) { if (aOverridingStoneMeta < 8) { this.mMetaData = ((short) (this.mMetaData + 3000)); @@ -167,7 +194,8 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit } else { this.mMetaData = ((short) (this.mMetaData + 3000)); } - } else if (aOverridingStoneBlock.isReplaceableOreGen(this.worldObj, this.xCoord, this.yCoord, this.zCoord, GregTech_API.sBlockStones)) { + } else if (aOverridingStoneBlock.isReplaceableOreGen( + this.worldObj, this.xCoord, this.yCoord, this.zCoord, GregTech_API.sBlockStones)) { if (aOverridingStoneBlock == GregTech_API.sBlockStones) { if (aOverridingStoneMeta < 8) { this.mMetaData = ((short) (this.mMetaData + 5000)); @@ -178,7 +206,14 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit this.mMetaData = ((short) (this.mMetaData + 5000)); } } - this.worldObj.setBlockMetadataWithNotify(this.xCoord, this.yCoord, this.zCoord, getHarvestData(this.mMetaData, ((GT_Block_Ores_Abstract) blockType).getBaseBlockHarvestLevel(mMetaData % 16000 / 1000)), 0); + this.worldObj.setBlockMetadataWithNotify( + this.xCoord, + this.yCoord, + this.zCoord, + getHarvestData( + this.mMetaData, + ((GT_Block_Ores_Abstract) blockType).getBaseBlockHarvestLevel(mMetaData % 16000 / 1000)), + 0); } public void convertOreBlock(World aWorld, int aX, int aY, int aZ) { @@ -187,7 +222,15 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); if (tTileEntity instanceof GT_TileEntity_Ores) { ((GT_TileEntity_Ores) tTileEntity).mMetaData = aMeta; - this.worldObj.setBlockMetadataWithNotify(this.xCoord, this.yCoord, this.zCoord, getHarvestData(aMeta, ((GT_Block_Ores_Abstract) tTileEntity.blockType).getBaseBlockHarvestLevel(aMeta % 16000 / 1000)), 0); + this.worldObj.setBlockMetadataWithNotify( + this.xCoord, + this.yCoord, + this.zCoord, + getHarvestData( + aMeta, + ((GT_Block_Ores_Abstract) tTileEntity.blockType) + .getBaseBlockHarvestLevel(aMeta % 16000 / 1000)), + 0); } } @@ -223,13 +266,15 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit Materials aMaterial = aOreMaterial.mOreReplacement; - ItemStack tStack = GT_OreDictUnificator.get(OrePrefixes.gemExquisite, aMaterial, GT_OreDictUnificator.get(OrePrefixes.gem, aMaterial, 1L), 1L); + ItemStack tStack = GT_OreDictUnificator.get( + OrePrefixes.gemExquisite, aMaterial, GT_OreDictUnificator.get(OrePrefixes.gem, aMaterial, 1L), 1L); if (tStack != null) { for (int i = 0; i < 1; i++) { tSelector.add(tStack); } } - tStack = GT_OreDictUnificator.get(OrePrefixes.gemFlawless, aMaterial, GT_OreDictUnificator.get(OrePrefixes.gem, aMaterial, 1L), 1L); + tStack = GT_OreDictUnificator.get( + OrePrefixes.gemFlawless, aMaterial, GT_OreDictUnificator.get(OrePrefixes.gem, aMaterial, 1L), 1L); if (tStack != null) { for (int i = 0; i < 2; i++) { tSelector.add(tStack); @@ -241,7 +286,8 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit tSelector.add(tStack); } } - tStack = GT_OreDictUnificator.get(OrePrefixes.gemFlawed, aMaterial, GT_OreDictUnificator.get(OrePrefixes.crushed, aMaterial, 1L), 1L); + tStack = GT_OreDictUnificator.get( + OrePrefixes.gemFlawed, aMaterial, GT_OreDictUnificator.get(OrePrefixes.crushed, aMaterial, 1L), 1L); if (tStack != null) { for (int i = 0; i < 5; i++) { tSelector.add(tStack); @@ -253,7 +299,11 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit tSelector.add(tStack); } } - tStack = GT_OreDictUnificator.get(OrePrefixes.gemChipped, aMaterial, GT_OreDictUnificator.get(OrePrefixes.dustImpure, aMaterial, 1L), 1L); + tStack = GT_OreDictUnificator.get( + OrePrefixes.gemChipped, + aMaterial, + GT_OreDictUnificator.get(OrePrefixes.dustImpure, aMaterial, 1L), + 1L); if (tStack != null) { for (int i = 0; i < 5; i++) { tSelector.add(tStack); @@ -267,14 +317,22 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit } if (!tSelector.isEmpty()) { int i = 0; - for (int j = Math.max(1, aMaterial.mOreMultiplier + (aFortune > 0 ? tRandom.nextInt(1 + aFortune * aMaterial.mOreMultiplier) : 0) / 2); i < j; i++) { + for (int j = Math.max( + 1, + aMaterial.mOreMultiplier + + (aFortune > 0 ? tRandom.nextInt(1 + aFortune * aMaterial.mOreMultiplier) : 0) + / 2); + i < j; + i++) { rList.add(GT_Utility.copyAmount(1L, tSelector.get(tRandom.nextInt(tSelector.size())))); } } if (tRandom.nextInt(3 + aFortune) > 1) { - Materials dustMat = ((GT_Block_Ores_Abstract) aDroppedOre).getDroppedDusts()[this.mMetaData / 1000 % 16]; + Materials dustMat = + ((GT_Block_Ores_Abstract) aDroppedOre).getDroppedDusts()[this.mMetaData / 1000 % 16]; if (dustMat != null) - rList.add(GT_OreDictUnificator.get(tRandom.nextInt(3) > 0 ? OrePrefixes.dustImpure : OrePrefixes.dust, dustMat, 1L)); + rList.add(GT_OreDictUnificator.get( + tRandom.nextInt(3) > 0 ? OrePrefixes.dustImpure : OrePrefixes.dust, dustMat, 1L)); } } return rList; @@ -285,20 +343,27 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit Materials aMaterial = GregTech_API.sGeneratedMaterials[(this.mMetaData % 1000)]; if ((aMaterial != null) && (this.mMetaData < 32000)) { ITexture iTexture = TextureFactory.builder() - .addIcon(aMaterial.mIconSet.mTextures[this.mMetaData / 16000 == 0 ? - OrePrefixes.ore.mTextureIndex : - OrePrefixes.oreSmall.mTextureIndex]) + .addIcon(aMaterial + .mIconSet + .mTextures[ + this.mMetaData / 16000 == 0 + ? OrePrefixes.ore.mTextureIndex + : OrePrefixes.oreSmall.mTextureIndex]) .setRGBA(aMaterial.mRGBa) .stdOrient() .build(); if (aBlock instanceof GT_Block_Ores_Abstract) { - return new ITexture[]{ - ((GT_Block_Ores_Abstract) aBlock).getTextureSet()[((this.mMetaData / 1000) % 16)], iTexture}; + return new ITexture[] { + ((GT_Block_Ores_Abstract) aBlock).getTextureSet()[((this.mMetaData / 1000) % 16)], iTexture + }; } } - return new ITexture[]{ - TextureFactory.of(Blocks.stone, 0), - TextureFactory.builder().addIcon(SET_NONE.mTextures[OrePrefixes.ore.mTextureIndex]).stdOrient().build() + return new ITexture[] { + TextureFactory.of(Blocks.stone, 0), + TextureFactory.builder() + .addIcon(SET_NONE.mTextures[OrePrefixes.ore.mTextureIndex]) + .stdOrient() + .build() }; } } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Arm.java b/src/main/java/gregtech/common/covers/GT_Cover_Arm.java index 23802851c7..fd4f2a684c 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Arm.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Arm.java @@ -20,8 +20,8 @@ import net.minecraftforge.fluids.Fluid; public class GT_Cover_Arm extends GT_CoverBehavior { public final int mTickRate; - //msb converted, 2nd : direction (1=export) - //right 14 bits: internalSlot, next 14 bits adjSlot, 0 = all, slot = -1 + // msb converted, 2nd : direction (1=export) + // right 14 bits: internalSlot, next 14 bits adjSlot, 0 = all, slot = -1 protected static final int EXPORT_MASK = 0x40000000; protected static final int SLOT_ID_MASK = 0x3FFF; protected static final int SLOT_ID_MIN = 0; @@ -32,21 +32,23 @@ public class GT_Cover_Arm extends GT_CoverBehavior { } @Override - public boolean isRedstoneSensitive(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { + public boolean isRedstoneSensitive( + byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { return false; } @Override - public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { + public int doCoverThings( + byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { if ((((aTileEntity instanceof IMachineProgress)) && (!((IMachineProgress) aTileEntity).isAllowedToWork()))) { return aCoverVariable; } - //Convert from ver. 5.09.33.50, check if 3 last bits are equal + // Convert from ver. 5.09.33.50, check if 3 last bits are equal if ((aCoverVariable >>> 29) == 0) { - aCoverVariable = CONVERTED_BIT | (((aCoverVariable+1) & SLOT_ID_MASK) << 14) | EXPORT_MASK; + aCoverVariable = CONVERTED_BIT | (((aCoverVariable + 1) & SLOT_ID_MASK) << 14) | EXPORT_MASK; } else if ((aCoverVariable >>> 29) == 7) { - aCoverVariable = CONVERTED_BIT | Math.min(Math.abs(aCoverVariable-1), SLOT_ID_MASK); + aCoverVariable = CONVERTED_BIT | Math.min(Math.abs(aCoverVariable - 1), SLOT_ID_MASK); } TileEntity toTile, fromTile; @@ -56,33 +58,50 @@ public class GT_Cover_Arm extends GT_CoverBehavior { fromTile = (TileEntity) aTileEntity; toTile = aTileEntity.getTileEntityAtSide(aSide); fromSlot = aCoverVariable & SLOT_ID_MASK; - toSlot = (aCoverVariable>>14) & SLOT_ID_MASK; + toSlot = (aCoverVariable >> 14) & SLOT_ID_MASK; } else { fromTile = aTileEntity.getTileEntityAtSide(aSide); toTile = (TileEntity) aTileEntity; - fromSlot = (aCoverVariable>>14) & SLOT_ID_MASK; + fromSlot = (aCoverVariable >> 14) & SLOT_ID_MASK; toSlot = aCoverVariable & SLOT_ID_MASK; } byte movedItems = 0; - if(fromSlot > 0 && toSlot > 0) { + if (fromSlot > 0 && toSlot > 0) { if (fromTile instanceof IInventory && toTile instanceof IInventory) - movedItems = GT_Utility.moveFromSlotToSlot((IInventory) fromTile, (IInventory) toTile, fromSlot-1, toSlot-1, null, false, (byte)64, (byte)1, (byte)64, (byte)1); + movedItems = GT_Utility.moveFromSlotToSlot( + (IInventory) fromTile, + (IInventory) toTile, + fromSlot - 1, + toSlot - 1, + null, + false, + (byte) 64, + (byte) 1, + (byte) 64, + (byte) 1); } else if (toSlot > 0) { byte side; - if ((aCoverVariable & EXPORT_MASK) > 0) - side = aSide; - else - side = GT_Utility.getOppositeSide(aSide); - movedItems = GT_Utility.moveOneItemStackIntoSlot(fromTile, toTile, side, toSlot-1, null, false, (byte)64, (byte)1, (byte)64, (byte)1); + if ((aCoverVariable & EXPORT_MASK) > 0) side = aSide; + else side = GT_Utility.getOppositeSide(aSide); + movedItems = GT_Utility.moveOneItemStackIntoSlot( + fromTile, toTile, side, toSlot - 1, null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1); } else if (fromSlot > 0) { byte toSide; - if ((aCoverVariable & EXPORT_MASK) > 0) - toSide = aSide; - else - toSide = GT_Utility.getOppositeSide(aSide); + if ((aCoverVariable & EXPORT_MASK) > 0) toSide = aSide; + else toSide = GT_Utility.getOppositeSide(aSide); if (fromTile instanceof IInventory) - movedItems = GT_Utility.moveFromSlotToSide((IInventory) fromTile, toTile, fromSlot-1, toSide, null, false, (byte)64, (byte)1, (byte)64, (byte)1); + movedItems = GT_Utility.moveFromSlotToSide( + (IInventory) fromTile, + toTile, + fromSlot - 1, + toSide, + null, + false, + (byte) 64, + (byte) 1, + (byte) 64, + (byte) 1); } else { byte fromSide, toSide; if ((aCoverVariable & EXPORT_MASK) > 0) { @@ -92,14 +111,23 @@ public class GT_Cover_Arm extends GT_CoverBehavior { fromSide = GT_Utility.getOppositeSide(aSide); toSide = aSide; } - movedItems = GT_Utility.moveOneItemStack(fromTile, toTile, fromSide, toSide, null, false, (byte)64, (byte)1, (byte)64, (byte)1); + movedItems = GT_Utility.moveOneItemStack( + fromTile, toTile, fromSide, toSide, null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1); } return aCoverVariable; } @Override - public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public int onCoverScrewdriverclick( + byte aSide, + int aCoverID, + int aCoverVariable, + ICoverable aTileEntity, + EntityPlayer aPlayer, + float aX, + float aY, + float aZ) { int step = 0; if (GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ)[0] >= 0.5F) { step += aPlayer.isSneaking() ? 256 : 16; @@ -112,7 +140,15 @@ public class GT_Cover_Arm extends GT_CoverBehavior { } @Override - protected boolean onCoverRightClickImpl(byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { + protected boolean onCoverRightClickImpl( + byte aSide, + int aCoverID, + ISerializableObject.LegacyCoverData aCoverVariable, + ICoverable aTileEntity, + EntityPlayer aPlayer, + float aX, + float aY, + float aZ) { int step = (GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ)[0] >= 0.5F) ? 1 : -1; int tCoverVariable = getNewVar(aCoverVariable.get(), step); sendMessageToPlayer(aPlayer, tCoverVariable); @@ -122,7 +158,15 @@ public class GT_Cover_Arm extends GT_CoverBehavior { @Override @SuppressWarnings("deprecation") - public boolean onCoverRightclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onCoverRightclick( + byte aSide, + int aCoverID, + int aCoverVariable, + ICoverable aTileEntity, + EntityPlayer aPlayer, + float aX, + float aY, + float aZ) { int step = (GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ)[0] >= 0.5F) ? 1 : -1; aCoverVariable = getNewVar(aCoverVariable, step); sendMessageToPlayer(aPlayer, aCoverVariable); @@ -132,9 +176,12 @@ public class GT_Cover_Arm extends GT_CoverBehavior { private void sendMessageToPlayer(EntityPlayer aPlayer, int var) { if ((var & EXPORT_MASK) != 0) - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("001", "Puts out into adjacent Slot #") + (((var >> 14) & SLOT_ID_MASK) - 1)); + GT_Utility.sendChatToPlayer( + aPlayer, + GT_Utility.trans("001", "Puts out into adjacent Slot #") + (((var >> 14) & SLOT_ID_MASK) - 1)); else - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("002", "Grabs in for own Slot #") + ((var & SLOT_ID_MASK) - 1)); + GT_Utility.sendChatToPlayer( + aPlayer, GT_Utility.trans("002", "Grabs in for own Slot #") + ((var & SLOT_ID_MASK) - 1)); } private int getNewVar(int var, int step) { @@ -142,25 +189,19 @@ public class GT_Cover_Arm extends GT_CoverBehavior { int adjSlot = (var >> 14) & SLOT_ID_MASK; if ((var & EXPORT_MASK) == 0) { int x = (intSlot + step); - if (x > SLOT_ID_MASK ) - return createVar(0, SLOT_ID_MASK, 0); - else if (x < 1) - return createVar(-step - intSlot + 1, 0, EXPORT_MASK); - else - return createVar(0, x, 0); + if (x > SLOT_ID_MASK) return createVar(0, SLOT_ID_MASK, 0); + else if (x < 1) return createVar(-step - intSlot + 1, 0, EXPORT_MASK); + else return createVar(0, x, 0); } else { int x = (adjSlot - step); - if (x > SLOT_ID_MASK) - return createVar(SLOT_ID_MASK, 0, EXPORT_MASK); - else if (x < 1) - return createVar(0, +step - adjSlot + 1, 0); - else - return createVar(x, 0, EXPORT_MASK); + if (x > SLOT_ID_MASK) return createVar(SLOT_ID_MASK, 0, EXPORT_MASK); + else if (x < 1) return createVar(0, +step - adjSlot + 1, 0); + else return createVar(x, 0, EXPORT_MASK); } } - private int createVar(int adjSlot, int intSlot, int export){ - return CONVERTED_BIT | export | ((adjSlot & SLOT_ID_MASK) << 14) | (intSlot & SLOT_ID_MASK); + private int createVar(int adjSlot, int intSlot, int export) { + return CONVERTED_BIT | export | ((adjSlot & SLOT_ID_MASK) << 14) | (intSlot & SLOT_ID_MASK); } @Override @@ -216,14 +257,13 @@ public class GT_Cover_Arm extends GT_CoverBehavior { /** * GUI Stuff */ - @Override public boolean hasCoverGUI() { return true; } @Override - public Object getClientGUI(byte aSide, int aCoverID, int coverData, ICoverable aTileEntity) { + public Object getClientGUI(byte aSide, int aCoverID, int coverData, ICoverable aTileEntity) { return new GT_Cover_Arm.GUI(aSide, aCoverID, coverData, aTileEntity); } @@ -243,7 +283,6 @@ public class GT_Cover_Arm extends GT_CoverBehavior { private boolean export; private int internalSlotID, adjacentSlotID; - private final int maxIntSlot, maxAdjSlot; private final int textColor = this.getTextColorOrDefault("text", 0xFF555555); @@ -258,28 +297,32 @@ public class GT_Cover_Arm extends GT_CoverBehavior { internalSlotID = (coverVariable & SLOT_ID_MASK); adjacentSlotID = (coverVariable >> 14) & SLOT_ID_MASK; - new GT_GuiIconButton(this, 0, startX + spaceX * 0, startY + spaceY * 0, GT_GuiIcon.EXPORT).setTooltipText(GT_Utility.trans("006", "Export")); - new GT_GuiIconButton(this, 1, startX + spaceX * 1, startY + spaceY * 0, GT_GuiIcon.IMPORT).setTooltipText(GT_Utility.trans("007", "Import")); + new GT_GuiIconButton(this, 0, startX + spaceX * 0, startY + spaceY * 0, GT_GuiIcon.EXPORT) + .setTooltipText(GT_Utility.trans("006", "Export")); + new GT_GuiIconButton(this, 1, startX + spaceX * 1, startY + spaceY * 0, GT_GuiIcon.IMPORT) + .setTooltipText(GT_Utility.trans("007", "Import")); - intSlot = new GT_GuiIntegerTextBox(this, 2, startX + spaceX * 0, startY + spaceY * 1 + 2, spaceX * 2+5, 12); - setBoxText(intSlot, internalSlotID-1); + intSlot = + new GT_GuiIntegerTextBox(this, 2, startX + spaceX * 0, startY + spaceY * 1 + 2, spaceX * 2 + 5, 12); + setBoxText(intSlot, internalSlotID - 1); intSlot.setMaxStringLength(6); - adjSlot = new GT_GuiIntegerTextBox(this, 3, startX + spaceX * 0, startY + spaceY * 2 + 2, spaceX * 2+5, 12); - setBoxText(adjSlot, adjacentSlotID-1); + adjSlot = + new GT_GuiIntegerTextBox(this, 3, startX + spaceX * 0, startY + spaceY * 2 + 2, spaceX * 2 + 5, 12); + setBoxText(adjSlot, adjacentSlotID - 1); adjSlot.setMaxStringLength(6); - //intSlotIcon = new GT_GuiFakeItemButton(this, startX + spaceX * 8-4, startY + spaceY * 1, GT_GuiIcon.SLOT_GRAY); - //adjSlotIcon = new GT_GuiFakeItemButton(this, startX + spaceX * 8-4, startY + spaceY * 2, GT_GuiIcon.SLOT_GRAY); + // intSlotIcon = new GT_GuiFakeItemButton(this, startX + spaceX * 8-4, startY + spaceY * 1, + // GT_GuiIcon.SLOT_GRAY); + // adjSlotIcon = new GT_GuiFakeItemButton(this, startX + spaceX * 8-4, startY + spaceY * 2, + // GT_GuiIcon.SLOT_GRAY); if (super.tile instanceof TileEntity && !super.tile.isDead()) { - maxIntSlot = tile.getSizeInventory()-1; + maxIntSlot = tile.getSizeInventory() - 1; TileEntity adj = super.tile.getTileEntityAtSide(side); - if (adj instanceof IInventory) - maxAdjSlot = ((IInventory) adj).getSizeInventory()-1; - else - maxAdjSlot = -1; + if (adj instanceof IInventory) maxAdjSlot = ((IInventory) adj).getSizeInventory() - 1; + else maxAdjSlot = -1; } else { maxIntSlot = -1; maxAdjSlot = -1; @@ -290,12 +333,32 @@ public class GT_Cover_Arm extends GT_CoverBehavior { public void drawExtras(int mouseX, int mouseY, float parTicks) { super.drawExtras(mouseX, mouseY, parTicks); if (export) - this.getFontRenderer().drawString(GT_Utility.trans("006", "Export"), startX + spaceX*3, 4+startY+spaceY*0, textColor); + this.getFontRenderer() + .drawString( + GT_Utility.trans("006", "Export"), + startX + spaceX * 3, + 4 + startY + spaceY * 0, + textColor); else - this.getFontRenderer().drawString(GT_Utility.trans("007", "Import"), startX + spaceX*3, 4+startY+spaceY*0, textColor); - - this.getFontRenderer().drawString(GT_Utility.trans("254", "Internal slot#"), startX + spaceX*3, 4+startY+spaceY*1, textColor); - this.getFontRenderer().drawString(GT_Utility.trans("255", "Adjacent slot#"), startX + spaceX*3, 4+startY+spaceY*2, textColor); + this.getFontRenderer() + .drawString( + GT_Utility.trans("007", "Import"), + startX + spaceX * 3, + 4 + startY + spaceY * 0, + textColor); + + this.getFontRenderer() + .drawString( + GT_Utility.trans("254", "Internal slot#"), + startX + spaceX * 3, + 4 + startY + spaceY * 1, + textColor); + this.getFontRenderer() + .drawString( + GT_Utility.trans("255", "Adjacent slot#"), + startX + spaceX * 3, + 4 + startY + spaceY * 2, + textColor); } @Override @@ -303,7 +366,7 @@ public class GT_Cover_Arm extends GT_CoverBehavior { intSlot.setFocused(true); updateButtons(); - //updateInventorySlots(); + // updateInventorySlots(); } @Override @@ -332,17 +395,13 @@ public class GT_Cover_Arm extends GT_CoverBehavior { step = (isShiftKeyDown() ? 50 : isCtrlKeyDown() ? 5 : 1) * (delta > 0 ? step : -step); int maxSlot = box.id == 3 ? maxAdjSlot : maxIntSlot; int val = parseTextBox(box, maxSlot); - if (val < 0) - val = -1; + if (val < 0) val = -1; val = val + step; if (maxSlot < val) - if (maxSlot < 0) - val = -1; - else - val = maxSlot; - else if (val < SLOT_ID_MIN) - val = -1; + if (maxSlot < 0) val = -1; + else val = maxSlot; + else if (val < SLOT_ID_MIN) val = -1; setBoxText(box, val); return; @@ -356,43 +415,37 @@ public class GT_Cover_Arm extends GT_CoverBehavior { if (box.id == 2) { val = parseTextBox(box, maxIntSlot); - internalSlotID = val+1; - } - else if (box.id == 3) { + internalSlotID = val + 1; + } else if (box.id == 3) { val = parseTextBox(box, maxAdjSlot); - adjacentSlotID = val+1; + adjacentSlotID = val + 1; } setBoxText(box, val); coverVariable = getNewCoverVariable(); GT_Values.NW.sendToServer(new GT_Packet_TileEntityCover(side, coverID, coverVariable, tile)); - //updateInventorySlots(); + // updateInventorySlots(); } @Override public void resetTextBox(GT_GuiIntegerTextBox box) { int val = 0; - if (box.id == 2) - val = internalSlotID-1; - else if (box.id == 3) - val = adjacentSlotID-1; + if (box.id == 2) val = internalSlotID - 1; + else if (box.id == 3) val = adjacentSlotID - 1; setBoxText(box, val); } private void setBoxText(GT_GuiIntegerTextBox box, int val) { - box.setText( val < 0 ? ANY_TEXT : String.valueOf(val)); + box.setText(val < 0 ? ANY_TEXT : String.valueOf(val)); } private int parseTextBox(GT_GuiIntegerTextBox box, int maxSlot) { String text = box.getText(); - if (text == null) - return -1; + if (text == null) return -1; text = text.trim(); - if (text.startsWith(ANY_TEXT)) - text = text.substring(ANY_TEXT.length()); + if (text.startsWith(ANY_TEXT)) text = text.substring(ANY_TEXT.length()); - if (text.isEmpty()) - return -1; + if (text.isEmpty()) return -1; int val; try { @@ -402,22 +455,21 @@ public class GT_Cover_Arm extends GT_CoverBehavior { } if (maxSlot < val) - if (maxSlot < 0) - return -1; - else - return maxSlot; - else if (val < SLOT_ID_MIN) - return SLOT_ID_MIN; + if (maxSlot < 0) return -1; + else return maxSlot; + else if (val < SLOT_ID_MIN) return SLOT_ID_MIN; return val; } private int getNewCoverVariable() { - return (export ? EXPORT_MASK : 0) | ((adjacentSlotID & SLOT_ID_MASK) << 14) | (internalSlotID & SLOT_ID_MASK) | CONVERTED_BIT; + return (export ? EXPORT_MASK : 0) + | ((adjacentSlotID & SLOT_ID_MASK) << 14) + | (internalSlotID & SLOT_ID_MASK) + | CONVERTED_BIT; } private boolean buttonClickable(int id) { - if (id == 0) - return !export; + if (id == 0) return !export; return export; } } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_ControlsWork.java b/src/main/java/gregtech/common/covers/GT_Cover_ControlsWork.java index dd2b17df05..6fd6eb1337 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_ControlsWork.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_ControlsWork.java @@ -9,7 +9,6 @@ import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.interfaces.tileentity.IMachineProgress; import gregtech.api.net.GT_Packet_TileEntityCover; import gregtech.api.util.GT_CoverBehavior; -import gregtech.api.util.GT_CoverBehaviorBase; import gregtech.api.util.GT_Utility; import net.minecraft.client.gui.GuiButton; import net.minecraft.entity.player.EntityPlayer; @@ -18,23 +17,28 @@ import net.minecraftforge.fluids.Fluid; public class GT_Cover_ControlsWork extends GT_CoverBehavior { @Override - public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { + public int doCoverThings( + byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { if (!makeSureOnlyOne(aSide, aTileEntity)) return 0; if (aTileEntity instanceof IMachineProgress) { IMachineProgress machine = (IMachineProgress) aTileEntity; if (aCoverVariable < 2) { if ((aInputRedstone > 0) == (aCoverVariable == 0)) { - if (!machine.isAllowedToWork()) - machine.enableWorking(); - } else if (machine.isAllowedToWork()) - machine.disableWorking(); + if (!machine.isAllowedToWork()) machine.enableWorking(); + } else if (machine.isAllowedToWork()) machine.disableWorking(); machine.setWorkDataValue(aInputRedstone); } else if (aCoverVariable == 2) { machine.disableWorking(); } else { if (machine.wasShutdown()) { machine.disableWorking(); - GT_Utility.sendChatToPlayer(lastPlayer, aTileEntity.getInventoryName() + "at " + String.format("(%d,%d,%d)", aTileEntity.getXCoord(), aTileEntity.getYCoord(), aTileEntity.getZCoord()) + " shut down."); + GT_Utility.sendChatToPlayer( + lastPlayer, + aTileEntity.getInventoryName() + "at " + + String.format( + "(%d,%d,%d)", + aTileEntity.getXCoord(), aTileEntity.getYCoord(), aTileEntity.getZCoord()) + + " shut down."); return 2; } else { return 3 + doCoverThings(aSide, aInputRedstone, aCoverID, aCoverVariable - 3, aTileEntity, aTimer); @@ -90,7 +94,8 @@ public class GT_Cover_ControlsWork extends GT_CoverBehavior { } @Override - public boolean onCoverRemoval(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, boolean aForced) { + public boolean onCoverRemoval( + byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, boolean aForced) { if ((aTileEntity instanceof IMachineProgress)) { ((IMachineProgress) aTileEntity).enableWorking(); ((IMachineProgress) aTileEntity).setWorkDataValue((byte) 0); @@ -99,9 +104,19 @@ public class GT_Cover_ControlsWork extends GT_CoverBehavior { } @Override - public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { - aCoverVariable = (aCoverVariable + (aPlayer.isSneaking()? -1 : 1)) % 5; - if(aCoverVariable <0){aCoverVariable = 2;} + public int onCoverScrewdriverclick( + byte aSide, + int aCoverID, + int aCoverVariable, + ICoverable aTileEntity, + EntityPlayer aPlayer, + float aX, + float aY, + float aZ) { + aCoverVariable = (aCoverVariable + (aPlayer.isSneaking() ? -1 : 1)) % 5; + if (aCoverVariable < 0) { + aCoverVariable = 2; + } if (aCoverVariable == 0) { GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("003", "Enable with Signal")); } @@ -140,14 +155,13 @@ public class GT_Cover_ControlsWork extends GT_CoverBehavior { /** * GUI Stuff */ - @Override public boolean hasCoverGUI() { return true; } @Override - public Object getClientGUI(byte aSide, int aCoverID, int coverData, ICoverable aTileEntity) { + public Object getClientGUI(byte aSide, int aCoverID, int coverData, ICoverable aTileEntity) { return new GT_Cover_ControlsWork.GUI(aSide, aCoverID, coverData, aTileEntity); } @@ -173,16 +187,31 @@ public class GT_Cover_ControlsWork extends GT_CoverBehavior { new GT_GuiIconButton(this, 1, startX + spaceX * 0, startY + spaceY * 1, GT_GuiIcon.REDSTONE_OFF); new GT_GuiIconButton(this, 2, startX + spaceX * 0, startY + spaceY * 2, GT_GuiIcon.CROSS); - new GT_GuiIconCheckButton(this, 3, startX + spaceX * 0, startY + spaceY * 3, GT_GuiIcon.CHECKMARK, GT_GuiIcon.CROSS).setChecked(aCoverVariable > 2); + new GT_GuiIconCheckButton( + this, 3, startX + spaceX * 0, startY + spaceY * 3, GT_GuiIcon.CHECKMARK, GT_GuiIcon.CROSS) + .setChecked(aCoverVariable > 2); } @Override public void drawExtras(int mouseX, int mouseY, float parTicks) { super.drawExtras(mouseX, mouseY, parTicks); - this.fontRendererObj.drawString(GT_Utility.trans("243", "Enable with Redstone"), 3+startX + spaceX*1, 4+startY+spaceY*0, textColor); - this.fontRendererObj.drawString(GT_Utility.trans("244", "Disable with Redstone"),3+startX + spaceX*1, 4+startY+spaceY*1, textColor); - this.fontRendererObj.drawString(GT_Utility.trans("245", "Disable machine"), 3+startX + spaceX*1, 4+startY+spaceY*2, textColor); - this.fontRendererObj.drawString(GT_Utility.trans("507", "Safe Mode"), 3+startX + spaceX*1, 4+startY+spaceY*3, textColor); + this.fontRendererObj.drawString( + GT_Utility.trans("243", "Enable with Redstone"), + 3 + startX + spaceX * 1, + 4 + startY + spaceY * 0, + textColor); + this.fontRendererObj.drawString( + GT_Utility.trans("244", "Disable with Redstone"), + 3 + startX + spaceX * 1, + 4 + startY + spaceY * 1, + textColor); + this.fontRendererObj.drawString( + GT_Utility.trans("245", "Disable machine"), + 3 + startX + spaceX * 1, + 4 + startY + spaceY * 2, + textColor); + this.fontRendererObj.drawString( + GT_Utility.trans("507", "Safe Mode"), 3 + startX + spaceX * 1, 4 + startY + spaceY * 3, textColor); } @Override @@ -231,6 +260,5 @@ public class GT_Cover_ControlsWork extends GT_CoverBehavior { coverVariable -= 3; } } - } } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java b/src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java index 9e0fd84a6c..592475b610 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java @@ -1,5 +1,7 @@ package gregtech.common.covers; +import static gregtech.api.util.GT_Utility.moveMultipleItemStacks; + import gregtech.api.enums.GT_Values; import gregtech.api.gui.GT_GUICover; import gregtech.api.gui.widgets.GT_GuiIcon; @@ -14,8 +16,6 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.fluids.Fluid; -import static gregtech.api.util.GT_Utility.moveMultipleItemStacks; - public class GT_Cover_Conveyor extends GT_CoverBehavior { public final int mTickRate; private final int mMaxStacks; @@ -31,12 +31,14 @@ public class GT_Cover_Conveyor extends GT_CoverBehavior { } @Override - public boolean isRedstoneSensitive(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { + public boolean isRedstoneSensitive( + byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { return false; } @Override - public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { + public int doCoverThings( + byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { if ((aCoverVariable % 6 > 1) && ((aTileEntity instanceof IMachineProgress))) { if (((IMachineProgress) aTileEntity).isAllowedToWork() != aCoverVariable % 6 < 4) { return aCoverVariable; @@ -44,44 +46,77 @@ public class GT_Cover_Conveyor extends GT_CoverBehavior { } TileEntity tTileEntity = aTileEntity.getTileEntityAtSide(aSide); Object fromEntity = aCoverVariable % 2 == 0 ? aTileEntity : tTileEntity, - toEntity = aCoverVariable % 2 != 0 ? aTileEntity : tTileEntity; + toEntity = aCoverVariable % 2 != 0 ? aTileEntity : tTileEntity; byte fromSide = aCoverVariable % 2 != 0 ? GT_Utility.getOppositeSide(aSide) : aSide, - toSide = aCoverVariable % 2 == 0 ? GT_Utility.getOppositeSide(aSide) : aSide; - - moveMultipleItemStacks(fromEntity, toEntity, fromSide , toSide, null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1,this.mMaxStacks); + toSide = aCoverVariable % 2 == 0 ? GT_Utility.getOppositeSide(aSide) : aSide; + + moveMultipleItemStacks( + fromEntity, + toEntity, + fromSide, + toSide, + null, + false, + (byte) 64, + (byte) 1, + (byte) 64, + (byte) 1, + this.mMaxStacks); return aCoverVariable; } @Override - public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { - aCoverVariable = (aCoverVariable + (aPlayer.isSneaking()? -1 : 1)) % 12; - if(aCoverVariable <0){aCoverVariable = 11;} - switch(aCoverVariable) { + public int onCoverScrewdriverclick( + byte aSide, + int aCoverID, + int aCoverVariable, + ICoverable aTileEntity, + EntityPlayer aPlayer, + float aX, + float aY, + float aZ) { + aCoverVariable = (aCoverVariable + (aPlayer.isSneaking() ? -1 : 1)) % 12; + if (aCoverVariable < 0) { + aCoverVariable = 11; + } + switch (aCoverVariable) { case 0: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("006", "Export")); break; + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("006", "Export")); + break; case 1: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("007", "Import")); break; + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("007", "Import")); + break; case 2: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("008", "Export (conditional)")); break; + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("008", "Export (conditional)")); + break; case 3: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("009", "Import (conditional)")); break; + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("009", "Import (conditional)")); + break; case 4: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("010", "Export (invert cond)")); break; + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("010", "Export (invert cond)")); + break; case 5: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("011", "Import (invert cond)")); break; + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("011", "Import (invert cond)")); + break; case 6: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("012", "Export allow Input")); break; + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("012", "Export allow Input")); + break; case 7: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("013", "Import allow Output")); break; + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("013", "Import allow Output")); + break; case 8: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("014", "Export allow Input (conditional)")); break; + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("014", "Export allow Input (conditional)")); + break; case 9: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("015", "Import allow Output (conditional)")); break; + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("015", "Import allow Output (conditional)")); + break; case 10: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("016", "Export allow Input (invert cond)")); break; + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("016", "Export allow Input (invert cond)")); + break; case 11: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("017", "Import allow Output (invert cond)")); break; + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("017", "Import allow Output (invert cond)")); + break; } return aCoverVariable; } @@ -139,14 +174,13 @@ public class GT_Cover_Conveyor extends GT_CoverBehavior { /** * GUI Stuff */ - @Override public boolean hasCoverGUI() { return true; } @Override - public Object getClientGUI(byte aSide, int aCoverID, int coverData, ICoverable aTileEntity) { + public Object getClientGUI(byte aSide, int aCoverID, int coverData, ICoverable aTileEntity) { return new GT_Cover_Conveyor.GUI(aSide, aCoverID, coverData, aTileEntity); } @@ -169,21 +203,31 @@ public class GT_Cover_Conveyor extends GT_CoverBehavior { this.coverVariable = aCoverVariable; GT_GuiIconButton b; - b = new GT_GuiIconButton(this, 0, startX + spaceX*0, startY+spaceY*0, GT_GuiIcon.EXPORT).setTooltipText(GT_Utility.trans("006", "Export")); - b = new GT_GuiIconButton(this, 1, startX + spaceX*1, startY+spaceY*0, GT_GuiIcon.IMPORT).setTooltipText(GT_Utility.trans("007", "Import")); - b = new GT_GuiIconButton(this, 2, startX + spaceX*0, startY+spaceY*1, GT_GuiIcon.CHECKMARK).setTooltipText(GT_Utility.trans("224", "Always On")); - b = new GT_GuiIconButton(this, 3, startX + spaceX*1, startY+spaceY*1, GT_GuiIcon.REDSTONE_ON).setTooltipText(GT_Utility.trans("225", "Active with Redstone Signal")); - b = new GT_GuiIconButton(this, 4, startX + spaceX*2, startY+spaceY*1, GT_GuiIcon.REDSTONE_OFF).setTooltipText(GT_Utility.trans("226", "Inactive with Redstone Signal")); - b = new GT_GuiIconButton(this, 5, startX + spaceX*0, startY+spaceY*2, GT_GuiIcon.ALLOW_INPUT).setTooltipText(GT_Utility.trans("227", "Allow Input")); - b = new GT_GuiIconButton(this, 6, startX + spaceX*1, startY+spaceY*2, GT_GuiIcon.BLOCK_INPUT).setTooltipText(GT_Utility.trans("228", "Block Input")); + b = new GT_GuiIconButton(this, 0, startX + spaceX * 0, startY + spaceY * 0, GT_GuiIcon.EXPORT) + .setTooltipText(GT_Utility.trans("006", "Export")); + b = new GT_GuiIconButton(this, 1, startX + spaceX * 1, startY + spaceY * 0, GT_GuiIcon.IMPORT) + .setTooltipText(GT_Utility.trans("007", "Import")); + b = new GT_GuiIconButton(this, 2, startX + spaceX * 0, startY + spaceY * 1, GT_GuiIcon.CHECKMARK) + .setTooltipText(GT_Utility.trans("224", "Always On")); + b = new GT_GuiIconButton(this, 3, startX + spaceX * 1, startY + spaceY * 1, GT_GuiIcon.REDSTONE_ON) + .setTooltipText(GT_Utility.trans("225", "Active with Redstone Signal")); + b = new GT_GuiIconButton(this, 4, startX + spaceX * 2, startY + spaceY * 1, GT_GuiIcon.REDSTONE_OFF) + .setTooltipText(GT_Utility.trans("226", "Inactive with Redstone Signal")); + b = new GT_GuiIconButton(this, 5, startX + spaceX * 0, startY + spaceY * 2, GT_GuiIcon.ALLOW_INPUT) + .setTooltipText(GT_Utility.trans("227", "Allow Input")); + b = new GT_GuiIconButton(this, 6, startX + spaceX * 1, startY + spaceY * 2, GT_GuiIcon.BLOCK_INPUT) + .setTooltipText(GT_Utility.trans("228", "Block Input")); } @Override public void drawExtras(int mouseX, int mouseY, float parTicks) { super.drawExtras(mouseX, mouseY, parTicks); - this.fontRendererObj.drawString(GT_Utility.trans("229", "Import/Export"), startX + spaceX*3, 3+startY+spaceY*0, textColor); - this.fontRendererObj.drawString(GT_Utility.trans("230", "Conditional"), startX + spaceX*3, 3+startY+spaceY*1, textColor); - this.fontRendererObj.drawString(GT_Utility.trans("231", "Enable Input"), startX + spaceX*3, 3+startY+spaceY*2, textColor); + this.fontRendererObj.drawString( + GT_Utility.trans("229", "Import/Export"), startX + spaceX * 3, 3 + startY + spaceY * 0, textColor); + this.fontRendererObj.drawString( + GT_Utility.trans("230", "Conditional"), startX + spaceX * 3, 3 + startY + spaceY * 1, textColor); + this.fontRendererObj.drawString( + GT_Utility.trans("231", "Enable Input"), startX + spaceX * 3, 3 + startY + spaceY * 2, textColor); } @Override @@ -192,15 +236,15 @@ public class GT_Cover_Conveyor extends GT_CoverBehavior { } @Override - public void buttonClicked(GuiButton btn){ - if (getClickable(btn.id)){ + public void buttonClicked(GuiButton btn) { + if (getClickable(btn.id)) { coverVariable = getNewCoverVariable(btn.id); GT_Values.NW.sendToServer(new GT_Packet_TileEntityCover(side, coverID, coverVariable, tile)); } updateButtons(); } - private void updateButtons(){ + private void updateButtons() { GuiButton b; for (Object o : buttonList) { b = (GuiButton) o; @@ -215,34 +259,29 @@ public class GT_Cover_Conveyor extends GT_CoverBehavior { case 1: return coverVariable | 0x1; case 2: - if (coverVariable > 5) - return 0x6 | (coverVariable & ~0xE); + if (coverVariable > 5) return 0x6 | (coverVariable & ~0xE); return (coverVariable & ~0xE); case 3: - if (coverVariable > 5) - return 0x8 | (coverVariable & ~0xE); + if (coverVariable > 5) return 0x8 | (coverVariable & ~0xE); return 0x2 | (coverVariable & ~0xE); case 4: - if (coverVariable > 5) - return 0xA | (coverVariable & ~0xE); + if (coverVariable > 5) return 0xA | (coverVariable & ~0xE); return (0x4 | (coverVariable & ~0xE)); case 5: - if (coverVariable <= 5) - return coverVariable + 6; + if (coverVariable <= 5) return coverVariable + 6; break; case 6: - if (coverVariable > 5) - return coverVariable - 6; + if (coverVariable > 5) return coverVariable - 6; } return coverVariable; } private boolean getClickable(int id) { - if (coverVariable < 0 | 11 < coverVariable) - return false; + if (coverVariable < 0 | 11 < coverVariable) return false; switch (id) { - case 0: case 1: + case 0: + case 1: return (0x1 & coverVariable) != id; case 2: return (coverVariable % 6) >= 2; diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Crafting.java b/src/main/java/gregtech/common/covers/GT_Cover_Crafting.java index bd3003f39f..61f7aefed9 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Crafting.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Crafting.java @@ -9,21 +9,38 @@ import net.minecraft.network.play.server.S2DPacketOpenWindow; public class GT_Cover_Crafting extends GT_CoverBehavior { @Override - public boolean isRedstoneSensitive(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { + public boolean isRedstoneSensitive( + byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { return false; } @Override - public boolean onCoverRightclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onCoverRightclick( + byte aSide, + int aCoverID, + int aCoverVariable, + ICoverable aTileEntity, + EntityPlayer aPlayer, + float aX, + float aY, + float aZ) { if ((aPlayer instanceof EntityPlayerMP)) { ((EntityPlayerMP) aPlayer).getNextWindowId(); - ((EntityPlayerMP) aPlayer).playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(((EntityPlayerMP) aPlayer).currentWindowId, 1, "Crafting", 9, true)); - ((EntityPlayerMP) aPlayer).openContainer = new ContainerWorkbench(((EntityPlayerMP) aPlayer).inventory, ((EntityPlayerMP) aPlayer).worldObj, aTileEntity.getXCoord(), aTileEntity.getYCoord(), aTileEntity.getZCoord()) { - @Override - public boolean canInteractWith(EntityPlayer player) { - return true; - } - }; + ((EntityPlayerMP) aPlayer) + .playerNetServerHandler.sendPacket(new S2DPacketOpenWindow( + ((EntityPlayerMP) aPlayer).currentWindowId, 1, "Crafting", 9, true)); + ((EntityPlayerMP) aPlayer).openContainer = + new ContainerWorkbench( + ((EntityPlayerMP) aPlayer).inventory, + ((EntityPlayerMP) aPlayer).worldObj, + aTileEntity.getXCoord(), + aTileEntity.getYCoord(), + aTileEntity.getZCoord()) { + @Override + public boolean canInteractWith(EntityPlayer player) { + return true; + } + }; ((EntityPlayerMP) aPlayer).openContainer.windowId = ((EntityPlayerMP) aPlayer).currentWindowId; ((EntityPlayerMP) aPlayer).openContainer.addCraftingToCrafters((EntityPlayerMP) aPlayer); } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_DoesWork.java b/src/main/java/gregtech/common/covers/GT_Cover_DoesWork.java index 366b896d45..54ca59b373 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_DoesWork.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_DoesWork.java @@ -16,22 +16,32 @@ import net.minecraftforge.fluids.Fluid; public class GT_Cover_DoesWork extends GT_CoverBehavior { @Override - public boolean isRedstoneSensitive(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { + public boolean isRedstoneSensitive( + byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { return false; } @Override - public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { + public int doCoverThings( + byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { if ((aTileEntity instanceof IMachineProgress)) { if (aCoverVariable < 2) { int tScale = ((IMachineProgress) aTileEntity).getMaxProgress() / 15; if ((tScale > 0) && (((IMachineProgress) aTileEntity).hasThingsToDo())) { - aTileEntity.setOutputRedstoneSignal(aSide, aCoverVariable % 2 == 0 ? (byte) (((IMachineProgress) aTileEntity).getProgress() / tScale) : (byte) (15 - ((IMachineProgress) aTileEntity).getProgress() / tScale)); + aTileEntity.setOutputRedstoneSignal( + aSide, + aCoverVariable % 2 == 0 + ? (byte) (((IMachineProgress) aTileEntity).getProgress() / tScale) + : (byte) (15 - ((IMachineProgress) aTileEntity).getProgress() / tScale)); } else { aTileEntity.setOutputRedstoneSignal(aSide, (byte) (aCoverVariable % 2 == 0 ? 0 : 15)); } } else { - aTileEntity.setOutputRedstoneSignal(aSide, (byte) ((aCoverVariable % 2 == 0 ? 1 : 0) != (((IMachineProgress) aTileEntity).getMaxProgress() == 0 ? 1 : 0) ? 0 : 15)); + aTileEntity.setOutputRedstoneSignal(aSide, (byte) + ((aCoverVariable % 2 == 0 ? 1 : 0) + != (((IMachineProgress) aTileEntity).getMaxProgress() == 0 ? 1 : 0) + ? 0 + : 15)); } } else { aTileEntity.setOutputRedstoneSignal(aSide, (byte) 0); @@ -40,18 +50,32 @@ public class GT_Cover_DoesWork extends GT_CoverBehavior { } @Override - public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { - aCoverVariable = (aCoverVariable + (aPlayer.isSneaking()? -1 : 1)) % 4; - if(aCoverVariable <0){aCoverVariable = 3;} - switch(aCoverVariable) { + public int onCoverScrewdriverclick( + byte aSide, + int aCoverID, + int aCoverVariable, + ICoverable aTileEntity, + EntityPlayer aPlayer, + float aX, + float aY, + float aZ) { + aCoverVariable = (aCoverVariable + (aPlayer.isSneaking() ? -1 : 1)) % 4; + if (aCoverVariable < 0) { + aCoverVariable = 3; + } + switch (aCoverVariable) { case 0: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("018", "Normal")); break; // Progress scaled + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("018", "Normal")); + break; // Progress scaled case 1: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("019", "Inverted")); break; // ^ inverted + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("019", "Inverted")); + break; // ^ inverted case 2: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("020", "Ready to work")); break; // Not Running + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("020", "Ready to work")); + break; // Not Running case 3: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("021", "Not ready to work")); break; // Running + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("021", "Not ready to work")); + break; // Running } return aCoverVariable; } @@ -87,7 +111,8 @@ public class GT_Cover_DoesWork extends GT_CoverBehavior { } @Override - public boolean manipulatesSidedRedstoneOutput(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + public boolean manipulatesSidedRedstoneOutput( + byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } @@ -99,14 +124,13 @@ public class GT_Cover_DoesWork extends GT_CoverBehavior { /** * GUI Stuff */ - @Override public boolean hasCoverGUI() { return true; } @Override - public Object getClientGUI(byte aSide, int aCoverID, int coverData, ICoverable aTileEntity) { + public Object getClientGUI(byte aSide, int aCoverID, int coverData, ICoverable aTileEntity) { return new GT_Cover_DoesWork.GUI(aSide, aCoverID, coverData, aTileEntity); } @@ -129,25 +153,22 @@ public class GT_Cover_DoesWork extends GT_CoverBehavior { this.coverVariable = aCoverVariable; GuiButton b; - b = new GT_GuiIconButton(this, 0, startX + spaceX*0, startY+spaceY*0, GT_GuiIcon.PROGRESS); - b = new GT_GuiIconButton(this, 1, startX + spaceX*1, startY+spaceY*0, GT_GuiIcon.CHECKMARK); - b = new GT_GuiIconCheckButton(this, 2, startX + spaceX*0, startY+spaceY*1, GT_GuiIcon.REDSTONE_ON, GT_GuiIcon.REDSTONE_OFF); + b = new GT_GuiIconButton(this, 0, startX + spaceX * 0, startY + spaceY * 0, GT_GuiIcon.PROGRESS); + b = new GT_GuiIconButton(this, 1, startX + spaceX * 1, startY + spaceY * 0, GT_GuiIcon.CHECKMARK); + b = new GT_GuiIconCheckButton( + this, 2, startX + spaceX * 0, startY + spaceY * 1, GT_GuiIcon.REDSTONE_ON, GT_GuiIcon.REDSTONE_OFF); } @Override public void drawExtras(int mouseX, int mouseY, float parTicks) { super.drawExtras(mouseX, mouseY, parTicks); String s1, s2; - if ((coverVariable & 0x2) > 0) - s1 = GT_Utility.trans("242", "Machine idle"); - else - s1 = GT_Utility.trans("241", "Recipe progress"); - if ((coverVariable & 0x1) > 0) - s2 = GT_Utility.trans("INVERTED", "Inverted"); - else - s2 = GT_Utility.trans("NORMAL", "Normal"); - this.fontRendererObj.drawString(s1, startX + spaceX*3, 4+startY+spaceY*0, textColor); - this.fontRendererObj.drawString(s2, startX + spaceX*3, 4+startY+spaceY*1, textColor); + if ((coverVariable & 0x2) > 0) s1 = GT_Utility.trans("242", "Machine idle"); + else s1 = GT_Utility.trans("241", "Recipe progress"); + if ((coverVariable & 0x1) > 0) s2 = GT_Utility.trans("INVERTED", "Inverted"); + else s2 = GT_Utility.trans("NORMAL", "Normal"); + this.fontRendererObj.drawString(s1, startX + spaceX * 3, 4 + startY + spaceY * 0, textColor); + this.fontRendererObj.drawString(s2, startX + spaceX * 3, 4 + startY + spaceY * 1, textColor); } @Override @@ -156,11 +177,10 @@ public class GT_Cover_DoesWork extends GT_CoverBehavior { } @Override - public void buttonClicked(GuiButton btn){ - if (getClickable(btn.id)){ + public void buttonClicked(GuiButton btn) { + if (getClickable(btn.id)) { boolean state = false; - if (btn.id == 2) - state = ((GT_GuiIconCheckButton) btn).isChecked(); + if (btn.id == 2) state = ((GT_GuiIconCheckButton) btn).isChecked(); coverVariable = getNewCoverVariable(btn.id, state); GT_Values.NW.sendToServer(new GT_Packet_TileEntityCover(side, coverID, coverVariable, tile)); @@ -168,11 +188,11 @@ public class GT_Cover_DoesWork extends GT_CoverBehavior { updateButtons(); } - private void updateButtons(){ + private void updateButtons() { GuiButton b; for (Object o : buttonList) { b = (GuiButton) o; - if(b.id == 2){ + if (b.id == 2) { ((GT_GuiIconCheckButton) b).setChecked((coverVariable & 0x1) > 0); } else { b.enabled = getClickable(b.id); @@ -187,8 +207,7 @@ public class GT_Cover_DoesWork extends GT_CoverBehavior { case 1: return coverVariable | 0x2; case 2: - if (buttonState) - return coverVariable & ~0x1; + if (buttonState) return coverVariable & ~0x1; return coverVariable | 0x1; } return coverVariable; diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Drain.java b/src/main/java/gregtech/common/covers/GT_Cover_Drain.java index bb89dcde7d..c2a831cd6e 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Drain.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Drain.java @@ -16,11 +16,14 @@ import net.minecraftforge.fluids.IFluidHandler; public class GT_Cover_Drain extends GT_CoverBehavior { @Override - public boolean isRedstoneSensitive(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { + public boolean isRedstoneSensitive( + byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { return false; } + @Override - public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { + public int doCoverThings( + byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { if ((aCoverVariable % 3 > 1) && ((aTileEntity instanceof IMachineProgress))) { if (((IMachineProgress) aTileEntity).isAllowedToWork() != aCoverVariable % 3 < 2) { return aCoverVariable; @@ -29,55 +32,112 @@ public class GT_Cover_Drain extends GT_CoverBehavior { if (aSide != 6) { Block tBlock = aTileEntity.getBlockAtSide(aSide); if ((aCoverVariable < 3) && ((aTileEntity instanceof IFluidHandler))) { - if ((aSide == 1) && - (aTileEntity.getWorld().isRaining()) && - (aTileEntity.getWorld().getPrecipitationHeight(aTileEntity.getXCoord(), aTileEntity.getZCoord()) - 2 < aTileEntity.getYCoord())) { + if ((aSide == 1) + && (aTileEntity.getWorld().isRaining()) + && (aTileEntity + .getWorld() + .getPrecipitationHeight( + aTileEntity.getXCoord(), aTileEntity.getZCoord()) + - 2 + < aTileEntity.getYCoord())) { int tAmount = (int) (aTileEntity.getBiome().rainfall * 10.0F); if (tAmount > 0) { - ((IFluidHandler) aTileEntity).fill(ForgeDirection.getOrientation(aSide), Materials.Water.getFluid(aTileEntity.getWorld().isThundering() ? tAmount * 2 : tAmount), true); + ((IFluidHandler) aTileEntity) + .fill( + ForgeDirection.getOrientation(aSide), + Materials.Water.getFluid( + aTileEntity.getWorld().isThundering() ? tAmount * 2 : tAmount), + true); } } FluidStack tLiquid = null; if (tBlock != null) { - if (((tBlock == Blocks.water) || (tBlock == Blocks.flowing_water)) && (aTileEntity.getMetaIDAtSide(aSide) == 0)) { + if (((tBlock == Blocks.water) || (tBlock == Blocks.flowing_water)) + && (aTileEntity.getMetaIDAtSide(aSide) == 0)) { tLiquid = Materials.Water.getFluid(1000L); - } else if (((tBlock == Blocks.lava) || (tBlock == Blocks.flowing_lava)) && (aTileEntity.getMetaIDAtSide(aSide) == 0)) { + } else if (((tBlock == Blocks.lava) || (tBlock == Blocks.flowing_lava)) + && (aTileEntity.getMetaIDAtSide(aSide) == 0)) { tLiquid = Materials.Lava.getFluid(1000L); } else if ((tBlock instanceof IFluidBlock)) { - tLiquid = ((IFluidBlock) tBlock).drain(aTileEntity.getWorld(), aTileEntity.getOffsetX(aSide, 1), aTileEntity.getOffsetY(aSide, 1), aTileEntity.getOffsetZ(aSide, 1), false); + tLiquid = ((IFluidBlock) tBlock) + .drain( + aTileEntity.getWorld(), + aTileEntity.getOffsetX(aSide, 1), + aTileEntity.getOffsetY(aSide, 1), + aTileEntity.getOffsetZ(aSide, 1), + false); } - if ((tLiquid != null) && (tLiquid.getFluid() != null) && ((aSide > 1) || ((aSide == 0) && (tLiquid.getFluid().getDensity() <= 0)) || ((aSide == 1) && (tLiquid.getFluid().getDensity() >= 0))) && - (((IFluidHandler) aTileEntity).fill(ForgeDirection.getOrientation(aSide), tLiquid, false) == tLiquid.amount)) { + if ((tLiquid != null) + && (tLiquid.getFluid() != null) + && ((aSide > 1) + || ((aSide == 0) && (tLiquid.getFluid().getDensity() <= 0)) + || ((aSide == 1) && (tLiquid.getFluid().getDensity() >= 0))) + && (((IFluidHandler) aTileEntity).fill(ForgeDirection.getOrientation(aSide), tLiquid, false) + == tLiquid.amount)) { ((IFluidHandler) aTileEntity).fill(ForgeDirection.getOrientation(aSide), tLiquid, true); - aTileEntity.getWorld().setBlockToAir(aTileEntity.getXCoord() + ForgeDirection.getOrientation(aSide).offsetX, aTileEntity.getYCoord() + ForgeDirection.getOrientation(aSide).offsetY, aTileEntity.getZCoord() + ForgeDirection.getOrientation(aSide).offsetZ); + aTileEntity + .getWorld() + .setBlockToAir( + aTileEntity.getXCoord() + ForgeDirection.getOrientation(aSide).offsetX, + aTileEntity.getYCoord() + ForgeDirection.getOrientation(aSide).offsetY, + aTileEntity.getZCoord() + ForgeDirection.getOrientation(aSide).offsetZ); } } } - if ((aCoverVariable >= 3) && (tBlock != null) && ( - (tBlock == Blocks.lava) || (tBlock == Blocks.flowing_lava) || (tBlock == Blocks.water) || (tBlock == Blocks.flowing_water) || ((tBlock instanceof IFluidBlock)))) { - aTileEntity.getWorld().setBlock(aTileEntity.getOffsetX(aSide, 1), aTileEntity.getOffsetY(aSide, 1), aTileEntity.getOffsetZ(aSide, 1), Blocks.air, 0, 0); + if ((aCoverVariable >= 3) + && (tBlock != null) + && ((tBlock == Blocks.lava) + || (tBlock == Blocks.flowing_lava) + || (tBlock == Blocks.water) + || (tBlock == Blocks.flowing_water) + || ((tBlock instanceof IFluidBlock)))) { + aTileEntity + .getWorld() + .setBlock( + aTileEntity.getOffsetX(aSide, 1), + aTileEntity.getOffsetY(aSide, 1), + aTileEntity.getOffsetZ(aSide, 1), + Blocks.air, + 0, + 0); } } return aCoverVariable; } @Override - public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { - aCoverVariable = (aCoverVariable + (aPlayer.isSneaking()? -1 : 1)) % 6; - if(aCoverVariable <0){aCoverVariable = 5;} - switch(aCoverVariable) { + public int onCoverScrewdriverclick( + byte aSide, + int aCoverID, + int aCoverVariable, + ICoverable aTileEntity, + EntityPlayer aPlayer, + float aX, + float aY, + float aZ) { + aCoverVariable = (aCoverVariable + (aPlayer.isSneaking() ? -1 : 1)) % 6; + if (aCoverVariable < 0) { + aCoverVariable = 5; + } + switch (aCoverVariable) { case 0: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("022", "Import")); break; + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("022", "Import")); + break; case 1: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("023", "Import (conditional)")); break; + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("023", "Import (conditional)")); + break; case 2: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("024", "Import (invert cond)")); break; + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("024", "Import (invert cond)")); + break; case 3: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("025", "Keep Liquids Away")); break; + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("025", "Keep Liquids Away")); + break; case 4: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("026", "Keep Liquids Away (conditional)")); break; + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("026", "Keep Liquids Away (conditional)")); + break; case 5: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("027", "Keep Liquids Away (invert cond)")); break; + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("027", "Keep Liquids Away (invert cond)")); + break; } return aCoverVariable; } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_EUMeter.java b/src/main/java/gregtech/common/covers/GT_Cover_EUMeter.java index 1f59049828..81b8fa8283 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_EUMeter.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_EUMeter.java @@ -16,6 +16,9 @@ import gregtech.api.util.GT_CoverBehaviorBase; import gregtech.api.util.GT_Utility; import gregtech.api.util.ISerializableObject; import io.netty.buffer.ByteBuf; +import java.util.function.Function; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; import net.minecraft.client.gui.GuiButton; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; @@ -24,10 +27,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; import net.minecraftforge.fluids.Fluid; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import java.util.function.Function; - public class GT_Cover_EUMeter extends GT_CoverBehaviorBase<GT_Cover_EUMeter.EUMeterData> { public GT_Cover_EUMeter() { super(EUMeterData.class); @@ -44,7 +43,13 @@ public class GT_Cover_EUMeter extends GT_CoverBehaviorBase<GT_Cover_EUMeter.EUMe } @Override - protected EUMeterData doCoverThingsImpl(byte aSide, byte aInputRedstone, int aCoverID, EUMeterData aCoverVariable, ICoverable aTileEntity, long aTimer) { + protected EUMeterData doCoverThingsImpl( + byte aSide, + byte aInputRedstone, + int aCoverID, + EUMeterData aCoverVariable, + ICoverable aTileEntity, + long aTimer) { final long stored = aCoverVariable.type.getTileEntityStoredEnergy(aTileEntity); final long capacity = aCoverVariable.type.getTileEntityEnergyCapacity(aTileEntity); @@ -78,8 +83,17 @@ public class GT_Cover_EUMeter extends GT_CoverBehaviorBase<GT_Cover_EUMeter.EUMe } @Override - protected EUMeterData onCoverScrewdriverClickImpl(byte aSide, int aCoverID, EUMeterData aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { - int num = (aCoverVariable.getNum() + (aPlayer.isSneaking() ? -1 : 1) + EnergyType.values().length * 2) % (EnergyType.values().length * 2); + protected EUMeterData onCoverScrewdriverClickImpl( + byte aSide, + int aCoverID, + EUMeterData aCoverVariable, + ICoverable aTileEntity, + EntityPlayer aPlayer, + float aX, + float aY, + float aZ) { + int num = (aCoverVariable.getNum() + (aPlayer.isSneaking() ? -1 : 1) + EnergyType.values().length * 2) + % (EnergyType.values().length * 2); switch (num) { case 0: GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("031", "Normal Universal Storage")); @@ -112,19 +126,22 @@ public class GT_Cover_EUMeter extends GT_CoverBehaviorBase<GT_Cover_EUMeter.EUMe GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("040", "Inverted Average Electric Output")); break; case 10: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("041", "Normal Electricity Storage(Including Batteries)")); + GT_Utility.sendChatToPlayer( + aPlayer, GT_Utility.trans("041", "Normal Electricity Storage(Including Batteries)")); break; case 11: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("042", "Inverted Electricity Storage(Including Batteries)")); + GT_Utility.sendChatToPlayer( + aPlayer, GT_Utility.trans("042", "Inverted Electricity Storage(Including Batteries)")); break; } aCoverVariable.setNum(num); return aCoverVariable; } - //region Static Result Methods + // region Static Result Methods @Override - protected boolean isRedstoneSensitiveImpl(byte aSide, int aCoverID, EUMeterData aCoverVariable, ICoverable aTileEntity, long aTimer) { + protected boolean isRedstoneSensitiveImpl( + byte aSide, int aCoverID, EUMeterData aCoverVariable, ICoverable aTileEntity, long aTimer) { return false; } @@ -139,27 +156,32 @@ public class GT_Cover_EUMeter extends GT_CoverBehaviorBase<GT_Cover_EUMeter.EUMe } @Override - protected boolean letsFluidInImpl(byte aSide, int aCoverID, EUMeterData aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { + protected boolean letsFluidInImpl( + byte aSide, int aCoverID, EUMeterData aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { return true; } @Override - protected boolean letsFluidOutImpl(byte aSide, int aCoverID, EUMeterData aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { + protected boolean letsFluidOutImpl( + byte aSide, int aCoverID, EUMeterData aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { return true; } @Override - protected boolean letsItemsInImpl(byte aSide, int aCoverID, EUMeterData aCoverVariable, int aSlot, ICoverable aTileEntity) { + protected boolean letsItemsInImpl( + byte aSide, int aCoverID, EUMeterData aCoverVariable, int aSlot, ICoverable aTileEntity) { return true; } @Override - protected boolean letsItemsOutImpl(byte aSide, int aCoverID, EUMeterData aCoverVariable, int aSlot, ICoverable aTileEntity) { + protected boolean letsItemsOutImpl( + byte aSide, int aCoverID, EUMeterData aCoverVariable, int aSlot, ICoverable aTileEntity) { return true; } @Override - protected boolean manipulatesSidedRedstoneOutputImpl(byte aSide, int aCoverID, EUMeterData aCoverVariable, ICoverable aTileEntity) { + protected boolean manipulatesSidedRedstoneOutputImpl( + byte aSide, int aCoverID, EUMeterData aCoverVariable, ICoverable aTileEntity) { return true; } @@ -167,19 +189,25 @@ public class GT_Cover_EUMeter extends GT_CoverBehaviorBase<GT_Cover_EUMeter.EUMe protected int getTickRateImpl(byte aSide, int aCoverID, EUMeterData aCoverVariable, ICoverable aTileEntity) { return 20; } - //endregion + // endregion - //region GUI Stuff + // region GUI Stuff @Override public boolean hasCoverGUI() { return true; } @Override - public Object getClientGUIImpl(byte aSide, int aCoverID, EUMeterData coverData, ICoverable aTileEntity, EntityPlayer aPlayer, World aWorld) { + public Object getClientGUIImpl( + byte aSide, + int aCoverID, + EUMeterData coverData, + ICoverable aTileEntity, + EntityPlayer aPlayer, + World aWorld) { return new GUI(aSide, aCoverID, coverData, aTileEntity); } - //endregion + // endregion public static class EUMeterData implements ISerializableObject { private EnergyType type; @@ -189,7 +217,6 @@ public class GT_Cover_EUMeter extends GT_CoverBehaviorBase<GT_Cover_EUMeter.EUMe */ private long threshold; - public EUMeterData() { type = EnergyType.UNIVERSAL_STORAGE; inverted = false; @@ -262,66 +289,64 @@ public class GT_Cover_EUMeter extends GT_CoverBehaviorBase<GT_Cover_EUMeter.EUMe private enum EnergyType { UNIVERSAL_STORAGE( - GT_Utility.trans("301", "Universal"), - GT_Utility.trans("256", "Universal Storage"), - ICoverable::getUniversalEnergyStored, - ICoverable::getUniversalEnergyCapacity - ), + GT_Utility.trans("301", "Universal"), + GT_Utility.trans("256", "Universal Storage"), + ICoverable::getUniversalEnergyStored, + ICoverable::getUniversalEnergyCapacity), ELECTRICITY_STORAGE( - GT_Utility.trans("302", "Int. EU"), - GT_Utility.trans("257", "Electricity Storage"), - ICoverable::getStoredEU, - ICoverable::getEUCapacity - ), + GT_Utility.trans("302", "Int. EU"), + GT_Utility.trans("257", "Electricity Storage"), + ICoverable::getStoredEU, + ICoverable::getEUCapacity), STEAM_STORAGE( - GT_Utility.trans("303", "Steam"), - GT_Utility.trans("258", "Steam Storage"), - ICoverable::getStoredSteam, - ICoverable::getSteamCapacity - ), + GT_Utility.trans("303", "Steam"), + GT_Utility.trans("258", "Steam Storage"), + ICoverable::getStoredSteam, + ICoverable::getSteamCapacity), AVERAGE_ELECTRIC_INPUT( - GT_Utility.trans("304", "Avg. Input"), - GT_Utility.trans("259", "Average Electric Input"), - ICoverable::getAverageElectricInput, - (te) -> te.getInputVoltage() * te.getInputAmperage() - ), + GT_Utility.trans("304", "Avg. Input"), + GT_Utility.trans("259", "Average Electric Input"), + ICoverable::getAverageElectricInput, + (te) -> te.getInputVoltage() * te.getInputAmperage()), AVERAGE_ELECTRIC_OUTPUT( - GT_Utility.trans("305", "Avg. Output"), - GT_Utility.trans("260", "Average Electric Output"), - ICoverable::getAverageElectricOutput, - (te) -> te.getOutputVoltage() * te.getOutputAmperage() - ), + GT_Utility.trans("305", "Avg. Output"), + GT_Utility.trans("260", "Average Electric Output"), + ICoverable::getAverageElectricOutput, + (te) -> te.getOutputVoltage() * te.getOutputAmperage()), ELECTRICITY_STORAGE_INCLUDING_BATTERIES( - GT_Utility.trans("306", "EU stored"), - GT_Utility.trans("261", "Electricity Storage(Including Batteries)"), - (te) -> { - if (te instanceof IGregTechTileEntity) { - IMetaTileEntity mte = ((IGregTechTileEntity) te).getMetaTileEntity(); - if (mte instanceof GT_MetaTileEntity_BasicBatteryBuffer) { - GT_MetaTileEntity_BasicBatteryBuffer buffer = (GT_MetaTileEntity_BasicBatteryBuffer) mte; - return buffer.getStoredEnergy()[0]; + GT_Utility.trans("306", "EU stored"), + GT_Utility.trans("261", "Electricity Storage(Including Batteries)"), + (te) -> { + if (te instanceof IGregTechTileEntity) { + IMetaTileEntity mte = ((IGregTechTileEntity) te).getMetaTileEntity(); + if (mte instanceof GT_MetaTileEntity_BasicBatteryBuffer) { + GT_MetaTileEntity_BasicBatteryBuffer buffer = (GT_MetaTileEntity_BasicBatteryBuffer) mte; + return buffer.getStoredEnergy()[0]; + } } - } - return te.getStoredEU(); - }, - (te) -> { - if (te instanceof IGregTechTileEntity) { - IMetaTileEntity mte = ((IGregTechTileEntity) te).getMetaTileEntity(); - if (mte instanceof GT_MetaTileEntity_BasicBatteryBuffer) { - GT_MetaTileEntity_BasicBatteryBuffer buffer = (GT_MetaTileEntity_BasicBatteryBuffer) mte; - return buffer.getStoredEnergy()[1]; + return te.getStoredEU(); + }, + (te) -> { + if (te instanceof IGregTechTileEntity) { + IMetaTileEntity mte = ((IGregTechTileEntity) te).getMetaTileEntity(); + if (mte instanceof GT_MetaTileEntity_BasicBatteryBuffer) { + GT_MetaTileEntity_BasicBatteryBuffer buffer = (GT_MetaTileEntity_BasicBatteryBuffer) mte; + return buffer.getStoredEnergy()[1]; + } } - } - return te.getEUCapacity(); - } - ); + return te.getEUCapacity(); + }); private final String title; private final String tooltip; private final Function<ICoverable, Long> getTileEntityStoredEnergyFunc; private final Function<ICoverable, Long> getTileEntityEnergyCapacityFunc; - EnergyType(String title, String tooltip, Function<ICoverable, Long> getTileEntityStoredEnergyFunc, Function<ICoverable, Long> getTileEntityEnergyCapacityFunc) { + EnergyType( + String title, + String tooltip, + Function<ICoverable, Long> getTileEntityStoredEnergyFunc, + Function<ICoverable, Long> getTileEntityEnergyCapacityFunc) { this.title = title; this.tooltip = tooltip; this.getTileEntityStoredEnergyFunc = getTileEntityStoredEnergyFunc; @@ -381,7 +406,15 @@ public class GT_Cover_EUMeter extends GT_CoverBehaviorBase<GT_Cover_EUMeter.EUMe this.coverVariable = aCoverVariable; typeButton = new GT_GuiIconButton(this, 0, startX, startY, GT_GuiIcon.CYCLIC); - invertedButton = new GT_GuiIconCheckButton(this, 2, startX, startY + spaceY, GT_GuiIcon.REDSTONE_ON, GT_GuiIcon.REDSTONE_OFF, INVERTED, NORMAL); + invertedButton = new GT_GuiIconCheckButton( + this, + 2, + startX, + startY + spaceY, + GT_GuiIcon.REDSTONE_ON, + GT_GuiIcon.REDSTONE_OFF, + INVERTED, + NORMAL); thresholdSlot = new GT_GuiIntegerTextBox(this, 4, startX, startY + spaceY * 2 + 2, spaceX * 8, 12); } @@ -389,11 +422,17 @@ public class GT_Cover_EUMeter extends GT_CoverBehaviorBase<GT_Cover_EUMeter.EUMe public void drawExtras(int mouseX, int mouseY, float parTicks) { super.drawExtras(mouseX, mouseY, parTicks); this.getFontRenderer().drawString(coverVariable.type.getTitle(), startX + spaceX, 4 + startY, textColor); - this.getFontRenderer().drawString(coverVariable.inverted ? INVERTED : NORMAL, startX + spaceX, 4 + startY + spaceY, textColor); - this.getFontRenderer().drawString(GT_Utility.trans("222.1", "Energy threshold"), startX, startY + spaceY * 3 + 4, textColor); + this.getFontRenderer() + .drawString( + coverVariable.inverted ? INVERTED : NORMAL, + startX + spaceX, + 4 + startY + spaceY, + textColor); + this.getFontRenderer() + .drawString( + GT_Utility.trans("222.1", "Energy threshold"), startX, startY + spaceY * 3 + 4, textColor); } - @Override protected void onInitGui(int guiLeft, int guiTop, int gui_width, int gui_height) { update(); @@ -458,7 +497,6 @@ public class GT_Cover_EUMeter extends GT_CoverBehaviorBase<GT_Cover_EUMeter.EUMe resetTextBox(thresholdSlot); } - private long parseTextBox(GT_GuiIntegerTextBox box) { if (box == thresholdSlot) { String text = box.getText(); diff --git a/src/main/java/gregtech/common/covers/GT_Cover_EnergyOnly.java b/src/main/java/gregtech/common/covers/GT_Cover_EnergyOnly.java index 27475f358e..53951ea771 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_EnergyOnly.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_EnergyOnly.java @@ -9,20 +9,32 @@ import net.minecraftforge.fluids.Fluid; public class GT_Cover_EnergyOnly extends GT_CoverBehavior { @Override - public boolean isRedstoneSensitive(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { + public boolean isRedstoneSensitive( + byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { return false; } @Override - public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public int onCoverScrewdriverclick( + byte aSide, + int aCoverID, + int aCoverVariable, + ICoverable aTileEntity, + EntityPlayer aPlayer, + float aX, + float aY, + float aZ) { aCoverVariable = (aCoverVariable + 1) % 3; - switch(aCoverVariable) { + switch (aCoverVariable) { case 0: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("028", "Allow")); break; + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("028", "Allow")); + break; case 1: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("029", "Allow (conditional)")); break; + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("029", "Allow (conditional)")); + break; case 2: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("030", "Disallow (conditional)")); break; + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("030", "Disallow (conditional)")); + break; } return aCoverVariable; } @@ -88,17 +100,27 @@ public class GT_Cover_EnergyOnly extends GT_CoverBehavior { } @Override - public boolean manipulatesSidedRedstoneOutput(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + public boolean manipulatesSidedRedstoneOutput( + byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return false; } @Override - public boolean onCoverRightclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onCoverRightclick( + byte aSide, + int aCoverID, + int aCoverVariable, + ICoverable aTileEntity, + EntityPlayer aPlayer, + float aX, + float aY, + float aZ) { return false; } @Override - public boolean onCoverRemoval(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, boolean aForced) { + public boolean onCoverRemoval( + byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, boolean aForced) { return true; } } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_FacadeAE.java b/src/main/java/gregtech/common/covers/GT_Cover_FacadeAE.java index a227d3f530..5b9c66f637 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_FacadeAE.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_FacadeAE.java @@ -6,24 +6,24 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; public class GT_Cover_FacadeAE extends GT_Cover_FacadeBase { - @Override - protected Block getTargetBlock(ItemStack aFacadeStack) { - if(aFacadeStack == null) return null; - final Item item = aFacadeStack.getItem(); - if (!(item instanceof IFacadeItem)) return null; - return ((IFacadeItem) item).getBlock(aFacadeStack); - } + @Override + protected Block getTargetBlock(ItemStack aFacadeStack) { + if (aFacadeStack == null) return null; + final Item item = aFacadeStack.getItem(); + if (!(item instanceof IFacadeItem)) return null; + return ((IFacadeItem) item).getBlock(aFacadeStack); + } - @Override - protected int getTargetMeta(ItemStack aFacadeStack) { - if(aFacadeStack == null) return 0; - final Item item = aFacadeStack.getItem(); - if (!(item instanceof IFacadeItem)) return 0; - return ((IFacadeItem) item).getMeta(aFacadeStack); - } + @Override + protected int getTargetMeta(ItemStack aFacadeStack) { + if (aFacadeStack == null) return 0; + final Item item = aFacadeStack.getItem(); + if (!(item instanceof IFacadeItem)) return 0; + return ((IFacadeItem) item).getMeta(aFacadeStack); + } - @Override - protected ItemStack getDisplayStackImpl(int aCoverID, FacadeData aCoverVariable) { - return aCoverVariable.mStack; - } + @Override + protected ItemStack getDisplayStackImpl(int aCoverID, FacadeData aCoverVariable) { + return aCoverVariable.mStack; + } } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_FacadeBase.java b/src/main/java/gregtech/common/covers/GT_Cover_FacadeBase.java index d35d0dbddd..addc154cfb 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_FacadeBase.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_FacadeBase.java @@ -16,6 +16,7 @@ import gregtech.api.util.GT_RenderingWorld; import gregtech.api.util.GT_Utility; import gregtech.api.util.ISerializableObject; import io.netty.buffer.ByteBuf; +import javax.annotation.Nonnull; import net.minecraft.block.Block; import net.minecraft.client.gui.GuiButton; import net.minecraft.entity.player.EntityPlayer; @@ -27,8 +28,6 @@ import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.Fluid; -import javax.annotation.Nonnull; - public abstract class GT_Cover_FacadeBase extends GT_CoverBehaviorBase<GT_Cover_FacadeBase.FacadeData> { /** * This is the Dummy, if there is a generic Cover without behavior @@ -53,19 +52,34 @@ public abstract class GT_Cover_FacadeBase extends GT_CoverBehaviorBase<GT_Cover_ } @Override - protected FacadeData onCoverScrewdriverClickImpl(byte aSide, int aCoverID, FacadeData aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { + protected FacadeData onCoverScrewdriverClickImpl( + byte aSide, + int aCoverID, + FacadeData aCoverVariable, + ICoverable aTileEntity, + EntityPlayer aPlayer, + float aX, + float aY, + float aZ) { aCoverVariable.mFlags = ((aCoverVariable.mFlags + 1) & 15); - GT_Utility.sendChatToPlayer(aPlayer, ((aCoverVariable.mFlags & 1) != 0 ? GT_Utility.trans("128", "Redstone ") : "") + ((aCoverVariable.mFlags & 2) != 0 ? GT_Utility.trans("129", "Energy ") : "") + ((aCoverVariable.mFlags & 4) != 0 ? GT_Utility.trans("130", "Fluids ") : "") + ((aCoverVariable.mFlags & 8) != 0 ? GT_Utility.trans("131", "Items ") : "")); + GT_Utility.sendChatToPlayer( + aPlayer, + ((aCoverVariable.mFlags & 1) != 0 ? GT_Utility.trans("128", "Redstone ") : "") + + ((aCoverVariable.mFlags & 2) != 0 ? GT_Utility.trans("129", "Energy ") : "") + + ((aCoverVariable.mFlags & 4) != 0 ? GT_Utility.trans("130", "Fluids ") : "") + + ((aCoverVariable.mFlags & 8) != 0 ? GT_Utility.trans("131", "Items ") : "")); return aCoverVariable; } @Override - protected boolean letsRedstoneGoInImpl(byte aSide, int aCoverID, FacadeData aCoverVariable, ICoverable aTileEntity) { + protected boolean letsRedstoneGoInImpl( + byte aSide, int aCoverID, FacadeData aCoverVariable, ICoverable aTileEntity) { return (aCoverVariable.mFlags & 1) != 0; } @Override - protected boolean letsRedstoneGoOutImpl(byte aSide, int aCoverID, FacadeData aCoverVariable, ICoverable aTileEntity) { + protected boolean letsRedstoneGoOutImpl( + byte aSide, int aCoverID, FacadeData aCoverVariable, ICoverable aTileEntity) { return (aCoverVariable.mFlags & 1) != 0; } @@ -80,30 +94,41 @@ public abstract class GT_Cover_FacadeBase extends GT_CoverBehaviorBase<GT_Cover_ } @Override - protected boolean letsFluidInImpl(byte aSide, int aCoverID, FacadeData aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { + protected boolean letsFluidInImpl( + byte aSide, int aCoverID, FacadeData aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { return (aCoverVariable.mFlags & 4) != 0; } @Override - protected boolean letsFluidOutImpl(byte aSide, int aCoverID, FacadeData aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { + protected boolean letsFluidOutImpl( + byte aSide, int aCoverID, FacadeData aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { return (aCoverVariable.mFlags & 4) != 0; } @Override - protected boolean letsItemsInImpl(byte aSide, int aCoverID, FacadeData aCoverVariable, int aSlot, ICoverable aTileEntity) { + protected boolean letsItemsInImpl( + byte aSide, int aCoverID, FacadeData aCoverVariable, int aSlot, ICoverable aTileEntity) { return (aCoverVariable.mFlags & 8) != 0; } @Override - protected boolean letsItemsOutImpl(byte aSide, int aCoverID, FacadeData aCoverVariable, int aSlot, ICoverable aTileEntity) { + protected boolean letsItemsOutImpl( + byte aSide, int aCoverID, FacadeData aCoverVariable, int aSlot, ICoverable aTileEntity) { return (aCoverVariable.mFlags & 8) != 0; } @Override public void placeCover(byte aSide, ItemStack aCover, ICoverable aTileEntity) { - aTileEntity.setCoverIdAndDataAtSide(aSide, GT_Utility.stackToInt(aCover), new FacadeData(GT_Utility.copyAmount(1, aCover), 0)); + aTileEntity.setCoverIdAndDataAtSide( + aSide, GT_Utility.stackToInt(aCover), new FacadeData(GT_Utility.copyAmount(1, aCover), 0)); if (aTileEntity.isClientSide()) - GT_RenderingWorld.getInstance().register(aTileEntity.getXCoord(), aTileEntity.getYCoord(), aTileEntity.getZCoord(), getTargetBlock(aCover), getTargetMeta(aCover)); + GT_RenderingWorld.getInstance() + .register( + aTileEntity.getXCoord(), + aTileEntity.getYCoord(), + aTileEntity.getZCoord(), + getTargetBlock(aCover), + getTargetMeta(aCover)); } @Override @@ -112,14 +137,18 @@ public abstract class GT_Cover_FacadeBase extends GT_CoverBehaviorBase<GT_Cover_ } @Override - protected ITexture getSpecialCoverTextureImpl(byte aSide, int aCoverID, FacadeData aCoverVariable, ICoverable aTileEntity) { + protected ITexture getSpecialCoverTextureImpl( + byte aSide, int aCoverID, FacadeData aCoverVariable, ICoverable aTileEntity) { if (GT_Utility.isStackInvalid(aCoverVariable.mStack)) return Textures.BlockIcons.ERROR_RENDERING[0]; Block block = getTargetBlock(aCoverVariable.mStack); if (block == null) return Textures.BlockIcons.ERROR_RENDERING[0]; // TODO: change this when *someone* made the block render in both pass - if (block.getRenderBlockPass() != 0) - return Textures.BlockIcons.ERROR_RENDERING[0]; - return TextureFactory.builder().setFromBlock(block, getTargetMeta(aCoverVariable.mStack)).useWorldCoord().setFromSide(ForgeDirection.getOrientation(aSide)).build(); + if (block.getRenderBlockPass() != 0) return Textures.BlockIcons.ERROR_RENDERING[0]; + return TextureFactory.builder() + .setFromBlock(block, getTargetMeta(aCoverVariable.mStack)) + .useWorldCoord() + .setFromSide(ForgeDirection.getOrientation(aSide)) + .build(); } @Override @@ -139,14 +168,21 @@ public abstract class GT_Cover_FacadeBase extends GT_CoverBehaviorBase<GT_Cover_ protected abstract int getTargetMeta(ItemStack aFacadeStack); @Override - protected boolean isDataNeededOnClientImpl(byte aSide, int aCoverID, FacadeData aCoverVariable, ICoverable aTileEntity) { + protected boolean isDataNeededOnClientImpl( + byte aSide, int aCoverID, FacadeData aCoverVariable, ICoverable aTileEntity) { return true; } @Override protected void onDataChangedImpl(byte aSide, int aCoverID, FacadeData aCoverVariable, ICoverable aTileEntity) { if (aTileEntity.isClientSide()) - GT_RenderingWorld.getInstance().register(aTileEntity.getXCoord(), aTileEntity.getYCoord(), aTileEntity.getZCoord(), getTargetBlock(aCoverVariable.mStack), getTargetMeta(aCoverVariable.mStack)); + GT_RenderingWorld.getInstance() + .register( + aTileEntity.getXCoord(), + aTileEntity.getYCoord(), + aTileEntity.getZCoord(), + getTargetBlock(aCoverVariable.mStack), + getTargetMeta(aCoverVariable.mStack)); } @Override @@ -159,12 +195,26 @@ public abstract class GT_Cover_FacadeBase extends GT_CoverBehaviorBase<GT_Cover_ } if (aCoverVariable.mStack != null) // mStack == null -> cover removed before data reach client - GT_RenderingWorld.getInstance().unregister(aTileEntity.getXCoord(), aTileEntity.getYCoord(), aTileEntity.getZCoord(), getTargetBlock(aCoverVariable.mStack), getTargetMeta(aCoverVariable.mStack)); + GT_RenderingWorld.getInstance() + .unregister( + aTileEntity.getXCoord(), + aTileEntity.getYCoord(), + aTileEntity.getZCoord(), + getTargetBlock(aCoverVariable.mStack), + getTargetMeta(aCoverVariable.mStack)); } } @Override - protected boolean onCoverRightClickImpl(byte aSide, int aCoverID, FacadeData aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { + protected boolean onCoverRightClickImpl( + byte aSide, + int aCoverID, + FacadeData aCoverVariable, + ICoverable aTileEntity, + EntityPlayer aPlayer, + float aX, + float aY, + float aZ) { // in case cover data didn't hit client somehow. maybe he had a ridiculous view distance aTileEntity.issueCoverUpdate(aSide); return super.onCoverRightClickImpl(aSide, aCoverID, aCoverVariable, aTileEntity, aPlayer, aX, aY, aZ); @@ -173,21 +223,26 @@ public abstract class GT_Cover_FacadeBase extends GT_CoverBehaviorBase<GT_Cover_ @Override public boolean isCoverPlaceable(byte aSide, ItemStack aStack, ICoverable aTileEntity) { // blocks that are not rendered in pass 0 are now accepted but rendered awkwardly - // to render it correctly require changing GT_Block_Machine to render in both pass, which is not really a good idea... + // to render it correctly require changing GT_Block_Machine to render in both pass, which is not really a good + // idea... if (!super.isCoverPlaceable(aSide, aStack, aTileEntity)) return false; Block targetBlock = getTargetBlock(aStack); if (targetBlock == null) return false; // we allow one single type of facade on the same block for now // otherwise it's not clear which block this block should impersonate - // this restriction can be lifted later by specifying a certain facade as dominate one as an extension to this class + // this restriction can be lifted later by specifying a certain facade as dominate one as an extension to this + // class for (byte i = 0; i < 6; i++) { if (i == aSide) continue; GT_CoverBehaviorBase<?> behavior = aTileEntity.getCoverBehaviorAtSideNew(i); if (behavior == null) continue; - Block facadeBlock = behavior.getFacadeBlock(i, aTileEntity.getCoverIDAtSide(i), aTileEntity.getComplexCoverDataAtSide(i), aTileEntity); + Block facadeBlock = behavior.getFacadeBlock( + i, aTileEntity.getCoverIDAtSide(i), aTileEntity.getComplexCoverDataAtSide(i), aTileEntity); if (facadeBlock == null) continue; if (facadeBlock != targetBlock) return false; - if (behavior.getFacadeMeta(i, aTileEntity.getCoverIDAtSide(i), aTileEntity.getComplexCoverDataAtSide(i), aTileEntity) != getTargetMeta(aStack)) return false; + if (behavior.getFacadeMeta( + i, aTileEntity.getCoverIDAtSide(i), aTileEntity.getComplexCoverDataAtSide(i), aTileEntity) + != getTargetMeta(aStack)) return false; } return true; } @@ -196,8 +251,7 @@ public abstract class GT_Cover_FacadeBase extends GT_CoverBehaviorBase<GT_Cover_ ItemStack mStack; int mFlags; - public FacadeData() { - } + public FacadeData() {} public FacadeData(ItemStack mStack, int mFlags) { this.mStack = mStack; @@ -214,7 +268,7 @@ public abstract class GT_Cover_FacadeBase extends GT_CoverBehaviorBase<GT_Cover_ @Override public NBTBase saveDataToNBT() { NBTTagCompound tag = new NBTTagCompound(); - if(mStack != null) tag.setTag("mStack", mStack.writeToNBT(new NBTTagCompound())); + if (mStack != null) tag.setTag("mStack", mStack.writeToNBT(new NBTTagCompound())); tag.setByte("mFlags", (byte) mFlags); return tag; } @@ -244,14 +298,19 @@ public abstract class GT_Cover_FacadeBase extends GT_CoverBehaviorBase<GT_Cover_ /** * GUI Stuff */ - @Override public boolean hasCoverGUI() { return true; } @Override - protected Object getClientGUIImpl(byte aSide, int aCoverID, FacadeData coverData, ICoverable aTileEntity, EntityPlayer aPlayer, World aWorld) { + protected Object getClientGUIImpl( + byte aSide, + int aCoverID, + FacadeData coverData, + ICoverable aTileEntity, + EntityPlayer aPlayer, + World aWorld) { return new GT_Cover_FacadeBase.GUI(aSide, aCoverID, coverData, aTileEntity); } @@ -273,19 +332,31 @@ public abstract class GT_Cover_FacadeBase extends GT_CoverBehaviorBase<GT_Cover_ this.coverID = aCoverID; this.coverVariable = aCoverVariable; - new GT_GuiIconCheckButton(this, 0, startX + spaceX * 0, startY + spaceY * 0, GT_GuiIcon.CHECKMARK, GT_GuiIcon.CROSS).setChecked((coverVariable.mFlags & 0x1) == 0); - new GT_GuiIconCheckButton(this, 1, startX + spaceX * 0, startY + spaceY * 1, GT_GuiIcon.CHECKMARK, GT_GuiIcon.CROSS).setChecked((coverVariable.mFlags & 0x2) == 0); - new GT_GuiIconCheckButton(this, 2, startX + spaceX * 0, startY + spaceY * 2, GT_GuiIcon.CHECKMARK, GT_GuiIcon.CROSS).setChecked((coverVariable.mFlags & 0x4) == 0); - new GT_GuiIconCheckButton(this, 3, startX + spaceX * 0, startY + spaceY * 3, GT_GuiIcon.CHECKMARK, GT_GuiIcon.CROSS).setChecked((coverVariable.mFlags & 0x8) == 0); + new GT_GuiIconCheckButton( + this, 0, startX + spaceX * 0, startY + spaceY * 0, GT_GuiIcon.CHECKMARK, GT_GuiIcon.CROSS) + .setChecked((coverVariable.mFlags & 0x1) == 0); + new GT_GuiIconCheckButton( + this, 1, startX + spaceX * 0, startY + spaceY * 1, GT_GuiIcon.CHECKMARK, GT_GuiIcon.CROSS) + .setChecked((coverVariable.mFlags & 0x2) == 0); + new GT_GuiIconCheckButton( + this, 2, startX + spaceX * 0, startY + spaceY * 2, GT_GuiIcon.CHECKMARK, GT_GuiIcon.CROSS) + .setChecked((coverVariable.mFlags & 0x4) == 0); + new GT_GuiIconCheckButton( + this, 3, startX + spaceX * 0, startY + spaceY * 3, GT_GuiIcon.CHECKMARK, GT_GuiIcon.CROSS) + .setChecked((coverVariable.mFlags & 0x8) == 0); } @Override public void drawExtras(int mouseX, int mouseY, float parTicks) { super.drawExtras(mouseX, mouseY, parTicks); - this.fontRendererObj.drawString(GT_Utility.trans("128", "Redstone"), 3 + startX + spaceX * 1, 4 + startY + spaceY * 0, textColor); - this.fontRendererObj.drawString(GT_Utility.trans("129", "Energy"), 3 + startX + spaceX * 1, 4 + startY + spaceY * 1, textColor); - this.fontRendererObj.drawString(GT_Utility.trans("130", "Fluids"), 3 + startX + spaceX * 1, 4 + startY + spaceY * 2, textColor); - this.fontRendererObj.drawString(GT_Utility.trans("131", "Items"), 3 + startX + spaceX * 1, 4 + startY + spaceY * 3, textColor); + this.fontRendererObj.drawString( + GT_Utility.trans("128", "Redstone"), 3 + startX + spaceX * 1, 4 + startY + spaceY * 0, textColor); + this.fontRendererObj.drawString( + GT_Utility.trans("129", "Energy"), 3 + startX + spaceX * 1, 4 + startY + spaceY * 1, textColor); + this.fontRendererObj.drawString( + GT_Utility.trans("130", "Fluids"), 3 + startX + spaceX * 1, 4 + startY + spaceY * 2, textColor); + this.fontRendererObj.drawString( + GT_Utility.trans("131", "Items"), 3 + startX + spaceX * 1, 4 + startY + spaceY * 3, textColor); } @Override diff --git a/src/main/java/gregtech/common/covers/GT_Cover_FluidLimiter.java b/src/main/java/gregtech/common/covers/GT_Cover_FluidLimiter.java index 4536cef710..a6c07e71f8 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_FluidLimiter.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_FluidLimiter.java @@ -10,6 +10,8 @@ import gregtech.api.util.GT_CoverBehaviorBase; import gregtech.api.util.GT_Utility; import gregtech.api.util.ISerializableObject; import io.netty.buffer.ByteBuf; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.nbt.NBTBase; @@ -20,22 +22,26 @@ import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidTankInfo; import net.minecraftforge.fluids.IFluidHandler; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - /*** * @author TrainerSnow#5086 */ public class GT_Cover_FluidLimiter extends GT_CoverBehaviorBase<GT_Cover_FluidLimiter.FluidLimiterData> { - public GT_Cover_FluidLimiter() { super(FluidLimiterData.class); } @Override - protected FluidLimiterData onCoverScrewdriverClickImpl(byte aSide, int aCoverID, FluidLimiterData aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { - if(aTileEntity instanceof IFluidHandler) { + protected FluidLimiterData onCoverScrewdriverClickImpl( + byte aSide, + int aCoverID, + FluidLimiterData aCoverVariable, + ICoverable aTileEntity, + EntityPlayer aPlayer, + float aX, + float aY, + float aZ) { + if (aTileEntity instanceof IFluidHandler) { adjustThreshold(aCoverVariable, !aPlayer.isSneaking()); GT_Utility.sendChatToPlayer(aPlayer, String.format("Threshold: %f", aCoverVariable.threshold)); } @@ -43,12 +49,14 @@ public class GT_Cover_FluidLimiter extends GT_CoverBehaviorBase<GT_Cover_FluidLi } @Override - protected boolean letsFluidInImpl(byte aSide, int aCoverID, FluidLimiterData aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { + protected boolean letsFluidInImpl( + byte aSide, int aCoverID, FluidLimiterData aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { return allowsFluidIn(aCoverVariable, aTileEntity); } @Override - protected boolean alwaysLookConnectedImpl(byte aSide, int aCoverID, FluidLimiterData aCoverVariable, ICoverable aTileEntity) { + protected boolean alwaysLookConnectedImpl( + byte aSide, int aCoverID, FluidLimiterData aCoverVariable, ICoverable aTileEntity) { return true; } @@ -57,22 +65,21 @@ public class GT_Cover_FluidLimiter extends GT_CoverBehaviorBase<GT_Cover_FluidLi */ private boolean allowsFluidIn(FluidLimiterData aCoverVariable, ICoverable c) { - if(c instanceof IFluidHandler) { + if (c instanceof IFluidHandler) { return aCoverVariable.threshold > getFillLevelInputSlots((IFluidHandler) c); } return false; } - private void adjustThreshold(FluidLimiterData coverVariable, boolean way) { - if(way) { - if((coverVariable.threshold + 0.05f) > 1F) { + if (way) { + if ((coverVariable.threshold + 0.05f) > 1F) { coverVariable.threshold = 0F; return; } coverVariable.threshold += 0.05F; } else { - if((Math.abs(coverVariable.threshold) - 0.05F) < 0F) { + if ((Math.abs(coverVariable.threshold) - 0.05F) < 0F) { coverVariable.threshold = 1F; return; } @@ -84,10 +91,10 @@ public class GT_Cover_FluidLimiter extends GT_CoverBehaviorBase<GT_Cover_FluidLi FluidTankInfo[] tankInfo = fh.getTankInfo(ForgeDirection.UNKNOWN); long tMax; long tUsed; - if(tankInfo != null) { - //0 Because we acces first slot only + if (tankInfo != null) { + // 0 Because we acces first slot only FluidTankInfo inputSlot = tankInfo[0]; - if(inputSlot.fluid != null) { + if (inputSlot.fluid != null) { tMax = inputSlot.capacity; tUsed = inputSlot.fluid.amount; return (float) tUsed / (float) tMax; @@ -96,7 +103,6 @@ public class GT_Cover_FluidLimiter extends GT_CoverBehaviorBase<GT_Cover_FluidLi return 0F; } - /* Data */ @@ -110,6 +116,7 @@ public class GT_Cover_FluidLimiter extends GT_CoverBehaviorBase<GT_Cover_FluidLi public FluidLimiterData createDataObject() { return new FluidLimiterData(1F); } + public static class FluidLimiterData implements ISerializableObject { private float threshold; @@ -138,7 +145,7 @@ public class GT_Cover_FluidLimiter extends GT_CoverBehaviorBase<GT_Cover_FluidLi @Override public void loadDataFromNBT(NBTBase aNBT) { - if(aNBT instanceof NBTTagCompound) { + if (aNBT instanceof NBTTagCompound) { NBTTagCompound tag = (NBTTagCompound) aNBT; this.threshold = tag.getFloat("threshold"); } @@ -152,13 +159,18 @@ public class GT_Cover_FluidLimiter extends GT_CoverBehaviorBase<GT_Cover_FluidLi } } - /* GUI */ @Override - protected Object getClientGUIImpl(byte aSide, int aCoverID, FluidLimiterData aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, World aWorld) { + protected Object getClientGUIImpl( + byte aSide, + int aCoverID, + FluidLimiterData aCoverVariable, + ICoverable aTileEntity, + EntityPlayer aPlayer, + World aWorld) { return new GUI(aSide, aCoverID, aCoverVariable, aTileEntity); } @@ -212,12 +224,12 @@ public class GT_Cover_FluidLimiter extends GT_CoverBehaviorBase<GT_Cover_FluidLi int percent; try { percent = Integer.parseInt(box.getText().trim()); - } catch(NumberFormatException ignored) { + } catch (NumberFormatException ignored) { resetTextBox(thresholdBox); return; } - if(percent > 100 || percent <= 0) return; + if (percent > 100 || percent <= 0) return; this.coverVariable.threshold = percent / 100F; box.setText(String.valueOf(percent)); diff --git a/src/main/java/gregtech/common/covers/GT_Cover_FluidRegulator.java b/src/main/java/gregtech/common/covers/GT_Cover_FluidRegulator.java index 947635369a..0bc34b147d 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_FluidRegulator.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_FluidRegulator.java @@ -13,6 +13,8 @@ import gregtech.api.util.GT_CoverBehaviorBase; import gregtech.api.util.GT_Utility; import gregtech.api.util.ISerializableObject; import io.netty.buffer.ByteBuf; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; import net.minecraft.client.gui.GuiButton; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; @@ -24,9 +26,6 @@ import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.IFluidHandler; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - /** * Cover variable * <pre> @@ -42,492 +41,561 @@ import javax.annotation.Nullable; * This way, `0` means 1tick interval, while `-1` means 1 tick interval as well, preserving the legacy behavior. */ public class GT_Cover_FluidRegulator extends GT_CoverBehaviorBase<GT_Cover_FluidRegulator.FluidRegulatorData> { - private static final int SPEED_LENGTH = 20; - private static final int TICK_RATE_LENGTH = Integer.SIZE - SPEED_LENGTH - 1; - private static final int TICK_RATE_MIN = 1; - private static final int TICK_RATE_MAX = (-1 >>> (Integer.SIZE - TICK_RATE_LENGTH)) + TICK_RATE_MIN; - private static final int TICK_RATE_BITMASK = (TICK_RATE_MAX - TICK_RATE_MIN) << SPEED_LENGTH; - - public final int mTransferRate; - private boolean allowFluid = false; - - public GT_Cover_FluidRegulator(int aTransferRate) { - super(FluidRegulatorData.class); - if (aTransferRate > (-1 >>> (Integer.SIZE - SPEED_LENGTH))) - throw new IllegalArgumentException("aTransferRate too big: " + aTransferRate); - this.mTransferRate = aTransferRate; - } - - @Override - public FluidRegulatorData createDataObject(int aLegacyData) { - return new FluidRegulatorData(aLegacyData); - } - - @Override - public FluidRegulatorData createDataObject() { - return new FluidRegulatorData(); - } - - private static int generateNewCoverVariable(int aFlowRate, int aTickRate) { - int tToStoreRaw = aTickRate - TICK_RATE_MIN; - int tToStore = aFlowRate >= 0 ? tToStoreRaw : ~tToStoreRaw; - return aFlowRate & ~TICK_RATE_BITMASK | (tToStore << SPEED_LENGTH); - } - - @Override - protected boolean isRedstoneSensitiveImpl(byte aSide, int aCoverID, FluidRegulatorData aCoverVariable, ICoverable aTileEntity, long aTimer) { - return aCoverVariable.condition.isRedstoneSensitive(); - } - - @Override - protected FluidRegulatorData doCoverThingsImpl(byte aSide, byte aInputRedstone, int aCoverID, FluidRegulatorData aCoverVariable, ICoverable aTileEntity, - long aTimer) { - if (aCoverVariable.speed == 0 || !aCoverVariable.condition.isAllowedToWork(aSide, aCoverID, aTileEntity)) { - return aCoverVariable; - } - if ((aTileEntity instanceof IFluidHandler)) { - IFluidHandler tTank1; - IFluidHandler tTank2; - ForgeDirection directionFrom; - ForgeDirection directionTo; - if (aCoverVariable.speed > 0) { - tTank2 = aTileEntity.getITankContainerAtSide(aSide); - tTank1 = (IFluidHandler) aTileEntity; - directionFrom = ForgeDirection.getOrientation(aSide); - directionTo = ForgeDirection.getOrientation(aSide).getOpposite(); - } else { - tTank1 = aTileEntity.getITankContainerAtSide(aSide); - tTank2 = (IFluidHandler) aTileEntity; - directionFrom = ForgeDirection.getOrientation(aSide).getOpposite(); - directionTo = ForgeDirection.getOrientation(aSide); - } - if (tTank1 != null && tTank2 != null) { - allowFluid = true; - FluidStack tLiquid = tTank1.drain(directionFrom, Math.abs(aCoverVariable.speed), false); - if (tLiquid != null) { - tLiquid = tLiquid.copy(); - tLiquid.amount = tTank2.fill(directionTo, tLiquid, false); - if (tLiquid.amount > 0) { - tTank2.fill(directionTo, tTank1.drain(directionFrom, tLiquid.amount, true), true); - } - } - allowFluid = false; - } - } - return aCoverVariable; - } - - private void adjustSpeed(EntityPlayer aPlayer, FluidRegulatorData aCoverVariable, int scale) { - int tSpeed = aCoverVariable.speed; - tSpeed += scale; - int tTickRate = aCoverVariable.tickRate; - if (Math.abs(tSpeed) > mTransferRate * tTickRate) { - tSpeed = mTransferRate * tTickRate * (tSpeed > 0 ? 1 : -1); - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("316", "Pump speed limit reached!")); - } - if (tTickRate == 1) { - GT_Utility.sendChatToPlayer(aPlayer, - GT_Utility.trans("048", "Pump speed: ") + tSpeed + GT_Utility.trans("049", "L/tick ") + tSpeed * 20 + GT_Utility.trans("050", "L/sec")); - } else { - GT_Utility.sendChatToPlayer(aPlayer, - String.format(GT_Utility.trans("207", "Pump speed: %dL every %d ticks, %.2f L/sec on average"), tSpeed, tTickRate, tSpeed * 20d / tTickRate)); - } - } - - @Override - public FluidRegulatorData onCoverScrewdriverClickImpl(byte aSide, int aCoverID, FluidRegulatorData aCoverVariable, ICoverable aTileEntity, - EntityPlayer aPlayer, float aX, float aY, float aZ) { - if (GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ)[0] >= 0.5F) { - adjustSpeed(aPlayer, aCoverVariable, aPlayer.isSneaking() ? 256 : 16); - } else { - adjustSpeed(aPlayer, aCoverVariable, aPlayer.isSneaking() ? -256 : -16); - } - return aCoverVariable; - } - - @Override - protected boolean onCoverRightClickImpl(byte aSide, int aCoverID, FluidRegulatorData aCoverVariable, ICoverable aTileEntity, - EntityPlayer aPlayer, float aX, float aY, float aZ) { - if (GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ)[0] >= 0.5F) { - adjustSpeed(aPlayer, aCoverVariable, 1); - } else { - adjustSpeed(aPlayer, aCoverVariable, -1); - } - return true; - } - - @Override - public boolean letsRedstoneGoInImpl(byte aSide, int aCoverID, FluidRegulatorData aCoverVariable, ICoverable aTileEntity) { - return true; - } - - @Override - public boolean letsRedstoneGoOutImpl(byte aSide, int aCoverID, FluidRegulatorData aCoverVariable, ICoverable aTileEntity) { - return true; - } - - @Override - public boolean letsEnergyInImpl(byte aSide, int aCoverID, FluidRegulatorData aCoverVariable, ICoverable aTileEntity) { - return true; - } - - @Override - public boolean letsEnergyOutImpl(byte aSide, int aCoverID, FluidRegulatorData aCoverVariable, ICoverable aTileEntity) { - return true; - } - - @Override - public boolean letsItemsInImpl(byte aSide, int aCoverID, FluidRegulatorData aCoverVariable, int aSlot, ICoverable aTileEntity) { - return true; - } - - @Override - public boolean letsItemsOutImpl(byte aSide, int aCoverID, FluidRegulatorData aCoverVariable, int aSlot, ICoverable aTileEntity) { - return true; - } - - @Override - public boolean letsFluidInImpl(byte aSide, int aCoverID, FluidRegulatorData aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { - return allowFluid; - } - - @Override - public boolean letsFluidOutImpl(byte aSide, int aCoverID, FluidRegulatorData aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { - return allowFluid; - } - - @Override - protected boolean alwaysLookConnectedImpl(byte aSide, int aCoverID, FluidRegulatorData aCoverVariable, ICoverable aTileEntity) { - return true; - } - - @Override + private static final int SPEED_LENGTH = 20; + private static final int TICK_RATE_LENGTH = Integer.SIZE - SPEED_LENGTH - 1; + private static final int TICK_RATE_MIN = 1; + private static final int TICK_RATE_MAX = (-1 >>> (Integer.SIZE - TICK_RATE_LENGTH)) + TICK_RATE_MIN; + private static final int TICK_RATE_BITMASK = (TICK_RATE_MAX - TICK_RATE_MIN) << SPEED_LENGTH; + + public final int mTransferRate; + private boolean allowFluid = false; + + public GT_Cover_FluidRegulator(int aTransferRate) { + super(FluidRegulatorData.class); + if (aTransferRate > (-1 >>> (Integer.SIZE - SPEED_LENGTH))) + throw new IllegalArgumentException("aTransferRate too big: " + aTransferRate); + this.mTransferRate = aTransferRate; + } + + @Override + public FluidRegulatorData createDataObject(int aLegacyData) { + return new FluidRegulatorData(aLegacyData); + } + + @Override + public FluidRegulatorData createDataObject() { + return new FluidRegulatorData(); + } + + private static int generateNewCoverVariable(int aFlowRate, int aTickRate) { + int tToStoreRaw = aTickRate - TICK_RATE_MIN; + int tToStore = aFlowRate >= 0 ? tToStoreRaw : ~tToStoreRaw; + return aFlowRate & ~TICK_RATE_BITMASK | (tToStore << SPEED_LENGTH); + } + + @Override + protected boolean isRedstoneSensitiveImpl( + byte aSide, int aCoverID, FluidRegulatorData aCoverVariable, ICoverable aTileEntity, long aTimer) { + return aCoverVariable.condition.isRedstoneSensitive(); + } + + @Override + protected FluidRegulatorData doCoverThingsImpl( + byte aSide, + byte aInputRedstone, + int aCoverID, + FluidRegulatorData aCoverVariable, + ICoverable aTileEntity, + long aTimer) { + if (aCoverVariable.speed == 0 || !aCoverVariable.condition.isAllowedToWork(aSide, aCoverID, aTileEntity)) { + return aCoverVariable; + } + if ((aTileEntity instanceof IFluidHandler)) { + IFluidHandler tTank1; + IFluidHandler tTank2; + ForgeDirection directionFrom; + ForgeDirection directionTo; + if (aCoverVariable.speed > 0) { + tTank2 = aTileEntity.getITankContainerAtSide(aSide); + tTank1 = (IFluidHandler) aTileEntity; + directionFrom = ForgeDirection.getOrientation(aSide); + directionTo = ForgeDirection.getOrientation(aSide).getOpposite(); + } else { + tTank1 = aTileEntity.getITankContainerAtSide(aSide); + tTank2 = (IFluidHandler) aTileEntity; + directionFrom = ForgeDirection.getOrientation(aSide).getOpposite(); + directionTo = ForgeDirection.getOrientation(aSide); + } + if (tTank1 != null && tTank2 != null) { + allowFluid = true; + FluidStack tLiquid = tTank1.drain(directionFrom, Math.abs(aCoverVariable.speed), false); + if (tLiquid != null) { + tLiquid = tLiquid.copy(); + tLiquid.amount = tTank2.fill(directionTo, tLiquid, false); + if (tLiquid.amount > 0) { + tTank2.fill(directionTo, tTank1.drain(directionFrom, tLiquid.amount, true), true); + } + } + allowFluid = false; + } + } + return aCoverVariable; + } + + private void adjustSpeed(EntityPlayer aPlayer, FluidRegulatorData aCoverVariable, int scale) { + int tSpeed = aCoverVariable.speed; + tSpeed += scale; + int tTickRate = aCoverVariable.tickRate; + if (Math.abs(tSpeed) > mTransferRate * tTickRate) { + tSpeed = mTransferRate * tTickRate * (tSpeed > 0 ? 1 : -1); + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("316", "Pump speed limit reached!")); + } + if (tTickRate == 1) { + GT_Utility.sendChatToPlayer( + aPlayer, + GT_Utility.trans("048", "Pump speed: ") + + tSpeed + + GT_Utility.trans("049", "L/tick ") + + tSpeed * 20 + + GT_Utility.trans("050", "L/sec")); + } else { + GT_Utility.sendChatToPlayer( + aPlayer, + String.format( + GT_Utility.trans("207", "Pump speed: %dL every %d ticks, %.2f L/sec on average"), + tSpeed, + tTickRate, + tSpeed * 20d / tTickRate)); + } + } + + @Override + public FluidRegulatorData onCoverScrewdriverClickImpl( + byte aSide, + int aCoverID, + FluidRegulatorData aCoverVariable, + ICoverable aTileEntity, + EntityPlayer aPlayer, + float aX, + float aY, + float aZ) { + if (GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ)[0] >= 0.5F) { + adjustSpeed(aPlayer, aCoverVariable, aPlayer.isSneaking() ? 256 : 16); + } else { + adjustSpeed(aPlayer, aCoverVariable, aPlayer.isSneaking() ? -256 : -16); + } + return aCoverVariable; + } + + @Override + protected boolean onCoverRightClickImpl( + byte aSide, + int aCoverID, + FluidRegulatorData aCoverVariable, + ICoverable aTileEntity, + EntityPlayer aPlayer, + float aX, + float aY, + float aZ) { + if (GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ)[0] >= 0.5F) { + adjustSpeed(aPlayer, aCoverVariable, 1); + } else { + adjustSpeed(aPlayer, aCoverVariable, -1); + } + return true; + } + + @Override + public boolean letsRedstoneGoInImpl( + byte aSide, int aCoverID, FluidRegulatorData aCoverVariable, ICoverable aTileEntity) { + return true; + } + + @Override + public boolean letsRedstoneGoOutImpl( + byte aSide, int aCoverID, FluidRegulatorData aCoverVariable, ICoverable aTileEntity) { + return true; + } + + @Override + public boolean letsEnergyInImpl( + byte aSide, int aCoverID, FluidRegulatorData aCoverVariable, ICoverable aTileEntity) { + return true; + } + + @Override + public boolean letsEnergyOutImpl( + byte aSide, int aCoverID, FluidRegulatorData aCoverVariable, ICoverable aTileEntity) { + return true; + } + + @Override + public boolean letsItemsInImpl( + byte aSide, int aCoverID, FluidRegulatorData aCoverVariable, int aSlot, ICoverable aTileEntity) { + return true; + } + + @Override + public boolean letsItemsOutImpl( + byte aSide, int aCoverID, FluidRegulatorData aCoverVariable, int aSlot, ICoverable aTileEntity) { + return true; + } + + @Override + public boolean letsFluidInImpl( + byte aSide, int aCoverID, FluidRegulatorData aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { + return allowFluid; + } + + @Override + public boolean letsFluidOutImpl( + byte aSide, int aCoverID, FluidRegulatorData aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { + return allowFluid; + } + + @Override + protected boolean alwaysLookConnectedImpl( + byte aSide, int aCoverID, FluidRegulatorData aCoverVariable, ICoverable aTileEntity) { + return true; + } + + @Override protected int getTickRateImpl(byte aSide, int aCoverID, FluidRegulatorData aCoverVariable, ICoverable aTileEntity) { - return aCoverVariable.tickRate; - } - - /** - * GUI Stuff - */ - - @Override - public boolean hasCoverGUI() { - return true; - } - - @Override - public Object getClientGUIImpl(byte aSide, int aCoverID, FluidRegulatorData coverData, ICoverable aTileEntity, EntityPlayer aPlayer, World aWorld) { - return new GT_Cover_FluidRegulator.GUI(aSide, aCoverID, coverData, aTileEntity); - } - - public enum Conditional { - Always(false) { - @Override - boolean isAllowedToWork(byte aSide, int aCoverID, ICoverable aTileEntity) { - return true; - } - }, - Conditional(true) { - @Override - boolean isAllowedToWork(byte aSide, int aCoverID, ICoverable aTileEntity) { - return !(aTileEntity instanceof IMachineProgress) || ((IMachineProgress) aTileEntity).isAllowedToWork(); - } - }, - Inverted(true) { - @Override - boolean isAllowedToWork(byte aSide, int aCoverID, ICoverable aTileEntity) { - return !(aTileEntity instanceof IMachineProgress) || !((IMachineProgress) aTileEntity).isAllowedToWork(); - } - }; - - static final Conditional[] VALUES = values(); - private final boolean redstoneSensitive; - - Conditional(boolean redstoneSensitive) { - this.redstoneSensitive = redstoneSensitive; - } - - abstract boolean isAllowedToWork(byte aSide, int aCoverID, ICoverable aTileEntity); - boolean isRedstoneSensitive() { - return redstoneSensitive; - } - } - - public static class FluidRegulatorData implements ISerializableObject { - private int tickRate; - private int speed; - private Conditional condition; - - private static int getSpeed(int aCoverVariable) { - // positive or 0 -> interval bits need to be set to zero - // negative -> interval bits need to be set to one - return aCoverVariable >= 0 ? aCoverVariable & ~TICK_RATE_BITMASK : aCoverVariable | TICK_RATE_BITMASK; - } - - private static int getTickRate(int aCoverVariable) { - // range: TICK_RATE_MIN ~ TICK_RATE_MAX - return ((Math.abs(aCoverVariable) & TICK_RATE_BITMASK) >>> SPEED_LENGTH) + TICK_RATE_MIN; - } - - public FluidRegulatorData() { - this(0); - } - public FluidRegulatorData(int legacy) { - this(getTickRate(legacy), getSpeed(legacy), Conditional.Always); - } - - public FluidRegulatorData(int tickRate, int speed, Conditional condition) { - this.tickRate = tickRate; - this.speed = speed; - this.condition = condition; - } - - @Nonnull - @Override - public ISerializableObject copy() { - return new FluidRegulatorData(tickRate, speed, condition); - } - - @Nonnull - @Override - public NBTBase saveDataToNBT() { - NBTTagCompound tag = new NBTTagCompound(); - tag.setInteger("mSpeed", speed); - tag.setInteger("mTickRate", tickRate); - tag.setByte("mCondition", (byte) condition.ordinal()); - return tag; - } - - @Override - public void writeToByteBuf(ByteBuf aBuf) { - aBuf.writeInt(tickRate).writeInt(speed).writeByte(condition.ordinal()); - } - - @Override - public void loadDataFromNBT(NBTBase aNBT) { - if (!(aNBT instanceof NBTTagCompound)) return; // not very good... - NBTTagCompound tag = (NBTTagCompound) aNBT; - speed = tag.getInteger("mSpeed"); - tickRate = tag.getInteger("mTickRate"); - condition = Conditional.VALUES[tag.getByte("mCondition")]; - } - - @Nonnull - @Override - public ISerializableObject readFromPacket(ByteArrayDataInput aBuf, @Nullable EntityPlayerMP aPlayer) { - return new FluidRegulatorData(aBuf.readInt(), aBuf.readInt(), Conditional.VALUES[aBuf.readUnsignedByte()]); - } - - public int getTickRate() { - return tickRate; - } - - public void setTickRate(int tickRate) { - this.tickRate = tickRate; - } - - public int getSpeed() { - return speed; - } - - public void setSpeed(int speed) { - this.speed = speed; - } - - public Conditional getCondition() { - return condition; - } - - public void setCondition(Conditional condition) { - this.condition = condition; - } - } - - private class GUI extends GT_GUICover { - private final byte side; - private final int coverID; - private GT_GuiIntegerTextBox tBox, lBox; - private FluidRegulatorData coverVariable; - - private static final int startX = 10; - private static final int startY = 25; - private static final int spaceX = 18; - private static final int spaceY = 18; - - private boolean warn = false; - - private final int - textColor = this.getTextColorOrDefault("text", 0xFF555555), - textColorValue = this.getTextColorOrDefault("value", 0xFFFF0000); - - public GUI(byte aSide, int aCoverID, FluidRegulatorData aCoverVariable, ICoverable aTileEntity) { - super(aTileEntity, 176, 107, GT_Utility.intToStack(aCoverID)); - this.side = aSide; - this.coverID = aCoverID; - this.coverVariable = aCoverVariable; - - new GT_GuiIconButton(this, 0, startX + spaceX * 0, startY + spaceY * 0, GT_GuiIcon.EXPORT).setTooltipText(GT_Utility.trans("006", "Export")); - new GT_GuiIconButton(this, 1, startX + spaceX * 1, startY + spaceY * 0, GT_GuiIcon.IMPORT).setTooltipText(GT_Utility.trans("007", "Import")); - new GT_GuiIconButton(this, 2, startX + spaceX * 0, startY + spaceY * 1, GT_GuiIcon.CHECKMARK).setTooltipText(GT_Utility.trans("224", "Always On")); - new GT_GuiIconButton(this, 3, startX + spaceX * 1, startY + spaceY * 1, GT_GuiIcon.REDSTONE_ON).setTooltipText(GT_Utility.trans("225", "Active with Redstone Signal")); - new GT_GuiIconButton(this, 4, startX + spaceX * 2, startY + spaceY * 1, GT_GuiIcon.REDSTONE_OFF).setTooltipText(GT_Utility.trans("226", "Inactive with Redstone Signal")); - - tBox = new GT_GuiIntegerTextBox(this, 2, startX + spaceX * 0, startY + spaceY * 2 + 2, spaceX * 4 - 3, 12) { + return aCoverVariable.tickRate; + } + + /** + * GUI Stuff + */ + @Override + public boolean hasCoverGUI() { + return true; + } + + @Override + public Object getClientGUIImpl( + byte aSide, + int aCoverID, + FluidRegulatorData coverData, + ICoverable aTileEntity, + EntityPlayer aPlayer, + World aWorld) { + return new GT_Cover_FluidRegulator.GUI(aSide, aCoverID, coverData, aTileEntity); + } + + public enum Conditional { + Always(false) { + @Override + boolean isAllowedToWork(byte aSide, int aCoverID, ICoverable aTileEntity) { + return true; + } + }, + Conditional(true) { + @Override + boolean isAllowedToWork(byte aSide, int aCoverID, ICoverable aTileEntity) { + return !(aTileEntity instanceof IMachineProgress) || ((IMachineProgress) aTileEntity).isAllowedToWork(); + } + }, + Inverted(true) { + @Override + boolean isAllowedToWork(byte aSide, int aCoverID, ICoverable aTileEntity) { + return !(aTileEntity instanceof IMachineProgress) + || !((IMachineProgress) aTileEntity).isAllowedToWork(); + } + }; + + static final Conditional[] VALUES = values(); + private final boolean redstoneSensitive; + + Conditional(boolean redstoneSensitive) { + this.redstoneSensitive = redstoneSensitive; + } + + abstract boolean isAllowedToWork(byte aSide, int aCoverID, ICoverable aTileEntity); + + boolean isRedstoneSensitive() { + return redstoneSensitive; + } + } + + public static class FluidRegulatorData implements ISerializableObject { + private int tickRate; + private int speed; + private Conditional condition; + + private static int getSpeed(int aCoverVariable) { + // positive or 0 -> interval bits need to be set to zero + // negative -> interval bits need to be set to one + return aCoverVariable >= 0 ? aCoverVariable & ~TICK_RATE_BITMASK : aCoverVariable | TICK_RATE_BITMASK; + } + + private static int getTickRate(int aCoverVariable) { + // range: TICK_RATE_MIN ~ TICK_RATE_MAX + return ((Math.abs(aCoverVariable) & TICK_RATE_BITMASK) >>> SPEED_LENGTH) + TICK_RATE_MIN; + } + + public FluidRegulatorData() { + this(0); + } + + public FluidRegulatorData(int legacy) { + this(getTickRate(legacy), getSpeed(legacy), Conditional.Always); + } + + public FluidRegulatorData(int tickRate, int speed, Conditional condition) { + this.tickRate = tickRate; + this.speed = speed; + this.condition = condition; + } + + @Nonnull + @Override + public ISerializableObject copy() { + return new FluidRegulatorData(tickRate, speed, condition); + } + + @Nonnull + @Override + public NBTBase saveDataToNBT() { + NBTTagCompound tag = new NBTTagCompound(); + tag.setInteger("mSpeed", speed); + tag.setInteger("mTickRate", tickRate); + tag.setByte("mCondition", (byte) condition.ordinal()); + return tag; + } + + @Override + public void writeToByteBuf(ByteBuf aBuf) { + aBuf.writeInt(tickRate).writeInt(speed).writeByte(condition.ordinal()); + } + + @Override + public void loadDataFromNBT(NBTBase aNBT) { + if (!(aNBT instanceof NBTTagCompound)) return; // not very good... + NBTTagCompound tag = (NBTTagCompound) aNBT; + speed = tag.getInteger("mSpeed"); + tickRate = tag.getInteger("mTickRate"); + condition = Conditional.VALUES[tag.getByte("mCondition")]; + } + + @Nonnull + @Override + public ISerializableObject readFromPacket(ByteArrayDataInput aBuf, @Nullable EntityPlayerMP aPlayer) { + return new FluidRegulatorData(aBuf.readInt(), aBuf.readInt(), Conditional.VALUES[aBuf.readUnsignedByte()]); + } + + public int getTickRate() { + return tickRate; + } + + public void setTickRate(int tickRate) { + this.tickRate = tickRate; + } + + public int getSpeed() { + return speed; + } + + public void setSpeed(int speed) { + this.speed = speed; + } + + public Conditional getCondition() { + return condition; + } + + public void setCondition(Conditional condition) { + this.condition = condition; + } + } + + private class GUI extends GT_GUICover { + private final byte side; + private final int coverID; + private GT_GuiIntegerTextBox tBox, lBox; + private FluidRegulatorData coverVariable; + + private static final int startX = 10; + private static final int startY = 25; + private static final int spaceX = 18; + private static final int spaceY = 18; + + private boolean warn = false; + + private final int textColor = this.getTextColorOrDefault("text", 0xFF555555), + textColorValue = this.getTextColorOrDefault("value", 0xFFFF0000); + + public GUI(byte aSide, int aCoverID, FluidRegulatorData aCoverVariable, ICoverable aTileEntity) { + super(aTileEntity, 176, 107, GT_Utility.intToStack(aCoverID)); + this.side = aSide; + this.coverID = aCoverID; + this.coverVariable = aCoverVariable; + + new GT_GuiIconButton(this, 0, startX + spaceX * 0, startY + spaceY * 0, GT_GuiIcon.EXPORT) + .setTooltipText(GT_Utility.trans("006", "Export")); + new GT_GuiIconButton(this, 1, startX + spaceX * 1, startY + spaceY * 0, GT_GuiIcon.IMPORT) + .setTooltipText(GT_Utility.trans("007", "Import")); + new GT_GuiIconButton(this, 2, startX + spaceX * 0, startY + spaceY * 1, GT_GuiIcon.CHECKMARK) + .setTooltipText(GT_Utility.trans("224", "Always On")); + new GT_GuiIconButton(this, 3, startX + spaceX * 1, startY + spaceY * 1, GT_GuiIcon.REDSTONE_ON) + .setTooltipText(GT_Utility.trans("225", "Active with Redstone Signal")); + new GT_GuiIconButton(this, 4, startX + spaceX * 2, startY + spaceY * 1, GT_GuiIcon.REDSTONE_OFF) + .setTooltipText(GT_Utility.trans("226", "Inactive with Redstone Signal")); + + tBox = new GT_GuiIntegerTextBox(this, 2, startX + spaceX * 0, startY + spaceY * 2 + 2, spaceX * 4 - 3, 12) { @Override public boolean validChar(char c, int key) { return super.validChar(c, key) || c == '-'; } }; - tBox.setText(String.valueOf(this.coverVariable.speed)); - tBox.setMaxStringLength(10); + tBox.setText(String.valueOf(this.coverVariable.speed)); + tBox.setMaxStringLength(10); - lBox = new GT_GuiIntegerTextBox(this, 3, startX + spaceX * 5, startY + spaceY * 2 + 2, spaceX * 2 - 3, 12) { + lBox = new GT_GuiIntegerTextBox(this, 3, startX + spaceX * 5, startY + spaceY * 2 + 2, spaceX * 2 - 3, 12) { @Override public boolean validChar(char c, int key) { return super.validChar(c, key) || c == '-'; } }; - lBox.setText(String.valueOf(this.coverVariable.tickRate)); - lBox.setMaxStringLength(4); - } - - @Override - public void drawExtras(int mouseX, int mouseY, float parTicks) { - super.drawExtras(mouseX, mouseY, parTicks); - this.getFontRenderer().drawString(GT_Utility.trans("229", "Import/Export"), startX + spaceX * 4, 4 + startY + spaceY * 0, textColor); - this.getFontRenderer().drawString(GT_Utility.trans("229", "Conditional"), startX + spaceX * 4, 4 + startY + spaceY * 1, textColor); - this.getFontRenderer().drawString(GT_Utility.trans("208", " L"), startX + spaceX * 4, 4 + startY + spaceY * 2, textColor); - this.getFontRenderer().drawString(GT_Utility.trans("209", " ticks"), startX + spaceX * 7, 4 + startY + spaceY * 2, textColor); - this.getFontRenderer().drawString(String.format(GT_Utility.trans("210", "Average: %.2f L/sec"), coverVariable.tickRate == 0 ? 0 : coverVariable.speed * 20d / coverVariable.tickRate), startX + spaceX * 0, 4 + startY + spaceY * 3, warn ? textColorValue : textColor); - } - - @Override - protected void onInitGui(int guiLeft, int guiTop, int gui_width, int gui_height) { - updateButtons(); - tBox.setFocused(true); - } - - @Override - public void buttonClicked(GuiButton btn){ - if (!btn.enabled) - return; - switch (btn.id) { - case 0: - case 1: - coverVariable.speed *= -1; - for (GT_GuiIntegerTextBox box : textBoxes){ + lBox.setText(String.valueOf(this.coverVariable.tickRate)); + lBox.setMaxStringLength(4); + } + + @Override + public void drawExtras(int mouseX, int mouseY, float parTicks) { + super.drawExtras(mouseX, mouseY, parTicks); + this.getFontRenderer() + .drawString( + GT_Utility.trans("229", "Import/Export"), + startX + spaceX * 4, + 4 + startY + spaceY * 0, + textColor); + this.getFontRenderer() + .drawString( + GT_Utility.trans("229", "Conditional"), + startX + spaceX * 4, + 4 + startY + spaceY * 1, + textColor); + this.getFontRenderer() + .drawString(GT_Utility.trans("208", " L"), startX + spaceX * 4, 4 + startY + spaceY * 2, textColor); + this.getFontRenderer() + .drawString( + GT_Utility.trans("209", " ticks"), startX + spaceX * 7, 4 + startY + spaceY * 2, textColor); + this.getFontRenderer() + .drawString( + String.format( + GT_Utility.trans("210", "Average: %.2f L/sec"), + coverVariable.tickRate == 0 + ? 0 + : coverVariable.speed * 20d / coverVariable.tickRate), + startX + spaceX * 0, + 4 + startY + spaceY * 3, + warn ? textColorValue : textColor); + } + + @Override + protected void onInitGui(int guiLeft, int guiTop, int gui_width, int gui_height) { + updateButtons(); + tBox.setFocused(true); + } + + @Override + public void buttonClicked(GuiButton btn) { + if (!btn.enabled) return; + switch (btn.id) { + case 0: + case 1: + coverVariable.speed *= -1; + for (GT_GuiIntegerTextBox box : textBoxes) { if (box.id == 2) { box.setText(String.valueOf(coverVariable.speed)); } } - break; - case 2: - case 3: - case 4: - coverVariable.condition = Conditional.VALUES[btn.id - 2]; - break; - default: - // not right, but we carry on - return; - } - GT_Values.NW.sendToServer(new GT_Packet_TileEntityCoverNew(side, coverID, coverVariable, tile)); - updateButtons(); - } - - @Override - public void onMouseWheel(int x, int y, int delta) { - for (GT_GuiIntegerTextBox box : textBoxes){ - if (box.isFocused()) { - int step = Math.max(1, Math.abs(delta / 120)); - step = (isShiftKeyDown() ? 50 : isCtrlKeyDown() ? 5 : 1) * (delta > 0 ? step : -step); - long i; - try { - i = Long.parseLong(box.getText()); - } catch (NumberFormatException e) { - return; - } - if (i > (Long.MAX_VALUE-1000)) - break; - - i = i + step; - if (i <= 0) - i = 0; - box.setText(String.valueOf(i)); - break; - } - } - } - - @Override - public void applyTextBox(GT_GuiIntegerTextBox box) { - long i; - String s = box.getText().trim(); - try { - i = Long.parseLong(s); - } catch (NumberFormatException e) { - resetTextBox(box); - return; - } - - warn = false; - if (box.id == 2) { - long maxFlow = (long) mTransferRate * GT_Utility.clamp(coverVariable.tickRate, TICK_RATE_MIN, TICK_RATE_MAX); - if (i > maxFlow) { - i = maxFlow; - warn = true; - } else if (i < -maxFlow) { + break; + case 2: + case 3: + case 4: + coverVariable.condition = Conditional.VALUES[btn.id - 2]; + break; + default: + // not right, but we carry on + return; + } + GT_Values.NW.sendToServer(new GT_Packet_TileEntityCoverNew(side, coverID, coverVariable, tile)); + updateButtons(); + } + + @Override + public void onMouseWheel(int x, int y, int delta) { + for (GT_GuiIntegerTextBox box : textBoxes) { + if (box.isFocused()) { + int step = Math.max(1, Math.abs(delta / 120)); + step = (isShiftKeyDown() ? 50 : isCtrlKeyDown() ? 5 : 1) * (delta > 0 ? step : -step); + long i; + try { + i = Long.parseLong(box.getText()); + } catch (NumberFormatException e) { + return; + } + if (i > (Long.MAX_VALUE - 1000)) break; + + i = i + step; + if (i <= 0) i = 0; + box.setText(String.valueOf(i)); + break; + } + } + } + + @Override + public void applyTextBox(GT_GuiIntegerTextBox box) { + long i; + String s = box.getText().trim(); + try { + i = Long.parseLong(s); + } catch (NumberFormatException e) { + resetTextBox(box); + return; + } + + warn = false; + if (box.id == 2) { + long maxFlow = + (long) mTransferRate * GT_Utility.clamp(coverVariable.tickRate, TICK_RATE_MIN, TICK_RATE_MAX); + if (i > maxFlow) { + i = maxFlow; + warn = true; + } else if (i < -maxFlow) { i = -maxFlow; warn = true; } - if (!warn && coverVariable.speed == i) return; - coverVariable.speed = (int) i; - } else if (box.id == 3) { - if (i > TICK_RATE_MAX) { - i = TICK_RATE_MAX; + if (!warn && coverVariable.speed == i) return; + coverVariable.speed = (int) i; + } else if (box.id == 3) { + if (i > TICK_RATE_MAX) { + i = TICK_RATE_MAX; + warn = true; + } else if (Math.abs(coverVariable.speed) > mTransferRate * i) { + i = Math.min(TICK_RATE_MAX, (Math.abs(coverVariable.speed) + mTransferRate - 1) / mTransferRate); warn = true; - } else if (Math.abs(coverVariable.speed) > mTransferRate * i) { - i = Math.min(TICK_RATE_MAX, (Math.abs(coverVariable.speed) + mTransferRate - 1) / mTransferRate); - warn = true; - } else if (i < TICK_RATE_MIN) { - i = 1; - } - if (!warn && coverVariable.tickRate == i) return; - coverVariable.tickRate = (int) i; - } - box.setText(String.valueOf(i)); - updateButtons(); - - GT_Values.NW.sendToServer(new GT_Packet_TileEntityCoverNew(side, coverID, coverVariable, tile)); - } - - @Override - public void resetTextBox(GT_GuiIntegerTextBox box) { - if (box.id == 2) - box.setText(String.valueOf(coverVariable.speed)); - else if (box.id == 3) - box.setText(String.valueOf(coverVariable.tickRate)); - } - - private void updateButtons(){ - GuiButton b; - for (Object o : buttonList) { - b = (GuiButton) o; - b.enabled = getClickable(b.id); - } - } - - private boolean getClickable(int id) { - switch (id) { - case 0: - return coverVariable.speed < 0; - case 1: - return coverVariable.speed > 0; - case 2: - case 3: - case 4: - return coverVariable.condition != Conditional.VALUES[id - 2]; - } - return false; - } - } + } else if (i < TICK_RATE_MIN) { + i = 1; + } + if (!warn && coverVariable.tickRate == i) return; + coverVariable.tickRate = (int) i; + } + box.setText(String.valueOf(i)); + updateButtons(); + + GT_Values.NW.sendToServer(new GT_Packet_TileEntityCoverNew(side, coverID, coverVariable, tile)); + } + + @Override + public void resetTextBox(GT_GuiIntegerTextBox box) { + if (box.id == 2) box.setText(String.valueOf(coverVariable.speed)); + else if (box.id == 3) box.setText(String.valueOf(coverVariable.tickRate)); + } + + private void updateButtons() { + GuiButton b; + for (Object o : buttonList) { + b = (GuiButton) o; + b.enabled = getClickable(b.id); + } + } + + private boolean getClickable(int id) { + switch (id) { + case 0: + return coverVariable.speed < 0; + case 1: + return coverVariable.speed > 0; + case 2: + case 3: + case 4: + return coverVariable.condition != Conditional.VALUES[id - 2]; + } + return false; + } + } } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_FluidStorageMonitor.java b/src/main/java/gregtech/common/covers/GT_Cover_FluidStorageMonitor.java index b9486398a3..a90d2f2213 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_FluidStorageMonitor.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_FluidStorageMonitor.java @@ -1,5 +1,21 @@ package gregtech.common.covers; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FLUID_STORAGE_MONITOR0; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FLUID_STORAGE_MONITOR1; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FLUID_STORAGE_MONITOR10; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FLUID_STORAGE_MONITOR11; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FLUID_STORAGE_MONITOR12; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FLUID_STORAGE_MONITOR13; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FLUID_STORAGE_MONITOR14; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FLUID_STORAGE_MONITOR2; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FLUID_STORAGE_MONITOR3; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FLUID_STORAGE_MONITOR4; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FLUID_STORAGE_MONITOR5; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FLUID_STORAGE_MONITOR6; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FLUID_STORAGE_MONITOR7; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FLUID_STORAGE_MONITOR8; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FLUID_STORAGE_MONITOR9; + import com.google.common.io.ByteArrayDataInput; import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.ITexture; @@ -9,6 +25,9 @@ import gregtech.api.util.GT_CoverBehaviorBase; import gregtech.api.util.GT_Utility; import gregtech.api.util.ISerializableObject; import io.netty.buffer.ByteBuf; +import java.util.Optional; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; @@ -25,28 +44,8 @@ import net.minecraftforge.fluids.FluidTankInfo; import net.minecraftforge.fluids.IFluidContainerItem; import net.minecraftforge.fluids.IFluidHandler; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import java.util.Optional; - -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FLUID_STORAGE_MONITOR0; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FLUID_STORAGE_MONITOR1; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FLUID_STORAGE_MONITOR10; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FLUID_STORAGE_MONITOR11; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FLUID_STORAGE_MONITOR12; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FLUID_STORAGE_MONITOR13; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FLUID_STORAGE_MONITOR14; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FLUID_STORAGE_MONITOR2; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FLUID_STORAGE_MONITOR3; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FLUID_STORAGE_MONITOR4; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FLUID_STORAGE_MONITOR5; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FLUID_STORAGE_MONITOR6; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FLUID_STORAGE_MONITOR7; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FLUID_STORAGE_MONITOR8; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FLUID_STORAGE_MONITOR9; - public class GT_Cover_FluidStorageMonitor extends GT_CoverBehaviorBase<GT_Cover_FluidStorageMonitor.FluidStorageData> { - private static final IIconContainer[] icons = new IIconContainer[]{ + private static final IIconContainer[] icons = new IIconContainer[] { OVERLAY_FLUID_STORAGE_MONITOR0, OVERLAY_FLUID_STORAGE_MONITOR1, OVERLAY_FLUID_STORAGE_MONITOR2, @@ -79,7 +78,13 @@ public class GT_Cover_FluidStorageMonitor extends GT_CoverBehaviorBase<GT_Cover_ } @Override - protected FluidStorageData doCoverThingsImpl(byte aSide, byte aInputRedstone, int aCoverID, FluidStorageData aCoverVariable, ICoverable aTileEntity, long aTimer) { + protected FluidStorageData doCoverThingsImpl( + byte aSide, + byte aInputRedstone, + int aCoverID, + FluidStorageData aCoverVariable, + ICoverable aTileEntity, + long aTimer) { final FluidTankInfo[] tanks = getValidFluidTankInfos(aTileEntity, aCoverVariable.side); if (tanks == null) { return aCoverVariable.disable().issueCoverUpdateIfNeeded(aTileEntity, aSide); @@ -96,40 +101,49 @@ public class GT_Cover_FluidStorageMonitor extends GT_CoverBehaviorBase<GT_Cover_ } return aCoverVariable - .setFluid(tank.fluid) - .setScale(getTankScale(tank)) - .issueCoverUpdateIfNeeded(aTileEntity, aSide); + .setFluid(tank.fluid) + .setScale(getTankScale(tank)) + .issueCoverUpdateIfNeeded(aTileEntity, aSide); } - @Override - protected ITexture getSpecialCoverTextureImpl(byte aSide, int aCoverID, FluidStorageData aCoverVariable, ICoverable aTileEntity) { + protected ITexture getSpecialCoverTextureImpl( + byte aSide, int aCoverID, FluidStorageData aCoverVariable, ICoverable aTileEntity) { if (aCoverVariable.slot == -1 || aCoverVariable.fluid == null || aCoverVariable.scale == 0) { return TextureFactory.of(OVERLAY_FLUID_STORAGE_MONITOR0); } return TextureFactory.of( - TextureFactory.of(new IIconContainer() { - @Override - public IIcon getIcon() { - return aCoverVariable.fluid.getStillIcon(); - } - - @Override - public IIcon getOverlayIcon() { - return null; - } - - @Override - public ResourceLocation getTextureFile() { - return TextureMap.locationBlocksTexture; - } - }, colorToRGBA(aCoverVariable.fluid.getColor())), - TextureFactory.of(icons[aCoverVariable.scale]) - ); + TextureFactory.of( + new IIconContainer() { + @Override + public IIcon getIcon() { + return aCoverVariable.fluid.getStillIcon(); + } + + @Override + public IIcon getOverlayIcon() { + return null; + } + + @Override + public ResourceLocation getTextureFile() { + return TextureMap.locationBlocksTexture; + } + }, + colorToRGBA(aCoverVariable.fluid.getColor())), + TextureFactory.of(icons[aCoverVariable.scale])); } @Override - protected boolean onCoverRightClickImpl(byte aSide, int aCoverID, FluidStorageData aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { + protected boolean onCoverRightClickImpl( + byte aSide, + int aCoverID, + FluidStorageData aCoverVariable, + ICoverable aTileEntity, + EntityPlayer aPlayer, + float aX, + float aY, + float aZ) { if (aPlayer == null || aPlayer.worldObj == null || aPlayer.worldObj.isRemote) { return false; } @@ -169,8 +183,8 @@ public class GT_Cover_FluidStorageMonitor extends GT_CoverBehaviorBase<GT_Cover_ return false; } - - protected static ItemStack fillToTank(@Nonnull ItemStack container, @Nonnull IFluidHandler tank, ForgeDirection side) { + protected static ItemStack fillToTank( + @Nonnull ItemStack container, @Nonnull IFluidHandler tank, ForgeDirection side) { final FluidStack fluidToFill = GT_Utility.getFluidForFilledItem(container, true); if (fluidToFill == null || fluidToFill.getFluid() == null || fluidToFill.amount <= 0) { return null; @@ -197,7 +211,11 @@ public class GT_Cover_FluidStorageMonitor extends GT_CoverBehaviorBase<GT_Cover_ } } - protected static ItemStack fillToContainer(@Nonnull ItemStack container, @Nonnull FluidTankInfo tankInfo, @Nonnull IFluidHandler tank, ForgeDirection side) { + protected static ItemStack fillToContainer( + @Nonnull ItemStack container, + @Nonnull FluidTankInfo tankInfo, + @Nonnull IFluidHandler tank, + ForgeDirection side) { if (tankInfo.fluid == null || tankInfo.fluid.getFluid() == null || tankInfo.fluid.amount <= 0) { return null; } @@ -208,9 +226,17 @@ public class GT_Cover_FluidStorageMonitor extends GT_CoverBehaviorBase<GT_Cover_ if (container.getItem() instanceof IFluidContainerItem) { final IFluidContainerItem containerItem = (IFluidContainerItem) container.getItem(); final int filled = Math.min( - Optional.ofNullable(tank.drain(side, new FluidStack(tankInfo.fluid.getFluid(), containerItem.getCapacity(container)), false)).filter(fs -> GT_Utility.areFluidsEqual(fs, tankInfo.fluid)).map(fs -> fs.amount).orElse(0), - containerItem.fill(container, new FluidStack(tankInfo.fluid.getFluid(), containerItem.getCapacity(container)), false) - ); + Optional.ofNullable(tank.drain( + side, + new FluidStack(tankInfo.fluid.getFluid(), containerItem.getCapacity(container)), + false)) + .filter(fs -> GT_Utility.areFluidsEqual(fs, tankInfo.fluid)) + .map(fs -> fs.amount) + .orElse(0), + containerItem.fill( + container, + new FluidStack(tankInfo.fluid.getFluid(), containerItem.getCapacity(container)), + false)); if (filled == 0) { return null; } @@ -226,7 +252,11 @@ public class GT_Cover_FluidStorageMonitor extends GT_CoverBehaviorBase<GT_Cover_ if (filledFluid == null || filledFluid.getFluid() == null || filledFluid.amount <= 0) { return null; } - if (Optional.ofNullable(tank.drain(side, filledFluid, false)).filter(fs -> GT_Utility.areFluidsEqual(fs, filledFluid)).map(fs -> fs.amount).orElse(0) != filledFluid.amount) { + if (Optional.ofNullable(tank.drain(side, filledFluid, false)) + .filter(fs -> GT_Utility.areFluidsEqual(fs, filledFluid)) + .map(fs -> fs.amount) + .orElse(0) + != filledFluid.amount) { return null; } tank.drain(side, filledFluid, true); @@ -234,19 +264,29 @@ public class GT_Cover_FluidStorageMonitor extends GT_CoverBehaviorBase<GT_Cover_ } } - protected static void replaceHeldItemStack(@Nonnull EntityPlayer player, @Nonnull ItemStack heldItem, @Nonnull ItemStack result) { + protected static void replaceHeldItemStack( + @Nonnull EntityPlayer player, @Nonnull ItemStack heldItem, @Nonnull ItemStack result) { heldItem.stackSize--; GT_Utility.addItemToPlayerInventory(player, result); player.inventoryContainer.detectAndSendChanges(); } - @Override - protected FluidStorageData onCoverScrewdriverClickImpl(byte aSide, int aCoverID, FluidStorageData aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { + protected FluidStorageData onCoverScrewdriverClickImpl( + byte aSide, + int aCoverID, + FluidStorageData aCoverVariable, + ICoverable aTileEntity, + EntityPlayer aPlayer, + float aX, + float aY, + float aZ) { if (aPlayer.isSneaking()) { aCoverVariable - .setSide(ForgeDirection.values()[(aCoverVariable.side.ordinal() + 1) % ForgeDirection.values().length]) - .setSlot(0); + .setSide( + ForgeDirection.values()[ + (aCoverVariable.side.ordinal() + 1) % ForgeDirection.values().length]) + .setSlot(0); GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("SIDE", "Side: ") + aCoverVariable.side.name()); return aCoverVariable; } @@ -258,24 +298,28 @@ public class GT_Cover_FluidStorageMonitor extends GT_CoverBehaviorBase<GT_Cover_ if (aCoverVariable.slot < 0 || tanks.length <= aCoverVariable.slot) { aCoverVariable.setSlot(0); } else { - aCoverVariable.setSlot((aCoverVariable.slot + tanks.length + (aPlayer.isSneaking() ? -1 : 1)) % tanks.length); + aCoverVariable.setSlot( + (aCoverVariable.slot + tanks.length + (aPlayer.isSneaking() ? -1 : 1)) % tanks.length); } GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("053", "Slot: ") + aCoverVariable.slot); return aCoverVariable; } @Override - protected boolean isDataNeededOnClientImpl(byte aSide, int aCoverID, FluidStorageData aCoverVariable, ICoverable aTileEntity) { + protected boolean isDataNeededOnClientImpl( + byte aSide, int aCoverID, FluidStorageData aCoverVariable, ICoverable aTileEntity) { return true; } @Override - protected boolean letsFluidInImpl(byte aSide, int aCoverID, FluidStorageData aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { + protected boolean letsFluidInImpl( + byte aSide, int aCoverID, FluidStorageData aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { return true; } @Override - protected boolean letsFluidOutImpl(byte aSide, int aCoverID, FluidStorageData aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { + protected boolean letsFluidOutImpl( + byte aSide, int aCoverID, FluidStorageData aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { return true; } @@ -284,7 +328,8 @@ public class GT_Cover_FluidStorageMonitor extends GT_CoverBehaviorBase<GT_Cover_ return 10; } - protected static FluidTankInfo[] getValidFluidTankInfos(@Nullable ICoverable tileEntity, @Nonnull ForgeDirection side) { + protected static FluidTankInfo[] getValidFluidTankInfos( + @Nullable ICoverable tileEntity, @Nonnull ForgeDirection side) { if (tileEntity instanceof IFluidHandler) { final FluidTankInfo[] tanks = ((IFluidHandler) tileEntity).getTankInfo(side); if (tanks != null && 0 < tanks.length) { @@ -302,11 +347,8 @@ public class GT_Cover_FluidStorageMonitor extends GT_CoverBehaviorBase<GT_Cover_ } protected short[] colorToRGBA(int color) { - return new short[]{ - (short) (color >> 16 & 0xFF), - (short) (color >> 8 & 0xFF), - (short) (color & 0xFF), - (short) (0xFF) + return new short[] { + (short) (color >> 16 & 0xFF), (short) (color >> 8 & 0xFF), (short) (color & 0xFF), (short) (0xFF) }; } @@ -389,7 +431,7 @@ public class GT_Cover_FluidStorageMonitor extends GT_CoverBehaviorBase<GT_Cover_ return this; } - //region ISerializableObject + // region ISerializableObject @Nonnull @Override public ISerializableObject copy() { @@ -437,7 +479,7 @@ public class GT_Cover_FluidStorageMonitor extends GT_CoverBehaviorBase<GT_Cover_ aBuf.writeInt(scale); aBuf.writeBoolean(dirty); } - //endregion + // endregion } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Fluidfilter.java b/src/main/java/gregtech/common/covers/GT_Cover_Fluidfilter.java index c90a0fb07e..1da703cbb7 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Fluidfilter.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Fluidfilter.java @@ -1,5 +1,7 @@ package gregtech.common.covers; +import static gregtech.api.enums.GT_Values.E; + import com.google.common.io.ByteArrayDataInput; import gregtech.api.enums.GT_Values; import gregtech.api.gui.GT_GUICover; @@ -12,6 +14,7 @@ import gregtech.api.util.GT_CoverBehaviorBase; import gregtech.api.util.GT_Utility; import gregtech.api.util.ISerializableObject; import io.netty.buffer.ByteBuf; +import javax.annotation.Nonnull; import net.minecraft.client.gui.GuiButton; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; @@ -24,21 +27,17 @@ import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; -import javax.annotation.Nonnull; - -import static gregtech.api.enums.GT_Values.E; - public class GT_Cover_Fluidfilter extends GT_CoverBehaviorBase<GT_Cover_Fluidfilter.FluidFilterData> { // Uses the lower 3 bits of the cover variable, so we have 8 options to work with (0-7) private final int FILTER_INPUT_DENY_OUTPUT = 0; // 000 private final int INVERT_INPUT_DENY_OUTPUT = 1; // 001 - private final int FILTER_INPUT_ANY_OUTPUT = 2; // 010 - private final int INVERT_INPUT_ANY_OUTPUT = 3; // 011 + private final int FILTER_INPUT_ANY_OUTPUT = 2; // 010 + private final int INVERT_INPUT_ANY_OUTPUT = 3; // 011 private final int DENY_INPUT_FILTER_OUTPUT = 4; // 100 private final int DENY_INPUT_INVERT_OUTPUT = 5; // 101 - private final int ANY_INPUT_FILTER_OUTPUT = 6; // 110 - private final int ANY_INPUT_INVERT_OUTPUT = 7; // 111 + private final int ANY_INPUT_FILTER_OUTPUT = 6; // 110 + private final int ANY_INPUT_INVERT_OUTPUT = 7; // 111 public GT_Cover_Fluidfilter() { super(FluidFilterData.class); @@ -55,21 +54,30 @@ public class GT_Cover_Fluidfilter extends GT_CoverBehaviorBase<GT_Cover_Fluidfil } @Override - protected String getDescriptionImpl(byte aSide, int aCoverID, FluidFilterData aCoverVariable, ICoverable aTileEntity) { + protected String getDescriptionImpl( + byte aSide, int aCoverID, FluidFilterData aCoverVariable, ICoverable aTileEntity) { final Fluid fluid = FluidRegistry.getFluid(aCoverVariable.mFluidID); if (fluid == null) return E; final FluidStack sFluid = new FluidStack(fluid, 1000); - return (String.format("Filtering Fluid: %s - %s", sFluid.getLocalizedName(), getFilterMode(aCoverVariable.mFilterMode))); + return (String.format( + "Filtering Fluid: %s - %s", sFluid.getLocalizedName(), getFilterMode(aCoverVariable.mFilterMode))); } @Override - protected boolean isRedstoneSensitiveImpl(byte aSide, int aCoverID, FluidFilterData aCoverVariable, ICoverable aTileEntity, long aTimer) { + protected boolean isRedstoneSensitiveImpl( + byte aSide, int aCoverID, FluidFilterData aCoverVariable, ICoverable aTileEntity, long aTimer) { return false; } @Override - protected FluidFilterData doCoverThingsImpl(byte aSide, byte aInputRedstone, int aCoverID, FluidFilterData aCoverVariable, ICoverable aTileEntity, long aTimer) { + protected FluidFilterData doCoverThingsImpl( + byte aSide, + byte aInputRedstone, + int aCoverID, + FluidFilterData aCoverVariable, + ICoverable aTileEntity, + long aTimer) { return aCoverVariable; } @@ -94,11 +102,18 @@ public class GT_Cover_Fluidfilter extends GT_CoverBehaviorBase<GT_Cover_Fluidfil default: return ("UNKNOWN"); } - } @Override - protected FluidFilterData onCoverScrewdriverClickImpl(byte aSide, int aCoverID, FluidFilterData aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { + protected FluidFilterData onCoverScrewdriverClickImpl( + byte aSide, + int aCoverID, + FluidFilterData aCoverVariable, + ICoverable aTileEntity, + EntityPlayer aPlayer, + float aX, + float aY, + float aZ) { aCoverVariable.mFilterMode = (aCoverVariable.mFilterMode + (aPlayer.isSneaking() ? -1 : 1)) % 8; if (aCoverVariable.mFilterMode < 0) { aCoverVariable.mFilterMode = 7; @@ -110,14 +125,20 @@ public class GT_Cover_Fluidfilter extends GT_CoverBehaviorBase<GT_Cover_Fluidfil } @Override - protected boolean onCoverRightClickImpl(byte aSide, int aCoverID, FluidFilterData aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { - if ( - ((aX > 0.375D) && (aX < 0.625D)) || - ((aSide > 3) && ((aY > 0.375D) && (aY < 0.625D))) || - ((aSide < 2) && ((aZ > 0.375D) && (aZ < 0.625D))) || - (aSide == 2) || - (aSide == 3) - ) { + protected boolean onCoverRightClickImpl( + byte aSide, + int aCoverID, + FluidFilterData aCoverVariable, + ICoverable aTileEntity, + EntityPlayer aPlayer, + float aX, + float aY, + float aZ) { + if (((aX > 0.375D) && (aX < 0.625D)) + || ((aSide > 3) && ((aY > 0.375D) && (aY < 0.625D))) + || ((aSide < 2) && ((aZ > 0.375D) && (aZ < 0.625D))) + || (aSide == 2) + || (aSide == 3)) { ItemStack tStack = aPlayer.inventory.getCurrentItem(); if (tStack == null) return true; @@ -127,7 +148,8 @@ public class GT_Cover_Fluidfilter extends GT_CoverBehaviorBase<GT_Cover_Fluidfil aCoverVariable.mFluidID = aFluid; aTileEntity.setCoverDataAtSide(aSide, aCoverVariable); FluidStack sFluid = new FluidStack(FluidRegistry.getFluid(aFluid), 1000); - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("047", "Filter Fluid: ") + sFluid.getLocalizedName()); + GT_Utility.sendChatToPlayer( + aPlayer, GT_Utility.trans("047", "Filter Fluid: ") + sFluid.getLocalizedName()); } return true; } @@ -135,41 +157,38 @@ public class GT_Cover_Fluidfilter extends GT_CoverBehaviorBase<GT_Cover_Fluidfil } @Override - protected boolean letsFluidInImpl(byte aSide, int aCoverID, FluidFilterData aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { + protected boolean letsFluidInImpl( + byte aSide, int aCoverID, FluidFilterData aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { if (aFluid == null) return true; int aFilterMode = aCoverVariable.mFilterMode; int aFilterFluid = aCoverVariable.mFluidID; - if (aFilterMode == DENY_INPUT_FILTER_OUTPUT || aFilterMode == DENY_INPUT_INVERT_OUTPUT) - return false; - else if (aFilterMode == ANY_INPUT_FILTER_OUTPUT || aFilterMode == ANY_INPUT_INVERT_OUTPUT) - return true; + if (aFilterMode == DENY_INPUT_FILTER_OUTPUT || aFilterMode == DENY_INPUT_INVERT_OUTPUT) return false; + else if (aFilterMode == ANY_INPUT_FILTER_OUTPUT || aFilterMode == ANY_INPUT_INVERT_OUTPUT) return true; else if (aFluid.getID() == aFilterFluid) return aFilterMode == FILTER_INPUT_DENY_OUTPUT || aFilterMode == FILTER_INPUT_ANY_OUTPUT; - else - return aFilterMode == INVERT_INPUT_DENY_OUTPUT || aFilterMode == INVERT_INPUT_ANY_OUTPUT; + else return aFilterMode == INVERT_INPUT_DENY_OUTPUT || aFilterMode == INVERT_INPUT_ANY_OUTPUT; } @Override - protected boolean letsFluidOutImpl(byte aSide, int aCoverID, FluidFilterData aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { + protected boolean letsFluidOutImpl( + byte aSide, int aCoverID, FluidFilterData aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { if (aFluid == null) return true; int aFilterMode = aCoverVariable.mFilterMode; int aFilterFluid = aCoverVariable.mFluidID; - if (aFilterMode == FILTER_INPUT_DENY_OUTPUT || aFilterMode == INVERT_INPUT_DENY_OUTPUT) - return false; - else if (aFilterMode == FILTER_INPUT_ANY_OUTPUT || aFilterMode == INVERT_INPUT_ANY_OUTPUT) - return true; + if (aFilterMode == FILTER_INPUT_DENY_OUTPUT || aFilterMode == INVERT_INPUT_DENY_OUTPUT) return false; + else if (aFilterMode == FILTER_INPUT_ANY_OUTPUT || aFilterMode == INVERT_INPUT_ANY_OUTPUT) return true; else if (aFluid.getID() == aFilterFluid) return aFilterMode == DENY_INPUT_FILTER_OUTPUT || aFilterMode == ANY_INPUT_FILTER_OUTPUT; - else - return aFilterMode == DENY_INPUT_INVERT_OUTPUT || aFilterMode == ANY_INPUT_INVERT_OUTPUT; + else return aFilterMode == DENY_INPUT_INVERT_OUTPUT || aFilterMode == ANY_INPUT_INVERT_OUTPUT; } @Override - protected boolean alwaysLookConnectedImpl(byte aSide, int aCoverID, FluidFilterData aCoverVariable, ICoverable aTileEntity) { + protected boolean alwaysLookConnectedImpl( + byte aSide, int aCoverID, FluidFilterData aCoverVariable, ICoverable aTileEntity) { return true; } @@ -181,14 +200,19 @@ public class GT_Cover_Fluidfilter extends GT_CoverBehaviorBase<GT_Cover_Fluidfil /** * GUI Stuff */ - @Override public boolean hasCoverGUI() { return true; } @Override - protected Object getClientGUIImpl(byte aSide, int aCoverID, FluidFilterData coverData, ICoverable aTileEntity, EntityPlayer aPlayer, World aWorld) { + protected Object getClientGUIImpl( + byte aSide, + int aCoverID, + FluidFilterData coverData, + ICoverable aTileEntity, + EntityPlayer aPlayer, + World aWorld) { return new GT_FluidFilterGUICover(aSide, aCoverID, coverData, aTileEntity); } @@ -204,25 +228,32 @@ public class GT_Cover_Fluidfilter extends GT_CoverBehaviorBase<GT_Cover_Fluidfil private static final int spaceX = 18; private static final int spaceY = 18; - private final int - textColor = this.getTextColorOrDefault("text", 0xFF555555), - textColorTitle = this.getTextColorOrDefault("title", 0xFF222222); + private final int textColor = this.getTextColorOrDefault("text", 0xFF555555), + textColorTitle = this.getTextColorOrDefault("title", 0xFF222222); - public GT_FluidFilterGUICover(byte aSide, int aCoverID, FluidFilterData aCoverVariable, ICoverable aTileEntity) { + public GT_FluidFilterGUICover( + byte aSide, int aCoverID, FluidFilterData aCoverVariable, ICoverable aTileEntity) { super(aTileEntity, 176, 107, GT_Utility.intToStack(aCoverID)); this.side = aSide; this.coverID = aCoverID; this.coverVariable = aCoverVariable; GT_GuiIconButton b; - b = new GT_GuiIconButton(this, 0, startX + spaceX*0, startY+spaceY*0, GT_GuiIcon.IMPORT).setTooltipText(GT_Utility.trans("232", "Filter Input")); - b = new GT_GuiIconButton(this, 1, startX + spaceX*1, startY+spaceY*0, GT_GuiIcon.EXPORT).setTooltipText(GT_Utility.trans("233", "Filter Output")); - b = new GT_GuiIconButton(this, 2, startX + spaceX*0, startY+spaceY*2, GT_GuiIcon.BLOCK_INPUT).setTooltipText(GT_Utility.trans("234", "Block Output")); - b = new GT_GuiIconButton(this, 3, startX + spaceX*1, startY+spaceY*2, GT_GuiIcon.ALLOW_INPUT).setTooltipText(GT_Utility.trans("235", "Allow Output")); - b = new GT_GuiIconButton(this, 4, startX + spaceX*0, startY+spaceY*1, GT_GuiIcon.WHITELIST).setTooltipText(GT_Utility.trans("236", "Whitelist Fluid")); - b = new GT_GuiIconButton(this, 5, startX + spaceX*1, startY+spaceY*1, GT_GuiIcon.BLACKLIST).setTooltipText(GT_Utility.trans("237", "Blacklist Fluid")); - - fluidFilterButton = new GT_GuiFakeItemButton(this, startX, startY + spaceY * 3 + 2, GT_GuiIcon.SLOT_DARKGRAY); + b = new GT_GuiIconButton(this, 0, startX + spaceX * 0, startY + spaceY * 0, GT_GuiIcon.IMPORT) + .setTooltipText(GT_Utility.trans("232", "Filter Input")); + b = new GT_GuiIconButton(this, 1, startX + spaceX * 1, startY + spaceY * 0, GT_GuiIcon.EXPORT) + .setTooltipText(GT_Utility.trans("233", "Filter Output")); + b = new GT_GuiIconButton(this, 2, startX + spaceX * 0, startY + spaceY * 2, GT_GuiIcon.BLOCK_INPUT) + .setTooltipText(GT_Utility.trans("234", "Block Output")); + b = new GT_GuiIconButton(this, 3, startX + spaceX * 1, startY + spaceY * 2, GT_GuiIcon.ALLOW_INPUT) + .setTooltipText(GT_Utility.trans("235", "Allow Output")); + b = new GT_GuiIconButton(this, 4, startX + spaceX * 0, startY + spaceY * 1, GT_GuiIcon.WHITELIST) + .setTooltipText(GT_Utility.trans("236", "Whitelist Fluid")); + b = new GT_GuiIconButton(this, 5, startX + spaceX * 1, startY + spaceY * 1, GT_GuiIcon.BLACKLIST) + .setTooltipText(GT_Utility.trans("237", "Blacklist Fluid")); + + fluidFilterButton = + new GT_GuiFakeItemButton(this, startX, startY + spaceY * 3 + 2, GT_GuiIcon.SLOT_DARKGRAY); fluidFilterButton.setMimicSlot(true); } @@ -259,14 +290,20 @@ public class GT_Cover_Fluidfilter extends GT_CoverBehaviorBase<GT_Cover_Fluidfil return false; } - @Override public void drawExtras(int mouseX, int mouseY, float parTicks) { super.drawExtras(mouseX, mouseY, parTicks); - this.fontRendererObj.drawString(GT_Utility.trans("238", "Filter Direction"), startX + spaceX*2, 3+startY+spaceY*0, textColor); - this.fontRendererObj.drawString(GT_Utility.trans("239", "Filter Type"), startX + spaceX*2, 3+startY+spaceY*1, textColor); - this.fontRendererObj.drawString(GT_Utility.trans("240", "Block Flow"), startX + spaceX*2, 3+startY+spaceY*2, textColor); - this.fontRendererObj.drawSplitString(fluidFilterName, startX + spaceX+3, 4+startY+spaceY*3, gui_width-40 , textColorTitle); + this.fontRendererObj.drawString( + GT_Utility.trans("238", "Filter Direction"), + startX + spaceX * 2, + 3 + startY + spaceY * 0, + textColor); + this.fontRendererObj.drawString( + GT_Utility.trans("239", "Filter Type"), startX + spaceX * 2, 3 + startY + spaceY * 1, textColor); + this.fontRendererObj.drawString( + GT_Utility.trans("240", "Block Flow"), startX + spaceX * 2, 3 + startY + spaceY * 2, textColor); + this.fontRendererObj.drawSplitString( + fluidFilterName, startX + spaceX + 3, 4 + startY + spaceY * 3, gui_width - 40, textColorTitle); } @Override @@ -289,16 +326,12 @@ public class GT_Cover_Fluidfilter extends GT_CoverBehaviorBase<GT_Cover_Fluidfil if (o instanceof GT_GuiIconButton) { b = (GT_GuiIconButton) o; b.enabled = getClickable(b.id); - if (getClickable(1)) { //filtering input - if (b.id == 2) - b.setTooltipText(GT_Utility.trans("311", "Block Output")); - else if (b.id == 3) - b.setTooltipText(GT_Utility.trans("312", "Allow Output")); + if (getClickable(1)) { // filtering input + if (b.id == 2) b.setTooltipText(GT_Utility.trans("311", "Block Output")); + else if (b.id == 3) b.setTooltipText(GT_Utility.trans("312", "Allow Output")); } else { - if (b.id == 2) - b.setTooltipText(GT_Utility.trans("313", "Block Input")); - else if (b.id == 3) - b.setTooltipText(GT_Utility.trans("314", "Allow Input")); + if (b.id == 2) b.setTooltipText(GT_Utility.trans("313", "Block Input")); + else if (b.id == 3) b.setTooltipText(GT_Utility.trans("314", "Allow Input")); } } } @@ -353,8 +386,7 @@ public class GT_Cover_Fluidfilter extends GT_CoverBehaviorBase<GT_Cover_Fluidfil mFilterMode = tNBT.getInteger("mFilterMode"); if (tNBT.hasKey("mFluid", NBT.TAG_STRING)) mFluidID = FluidRegistry.getFluidID(tNBT.getString("mFluid")); - else - mFluidID = -1; + else mFluidID = -1; } } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_ItemFilter.java b/src/main/java/gregtech/common/covers/GT_Cover_ItemFilter.java index f6b37316b2..b50cdb7194 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_ItemFilter.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_ItemFilter.java @@ -1,5 +1,8 @@ package gregtech.common.covers; +import static gregtech.api.util.GT_Utility.intToStack; +import static gregtech.api.util.GT_Utility.moveMultipleItemStacks; + import com.google.common.io.ByteArrayDataInput; import cpw.mods.fml.common.network.ByteBufUtils; import gregtech.api.enums.GT_Values; @@ -13,6 +16,9 @@ import gregtech.api.util.GT_CoverBehaviorBase; import gregtech.api.util.GT_Utility; import gregtech.api.util.ISerializableObject; import io.netty.buffer.ByteBuf; +import java.util.Collections; +import java.util.List; +import javax.annotation.Nonnull; import net.minecraft.client.gui.GuiButton; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; @@ -24,13 +30,6 @@ import net.minecraft.world.World; import net.minecraftforge.common.util.Constants; import net.minecraftforge.fluids.Fluid; -import javax.annotation.Nonnull; -import java.util.Collections; -import java.util.List; - -import static gregtech.api.util.GT_Utility.intToStack; -import static gregtech.api.util.GT_Utility.moveMultipleItemStacks; - public class GT_Cover_ItemFilter extends GT_CoverBehaviorBase<GT_Cover_ItemFilter.ItemFilterData> { private final boolean mExport; @@ -51,27 +50,52 @@ public class GT_Cover_ItemFilter extends GT_CoverBehaviorBase<GT_Cover_ItemFilte } @Override - protected boolean isRedstoneSensitiveImpl(byte aSide, int aCoverID, ItemFilterData aCoverVariable, ICoverable aTileEntity, long aTimer) { + protected boolean isRedstoneSensitiveImpl( + byte aSide, int aCoverID, ItemFilterData aCoverVariable, ICoverable aTileEntity, long aTimer) { return false; } @Override - protected ItemFilterData doCoverThingsImpl(byte aSide, byte aInputRedstone, int aCoverID, ItemFilterData aCoverVariable, ICoverable aTileEntity, long aTimer) { + protected ItemFilterData doCoverThingsImpl( + byte aSide, + byte aInputRedstone, + int aCoverID, + ItemFilterData aCoverVariable, + ICoverable aTileEntity, + long aTimer) { TileEntity tTileEntity = aTileEntity.getTileEntityAtSide(aSide); - Object fromEntity = mExport ? aTileEntity : tTileEntity, - toEntity = !mExport ? aTileEntity : tTileEntity; + Object fromEntity = mExport ? aTileEntity : tTileEntity, toEntity = !mExport ? aTileEntity : tTileEntity; byte fromSide = !mExport ? GT_Utility.getOppositeSide(aSide) : aSide, toSide = mExport ? GT_Utility.getOppositeSide(aSide) : aSide; List<ItemStack> Filter = Collections.singletonList(aCoverVariable.mFilter); - moveMultipleItemStacks(fromEntity, toEntity, fromSide, toSide, Filter, aCoverVariable.mWhitelist, (byte) 64, (byte) 1, (byte) 64, (byte) 1, 64); + moveMultipleItemStacks( + fromEntity, + toEntity, + fromSide, + toSide, + Filter, + aCoverVariable.mWhitelist, + (byte) 64, + (byte) 1, + (byte) 64, + (byte) 1, + 64); return aCoverVariable; } @Override - protected boolean onCoverRightClickImpl(byte aSide, int aCoverID, ItemFilterData aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { + protected boolean onCoverRightClickImpl( + byte aSide, + int aCoverID, + ItemFilterData aCoverVariable, + ICoverable aTileEntity, + EntityPlayer aPlayer, + float aX, + float aY, + float aZ) { ItemStack tStack = aPlayer.inventory.getCurrentItem(); if (tStack != null) { aCoverVariable.mFilter = tStack; @@ -84,54 +108,75 @@ public class GT_Cover_ItemFilter extends GT_CoverBehaviorBase<GT_Cover_ItemFilte } @Override - protected ItemFilterData onCoverScrewdriverClickImpl(byte aSide, int aCoverID, ItemFilterData aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { + protected ItemFilterData onCoverScrewdriverClickImpl( + byte aSide, + int aCoverID, + ItemFilterData aCoverVariable, + ICoverable aTileEntity, + EntityPlayer aPlayer, + float aX, + float aY, + float aZ) { aCoverVariable.mWhitelist = !aCoverVariable.mWhitelist; - GT_Utility.sendChatToPlayer(aPlayer, aCoverVariable.mWhitelist ? GT_Utility.trans("125", "Whitelist Mode") : GT_Utility.trans("124", "Blacklist Mode")); + GT_Utility.sendChatToPlayer( + aPlayer, + aCoverVariable.mWhitelist + ? GT_Utility.trans("125", "Whitelist Mode") + : GT_Utility.trans("124", "Blacklist Mode")); return aCoverVariable; } @Override - protected boolean letsRedstoneGoInImpl(byte aSide, int aCoverID, ItemFilterData aCoverVariable, ICoverable aTileEntity) { + protected boolean letsRedstoneGoInImpl( + byte aSide, int aCoverID, ItemFilterData aCoverVariable, ICoverable aTileEntity) { return true; } @Override - protected boolean letsRedstoneGoOutImpl(byte aSide, int aCoverID, ItemFilterData aCoverVariable, ICoverable aTileEntity) { + protected boolean letsRedstoneGoOutImpl( + byte aSide, int aCoverID, ItemFilterData aCoverVariable, ICoverable aTileEntity) { return true; } @Override - protected boolean letsEnergyInImpl(byte aSide, int aCoverID, ItemFilterData aCoverVariable, ICoverable aTileEntity) { + protected boolean letsEnergyInImpl( + byte aSide, int aCoverID, ItemFilterData aCoverVariable, ICoverable aTileEntity) { return true; } @Override - protected boolean letsEnergyOutImpl(byte aSide, int aCoverID, ItemFilterData aCoverVariable, ICoverable aTileEntity) { + protected boolean letsEnergyOutImpl( + byte aSide, int aCoverID, ItemFilterData aCoverVariable, ICoverable aTileEntity) { return true; } @Override - protected boolean letsFluidInImpl(byte aSide, int aCoverID, ItemFilterData aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { + protected boolean letsFluidInImpl( + byte aSide, int aCoverID, ItemFilterData aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { return false; } @Override - protected boolean letsFluidOutImpl(byte aSide, int aCoverID, ItemFilterData aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { + protected boolean letsFluidOutImpl( + byte aSide, int aCoverID, ItemFilterData aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { return false; } @Override - protected boolean letsItemsInImpl(byte aSide, int aCoverID, ItemFilterData aCoverVariable, int aSlot, ICoverable aTileEntity) { + protected boolean letsItemsInImpl( + byte aSide, int aCoverID, ItemFilterData aCoverVariable, int aSlot, ICoverable aTileEntity) { return true; } @Override - protected boolean letsItemsOutImpl(byte aSide, int aCoverID, ItemFilterData aCoverVariable, int aSlot, ICoverable aTileEntity) { + protected boolean letsItemsOutImpl( + byte aSide, int aCoverID, ItemFilterData aCoverVariable, int aSlot, ICoverable aTileEntity) { return true; } @Override - protected boolean alwaysLookConnectedImpl(byte aSide, int aCoverID, ItemFilterData aCoverVariable, ICoverable aTileEntity) { + protected boolean alwaysLookConnectedImpl( + byte aSide, int aCoverID, ItemFilterData aCoverVariable, ICoverable aTileEntity) { return true; } @@ -143,14 +188,19 @@ public class GT_Cover_ItemFilter extends GT_CoverBehaviorBase<GT_Cover_ItemFilte /** * GUI Stuff */ - @Override public boolean hasCoverGUI() { return true; } @Override - protected Object getClientGUIImpl(byte aSide, int aCoverID, ItemFilterData aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, World aWorld) { + protected Object getClientGUIImpl( + byte aSide, + int aCoverID, + ItemFilterData aCoverVariable, + ICoverable aTileEntity, + EntityPlayer aPlayer, + World aWorld) { return new GT_Cover_ItemFilter.GUI(aSide, aCoverID, aCoverVariable, aTileEntity); } @@ -158,8 +208,7 @@ public class GT_Cover_ItemFilter extends GT_CoverBehaviorBase<GT_Cover_ItemFilte private boolean mWhitelist; private ItemStack mFilter; - public ItemFilterData() { - } + public ItemFilterData() {} public ItemFilterData(boolean mWhitelist, ItemStack mFilter) { this.mWhitelist = mWhitelist; @@ -177,8 +226,7 @@ public class GT_Cover_ItemFilter extends GT_CoverBehaviorBase<GT_Cover_ItemFilte public NBTBase saveDataToNBT() { NBTTagCompound tag = new NBTTagCompound(); tag.setBoolean("mWhitelist", mWhitelist); - if (mFilter != null) - tag.setTag("mFilter", mFilter.writeToNBT(new NBTTagCompound())); + if (mFilter != null) tag.setTag("mFilter", mFilter.writeToNBT(new NBTTagCompound())); return tag; } @@ -194,8 +242,7 @@ public class GT_Cover_ItemFilter extends GT_CoverBehaviorBase<GT_Cover_ItemFilte mWhitelist = tag.getBoolean("mWhitelist"); if (tag.hasKey("mFilter", Constants.NBT.TAG_COMPOUND)) mFilter = ItemStack.loadItemStackFromNBT(tag.getCompoundTag("mFilter")); - else - mFilter = null; + else mFilter = null; } @Nonnull @@ -227,17 +274,28 @@ public class GT_Cover_ItemFilter extends GT_CoverBehaviorBase<GT_Cover_ItemFilte this.coverID = aCoverID; this.coverVariable = aCoverVariable; - btnMode = new GT_GuiIconCheckButton(this, 0, startX + spaceX * 0, startY + spaceY * 0, GT_GuiIcon.WHITELIST, GT_GuiIcon.BLACKLIST, GT_Utility.trans("125", "Whitelist Mode"), GT_Utility.trans("124", "Blacklist Mode")); - - itemFilterButtons = new GT_GuiFakeItemButton(this, startX + spaceX * 0, startY + spaceY * 2, GT_GuiIcon.SLOT_GRAY); + btnMode = new GT_GuiIconCheckButton( + this, + 0, + startX + spaceX * 0, + startY + spaceY * 0, + GT_GuiIcon.WHITELIST, + GT_GuiIcon.BLACKLIST, + GT_Utility.trans("125", "Whitelist Mode"), + GT_Utility.trans("124", "Blacklist Mode")); + + itemFilterButtons = + new GT_GuiFakeItemButton(this, startX + spaceX * 0, startY + spaceY * 2, GT_GuiIcon.SLOT_GRAY); itemFilterButtons.setMimicSlot(true); } @Override public void drawExtras(int mouseX, int mouseY, float parTicks) { super.drawExtras(mouseX, mouseY, parTicks); - this.fontRendererObj.drawString(GT_Utility.trans("317", "Filter: "), startX + spaceX*0, 3+startY+spaceY*1, textColor); - this.fontRendererObj.drawString(GT_Utility.trans("318", "Check Mode"), startX + spaceX*2, 3+startY+spaceY*0, textColor); + this.fontRendererObj.drawString( + GT_Utility.trans("317", "Filter: "), startX + spaceX * 0, 3 + startY + spaceY * 1, textColor); + this.fontRendererObj.drawString( + GT_Utility.trans("318", "Check Mode"), startX + spaceX * 2, 3 + startY + spaceY * 0, textColor); } @Override diff --git a/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java b/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java index 846e115bd8..4b66c2eaab 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java @@ -1,7 +1,6 @@ package gregtech.common.covers; import com.google.common.io.ByteArrayDataInput; - import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.gui.GT_GUICover; @@ -19,6 +18,7 @@ import gregtech.api.util.ISerializableObject; import gregtech.common.tileentities.machines.GT_MetaTileEntity_Hatch_OutputBus_ME; import gregtech.common.tileentities.storage.GT_MetaTileEntity_DigitalChestBase; import io.netty.buffer.ByteBuf; +import javax.annotation.Nonnull; import net.minecraft.client.gui.GuiButton; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; @@ -29,8 +29,6 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import net.minecraftforge.fluids.Fluid; -import javax.annotation.Nonnull; - public class GT_Cover_ItemMeter extends GT_CoverBehaviorBase<GT_Cover_ItemMeter.ItemMeterData> { // Legacy data format @@ -44,14 +42,11 @@ public class GT_Cover_ItemMeter extends GT_CoverBehaviorBase<GT_Cover_ItemMeter. @Override public ItemMeterData createDataObject(int aLegacyData) { - //Convert from ver. 5.09.33.50 + // Convert from ver. 5.09.33.50 if ((CONVERTED_BIT & aLegacyData) == 0) - if (aLegacyData == 0) - aLegacyData = CONVERTED_BIT; - else if (aLegacyData == 1) - aLegacyData = CONVERTED_BIT | INVERT_BIT; - else if (aLegacyData > 1) - aLegacyData = CONVERTED_BIT | Math.min((aLegacyData - 2), SLOT_MASK); + if (aLegacyData == 0) aLegacyData = CONVERTED_BIT; + else if (aLegacyData == 1) aLegacyData = CONVERTED_BIT | INVERT_BIT; + else if (aLegacyData > 1) aLegacyData = CONVERTED_BIT | Math.min((aLegacyData - 2), SLOT_MASK); boolean invert = (aLegacyData & INVERT_BIT) == INVERT_BIT; int slot = (aLegacyData & SLOT_MASK) - 1; @@ -65,12 +60,19 @@ public class GT_Cover_ItemMeter extends GT_CoverBehaviorBase<GT_Cover_ItemMeter. } @Override - protected boolean isRedstoneSensitiveImpl(byte aSide, int aCoverID, ItemMeterData aCoverVariable, ICoverable aTileEntity, long aTimer) { + protected boolean isRedstoneSensitiveImpl( + byte aSide, int aCoverID, ItemMeterData aCoverVariable, ICoverable aTileEntity, long aTimer) { return false; } @Override - protected ItemMeterData doCoverThingsImpl(byte aSide, byte aInputRedstone, int aCoverID, ItemMeterData aCoverVariable, ICoverable aTileEntity, long aTimer) { + protected ItemMeterData doCoverThingsImpl( + byte aSide, + byte aInputRedstone, + int aCoverID, + ItemMeterData aCoverVariable, + ICoverable aTileEntity, + long aTimer) { long tMax = 0; long tUsed = 0; IMetaTileEntity mte = ((IGregTechTileEntity) aTileEntity).getMetaTileEntity(); @@ -78,24 +80,22 @@ public class GT_Cover_ItemMeter extends GT_CoverBehaviorBase<GT_Cover_ItemMeter. GT_MetaTileEntity_DigitalChestBase dc = (GT_MetaTileEntity_DigitalChestBase) mte; tMax = dc.getMaxItemCount(); // currently it is limited by int, but there is not much reason for that ItemStack[] inv = dc.getStoredItemData(); - if (inv != null && inv.length > 1 && inv[1] != null) - tUsed = inv[1].stackSize; + if (inv != null && inv.length > 1 && inv[1] != null) tUsed = inv[1].stackSize; } else if (GregTech_API.mAE2 && mte instanceof GT_MetaTileEntity_Hatch_OutputBus_ME) { if (((GT_MetaTileEntity_Hatch_OutputBus_ME) mte).isLastOutputFailed()) { tMax = 64; tUsed = 64; } } else { - int[] tSlots = aCoverVariable.slot >= 0 ? - new int[]{aCoverVariable.slot} : - aTileEntity.getAccessibleSlotsFromSide(aSide); + int[] tSlots = aCoverVariable.slot >= 0 + ? new int[] {aCoverVariable.slot} + : aTileEntity.getAccessibleSlotsFromSide(aSide); for (int i : tSlots) { if (i >= 0 && i < aTileEntity.getSizeInventory()) { tMax += 64; ItemStack tStack = aTileEntity.getStackInSlot(i); - if (tStack != null) - tUsed += (tStack.stackSize << 6) / tStack.getMaxStackSize(); + if (tStack != null) tUsed += (tStack.stackSize << 6) / tStack.getMaxStackSize(); } } } @@ -129,25 +129,31 @@ public class GT_Cover_ItemMeter extends GT_CoverBehaviorBase<GT_Cover_ItemMeter. } @Override - protected ItemMeterData onCoverScrewdriverClickImpl(byte aSide, int aCoverID, ItemMeterData aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { + protected ItemMeterData onCoverScrewdriverClickImpl( + byte aSide, + int aCoverID, + ItemMeterData aCoverVariable, + ICoverable aTileEntity, + EntityPlayer aPlayer, + float aX, + float aY, + float aZ) { if (aPlayer.isSneaking()) { if (aCoverVariable.inverted) { aCoverVariable.inverted = false; - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("055", "Normal")); - } - else { + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("055", "Normal")); + } else { aCoverVariable.inverted = true; - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("054", "Inverted")); + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("054", "Inverted")); } } else { aCoverVariable.slot++; - if (aCoverVariable.slot > aTileEntity.getSizeInventory()) - aCoverVariable.slot = -1; + if (aCoverVariable.slot > aTileEntity.getSizeInventory()) aCoverVariable.slot = -1; if (aCoverVariable.slot == -1) - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("053", "Slot: ") + GT_Utility.trans("ALL", "All")); - else - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("053", "Slot: ") + aCoverVariable.slot); + GT_Utility.sendChatToPlayer( + aPlayer, GT_Utility.trans("053", "Slot: ") + GT_Utility.trans("ALL", "All")); + else GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("053", "Slot: ") + aCoverVariable.slot); } return aCoverVariable; @@ -159,32 +165,38 @@ public class GT_Cover_ItemMeter extends GT_CoverBehaviorBase<GT_Cover_ItemMeter. } @Override - protected boolean letsEnergyOutImpl(byte aSide, int aCoverID, ItemMeterData aCoverVariable, ICoverable aTileEntity) { + protected boolean letsEnergyOutImpl( + byte aSide, int aCoverID, ItemMeterData aCoverVariable, ICoverable aTileEntity) { return true; } @Override - protected boolean letsFluidInImpl(byte aSide, int aCoverID, ItemMeterData aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { + protected boolean letsFluidInImpl( + byte aSide, int aCoverID, ItemMeterData aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { return true; } @Override - protected boolean letsFluidOutImpl(byte aSide, int aCoverID, ItemMeterData aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { + protected boolean letsFluidOutImpl( + byte aSide, int aCoverID, ItemMeterData aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { return true; } @Override - protected boolean letsItemsInImpl(byte aSide, int aCoverID, ItemMeterData aCoverVariable, int aSlot, ICoverable aTileEntity) { + protected boolean letsItemsInImpl( + byte aSide, int aCoverID, ItemMeterData aCoverVariable, int aSlot, ICoverable aTileEntity) { return true; } @Override - protected boolean letsItemsOutImpl(byte aSide, int aCoverID, ItemMeterData aCoverVariable, int aSlot, ICoverable aTileEntity) { + protected boolean letsItemsOutImpl( + byte aSide, int aCoverID, ItemMeterData aCoverVariable, int aSlot, ICoverable aTileEntity) { return true; } @Override - protected boolean manipulatesSidedRedstoneOutputImpl(byte aSide, int aCoverID, ItemMeterData aCoverVariable, ICoverable aTileEntity) { + protected boolean manipulatesSidedRedstoneOutputImpl( + byte aSide, int aCoverID, ItemMeterData aCoverVariable, ICoverable aTileEntity) { return true; } @@ -196,14 +208,19 @@ public class GT_Cover_ItemMeter extends GT_CoverBehaviorBase<GT_Cover_ItemMeter. /** * GUI Stuff */ - @Override public boolean hasCoverGUI() { return true; } @Override - protected Object getClientGUIImpl(byte aSide, int aCoverID, ItemMeterData coverData, ICoverable aTileEntity, EntityPlayer aPlayer, World aWorld) { + protected Object getClientGUIImpl( + byte aSide, + int aCoverID, + ItemMeterData coverData, + ICoverable aTileEntity, + EntityPlayer aPlayer, + World aWorld) { return new GUI(aSide, aCoverID, coverData, aTileEntity); } @@ -284,31 +301,35 @@ public class GT_Cover_ItemMeter extends GT_CoverBehaviorBase<GT_Cover_ItemMeter. private static final int spaceY = 18; private final String ALL = GT_Utility.trans("ALL", "All"); - private final String INVERTED = GT_Utility.trans("INVERTED", "Inverted"); - private final String NORMAL = GT_Utility.trans("NORMAL", "Normal"); + private final String INVERTED = GT_Utility.trans("INVERTED", "Inverted"); + private final String NORMAL = GT_Utility.trans("NORMAL", "Normal"); private final int textColor = this.getTextColorOrDefault("text", 0xFF555555); - public GUI(byte aSide, int aCoverID, ItemMeterData aCoverVariable, ICoverable aTileEntity) { + public GUI(byte aSide, int aCoverID, ItemMeterData aCoverVariable, ICoverable aTileEntity) { super(aTileEntity, 176, 107, GT_Utility.intToStack(aCoverID)); this.side = aSide; this.coverID = aCoverID; this.coverVariable = aCoverVariable; - invertedButton = new GT_GuiIconCheckButton(this, 0, startX, startY, GT_GuiIcon.REDSTONE_ON, GT_GuiIcon.REDSTONE_OFF, INVERTED, NORMAL); + invertedButton = new GT_GuiIconCheckButton( + this, 0, startX, startY, GT_GuiIcon.REDSTONE_ON, GT_GuiIcon.REDSTONE_OFF, INVERTED, NORMAL); intSlot = new GT_GuiIntegerTextBox(this, 1, startX, startY + spaceY + 2, spaceX * 2 + 5, 12); intSlot.setMaxStringLength(6); - //only shows if opened gui of block sadly, should've used container. - intSlotIcon = new GT_GuiFakeItemButton(this, startX + spaceX * 8 - 4, startY + spaceY, GT_GuiIcon.SLOT_GRAY); + // only shows if opened gui of block sadly, should've used container. + intSlotIcon = + new GT_GuiFakeItemButton(this, startX + spaceX * 8 - 4, startY + spaceY, GT_GuiIcon.SLOT_GRAY); intSlotIcon.setMimicSlot(true); - if (tile instanceof TileEntity && !super.tile.isDead() && tile instanceof IGregTechTileEntity - && !(((IGregTechTileEntity) tile).getMetaTileEntity() instanceof GT_MetaTileEntity_DigitalChestBase)) - maxSlot = Math.min(tile.getSizeInventory() - 1, SLOT_MASK-1); - else - maxSlot = -1; + if (tile instanceof TileEntity + && !super.tile.isDead() + && tile instanceof IGregTechTileEntity + && !(((IGregTechTileEntity) tile).getMetaTileEntity() + instanceof GT_MetaTileEntity_DigitalChestBase)) + maxSlot = Math.min(tile.getSizeInventory() - 1, SLOT_MASK - 1); + else maxSlot = -1; intSlot.setEnabled(maxSlot >= 0); @@ -319,16 +340,26 @@ public class GT_Cover_ItemMeter extends GT_CoverBehaviorBase<GT_Cover_ItemMeter. @Override public void drawExtras(int mouseX, int mouseY, float parTicks) { super.drawExtras(mouseX, mouseY, parTicks); - this.getFontRenderer().drawString(coverVariable.inverted ? INVERTED : NORMAL, startX + spaceX * 3, 4 + startY, textColor); - this.getFontRenderer().drawString(GT_Utility.trans("254", "Detect slot#"), startX + spaceX * 3, 4 + startY + spaceY, textColor); - this.getFontRenderer().drawString(GT_Utility.trans("221", "Item threshold"), startX + spaceX * 3, startY + spaceY * 2 + 4, textColor); + this.getFontRenderer() + .drawString(coverVariable.inverted ? INVERTED : NORMAL, startX + spaceX * 3, 4 + startY, textColor); + this.getFontRenderer() + .drawString( + GT_Utility.trans("254", "Detect slot#"), + startX + spaceX * 3, + 4 + startY + spaceY, + textColor); + this.getFontRenderer() + .drawString( + GT_Utility.trans("221", "Item threshold"), + startX + spaceX * 3, + startY + spaceY * 2 + 4, + textColor); } @Override protected void onInitGui(int guiLeft, int guiTop, int gui_width, int gui_height) { update(); - if (intSlot.isEnabled()) - intSlot.setFocused(true); + if (intSlot.isEnabled()) intSlot.setFocused(true); } @Override @@ -345,15 +376,12 @@ public class GT_Cover_ItemMeter extends GT_CoverBehaviorBase<GT_Cover_ItemMeter. step = (isShiftKeyDown() ? 50 : isCtrlKeyDown() ? 5 : 1) * (delta > 0 ? step : -step); int val = parseTextBox(intSlot); - if (val < 0) - val = -1; + if (val < 0) val = -1; val = val + step; - if (val < 0) - val = -1; - else if (val > maxSlot) - val = maxSlot; + if (val < 0) val = -1; + else if (val > maxSlot) val = maxSlot; intSlot.setText(val < 0 ? ALL : Integer.toString(val)); } else if (thresholdSlot.isFocused()) { @@ -417,14 +445,11 @@ public class GT_Cover_ItemMeter extends GT_CoverBehaviorBase<GT_Cover_ItemMeter. private int parseTextBox(GT_GuiIntegerTextBox box) { if (box == intSlot) { String text = box.getText(); - if (text == null) - return -1; + if (text == null) return -1; text = text.trim(); - if (text.startsWith(ALL)) - text = text.substring(ALL.length()); + if (text.startsWith(ALL)) text = text.substring(ALL.length()); - if (text.isEmpty()) - return -1; + if (text.isEmpty()) return -1; int val; try { @@ -433,10 +458,8 @@ public class GT_Cover_ItemMeter extends GT_CoverBehaviorBase<GT_Cover_ItemMeter. return -1; } - if (val < 0) - return -1; - else if (maxSlot < val) - return maxSlot; + if (val < 0) return -1; + else if (maxSlot < val) return maxSlot; return val; } else if (box == thresholdSlot) { String text = box.getText(); diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Lens.java b/src/main/java/gregtech/common/covers/GT_Cover_Lens.java index 37405e6fa8..735959e15c 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Lens.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Lens.java @@ -11,7 +11,8 @@ public class GT_Cover_Lens extends GT_CoverBehavior { } @Override - public boolean isRedstoneSensitive(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { + public boolean isRedstoneSensitive( + byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { return false; } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_LiquidMeter.java b/src/main/java/gregtech/common/covers/GT_Cover_LiquidMeter.java index 3d5074a686..55cca29704 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_LiquidMeter.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_LiquidMeter.java @@ -12,6 +12,8 @@ import gregtech.api.util.GT_CoverBehaviorBase; import gregtech.api.util.GT_Utility; import gregtech.api.util.ISerializableObject; import io.netty.buffer.ByteBuf; +import java.util.Arrays; +import javax.annotation.Nonnull; import net.minecraft.client.gui.GuiButton; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; @@ -24,9 +26,6 @@ import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidTankInfo; import net.minecraftforge.fluids.IFluidHandler; -import javax.annotation.Nonnull; -import java.util.Arrays; - public class GT_Cover_LiquidMeter extends GT_CoverBehaviorBase<GT_Cover_LiquidMeter.LiquidMeterData> { public GT_Cover_LiquidMeter() { @@ -44,12 +43,19 @@ public class GT_Cover_LiquidMeter extends GT_CoverBehaviorBase<GT_Cover_LiquidMe } @Override - protected boolean isRedstoneSensitiveImpl(byte aSide, int aCoverID, LiquidMeterData aCoverVariable, ICoverable aTileEntity, long aTimer) { + protected boolean isRedstoneSensitiveImpl( + byte aSide, int aCoverID, LiquidMeterData aCoverVariable, ICoverable aTileEntity, long aTimer) { return false; } @Override - protected LiquidMeterData doCoverThingsImpl(byte aSide, byte aInputRedstone, int aCoverID, LiquidMeterData aCoverVariable, ICoverable aTileEntity, long aTimer) { + protected LiquidMeterData doCoverThingsImpl( + byte aSide, + byte aInputRedstone, + int aCoverID, + LiquidMeterData aCoverVariable, + ICoverable aTileEntity, + long aTimer) { if ((aTileEntity instanceof IFluidHandler)) { FluidTankInfo[] tTanks = ((IFluidHandler) aTileEntity).getTankInfo(ForgeDirection.UNKNOWN); long tMax = 0; @@ -92,13 +98,21 @@ public class GT_Cover_LiquidMeter extends GT_CoverBehaviorBase<GT_Cover_LiquidMe aTileEntity.setOutputRedstoneSignal(aSide, (byte) redstoneSignal); } else { - aTileEntity.setOutputRedstoneSignal(aSide, (byte)0); + aTileEntity.setOutputRedstoneSignal(aSide, (byte) 0); } return aCoverVariable; } @Override - protected LiquidMeterData onCoverScrewdriverClickImpl(byte aSide, int aCoverID, LiquidMeterData aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { + protected LiquidMeterData onCoverScrewdriverClickImpl( + byte aSide, + int aCoverID, + LiquidMeterData aCoverVariable, + ICoverable aTileEntity, + EntityPlayer aPlayer, + float aX, + float aY, + float aZ) { if (aCoverVariable.inverted) { aCoverVariable.inverted = false; GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("055", "Normal")); @@ -110,37 +124,44 @@ public class GT_Cover_LiquidMeter extends GT_CoverBehaviorBase<GT_Cover_LiquidMe } @Override - protected boolean letsEnergyInImpl(byte aSide, int aCoverID, LiquidMeterData aCoverVariable, ICoverable aTileEntity) { + protected boolean letsEnergyInImpl( + byte aSide, int aCoverID, LiquidMeterData aCoverVariable, ICoverable aTileEntity) { return true; } @Override - protected boolean letsEnergyOutImpl(byte aSide, int aCoverID, LiquidMeterData aCoverVariable, ICoverable aTileEntity) { + protected boolean letsEnergyOutImpl( + byte aSide, int aCoverID, LiquidMeterData aCoverVariable, ICoverable aTileEntity) { return true; } @Override - protected boolean letsFluidInImpl(byte aSide, int aCoverID, LiquidMeterData aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { + protected boolean letsFluidInImpl( + byte aSide, int aCoverID, LiquidMeterData aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { return true; } @Override - protected boolean letsFluidOutImpl(byte aSide, int aCoverID, LiquidMeterData aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { + protected boolean letsFluidOutImpl( + byte aSide, int aCoverID, LiquidMeterData aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { return true; } @Override - protected boolean letsItemsInImpl(byte aSide, int aCoverID, LiquidMeterData aCoverVariable, int aSlot, ICoverable aTileEntity) { + protected boolean letsItemsInImpl( + byte aSide, int aCoverID, LiquidMeterData aCoverVariable, int aSlot, ICoverable aTileEntity) { return true; } @Override - protected boolean letsItemsOutImpl(byte aSide, int aCoverID, LiquidMeterData aCoverVariable, int aSlot, ICoverable aTileEntity) { + protected boolean letsItemsOutImpl( + byte aSide, int aCoverID, LiquidMeterData aCoverVariable, int aSlot, ICoverable aTileEntity) { return true; } @Override - protected boolean manipulatesSidedRedstoneOutputImpl(byte aSide, int aCoverID, LiquidMeterData aCoverVariable, ICoverable aTileEntity) { + protected boolean manipulatesSidedRedstoneOutputImpl( + byte aSide, int aCoverID, LiquidMeterData aCoverVariable, ICoverable aTileEntity) { return true; } @@ -151,14 +172,19 @@ public class GT_Cover_LiquidMeter extends GT_CoverBehaviorBase<GT_Cover_LiquidMe /** * GUI Stuff */ - @Override public boolean hasCoverGUI() { return true; } @Override - public Object getClientGUIImpl(byte aSide, int aCoverID, LiquidMeterData coverData, ICoverable aTileEntity, EntityPlayer aPlayer, World aWorld) { + public Object getClientGUIImpl( + byte aSide, + int aCoverID, + LiquidMeterData coverData, + ICoverable aTileEntity, + EntityPlayer aPlayer, + World aWorld) { return new GUI(aSide, aCoverID, coverData, aTileEntity); } @@ -239,15 +265,22 @@ public class GT_Cover_LiquidMeter extends GT_CoverBehaviorBase<GT_Cover_LiquidMe this.coverID = aCoverID; this.coverVariable = aCoverVariable; - invertedButton = new GT_GuiIconCheckButton(this, 0, startX + spaceX * 0, startY + spaceY * 0, GT_GuiIcon.REDSTONE_ON, GT_GuiIcon.REDSTONE_OFF, INVERTED, NORMAL); - thresholdSlot = new GT_GuiIntegerTextBox(this, 2, startX + spaceX * 0, startY + spaceY * 1 + 2, spaceX * 4 + 5, 12); + invertedButton = new GT_GuiIconCheckButton( + this, + 0, + startX + spaceX * 0, + startY + spaceY * 0, + GT_GuiIcon.REDSTONE_ON, + GT_GuiIcon.REDSTONE_OFF, + INVERTED, + NORMAL); + thresholdSlot = + new GT_GuiIntegerTextBox(this, 2, startX + spaceX * 0, startY + spaceY * 1 + 2, spaceX * 4 + 5, 12); if (tile instanceof IFluidHandler) { FluidTankInfo[] tanks = ((IFluidHandler) tile).getTankInfo(ForgeDirection.UNKNOWN); maxCapacity = - Arrays.stream(tanks) - .mapToInt(tank -> tank.capacity) - .sum(); + Arrays.stream(tanks).mapToInt(tank -> tank.capacity).sum(); } else { maxCapacity = -1; } @@ -256,8 +289,17 @@ public class GT_Cover_LiquidMeter extends GT_CoverBehaviorBase<GT_Cover_LiquidMe @Override public void drawExtras(int mouseX, int mouseY, float parTicks) { super.drawExtras(mouseX, mouseY, parTicks); - this.fontRendererObj.drawString(coverVariable.inverted ? INVERTED : NORMAL, startX + spaceX * 1, 4 + startY + spaceY * 0, textColor); - this.getFontRenderer().drawString(GT_Utility.trans("222", "Fluid threshold"), startX + spaceX * 5 - 10, startY + spaceY * 1 + 4, textColor); + this.fontRendererObj.drawString( + coverVariable.inverted ? INVERTED : NORMAL, + startX + spaceX * 1, + 4 + startY + spaceY * 0, + textColor); + this.getFontRenderer() + .drawString( + GT_Utility.trans("222", "Fluid threshold"), + startX + spaceX * 5 - 10, + startY + spaceY * 1 + 4, + textColor); } @Override diff --git a/src/main/java/gregtech/common/covers/GT_Cover_NeedMaintainance.java b/src/main/java/gregtech/common/covers/GT_Cover_NeedMaintainance.java index dc4dc7c56e..baf3c6232f 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_NeedMaintainance.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_NeedMaintainance.java @@ -19,16 +19,21 @@ import net.minecraftforge.fluids.Fluid; public class GT_Cover_NeedMaintainance extends GT_CoverBehavior { private boolean isRotor(ItemStack aRotor) { - return !(aRotor == null || !(aRotor.getItem() instanceof GT_MetaGenerated_Tool) || aRotor.getItemDamage() < 170 || aRotor.getItemDamage() > 176); + return !(aRotor == null + || !(aRotor.getItem() instanceof GT_MetaGenerated_Tool) + || aRotor.getItemDamage() < 170 + || aRotor.getItemDamage() > 176); } @Override - public boolean isRedstoneSensitive(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { + public boolean isRedstoneSensitive( + byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { return false; } @Override - public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { + public int doCoverThings( + byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { boolean needsRepair = false; if (aTileEntity instanceof IGregTechTileEntity) { IGregTechTileEntity tTileEntity = (IGregTechTileEntity) aTileEntity; @@ -40,8 +45,7 @@ public class GT_Cover_NeedMaintainance extends GT_CoverBehavior { ItemStack tRotor = multi.getRealInventory()[1]; int coverVar = aCoverVariable >>> 1; if (coverVar < 5) { - if (ideal - real > coverVar) - needsRepair = true; + if (ideal - real > coverVar) needsRepair = true; } else if (coverVar == 5 || coverVar == 6) { if (isRotor(tRotor)) { long tMax = GT_MetaGenerated_Tool.getToolMaxDamage(tRotor); @@ -49,7 +53,8 @@ public class GT_Cover_NeedMaintainance extends GT_CoverBehavior { if (coverVar == 5) { needsRepair = (tCur >= tMax * 8 / 10); } else { - long mExpectedDamage = Math.round(Math.min(multi.mEUt / multi.damageFactorLow, Math.pow(multi.mEUt, multi.damageFactorHigh))); + long mExpectedDamage = Math.round(Math.min( + multi.mEUt / multi.damageFactorLow, Math.pow(multi.mEUt, multi.damageFactorHigh))); needsRepair = tCur + mExpectedDamage * 2 >= tMax; } } else { @@ -68,7 +73,15 @@ public class GT_Cover_NeedMaintainance extends GT_CoverBehavior { } @Override - public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public int onCoverScrewdriverclick( + byte aSide, + int aCoverID, + int aCoverVariable, + ICoverable aTileEntity, + EntityPlayer aPlayer, + float aX, + float aY, + float aZ) { aCoverVariable = (aCoverVariable + (aPlayer.isSneaking() ? -1 : 1)) % 14; if (aCoverVariable < 0) { aCoverVariable = 13; @@ -105,16 +118,21 @@ public class GT_Cover_NeedMaintainance extends GT_CoverBehavior { GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("065", "Emit if 5 Maintenance Needed(inverted)")); break; case 10: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("066", "Emit if rotor needs maintenance low accuracy mod")); + GT_Utility.sendChatToPlayer( + aPlayer, GT_Utility.trans("066", "Emit if rotor needs maintenance low accuracy mod")); break; case 11: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("067", "Emit if rotor needs maintenance low accuracy mod(inverted)")); + GT_Utility.sendChatToPlayer( + aPlayer, GT_Utility.trans("067", "Emit if rotor needs maintenance low accuracy mod(inverted)")); break; case 12: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("068", "Emit if rotor needs maintenance high accuracy mod")); + GT_Utility.sendChatToPlayer( + aPlayer, GT_Utility.trans("068", "Emit if rotor needs maintenance high accuracy mod")); break; case 13: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("069", "Emit if rotor needs maintenance high accuracy mod(inverted)")); + GT_Utility.sendChatToPlayer( + aPlayer, + GT_Utility.trans("069", "Emit if rotor needs maintenance high accuracy mod(inverted)")); break; } return aCoverVariable; @@ -151,7 +169,8 @@ public class GT_Cover_NeedMaintainance extends GT_CoverBehavior { } @Override - public boolean manipulatesSidedRedstoneOutput(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + public boolean manipulatesSidedRedstoneOutput( + byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } @@ -162,14 +181,13 @@ public class GT_Cover_NeedMaintainance extends GT_CoverBehavior { /** * GUI Stuff */ - @Override public boolean hasCoverGUI() { return true; } @Override - public Object getClientGUI(byte aSide, int aCoverID, int coverData, ICoverable aTileEntity) { + public Object getClientGUI(byte aSide, int aCoverID, int coverData, ICoverable aTileEntity) { return new GUI(aSide, aCoverID, coverData, aTileEntity); } @@ -179,26 +197,25 @@ public class GT_Cover_NeedMaintainance extends GT_CoverBehavior { private int coverVariable; private final String[] tooltiptext = { - GT_Utility.trans("056", "Emit if 1 Maintenance Needed"), - GT_Utility.trans("058", "Emit if 2 Maintenance Needed"), - GT_Utility.trans("060", "Emit if 3 Maintenance Needed"), - GT_Utility.trans("062", "Emit if 4 Maintenance Needed"), - GT_Utility.trans("064", "Emit if 5 Maintenance Needed"), - GT_Utility.trans("066", "Emit if rotor needs maintenance low accuracy mod"), - GT_Utility.trans("068", "Emit if rotor needs maintenance high accuracy mod"), + GT_Utility.trans("056", "Emit if 1 Maintenance Needed"), + GT_Utility.trans("058", "Emit if 2 Maintenance Needed"), + GT_Utility.trans("060", "Emit if 3 Maintenance Needed"), + GT_Utility.trans("062", "Emit if 4 Maintenance Needed"), + GT_Utility.trans("064", "Emit if 5 Maintenance Needed"), + GT_Utility.trans("066", "Emit if rotor needs maintenance low accuracy mod"), + GT_Utility.trans("068", "Emit if rotor needs maintenance high accuracy mod"), }; private final String[] buttontext = { - GT_Utility.trans("247", "1 Issue"), - GT_Utility.trans("248", "2 Issues"), - GT_Utility.trans("249", "3 Issues"), - GT_Utility.trans("250", "4 Issues"), - GT_Utility.trans("251", "5 Issues"), - GT_Utility.trans("252", "Rotor < 80%"), - GT_Utility.trans("253", "Rotor < 100%"), - - GT_Utility.trans("INVERTED", "Inverted"), - GT_Utility.trans("NORMAL", "Normal"), + GT_Utility.trans("247", "1 Issue"), + GT_Utility.trans("248", "2 Issues"), + GT_Utility.trans("249", "3 Issues"), + GT_Utility.trans("250", "4 Issues"), + GT_Utility.trans("251", "5 Issues"), + GT_Utility.trans("252", "Rotor < 80%"), + GT_Utility.trans("253", "Rotor < 100%"), + GT_Utility.trans("INVERTED", "Inverted"), + GT_Utility.trans("NORMAL", "Normal"), }; private static final int startX = 10; @@ -215,31 +232,46 @@ public class GT_Cover_NeedMaintainance extends GT_CoverBehavior { this.coverVariable = aCoverVariable; GuiButton b; - b = new GT_GuiIconCheckButton(this, 0, startX + spaceX*0, startY+spaceY*0, GT_GuiIcon.CHECKMARK, null).setTooltipText(tooltiptext[0]); - b = new GT_GuiIconCheckButton(this, 1, startX + spaceX*0, startY+spaceY*1, GT_GuiIcon.CHECKMARK, null).setTooltipText(tooltiptext[1]); - b = new GT_GuiIconCheckButton(this, 2, startX + spaceX*0, startY+spaceY*2, GT_GuiIcon.CHECKMARK, null).setTooltipText(tooltiptext[2]); - b = new GT_GuiIconCheckButton(this, 3, startX + spaceX*0, startY+spaceY*3, GT_GuiIcon.CHECKMARK, null).setTooltipText(tooltiptext[3]); - b = new GT_GuiIconCheckButton(this, 4, startX + spaceX*4 + 4, startY+spaceY*0, GT_GuiIcon.CHECKMARK, null).setTooltipText(tooltiptext[4]); - b = new GT_GuiIconCheckButton(this, 5, startX + spaceX*4 + 4, startY+spaceY*1, GT_GuiIcon.CHECKMARK, null).setTooltipText(tooltiptext[5]); - b = new GT_GuiIconCheckButton(this, 6, startX + spaceX*4 + 4, startY+spaceY*2, GT_GuiIcon.CHECKMARK, null).setTooltipText(tooltiptext[6]); - b = new GT_GuiIconCheckButton(this, 7, startX + spaceX*4 + 4, startY+spaceY*3, GT_GuiIcon.REDSTONE_ON, GT_GuiIcon.REDSTONE_OFF); + b = new GT_GuiIconCheckButton(this, 0, startX + spaceX * 0, startY + spaceY * 0, GT_GuiIcon.CHECKMARK, null) + .setTooltipText(tooltiptext[0]); + b = new GT_GuiIconCheckButton(this, 1, startX + spaceX * 0, startY + spaceY * 1, GT_GuiIcon.CHECKMARK, null) + .setTooltipText(tooltiptext[1]); + b = new GT_GuiIconCheckButton(this, 2, startX + spaceX * 0, startY + spaceY * 2, GT_GuiIcon.CHECKMARK, null) + .setTooltipText(tooltiptext[2]); + b = new GT_GuiIconCheckButton(this, 3, startX + spaceX * 0, startY + spaceY * 3, GT_GuiIcon.CHECKMARK, null) + .setTooltipText(tooltiptext[3]); + b = new GT_GuiIconCheckButton( + this, 4, startX + spaceX * 4 + 4, startY + spaceY * 0, GT_GuiIcon.CHECKMARK, null) + .setTooltipText(tooltiptext[4]); + b = new GT_GuiIconCheckButton( + this, 5, startX + spaceX * 4 + 4, startY + spaceY * 1, GT_GuiIcon.CHECKMARK, null) + .setTooltipText(tooltiptext[5]); + b = new GT_GuiIconCheckButton( + this, 6, startX + spaceX * 4 + 4, startY + spaceY * 2, GT_GuiIcon.CHECKMARK, null) + .setTooltipText(tooltiptext[6]); + b = new GT_GuiIconCheckButton( + this, + 7, + startX + spaceX * 4 + 4, + startY + spaceY * 3, + GT_GuiIcon.REDSTONE_ON, + GT_GuiIcon.REDSTONE_OFF); } - @Override public void drawExtras(int mouseX, int mouseY, float parTicks) { super.drawExtras(mouseX, mouseY, parTicks); - this.fontRendererObj.drawString(buttontext[0],startX + spaceX*1, 4+startY+spaceY*0, textColor); - this.fontRendererObj.drawString(buttontext[1],startX + spaceX*1, 4+startY+spaceY*1, textColor); - this.fontRendererObj.drawString(buttontext[2],startX + spaceX*1, 4+startY+spaceY*2, textColor); - this.fontRendererObj.drawString(buttontext[3],startX + spaceX*1, 4+startY+spaceY*3, textColor); - this.fontRendererObj.drawString(buttontext[4],startX + spaceX*5 + 4, 4+startY+spaceY*0, textColor); - this.fontRendererObj.drawString(buttontext[5],startX + spaceX*5 + 4, 4+startY+spaceY*1, textColor); - this.fontRendererObj.drawString(buttontext[6],startX + spaceX*5 + 4, 4+startY+spaceY*2, textColor); + this.fontRendererObj.drawString(buttontext[0], startX + spaceX * 1, 4 + startY + spaceY * 0, textColor); + this.fontRendererObj.drawString(buttontext[1], startX + spaceX * 1, 4 + startY + spaceY * 1, textColor); + this.fontRendererObj.drawString(buttontext[2], startX + spaceX * 1, 4 + startY + spaceY * 2, textColor); + this.fontRendererObj.drawString(buttontext[3], startX + spaceX * 1, 4 + startY + spaceY * 3, textColor); + this.fontRendererObj.drawString(buttontext[4], startX + spaceX * 5 + 4, 4 + startY + spaceY * 0, textColor); + this.fontRendererObj.drawString(buttontext[5], startX + spaceX * 5 + 4, 4 + startY + spaceY * 1, textColor); + this.fontRendererObj.drawString(buttontext[6], startX + spaceX * 5 + 4, 4 + startY + spaceY * 2, textColor); // inverted normal String s2 = ((coverVariable & 0x1) > 0) ? buttontext[7] : buttontext[8]; - this.fontRendererObj.drawString(s2, startX + spaceX*5 + 4, 4+startY+spaceY*3, textColor); + this.fontRendererObj.drawString(s2, startX + spaceX * 5 + 4, 4 + startY + spaceY * 3, textColor); } @Override @@ -248,32 +280,29 @@ public class GT_Cover_NeedMaintainance extends GT_CoverBehavior { } @Override - public void buttonClicked(GuiButton btn){ - if (btn.id == 7 || !isEnabled(btn.id)){ + public void buttonClicked(GuiButton btn) { + if (btn.id == 7 || !isEnabled(btn.id)) { coverVariable = getNewCoverVariable(btn.id, ((GT_GuiIconCheckButton) btn).isChecked()); GT_Values.NW.sendToServer(new GT_Packet_TileEntityCover(side, coverID, coverVariable, tile)); } updateButtons(); } - private void updateButtons(){ + private void updateButtons() { for (Object o : buttonList) ((GT_GuiIconCheckButton) o).setChecked(isEnabled(((GT_GuiIconCheckButton) o).id)); } private int getNewCoverVariable(int id, boolean checked) { if (id == 7) { - if (checked) - return coverVariable & ~0x1; - else - return coverVariable | 0x1; + if (checked) return coverVariable & ~0x1; + else return coverVariable | 0x1; } - return (coverVariable & 0x1) | (id << 1) ; + return (coverVariable & 0x1) | (id << 1); } private boolean isEnabled(int id) { - if (id == 7) - return (coverVariable & 0x1) > 0; + if (id == 7) return (coverVariable & 0x1) > 0; return (coverVariable >>> 1) == id; } } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_PlayerDetector.java b/src/main/java/gregtech/common/covers/GT_Cover_PlayerDetector.java index 4bcb119e84..a0f2d830c0 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_PlayerDetector.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_PlayerDetector.java @@ -20,12 +20,14 @@ public class GT_Cover_PlayerDetector extends GT_CoverBehavior { private int range = 8; @Override - public boolean isRedstoneSensitive(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { + public boolean isRedstoneSensitive( + byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { return false; } @Override - public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { + public int doCoverThings( + byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { boolean playerDetected = false; if (aTileEntity instanceof IGregTechTileEntity) { @@ -40,7 +42,10 @@ public class GT_Cover_PlayerDetector extends GT_CoverBehavior { for (Object tObject : aTileEntity.getWorld().playerEntities) { if ((tObject instanceof EntityPlayerMP)) { EntityPlayerMP tEntity = (EntityPlayerMP) tObject; - int dist = Math.max(1, (int) tEntity.getDistance(aTileEntity.getXCoord() + 0.5D, aTileEntity.getYCoord() + 0.5D, aTileEntity.getZCoord() + 0.5D)); + int dist = Math.max(1, (int) tEntity.getDistance( + aTileEntity.getXCoord() + 0.5D, + aTileEntity.getYCoord() + 0.5D, + aTileEntity.getZCoord() + 0.5D)); if (dist < range) { if (aCoverVariable == 0) { playerDetected = true; @@ -59,22 +64,34 @@ public class GT_Cover_PlayerDetector extends GT_CoverBehavior { } } - aTileEntity.setOutputRedstoneSignal(aSide, (byte) (playerDetected ? 15 : 0)); return aCoverVariable; } @Override - public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { - aCoverVariable = (aCoverVariable + (aPlayer.isSneaking()? -1 : 1)) % 3; - if(aCoverVariable <0){aCoverVariable = 2;} - switch(aCoverVariable) { + public int onCoverScrewdriverclick( + byte aSide, + int aCoverID, + int aCoverVariable, + ICoverable aTileEntity, + EntityPlayer aPlayer, + float aX, + float aY, + float aZ) { + aCoverVariable = (aCoverVariable + (aPlayer.isSneaking() ? -1 : 1)) % 3; + if (aCoverVariable < 0) { + aCoverVariable = 2; + } + switch (aCoverVariable) { case 0: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("068", "Emit if any Player is close")); break; + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("068", "Emit if any Player is close")); + break; case 1: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("069", "Emit if other Player is close")); break; + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("069", "Emit if other Player is close")); + break; case 2: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("070", "Emit if you are close")); break; + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("070", "Emit if you are close")); + break; } return aCoverVariable; } @@ -110,7 +127,8 @@ public class GT_Cover_PlayerDetector extends GT_CoverBehavior { } @Override - public boolean manipulatesSidedRedstoneOutput(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + public boolean manipulatesSidedRedstoneOutput( + byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } @@ -121,14 +139,13 @@ public class GT_Cover_PlayerDetector extends GT_CoverBehavior { /** * GUI Stuff */ - @Override public boolean hasCoverGUI() { return true; } @Override - public Object getClientGUI(byte aSide, int aCoverID, int coverData, ICoverable aTileEntity) { + public Object getClientGUI(byte aSide, int aCoverID, int coverData, ICoverable aTileEntity) { return new GUI(aSide, aCoverID, coverData, aTileEntity); } @@ -150,23 +167,23 @@ public class GT_Cover_PlayerDetector extends GT_CoverBehavior { this.coverID = aCoverID; this.coverVariable = aCoverVariable; - new GT_GuiIconCheckButton(this, 0, startX + spaceX*0, startY+spaceY*0, GT_GuiIcon.CHECKMARK, null) + new GT_GuiIconCheckButton(this, 0, startX + spaceX * 0, startY + spaceY * 0, GT_GuiIcon.CHECKMARK, null) .setTooltipText(GT_Utility.trans("068", "Emit if any Player is close")); - new GT_GuiIconCheckButton(this, 1, startX + spaceX*0, startY+spaceY*1, GT_GuiIcon.CHECKMARK, null) + new GT_GuiIconCheckButton(this, 1, startX + spaceX * 0, startY + spaceY * 1, GT_GuiIcon.CHECKMARK, null) .setTooltipText(GT_Utility.trans("069", "Emit if other Player is close")); - new GT_GuiIconCheckButton(this, 2, startX + spaceX*0, startY+spaceY*2, GT_GuiIcon.CHECKMARK, null) + new GT_GuiIconCheckButton(this, 2, startX + spaceX * 0, startY + spaceY * 2, GT_GuiIcon.CHECKMARK, null) .setTooltipText(GT_Utility.trans("070", "Emit if you are close")); } @Override public void drawExtras(int mouseX, int mouseY, float parTicks) { super.drawExtras(mouseX, mouseY, parTicks); - this.fontRendererObj.drawString(GT_Utility.trans("319", "Any player"), - startX + spaceX*1, 4+startY+spaceY*0, textColor); - this.fontRendererObj.drawString(GT_Utility.trans("320", "Other players"), - startX + spaceX*1, 4+startY+spaceY*1, textColor); - this.fontRendererObj.drawString(GT_Utility.trans("321", "Only owner"), - startX + spaceX*1, 4+startY+spaceY*2, textColor); + this.fontRendererObj.drawString( + GT_Utility.trans("319", "Any player"), startX + spaceX * 1, 4 + startY + spaceY * 0, textColor); + this.fontRendererObj.drawString( + GT_Utility.trans("320", "Other players"), startX + spaceX * 1, 4 + startY + spaceY * 1, textColor); + this.fontRendererObj.drawString( + GT_Utility.trans("321", "Only owner"), startX + spaceX * 1, 4 + startY + spaceY * 2, textColor); } @Override @@ -175,15 +192,15 @@ public class GT_Cover_PlayerDetector extends GT_CoverBehavior { } @Override - public void buttonClicked(GuiButton btn){ - if (!isEnabled(btn.id)){ + public void buttonClicked(GuiButton btn) { + if (!isEnabled(btn.id)) { coverVariable = getNewCoverVariable(btn.id, ((GT_GuiIconCheckButton) btn).isChecked()); GT_Values.NW.sendToServer(new GT_Packet_TileEntityCover(side, coverID, coverVariable, tile)); } updateButtons(); } - private void updateButtons(){ + private void updateButtons() { for (Object o : buttonList) ((GT_GuiIconCheckButton) o).setChecked(isEnabled(((GT_GuiIconCheckButton) o).id)); } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Pump.java b/src/main/java/gregtech/common/covers/GT_Cover_Pump.java index e92f3f1370..269788cb6d 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Pump.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Pump.java @@ -16,7 +16,7 @@ import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.IFluidHandler; -public class GT_Cover_Pump extends GT_CoverBehavior{ +public class GT_Cover_Pump extends GT_CoverBehavior { public final int mTransferRate; public GT_Cover_Pump(int aTransferRate) { @@ -24,12 +24,14 @@ public class GT_Cover_Pump extends GT_CoverBehavior{ } @Override - public boolean isRedstoneSensitive(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { + public boolean isRedstoneSensitive( + byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { return false; } @Override - public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { + public int doCoverThings( + byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { if ((aCoverVariable % 6 > 1) && ((aTileEntity instanceof IMachineProgress))) { if (((IMachineProgress) aTileEntity).isAllowedToWork() != aCoverVariable % 6 < 4) { return aCoverVariable; @@ -38,24 +40,33 @@ public class GT_Cover_Pump extends GT_CoverBehavior{ if ((aTileEntity instanceof IFluidHandler)) { IFluidHandler tTank2 = aTileEntity.getITankContainerAtSide(aSide); if (tTank2 != null) { - //aTileEntity.decreaseStoredEnergyUnits(GT_Utility.getTier(this.mTransferRate), true); + // aTileEntity.decreaseStoredEnergyUnits(GT_Utility.getTier(this.mTransferRate), true); IFluidHandler tTank1 = (IFluidHandler) aTileEntity; if (aCoverVariable % 2 == 0) { FluidStack tLiquid = tTank1.drain(ForgeDirection.getOrientation(aSide), this.mTransferRate, false); if (tLiquid != null) { tLiquid = tLiquid.copy(); - tLiquid.amount = tTank2.fill(ForgeDirection.getOrientation(aSide).getOpposite(), tLiquid, false); + tLiquid.amount = + tTank2.fill(ForgeDirection.getOrientation(aSide).getOpposite(), tLiquid, false); if (tLiquid.amount > 0 && canTransferFluid(tLiquid)) { - tTank2.fill(ForgeDirection.getOrientation(aSide).getOpposite(), tTank1.drain(ForgeDirection.getOrientation(aSide), tLiquid.amount, true), true); + tTank2.fill( + ForgeDirection.getOrientation(aSide).getOpposite(), + tTank1.drain(ForgeDirection.getOrientation(aSide), tLiquid.amount, true), + true); } } } else { - FluidStack tLiquid = tTank2.drain(ForgeDirection.getOrientation(aSide).getOpposite(), this.mTransferRate, false); + FluidStack tLiquid = + tTank2.drain(ForgeDirection.getOrientation(aSide).getOpposite(), this.mTransferRate, false); if (tLiquid != null) { tLiquid = tLiquid.copy(); tLiquid.amount = tTank1.fill(ForgeDirection.getOrientation(aSide), tLiquid, false); if (tLiquid.amount > 0 && canTransferFluid(tLiquid)) { - tTank1.fill(ForgeDirection.getOrientation(aSide), tTank2.drain(ForgeDirection.getOrientation(aSide).getOpposite(), tLiquid.amount, true), true); + tTank1.fill( + ForgeDirection.getOrientation(aSide), + tTank2.drain( + ForgeDirection.getOrientation(aSide).getOpposite(), tLiquid.amount, true), + true); } } } @@ -69,34 +80,56 @@ public class GT_Cover_Pump extends GT_CoverBehavior{ } @Override - public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { - aCoverVariable = (aCoverVariable + (aPlayer.isSneaking()? -1 : 1)) % 12; - if(aCoverVariable <0){aCoverVariable = 11;} - switch(aCoverVariable) { - case 0: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("006", "Export")); break; - case 1: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("007", "Import")); break; - case 2: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("008", "Export (conditional)")); break; - case 3: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("009", "Import (conditional)")); break; - case 4: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("010", "Export (invert cond)")); break; - case 5: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("011", "Import (invert cond)")); break; - case 6: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("012", "Export allow Input")); break; - case 7: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("013", "Import allow Output")); break; - case 8: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("014", "Export allow Input (conditional)")); break; - case 9: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("015", "Import allow Output (conditional)")); break; - case 10: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("016", "Export allow Input (invert cond)")); break; - case 11: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("017", "Import allow Output (invert cond)")); break; + public int onCoverScrewdriverclick( + byte aSide, + int aCoverID, + int aCoverVariable, + ICoverable aTileEntity, + EntityPlayer aPlayer, + float aX, + float aY, + float aZ) { + aCoverVariable = (aCoverVariable + (aPlayer.isSneaking() ? -1 : 1)) % 12; + if (aCoverVariable < 0) { + aCoverVariable = 11; + } + switch (aCoverVariable) { + case 0: + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("006", "Export")); + break; + case 1: + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("007", "Import")); + break; + case 2: + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("008", "Export (conditional)")); + break; + case 3: + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("009", "Import (conditional)")); + break; + case 4: + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("010", "Export (invert cond)")); + break; + case 5: + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("011", "Import (invert cond)")); + break; + case 6: + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("012", "Export allow Input")); + break; + case 7: + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("013", "Import allow Output")); + break; + case 8: + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("014", "Export allow Input (conditional)")); + break; + case 9: + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("015", "Import allow Output (conditional)")); + break; + case 10: + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("016", "Export allow Input (invert cond)")); + break; + case 11: + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("017", "Import allow Output (invert cond)")); + break; } return aCoverVariable; } @@ -164,14 +197,13 @@ public class GT_Cover_Pump extends GT_CoverBehavior{ /** * GUI Stuff */ - @Override public boolean hasCoverGUI() { return true; } @Override - public Object getClientGUI(byte aSide, int aCoverID, int coverData, ICoverable aTileEntity) { + public Object getClientGUI(byte aSide, int aCoverID, int coverData, ICoverable aTileEntity) { return new GT_PumpGUICover(aSide, aCoverID, coverData, aTileEntity); } @@ -194,21 +226,31 @@ public class GT_Cover_Pump extends GT_CoverBehavior{ this.coverVariable = aCoverVariable; GT_GuiIconButton b; - b = new GT_GuiIconButton(this, 0, startX + spaceX*0, startY+spaceY*0, GT_GuiIcon.EXPORT).setTooltipText(GT_Utility.trans("006", "Export")); - b = new GT_GuiIconButton(this, 1, startX + spaceX*1, startY+spaceY*0, GT_GuiIcon.IMPORT).setTooltipText(GT_Utility.trans("007", "Import")); - b = new GT_GuiIconButton(this, 2, startX + spaceX*0, startY+spaceY*1, GT_GuiIcon.CHECKMARK).setTooltipText(GT_Utility.trans("224", "Always On")); - b = new GT_GuiIconButton(this, 3, startX + spaceX*1, startY+spaceY*1, GT_GuiIcon.REDSTONE_ON).setTooltipText(GT_Utility.trans("225", "Active with Redstone Signal")); - b = new GT_GuiIconButton(this, 4, startX + spaceX*2, startY+spaceY*1, GT_GuiIcon.REDSTONE_OFF).setTooltipText(GT_Utility.trans("226", "Inactive with Redstone Signal")); - b = new GT_GuiIconButton(this, 5, startX + spaceX*0, startY+spaceY*2, GT_GuiIcon.ALLOW_INPUT).setTooltipText(GT_Utility.trans("227", "Allow Input")); - b = new GT_GuiIconButton(this, 6, startX + spaceX*1, startY+spaceY*2, GT_GuiIcon.BLOCK_INPUT).setTooltipText(GT_Utility.trans("228", "Block Input")); + b = new GT_GuiIconButton(this, 0, startX + spaceX * 0, startY + spaceY * 0, GT_GuiIcon.EXPORT) + .setTooltipText(GT_Utility.trans("006", "Export")); + b = new GT_GuiIconButton(this, 1, startX + spaceX * 1, startY + spaceY * 0, GT_GuiIcon.IMPORT) + .setTooltipText(GT_Utility.trans("007", "Import")); + b = new GT_GuiIconButton(this, 2, startX + spaceX * 0, startY + spaceY * 1, GT_GuiIcon.CHECKMARK) + .setTooltipText(GT_Utility.trans("224", "Always On")); + b = new GT_GuiIconButton(this, 3, startX + spaceX * 1, startY + spaceY * 1, GT_GuiIcon.REDSTONE_ON) + .setTooltipText(GT_Utility.trans("225", "Active with Redstone Signal")); + b = new GT_GuiIconButton(this, 4, startX + spaceX * 2, startY + spaceY * 1, GT_GuiIcon.REDSTONE_OFF) + .setTooltipText(GT_Utility.trans("226", "Inactive with Redstone Signal")); + b = new GT_GuiIconButton(this, 5, startX + spaceX * 0, startY + spaceY * 2, GT_GuiIcon.ALLOW_INPUT) + .setTooltipText(GT_Utility.trans("227", "Allow Input")); + b = new GT_GuiIconButton(this, 6, startX + spaceX * 1, startY + spaceY * 2, GT_GuiIcon.BLOCK_INPUT) + .setTooltipText(GT_Utility.trans("228", "Block Input")); } @Override public void drawExtras(int mouseX, int mouseY, float parTicks) { super.drawExtras(mouseX, mouseY, parTicks); - this.fontRendererObj.drawString(GT_Utility.trans("229", "Import/Export"), startX + spaceX*3, 3+startY+spaceY*0, textColor); - this.fontRendererObj.drawString(GT_Utility.trans("230", "Conditional"), startX + spaceX*3, 3+startY+spaceY*1, textColor); - this.fontRendererObj.drawString(GT_Utility.trans("231", "Enable Input"), startX + spaceX*3, 3+startY+spaceY*2, textColor); + this.fontRendererObj.drawString( + GT_Utility.trans("229", "Import/Export"), startX + spaceX * 3, 3 + startY + spaceY * 0, textColor); + this.fontRendererObj.drawString( + GT_Utility.trans("230", "Conditional"), startX + spaceX * 3, 3 + startY + spaceY * 1, textColor); + this.fontRendererObj.drawString( + GT_Utility.trans("231", "Enable Input"), startX + spaceX * 3, 3 + startY + spaceY * 2, textColor); } @Override @@ -217,15 +259,15 @@ public class GT_Cover_Pump extends GT_CoverBehavior{ } @Override - public void buttonClicked(GuiButton btn){ - if (getClickable(btn.id)){ + public void buttonClicked(GuiButton btn) { + if (getClickable(btn.id)) { coverVariable = getNewCoverVariable(btn.id); GT_Values.NW.sendToServer(new GT_Packet_TileEntityCover(side, coverID, coverVariable, tile)); } updateButtons(); } - private void updateButtons(){ + private void updateButtons() { GuiButton b; for (Object o : buttonList) { b = (GuiButton) o; @@ -240,34 +282,29 @@ public class GT_Cover_Pump extends GT_CoverBehavior{ case 1: return coverVariable | 0x1; case 2: - if (coverVariable > 5) - return 0x6 | (coverVariable & ~0xE); + if (coverVariable > 5) return 0x6 | (coverVariable & ~0xE); return (coverVariable & ~0xE); case 3: - if (coverVariable > 5) - return 0x8 | (coverVariable & ~0xE); + if (coverVariable > 5) return 0x8 | (coverVariable & ~0xE); return 0x2 | (coverVariable & ~0xE); case 4: - if (coverVariable > 5) - return 0xA | (coverVariable & ~0xE); + if (coverVariable > 5) return 0xA | (coverVariable & ~0xE); return (0x4 | (coverVariable & ~0xE)); case 5: - if (coverVariable <= 5) - return coverVariable + 6; + if (coverVariable <= 5) return coverVariable + 6; break; case 6: - if (coverVariable > 5) - return coverVariable - 6; + if (coverVariable > 5) return coverVariable - 6; } return coverVariable; } private boolean getClickable(int id) { - if (coverVariable < 0 | 11 < coverVariable) - return false; + if (coverVariable < 0 | 11 < coverVariable) return false; switch (id) { - case 0: case 1: + case 0: + case 1: return (0x1 & coverVariable) != id; case 2: return (coverVariable % 6) >= 2; diff --git a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneConductor.java b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneConductor.java index d436d6ac2d..06e0ec4001 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneConductor.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneConductor.java @@ -8,39 +8,59 @@ import net.minecraftforge.fluids.Fluid; public class GT_Cover_RedstoneConductor extends GT_CoverBehavior { @Override - public boolean isRedstoneSensitive(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { + public boolean isRedstoneSensitive( + byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { return false; } @Override - public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { + public int doCoverThings( + byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { if (aCoverVariable == 0) { aTileEntity.setOutputRedstoneSignal(aSide, aTileEntity.getStrongestRedstone()); } else if (aCoverVariable < 7) { - aTileEntity.setOutputRedstoneSignal(aSide, aTileEntity.getInternalInputRedstoneSignal((byte) (aCoverVariable - 1))); + aTileEntity.setOutputRedstoneSignal( + aSide, aTileEntity.getInternalInputRedstoneSignal((byte) (aCoverVariable - 1))); } return aCoverVariable; } @Override - public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { - aCoverVariable = (aCoverVariable + (aPlayer.isSneaking()? -1 : 1)) % 7; - if(aCoverVariable <0){aCoverVariable = 6;} + public int onCoverScrewdriverclick( + byte aSide, + int aCoverID, + int aCoverVariable, + ICoverable aTileEntity, + EntityPlayer aPlayer, + float aX, + float aY, + float aZ) { + aCoverVariable = (aCoverVariable + (aPlayer.isSneaking() ? -1 : 1)) % 7; + if (aCoverVariable < 0) { + aCoverVariable = 6; + } switch (aCoverVariable) { case 0: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("071", "Conducts strongest Input")); break; + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("071", "Conducts strongest Input")); + break; case 1: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("072", "Conducts from bottom Input")); break; + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("072", "Conducts from bottom Input")); + break; case 2: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("073", "Conducts from top Input")); break; + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("073", "Conducts from top Input")); + break; case 3: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("074", "Conducts from north Input")); break; + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("074", "Conducts from north Input")); + break; case 4: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("075", "Conducts from south Input")); break; + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("075", "Conducts from south Input")); + break; case 5: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("076", "Conducts from west Input")); break; + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("076", "Conducts from west Input")); + break; case 6: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("077", "Conducts from east Input")); break; + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("077", "Conducts from east Input")); + break; } return aCoverVariable; } @@ -76,7 +96,8 @@ public class GT_Cover_RedstoneConductor extends GT_CoverBehavior { } @Override - public boolean manipulatesSidedRedstoneOutput(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + public boolean manipulatesSidedRedstoneOutput( + byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneReceiverExternal.java b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneReceiverExternal.java index a4649629d8..374f5a0a81 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneReceiverExternal.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneReceiverExternal.java @@ -5,18 +5,25 @@ import gregtech.api.interfaces.tileentity.ICoverable; public class GT_Cover_RedstoneReceiverExternal extends GT_Cover_RedstoneWirelessBase { @Override - public boolean isRedstoneSensitive(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { + public boolean isRedstoneSensitive( + byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { return false; } @Override - public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { - aTileEntity.setOutputRedstoneSignal(aSide, GregTech_API.sWirelessRedstone.get(Integer.valueOf(aCoverVariable)) == null ? 0 : ((Byte) GregTech_API.sWirelessRedstone.get(Integer.valueOf(aCoverVariable))).byteValue()); + public int doCoverThings( + byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { + aTileEntity.setOutputRedstoneSignal( + aSide, + GregTech_API.sWirelessRedstone.get(Integer.valueOf(aCoverVariable)) == null + ? 0 + : ((Byte) GregTech_API.sWirelessRedstone.get(Integer.valueOf(aCoverVariable))).byteValue()); return aCoverVariable; } @Override - public boolean manipulatesSidedRedstoneOutput(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + public boolean manipulatesSidedRedstoneOutput( + byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneReceiverInternal.java b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneReceiverInternal.java index 2173014509..61dcb5a602 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneReceiverInternal.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneReceiverInternal.java @@ -6,20 +6,23 @@ import gregtech.api.interfaces.tileentity.IMachineProgress; public class GT_Cover_RedstoneReceiverInternal extends GT_Cover_RedstoneWirelessBase { @Override - public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { + public int doCoverThings( + byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { if (aTileEntity instanceof IMachineProgress) { - if (getRedstoneInput(aSide, aInputRedstone, aCoverID, aCoverVariable, aTileEntity) >0) + if (getRedstoneInput(aSide, aInputRedstone, aCoverID, aCoverVariable, aTileEntity) > 0) ((IMachineProgress) aTileEntity).enableWorking(); - else - ((IMachineProgress) aTileEntity).disableWorking(); + else ((IMachineProgress) aTileEntity).disableWorking(); ((IMachineProgress) aTileEntity).setWorkDataValue(aInputRedstone); } return aCoverVariable; } @Override - public byte getRedstoneInput(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - return GregTech_API.sWirelessRedstone.get(Integer.valueOf(aCoverVariable)) == null ? 0 : ((Byte) GregTech_API.sWirelessRedstone.get(Integer.valueOf(aCoverVariable))).byteValue(); + public byte getRedstoneInput( + byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + return GregTech_API.sWirelessRedstone.get(Integer.valueOf(aCoverVariable)) == null + ? 0 + : ((Byte) GregTech_API.sWirelessRedstone.get(Integer.valueOf(aCoverVariable))).byteValue(); } @Override diff --git a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneSignalizer.java b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneSignalizer.java index 4b94d11a2b..d4ec0a82d6 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneSignalizer.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneSignalizer.java @@ -9,20 +9,34 @@ import net.minecraftforge.fluids.Fluid; public class GT_Cover_RedstoneSignalizer extends GT_CoverBehavior { @Override - public boolean isRedstoneSensitive(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { + public boolean isRedstoneSensitive( + byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { return false; } @Override - public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public int onCoverScrewdriverclick( + byte aSide, + int aCoverID, + int aCoverVariable, + ICoverable aTileEntity, + EntityPlayer aPlayer, + float aX, + float aY, + float aZ) { aCoverVariable = (aCoverVariable + 1) % 48; - switch(aCoverVariable / 16) { + switch (aCoverVariable / 16) { case 0: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("078", "Signal = ") + (aCoverVariable & 0xF)); break; + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("078", "Signal = ") + (aCoverVariable & 0xF)); + break; case 1: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("079", "Conditional Signal = ") + (aCoverVariable & 0xF)); break; + GT_Utility.sendChatToPlayer( + aPlayer, GT_Utility.trans("079", "Conditional Signal = ") + (aCoverVariable & 0xF)); + break; case 2: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("080", "Inverted Conditional Signal = ") + (aCoverVariable & 0xF)); break; + GT_Utility.sendChatToPlayer( + aPlayer, GT_Utility.trans("080", "Inverted Conditional Signal = ") + (aCoverVariable & 0xF)); + break; } return aCoverVariable; } @@ -63,7 +77,8 @@ public class GT_Cover_RedstoneSignalizer extends GT_CoverBehavior { } @Override - public byte getRedstoneInput(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + public byte getRedstoneInput( + byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { if (aCoverVariable < 16) { return (byte) (aCoverVariable & 0xF); } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneTransmitterExternal.java b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneTransmitterExternal.java index cd8f1f4ffc..0c89d7e6e4 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneTransmitterExternal.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneTransmitterExternal.java @@ -5,7 +5,8 @@ import gregtech.api.interfaces.tileentity.ICoverable; public class GT_Cover_RedstoneTransmitterExternal extends GT_Cover_RedstoneWirelessBase { @Override - public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { + public int doCoverThings( + byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { GregTech_API.sWirelessRedstone.put(Integer.valueOf(aCoverVariable), Byte.valueOf(aInputRedstone)); return aCoverVariable; } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneTransmitterInternal.java b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneTransmitterInternal.java index 94741f6b36..0003e063b3 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneTransmitterInternal.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneTransmitterInternal.java @@ -5,13 +5,16 @@ import gregtech.api.interfaces.tileentity.ICoverable; public class GT_Cover_RedstoneTransmitterInternal extends GT_Cover_RedstoneWirelessBase { @Override - public boolean isRedstoneSensitive(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { + public boolean isRedstoneSensitive( + byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { return false; } @Override - public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { - GregTech_API.sWirelessRedstone.put(Integer.valueOf(aCoverVariable), Byte.valueOf(aTileEntity.getOutputRedstoneSignal(aSide))); + public int doCoverThings( + byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { + GregTech_API.sWirelessRedstone.put( + Integer.valueOf(aCoverVariable), Byte.valueOf(aTileEntity.getOutputRedstoneSignal(aSide))); return aCoverVariable; } @@ -26,7 +29,8 @@ public class GT_Cover_RedstoneTransmitterInternal extends GT_Cover_RedstoneWirel } @Override - public boolean manipulatesSidedRedstoneOutput(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + public boolean manipulatesSidedRedstoneOutput( + byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneWirelessBase.java b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneWirelessBase.java index b60270ea58..02f4786dee 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneWirelessBase.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneWirelessBase.java @@ -24,16 +24,26 @@ public abstract class GT_Cover_RedstoneWirelessBase extends GT_CoverBehavior { private static final int CHECKBOX_MASK = 0x00010000; @Override - public boolean onCoverRemoval(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, boolean aForced) { + public boolean onCoverRemoval( + byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, boolean aForced) { GregTech_API.sWirelessRedstone.put(aCoverVariable, (byte) 0); return true; } @Override - protected boolean onCoverRightClickImpl(byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { + protected boolean onCoverRightClickImpl( + byte aSide, + int aCoverID, + ISerializableObject.LegacyCoverData aCoverVariable, + ICoverable aTileEntity, + EntityPlayer aPlayer, + float aX, + float aY, + float aZ) { if (((aX > 0.375D) && (aX < 0.625D)) || ((aSide > 3) && ((aY > 0.375D) && (aY < 0.625D)))) { GregTech_API.sWirelessRedstone.put(aCoverVariable.get(), (byte) 0); - aCoverVariable.set((aCoverVariable.get() & (PRIVATE_MASK | CHECKBOX_MASK)) | (((Integer)GT_Utility.stackToInt(aPlayer.inventory.getCurrentItem())).hashCode() & PUBLIC_MASK)); + aCoverVariable.set((aCoverVariable.get() & (PRIVATE_MASK | CHECKBOX_MASK)) + | (((Integer) GT_Utility.stackToInt(aPlayer.inventory.getCurrentItem())).hashCode() & PUBLIC_MASK)); GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("081", "Frequency: ") + aCoverVariable); return true; } @@ -42,24 +52,43 @@ public abstract class GT_Cover_RedstoneWirelessBase extends GT_CoverBehavior { @Override @SuppressWarnings("deprecation") - public boolean onCoverRightclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onCoverRightclick( + byte aSide, + int aCoverID, + int aCoverVariable, + ICoverable aTileEntity, + EntityPlayer aPlayer, + float aX, + float aY, + float aZ) { if (((aX > 0.375D) && (aX < 0.625D)) || ((aSide > 3) && ((aY > 0.375D) && (aY < 0.625D)))) { GregTech_API.sWirelessRedstone.put(aCoverVariable, (byte) 0); - int val = GT_Utility.stackToInt(aPlayer.inventory.getCurrentItem()) * (1 + aPlayer.inventory.getCurrentItem().getItemDamage()); + int val = GT_Utility.stackToInt(aPlayer.inventory.getCurrentItem()) + * (1 + aPlayer.inventory.getCurrentItem().getItemDamage()); aCoverVariable = (aCoverVariable & (PRIVATE_MASK | CHECKBOX_MASK)) | (val & PUBLIC_MASK); aTileEntity.setCoverDataAtSide(aSide, aCoverVariable); - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("081", "Frequency: ") + (aCoverVariable & PUBLIC_MASK)); + GT_Utility.sendChatToPlayer( + aPlayer, GT_Utility.trans("081", "Frequency: ") + (aCoverVariable & PUBLIC_MASK)); return true; } return false; } @Override - public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { - if (((aX > 0.375D) && (aX < 0.625D)) || ((aSide <= 3) || (((aY > 0.375D) && (aY < 0.625D)) || ((((aZ <= 0.375D) || (aZ >= 0.625D))))))) { + public int onCoverScrewdriverclick( + byte aSide, + int aCoverID, + int aCoverVariable, + ICoverable aTileEntity, + EntityPlayer aPlayer, + float aX, + float aY, + float aZ) { + if (((aX > 0.375D) && (aX < 0.625D)) + || ((aSide <= 3) || (((aY > 0.375D) && (aY < 0.625D)) || ((((aZ <= 0.375D) || (aZ >= 0.625D))))))) { GregTech_API.sWirelessRedstone.put(aCoverVariable, (byte) 0); float[] tCoords = GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ); @@ -83,11 +112,9 @@ public abstract class GT_Cover_RedstoneWirelessBase extends GT_CoverBehavior { if (tPublicChannel < 0) { aCoverVariable = aCoverVariable & ~PUBLIC_MASK; - } - else if (tPublicChannel > MAX_CHANNEL) { + } else if (tPublicChannel > MAX_CHANNEL) { aCoverVariable = (aCoverVariable & (PRIVATE_MASK | CHECKBOX_MASK)) | MAX_CHANNEL; - } - else { + } else { aCoverVariable = (aCoverVariable & (PRIVATE_MASK | CHECKBOX_MASK)) | tPublicChannel; } } @@ -137,14 +164,13 @@ public abstract class GT_Cover_RedstoneWirelessBase extends GT_CoverBehavior { /** * GUI Stuff */ - @Override public boolean hasCoverGUI() { return true; } @Override - public Object getClientGUI(byte aSide, int aCoverID, int coverData, ICoverable aTileEntity) { + public Object getClientGUI(byte aSide, int aCoverID, int coverData, ICoverable aTileEntity) { return new GUI(aSide, aCoverID, coverData, aTileEntity); } @@ -167,19 +193,30 @@ public abstract class GT_Cover_RedstoneWirelessBase extends GT_CoverBehavior { this.coverID = aCoverID; this.coverVariable = aCoverVariable; - fBox = new GT_GuiShortTextBox(this, 2,startX + spaceX*0,startY+spaceY*0 + 2, spaceX*4-3,12); + fBox = new GT_GuiShortTextBox(this, 2, startX + spaceX * 0, startY + spaceY * 0 + 2, spaceX * 4 - 3, 12); fBox.setText(String.valueOf(coverVariable & PUBLIC_MASK)); fBox.setMaxStringLength(12); GuiButton b; - b = new GT_GuiIconCheckButton(this, 0, startX + spaceX * 0, startY + spaceY * 2, GT_GuiIcon.CHECKMARK, null); + b = new GT_GuiIconCheckButton( + this, 0, startX + spaceX * 0, startY + spaceY * 2, GT_GuiIcon.CHECKMARK, null); } @Override public void drawExtras(int mouseX, int mouseY, float parTicks) { super.drawExtras(mouseX, mouseY, parTicks); - this.getFontRenderer().drawString(GT_Utility.trans("246", "Frequency"), startX + spaceX*4, 4+startY+spaceY*0, textColor); - this.getFontRenderer().drawString(GT_Utility.trans("601", "Use Private Frequency"), startX + spaceX * 1, startY + spaceY * 2 + 4, textColor); + this.getFontRenderer() + .drawString( + GT_Utility.trans("246", "Frequency"), + startX + spaceX * 4, + 4 + startY + spaceY * 0, + textColor); + this.getFontRenderer() + .drawString( + GT_Utility.trans("601", "Use Private Frequency"), + startX + spaceX * 1, + startY + spaceY * 2 + 4, + textColor); } @Override @@ -190,7 +227,7 @@ public abstract class GT_Cover_RedstoneWirelessBase extends GT_CoverBehavior { @Override public void onMouseWheel(int x, int y, int delta) { - for (GT_GuiIntegerTextBox box : textBoxes){ + for (GT_GuiIntegerTextBox box : textBoxes) { if (box.isFocused()) { int step = Math.max(1, Math.abs(delta / 120)); step = (isShiftKeyDown() ? 1000 : isCtrlKeyDown() ? 50 : 1) * (delta > 0 ? step : -step); @@ -201,10 +238,8 @@ public abstract class GT_Cover_RedstoneWirelessBase extends GT_CoverBehavior { return; } tCoverVariable = tCoverVariable + step; - if (tCoverVariable > MAX_CHANNEL) - tCoverVariable = MAX_CHANNEL; - else if (tCoverVariable < 0) - tCoverVariable = 0; + if (tCoverVariable > MAX_CHANNEL) tCoverVariable = MAX_CHANNEL; + else if (tCoverVariable < 0) tCoverVariable = 0; box.setText(String.valueOf(tCoverVariable)); return; @@ -223,17 +258,16 @@ public abstract class GT_Cover_RedstoneWirelessBase extends GT_CoverBehavior { return; } - if (tPublicChannel > MAX_CHANNEL) - tPublicChannel = MAX_CHANNEL; - else if (tPublicChannel < 0) - tPublicChannel = 0; + if (tPublicChannel > MAX_CHANNEL) tPublicChannel = MAX_CHANNEL; + else if (tPublicChannel < 0) tPublicChannel = 0; - int tCheckBoxValue = ((GT_GuiIconCheckButton)this.buttonList.get(0)).isChecked() ? CHECKBOX_MASK : 0; + int tCheckBoxValue = ((GT_GuiIconCheckButton) this.buttonList.get(0)).isChecked() ? CHECKBOX_MASK : 0; coverVariable = tCheckBoxValue | tPublicChannel; fBox.setText(Integer.toString(tPublicChannel)); - GT_Values.NW.sendToServer(new GT_Packet_WirelessRedstoneCover(side, coverID, tile, tPublicChannel, tCheckBoxValue)); + GT_Values.NW.sendToServer( + new GT_Packet_WirelessRedstoneCover(side, coverID, tile, tPublicChannel, tCheckBoxValue)); } @Override @@ -259,7 +293,8 @@ public abstract class GT_Cover_RedstoneWirelessBase extends GT_CoverBehavior { coverVariable = tCheckBoxValue | tPublicChannel; - GT_Values.NW.sendToServer(new GT_Packet_WirelessRedstoneCover(side, coverID, tile, tPublicChannel, tCheckBoxValue)); + GT_Values.NW.sendToServer( + new GT_Packet_WirelessRedstoneCover(side, coverID, tile, tPublicChannel, tCheckBoxValue)); } private class GT_GuiShortTextBox extends GT_GuiIntegerTextBox { @@ -272,8 +307,7 @@ public abstract class GT_Cover_RedstoneWirelessBase extends GT_CoverBehavior { public boolean textboxKeyTyped(char c, int key) { int tValue = 0; - if(!super.textboxKeyTyped(c, key)) - return false; + if (!super.textboxKeyTyped(c, key)) return false; int cursorPos = this.getCursorPosition(); @@ -281,12 +315,11 @@ public abstract class GT_Cover_RedstoneWirelessBase extends GT_CoverBehavior { if (tText.length() > 0) { try { tValue = Integer.parseInt(tText); - } catch (NumberFormatException ignored) {} + } catch (NumberFormatException ignored) { + } - if (tValue > MAX_CHANNEL) - setText(String.valueOf(MAX_CHANNEL)); - else - setText(String.valueOf(tValue)); + if (tValue > MAX_CHANNEL) setText(String.valueOf(MAX_CHANNEL)); + else setText(String.valueOf(tValue)); setCursorPosition(cursorPos); } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Screen.java b/src/main/java/gregtech/common/covers/GT_Cover_Screen.java index c0de124a7a..393f5ee4b4 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Screen.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Screen.java @@ -7,7 +7,8 @@ import net.minecraftforge.fluids.Fluid; public class GT_Cover_Screen extends GT_CoverBehavior { @Override - public boolean isRedstoneSensitive(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { + public boolean isRedstoneSensitive( + byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { return false; } @@ -62,22 +63,33 @@ public class GT_Cover_Screen extends GT_CoverBehavior { } @Override - public boolean manipulatesSidedRedstoneOutput(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + public boolean manipulatesSidedRedstoneOutput( + byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return false; } @Override - public boolean onCoverRightclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onCoverRightclick( + byte aSide, + int aCoverID, + int aCoverVariable, + ICoverable aTileEntity, + EntityPlayer aPlayer, + float aX, + float aY, + float aZ) { return false; } @Override - public boolean onCoverRemoval(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, boolean aForced) { + public boolean onCoverRemoval( + byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, boolean aForced) { return true; } @Override - public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { + public int doCoverThings( + byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { return 0; } } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Shutter.java b/src/main/java/gregtech/common/covers/GT_Cover_Shutter.java index bf6ecc3a56..9a2ceac09b 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Shutter.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Shutter.java @@ -17,17 +17,27 @@ import net.minecraftforge.fluids.Fluid; public class GT_Cover_Shutter extends GT_CoverBehavior { @Override - public boolean isRedstoneSensitive(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { + public boolean isRedstoneSensitive( + byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { return false; } @Override - public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { + public int doCoverThings( + byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { return aCoverVariable; } @Override - public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public int onCoverScrewdriverclick( + byte aSide, + int aCoverID, + int aCoverVariable, + ICoverable aTileEntity, + EntityPlayer aPlayer, + float aX, + float aY, + float aZ) { aCoverVariable = (aCoverVariable + (aPlayer.isSneaking() ? -1 : 1)) % 4; if (aCoverVariable < 0) { aCoverVariable = 3; @@ -54,42 +64,66 @@ public class GT_Cover_Shutter extends GT_CoverBehavior { @Override public boolean letsRedstoneGoIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - return aCoverVariable >= 2 ? aCoverVariable == 3 : !(aTileEntity instanceof IMachineProgress) || (((IMachineProgress) aTileEntity).isAllowedToWork() == (aCoverVariable % 2 == 0)); + return aCoverVariable >= 2 + ? aCoverVariable == 3 + : !(aTileEntity instanceof IMachineProgress) + || (((IMachineProgress) aTileEntity).isAllowedToWork() == (aCoverVariable % 2 == 0)); } @Override public boolean letsRedstoneGoOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - return aCoverVariable >= 2 ? aCoverVariable == 2 : !(aTileEntity instanceof IMachineProgress) || (((IMachineProgress) aTileEntity).isAllowedToWork() == (aCoverVariable % 2 == 0)); + return aCoverVariable >= 2 + ? aCoverVariable == 2 + : !(aTileEntity instanceof IMachineProgress) + || (((IMachineProgress) aTileEntity).isAllowedToWork() == (aCoverVariable % 2 == 0)); } @Override public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - return aCoverVariable >= 2 ? aCoverVariable == 3 : !(aTileEntity instanceof IMachineProgress) || (((IMachineProgress) aTileEntity).isAllowedToWork() == (aCoverVariable % 2 == 0)); + return aCoverVariable >= 2 + ? aCoverVariable == 3 + : !(aTileEntity instanceof IMachineProgress) + || (((IMachineProgress) aTileEntity).isAllowedToWork() == (aCoverVariable % 2 == 0)); } @Override public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - return aCoverVariable >= 2 ? aCoverVariable == 2 : !(aTileEntity instanceof IMachineProgress) || ((IMachineProgress) aTileEntity).isAllowedToWork() == (aCoverVariable % 2 == 0); + return aCoverVariable >= 2 + ? aCoverVariable == 2 + : !(aTileEntity instanceof IMachineProgress) + || ((IMachineProgress) aTileEntity).isAllowedToWork() == (aCoverVariable % 2 == 0); } @Override public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { - return aCoverVariable >= 2 ? aCoverVariable == 3 : !(aTileEntity instanceof IMachineProgress) || ((IMachineProgress) aTileEntity).isAllowedToWork() == (aCoverVariable % 2 == 0); + return aCoverVariable >= 2 + ? aCoverVariable == 3 + : !(aTileEntity instanceof IMachineProgress) + || ((IMachineProgress) aTileEntity).isAllowedToWork() == (aCoverVariable % 2 == 0); } @Override public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { - return aCoverVariable >= 2 ? aCoverVariable == 2 : !(aTileEntity instanceof IMachineProgress) || ((IMachineProgress) aTileEntity).isAllowedToWork() == (aCoverVariable % 2 == 0); + return aCoverVariable >= 2 + ? aCoverVariable == 2 + : !(aTileEntity instanceof IMachineProgress) + || ((IMachineProgress) aTileEntity).isAllowedToWork() == (aCoverVariable % 2 == 0); } @Override public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) { - return aCoverVariable >= 2 ? aCoverVariable == 3 : !(aTileEntity instanceof IMachineProgress) || ((IMachineProgress) aTileEntity).isAllowedToWork() == (aCoverVariable % 2 == 0); + return aCoverVariable >= 2 + ? aCoverVariable == 3 + : !(aTileEntity instanceof IMachineProgress) + || ((IMachineProgress) aTileEntity).isAllowedToWork() == (aCoverVariable % 2 == 0); } @Override public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) { - return aCoverVariable >= 2 ? aCoverVariable == 2 : !(aTileEntity instanceof IMachineProgress) || ((IMachineProgress) aTileEntity).isAllowedToWork() == (aCoverVariable % 2 == 0); + return aCoverVariable >= 2 + ? aCoverVariable == 2 + : !(aTileEntity instanceof IMachineProgress) + || ((IMachineProgress) aTileEntity).isAllowedToWork() == (aCoverVariable % 2 == 0); } @Override @@ -105,14 +139,13 @@ public class GT_Cover_Shutter extends GT_CoverBehavior { /** * GUI Stuff */ - @Override public boolean hasCoverGUI() { return true; } @Override - public Object getClientGUI(byte aSide, int aCoverID, int coverData, ICoverable aTileEntity) { + public Object getClientGUI(byte aSide, int aCoverID, int coverData, ICoverable aTileEntity) { return new GUI(aSide, aCoverID, coverData, aTileEntity); } @@ -134,23 +167,35 @@ public class GT_Cover_Shutter extends GT_CoverBehavior { this.coverID = aCoverID; this.coverVariable = aCoverVariable; - new GT_GuiIconCheckButton(this, 0, startX + spaceX*0, startY+spaceY*0, GT_GuiIcon.CHECKMARK, null); - new GT_GuiIconCheckButton(this, 1, startX + spaceX*0, startY+spaceY*1, GT_GuiIcon.CHECKMARK, null); - new GT_GuiIconCheckButton(this, 2, startX + spaceX*0, startY+spaceY*2, GT_GuiIcon.CHECKMARK, null); - new GT_GuiIconCheckButton(this, 3, startX + spaceX*0, startY+spaceY*3, GT_GuiIcon.CHECKMARK, null); + new GT_GuiIconCheckButton(this, 0, startX + spaceX * 0, startY + spaceY * 0, GT_GuiIcon.CHECKMARK, null); + new GT_GuiIconCheckButton(this, 1, startX + spaceX * 0, startY + spaceY * 1, GT_GuiIcon.CHECKMARK, null); + new GT_GuiIconCheckButton(this, 2, startX + spaceX * 0, startY + spaceY * 2, GT_GuiIcon.CHECKMARK, null); + new GT_GuiIconCheckButton(this, 3, startX + spaceX * 0, startY + spaceY * 3, GT_GuiIcon.CHECKMARK, null); } @Override public void drawExtras(int mouseX, int mouseY, float parTicks) { super.drawExtras(mouseX, mouseY, parTicks); - this.fontRendererObj.drawString(GT_Utility.trans("082", "Open if work enabled"), - 3+startX + spaceX*1, 4+startY+spaceY*0, textColor); - this.fontRendererObj.drawString(GT_Utility.trans("083", "Open if work disabled"), - 3+startX + spaceX*1, 4+startY+spaceY*1, textColor); - this.fontRendererObj.drawString(GT_Utility.trans("084", "Only Output allowed"), - 3+startX + spaceX*1, 4+startY+spaceY*2, textColor); - this.fontRendererObj.drawString(GT_Utility.trans("085", "Only Input allowed"), - 3+startX + spaceX*1, 4+startY+spaceY*3, textColor); + this.fontRendererObj.drawString( + GT_Utility.trans("082", "Open if work enabled"), + 3 + startX + spaceX * 1, + 4 + startY + spaceY * 0, + textColor); + this.fontRendererObj.drawString( + GT_Utility.trans("083", "Open if work disabled"), + 3 + startX + spaceX * 1, + 4 + startY + spaceY * 1, + textColor); + this.fontRendererObj.drawString( + GT_Utility.trans("084", "Only Output allowed"), + 3 + startX + spaceX * 1, + 4 + startY + spaceY * 2, + textColor); + this.fontRendererObj.drawString( + GT_Utility.trans("085", "Only Input allowed"), + 3 + startX + spaceX * 1, + 4 + startY + spaceY * 3, + textColor); } @Override @@ -159,15 +204,15 @@ public class GT_Cover_Shutter extends GT_CoverBehavior { } @Override - public void buttonClicked(GuiButton btn){ - if (!isEnabled(btn.id)){ + public void buttonClicked(GuiButton btn) { + if (!isEnabled(btn.id)) { coverVariable = getNewCoverVariable(btn.id, ((GT_GuiIconCheckButton) btn).isChecked()); GT_Values.NW.sendToServer(new GT_Packet_TileEntityCover(side, coverID, coverVariable, tile)); } updateButtons(); } - private void updateButtons(){ + private void updateButtons() { for (Object o : buttonList) ((GT_GuiIconCheckButton) o).setChecked(isEnabled(((GT_GuiIconCheckButton) o).id)); } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_SolarPanel.java b/src/main/java/gregtech/common/covers/GT_Cover_SolarPanel.java index 09a9d5ab69..de1a0c7617 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_SolarPanel.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_SolarPanel.java @@ -1,5 +1,7 @@ package gregtech.common.covers; +import static gregtech.api.objects.XSTR.XSTR_INSTANCE; + import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.util.GT_CoverBehavior; import gregtech.api.util.GT_Utility; @@ -8,8 +10,6 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; -import static gregtech.api.objects.XSTR.XSTR_INSTANCE; - public class GT_Cover_SolarPanel extends GT_CoverBehavior { private final int mVoltage; @@ -18,88 +18,107 @@ public class GT_Cover_SolarPanel extends GT_CoverBehavior { } @Override - public boolean isRedstoneSensitive(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { + public boolean isRedstoneSensitive( + byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { return false; } @Override - public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { - if(aSide != 1)return 0; - int coverState=aCoverVariable&0x3; - int coverNum=aCoverVariable>>2; + public int doCoverThings( + byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { + if (aSide != 1) return 0; + int coverState = aCoverVariable & 0x3; + int coverNum = aCoverVariable >> 2; if (aTimer % 100L == 0L) { if (aTileEntity.getWorld().isThundering()) { - return aTileEntity.getBiome().rainfall > 0.0F && aTileEntity.getSkyAtSide(aSide) ? Math.min(20,coverNum)<<2 : coverNum<<2; + return aTileEntity.getBiome().rainfall > 0.0F && aTileEntity.getSkyAtSide(aSide) + ? Math.min(20, coverNum) << 2 + : coverNum << 2; } else { - if(aTileEntity.getWorld().isRaining() && aTileEntity.getBiome().rainfall > 0.0F){//really rains - if(aTileEntity.getSkyAtSide(aSide)) coverNum=Math.min(30,coverNum); - if(aTileEntity.getWorld().skylightSubtracted >= 4){ - if(aTileEntity.getWorld().isDaytime()){ - coverState=2; - }else{ - return coverNum<<2; + if (aTileEntity.getWorld().isRaining() && aTileEntity.getBiome().rainfall > 0.0F) { // really rains + if (aTileEntity.getSkyAtSide(aSide)) coverNum = Math.min(30, coverNum); + if (aTileEntity.getWorld().skylightSubtracted >= 4) { + if (aTileEntity.getWorld().isDaytime()) { + coverState = 2; + } else { + return coverNum << 2; } } - }else{//not rains - if(aTileEntity.getWorld().isDaytime()){ - coverState=1; - }else{ - coverState=2; + } else { // not rains + if (aTileEntity.getWorld().isDaytime()) { + coverState = 1; + } else { + coverState = 2; } } } } - if (coverState == 1 ) { - aTileEntity.injectEnergyUnits((byte) 6, ((100L-(long)coverNum)*((long)this.mVoltage))/100L, 1L); - + if (coverState == 1) { + aTileEntity.injectEnergyUnits((byte) 6, ((100L - (long) coverNum) * ((long) this.mVoltage)) / 100L, 1L); } - if(aTimer % 28800L == 0L && coverNum<100 && (coverNum>10 || XSTR_INSTANCE.nextInt(3)==2)) - coverNum++; - return coverState+(coverNum<<2); + if (aTimer % 28800L == 0L && coverNum < 100 && (coverNum > 10 || XSTR_INSTANCE.nextInt(3) == 2)) coverNum++; + return coverState + (coverNum << 2); } @Override - protected boolean onCoverRightClickImpl(byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { - if(aPlayer.capabilities.isCreativeMode){ - GT_Utility.sendChatToPlayer(aPlayer,"Cleaned solar panel from "+(aCoverVariable.get()>>2)+"% dirt"); - aCoverVariable.set(aCoverVariable.get() & 0x3); + protected boolean onCoverRightClickImpl( + byte aSide, + int aCoverID, + ISerializableObject.LegacyCoverData aCoverVariable, + ICoverable aTileEntity, + EntityPlayer aPlayer, + float aX, + float aY, + float aZ) { + if (aPlayer.capabilities.isCreativeMode) { + GT_Utility.sendChatToPlayer(aPlayer, "Cleaned solar panel from " + (aCoverVariable.get() >> 2) + "% dirt"); + aCoverVariable.set(aCoverVariable.get() & 0x3); return true; } - for(int i=0;i<aPlayer.inventory.mainInventory.length;i++){ - ItemStack is=aPlayer.inventory.mainInventory[i]; - if(is==null) continue; - if(is.getUnlocalizedName().equals(new ItemStack(Items.water_bucket).getUnlocalizedName())){ - aPlayer.inventory.mainInventory[i]=new ItemStack(Items.bucket); + for (int i = 0; i < aPlayer.inventory.mainInventory.length; i++) { + ItemStack is = aPlayer.inventory.mainInventory[i]; + if (is == null) continue; + if (is.getUnlocalizedName().equals(new ItemStack(Items.water_bucket).getUnlocalizedName())) { + aPlayer.inventory.mainInventory[i] = new ItemStack(Items.bucket); if (aPlayer.inventoryContainer != null) aPlayer.inventoryContainer.detectAndSendChanges(); - GT_Utility.sendChatToPlayer(aPlayer,"Cleaned solar panel from "+(aCoverVariable.get()>>2)+"% dirt"); + GT_Utility.sendChatToPlayer( + aPlayer, "Cleaned solar panel from " + (aCoverVariable.get() >> 2) + "% dirt"); aCoverVariable.set(aCoverVariable.get() & 0x3); return true; } } - GT_Utility.sendChatToPlayer(aPlayer,"You need water bucket in inventory to clean the panel."); + GT_Utility.sendChatToPlayer(aPlayer, "You need water bucket in inventory to clean the panel."); return false; } @Override @SuppressWarnings("deprecation") - public boolean onCoverRightclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { - if(aPlayer.capabilities.isCreativeMode){ - GT_Utility.sendChatToPlayer(aPlayer,"Cleaned solar panel from "+(aCoverVariable>>2)+"% dirt"); + public boolean onCoverRightclick( + byte aSide, + int aCoverID, + int aCoverVariable, + ICoverable aTileEntity, + EntityPlayer aPlayer, + float aX, + float aY, + float aZ) { + if (aPlayer.capabilities.isCreativeMode) { + GT_Utility.sendChatToPlayer(aPlayer, "Cleaned solar panel from " + (aCoverVariable >> 2) + "% dirt"); aTileEntity.setCoverDataAtSide(aSide, (aCoverVariable & 0x3)); return true; } - for(int i=0;i<aPlayer.inventory.mainInventory.length;i++){ - ItemStack is=aPlayer.inventory.mainInventory[i]; - if(is==null) continue; - if(is.getUnlocalizedName().equals(new ItemStack(Items.water_bucket).getUnlocalizedName())){ - aPlayer.inventory.mainInventory[i]=new ItemStack(Items.bucket); + for (int i = 0; i < aPlayer.inventory.mainInventory.length; i++) { + ItemStack is = aPlayer.inventory.mainInventory[i]; + if (is == null) continue; + if (is.getUnlocalizedName().equals(new ItemStack(Items.water_bucket).getUnlocalizedName())) { + aPlayer.inventory.mainInventory[i] = new ItemStack(Items.bucket); if (aPlayer.inventoryContainer != null) aPlayer.inventoryContainer.detectAndSendChanges(); - GT_Utility.sendChatToPlayer(aPlayer,"Cleaned solar panel from "+(aCoverVariable>>2)+"% dirt"); + GT_Utility.sendChatToPlayer(aPlayer, "Cleaned solar panel from " + (aCoverVariable >> 2) + "% dirt"); aTileEntity.setCoverDataAtSide(aSide, (aCoverVariable & 0x3)); return true; } } - GT_Utility.sendChatToPlayer(aPlayer,"You need water bucket in inventory to clean the panel."); + GT_Utility.sendChatToPlayer(aPlayer, "You need water bucket in inventory to clean the panel."); return false; } @@ -107,7 +126,7 @@ public class GT_Cover_SolarPanel extends GT_CoverBehavior { public boolean alwaysLookConnected(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } - + @Override public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return 1; diff --git a/src/main/java/gregtech/common/covers/GT_Cover_SteamValve.java b/src/main/java/gregtech/common/covers/GT_Cover_SteamValve.java index 8d4ac949b7..068576e8ca 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_SteamValve.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_SteamValve.java @@ -11,7 +11,8 @@ public class GT_Cover_SteamValve extends GT_Cover_Pump { } @Override - public boolean isRedstoneSensitive(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { + public boolean isRedstoneSensitive( + byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { return false; } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Vent.java b/src/main/java/gregtech/common/covers/GT_Cover_Vent.java index f6b9afa005..1208816d7d 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Vent.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Vent.java @@ -1,5 +1,8 @@ package gregtech.common.covers; +import static gregtech.api.enums.GT_Values.SIDE_UNKNOWN; +import static gregtech.api.objects.XSTR.XSTR_INSTANCE; + import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.interfaces.tileentity.IMachineProgress; import gregtech.api.util.GT_CoverBehavior; @@ -13,9 +16,6 @@ import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.IFluidHandler; -import static gregtech.api.enums.GT_Values.SIDE_UNKNOWN; -import static gregtech.api.objects.XSTR.XSTR_INSTANCE; - public class GT_Cover_Vent extends GT_CoverBehavior { private final int mEfficiency; private final Fluid IC2_HOT_COOLANT = FluidRegistry.getFluid("ic2hotcoolant"); @@ -26,12 +26,14 @@ public class GT_Cover_Vent extends GT_CoverBehavior { } @Override - public boolean isRedstoneSensitive(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { + public boolean isRedstoneSensitive( + byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { return false; } @Override - public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { + public int doCoverThings( + byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { if (aSide == SIDE_UNKNOWN) return 0; int ret = 0; if (aTileEntity instanceof IFluidHandler) { @@ -107,10 +109,8 @@ public class GT_Cover_Vent extends GT_CoverBehavior { return 0; // Vent cover need water or air } if (chances > XSTR_INSTANCE.nextInt(10000)) { - final FluidStack hotFluidStack = - fluidHandler.drain(ForgeDirection.UNKNOWN, Integer.MAX_VALUE, true); - final FluidStack coldFluidStack = - new FluidStack(IC2_COOLANT, hotFluidStack.amount); + final FluidStack hotFluidStack = fluidHandler.drain(ForgeDirection.UNKNOWN, Integer.MAX_VALUE, true); + final FluidStack coldFluidStack = new FluidStack(IC2_COOLANT, hotFluidStack.amount); fluidHandler.fill(ForgeDirection.UNKNOWN, coldFluidStack, true); return hotFluidStack.amount; } diff --git a/src/main/java/gregtech/common/entities/GT_EntityFXPollution.java b/src/main/java/gregtech/common/entities/GT_EntityFXPollution.java index b44f90f7ea..5cb81ab20d 100644 --- a/src/main/java/gregtech/common/entities/GT_EntityFXPollution.java +++ b/src/main/java/gregtech/common/entities/GT_EntityFXPollution.java @@ -1,14 +1,13 @@ package gregtech.common.entities; +import java.util.Random; import net.minecraft.client.particle.EntityFX; import net.minecraft.world.World; -import java.util.Random; - public class GT_EntityFXPollution extends EntityFX { public GT_EntityFXPollution(World world, double x, double y, double z) { - super(world, x, y, z,0 ,0 ,0); + super(world, x, y, z, 0, 0, 0); this.particleRed = 0.25F; this.particleGreen = 0.2F; @@ -26,7 +25,7 @@ public class GT_EntityFXPollution extends EntityFX { this.particleTextureIndexX = 0; this.particleTextureIndexY = 0; - this.particleMaxAge = (int)((double)20 / ((double)random.nextFloat() * 0.8D + 0.2D)); + this.particleMaxAge = (int) ((double) 20 / ((double) random.nextFloat() * 0.8D + 0.2D)); this.particleScale *= 0.75F; this.noClip = true; diff --git a/src/main/java/gregtech/common/entities/GT_Entity_Arrow.java b/src/main/java/gregtech/common/entities/GT_Entity_Arrow.java index d6e2995500..028b3199f7 100644 --- a/src/main/java/gregtech/common/entities/GT_Entity_Arrow.java +++ b/src/main/java/gregtech/common/entities/GT_Entity_Arrow.java @@ -6,6 +6,8 @@ import gregtech.api.objects.ItemData; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; import gregtech.api.util.WorldSpawnedEventBuilder; +import java.util.List; +import java.util.UUID; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.enchantment.Enchantment; @@ -28,9 +30,6 @@ import net.minecraft.world.World; import net.minecraft.world.WorldServer; import net.minecraftforge.common.util.FakePlayerFactory; -import java.util.List; -import java.util.UUID; - public class GT_Entity_Arrow extends EntityArrow { private int mHitBlockX = -1; private int mHitBlockY = -1; @@ -73,8 +72,10 @@ public class GT_Entity_Arrow extends EntityArrow { Entity tShootingEntity = this.shootingEntity; if ((this.prevRotationPitch == 0.0F) && (this.prevRotationYaw == 0.0F)) { float f = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); - this.prevRotationYaw = (this.rotationYaw = (float) (Math.atan2(this.motionX, this.motionZ) * 180.0D / 3.141592653589793D)); - this.prevRotationPitch = (this.rotationPitch = (float) (Math.atan2(this.motionY, f) * 180.0D / 3.141592653589793D)); + this.prevRotationYaw = + (this.rotationYaw = (float) (Math.atan2(this.motionX, this.motionZ) * 180.0D / 3.141592653589793D)); + this.prevRotationPitch = + (this.rotationPitch = (float) (Math.atan2(this.motionY, f) * 180.0D / 3.141592653589793D)); } if (this.mTicksAlive++ == 3000) { setDead(); @@ -82,8 +83,10 @@ public class GT_Entity_Arrow extends EntityArrow { Block tBlock = this.worldObj.getBlock(this.mHitBlockX, this.mHitBlockY, this.mHitBlockZ); if (tBlock.getMaterial() != Material.air) { tBlock.setBlockBoundsBasedOnState(this.worldObj, this.mHitBlockX, this.mHitBlockY, this.mHitBlockZ); - AxisAlignedBB axisalignedbb = tBlock.getCollisionBoundingBoxFromPool(this.worldObj, this.mHitBlockX, this.mHitBlockY, this.mHitBlockZ); - if ((axisalignedbb != null) && (axisalignedbb.isVecInside(Vec3.createVectorHelper(this.posX, this.posY, this.posZ)))) { + AxisAlignedBB axisalignedbb = tBlock.getCollisionBoundingBoxFromPool( + this.worldObj, this.mHitBlockX, this.mHitBlockY, this.mHitBlockZ); + if ((axisalignedbb != null) + && (axisalignedbb.isVecInside(Vec3.createVectorHelper(this.posX, this.posY, this.posZ)))) { this.inGround = true; } } @@ -103,15 +106,21 @@ public class GT_Entity_Arrow extends EntityArrow { } else { this.ticksInAir += 1; Vec3 vec31 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); - Vec3 vec3 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + Vec3 vec3 = Vec3.createVectorHelper( + this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); MovingObjectPosition tVector = this.worldObj.func_147447_a(vec31, vec3, false, true, false); vec31 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); - vec3 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + vec3 = Vec3.createVectorHelper( + this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); if (tVector != null) { vec3 = Vec3.createVectorHelper(tVector.hitVec.xCoord, tVector.hitVec.yCoord, tVector.hitVec.zCoord); } Entity tHitEntity = null; - List tAllPotentiallyHitEntities = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D)); + List tAllPotentiallyHitEntities = this.worldObj.getEntitiesWithinAABBExcludingEntity( + this, + this.boundingBox + .addCoord(this.motionX, this.motionY, this.motionZ) + .expand(1.0D, 1.0D, 1.0D)); double tLargestDistance = 1.7976931348623157E+308D; for (int i = 0; i < tAllPotentiallyHitEntities.size(); i++) { Entity entity1 = (Entity) tAllPotentiallyHitEntities.get(i); @@ -132,7 +141,9 @@ public class GT_Entity_Arrow extends EntityArrow { } if ((tVector != null) && ((tVector.entityHit instanceof EntityPlayer))) { EntityPlayer entityplayer = (EntityPlayer) tVector.entityHit; - if ((entityplayer.capabilities.disableDamage) || (((tShootingEntity instanceof EntityPlayer)) && (!((EntityPlayer) tShootingEntity).canAttackPlayer(entityplayer)))) { + if ((entityplayer.capabilities.disableDamage) + || (((tShootingEntity instanceof EntityPlayer)) + && (!((EntityPlayer) tShootingEntity).canAttackPlayer(entityplayer)))) { tVector = null; } } @@ -140,17 +151,37 @@ public class GT_Entity_Arrow extends EntityArrow { if (tVector.entityHit != null) { ItemData tData = GT_OreDictUnificator.getItemData(this.mArrow); - - float tMagicDamage = (tVector.entityHit instanceof EntityLivingBase) ? EnchantmentHelper.func_152377_a(this.mArrow, ((EntityLivingBase) tVector.entityHit).getCreatureAttribute()) : 0.0F; - float tDamage = MathHelper.ceiling_double_int(MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ) * (getDamage() + ((tData != null) && (tData.mMaterial != null) && (tData.mMaterial.mMaterial != null) ? tData.mMaterial.mMaterial.mToolQuality / 2.0F - 1.0F : 0.0F))); + float tMagicDamage = (tVector.entityHit instanceof EntityLivingBase) + ? EnchantmentHelper.func_152377_a( + this.mArrow, ((EntityLivingBase) tVector.entityHit).getCreatureAttribute()) + : 0.0F; + float tDamage = MathHelper.ceiling_double_int(MathHelper.sqrt_double(this.motionX * this.motionX + + this.motionY * this.motionY + + this.motionZ * this.motionZ) + * (getDamage() + + ((tData != null) + && (tData.mMaterial != null) + && (tData.mMaterial.mMaterial != null) + ? tData.mMaterial.mMaterial.mToolQuality / 2.0F - 1.0F + : 0.0F))); if (getIsCritical()) { tDamage += this.rand.nextInt((int) (tDamage / 2.0D + 2.0D)); } - int tFireDamage = (isBurning() ? 5 : 0) + 4 * EnchantmentHelper.getEnchantmentLevel(Enchantment.fireAspect.effectId, this.mArrow); - int tKnockback = this.mKnockback + EnchantmentHelper.getEnchantmentLevel(Enchantment.knockback.effectId, this.mArrow); + int tFireDamage = (isBurning() ? 5 : 0) + + 4 * EnchantmentHelper.getEnchantmentLevel(Enchantment.fireAspect.effectId, this.mArrow); + int tKnockback = this.mKnockback + + EnchantmentHelper.getEnchantmentLevel(Enchantment.knockback.effectId, this.mArrow); int tHitTimer = -1; - int[] tDamages = onHitEntity(tVector.entityHit, tShootingEntity == null ? this : tShootingEntity, this.mArrow == null ? new ItemStack(Items.arrow, 1) : this.mArrow, (int) (tDamage * 2.0F), (int) (tMagicDamage * 2.0F), tKnockback, tFireDamage, tHitTimer); + int[] tDamages = onHitEntity( + tVector.entityHit, + tShootingEntity == null ? this : tShootingEntity, + this.mArrow == null ? new ItemStack(Items.arrow, 1) : this.mArrow, + (int) (tDamage * 2.0F), + (int) (tMagicDamage * 2.0F), + tKnockback, + tFireDamage, + tHitTimer); if (tDamages != null) { tDamage = tDamages[0] / 2.0F; tMagicDamage = tDamages[1] / 2.0F; @@ -160,10 +191,18 @@ public class GT_Entity_Arrow extends EntityArrow { if ((tFireDamage > 0) && (!(tVector.entityHit instanceof EntityEnderman))) { tVector.entityHit.setFire(tFireDamage); } - if ((!(tHitEntity instanceof EntityPlayer)) && (EnchantmentHelper.getEnchantmentLevel(Enchantment.looting.effectId, this.mArrow) > 0)) { + if ((!(tHitEntity instanceof EntityPlayer)) + && (EnchantmentHelper.getEnchantmentLevel(Enchantment.looting.effectId, this.mArrow) + > 0)) { EntityPlayer tPlayer = null; if ((this.worldObj instanceof WorldServer)) { - tPlayer = FakePlayerFactory.get((WorldServer) this.worldObj, new GameProfile(new UUID(0L, 0L), (tShootingEntity instanceof EntityLivingBase) ? ((EntityLivingBase) tShootingEntity).getCommandSenderName() : "Arrow")); + tPlayer = FakePlayerFactory.get( + (WorldServer) this.worldObj, + new GameProfile( + new UUID(0L, 0L), + (tShootingEntity instanceof EntityLivingBase) + ? ((EntityLivingBase) tShootingEntity).getCommandSenderName() + : "Arrow")); } if (tPlayer != null) { tPlayer.inventory.currentItem = 0; @@ -172,35 +211,59 @@ public class GT_Entity_Arrow extends EntityArrow { tPlayer.setDead(); } } - DamageSource tDamageSource = DamageSource.causeArrowDamage(this, tShootingEntity == null ? this : tShootingEntity); - if ((tDamage + tMagicDamage > 0.0F) && (tVector.entityHit.attackEntityFrom(tDamageSource, tDamage + tMagicDamage))) { + DamageSource tDamageSource = + DamageSource.causeArrowDamage(this, tShootingEntity == null ? this : tShootingEntity); + if ((tDamage + tMagicDamage > 0.0F) + && (tVector.entityHit.attackEntityFrom(tDamageSource, tDamage + tMagicDamage))) { if ((tVector.entityHit instanceof EntityLivingBase)) { if (tHitTimer >= 0) { tVector.entityHit.hurtResistantTime = tHitTimer; } - if (((tVector.entityHit instanceof EntityCreeper)) && (EnchantmentHelper.getEnchantmentLevel(Enchantment.fireAspect.effectId, this.mArrow) > 0)) { + if (((tVector.entityHit instanceof EntityCreeper)) + && (EnchantmentHelper.getEnchantmentLevel( + Enchantment.fireAspect.effectId, this.mArrow) + > 0)) { ((EntityCreeper) tVector.entityHit).func_146079_cb(); } EntityLivingBase tHitLivingEntity = (EntityLivingBase) tVector.entityHit; if (!this.worldObj.isRemote) { - tHitLivingEntity.setArrowCountInEntity(tHitLivingEntity.getArrowCountInEntity() + 1); + tHitLivingEntity.setArrowCountInEntity( + tHitLivingEntity.getArrowCountInEntity() + 1); } if (tKnockback > 0) { - float tKnockbackDivider = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + float tKnockbackDivider = MathHelper.sqrt_double( + this.motionX * this.motionX + this.motionZ * this.motionZ); if (tKnockbackDivider > 0.0F) { - tHitLivingEntity.addVelocity(this.motionX * tKnockback * 0.6000000238418579D / tKnockbackDivider, 0.1D, this.motionZ * tKnockback * 0.6000000238418579D / tKnockbackDivider); + tHitLivingEntity.addVelocity( + this.motionX * tKnockback * 0.6000000238418579D / tKnockbackDivider, + 0.1D, + this.motionZ * tKnockback * 0.6000000238418579D / tKnockbackDivider); } } - GT_Utility.GT_EnchantmentHelper.applyBullshitA(tHitLivingEntity, tShootingEntity == null ? this : tShootingEntity, this.mArrow); - GT_Utility.GT_EnchantmentHelper.applyBullshitB((tShootingEntity instanceof EntityLivingBase) ? (EntityLivingBase) tShootingEntity : null, tHitLivingEntity, this.mArrow); - if ((tShootingEntity != null) && (tHitLivingEntity != tShootingEntity) && ((tHitLivingEntity instanceof EntityPlayer)) && ((tShootingEntity instanceof EntityPlayerMP))) { - ((EntityPlayerMP) tShootingEntity).playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(6, 0.0F)); + GT_Utility.GT_EnchantmentHelper.applyBullshitA( + tHitLivingEntity, + tShootingEntity == null ? this : tShootingEntity, + this.mArrow); + GT_Utility.GT_EnchantmentHelper.applyBullshitB( + (tShootingEntity instanceof EntityLivingBase) + ? (EntityLivingBase) tShootingEntity + : null, + tHitLivingEntity, + this.mArrow); + if ((tShootingEntity != null) + && (tHitLivingEntity != tShootingEntity) + && ((tHitLivingEntity instanceof EntityPlayer)) + && ((tShootingEntity instanceof EntityPlayerMP))) { + ((EntityPlayerMP) tShootingEntity) + .playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(6, 0.0F)); } } if (((tShootingEntity instanceof EntityPlayer)) && (tMagicDamage > 0.0F)) { ((EntityPlayer) tShootingEntity).onEnchantmentCritical(tVector.entityHit); } - if ((!(tVector.entityHit instanceof EntityEnderman)) || (((EntityEnderman) tVector.entityHit).getActivePotionEffect(Potion.weakness) != null)) { + if ((!(tVector.entityHit instanceof EntityEnderman)) + || (((EntityEnderman) tVector.entityHit).getActivePotionEffect(Potion.weakness) + != null)) { if (tFireDamage > 0) { tVector.entityHit.setFire(tFireDamage); } @@ -221,11 +284,13 @@ public class GT_Entity_Arrow extends EntityArrow { this.mHitBlockY = tVector.blockY; this.mHitBlockZ = tVector.blockZ; this.mHitBlock = this.worldObj.getBlock(this.mHitBlockX, this.mHitBlockY, this.mHitBlockZ); - this.mHitBlockMeta = this.worldObj.getBlockMetadata(this.mHitBlockX, this.mHitBlockY, this.mHitBlockZ); + this.mHitBlockMeta = + this.worldObj.getBlockMetadata(this.mHitBlockX, this.mHitBlockY, this.mHitBlockZ); this.motionX = ((float) (tVector.hitVec.xCoord - this.posX)); this.motionY = ((float) (tVector.hitVec.yCoord - this.posY)); this.motionZ = ((float) (tVector.hitVec.zCoord - this.posZ)); - float f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ); + float f2 = MathHelper.sqrt_double( + this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ); this.posX -= this.motionX / f2 * 0.0500000007450581D; this.posY -= this.motionY / f2 * 0.0500000007450581D; this.posZ -= this.motionZ / f2 * 0.0500000007450581D; @@ -234,37 +299,44 @@ public class GT_Entity_Arrow extends EntityArrow { this.arrowShake = 7; setIsCritical(false); if (this.mHitBlock.getMaterial() != Material.air) { - this.mHitBlock.onEntityCollidedWithBlock(this.worldObj, this.mHitBlockX, this.mHitBlockY, this.mHitBlockZ, this); + this.mHitBlock.onEntityCollidedWithBlock( + this.worldObj, this.mHitBlockX, this.mHitBlockY, this.mHitBlockZ, this); } - if ((!this.worldObj.isRemote) && (EnchantmentHelper.getEnchantmentLevel(Enchantment.fireAspect.effectId, this.mArrow) > 2)) { - GT_Utility.setCoordsOnFire(this.worldObj, this.mHitBlockX, this.mHitBlockY, this.mHitBlockZ, true); + if ((!this.worldObj.isRemote) + && (EnchantmentHelper.getEnchantmentLevel(Enchantment.fireAspect.effectId, this.mArrow) + > 2)) { + GT_Utility.setCoordsOnFire( + this.worldObj, this.mHitBlockX, this.mHitBlockY, this.mHitBlockZ, true); } if (breaksOnImpact()) { setDead(); } } } - WorldSpawnedEventBuilder.ParticleEventBuilder events = new WorldSpawnedEventBuilder.ParticleEventBuilder() - .setWorld(this.worldObj); + WorldSpawnedEventBuilder.ParticleEventBuilder events = + new WorldSpawnedEventBuilder.ParticleEventBuilder().setWorld(this.worldObj); if (getIsCritical()) { events.setIdentifier(ParticleFX.CRIT) .setMotion(-this.motionX, -this.motionY + 0.2D, -this.motionZ) - .<WorldSpawnedEventBuilder.ParticleEventBuilder>times(4, (x, i) -> - x.setPosition( - this.posX + this.motionX * i / 4.0D, - this.posY + this.motionY * i / 4.0D, - this.posZ + this.motionZ * i / 4.0D - ).run() - ); + .<WorldSpawnedEventBuilder.ParticleEventBuilder>times(4, (x, i) -> x.setPosition( + this.posX + this.motionX * i / 4.0D, + this.posY + this.motionY * i / 4.0D, + this.posZ + this.motionZ * i / 4.0D) + .run()); } this.posX += this.motionX; this.posY += this.motionY; this.posZ += this.motionZ; this.rotationYaw = ((float) (Math.atan2(this.motionX, this.motionZ) * 180.0D / 3.141592653589793D)); - for (this.rotationPitch = ((float) (Math.atan2(this.motionY, MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ)) * 180.0D / 3.141592653589793D)); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) { - } + for (this.rotationPitch = ((float) (Math.atan2( + this.motionY, + MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ)) + * 180.0D + / 3.141592653589793D)); + this.rotationPitch - this.prevRotationPitch < -180.0F; + this.prevRotationPitch -= 360.0F) {} while (this.rotationPitch - this.prevRotationPitch >= 180.0F) { this.prevRotationPitch += 360.0F; } @@ -283,8 +355,7 @@ public class GT_Entity_Arrow extends EntityArrow { .setPosition( this.posX - this.motionX * 0.25D, this.posY - this.motionY * 0.25D, - this.posZ - this.motionZ * 0.25D - ) + this.posZ - this.motionZ * 0.25D) .times(4, Runnable::run); tFrictionMultiplier = 0.8F; } @@ -334,15 +405,27 @@ public class GT_Entity_Arrow extends EntityArrow { @Override public void onCollideWithPlayer(EntityPlayer aPlayer) { - if ((!this.worldObj.isRemote) && (this.inGround) && (this.arrowShake <= 0) && (this.canBePickedUp == 1) && (aPlayer.inventory.addItemStackToInventory(getArrowItem()))) { + if ((!this.worldObj.isRemote) + && (this.inGround) + && (this.arrowShake <= 0) + && (this.canBePickedUp == 1) + && (aPlayer.inventory.addItemStackToInventory(getArrowItem()))) { playSound("random.pop", 0.2F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F); aPlayer.onItemPickup(this, 1); setDead(); } } - public int[] onHitEntity(Entity aHitEntity, Entity aShootingEntity, ItemStack aArrow, int aRegularDamage, int aMagicDamage, int aKnockback, int aFireDamage, int aHitTimer) { - return new int[]{aRegularDamage, aMagicDamage, aKnockback, aFireDamage, aHitTimer}; + public int[] onHitEntity( + Entity aHitEntity, + Entity aShootingEntity, + ItemStack aArrow, + int aRegularDamage, + int aMagicDamage, + int aKnockback, + int aFireDamage, + int aHitTimer) { + return new int[] {aRegularDamage, aMagicDamage, aKnockback, aFireDamage, aHitTimer}; } public ItemStack getArrowItem() { diff --git a/src/main/java/gregtech/common/entities/GT_Entity_Arrow_Potion.java b/src/main/java/gregtech/common/entities/GT_Entity_Arrow_Potion.java index ccf645bf1c..ec98099ba8 100644 --- a/src/main/java/gregtech/common/entities/GT_Entity_Arrow_Potion.java +++ b/src/main/java/gregtech/common/entities/GT_Entity_Arrow_Potion.java @@ -50,14 +50,25 @@ public class GT_Entity_Arrow_Potion extends GT_Entity_Arrow { } @Override - public int[] onHitEntity(Entity aHitEntity, Entity aShootingEntity, ItemStack aArrow, int aRegularDamage, int aMagicDamage, int aKnockback, int aFireDamage, int aHitTimer) { + public int[] onHitEntity( + Entity aHitEntity, + Entity aShootingEntity, + ItemStack aArrow, + int aRegularDamage, + int aMagicDamage, + int aKnockback, + int aFireDamage, + int aHitTimer) { if ((aHitEntity instanceof EntityLivingBase)) { for (int i = 3; i < this.mPotions.length; i += 4) { if (aHitEntity.worldObj.rand.nextInt(100) < this.mPotions[i]) { - ((EntityLivingBase) aHitEntity).addPotionEffect(new PotionEffect(this.mPotions[(i - 3)], this.mPotions[(i - 2)], this.mPotions[(i - 1)], false)); + ((EntityLivingBase) aHitEntity) + .addPotionEffect(new PotionEffect( + this.mPotions[(i - 3)], this.mPotions[(i - 2)], this.mPotions[(i - 1)], false)); } } } - return super.onHitEntity(aHitEntity, aShootingEntity, aArrow, 1, aMagicDamage, aKnockback, aFireDamage, aHitTimer); + return super.onHitEntity( + aHitEntity, aShootingEntity, aArrow, 1, aMagicDamage, aKnockback, aFireDamage, aHitTimer); } } diff --git a/src/main/java/gregtech/common/gui/GT_Container_Boiler.java b/src/main/java/gregtech/common/gui/GT_Container_Boiler.java index d534c2e8ba..a29e732f07 100644 --- a/src/main/java/gregtech/common/gui/GT_Container_Boiler.java +++ b/src/main/java/gregtech/common/gui/GT_Container_Boiler.java @@ -14,6 +14,7 @@ public class GT_Container_Boiler extends GT_ContainerMetaTile_Machine { public int mSteamAmount = 0; public int mProcessingEnergy = 0; public int mTemperature = 2; + public GT_Container_Boiler(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { super(aInventoryPlayer, aTileEntity); } @@ -48,13 +49,25 @@ public class GT_Container_Boiler extends GT_ContainerMetaTile_Machine { this.mTemperature = ((GT_MetaTileEntity_Boiler) this.mTileEntity.getMetaTileEntity()).mTemperature; this.mProcessingEnergy = ((GT_MetaTileEntity_Boiler) this.mTileEntity.getMetaTileEntity()).mProcessingEnergy; - this.mSteamAmount = (((GT_MetaTileEntity_Boiler) this.mTileEntity.getMetaTileEntity()).mSteam == null ? 0 : ((GT_MetaTileEntity_Boiler) this.mTileEntity.getMetaTileEntity()).mSteam.amount); - this.mWaterAmount = (((GT_MetaTileEntity_Boiler) this.mTileEntity.getMetaTileEntity()).mFluid == null ? 0 : ((GT_MetaTileEntity_Boiler) this.mTileEntity.getMetaTileEntity()).mFluid.amount); + this.mSteamAmount = (((GT_MetaTileEntity_Boiler) this.mTileEntity.getMetaTileEntity()).mSteam == null + ? 0 + : ((GT_MetaTileEntity_Boiler) this.mTileEntity.getMetaTileEntity()).mSteam.amount); + this.mWaterAmount = (((GT_MetaTileEntity_Boiler) this.mTileEntity.getMetaTileEntity()).mFluid == null + ? 0 + : ((GT_MetaTileEntity_Boiler) this.mTileEntity.getMetaTileEntity()).mFluid.amount); - this.mTemperature = Math.min(54, Math.max(0, this.mTemperature * 54 / (((GT_MetaTileEntity_Boiler) this.mTileEntity.getMetaTileEntity()).maxProgresstime() - 10))); + this.mTemperature = Math.min( + 54, + Math.max( + 0, + this.mTemperature + * 54 + / (((GT_MetaTileEntity_Boiler) this.mTileEntity.getMetaTileEntity()).maxProgresstime() + - 10))); this.mSteamAmount = Math.min(54, Math.max(0, this.mSteamAmount * 54 / (capacity - 100))); this.mWaterAmount = Math.min(54, Math.max(0, this.mWaterAmount * 54 / (capacity - 100))); - this.mProcessingEnergy = Math.min(14, Math.max(this.mProcessingEnergy > 0 ? 1 : 0, this.mProcessingEnergy * 14 / 1000)); + this.mProcessingEnergy = + Math.min(14, Math.max(this.mProcessingEnergy > 0 ? 1 : 0, this.mProcessingEnergy * 14 / 1000)); for (Object crafter : this.crafters) { ICrafting player = (ICrafting) crafter; diff --git a/src/main/java/gregtech/common/gui/GT_Container_ChestBuffer.java b/src/main/java/gregtech/common/gui/GT_Container_ChestBuffer.java index 827a7d2d10..afa22a738b 100644 --- a/src/main/java/gregtech/common/gui/GT_Container_ChestBuffer.java +++ b/src/main/java/gregtech/common/gui/GT_Container_ChestBuffer.java @@ -39,38 +39,50 @@ public class GT_Container_ChestBuffer extends GT_ContainerMetaTile_Machine { return null; } if (aSlotIndex == 27) { - ((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bOutput = (!((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bOutput); + ((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bOutput = + (!((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bOutput); if (((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bOutput) { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("116","Emit Energy to Outputside")); + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("116", "Emit Energy to Outputside")); } else { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("117","Don't emit Energy")); + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("117", "Don't emit Energy")); } return null; } if (aSlotIndex == 28) { - ((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull = (!((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull); + ((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull = + (!((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull); if (((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull) { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("118","Emit Redstone if no Slot is free")); + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("118", "Emit Redstone if no Slot is free")); } else { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("119","Don't emit Redstone")); + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("119", "Don't emit Redstone")); } return null; } if (aSlotIndex == 29) { - ((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bInvert = (!((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bInvert); + ((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bInvert = + (!((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bInvert); if (((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bInvert) { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("120","Invert Redstone")); + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("120", "Invert Redstone")); } else { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("121","Don't invert Redstone")); + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("121", "Don't invert Redstone")); } return null; } if (aSlotIndex == 30) { - ((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bStockingMode = (!((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bStockingMode); + ((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bStockingMode = + (!((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bStockingMode); if (((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bStockingMode) { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("217","Stocking mode. Keeps this many items in destination input slots. This mode can be server unfriendly.")); + GT_Utility.sendChatToPlayer( + aPlayer, + GT_Utility.trans( + "217", + "Stocking mode. Keeps this many items in destination input slots. This mode can be server unfriendly.")); } else { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("218", "Transfer size mode. Add exactly this many items in destination input slots as long as there is room.")); + GT_Utility.sendChatToPlayer( + aPlayer, + GT_Utility.trans( + "218", + "Transfer size mode. Add exactly this many items in destination input slots as long as there is room.")); } return null; } diff --git a/src/main/java/gregtech/common/gui/GT_Container_Filter.java b/src/main/java/gregtech/common/gui/GT_Container_Filter.java index 7ca72b8e3a..d4aabe0cb4 100644 --- a/src/main/java/gregtech/common/gui/GT_Container_Filter.java +++ b/src/main/java/gregtech/common/gui/GT_Container_Filter.java @@ -61,56 +61,64 @@ public class GT_Container_Filter extends GT_ContainerMetaTile_Machine { if (aMouseclick == 0) { tSlot.putStack(null); } else if (tStack != null) { - tStack = GT_Utility.copyAmountAndMetaData(tStack.stackSize, 32767, tStack); - if(GT_Utility.isStackInvalid(tStack)){tStack=null;} + tStack = GT_Utility.copyAmountAndMetaData(tStack.stackSize, 32767, tStack); + if (GT_Utility.isStackInvalid(tStack)) { + tStack = null; + } } } else { - tSlot.putStack(GT_Utility.copyAmount(1L, new Object[]{tStack})); + tSlot.putStack(GT_Utility.copyAmount(1L, new Object[] {tStack})); } return null; } if (aSlotIndex == 18) { - ((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bOutput = (!((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bOutput); + ((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bOutput = + (!((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bOutput); if (((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bOutput) { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("116","Emit Energy to Outputside")); + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("116", "Emit Energy to Outputside")); } else { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("117","Don't emit Energy")); + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("117", "Don't emit Energy")); } return null; } if (aSlotIndex == 19) { - ((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull = (!((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull); + ((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull = + (!((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull); if (((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull) { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("122","Emit Redstone if slots contain something")); + GT_Utility.sendChatToPlayer( + aPlayer, GT_Utility.trans("122", "Emit Redstone if slots contain something")); } else { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("123","Don't emit Redstone")); + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("123", "Don't emit Redstone")); } return null; } if (aSlotIndex == 20) { - ((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bInvert = (!((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bInvert); + ((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bInvert = + (!((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bInvert); if (((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bInvert) { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("120","Invert Redstone")); + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("120", "Invert Redstone")); } else { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("121","Don't invert Redstone")); + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("121", "Don't invert Redstone")); } return null; } if (aSlotIndex == 21) { - ((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bInvertFilter = (!((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bInvertFilter); + ((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bInvertFilter = + (!((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bInvertFilter); if (((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bInvertFilter) { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("124","Invert Filter")); + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("124", "Invert Filter")); } else { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("125","Don't invert Filter")); + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("125", "Don't invert Filter")); } return null; } if (aSlotIndex == 22) { - ((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bIgnoreNBT = (!((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bIgnoreNBT); + ((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bIgnoreNBT = + (!((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bIgnoreNBT); if (((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bIgnoreNBT) { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("126","Ignore NBT")); + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("126", "Ignore NBT")); } else { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("127","NBT has to match")); + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("127", "NBT has to match")); } return null; } diff --git a/src/main/java/gregtech/common/gui/GT_Container_IndustrialApiary.java b/src/main/java/gregtech/common/gui/GT_Container_IndustrialApiary.java index 26170a9478..b2a2c4cae1 100644 --- a/src/main/java/gregtech/common/gui/GT_Container_IndustrialApiary.java +++ b/src/main/java/gregtech/common/gui/GT_Container_IndustrialApiary.java @@ -11,6 +11,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.util.GT_ApiaryUpgrade; import gregtech.api.util.GT_Utility; import gregtech.common.tileentities.machines.basic.GT_MetaTileEntity_IndustrialApiary; +import java.util.ArrayList; import net.bdew.gendustry.api.items.IApiaryUpgrade; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; @@ -21,8 +22,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; -import java.util.ArrayList; - public class GT_Container_IndustrialApiary extends GT_ContainerMetaTile_Machine { GT_Slot_Holo slotItemTransferToggle; @@ -60,13 +59,12 @@ public class GT_Container_IndustrialApiary extends GT_ContainerMetaTile_Machine slotUpgrade.add(addSlotToContainer(new ApiarySlot(this.mTileEntity, tStartIndex++, 62, 42))); slotUpgrade.add(addSlotToContainer(new ApiarySlot(this.mTileEntity, tStartIndex++, 80, 42))); - for(int i = 107; i <= 143; i += 18) - for(int j = 6; j <= 42; j += 18) + for (int i = 107; i <= 143; i += 18) + for (int j = 6; j <= 42; j += 18) addSlotToContainer(new GT_Slot_Output(this.mTileEntity, tStartIndex++, i, j)); addSlotToContainer(slotBattery = new Slot(mTileEntity, 1, 80, 63)); addSlotToContainer(slotSpecial = new Slot(mTileEntity, 3, 125, 63)); - } @Override @@ -79,24 +77,18 @@ public class GT_Container_IndustrialApiary extends GT_ContainerMetaTile_Machine machine.mItemTransfer = !machine.mItemTransfer; return null; case 1: - if(aMouseclick == 0) { - if(machine.mLockedSpeed) - return null; - if(aShifthold == 0) { + if (aMouseclick == 0) { + if (machine.mLockedSpeed) return null; + if (aShifthold == 0) { machine.mSpeed++; if (machine.mSpeed > machine.getMaxSpeed()) machine.mSpeed = 0; - } - else if(aShifthold == 1) - { + } else if (aShifthold == 1) { machine.mSpeed--; if (machine.mSpeed < 0) machine.mSpeed = machine.getMaxSpeed(); } - } - else if(aMouseclick == 1) - { + } else if (aMouseclick == 1) { machine.mLockedSpeed = !machine.mLockedSpeed; - if(machine.mLockedSpeed) - machine.mSpeed = machine.getMaxSpeed(); + if (machine.mLockedSpeed) machine.mSpeed = machine.getMaxSpeed(); } return null; case 2: @@ -105,39 +97,28 @@ public class GT_Container_IndustrialApiary extends GT_ContainerMetaTile_Machine return null; } - if(!(aSlotNumber >= getSlotStartIndex()+2 && aSlotNumber < getSlotStartIndex()+2+4)) - return super.slotClick(aSlotNumber, aMouseclick, aShifthold, aPlayer); - if(aShifthold == 5) - return null; - if(aShifthold != 0) - return super.slotClick(aSlotNumber, aMouseclick, aShifthold, aPlayer); - if(aMouseclick > 1) + if (!(aSlotNumber >= getSlotStartIndex() + 2 && aSlotNumber < getSlotStartIndex() + 2 + 4)) return super.slotClick(aSlotNumber, aMouseclick, aShifthold, aPlayer); + if (aShifthold == 5) return null; + if (aShifthold != 0) return super.slotClick(aSlotNumber, aMouseclick, aShifthold, aPlayer); + if (aMouseclick > 1) return super.slotClick(aSlotNumber, aMouseclick, aShifthold, aPlayer); ItemStack s = aPlayer.inventory.getItemStack(); - if(s == null) - return super.slotClick(aSlotNumber, aMouseclick, aShifthold, aPlayer); + if (s == null) return super.slotClick(aSlotNumber, aMouseclick, aShifthold, aPlayer); Slot slot = getSlot(aSlotNumber); ItemStack slotstack = slot.getStack(); - if(slotstack != null && !GT_Utility.areStacksEqual(slotstack, s)) - return null; // super would replace item - if(slotstack == null && !slot.isItemValid(s)) + if (slotstack != null && !GT_Utility.areStacksEqual(slotstack, s)) return null; // super would replace item + if (slotstack == null && !slot.isItemValid(s)) return super.slotClick(aSlotNumber, aMouseclick, aShifthold, aPlayer); - if(!(s.getItem() instanceof IApiaryUpgrade) && !GT_ApiaryUpgrade.isUpgrade(s)) + if (!(s.getItem() instanceof IApiaryUpgrade) && !GT_ApiaryUpgrade.isUpgrade(s)) return super.slotClick(aSlotNumber, aMouseclick, aShifthold, aPlayer); int max = 1; - if (s.getItem() instanceof IApiaryUpgrade) - max = ((IApiaryUpgrade) s.getItem()).getMaxNumber(s); - else - max = GT_ApiaryUpgrade.getUpgrade(s).getMaxNumber(); - if(slotstack != null) - max = Math.max(0, max - slotstack.stackSize); + if (s.getItem() instanceof IApiaryUpgrade) max = ((IApiaryUpgrade) s.getItem()).getMaxNumber(s); + else max = GT_ApiaryUpgrade.getUpgrade(s).getMaxNumber(); + if (slotstack != null) max = Math.max(0, max - slotstack.stackSize); max = Math.min(max, s.stackSize); - if(max == 0) - return null; - if(aMouseclick == 1) - max = 1; - if(max == s.stackSize) - return super.slotClick(aSlotNumber, aMouseclick, aShifthold, aPlayer); + if (max == 0) return null; + if (aMouseclick == 1) max = 1; + if (max == s.stackSize) return super.slotClick(aSlotNumber, aMouseclick, aShifthold, aPlayer); ItemStack newstack = s.splitStack(s.stackSize - max); ItemStack result = super.slotClick(aSlotNumber, aMouseclick, aShifthold, aPlayer); aPlayer.inventory.setItemStack(newstack); @@ -151,7 +132,7 @@ public class GT_Container_IndustrialApiary extends GT_ContainerMetaTile_Machine @Override public int getSlotCount() { - return 6+9+2; + return 6 + 9 + 2; } @Override @@ -176,8 +157,7 @@ public class GT_Container_IndustrialApiary extends GT_ContainerMetaTile_Machine var1.sendProgressBarUpdate(this, 100, this.mSpeed); var1.sendProgressBarUpdate(this, 101, this.mItemTransfer ? 1 : 0); var1.sendProgressBarUpdate(this, 102, 0); - for(IErrorState s : getMachine().mErrorStates) - var1.sendProgressBarUpdate(this, 103, s.getID()); + for (IErrorState s : getMachine().mErrorStates) var1.sendProgressBarUpdate(this, 103, s.getID()); var1.sendProgressBarUpdate(this, 104, this.mStuttering ? 1 : 0); var1.sendProgressBarUpdate(this, 105, this.mLockedSpeed ? 1 : 0); } @@ -198,7 +178,11 @@ public class GT_Container_IndustrialApiary extends GT_ContainerMetaTile_Machine this.mErrorStates.clear(); break; case 103: - this.mErrorStates.add(EnumChatFormatting.RED + StatCollector.translateToLocal("for." + ForestryAPI.errorStateRegistry.getErrorState((short) par2).getDescription())); + this.mErrorStates.add(EnumChatFormatting.RED + + StatCollector.translateToLocal("for." + + ForestryAPI.errorStateRegistry + .getErrorState((short) par2) + .getDescription())); break; case 104: this.mStuttering = par2 == 1; @@ -216,33 +200,24 @@ public class GT_Container_IndustrialApiary extends GT_ContainerMetaTile_Machine @Override public ItemStack transferStackInSlot(EntityPlayer aPlayer, int aSlotIndex) { Slot s = getSlot(aSlotIndex); - if(s == null) - return super.transferStackInSlot(aPlayer, aSlotIndex); - if(!(s.inventory instanceof InventoryPlayer)) - return super.transferStackInSlot(aPlayer, aSlotIndex); + if (s == null) return super.transferStackInSlot(aPlayer, aSlotIndex); + if (!(s.inventory instanceof InventoryPlayer)) return super.transferStackInSlot(aPlayer, aSlotIndex); ItemStack aStack = s.getStack(); - if(aStack == null) + if (aStack == null) return super.transferStackInSlot(aPlayer, aSlotIndex); + if (!(aStack.getItem() instanceof IApiaryUpgrade) && !GT_ApiaryUpgrade.isUpgrade(aStack)) return super.transferStackInSlot(aPlayer, aSlotIndex); - if(!(aStack.getItem() instanceof IApiaryUpgrade) && !GT_ApiaryUpgrade.isUpgrade(aStack)) - return super.transferStackInSlot(aPlayer, aSlotIndex); - for(int i = getSlotStartIndex()+2; i < getSlotStartIndex()+2+4; i++) { + for (int i = getSlotStartIndex() + 2; i < getSlotStartIndex() + 2 + 4; i++) { Slot iSlot = getSlot(i); ItemStack iStack = iSlot.getStack(); - if(iStack == null) - { - if(!iSlot.isItemValid(aStack)) - continue; - } - else - { - if(!GT_Utility.areStacksEqual(aStack, iStack)) - continue; + if (iStack == null) { + if (!iSlot.isItemValid(aStack)) continue; + } else { + if (!GT_Utility.areStacksEqual(aStack, iStack)) continue; } int max = 1; if (aStack.getItem() instanceof IApiaryUpgrade) max = ((IApiaryUpgrade) aStack.getItem()).getMaxNumber(aStack); - else - max = GT_ApiaryUpgrade.getUpgrade(aStack).getMaxNumber(); + else max = GT_ApiaryUpgrade.getUpgrade(aStack).getMaxNumber(); if (iStack == null) { max = Math.min(max, aStack.stackSize); ItemStack newstack = aStack.splitStack(max); @@ -254,16 +229,14 @@ public class GT_Container_IndustrialApiary extends GT_ContainerMetaTile_Machine aStack.stackSize -= max; iSlot.onSlotChanged(); } - if (aStack.stackSize == 0) - s.putStack(null); - else - s.onSlotChanged(); + if (aStack.stackSize == 0) s.putStack(null); + else s.onSlotChanged(); break; } return null; } - private static class ApiarySlot extends Slot{ + private static class ApiarySlot extends Slot { public ApiarySlot(IInventory p_i1824_1_, int p_i1824_2_, int p_i1824_3_, int p_i1824_4_) { super(p_i1824_1_, p_i1824_2_, p_i1824_3_, p_i1824_4_); @@ -277,7 +250,8 @@ public class GT_Container_IndustrialApiary extends GT_ContainerMetaTile_Machine @Override public void onSlotChanged() { super.onSlotChanged(); - ((GT_MetaTileEntity_IndustrialApiary)((IGregTechTileEntity)this.inventory).getMetaTileEntity()).onInventoryUpdate(this.getSlotIndex()); + ((GT_MetaTileEntity_IndustrialApiary) ((IGregTechTileEntity) this.inventory).getMetaTileEntity()) + .onInventoryUpdate(this.getSlotIndex()); } } } diff --git a/src/main/java/gregtech/common/gui/GT_Container_InputBus_ME.java b/src/main/java/gregtech/common/gui/GT_Container_InputBus_ME.java index 0f7b26eea7..58aff9ad08 100644 --- a/src/main/java/gregtech/common/gui/GT_Container_InputBus_ME.java +++ b/src/main/java/gregtech/common/gui/GT_Container_InputBus_ME.java @@ -1,11 +1,5 @@ package gregtech.common.gui; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.ICrafting; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.gui.GT_ContainerMetaTile_Machine; @@ -14,25 +8,43 @@ import gregtech.api.gui.GT_Slot_Holo_ME; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.util.GT_Utility; import gregtech.common.tileentities.machines.GT_MetaTileEntity_Hatch_InputBus_ME; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; public class GT_Container_InputBus_ME extends GT_ContainerMetaTile_Machine { private static final int LEFT_OFFSET = 8; private static final int TOP_OFFSET = 10; private static final int SLOT_SIZE = 18; public static final int CIRCUIT_SLOT = 32; + public GT_Container_InputBus_ME(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { super(aInventoryPlayer, aTileEntity); } + @Override public void addSlots(InventoryPlayer aInventoryPlayer) { for (int y = 0; y < 4; ++y) for (int x = 0; x < 4; ++x) - addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, x + y * 4, - LEFT_OFFSET + x * SLOT_SIZE, TOP_OFFSET + y * SLOT_SIZE, false, true, 1)); + addSlotToContainer(new GT_Slot_Holo( + this.mTileEntity, + x + y * 4, + LEFT_OFFSET + x * SLOT_SIZE, + TOP_OFFSET + y * SLOT_SIZE, + false, + true, + 1)); for (int y = 0; y < 4; ++y) for (int x = 0; x < 4; ++x) { - GT_Slot_Holo_ME slot = new GT_Slot_Holo_ME(this.mTileEntity, x + y * 4 + 16, - LEFT_OFFSET + x * SLOT_SIZE + 90, TOP_OFFSET + y * SLOT_SIZE, false, true); + GT_Slot_Holo_ME slot = new GT_Slot_Holo_ME( + this.mTileEntity, + x + y * 4 + 16, + LEFT_OFFSET + x * SLOT_SIZE + 90, + TOP_OFFSET + y * SLOT_SIZE, + false, + true); addSlotToContainer(slot); } super.addSlots(aInventoryPlayer); @@ -41,25 +53,22 @@ public class GT_Container_InputBus_ME extends GT_ContainerMetaTile_Machine { private boolean containsSuchStack(ItemStack tStack) { for (int i = 0; i < 16; ++i) { Slot tSlot = (Slot) this.inventorySlots.get(i); - if (tSlot != null && GT_Utility.areStacksEqual(tSlot.getStack(), tStack, false)) - return true; + if (tSlot != null && GT_Utility.areStacksEqual(tSlot.getStack(), tStack, false)) return true; } return false; } - private final static int PROGRESS_PACKET_INDEX_OFFSET = 200; + private static final int PROGRESS_PACKET_INDEX_OFFSET = 200; @Override public void detectAndSendChanges() { super.detectAndSendChanges(); - if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) - return; + if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) return; for (Object crafter : this.crafters) { ICrafting player = (ICrafting) crafter; for (int i = 0; i < 16; ++i) { ItemStack s = ((Slot) this.inventorySlots.get(i + 16)).getStack(); - if (s == null) - continue; + if (s == null) continue; player.sendProgressBarUpdate(this, PROGRESS_PACKET_INDEX_OFFSET + 2 * i, s.stackSize & 65535); player.sendProgressBarUpdate(this, PROGRESS_PACKET_INDEX_OFFSET + 2 * i + 1, s.stackSize >>> 16); } @@ -77,8 +86,7 @@ public class GT_Container_InputBus_ME extends GT_ContainerMetaTile_Machine { if ((id - PROGRESS_PACKET_INDEX_OFFSET) % 2 == 0) { s.stackSize &= 0xFFFF0000; s.stackSize += (value & 0xFFFF); - } - else { + } else { s.stackSize &= 0xFFFF; s.stackSize += value << 16; } @@ -91,19 +99,17 @@ public class GT_Container_InputBus_ME extends GT_ContainerMetaTile_Machine { if (aSlotIndex >= 0 && aSlotIndex < 16) { Slot tSlot = (Slot) this.inventorySlots.get(aSlotIndex); if (tSlot != null) { - if (this.mTileEntity.getMetaTileEntity() == null) - return null; + if (this.mTileEntity.getMetaTileEntity() == null) return null; ItemStack tStack = aPlayer.inventory.getItemStack(); if (tStack == null) { tSlot.putStack(null); - } - else { - if (containsSuchStack(tStack)) - return null; + } else { + if (containsSuchStack(tStack)) return null; tSlot.putStack(GT_Utility.copyAmount(1L, tStack)); } if (mTileEntity.isServerSide()) { - ItemStack newInfo = ((GT_MetaTileEntity_Hatch_InputBus_ME) mTileEntity.getMetaTileEntity()).updateInformationSlot(aSlotIndex, tStack); + ItemStack newInfo = ((GT_MetaTileEntity_Hatch_InputBus_ME) mTileEntity.getMetaTileEntity()) + .updateInformationSlot(aSlotIndex, tStack); ((Slot) this.inventorySlots.get(aSlotIndex + 16)).putStack(newInfo); detectAndSendChanges(); } diff --git a/src/main/java/gregtech/common/gui/GT_Container_ItemDistributor.java b/src/main/java/gregtech/common/gui/GT_Container_ItemDistributor.java index 6f3c8fe85c..2de68c9752 100644 --- a/src/main/java/gregtech/common/gui/GT_Container_ItemDistributor.java +++ b/src/main/java/gregtech/common/gui/GT_Container_ItemDistributor.java @@ -38,29 +38,32 @@ public class GT_Container_ItemDistributor extends GT_ContainerMetaTile_Machine { return null; } if (aSlotIndex == 27) { - ((GT_MetaTileEntity_ItemDistributor) this.mTileEntity.getMetaTileEntity()).bOutput = (!((GT_MetaTileEntity_ItemDistributor) this.mTileEntity.getMetaTileEntity()).bOutput); + ((GT_MetaTileEntity_ItemDistributor) this.mTileEntity.getMetaTileEntity()).bOutput = + (!((GT_MetaTileEntity_ItemDistributor) this.mTileEntity.getMetaTileEntity()).bOutput); if (((GT_MetaTileEntity_ItemDistributor) this.mTileEntity.getMetaTileEntity()).bOutput) { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("116","Emit Energy to Outputside")); + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("116", "Emit Energy to Outputside")); } else { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("117","Don't emit Energy")); + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("117", "Don't emit Energy")); } return null; } if (aSlotIndex == 28) { - ((GT_MetaTileEntity_ItemDistributor) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull = (!((GT_MetaTileEntity_ItemDistributor) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull); + ((GT_MetaTileEntity_ItemDistributor) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull = + (!((GT_MetaTileEntity_ItemDistributor) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull); if (((GT_MetaTileEntity_ItemDistributor) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull) { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("118","Emit Redstone if no Slot is free")); + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("118", "Emit Redstone if no Slot is free")); } else { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("119","Don't emit Redstone")); + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("119", "Don't emit Redstone")); } return null; } if (aSlotIndex == 29) { - ((GT_MetaTileEntity_ItemDistributor) this.mTileEntity.getMetaTileEntity()).bInvert = (!((GT_MetaTileEntity_ItemDistributor) this.mTileEntity.getMetaTileEntity()).bInvert); + ((GT_MetaTileEntity_ItemDistributor) this.mTileEntity.getMetaTileEntity()).bInvert = + (!((GT_MetaTileEntity_ItemDistributor) this.mTileEntity.getMetaTileEntity()).bInvert); if (((GT_MetaTileEntity_ItemDistributor) this.mTileEntity.getMetaTileEntity()).bInvert) { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("120","Invert Redstone")); + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("120", "Invert Redstone")); } else { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("121","Don't invert Redstone")); + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("121", "Don't invert Redstone")); } return null; } diff --git a/src/main/java/gregtech/common/gui/GT_Container_MicrowaveEnergyTransmitter.java b/src/main/java/gregtech/common/gui/GT_Container_MicrowaveEnergyTransmitter.java index 4e88c8088e..bd6b917f1f 100644 --- a/src/main/java/gregtech/common/gui/GT_Container_MicrowaveEnergyTransmitter.java +++ b/src/main/java/gregtech/common/gui/GT_Container_MicrowaveEnergyTransmitter.java @@ -18,6 +18,7 @@ public class GT_Container_MicrowaveEnergyTransmitter extends GT_ContainerMetaTil public int mTargetZ = 0; public int mTargetY = 0; public int mTargetX = 0; + public GT_Container_MicrowaveEnergyTransmitter(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { super(aInventoryPlayer, aTileEntity); } @@ -54,52 +55,68 @@ public class GT_Container_MicrowaveEnergyTransmitter extends GT_ContainerMetaTil if ((tSlot != null) && (this.mTileEntity.getMetaTileEntity() != null)) { switch (aSlotIndex) { case 0: - ((GT_MetaTileEntity_MicrowaveEnergyTransmitter) this.mTileEntity.getMetaTileEntity()).mTargetX -= (aShifthold == 1 ? 512 : 64); + ((GT_MetaTileEntity_MicrowaveEnergyTransmitter) this.mTileEntity.getMetaTileEntity()).mTargetX -= + (aShifthold == 1 ? 512 : 64); return null; case 1: - ((GT_MetaTileEntity_MicrowaveEnergyTransmitter) this.mTileEntity.getMetaTileEntity()).mTargetY -= (aShifthold == 1 ? 512 : 64); + ((GT_MetaTileEntity_MicrowaveEnergyTransmitter) this.mTileEntity.getMetaTileEntity()).mTargetY -= + (aShifthold == 1 ? 512 : 64); return null; case 2: - ((GT_MetaTileEntity_MicrowaveEnergyTransmitter) this.mTileEntity.getMetaTileEntity()).mTargetZ -= (aShifthold == 1 ? 512 : 64); + ((GT_MetaTileEntity_MicrowaveEnergyTransmitter) this.mTileEntity.getMetaTileEntity()).mTargetZ -= + (aShifthold == 1 ? 512 : 64); return null; case 3: - ((GT_MetaTileEntity_MicrowaveEnergyTransmitter) this.mTileEntity.getMetaTileEntity()).mTargetD -= (aShifthold == 1 ? 16 : 8); + ((GT_MetaTileEntity_MicrowaveEnergyTransmitter) this.mTileEntity.getMetaTileEntity()).mTargetD -= + (aShifthold == 1 ? 16 : 8); return null; case 4: - ((GT_MetaTileEntity_MicrowaveEnergyTransmitter) this.mTileEntity.getMetaTileEntity()).mTargetX -= (aShifthold == 1 ? 16 : 1); + ((GT_MetaTileEntity_MicrowaveEnergyTransmitter) this.mTileEntity.getMetaTileEntity()).mTargetX -= + (aShifthold == 1 ? 16 : 1); return null; case 5: - ((GT_MetaTileEntity_MicrowaveEnergyTransmitter) this.mTileEntity.getMetaTileEntity()).mTargetY -= (aShifthold == 1 ? 16 : 1); + ((GT_MetaTileEntity_MicrowaveEnergyTransmitter) this.mTileEntity.getMetaTileEntity()).mTargetY -= + (aShifthold == 1 ? 16 : 1); return null; case 6: - ((GT_MetaTileEntity_MicrowaveEnergyTransmitter) this.mTileEntity.getMetaTileEntity()).mTargetZ -= (aShifthold == 1 ? 16 : 1); + ((GT_MetaTileEntity_MicrowaveEnergyTransmitter) this.mTileEntity.getMetaTileEntity()).mTargetZ -= + (aShifthold == 1 ? 16 : 1); return null; case 7: - ((GT_MetaTileEntity_MicrowaveEnergyTransmitter) this.mTileEntity.getMetaTileEntity()).mTargetD -= (aShifthold == 1 ? 4 : 1); + ((GT_MetaTileEntity_MicrowaveEnergyTransmitter) this.mTileEntity.getMetaTileEntity()).mTargetD -= + (aShifthold == 1 ? 4 : 1); return null; case 8: - ((GT_MetaTileEntity_MicrowaveEnergyTransmitter) this.mTileEntity.getMetaTileEntity()).mTargetX += (aShifthold == 1 ? 512 : 64); + ((GT_MetaTileEntity_MicrowaveEnergyTransmitter) this.mTileEntity.getMetaTileEntity()).mTargetX += + (aShifthold == 1 ? 512 : 64); return null; case 9: - ((GT_MetaTileEntity_MicrowaveEnergyTransmitter) this.mTileEntity.getMetaTileEntity()).mTargetY += (aShifthold == 1 ? 512 : 64); + ((GT_MetaTileEntity_MicrowaveEnergyTransmitter) this.mTileEntity.getMetaTileEntity()).mTargetY += + (aShifthold == 1 ? 512 : 64); return null; case 10: - ((GT_MetaTileEntity_MicrowaveEnergyTransmitter) this.mTileEntity.getMetaTileEntity()).mTargetZ += (aShifthold == 1 ? 512 : 64); + ((GT_MetaTileEntity_MicrowaveEnergyTransmitter) this.mTileEntity.getMetaTileEntity()).mTargetZ += + (aShifthold == 1 ? 512 : 64); return null; case 11: - ((GT_MetaTileEntity_MicrowaveEnergyTransmitter) this.mTileEntity.getMetaTileEntity()).mTargetD += (aShifthold == 1 ? 16 : 8); + ((GT_MetaTileEntity_MicrowaveEnergyTransmitter) this.mTileEntity.getMetaTileEntity()).mTargetD += + (aShifthold == 1 ? 16 : 8); return null; case 12: - ((GT_MetaTileEntity_MicrowaveEnergyTransmitter) this.mTileEntity.getMetaTileEntity()).mTargetX += (aShifthold == 1 ? 16 : 1); + ((GT_MetaTileEntity_MicrowaveEnergyTransmitter) this.mTileEntity.getMetaTileEntity()).mTargetX += + (aShifthold == 1 ? 16 : 1); return null; case 13: - ((GT_MetaTileEntity_MicrowaveEnergyTransmitter) this.mTileEntity.getMetaTileEntity()).mTargetY += (aShifthold == 1 ? 16 : 1); + ((GT_MetaTileEntity_MicrowaveEnergyTransmitter) this.mTileEntity.getMetaTileEntity()).mTargetY += + (aShifthold == 1 ? 16 : 1); return null; case 14: - ((GT_MetaTileEntity_MicrowaveEnergyTransmitter) this.mTileEntity.getMetaTileEntity()).mTargetZ += (aShifthold == 1 ? 16 : 1); + ((GT_MetaTileEntity_MicrowaveEnergyTransmitter) this.mTileEntity.getMetaTileEntity()).mTargetZ += + (aShifthold == 1 ? 16 : 1); return null; case 15: - ((GT_MetaTileEntity_MicrowaveEnergyTransmitter) this.mTileEntity.getMetaTileEntity()).mTargetD += (aShifthold == 1 ? 4 : 1); + ((GT_MetaTileEntity_MicrowaveEnergyTransmitter) this.mTileEntity.getMetaTileEntity()).mTargetD += + (aShifthold == 1 ? 4 : 1); return null; } } @@ -116,7 +133,10 @@ public class GT_Container_MicrowaveEnergyTransmitter extends GT_ContainerMetaTil this.mTargetY = ((GT_MetaTileEntity_MicrowaveEnergyTransmitter) this.mTileEntity.getMetaTileEntity()).mTargetY; this.mTargetZ = ((GT_MetaTileEntity_MicrowaveEnergyTransmitter) this.mTileEntity.getMetaTileEntity()).mTargetZ; this.mTargetD = ((GT_MetaTileEntity_MicrowaveEnergyTransmitter) this.mTileEntity.getMetaTileEntity()).mTargetD; - this.mEgg = (((GT_MetaTileEntity_MicrowaveEnergyTransmitter) this.mTileEntity.getMetaTileEntity()).hasDimensionalTeleportCapability() ? 1 : 0); + this.mEgg = (((GT_MetaTileEntity_MicrowaveEnergyTransmitter) this.mTileEntity.getMetaTileEntity()) + .hasDimensionalTeleportCapability() + ? 1 + : 0); for (Object crafter : this.crafters) { ICrafting aPlayer = (ICrafting) crafter; diff --git a/src/main/java/gregtech/common/gui/GT_Container_OutputHatch.java b/src/main/java/gregtech/common/gui/GT_Container_OutputHatch.java index 25179d718e..954b8ab61b 100644 --- a/src/main/java/gregtech/common/gui/GT_Container_OutputHatch.java +++ b/src/main/java/gregtech/common/gui/GT_Container_OutputHatch.java @@ -33,17 +33,21 @@ public class GT_Container_OutputHatch extends GT_Container_BasicTank { FluidStack tReadyLockFluid = GT_Utility.getFluidForFilledItem(aPlayer.inventory.getItemStack(), true); byte tMode = tHatch.getMode(); // If player click the locker slot with empty or the same fluid cell, clear the lock fluid - if (tReadyLockFluid == null || (tMode >= 8 && tReadyLockFluid.getFluid().getName().equals(tHatch.getLockedFluidName()))) { + if (tReadyLockFluid == null + || (tMode >= 8 && tReadyLockFluid.getFluid().getName().equals(tHatch.getLockedFluidName()))) { tHatch.setLockedFluidName(null); GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("300", "Fluid Lock Cleared.")); tHatch.mMode = 0; - } - else { + } else { tHatch.setLockedFluidName(tReadyLockFluid.getFluid().getName()); - GT_Utility.sendChatToPlayer(aPlayer, String.format(GT_Utility.trans("151.4", "Sucessfully locked Fluid to %s"), tReadyLockFluid.getLocalizedName())); + GT_Utility.sendChatToPlayer( + aPlayer, + String.format( + GT_Utility.trans("151.4", "Sucessfully locked Fluid to %s"), + tReadyLockFluid.getLocalizedName())); tHatch.mMode = 9; } } return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); } -}
\ No newline at end of file +} diff --git a/src/main/java/gregtech/common/gui/GT_Container_PrimitiveBlastFurnace.java b/src/main/java/gregtech/common/gui/GT_Container_PrimitiveBlastFurnace.java index 7aebadf31e..e19b6167ec 100644 --- a/src/main/java/gregtech/common/gui/GT_Container_PrimitiveBlastFurnace.java +++ b/src/main/java/gregtech/common/gui/GT_Container_PrimitiveBlastFurnace.java @@ -19,7 +19,8 @@ public class GT_Container_PrimitiveBlastFurnace extends GT_ContainerMetaTile_Mac addSlotToContainer(new Slot(this.mTileEntity, i, 34, 16 + 18 * i)); } for (int i = 0; i < GT_MetaTileEntity_PrimitiveBlastFurnace.OUTPUT_SLOTS; i++) { - addSlotToContainer(new GT_Slot_Output(mTileEntity, GT_MetaTileEntity_PrimitiveBlastFurnace.INPUT_SLOTS + i, 86 + i * 18, 25)); + addSlotToContainer(new GT_Slot_Output( + mTileEntity, GT_MetaTileEntity_PrimitiveBlastFurnace.INPUT_SLOTS + i, 86 + i * 18, 25)); } } diff --git a/src/main/java/gregtech/common/gui/GT_Container_Regulator.java b/src/main/java/gregtech/common/gui/GT_Container_Regulator.java index c6a7bdbdec..3079b40470 100644 --- a/src/main/java/gregtech/common/gui/GT_Container_Regulator.java +++ b/src/main/java/gregtech/common/gui/GT_Container_Regulator.java @@ -22,7 +22,7 @@ public class GT_Container_Regulator extends GT_ContainerMetaTile_Machine { @Override public void addSlots(InventoryPlayer aInventoryPlayer) { - this.mTargetSlots = new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0}; + this.mTargetSlots = new int[] {0, 0, 0, 0, 0, 0, 0, 0, 0}; addSlotToContainer(new Slot(this.mTileEntity, 0, 8, 6)); addSlotToContainer(new Slot(this.mTileEntity, 1, 26, 6)); @@ -70,7 +70,8 @@ public class GT_Container_Regulator extends GT_ContainerMetaTile_Machine { return null; } if (aSlotIndex == 28) { - ((GT_MetaTileEntity_Regulator) this.mTileEntity.getMetaTileEntity()).bOutput = (!((GT_MetaTileEntity_Regulator) this.mTileEntity.getMetaTileEntity()).bOutput); + ((GT_MetaTileEntity_Regulator) this.mTileEntity.getMetaTileEntity()).bOutput = + (!((GT_MetaTileEntity_Regulator) this.mTileEntity.getMetaTileEntity()).bOutput); if (((GT_MetaTileEntity_Regulator) this.mTileEntity.getMetaTileEntity()).bOutput) { GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("116", "Emit Energy to Outputside")); } else { @@ -98,7 +99,14 @@ public class GT_Container_Regulator extends GT_ContainerMetaTile_Machine { return null; } if ((aSlotIndex < 28)) { - ((GT_MetaTileEntity_Regulator) this.mTileEntity.getMetaTileEntity()).mTargetSlots[(aSlotIndex - 19)] = Math.min(99, Math.max(0, ((GT_MetaTileEntity_Regulator) this.mTileEntity.getMetaTileEntity()).mTargetSlots[(aSlotIndex - 19)] + (aMouseclick == 0 ? -1 : 1) * (aShifthold == 0 ? 1 : 16))); + ((GT_MetaTileEntity_Regulator) this.mTileEntity.getMetaTileEntity()).mTargetSlots[(aSlotIndex - 19)] = + Math.min( + 99, + Math.max( + 0, + ((GT_MetaTileEntity_Regulator) this.mTileEntity.getMetaTileEntity()) + .mTargetSlots[(aSlotIndex - 19)] + + (aMouseclick == 0 ? -1 : 1) * (aShifthold == 0 ? 1 : 16))); return null; } } diff --git a/src/main/java/gregtech/common/gui/GT_Container_SuperBuffer.java b/src/main/java/gregtech/common/gui/GT_Container_SuperBuffer.java index 58df63e16a..0fda1a485f 100644 --- a/src/main/java/gregtech/common/gui/GT_Container_SuperBuffer.java +++ b/src/main/java/gregtech/common/gui/GT_Container_SuperBuffer.java @@ -34,38 +34,50 @@ public class GT_Container_SuperBuffer extends GT_ContainerMetaTile_Machine { return null; } if (aSlotIndex == 0) { - ((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bOutput = (!((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bOutput); + ((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bOutput = + (!((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bOutput); if (((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bOutput) { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("116","Emit Energy to Outputside")); + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("116", "Emit Energy to Outputside")); } else { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("117","Don't emit Energy")); + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("117", "Don't emit Energy")); } return null; } if (aSlotIndex == 1) { - ((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull = (!((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull); + ((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull = + (!((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull); if (((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull) { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("118","Emit Redstone if no Slot is free")); + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("118", "Emit Redstone if no Slot is free")); } else { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("119","Don't emit Redstone")); + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("119", "Don't emit Redstone")); } return null; } if (aSlotIndex == 2) { - ((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bInvert = (!((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bInvert); + ((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bInvert = + (!((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bInvert); if (((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bInvert) { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("120","Invert Redstone")); + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("120", "Invert Redstone")); } else { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("121","Don't invert Redstone")); + GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("121", "Don't invert Redstone")); } return null; } if (aSlotIndex == 3) { - ((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bStockingMode = (!((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bStockingMode); + ((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bStockingMode = + (!((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bStockingMode); if (((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bStockingMode) { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("217","Stocking mode. Keeps this many items in destination input slots. This mode can be server unfriendly.")); + GT_Utility.sendChatToPlayer( + aPlayer, + GT_Utility.trans( + "217", + "Stocking mode. Keeps this many items in destination input slots. This mode can be server unfriendly.")); } else { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("218", "Transfer size mode. Add exactly this many items in destination input slots as long as there is room.")); + GT_Utility.sendChatToPlayer( + aPlayer, + GT_Utility.trans( + "218", + "Transfer size mode. Add exactly this many items in destination input slots as long as there is room.")); } return null; } diff --git a/src/main/java/gregtech/common/gui/GT_Container_Teleporter.java b/src/main/java/gregtech/common/gui/GT_Container_Teleporter.java index d5013d9504..219391e662 100644 --- a/src/main/java/gregtech/common/gui/GT_Container_Teleporter.java +++ b/src/main/java/gregtech/common/gui/GT_Container_Teleporter.java @@ -6,20 +6,20 @@ import gregtech.api.gui.GT_ContainerMetaTile_Machine; import gregtech.api.gui.GT_Slot_Holo; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.common.tileentities.machines.basic.GT_MetaTileEntity_Teleporter; +import java.util.Iterator; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -import java.util.Iterator; - public class GT_Container_Teleporter extends GT_ContainerMetaTile_Machine { public int mEgg = 0; public int mTargetD = 0; public int mTargetZ = 0; public int mTargetY = 0; public int mTargetX = 0; + public GT_Container_Teleporter(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { super(aInventoryPlayer, aTileEntity); } @@ -56,52 +56,68 @@ public class GT_Container_Teleporter extends GT_ContainerMetaTile_Machine { if ((tSlot != null) && (this.mTileEntity.getMetaTileEntity() != null)) { switch (aSlotIndex) { case 0: - ((GT_MetaTileEntity_Teleporter) this.mTileEntity.getMetaTileEntity()).mTargetX -= (aShifthold == 1 ? 512 : 64); + ((GT_MetaTileEntity_Teleporter) this.mTileEntity.getMetaTileEntity()).mTargetX -= + (aShifthold == 1 ? 512 : 64); return null; case 1: - ((GT_MetaTileEntity_Teleporter) this.mTileEntity.getMetaTileEntity()).mTargetY -= (aShifthold == 1 ? 512 : 64); + ((GT_MetaTileEntity_Teleporter) this.mTileEntity.getMetaTileEntity()).mTargetY -= + (aShifthold == 1 ? 512 : 64); return null; case 2: - ((GT_MetaTileEntity_Teleporter) this.mTileEntity.getMetaTileEntity()).mTargetZ -= (aShifthold == 1 ? 512 : 64); + ((GT_MetaTileEntity_Teleporter) this.mTileEntity.getMetaTileEntity()).mTargetZ -= + (aShifthold == 1 ? 512 : 64); return null; case 3: - ((GT_MetaTileEntity_Teleporter) this.mTileEntity.getMetaTileEntity()).mTargetD -= (aShifthold == 1 ? 16 : 8); + ((GT_MetaTileEntity_Teleporter) this.mTileEntity.getMetaTileEntity()).mTargetD -= + (aShifthold == 1 ? 16 : 8); return null; case 4: - ((GT_MetaTileEntity_Teleporter) this.mTileEntity.getMetaTileEntity()).mTargetX -= (aShifthold == 1 ? 16 : 1); + ((GT_MetaTileEntity_Teleporter) this.mTileEntity.getMetaTileEntity()).mTargetX -= + (aShifthold == 1 ? 16 : 1); return null; case 5: - ((GT_MetaTileEntity_Teleporter) this.mTileEntity.getMetaTileEntity()).mTargetY -= (aShifthold == 1 ? 16 : 1); + ((GT_MetaTileEntity_Teleporter) this.mTileEntity.getMetaTileEntity()).mTargetY -= + (aShifthold == 1 ? 16 : 1); return null; case 6: - ((GT_MetaTileEntity_Teleporter) this.mTileEntity.getMetaTileEntity()).mTargetZ -= (aShifthold == 1 ? 16 : 1); + ((GT_MetaTileEntity_Teleporter) this.mTileEntity.getMetaTileEntity()).mTargetZ -= + (aShifthold == 1 ? 16 : 1); return null; case 7: - ((GT_MetaTileEntity_Teleporter) this.mTileEntity.getMetaTileEntity()).mTargetD -= (aShifthold == 1 ? 4 : 1); + ((GT_MetaTileEntity_Teleporter) this.mTileEntity.getMetaTileEntity()).mTargetD -= + (aShifthold == 1 ? 4 : 1); return null; case 8: - ((GT_MetaTileEntity_Teleporter) this.mTileEntity.getMetaTileEntity()).mTargetX += (aShifthold == 1 ? 512 : 64); + ((GT_MetaTileEntity_Teleporter) this.mTileEntity.getMetaTileEntity()).mTargetX += + (aShifthold == 1 ? 512 : 64); return null; case 9: - ((GT_MetaTileEntity_Teleporter) this.mTileEntity.getMetaTileEntity()).mTargetY += (aShifthold == 1 ? 512 : 64); + ((GT_MetaTileEntity_Teleporter) this.mTileEntity.getMetaTileEntity()).mTargetY += + (aShifthold == 1 ? 512 : 64); return null; case 10: - ((GT_MetaTileEntity_Teleporter) this.mTileEntity.getMetaTileEntity()).mTargetZ += (aShifthold == 1 ? 512 : 64); + ((GT_MetaTileEntity_Teleporter) this.mTileEntity.getMetaTileEntity()).mTargetZ += + (aShifthold == 1 ? 512 : 64); return null; case 11: - ((GT_MetaTileEntity_Teleporter) this.mTileEntity.getMetaTileEntity()).mTargetD += (aShifthold == 1 ? 16 : 8); + ((GT_MetaTileEntity_Teleporter) this.mTileEntity.getMetaTileEntity()).mTargetD += + (aShifthold == 1 ? 16 : 8); return null; case 12: - ((GT_MetaTileEntity_Teleporter) this.mTileEntity.getMetaTileEntity()).mTargetX += (aShifthold == 1 ? 16 : 1); + ((GT_MetaTileEntity_Teleporter) this.mTileEntity.getMetaTileEntity()).mTargetX += + (aShifthold == 1 ? 16 : 1); return null; case 13: - ((GT_MetaTileEntity_Teleporter) this.mTileEntity.getMetaTileEntity()).mTargetY += (aShifthold == 1 ? 16 : 1); + ((GT_MetaTileEntity_Teleporter) this.mTileEntity.getMetaTileEntity()).mTargetY += + (aShifthold == 1 ? 16 : 1); return null; case 14: - ((GT_MetaTileEntity_Teleporter) this.mTileEntity.getMetaTileEntity()).mTargetZ += (aShifthold == 1 ? 16 : 1); + ((GT_MetaTileEntity_Teleporter) this.mTileEntity.getMetaTileEntity()).mTargetZ += + (aShifthold == 1 ? 16 : 1); return null; case 15: - ((GT_MetaTileEntity_Teleporter) this.mTileEntity.getMetaTileEntity()).mTargetD += (aShifthold == 1 ? 4 : 1); + ((GT_MetaTileEntity_Teleporter) this.mTileEntity.getMetaTileEntity()).mTargetD += + (aShifthold == 1 ? 4 : 1); return null; } } @@ -118,7 +134,10 @@ public class GT_Container_Teleporter extends GT_ContainerMetaTile_Machine { this.mTargetY = ((GT_MetaTileEntity_Teleporter) this.mTileEntity.getMetaTileEntity()).mTargetY; this.mTargetZ = ((GT_MetaTileEntity_Teleporter) this.mTileEntity.getMetaTileEntity()).mTargetZ; this.mTargetD = ((GT_MetaTileEntity_Teleporter) this.mTileEntity.getMetaTileEntity()).mTargetD; - this.mEgg = (((GT_MetaTileEntity_Teleporter) this.mTileEntity.getMetaTileEntity()).hasDimensionalTeleportCapability() ? 1 : 0); + this.mEgg = (((GT_MetaTileEntity_Teleporter) this.mTileEntity.getMetaTileEntity()) + .hasDimensionalTeleportCapability() + ? 1 + : 0); Iterator playerIterator = this.crafters.iterator(); while (playerIterator.hasNext()) { diff --git a/src/main/java/gregtech/common/gui/GT_GUIContainerVolumetricFlask.java b/src/main/java/gregtech/common/gui/GT_GUIContainerVolumetricFlask.java index 85fe2171b0..45df55cbe9 100644 --- a/src/main/java/gregtech/common/gui/GT_GUIContainerVolumetricFlask.java +++ b/src/main/java/gregtech/common/gui/GT_GUIContainerVolumetricFlask.java @@ -1,13 +1,12 @@ package gregtech.common.gui; - import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.GT_Values; import gregtech.api.net.GT_Packet_UpdateItem; import gregtech.common.items.GT_VolumetricFlask; -import gregtech.common.net.MessageSetFlaskCapacity; -import net.minecraft.client.Minecraft; +import java.text.DecimalFormat; +import java.text.ParseException; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiTextField; @@ -16,12 +15,10 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; -import java.text.DecimalFormat; -import java.text.ParseException; - @SideOnly(Side.CLIENT) public final class GT_GUIContainerVolumetricFlask extends GuiContainer { - private static final ResourceLocation BACKGROUND = new ResourceLocation("gregtech:textures/gui/VolumetricFlask.png"); + private static final ResourceLocation BACKGROUND = + new ResourceLocation("gregtech:textures/gui/VolumetricFlask.png"); private GuiIntegerBox amount; private GuiButton apply; @@ -56,7 +53,13 @@ public final class GT_GUIContainerVolumetricFlask extends GuiContainer { buttonList.add(apply = new GuiButton(0, guiLeft + 128, guiTop + 51, 38, 20, "Accept")); - amount = new GuiIntegerBox(fontRendererObj, guiLeft + 62, guiTop + 57, 59, fontRendererObj.FONT_HEIGHT, ((GT_VolumetricFlask) container.flask.getItem()).getMaxCapacity()); + amount = new GuiIntegerBox( + fontRendererObj, + guiLeft + 62, + guiTop + 57, + 59, + fontRendererObj.FONT_HEIGHT, + ((GT_VolumetricFlask) container.flask.getItem()).getMaxCapacity()); amount.setEnableBackgroundDrawing(false); amount.setMaxStringLength(16); amount.setTextColor(16777215); @@ -67,7 +70,6 @@ public final class GT_GUIContainerVolumetricFlask extends GuiContainer { amount.setText(String.valueOf(((GT_VolumetricFlask) container.flask.getItem()).getCapacity(container.flask))); } - @Override protected final void drawGuiContainerBackgroundLayer(float f, int x, int y) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); @@ -84,13 +86,17 @@ public final class GT_GUIContainerVolumetricFlask extends GuiContainer { amount.drawTextBox(); } - @Override protected void keyTyped(char character, int key) { if (!checkHotbarKeys(key)) { - if (key == 28) - actionPerformed(apply); - if (((key == 211) || (key == 205) || (key == 203) || (key == 14) || (character == '-') || (Character.isDigit(character))) && (amount.textboxKeyTyped(character, key))) { + if (key == 28) actionPerformed(apply); + if (((key == 211) + || (key == 205) + || (key == 203) + || (key == 14) + || (character == '-') + || (Character.isDigit(character))) + && (amount.textboxKeyTyped(character, key))) { try { String out = amount.getText(); boolean fixed = false; @@ -171,7 +177,6 @@ public final class GT_GUIContainerVolumetricFlask extends GuiContainer { } } - protected int getQty(GuiButton btn) { try { DecimalFormat df = new DecimalFormat("+#;-#"); @@ -194,7 +199,6 @@ public final class GT_GUIContainerVolumetricFlask extends GuiContainer { this.maxValue = maxValue; } - @Override public void writeText(String selectedText) { String original = getText(); @@ -212,7 +216,6 @@ public final class GT_GUIContainerVolumetricFlask extends GuiContainer { } } - @Override public void setText(String s) { try { @@ -228,5 +231,4 @@ public final class GT_GUIContainerVolumetricFlask extends GuiContainer { super.setText(s); } } - } diff --git a/src/main/java/gregtech/common/gui/GT_GUIContainer_Boiler.java b/src/main/java/gregtech/common/gui/GT_GUIContainer_Boiler.java index 0c9b6e1f93..ef7ed15720 100644 --- a/src/main/java/gregtech/common/gui/GT_GUIContainer_Boiler.java +++ b/src/main/java/gregtech/common/gui/GT_GUIContainer_Boiler.java @@ -8,7 +8,8 @@ public class GT_GUIContainer_Boiler extends GT_GUIContainerMetaTile_Machine { private final int textColor = this.getTextColorOrDefault("title", 0x404040); - public GT_GUIContainer_Boiler(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aTextureName) { + public GT_GUIContainer_Boiler( + InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aTextureName) { super(new GT_Container_Boiler(aInventoryPlayer, aTileEntity), "gregtech:textures/gui/" + aTextureName); } diff --git a/src/main/java/gregtech/common/gui/GT_GUIContainer_BronzeBlastFurnace.java b/src/main/java/gregtech/common/gui/GT_GUIContainer_BronzeBlastFurnace.java index 6e51d85f32..b92f7e9243 100644 --- a/src/main/java/gregtech/common/gui/GT_GUIContainer_BronzeBlastFurnace.java +++ b/src/main/java/gregtech/common/gui/GT_GUIContainer_BronzeBlastFurnace.java @@ -9,7 +9,9 @@ public class GT_GUIContainer_BronzeBlastFurnace extends GT_GUIContainerMetaTile_ private final int textColor = this.getTextColorOrDefault("title", 0x404040); public GT_GUIContainer_BronzeBlastFurnace(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(new GT_Container_BronzeBlastFurnace(aInventoryPlayer, aTileEntity), "gregtech:textures/gui/BronzeBlastFurnace.png"); + super( + new GT_Container_BronzeBlastFurnace(aInventoryPlayer, aTileEntity), + "gregtech:textures/gui/BronzeBlastFurnace.png"); } @Override @@ -23,9 +25,23 @@ public class GT_GUIContainer_BronzeBlastFurnace extends GT_GUIContainerMetaTile_ int x = (this.width - this.xSize) / 2; int y = (this.height - this.ySize) / 2; drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize); - if ((this.mContainer != null) && - (this.mContainer.mProgressTime > 0)) { - drawTexturedModalRect(x + 58, y + 28, 176, 0, Math.max(0, Math.min(20, (this.mContainer.mProgressTime > 0 ? 1 : 0) + this.mContainer.mProgressTime * 20 / (this.mContainer.mMaxProgressTime < 1 ? 1 : this.mContainer.mMaxProgressTime))), 11); + if ((this.mContainer != null) && (this.mContainer.mProgressTime > 0)) { + drawTexturedModalRect( + x + 58, + y + 28, + 176, + 0, + Math.max( + 0, + Math.min( + 20, + (this.mContainer.mProgressTime > 0 ? 1 : 0) + + this.mContainer.mProgressTime + * 20 + / (this.mContainer.mMaxProgressTime < 1 + ? 1 + : this.mContainer.mMaxProgressTime))), + 11); } } } diff --git a/src/main/java/gregtech/common/gui/GT_GUIContainer_FusionReactor.java b/src/main/java/gregtech/common/gui/GT_GUIContainer_FusionReactor.java index b6a86fd668..87e035c61a 100644 --- a/src/main/java/gregtech/common/gui/GT_GUIContainer_FusionReactor.java +++ b/src/main/java/gregtech/common/gui/GT_GUIContainer_FusionReactor.java @@ -1,28 +1,33 @@ package gregtech.common.gui; +import static gregtech.api.enums.GT_Values.RES_PATH_GUI; + import gregtech.api.gui.GT_Container_MultiMachine; import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.util.GT_Utility; import gregtech.nei.NEI_TransferRectHost; -import net.minecraft.entity.player.InventoryPlayer; - import java.awt.Rectangle; - -import static gregtech.api.enums.GT_Values.RES_PATH_GUI; +import net.minecraft.entity.player.InventoryPlayer; public class GT_GUIContainer_FusionReactor extends GT_GUIContainerMetaTile_Machine implements NEI_TransferRectHost { public String mNEI; String mName = ""; - private final int - textColor = this.getTextColorOrDefault("text", 0xFAFAFF), - textColorTitle = this.getTextColorOrDefault("title", 0xFAFAFF), - textColorValue = this.getTextColorOrDefault("value", 0xFF0000); + private final int textColor = this.getTextColorOrDefault("text", 0xFAFAFF), + textColorTitle = this.getTextColorOrDefault("title", 0xFAFAFF), + textColorValue = this.getTextColorOrDefault("value", 0xFF0000); - public GT_GUIContainer_FusionReactor(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aTextureFile, String aNEI) { - super(new GT_Container_MultiMachine(aInventoryPlayer, aTileEntity, false), RES_PATH_GUI + "multimachines/" + (aTextureFile == null ? "MultiblockDisplay" : aTextureFile)); + public GT_GUIContainer_FusionReactor( + InventoryPlayer aInventoryPlayer, + IGregTechTileEntity aTileEntity, + String aName, + String aTextureFile, + String aNEI) { + super( + new GT_Container_MultiMachine(aInventoryPlayer, aTileEntity, false), + RES_PATH_GUI + "multimachines/" + (aTextureFile == null ? "MultiblockDisplay" : aTextureFile)); mName = aName; mNEI = aNEI; } @@ -37,21 +42,23 @@ public class GT_GUIContainer_FusionReactor extends GT_GUIContainerMetaTile_Machi if (mContainer.mDisplayErrorCode == 0) { if (mContainer.mActive == 0) { - fontRendererObj.drawString("Hit with Soft Mallet to (re-)start the Machine if it doesn't start.", -70, 170, textColor); + fontRendererObj.drawString( + "Hit with Soft Mallet to (re-)start the Machine if it doesn't start.", -70, 170, textColor); } else { fontRendererObj.drawString("Running perfectly.", 10, 170, textColor); } } - if(this.mContainer.mEnergy > 160000000 && this.mContainer.mEnergy < 160010000) + if (this.mContainer.mEnergy > 160000000 && this.mContainer.mEnergy < 160010000) fontRendererObj.drawString("160,000,000 EU", 50, 155, textColorValue); - else if(this.mContainer.mEnergy > 320000000 && this.mContainer.mEnergy < 320010000) + else if (this.mContainer.mEnergy > 320000000 && this.mContainer.mEnergy < 320010000) fontRendererObj.drawString("320,000,000 EU", 50, 155, textColorValue); - else if(this.mContainer.mEnergy > 640000000 && this.mContainer.mEnergy < 640010000) + else if (this.mContainer.mEnergy > 640000000 && this.mContainer.mEnergy < 640010000) fontRendererObj.drawString("640,000,000 EU", 50, 155, textColorValue); - else if(this.mContainer.mEnergyLong > 5120000000L && this.mContainer.mEnergyLong < 5120080000L) + else if (this.mContainer.mEnergyLong > 5120000000L && this.mContainer.mEnergyLong < 5120080000L) fontRendererObj.drawString("5,120,000,000 EU", 50, 155, textColorValue); else - fontRendererObj.drawString(GT_Utility.formatNumbers(this.mContainer.mEnergyLong) + " EU", 50, 155, textColorValue); + fontRendererObj.drawString( + GT_Utility.formatNumbers(this.mContainer.mEnergyLong) + " EU", 50, 155, textColorValue); } } diff --git a/src/main/java/gregtech/common/gui/GT_GUIContainer_IndustrialApiary.java b/src/main/java/gregtech/common/gui/GT_GUIContainer_IndustrialApiary.java index 9b0de5ba81..2225822764 100644 --- a/src/main/java/gregtech/common/gui/GT_GUIContainer_IndustrialApiary.java +++ b/src/main/java/gregtech/common/gui/GT_GUIContainer_IndustrialApiary.java @@ -9,110 +9,135 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.util.GT_TooltipDataCache; import gregtech.api.util.GT_Utility; import gregtech.common.tileentities.machines.basic.GT_MetaTileEntity_IndustrialApiary; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.util.StatCollector; - import java.awt.*; import java.util.ArrayList; import java.util.Arrays; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.util.StatCollector; public class GT_GUIContainer_IndustrialApiary extends GT_GUIContainerMetaTile_Machine { - private static final String - BATTERY_SLOT_TOOLTIP = "GT5U.machines.battery_slot.tooltip", - UNUSED_SLOT_TOOLTIP = "GT5U.machines.unused_slot.tooltip", - STALLED_STUTTERING_TOOLTIP = "GT5U.machines.stalled_stuttering.tooltip", - ITEM_TRANSFER_TOOLTIP = "GT5U.machines.item_transfer.tooltip", - POWER_SOURCE_POWER = "GT5U.machines.powersource.power", - CANCEL_PROCESS_TOOLTIP = "GT5U.machines.industrialapiary.cancel.tooltip", - SPEED_TOOLTIP = "GT5U.machines.industrialapiary.speed.tooltip", - SPEED_LOCKED_TOOLTIP = "GT5U.machines.industrialapiary.speedlocked.tooltip", - INFO_TOOLTIP = "GT5U.machines.industrialapiary.info.tooltip", - INFO_WITH_BEE_TOOLTIP = "GT5U.machines.industrialapiary.infoextended.tooltip", - UPGRADE_TOOLTIP = "GT5U.machines.industrialapiary.upgradeslot.tooltip" - ; - - private final int - textColor = this.getTextColorOrDefault("text", 0x404040), - textColorTitle = this.getTextColorOrDefault("title", 0x404040), - textColorValue = this.getTextColorOrDefault("value", 0x404040); + private static final String BATTERY_SLOT_TOOLTIP = "GT5U.machines.battery_slot.tooltip", + UNUSED_SLOT_TOOLTIP = "GT5U.machines.unused_slot.tooltip", + STALLED_STUTTERING_TOOLTIP = "GT5U.machines.stalled_stuttering.tooltip", + ITEM_TRANSFER_TOOLTIP = "GT5U.machines.item_transfer.tooltip", + POWER_SOURCE_POWER = "GT5U.machines.powersource.power", + CANCEL_PROCESS_TOOLTIP = "GT5U.machines.industrialapiary.cancel.tooltip", + SPEED_TOOLTIP = "GT5U.machines.industrialapiary.speed.tooltip", + SPEED_LOCKED_TOOLTIP = "GT5U.machines.industrialapiary.speedlocked.tooltip", + INFO_TOOLTIP = "GT5U.machines.industrialapiary.info.tooltip", + INFO_WITH_BEE_TOOLTIP = "GT5U.machines.industrialapiary.infoextended.tooltip", + UPGRADE_TOOLTIP = "GT5U.machines.industrialapiary.upgradeslot.tooltip"; + private final int textColor = this.getTextColorOrDefault("text", 0x404040), + textColorTitle = this.getTextColorOrDefault("title", 0x404040), + textColorValue = this.getTextColorOrDefault("value", 0x404040); GT_GuiTooltip mErrorStatesTooltip; GT_GuiTooltip mSpeedToggleTooltip; GT_GuiTooltip mInfoTooltip; public GT_GUIContainer_IndustrialApiary(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(new GT_Container_IndustrialApiary(aInventoryPlayer, aTileEntity), "gregtech:textures/gui/basicmachines/IndustrialApiary.png"); + super( + new GT_Container_IndustrialApiary(aInventoryPlayer, aTileEntity), + "gregtech:textures/gui/basicmachines/IndustrialApiary.png"); } @Override protected void setupTooltips() { Rectangle tBeeProblemArea = new Rectangle(this.guiLeft + 100, this.guiTop + 63, 18, 18); - addToolTip(mErrorStatesTooltip = new GT_GuiTooltip(tBeeProblemArea, "") { - @Override - protected void onTick() { - boolean e = this.enabled; - super.onTick(); - this.enabled = e; - } - }); - addToolTip(mSpeedToggleTooltip = new GT_GuiSlotTooltip(getContainer().slotSpeedToggle, new GT_TooltipDataCache.TooltipData(null, null))); + addToolTip( + mErrorStatesTooltip = new GT_GuiTooltip(tBeeProblemArea, "") { + @Override + protected void onTick() { + boolean e = this.enabled; + super.onTick(); + this.enabled = e; + } + }); + addToolTip( + mSpeedToggleTooltip = new GT_GuiSlotTooltip( + getContainer().slotSpeedToggle, new GT_TooltipDataCache.TooltipData(null, null))); mErrorStatesTooltip.enabled = false; addToolTip(mInfoTooltip = new GT_GuiTooltip(new Rectangle(this.guiLeft + 163, guiTop + 5, 6, 17))); - addToolTip(new GT_GuiSlotTooltip(getContainer().slotCancelProcess, mTooltipCache.getData(CANCEL_PROCESS_TOOLTIP))); - getContainer().slotUpgrade.forEach(s->addToolTip(new GT_GuiSlotTooltip(s, mTooltipCache.getData(UPGRADE_TOOLTIP)))); - - - addToolTip(new GT_GuiSlotTooltip(getContainer().slotItemTransferToggle, mTooltipCache.getData(ITEM_TRANSFER_TOOLTIP))); - addToolTip(new GT_GuiSlotTooltip(getContainer().slotBattery, mTooltipCache.getData(BATTERY_SLOT_TOOLTIP, - powerTierName(getContainer().getMachine().mTier), - powerTierName((byte)(getContainer().getMachine().mTier + 1))))); + addToolTip( + new GT_GuiSlotTooltip(getContainer().slotCancelProcess, mTooltipCache.getData(CANCEL_PROCESS_TOOLTIP))); + getContainer() + .slotUpgrade + .forEach(s -> addToolTip(new GT_GuiSlotTooltip(s, mTooltipCache.getData(UPGRADE_TOOLTIP)))); + + addToolTip(new GT_GuiSlotTooltip( + getContainer().slotItemTransferToggle, mTooltipCache.getData(ITEM_TRANSFER_TOOLTIP))); + addToolTip(new GT_GuiSlotTooltip( + getContainer().slotBattery, + mTooltipCache.getData( + BATTERY_SLOT_TOOLTIP, powerTierName(getContainer().getMachine().mTier), powerTierName((byte) + (getContainer().getMachine().mTier + 1))))); addToolTip(new GT_GuiSlotTooltip(getContainer().slotSpecial, mTooltipCache.getData(UNUSED_SLOT_TOOLTIP))); } @Override public void drawScreen(int mouseX, int mouseY, float parTicks) { mErrorStatesTooltip.enabled = !getContainer().mErrorStates.isEmpty(); - if(mErrorStatesTooltip.enabled){ mErrorStatesTooltip.setToolTipText(new GT_TooltipDataCache.TooltipData(getContainer().mErrorStates, getContainer().mErrorStates)); } - else if(getContainer().mStuttering) - { + if (mErrorStatesTooltip.enabled) { + mErrorStatesTooltip.setToolTipText( + new GT_TooltipDataCache.TooltipData(getContainer().mErrorStates, getContainer().mErrorStates)); + } else if (getContainer().mStuttering) { mErrorStatesTooltip.enabled = true; - mErrorStatesTooltip.setToolTipText(mTooltipCache.getData(STALLED_STUTTERING_TOOLTIP, StatCollector.translateToLocal(POWER_SOURCE_POWER))); + mErrorStatesTooltip.setToolTipText(mTooltipCache.getData( + STALLED_STUTTERING_TOOLTIP, StatCollector.translateToLocal(POWER_SOURCE_POWER))); } int accelerated = (1 << getContainer().mSpeed); int energyusage = 0; - if(accelerated == 2) - energyusage = 32; - else if(accelerated > 2) - energyusage = 32 * accelerated << (getContainer().mSpeed - 2); - mSpeedToggleTooltip.setToolTipText(mTooltipCache.getUncachedTooltipData(getContainer().mLockedSpeed ? SPEED_LOCKED_TOOLTIP : SPEED_TOOLTIP, accelerated, GT_Utility.formatNumbers(energyusage))); + if (accelerated == 2) energyusage = 32; + else if (accelerated > 2) energyusage = 32 * accelerated << (getContainer().mSpeed - 2); + mSpeedToggleTooltip.setToolTipText(mTooltipCache.getUncachedTooltipData( + getContainer().mLockedSpeed ? SPEED_LOCKED_TOOLTIP : SPEED_TOOLTIP, + accelerated, + GT_Utility.formatNumbers(energyusage))); ArrayList<String> s = new ArrayList<>(); GT_MetaTileEntity_IndustrialApiary IA = getContainer().getMachine(); - String energyreq = GT_Utility.formatNumbers((int)((float)GT_MetaTileEntity_IndustrialApiary.baseEUtUsage * IA.getEnergyModifier() * accelerated) + energyusage); + String energyreq = GT_Utility.formatNumbers( + (int) ((float) GT_MetaTileEntity_IndustrialApiary.baseEUtUsage * IA.getEnergyModifier() * accelerated) + + energyusage); String Temp = StatCollector.translateToLocal(IA.getTemperature().getName()); String Hum = StatCollector.translateToLocal(IA.getHumidity().getName()); boolean moreinformationgiven = false; - if(IA.getUsedQueen() != null && BeeManager.beeRoot.isMember(IA.getUsedQueen(), EnumBeeType.QUEEN.ordinal())) { + if (IA.getUsedQueen() != null && BeeManager.beeRoot.isMember(IA.getUsedQueen(), EnumBeeType.QUEEN.ordinal())) { IBee bee = BeeManager.beeRoot.getMember(IA.getUsedQueen()); if (bee.isAnalyzed()) { moreinformationgiven = true; IBeeGenome genome = bee.getGenome(); - IBeeModifier mod = BeeManager.beeRoot.getBeekeepingMode(IA.getWorld()).getBeeModifier(); + IBeeModifier mod = + BeeManager.beeRoot.getBeekeepingMode(IA.getWorld()).getBeeModifier(); float tmod = IA.getTerritoryModifier(null, 1f) * mod.getTerritoryModifier(null, 1f); - int[] t = Arrays.stream(genome.getTerritory()).map(i -> (int) ((float) i * tmod)).toArray(); - mInfoTooltip.setToolTipText(mTooltipCache.getUncachedTooltipData(INFO_WITH_BEE_TOOLTIP, energyreq, Temp, Hum, - Math.round(100f * IA.getProductionModifier(null, 1f) * genome.getSpeed() * mod.getProductionModifier(null, 1f)), - Math.round(IA.getFloweringModifier(null, 1f) * genome.getFlowering() * mod.getFloweringModifier(null, 1f)), - Math.round(IA.getLifespanModifier(null, null, 1f) * genome.getLifespan() * mod.getLifespanModifier(null, null, 1f)), - t[0], t[1], t[2])); + int[] t = Arrays.stream(genome.getTerritory()) + .map(i -> (int) ((float) i * tmod)) + .toArray(); + mInfoTooltip.setToolTipText(mTooltipCache.getUncachedTooltipData( + INFO_WITH_BEE_TOOLTIP, + energyreq, + Temp, + Hum, + Math.round(100f + * IA.getProductionModifier(null, 1f) + * genome.getSpeed() + * mod.getProductionModifier(null, 1f)), + Math.round(IA.getFloweringModifier(null, 1f) + * genome.getFlowering() + * mod.getFloweringModifier(null, 1f)), + Math.round(IA.getLifespanModifier(null, null, 1f) + * genome.getLifespan() + * mod.getLifespanModifier(null, null, 1f)), + t[0], + t[1], + t[2])); } } - if(!moreinformationgiven) + if (!moreinformationgiven) mInfoTooltip.setToolTipText(mTooltipCache.getUncachedTooltipData(INFO_TOOLTIP, energyreq, Temp, Hum)); - super.drawScreen(mouseX, mouseY, parTicks); } @@ -130,18 +155,17 @@ public class GT_GUIContainer_IndustrialApiary extends GT_GUIContainerMetaTile_Ma int y = (this.height - this.ySize) / 2; drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize); if (this.mContainer != null) { - if (getContainer().mItemTransfer) - drawTexturedModalRect(x + 7, y + 62, 176, 18, 18, 18); - if(getContainer().mMaxProgressTime > 0) { + if (getContainer().mItemTransfer) drawTexturedModalRect(x + 7, y + 62, 176, 18, 18, 18); + if (getContainer().mMaxProgressTime > 0) { double p = (double) getContainer().mProgressTime / getContainer().mMaxProgressTime; - drawTexturedModalRect(x+70, y+3, 176, 0, (int)(p*20), 18); + drawTexturedModalRect(x + 70, y + 3, 176, 0, (int) (p * 20), 18); } - if(mErrorStatesTooltip.enabled) - drawTexturedModalRect(x+100, y+63, 176, 36, getContainer().mStuttering ? 18 : 9, 18); + if (mErrorStatesTooltip.enabled) + drawTexturedModalRect(x + 100, y + 63, 176, 36, getContainer().mStuttering ? 18 : 9, 18); } } - private GT_Container_IndustrialApiary getContainer(){ + private GT_Container_IndustrialApiary getContainer() { return ((GT_Container_IndustrialApiary) this.mContainer); } @@ -149,5 +173,4 @@ public class GT_GUIContainer_IndustrialApiary extends GT_GUIContainerMetaTile_Ma private String powerTierName(byte machineTier) { return GT_Values.TIER_COLORS[machineTier] + GT_Values.VN[machineTier]; } - } diff --git a/src/main/java/gregtech/common/gui/GT_GUIContainer_InputBus_ME.java b/src/main/java/gregtech/common/gui/GT_GUIContainer_InputBus_ME.java index 51e6289d3d..9b19da6367 100644 --- a/src/main/java/gregtech/common/gui/GT_GUIContainer_InputBus_ME.java +++ b/src/main/java/gregtech/common/gui/GT_GUIContainer_InputBus_ME.java @@ -1,10 +1,5 @@ package gregtech.common.gui; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.client.renderer.entity.RenderItem; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Slot; - import appeng.client.render.AppEngRenderItem; import appeng.core.AELog; import appeng.integration.IntegrationRegistry; @@ -15,8 +10,12 @@ import cpw.mods.fml.common.Optional; import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; import gregtech.api.gui.GT_Slot_Holo_ME; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Slot; -public class GT_GUIContainer_InputBus_ME extends GT_GUIContainerMetaTile_Machine { +public class GT_GUIContainer_InputBus_ME extends GT_GUIContainerMetaTile_Machine { private final AppEngRenderItem aeRenderItem = new AppEngRenderItem(); @@ -31,19 +30,17 @@ public class GT_GUIContainer_InputBus_ME extends GT_GUIContainerMetaTile_Machin int y = (this.height - this.ySize) / 2; drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize); } - + // base method is made public by AE2 ASM - public void func_146977_a( final Slot s ) - { - this.drawSlot( s ); + public void func_146977_a(final Slot s) { + this.drawSlot(s); } @Optional.Method(modid = "appliedenergistics2") private RenderItem setItemRender(final RenderItem item) { if (IntegrationRegistry.INSTANCE.isEnabled(IntegrationType.NEI)) { - return ((INEI)IntegrationRegistry.INSTANCE.getInstance(IntegrationType.NEI)).setItemRender(item); - } - else { + return ((INEI) IntegrationRegistry.INSTANCE.getInstance(IntegrationType.NEI)).setItemRender(item); + } else { final RenderItem ri = itemRender; itemRender = item; return ri; @@ -51,31 +48,30 @@ public class GT_GUIContainer_InputBus_ME extends GT_GUIContainerMetaTile_Machin } @Optional.Method(modid = "appliedenergistics2") - private void drawSlot( final Slot s ) { + private void drawSlot(final Slot s) { if (s instanceof GT_Slot_Holo_ME) { - final RenderItem pIR = this.setItemRender( this.aeRenderItem ); + final RenderItem pIR = this.setItemRender(this.aeRenderItem); try { this.zLevel = 0.0F; itemRender.zLevel = 0.0F; - this.aeRenderItem.setAeStack( Platform.getAEStackInSlot( s ) ); - this.safeDrawSlot( s ); - } - catch (final Exception err) { - AELog.warn( "[AppEng] AE prevented crash while drawing slot: " + err.toString()); + this.aeRenderItem.setAeStack(Platform.getAEStackInSlot(s)); + this.safeDrawSlot(s); + } catch (final Exception err) { + AELog.warn("[AppEng] AE prevented crash while drawing slot: " + err.toString()); } - this.setItemRender( pIR ); + this.setItemRender(pIR); return; } safeDrawSlot(s); } @Optional.Method(modid = "appliedenergistics2") - private void safeDrawSlot( final Slot s ) - { + private void safeDrawSlot(final Slot s) { try { - GuiContainer.class.getDeclaredMethod( "func_146977_a_original", Slot.class ).invoke( this, s ); - } - catch (final Exception ignored) { + GuiContainer.class + .getDeclaredMethod("func_146977_a_original", Slot.class) + .invoke(this, s); + } catch (final Exception ignored) { } } } diff --git a/src/main/java/gregtech/common/gui/GT_GUIContainer_ItemDistributor.java b/src/main/java/gregtech/common/gui/GT_GUIContainer_ItemDistributor.java index d4a2484a88..2c8fa870a1 100644 --- a/src/main/java/gregtech/common/gui/GT_GUIContainer_ItemDistributor.java +++ b/src/main/java/gregtech/common/gui/GT_GUIContainer_ItemDistributor.java @@ -6,7 +6,9 @@ import net.minecraft.entity.player.InventoryPlayer; public class GT_GUIContainer_ItemDistributor extends GT_GUIContainerMetaTile_Machine { public GT_GUIContainer_ItemDistributor(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(new GT_Container_ItemDistributor(aInventoryPlayer, aTileEntity), "gregtech:textures/gui/ItemDistributor.png"); + super( + new GT_Container_ItemDistributor(aInventoryPlayer, aTileEntity), + "gregtech:textures/gui/ItemDistributor.png"); } @Override diff --git a/src/main/java/gregtech/common/gui/GT_GUIContainer_MicrowaveEnergyTransmitter.java b/src/main/java/gregtech/common/gui/GT_GUIContainer_MicrowaveEnergyTransmitter.java index 9421441f22..7b0b840276 100644 --- a/src/main/java/gregtech/common/gui/GT_GUIContainer_MicrowaveEnergyTransmitter.java +++ b/src/main/java/gregtech/common/gui/GT_GUIContainer_MicrowaveEnergyTransmitter.java @@ -1,32 +1,66 @@ package gregtech.common.gui; +import static gregtech.api.enums.GT_Values.RES_PATH_GUI; + import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.InventoryPlayer; -import static gregtech.api.enums.GT_Values.RES_PATH_GUI; - public class GT_GUIContainer_MicrowaveEnergyTransmitter extends GT_GUIContainerMetaTile_Machine { - - private final int - textColor = this.getTextColorOrDefault("text", 0xFAFAFF), - textColorTitle = this.getTextColorOrDefault("title", 0xFAFAFF); - public GT_GUIContainer_MicrowaveEnergyTransmitter(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(new GT_Container_MicrowaveEnergyTransmitter(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "Teleporter.png"); + private final int textColor = this.getTextColorOrDefault("text", 0xFAFAFF), + textColorTitle = this.getTextColorOrDefault("title", 0xFAFAFF); + + public GT_GUIContainer_MicrowaveEnergyTransmitter( + InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { + super( + new GT_Container_MicrowaveEnergyTransmitter(aInventoryPlayer, aTileEntity), + RES_PATH_GUI + "Teleporter.png"); } @Override protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { this.fontRendererObj.drawString("Teleporter", 46, 8, textColorTitle); if (this.mContainer != null) { - this.fontRendererObj.drawString("X: " + GT_Utility.parseNumberToString(((GT_Container_MicrowaveEnergyTransmitter) this.mContainer).mTargetX), 46, 16, textColor); - this.fontRendererObj.drawString("Y: " + GT_Utility.parseNumberToString(((GT_Container_MicrowaveEnergyTransmitter) this.mContainer).mTargetY), 46, 24, textColor); - this.fontRendererObj.drawString("Z: " + GT_Utility.parseNumberToString(((GT_Container_MicrowaveEnergyTransmitter) this.mContainer).mTargetZ), 46, 32, textColor); + this.fontRendererObj.drawString( + "X: " + + GT_Utility.parseNumberToString( + ((GT_Container_MicrowaveEnergyTransmitter) this.mContainer).mTargetX), + 46, + 16, + textColor); + this.fontRendererObj.drawString( + "Y: " + + GT_Utility.parseNumberToString( + ((GT_Container_MicrowaveEnergyTransmitter) this.mContainer).mTargetY), + 46, + 24, + textColor); + this.fontRendererObj.drawString( + "Z: " + + GT_Utility.parseNumberToString( + ((GT_Container_MicrowaveEnergyTransmitter) this.mContainer).mTargetZ), + 46, + 32, + textColor); if (((GT_Container_MicrowaveEnergyTransmitter) this.mContainer).mEgg > 0) { - this.fontRendererObj.drawString("Dim: " + GT_Utility.parseNumberToString(((GT_Container_MicrowaveEnergyTransmitter) this.mContainer).mTargetD), 46, 40, textColor); - this.fontRendererObj.drawString("Dim Valid: " + (GT_Utility.isRealDimension(((GT_Container_MicrowaveEnergyTransmitter) this.mContainer).mTargetD) ? "Yes":"No"), 46, 48, textColor); + this.fontRendererObj.drawString( + "Dim: " + + GT_Utility.parseNumberToString( + ((GT_Container_MicrowaveEnergyTransmitter) this.mContainer).mTargetD), + 46, + 40, + textColor); + this.fontRendererObj.drawString( + "Dim Valid: " + + (GT_Utility.isRealDimension( + ((GT_Container_MicrowaveEnergyTransmitter) this.mContainer).mTargetD) + ? "Yes" + : "No"), + 46, + 48, + textColor); } } } diff --git a/src/main/java/gregtech/common/gui/GT_GUIContainer_OutputHatch.java b/src/main/java/gregtech/common/gui/GT_GUIContainer_OutputHatch.java index 789e11e6f1..605fb5a463 100644 --- a/src/main/java/gregtech/common/gui/GT_GUIContainer_OutputHatch.java +++ b/src/main/java/gregtech/common/gui/GT_GUIContainer_OutputHatch.java @@ -1,5 +1,7 @@ package gregtech.common.gui; +import static gregtech.api.enums.GT_Values.RES_PATH_GUI; + import codechicken.nei.VisiblityData; import codechicken.nei.api.INEIGuiHandler; import codechicken.nei.api.TaggedInventoryArea; @@ -9,40 +11,43 @@ import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.net.GT_Packet_SetLockedFluid; import gregtech.api.util.GT_Utility; +import java.util.Collections; +import java.util.List; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.StatCollector; import net.minecraftforge.fluids.FluidStack; -import java.util.Collections; -import java.util.List; - -import static gregtech.api.enums.GT_Values.RES_PATH_GUI; - @Optional.Interface(modid = "NotEnoughItems", iface = "codechicken.nei.api.INEIGuiHandler") public class GT_GUIContainer_OutputHatch extends GT_GUIContainerMetaTile_Machine implements INEIGuiHandler { private final String mName; - private final int - textColor = this.getTextColorOrDefault("text", 0xFAFAFF), - textColorTitle = this.getTextColorOrDefault("title", 0x404040), - textColorValue = this.getTextColorOrDefault("value", 0xFAFAFF); + private final int textColor = this.getTextColorOrDefault("text", 0xFAFAFF), + textColorTitle = this.getTextColorOrDefault("title", 0x404040), + textColorValue = this.getTextColorOrDefault("value", 0xFAFAFF); - public GT_GUIContainer_OutputHatch(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) { + public GT_GUIContainer_OutputHatch( + InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) { super(new GT_Container_OutputHatch(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "OutputHatch.png"); mName = aName; } @Override protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { - fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 8, ySize - 96 + 2, textColorTitle); + fontRendererObj.drawString( + StatCollector.translateToLocal("container.inventory"), 8, ySize - 96 + 2, textColorTitle); fontRendererObj.drawString(mName, 8, 6, textColorTitle); if (mContainer != null) { fontRendererObj.drawString("Liquid Amount", 10, 20, textColor); - fontRendererObj.drawString(GT_Utility.parseNumberToString(((GT_Container_OutputHatch) mContainer).mContent), 10, 30, textColorValue); + fontRendererObj.drawString( + GT_Utility.parseNumberToString(((GT_Container_OutputHatch) mContainer).mContent), + 10, + 30, + textColorValue); fontRendererObj.drawString("Locked Fluid", 101, 20, textColor); - ItemStack tLockedDisplayStack = (ItemStack) mContainer.getInventory().get(3); + ItemStack tLockedDisplayStack = + (ItemStack) mContainer.getInventory().get(3); String fluidName = tLockedDisplayStack == null ? "None" : tLockedDisplayStack.getDisplayName(); fontRendererObj.drawString(fluidName, 101, 30, textColorValue); } @@ -74,7 +79,8 @@ public class GT_GUIContainer_OutputHatch extends GT_GUIContainerMetaTile_Machine @Override public boolean handleDragNDrop(GuiContainer gui, int mousex, int mousey, ItemStack draggedStack, int button) { - if (gui instanceof GT_GUIContainer_OutputHatch && ((GT_GUIContainer_OutputHatch) gui).isMouseOverSlot(3, mousex, mousey)) { + if (gui instanceof GT_GUIContainer_OutputHatch + && ((GT_GUIContainer_OutputHatch) gui).isMouseOverSlot(3, mousex, mousey)) { // the instanceof check should be unnecessary, but we will do it regardless, just in case. FluidStack tFluidStack; tFluidStack = GT_Utility.getFluidForFilledItem(draggedStack, true); @@ -82,7 +88,8 @@ public class GT_GUIContainer_OutputHatch extends GT_GUIContainerMetaTile_Machine tFluidStack = GT_Utility.getFluidFromDisplayStack(draggedStack); } if (tFluidStack != null) { - GT_Values.NW.sendToServer(new GT_Packet_SetLockedFluid(((GT_GUIContainer_OutputHatch) gui).mContainer.mTileEntity, tFluidStack)); + GT_Values.NW.sendToServer(new GT_Packet_SetLockedFluid( + ((GT_GUIContainer_OutputHatch) gui).mContainer.mTileEntity, tFluidStack)); draggedStack.stackSize = 0; return true; } diff --git a/src/main/java/gregtech/common/gui/GT_GUIContainer_PrimitiveBlastFurnace.java b/src/main/java/gregtech/common/gui/GT_GUIContainer_PrimitiveBlastFurnace.java index eff12be29a..060b93674a 100644 --- a/src/main/java/gregtech/common/gui/GT_GUIContainer_PrimitiveBlastFurnace.java +++ b/src/main/java/gregtech/common/gui/GT_GUIContainer_PrimitiveBlastFurnace.java @@ -5,23 +5,21 @@ import gregtech.api.gui.widgets.GT_GuiIcon; import gregtech.api.gui.widgets.GT_GuiTabLine.GT_GuiTabIconSet; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.nei.NEI_TransferRectHost; -import net.minecraft.entity.player.InventoryPlayer; - import java.awt.*; +import net.minecraft.entity.player.InventoryPlayer; public class GT_GUIContainer_PrimitiveBlastFurnace extends GT_GUIContainerMetaTile_Machine implements NEI_TransferRectHost { private String name; public String mNEI; - private final static GT_GuiTabIconSet TAB_ICONSET = new GT_GuiTabIconSet( - GT_GuiIcon.TAB_NORMAL_BRICK, - GT_GuiIcon.TAB_HIGHLIGHT_BRICK, - GT_GuiIcon.TAB_DISABLED_BRICK); + private static final GT_GuiTabIconSet TAB_ICONSET = new GT_GuiTabIconSet( + GT_GuiIcon.TAB_NORMAL_BRICK, GT_GuiIcon.TAB_HIGHLIGHT_BRICK, GT_GuiIcon.TAB_DISABLED_BRICK); private final int textColor = this.getTextColorOrDefault("title", 0x404040); - public GT_GUIContainer_PrimitiveBlastFurnace(InventoryPlayer inventoryPlayer, IGregTechTileEntity tileEntity, - String name, String aNEI) { - super(new GT_Container_PrimitiveBlastFurnace(inventoryPlayer, tileEntity), + public GT_GUIContainer_PrimitiveBlastFurnace( + InventoryPlayer inventoryPlayer, IGregTechTileEntity tileEntity, String name, String aNEI) { + super( + new GT_Container_PrimitiveBlastFurnace(inventoryPlayer, tileEntity), String.format("gregtech:textures/gui/%s.png", name.replace(" ", ""))); this.name = name; this.mNEI = aNEI; @@ -39,8 +37,19 @@ public class GT_GUIContainer_PrimitiveBlastFurnace extends GT_GUIContainerMetaTi int y = (this.height - this.ySize) / 2; drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize); if ((this.mContainer != null) && (this.mContainer.mProgressTime > 0)) { - drawTexturedModalRect(x + 58, y + 28, 176, 0, Math.max(0, Math.min(20, (1) - + this.mContainer.mProgressTime * 20 / (Math.max(this.mContainer.mMaxProgressTime, 1)))), + drawTexturedModalRect( + x + 58, + y + 28, + 176, + 0, + Math.max( + 0, + Math.min( + 20, + (1) + + this.mContainer.mProgressTime + * 20 + / (Math.max(this.mContainer.mMaxProgressTime, 1)))), 11); } } diff --git a/src/main/java/gregtech/common/gui/GT_GUIContainer_QuantumChest.java b/src/main/java/gregtech/common/gui/GT_GUIContainer_QuantumChest.java index 51086d3cfd..530e48e550 100644 --- a/src/main/java/gregtech/common/gui/GT_GUIContainer_QuantumChest.java +++ b/src/main/java/gregtech/common/gui/GT_GUIContainer_QuantumChest.java @@ -1,34 +1,38 @@ package gregtech.common.gui; +import static gregtech.api.enums.GT_Values.RES_PATH_GUI; + import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.StatCollector; -import static gregtech.api.enums.GT_Values.RES_PATH_GUI; - public class GT_GUIContainer_QuantumChest extends GT_GUIContainerMetaTile_Machine { private final String mName; - private final int - textColor = this.getTextColorOrDefault("text", 0xFAFAFF), - textColorTitle = this.getTextColorOrDefault("title", 0x404040), - textColorValue = this.getTextColorOrDefault("value", 0xFAFAFF); - + private final int textColor = this.getTextColorOrDefault("text", 0xFAFAFF), + textColorTitle = this.getTextColorOrDefault("title", 0x404040), + textColorValue = this.getTextColorOrDefault("value", 0xFAFAFF); - public GT_GUIContainer_QuantumChest(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) { + public GT_GUIContainer_QuantumChest( + InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) { super(new GT_Container_QuantumChest(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "BasicTank.png"); mName = aName; } @Override protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { - fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 8, ySize - 96 + 2, textColorTitle); + fontRendererObj.drawString( + StatCollector.translateToLocal("container.inventory"), 8, ySize - 96 + 2, textColorTitle); fontRendererObj.drawString(mName, 8, 6, textColorTitle); if (mContainer != null) { fontRendererObj.drawString("Item Amount", 10, 20, textColor); - fontRendererObj.drawString(GT_Utility.parseNumberToString(((GT_Container_QuantumChest) mContainer).mContent), 10, 30, textColorValue); + fontRendererObj.drawString( + GT_Utility.parseNumberToString(((GT_Container_QuantumChest) mContainer).mContent), + 10, + 30, + textColorValue); } } diff --git a/src/main/java/gregtech/common/gui/GT_GUIContainer_RecipeFilter.java b/src/main/java/gregtech/common/gui/GT_GUIContainer_RecipeFilter.java index 07f81ccf80..8bfc2c0944 100644 --- a/src/main/java/gregtech/common/gui/GT_GUIContainer_RecipeFilter.java +++ b/src/main/java/gregtech/common/gui/GT_GUIContainer_RecipeFilter.java @@ -8,14 +8,16 @@ import net.minecraft.entity.player.InventoryPlayer; public class GT_GUIContainer_RecipeFilter extends GT_GUIContainer_SpecialFilter { - private static final String REPRESENTATION_SLOT_TOOLTIP = "GT5U.recipe_filter.representation_slot.tooltip"; + private static final String REPRESENTATION_SLOT_TOOLTIP = "GT5U.recipe_filter.representation_slot.tooltip"; - public GT_GUIContainer_RecipeFilter(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(aInventoryPlayer, aTileEntity); - } + public GT_GUIContainer_RecipeFilter(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { + super(aInventoryPlayer, aTileEntity); + } - @Override - protected void setupTooltips() { - addToolTip(new GT_GuiSlotTooltip(((GT_Container_SpecialFilter) mContainer).getSpecialSlot(), mTooltipCache.getData(REPRESENTATION_SLOT_TOOLTIP))); - } + @Override + protected void setupTooltips() { + addToolTip(new GT_GuiSlotTooltip( + ((GT_Container_SpecialFilter) mContainer).getSpecialSlot(), + mTooltipCache.getData(REPRESENTATION_SLOT_TOOLTIP))); + } } diff --git a/src/main/java/gregtech/common/gui/GT_GUIContainer_Regulator.java b/src/main/java/gregtech/common/gui/GT_GUIContainer_Regulator.java index 6a02fc8bca..c3d579e58c 100644 --- a/src/main/java/gregtech/common/gui/GT_GUIContainer_Regulator.java +++ b/src/main/java/gregtech/common/gui/GT_GUIContainer_Regulator.java @@ -14,15 +14,24 @@ public class GT_GUIContainer_Regulator extends GT_GUIContainerMetaTile_Machine { @Override protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { - this.fontRendererObj.drawString(String.valueOf(((GT_Container_Regulator) this.mContainer).mTargetSlots[0]), 120, 9, textColor); - this.fontRendererObj.drawString(String.valueOf(((GT_Container_Regulator) this.mContainer).mTargetSlots[1]), 137, 9, textColor); - this.fontRendererObj.drawString(String.valueOf(((GT_Container_Regulator) this.mContainer).mTargetSlots[2]), 155, 9, textColor); - this.fontRendererObj.drawString(String.valueOf(((GT_Container_Regulator) this.mContainer).mTargetSlots[3]), 120, 26, textColor); - this.fontRendererObj.drawString(String.valueOf(((GT_Container_Regulator) this.mContainer).mTargetSlots[4]), 137, 26, textColor); - this.fontRendererObj.drawString(String.valueOf(((GT_Container_Regulator) this.mContainer).mTargetSlots[5]), 155, 26, textColor); - this.fontRendererObj.drawString(String.valueOf(((GT_Container_Regulator) this.mContainer).mTargetSlots[6]), 120, 43, textColor); - this.fontRendererObj.drawString(String.valueOf(((GT_Container_Regulator) this.mContainer).mTargetSlots[7]), 137, 43, textColor); - this.fontRendererObj.drawString(String.valueOf(((GT_Container_Regulator) this.mContainer).mTargetSlots[8]), 155, 43, textColor); + this.fontRendererObj.drawString( + String.valueOf(((GT_Container_Regulator) this.mContainer).mTargetSlots[0]), 120, 9, textColor); + this.fontRendererObj.drawString( + String.valueOf(((GT_Container_Regulator) this.mContainer).mTargetSlots[1]), 137, 9, textColor); + this.fontRendererObj.drawString( + String.valueOf(((GT_Container_Regulator) this.mContainer).mTargetSlots[2]), 155, 9, textColor); + this.fontRendererObj.drawString( + String.valueOf(((GT_Container_Regulator) this.mContainer).mTargetSlots[3]), 120, 26, textColor); + this.fontRendererObj.drawString( + String.valueOf(((GT_Container_Regulator) this.mContainer).mTargetSlots[4]), 137, 26, textColor); + this.fontRendererObj.drawString( + String.valueOf(((GT_Container_Regulator) this.mContainer).mTargetSlots[5]), 155, 26, textColor); + this.fontRendererObj.drawString( + String.valueOf(((GT_Container_Regulator) this.mContainer).mTargetSlots[6]), 120, 43, textColor); + this.fontRendererObj.drawString( + String.valueOf(((GT_Container_Regulator) this.mContainer).mTargetSlots[7]), 137, 43, textColor); + this.fontRendererObj.drawString( + String.valueOf(((GT_Container_Regulator) this.mContainer).mTargetSlots[8]), 155, 43, textColor); } @Override diff --git a/src/main/java/gregtech/common/gui/GT_GUIContainer_Teleporter.java b/src/main/java/gregtech/common/gui/GT_GUIContainer_Teleporter.java index 3d6aa6f966..a5e035b4ff 100644 --- a/src/main/java/gregtech/common/gui/GT_GUIContainer_Teleporter.java +++ b/src/main/java/gregtech/common/gui/GT_GUIContainer_Teleporter.java @@ -1,17 +1,16 @@ package gregtech.common.gui; +import static gregtech.api.enums.GT_Values.RES_PATH_GUI; + import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.InventoryPlayer; -import static gregtech.api.enums.GT_Values.RES_PATH_GUI; - public class GT_GUIContainer_Teleporter extends GT_GUIContainerMetaTile_Machine { - - private final int - textColor = this.getTextColorOrDefault("text", 0xFAFAFF), - textColorTitle = this.getTextColorOrDefault("text", 0xFAFAFF); + + private final int textColor = this.getTextColorOrDefault("text", 0xFAFAFF), + textColorTitle = this.getTextColorOrDefault("text", 0xFAFAFF); public GT_GUIContainer_Teleporter(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { super(new GT_Container_Teleporter(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "Teleporter.png"); @@ -21,12 +20,35 @@ public class GT_GUIContainer_Teleporter extends GT_GUIContainerMetaTile_Machine protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { this.fontRendererObj.drawString("Teleporter", 46, 8, textColorTitle); if (this.mContainer != null) { - this.fontRendererObj.drawString("X: " + GT_Utility.parseNumberToString(((GT_Container_Teleporter) this.mContainer).mTargetX), 46, 16, textColor); - this.fontRendererObj.drawString("Y: " + GT_Utility.parseNumberToString(((GT_Container_Teleporter) this.mContainer).mTargetY), 46, 24, textColor); - this.fontRendererObj.drawString("Z: " + GT_Utility.parseNumberToString(((GT_Container_Teleporter) this.mContainer).mTargetZ), 46, 32, textColor); + this.fontRendererObj.drawString( + "X: " + GT_Utility.parseNumberToString(((GT_Container_Teleporter) this.mContainer).mTargetX), + 46, + 16, + textColor); + this.fontRendererObj.drawString( + "Y: " + GT_Utility.parseNumberToString(((GT_Container_Teleporter) this.mContainer).mTargetY), + 46, + 24, + textColor); + this.fontRendererObj.drawString( + "Z: " + GT_Utility.parseNumberToString(((GT_Container_Teleporter) this.mContainer).mTargetZ), + 46, + 32, + textColor); if (((GT_Container_Teleporter) this.mContainer).mEgg > 0) { - this.fontRendererObj.drawString("Dim: " + GT_Utility.parseNumberToString(((GT_Container_Teleporter) this.mContainer).mTargetD), 46, 40, textColor); - this.fontRendererObj.drawString("Dim Valid: " + (GT_Utility.isRealDimension(((GT_Container_Teleporter) this.mContainer).mTargetD) ? "Yes":"No"), 46, 48, textColor); + this.fontRendererObj.drawString( + "Dim: " + GT_Utility.parseNumberToString(((GT_Container_Teleporter) this.mContainer).mTargetD), + 46, + 40, + textColor); + this.fontRendererObj.drawString( + "Dim Valid: " + + (GT_Utility.isRealDimension(((GT_Container_Teleporter) this.mContainer).mTargetD) + ? "Yes" + : "No"), + 46, + 48, + textColor); } } } diff --git a/src/main/java/gregtech/common/items/CombType.java b/src/main/java/gregtech/common/items/CombType.java index 50e3e853b2..49acf1be32 100644 --- a/src/main/java/gregtech/common/items/CombType.java +++ b/src/main/java/gregtech/common/items/CombType.java @@ -2,12 +2,10 @@ package gregtech.common.items; import gregtech.api.enums.Materials; import gregtech.api.util.GT_LanguageManager; - -import java.rmi.MarshalException; import java.util.Arrays; public enum CombType { - //Organic Line + // Organic Line LIGNIE(0, "lignite", true, Materials.Lignite, 100, 0x58300B, 0x906237), COAL(1, "coal", true, Materials.Coal, 100, 0x525252, 0x666666), STICKY(2, "stickyresin", true, Materials._NULL, 50, 0x2E8F5B, 0xDCC289), @@ -15,14 +13,14 @@ public enum CombType { APATITE(4, "apatite", true, Materials.Apatite, 100, 0xc1c1f6, 0x676784), ASH(5, "ash", true, Materials.Ash, 100, 0x1e1a18, 0xc6c6c6), - //IC2 Line + // IC2 Line COOLANT(6, "coolant", true, Materials._NULL, 100, 0x144F5A, 0x2494A2), ENERGY(7, "energy", true, Materials._NULL, 80, 0xC11F1F, 0xEBB9B9), LAPOTRON(8, "lapotron", true, Materials._NULL, 60, 0x1414FF, 0x6478FF), PYROTHEUM(9, "pyrotheum", true, Materials.Pyrotheum, 50, 0xffebc4, 0xe36400), CRYOTHEUM(10, "cryotheum", true, Materials.Pyrotheum, 50, 0x2660ff, 0x5af7ff), - //Alloy Line + // Alloy Line REDALLOY(11, "redalloy", true, Materials.RedAlloy, 100, 0xE60000, 0xB80000), REDSTONEALLOY(12, "redstonealloy", true, Materials.RedstoneAlloy, 90, 0xB80000, 0xA50808), CONDUCTIVEIRON(13, "conductiveiron", true, Materials.ConductiveIron, 80, 0x817671, 0xCEADA3), @@ -34,7 +32,7 @@ public enum CombType { STAINLESSSTEEL(19, "stainlesssteel", true, Materials.StainlessSteel, 75, 0x778899, 0xC8C8DC), ENDERIUM(20, "enderium", true, Materials.Enderium, 40, 0x2E8B57, 0x599087), - //Thaumcraft Line + // Thaumcraft Line THAUMIUMDUST(21, "thaumiumdust", true, Materials.Thaumium, 100, 0x7A007A, 0x5C005C), THAUMIUMSHARD(22, "thaumiumshard", true, Materials._NULL, 85, 0x9966FF, 0xAD85FF), AMBER(23, "amber", true, Materials.Amber, 90, 0x774B15, 0xEE7700), @@ -48,7 +46,7 @@ public enum CombType { DIVIDED(31, "divided", true, Materials.Unstable, 40, 0xF0F0F0, 0xDCDCDC), SPARKELING(32, "sparkling", true, Materials.NetherStar, 40, 0x7A007A, 0xFFFFFF), - //Gem Line + // Gem Line STONE(33, "stone", true, Materials._NULL, 70, 0x808080, 0x999999), CERTUS(34, "certus", true, Materials.CertusQuartz, 100, 0x57CFFB, 0xBBEEFF), FLUIX(35, "fluix", true, Materials.Fluix, 100, 0xA375FF, 0xB591FF), @@ -66,7 +64,7 @@ public enum CombType { GROSSULAR(47, "grossular", true, Materials.Grossular, 100, 0x9B4E00, 0x8B8B8B), FIRESTONE(48, "firestone", true, Materials.Firestone, 100, 0xC00000, 0xFF0000), - //Metals Line + // Metals Line SLAG(49, "slag", true, Materials._NULL, 50, 0xD4D4D4, 0x58300B), COPPER(50, "copper", true, Materials.Copper, 100, 0xFF6600, 0xE65C00), TIN(51, "tin", true, Materials.Tin, 100, 0xD4D4D4, 0xDDDDDD), @@ -81,7 +79,7 @@ public enum CombType { GALLIUM(60, "gallium", true, Materials.Gallium, 75, 0x8B8B8B, 0xC5C5E4), ARSENIC(61, "arsenic", true, Materials.Arsenic, 75, 0x736C52, 0x292412), - //Rare Metals Line + // Rare Metals Line BAUXITE(62, "bauxite", true, Materials.Bauxite, 85, 0x6B3600, 0x8B8B8B), ALUMINIUM(63, "aluminium", true, Materials.Aluminium, 60, 0x008AB8, 0xD6D6FF), MANGANESE(64, "manganese", true, Materials.Manganese, 30, 0xD5D5D5, 0xAAAAAA), @@ -98,7 +96,7 @@ public enum CombType { ELECTROTINE(75, "electrotine", true, Materials.Electrotine, 75, 0x1E90FF, 0x3CB4C8), ALMANDINE(76, "almandine", true, Materials.Almandine, 85, 0xC60000, 0x8B8B8B), - //Radioactive Line + // Radioactive Line URANIUM(77, "uranium", true, Materials.Uranium, 50, 0x19AF19, 0x169E16), PLUTONIUM(78, "plutonium", true, Materials.Plutonium, 10, 0x240000, 0x570000), NAQUADAH(79, "naquadah", true, Materials.Naquadah, 10, 0x000000, 0x004400), @@ -109,14 +107,14 @@ public enum CombType { AMERICIUM(84, "americium", true, Materials.Americium, 5, 0xE6E6FF, 0xC8C8C8), NEUTRONIUM(85, "neutronium", true, Materials.Neutronium, 2, 0xFFF0F0, 0xFAFAFA), - //Twilight + // Twilight NAGA(86, "naga", true, Materials._NULL, 100, 0x0D5A0D, 0x28874B), LICH(87, "lich", true, Materials._NULL, 90, 0x5C605E, 0xC5C5C5), HYDRA(88, "hydra", true, Materials._NULL, 80, 0x872836, 0xB8132C), URGHAST(89, "urghast", true, Materials._NULL, 70, 0x7C0618, 0xA7041C), SNOWQUEEN(90, "snowqueen", true, Materials._NULL, 60, 0x9C0018, 0xD02001), - //Space + // Space SPACE(91, "space", true, Materials._NULL, 100, 0x003366, 0xC0C0C0), METEORICIRON(92, "meteoriciron", true, Materials.MeteoricIron, 100, 0x321928, 0x643250), DESH(93, "desh", true, Materials.Desh, 90, 0x282828, 0x323232), @@ -129,7 +127,7 @@ public enum CombType { BLACKPLUTONIUM(100, "blackplutonium", true, Materials.Quantium, 25, 0x000000, 0x323232), TRINIUM(101, "trinium", true, Materials.Trinium, 25, 0xB0E0E6, 0xC8C8D2), - //Planet + // Planet MERCURY(102, "mercury", true, Materials._NULL, 65, 0x4A4033, 0xB5A288), VENUS(103, "venus", true, Materials._NULL, 65, 0x120E07, 0x272010), MOON(104, "moon", true, Materials._NULL, 90, 0x373735, 0x7E7E78), @@ -146,12 +144,12 @@ public enum CombType { BARNARDA(115, "barnarda", true, Materials._NULL, 10, 0x0D5A0D, 0xE6C18D), VEGA(116, "vega", true, Materials._NULL, 10, 0x1A2036, 0xB5C0DE), - //Infinity + // Infinity COSMICNEUTRONIUM(117, "cosmicneutronium", true, Materials._NULL, 5, 0x484848, 0x323232), INFINITYCATALYST(118, "infinitycatalyst", true, Materials._NULL, 2, 0xFFFFFF, 0xFFFFFF), INFINITY(119, "infinity", true, Materials._NULL, 1, 0xFFFFFF, 0xFFFFFF), - //HEE + // HEE ENDDUST(120, "enddust", true, Materials._NULL, 50, 0x003A7D, 0xCC00FA), ECTOPLASMA(121, "ectoplasma", true, Materials._NULL, 35, 0x381C40, 0xDCB0E5), ARCANESHARD(122, "arcaneshard", true, Materials._NULL, 35, 0x333D82, 0x9010AD), @@ -164,24 +162,25 @@ public enum CombType { RUNEII(129, "rune2", true, Materials._NULL, 10, 0xE31010, 0x0104D9), FIREESSENSE(130, "fireessence", true, Materials._NULL, 30, 0xFFA157, 0xD41238), CRYOLITE(131, "cryolite", true, Materials.Cryolite, 90, 0xBFEFFF, 0x73B9D0), - //(NOBLE) GAS LINE + // (NOBLE) GAS LINE HELIUM(132, "helium", true, Materials.Helium, 90, 0xFFA9FF, 0xFFFFC3), ARGON(133, "argon", true, Materials.Argon, 95, 0x89D9E1, 0x160822), - //XENON, NEON and KRYPTON Fluid extractor Recipes are located in GT_MachineRecipeLoader.java + // XENON, NEON and KRYPTON Fluid extractor Recipes are located in GT_MachineRecipeLoader.java XENON(134, "xenon", true, Materials._NULL, 85, 0x160822, 0x8A97B0), NEON(135, "neon", true, Materials._NULL, 90, 0xFF7200, 0xFFC826), KRYPTON(136, "krypton", true, Materials._NULL, 85, 0x160822, 0x8A97B0), NITROGEN(137, "nitrogen", true, Materials.Nitrogen, 100, 0xA52A2A, 0xFFC832), OXYGEN(138, "oxygen", true, Materials.Oxygen, 100, 0x8F8FFF, 0xFFFFFF), HYDROGEN(139, "hydrogen", true, Materials.Hydrogen, 100, 0xFF1493, 0xFFFFFF), - //Those are supposed to be in the organic branch, but that would require shifting all comb IDs and we don't want to risk it. + // Those are supposed to be in the organic branch, but that would require shifting all comb IDs and we don't want to + // risk it. PHOSPHORUS(140, "phosphorus", true, Materials.Phosphorus, 100, 0xC1C1F6, 0xFFC826), MICA(141, "mica", true, Materials.Mica, 100, 0x8A97B0, 0x2F3641), - //Seaweed is located in the planet line + // Seaweed is located in the planet line SEAWEED(142, "seaweed", true, Materials._NULL, 90, 0x83FF83, 0xCBCBCB), - //just Walrus + // just Walrus WALRUS(143, "walrus", true, Materials._NULL, 100, 0xB5CFC9, 0xD6D580), - //TC infused Air shards line. Recipes in GT_MachineRecipeLoader.java Lines 1500+ + Nether/Endshard + // TC infused Air shards line. Recipes in GT_MachineRecipeLoader.java Lines 1500+ + Nether/Endshard INFUSEDAER(144, "infusedair", true, Materials._NULL, 100, 0x60602F, 0xFFFF7E), INFUSEDTERRA(145, "infusedterra", true, Materials._NULL, 100, 0x003300, 0x008600), INFUSEDIGNIS(146, "infusedignis", true, Materials._NULL, 100, 0x3B0E00, 0xED3801), @@ -196,11 +195,11 @@ public enum CombType { CAELESTISGREEN(155, "caelestisgreen", true, Materials._NULL, 100, 0x00FF00, 0xB233FF), CAELESTISBLUE(156, "caelestisblue", true, Materials._NULL, 100, 0x0000FF, 0xFF99A5), UNKNOWNWATER(157, "unknownwater", true, Materials._NULL, 100, 0x36ABFF, 0x4333A5), - //ESSENTIA gets a use soon. Dont remove. + // ESSENTIA gets a use soon. Dont remove. ESSENTIA(158, "essentia", true, Materials._NULL, 100, 0xED3601, 0xFF6D50), INDIUM(159, "indium", true, Materials.Indium, 100, 0x8F5D99, 0xFFA9FF), - //ALWAYS KEEP _NULL AT THE BOTTOM + // ALWAYS KEEP _NULL AT THE BOTTOM _NULL(-1, "INVALIDCOMB", false, Materials._NULL, 0, 0, 0); public boolean showInList; @@ -221,8 +220,7 @@ public enum CombType { } CombType(int id, String pName, boolean show, Materials material, int chance, int... color) { - if (id < 0 && !"INVALIDCOMB".equals(pName)) - throw new IllegalArgumentException(); + if (id < 0 && !"INVALIDCOMB".equals(pName)) throw new IllegalArgumentException(); this.id = id; this.name = pName; this.material = material; @@ -237,11 +235,12 @@ public enum CombType { public String getName() { - return GT_LanguageManager.addStringLocalization("comb." + this.name, this.name.substring(0, 1).toUpperCase() + this.name.substring(1) + " Comb"); + return GT_LanguageManager.addStringLocalization( + "comb." + this.name, this.name.substring(0, 1).toUpperCase() + this.name.substring(1) + " Comb"); } public int[] getColours() { - return color == null || color.length != 2 ? new int[]{0, 0} : color; + return color == null || color.length != 2 ? new int[] {0, 0} : color; } public int getId() { @@ -256,12 +255,14 @@ public enum CombType { private static final CombType[] VALUES; static { - int biggestId = Arrays.stream(CombType.values()).mapToInt(CombType::getId).max().getAsInt(); + int biggestId = Arrays.stream(CombType.values()) + .mapToInt(CombType::getId) + .max() + .getAsInt(); VALUES = new CombType[biggestId + 1]; Arrays.fill(VALUES, _NULL); for (CombType type : CombType.values()) { - if (type != _NULL) - VALUES[type.getId()] = type; + if (type != _NULL) VALUES[type.getId()] = type; } } } diff --git a/src/main/java/gregtech/common/items/DropType.java b/src/main/java/gregtech/common/items/DropType.java index f3ea945016..6bc8eadcf7 100644 --- a/src/main/java/gregtech/common/items/DropType.java +++ b/src/main/java/gregtech/common/items/DropType.java @@ -4,32 +4,32 @@ import gregtech.api.enums.Materials; import gregtech.api.util.GT_LanguageManager; public enum DropType { - - OIL("oil",true), - MUTAGEN("small mutagen catalyst",true), - COOLANT("coolant",true), - HOT_COOLANT("hot coolant",true), - HYDRA("hydra blood",true), - SNOW_QUEEN("snowqueen blood",true), - OXYGEN("oxygen",true), - LAPIS("lapis coolant",true), - ENDERGOO("ender goo",true); - - private static int[][] colours = new int[][]{ - {0x19191B, 0x303032}, - {0xffc100, 0x00ff11}, - {0x144F5A, 0x2494A2}, - {0xC11F1F, 0xEBB9B9}, - {0x872836, 0xB8132C}, - {0xD02001, 0x9C0018}, - {0x003366, 0x0066BB}, - {0x1727b1, 0x008ce3}, - {0xA005E7, 0x161616}, + OIL("oil", true), + MUTAGEN("small mutagen catalyst", true), + COOLANT("coolant", true), + HOT_COOLANT("hot coolant", true), + HYDRA("hydra blood", true), + SNOW_QUEEN("snowqueen blood", true), + OXYGEN("oxygen", true), + LAPIS("lapis coolant", true), + ENDERGOO("ender goo", true); + + private static int[][] colours = new int[][] { + {0x19191B, 0x303032}, + {0xffc100, 0x00ff11}, + {0x144F5A, 0x2494A2}, + {0xC11F1F, 0xEBB9B9}, + {0x872836, 0xB8132C}, + {0xD02001, 0x9C0018}, + {0x003366, 0x0066BB}, + {0x1727b1, 0x008ce3}, + {0xA005E7, 0x161616}, }; public boolean showInList; public Materials material; public int chance; private String name; + private DropType(String pName, boolean show) { this.name = pName; this.showInList = show; @@ -41,7 +41,8 @@ public enum DropType { public String getName() { - return GT_LanguageManager.addStringLocalization("drop." + this.name, this.name.substring(0, 1).toUpperCase() + this.name.substring(1) + " Drop"); + return GT_LanguageManager.addStringLocalization( + "drop." + this.name, this.name.substring(0, 1).toUpperCase() + this.name.substring(1) + " Drop"); } public int[] getColours() { diff --git a/src/main/java/gregtech/common/items/GT_DepletetCell_Item.java b/src/main/java/gregtech/common/items/GT_DepletetCell_Item.java index 056ab796fa..7a4df4f1a3 100644 --- a/src/main/java/gregtech/common/items/GT_DepletetCell_Item.java +++ b/src/main/java/gregtech/common/items/GT_DepletetCell_Item.java @@ -11,11 +11,19 @@ public class GT_DepletetCell_Item extends GT_RadioactiveCellIC_Item { } @Override - public void processChamber(IReactor paramIReactor, ItemStack paramItemStack, int paramInt1, int paramInt2, boolean paramBoolean) { - } + public void processChamber( + IReactor paramIReactor, ItemStack paramItemStack, int paramInt1, int paramInt2, boolean paramBoolean) {} @Override - public boolean acceptUraniumPulse(IReactor paramIReactor, ItemStack paramItemStack1, ItemStack paramItemStack2, int paramInt1, int paramInt2, int paramInt3, int paramInt4, boolean paramBoolean) { + public boolean acceptUraniumPulse( + IReactor paramIReactor, + ItemStack paramItemStack1, + ItemStack paramItemStack2, + int paramInt1, + int paramInt2, + int paramInt3, + int paramInt4, + boolean paramBoolean) { return false; } @@ -35,7 +43,8 @@ public class GT_DepletetCell_Item extends GT_RadioactiveCellIC_Item { } @Override - public int alterHeat(IReactor paramIReactor, ItemStack paramItemStack, int paramInt1, int paramInt2, int paramInt3) { + public int alterHeat( + IReactor paramIReactor, ItemStack paramItemStack, int paramInt1, int paramInt2, int paramInt3) { return 0; } diff --git a/src/main/java/gregtech/common/items/GT_FluidDisplayItem.java b/src/main/java/gregtech/common/items/GT_FluidDisplayItem.java index a2879844aa..aa9a150b7e 100644 --- a/src/main/java/gregtech/common/items/GT_FluidDisplayItem.java +++ b/src/main/java/gregtech/common/items/GT_FluidDisplayItem.java @@ -7,6 +7,11 @@ import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.items.GT_Generic_Item; import gregtech.api.util.GT_Utility; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Stream; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; @@ -20,13 +25,7 @@ import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.stream.Stream; - -@SuppressWarnings({"rawtypes","unchecked"}) +@SuppressWarnings({"rawtypes", "unchecked"}) public class GT_FluidDisplayItem extends GT_Generic_Item { private static final Map<Fluid, String> sFluidTooltips = new HashMap<>(); @@ -39,8 +38,10 @@ public class GT_FluidDisplayItem extends GT_Generic_Item { @Override protected void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) { if (FluidRegistry.getFluid(aStack.getItemDamage()) != null) { - String tChemicalFormula = getChemicalFormula(new FluidStack(FluidRegistry.getFluid(aStack.getItemDamage()), 1)); - if (!tChemicalFormula.isEmpty()) aList.add(EnumChatFormatting.YELLOW + tChemicalFormula + EnumChatFormatting.RESET); + String tChemicalFormula = + getChemicalFormula(new FluidStack(FluidRegistry.getFluid(aStack.getItemDamage()), 1)); + if (!tChemicalFormula.isEmpty()) + aList.add(EnumChatFormatting.YELLOW + tChemicalFormula + EnumChatFormatting.RESET); } NBTTagCompound aNBT = aStack.getTagCompound(); if (GT_Values.D1) { @@ -52,17 +53,20 @@ public class GT_FluidDisplayItem extends GT_Generic_Item { if (aNBT != null) { long tToolTipAmount = aNBT.getLong("mFluidDisplayAmount"); if (tToolTipAmount > 0L) { - aList.add(EnumChatFormatting.BLUE + "Amount: " + GT_Utility.formatNumbers(tToolTipAmount) + " L" + EnumChatFormatting.GRAY); + aList.add(EnumChatFormatting.BLUE + "Amount: " + GT_Utility.formatNumbers(tToolTipAmount) + " L" + + EnumChatFormatting.GRAY); } - aList.add(EnumChatFormatting.RED + "Temperature: " + GT_Utility.formatNumbers(aNBT.getLong("mFluidDisplayHeat")) + " K" + EnumChatFormatting.GRAY); - aList.add(EnumChatFormatting.GREEN + String.format(transItem("018", "State: %s"), aNBT.getBoolean("mFluidState") ? "Gas" : "Liquid") + EnumChatFormatting.GRAY); + aList.add(EnumChatFormatting.RED + "Temperature: " + + GT_Utility.formatNumbers(aNBT.getLong("mFluidDisplayHeat")) + " K" + EnumChatFormatting.GRAY); + aList.add(EnumChatFormatting.GREEN + + String.format(transItem("018", "State: %s"), aNBT.getBoolean("mFluidState") ? "Gas" : "Liquid") + + EnumChatFormatting.GRAY); } } @Override @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister aIconRegister) { - } + public void registerIcons(IIconRegister aIconRegister) {} @Override public IIcon getIconFromDamage(int aMetaData) { @@ -104,32 +108,32 @@ public class GT_FluidDisplayItem extends GT_Generic_Item { @SideOnly(Side.CLIENT) public String getChemicalFormula(FluidStack aRealFluid) { - return sFluidTooltips.computeIfAbsent(aRealFluid.getFluid(), - fluid -> { - for(ItemStack tContainer : GT_Utility.getContainersFromFluid(aRealFluid)) { - if (isCell(tContainer)) { - Materials tMaterial = getMaterialFromCell(tContainer); - if (!tMaterial.equals(Materials._NULL)) { - if (tMaterial.mChemicalFormula.equals("?")) { - return ""; - } - else { - return tMaterial.mChemicalFormula; - } - } - else { - // For GT++ Fluid Display - // GT++ didn't register a Material in GT, so I have too find the Chemical Formula in its cell's tooltip - List tTooltip = tContainer.getTooltip(null, true); - for (Object tInfo : tTooltip) { - if (!((String) tInfo).contains(" ") && !((String) tInfo).contains(":") && tTooltip.indexOf(tInfo) != 0) { - return (String) tInfo; - } - } + return sFluidTooltips.computeIfAbsent(aRealFluid.getFluid(), fluid -> { + for (ItemStack tContainer : GT_Utility.getContainersFromFluid(aRealFluid)) { + if (isCell(tContainer)) { + Materials tMaterial = getMaterialFromCell(tContainer); + if (!tMaterial.equals(Materials._NULL)) { + if (tMaterial.mChemicalFormula.equals("?")) { + return ""; + } else { + return tMaterial.mChemicalFormula; + } + } else { + // For GT++ Fluid Display + // GT++ didn't register a Material in GT, so I have too find the Chemical Formula in its cell's + // tooltip + List tTooltip = tContainer.getTooltip(null, true); + for (Object tInfo : tTooltip) { + if (!((String) tInfo).contains(" ") + && !((String) tInfo).contains(":") + && tTooltip.indexOf(tInfo) != 0) { + return (String) tInfo; } } } - return ""; + } + } + return ""; }); } @@ -160,10 +164,7 @@ public class GT_FluidDisplayItem extends GT_Generic_Item { String tOreDictName = OreDictionary.getOreName(tOreDict); if (tOreDictName.startsWith("cell")) { return Materials.getRealMaterial( - tOreDictName.replace("cell", "") - .replace("Molten", "") - .replace("Plasma", "") - ); + tOreDictName.replace("cell", "").replace("Molten", "").replace("Plasma", "")); } } return Materials._NULL; diff --git a/src/main/java/gregtech/common/items/GT_IntegratedCircuit_Item.java b/src/main/java/gregtech/common/items/GT_IntegratedCircuit_Item.java index 052e5ed1b6..74dab0e74e 100644 --- a/src/main/java/gregtech/common/items/GT_IntegratedCircuit_Item.java +++ b/src/main/java/gregtech/common/items/GT_IntegratedCircuit_Item.java @@ -1,5 +1,8 @@ package gregtech.common.items; +import static gregtech.GT_Mod.GT_FML_LOGGER; +import static gregtech.api.enums.GT_Values.RES_PATH_ITEM; + import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -18,6 +21,11 @@ import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Log; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Utility; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.function.BiFunction; +import java.util.function.Predicate; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; @@ -34,19 +42,11 @@ import net.minecraftforge.common.util.Constants; import net.minecraftforge.common.util.FakePlayer; import org.apache.commons.lang3.tuple.Pair; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.function.BiFunction; -import java.util.function.Predicate; - -import static gregtech.GT_Mod.GT_FML_LOGGER; -import static gregtech.api.enums.GT_Values.RES_PATH_ITEM; - public class GT_IntegratedCircuit_Item extends GT_Generic_Item implements INetworkUpdatableItem { private static final String aTextEmptyRow = " "; private static final List<ItemStack> ALL_VARIANTS = new ArrayList<>(); protected IIcon[] mIconDamage = new IIcon[25]; + public GT_IntegratedCircuit_Item() { super("integrated_circuit", "Programmed Circuit", ""); setHasSubtypes(true); @@ -61,33 +61,84 @@ public class GT_IntegratedCircuit_Item extends GT_Generic_Item implements INetwo ALL_VARIANTS.add(aStack); } - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 0L), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{OrePrefixes.circuit.get(Materials.Basic)}); + GT_ModHandler.addShapelessCraftingRecipe( + ItemList.Circuit_Integrated.getWithDamage(1L, 0L), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] {OrePrefixes.circuit.get(Materials.Basic)}); long bits = GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE; - GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 1L), bits, new Object[]{"d ", " P ", aTextEmptyRow, 'P', ItemList.Circuit_Integrated.getWildcard(1L)}); - GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 2L), bits, new Object[]{" d ", " P ", aTextEmptyRow, 'P', ItemList.Circuit_Integrated.getWildcard(1L)}); - GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 3L), bits, new Object[]{" d", " P ", aTextEmptyRow, 'P', ItemList.Circuit_Integrated.getWildcard(1L)}); - GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 4L), bits, new Object[]{aTextEmptyRow, " Pd", aTextEmptyRow, 'P', ItemList.Circuit_Integrated.getWildcard(1L)}); - GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 5L), bits, new Object[]{aTextEmptyRow, " P ", " d", 'P', ItemList.Circuit_Integrated.getWildcard(1L)}); - GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 6L), bits, new Object[]{aTextEmptyRow, " P ", " d ", 'P', ItemList.Circuit_Integrated.getWildcard(1L)}); - GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 7L), bits, new Object[]{aTextEmptyRow, " P ", "d ", 'P', ItemList.Circuit_Integrated.getWildcard(1L)}); - GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 8L), bits, new Object[]{aTextEmptyRow, "dP ", aTextEmptyRow, 'P', ItemList.Circuit_Integrated.getWildcard(1L)}); - - GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 9L), bits, new Object[]{"P d", aTextEmptyRow, aTextEmptyRow, 'P', ItemList.Circuit_Integrated.getWildcard(1L)}); - GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 10L), bits, new Object[]{"P ", " d", aTextEmptyRow, 'P', ItemList.Circuit_Integrated.getWildcard(1L)}); - GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 11L), bits, new Object[]{"P ", aTextEmptyRow, " d", 'P', ItemList.Circuit_Integrated.getWildcard(1L)}); - GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 12L), bits, new Object[]{"P ", aTextEmptyRow, " d ", 'P', ItemList.Circuit_Integrated.getWildcard(1L)}); - GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 13L), bits, new Object[]{" P", aTextEmptyRow, " d", 'P', ItemList.Circuit_Integrated.getWildcard(1L)}); - GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 14L), bits, new Object[]{" P", aTextEmptyRow, " d ", 'P', ItemList.Circuit_Integrated.getWildcard(1L)}); - GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 15L), bits, new Object[]{" P", aTextEmptyRow, "d ", 'P', ItemList.Circuit_Integrated.getWildcard(1L)}); - GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 16L), bits, new Object[]{" P", "d ", aTextEmptyRow, 'P', ItemList.Circuit_Integrated.getWildcard(1L)}); - GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 17L), bits, new Object[]{aTextEmptyRow, aTextEmptyRow, "d P", 'P', ItemList.Circuit_Integrated.getWildcard(1L)}); - GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 18L), bits, new Object[]{aTextEmptyRow, "d ", " P", 'P', ItemList.Circuit_Integrated.getWildcard(1L)}); - GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 19L), bits, new Object[]{"d ", aTextEmptyRow, " P", 'P', ItemList.Circuit_Integrated.getWildcard(1L)}); - GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 20L), bits, new Object[]{" d ", aTextEmptyRow, " P", 'P', ItemList.Circuit_Integrated.getWildcard(1L)}); - GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 21L), bits, new Object[]{"d ", aTextEmptyRow, "P ", 'P', ItemList.Circuit_Integrated.getWildcard(1L)}); - GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 22L), bits, new Object[]{" d ", aTextEmptyRow, "P ", 'P', ItemList.Circuit_Integrated.getWildcard(1L)}); - GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 23L), bits, new Object[]{" d", aTextEmptyRow, "P ", 'P', ItemList.Circuit_Integrated.getWildcard(1L)}); - GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 24L), bits, new Object[]{aTextEmptyRow, " d", "P ", 'P', ItemList.Circuit_Integrated.getWildcard(1L)}); + GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 1L), bits, new Object[] { + "d ", " P ", aTextEmptyRow, 'P', ItemList.Circuit_Integrated.getWildcard(1L) + }); + GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 2L), bits, new Object[] { + " d ", " P ", aTextEmptyRow, 'P', ItemList.Circuit_Integrated.getWildcard(1L) + }); + GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 3L), bits, new Object[] { + " d", " P ", aTextEmptyRow, 'P', ItemList.Circuit_Integrated.getWildcard(1L) + }); + GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 4L), bits, new Object[] { + aTextEmptyRow, " Pd", aTextEmptyRow, 'P', ItemList.Circuit_Integrated.getWildcard(1L) + }); + GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 5L), bits, new Object[] { + aTextEmptyRow, " P ", " d", 'P', ItemList.Circuit_Integrated.getWildcard(1L) + }); + GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 6L), bits, new Object[] { + aTextEmptyRow, " P ", " d ", 'P', ItemList.Circuit_Integrated.getWildcard(1L) + }); + GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 7L), bits, new Object[] { + aTextEmptyRow, " P ", "d ", 'P', ItemList.Circuit_Integrated.getWildcard(1L) + }); + GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 8L), bits, new Object[] { + aTextEmptyRow, "dP ", aTextEmptyRow, 'P', ItemList.Circuit_Integrated.getWildcard(1L) + }); + + GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 9L), bits, new Object[] { + "P d", aTextEmptyRow, aTextEmptyRow, 'P', ItemList.Circuit_Integrated.getWildcard(1L) + }); + GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 10L), bits, new Object[] { + "P ", " d", aTextEmptyRow, 'P', ItemList.Circuit_Integrated.getWildcard(1L) + }); + GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 11L), bits, new Object[] { + "P ", aTextEmptyRow, " d", 'P', ItemList.Circuit_Integrated.getWildcard(1L) + }); + GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 12L), bits, new Object[] { + "P ", aTextEmptyRow, " d ", 'P', ItemList.Circuit_Integrated.getWildcard(1L) + }); + GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 13L), bits, new Object[] { + " P", aTextEmptyRow, " d", 'P', ItemList.Circuit_Integrated.getWildcard(1L) + }); + GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 14L), bits, new Object[] { + " P", aTextEmptyRow, " d ", 'P', ItemList.Circuit_Integrated.getWildcard(1L) + }); + GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 15L), bits, new Object[] { + " P", aTextEmptyRow, "d ", 'P', ItemList.Circuit_Integrated.getWildcard(1L) + }); + GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 16L), bits, new Object[] { + " P", "d ", aTextEmptyRow, 'P', ItemList.Circuit_Integrated.getWildcard(1L) + }); + GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 17L), bits, new Object[] { + aTextEmptyRow, aTextEmptyRow, "d P", 'P', ItemList.Circuit_Integrated.getWildcard(1L) + }); + GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 18L), bits, new Object[] { + aTextEmptyRow, "d ", " P", 'P', ItemList.Circuit_Integrated.getWildcard(1L) + }); + GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 19L), bits, new Object[] { + "d ", aTextEmptyRow, " P", 'P', ItemList.Circuit_Integrated.getWildcard(1L) + }); + GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 20L), bits, new Object[] { + " d ", aTextEmptyRow, " P", 'P', ItemList.Circuit_Integrated.getWildcard(1L) + }); + GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 21L), bits, new Object[] { + "d ", aTextEmptyRow, "P ", 'P', ItemList.Circuit_Integrated.getWildcard(1L) + }); + GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 22L), bits, new Object[] { + " d ", aTextEmptyRow, "P ", 'P', ItemList.Circuit_Integrated.getWildcard(1L) + }); + GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 23L), bits, new Object[] { + " d", aTextEmptyRow, "P ", 'P', ItemList.Circuit_Integrated.getWildcard(1L) + }); + GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 24L), bits, new Object[] { + aTextEmptyRow, " d", "P ", 'P', ItemList.Circuit_Integrated.getWildcard(1L) + }); } private static String getModeString(int aMetaData) { @@ -113,9 +164,25 @@ public class GT_IntegratedCircuit_Item extends GT_Generic_Item implements INetwo @Override public void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) { super.addAdditionalToolTips(aList, aStack, aPlayer); - aList.add(GT_LanguageManager.addStringLocalization(new StringBuilder().append(getUnlocalizedName()).append(".configuration").toString(), "Configuration: ") + getConfigurationString(getDamage(aStack))); - aList.add(GT_LanguageManager.addStringLocalization(new StringBuilder().append(getUnlocalizedName()).append(".tooltip.0").toString(), "Right click to reconfigure")); - aList.add(GT_LanguageManager.addStringLocalization(new StringBuilder().append(getUnlocalizedName()).append(".tooltip.1").toString(), "Needs a screwdriver or circuit programming tool")); + aList.add(GT_LanguageManager.addStringLocalization( + new StringBuilder() + .append(getUnlocalizedName()) + .append(".configuration") + .toString(), + "Configuration: ") + + getConfigurationString(getDamage(aStack))); + aList.add(GT_LanguageManager.addStringLocalization( + new StringBuilder() + .append(getUnlocalizedName()) + .append(".tooltip.0") + .toString(), + "Right click to reconfigure")); + aList.add(GT_LanguageManager.addStringLocalization( + new StringBuilder() + .append(getUnlocalizedName()) + .append(".tooltip.1") + .toString(), + "Needs a screwdriver or circuit programming tool")); } @Override @@ -133,8 +200,9 @@ public class GT_IntegratedCircuit_Item extends GT_Generic_Item implements INetwo @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister aIconRegister) { super.registerIcons(aIconRegister); - for (int i=0; i < mIconDamage.length; i++) { - mIconDamage[i] = aIconRegister.registerIcon(RES_PATH_ITEM + (GT_Config.troll ? "troll" : getUnlocalizedName() + "/" + i)); + for (int i = 0; i < mIconDamage.length; i++) { + mIconDamage[i] = aIconRegister.registerIcon( + RES_PATH_ITEM + (GT_Config.troll ? "troll" : getUnlocalizedName() + "/" + i)); } if (GregTech_API.sPostloadFinished) { GT_Log.out.println("GT_Mod: Starting Item Icon Load Phase"); @@ -144,7 +212,9 @@ public class GT_IntegratedCircuit_Item extends GT_Generic_Item implements INetwo for (Runnable tRunnable : GregTech_API.sGTItemIconload) { tRunnable.run(); } - } catch (Throwable e) {e.printStackTrace(GT_Log.err);} + } catch (Throwable e) { + e.printStackTrace(GT_Log.err); + } GT_Log.out.println("GT_Mod: Finished Item Icon Load Phase"); GT_FML_LOGGER.info("GT_Mod: Finished Item Icon Load Phase"); } @@ -159,8 +229,7 @@ public class GT_IntegratedCircuit_Item extends GT_Generic_Item implements INetwo @Override public boolean receive(ItemStack stack, EntityPlayerMP player, NBTTagCompound tag) { int meta = tag.hasKey("meta", Constants.NBT.TAG_BYTE) ? tag.getByte("meta") : -1; - if (meta < 0 || meta > 24) - return true; + if (meta < 0 || meta > 24) return true; if (!player.capabilities.isCreativeMode) { Pair<Integer, BiFunction<ItemStack, EntityPlayerMP, ItemStack>> toolIndex = findConfiguratorInInv(player); @@ -175,7 +244,17 @@ public class GT_IntegratedCircuit_Item extends GT_Generic_Item implements INetwo } @Override - public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float xOffset, float yOffset, float zOffset) { + public boolean onItemUse( + ItemStack stack, + EntityPlayer player, + World world, + int x, + int y, + int z, + int side, + float xOffset, + float yOffset, + float zOffset) { // nothing on server side or fake player if (player instanceof FakePlayer || !world.isRemote) return false; // check if any screwdriver @@ -187,12 +266,16 @@ public class GT_IntegratedCircuit_Item extends GT_Generic_Item implements INetwo if (configurator == null) { int count; try { - count = Integer.parseInt(StatCollector.translateToLocal("GT5U.item.programmed_circuit.no_screwdriver.count")); + count = Integer.parseInt( + StatCollector.translateToLocal("GT5U.item.programmed_circuit.no_screwdriver.count")); } catch (NumberFormatException e) { - player.addChatComponentMessage(new ChatComponentText("Error in translation GT5U.item.programmed_circuit.no_screwdriver.count: " + e.getMessage())); + player.addChatComponentMessage(new ChatComponentText( + "Error in translation GT5U.item.programmed_circuit.no_screwdriver.count: " + + e.getMessage())); count = 1; } - player.addChatComponentMessage(new ChatComponentTranslation("GT5U.item.programmed_circuit.no_screwdriver." + XSTR.XSTR_INSTANCE.nextInt(count))); + player.addChatComponentMessage(new ChatComponentTranslation( + "GT5U.item.programmed_circuit.no_screwdriver." + XSTR.XSTR_INSTANCE.nextInt(count))); return false; } configuratorStack = player.inventory.mainInventory[configurator.getKey()]; @@ -202,15 +285,15 @@ public class GT_IntegratedCircuit_Item extends GT_Generic_Item implements INetwo } private void openSelectorGui(ItemStack configurator, int meta) { - FMLCommonHandler.instance().showGuiScreen(new GT_GUIDialogSelectItem( - StatCollector.translateToLocal("GT5U.item.programmed_circuit.select.header"), - configurator, - null, - GT_IntegratedCircuit_Item::onConfigured, - ALL_VARIANTS, - meta, - true - )); + FMLCommonHandler.instance() + .showGuiScreen(new GT_GUIDialogSelectItem( + StatCollector.translateToLocal("GT5U.item.programmed_circuit.select.header"), + configurator, + null, + GT_IntegratedCircuit_Item::onConfigured, + ALL_VARIANTS, + meta, + true)); } private static void onConfigured(ItemStack stack) { @@ -219,17 +302,17 @@ public class GT_IntegratedCircuit_Item extends GT_Generic_Item implements INetwo GT_Values.NW.sendToServer(new GT_Packet_UpdateItem(tag)); } - private static Pair<Integer, BiFunction<ItemStack, EntityPlayerMP, ItemStack>> findConfiguratorInInv(EntityPlayer player) { + private static Pair<Integer, BiFunction<ItemStack, EntityPlayerMP, ItemStack>> findConfiguratorInInv( + EntityPlayer player) { ItemStack[] mainInventory = player.inventory.mainInventory; for (int j = 0, mainInventoryLength = mainInventory.length; j < mainInventoryLength; j++) { ItemStack toolStack = mainInventory[j]; - if (!GT_Utility.isStackValid(toolStack)) - continue; + if (!GT_Utility.isStackValid(toolStack)) continue; - for (Map.Entry<Predicate<ItemStack>, BiFunction<ItemStack, EntityPlayerMP, ItemStack>> p : GregTech_API.sCircuitProgrammerList.entrySet()) - if (p.getKey().test(toolStack)) - return Pair.of(j, p.getValue()); + for (Map.Entry<Predicate<ItemStack>, BiFunction<ItemStack, EntityPlayerMP, ItemStack>> p : + GregTech_API.sCircuitProgrammerList.entrySet()) + if (p.getKey().test(toolStack)) return Pair.of(j, p.getValue()); } return null; } diff --git a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java index 988038668b..df979e2b3e 100644 --- a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java +++ b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java @@ -1,5 +1,7 @@ package gregtech.common.items; +import static gregtech.api.enums.Textures.BlockIcons.*; + import cpw.mods.fml.common.Loader; import gregtech.api.GregTech_API; import gregtech.api.enums.Dyes; @@ -24,6 +26,10 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.covers.*; import gregtech.common.items.behaviors.*; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import net.minecraft.block.Block; import net.minecraft.enchantment.Enchantment; import net.minecraft.entity.item.EntityItem; @@ -36,158 +42,885 @@ import net.minecraft.potion.Potion; import net.minecraft.util.MathHelper; import net.minecraftforge.oredict.OreDictionary; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import static gregtech.api.enums.Textures.BlockIcons.*; - public class GT_MetaGenerated_Item_01 extends GT_MetaGenerated_Item_X32 { public static GT_MetaGenerated_Item_01 INSTANCE; - private final String mToolTipPurify = GT_LanguageManager.addStringLocalization("metaitem.01.tooltip.purify", "Throw into Cauldron to get clean Dust"); + private final String mToolTipPurify = GT_LanguageManager.addStringLocalization( + "metaitem.01.tooltip.purify", "Throw into Cauldron to get clean Dust"); private static final String aTextArrow = " A"; private static final String aTextStick = " S "; private static final String aTextFeather = "F "; - private static final String aTextEmptyRow = " "; private static final String aTextShape = " P "; + private static final String aTextEmptyRow = " "; + private static final String aTextShape = " P "; private static final String PartCoverText = " L/t ("; private static final String PartCoverText2 = " L/s) as Cover"; private static final String PartNotCoverText = "Cannot be used as a Cover"; private static final String RAText = "Grabs from and inserts into specific slots"; private static final String FRText1 = "Configurable up to "; - private static final String FRText2 = " L/sec (as Cover)/n Rightclick/Screwdriver-rightclick/Shift-screwdriver-rightclick/n to adjust the pump speed by 1/16/256 L/sec per click"; + private static final String FRText2 = + " L/sec (as Cover)/n Rightclick/Screwdriver-rightclick/Shift-screwdriver-rightclick/n to adjust the pump speed by 1/16/256 L/sec per click"; public GT_MetaGenerated_Item_01() { - super("metaitem.01", OrePrefixes.dustTiny, OrePrefixes.dustSmall, OrePrefixes.dust, OrePrefixes.dustImpure, OrePrefixes.dustPure, OrePrefixes.crushed, OrePrefixes.crushedPurified, OrePrefixes.crushedCentrifuged, OrePrefixes.gem, OrePrefixes.nugget, null, OrePrefixes.ingot, OrePrefixes.ingotHot, OrePrefixes.ingotDouble, OrePrefixes.ingotTriple, OrePrefixes.ingotQuadruple, OrePrefixes.ingotQuintuple, OrePrefixes.plate, OrePrefixes.plateDouble, OrePrefixes.plateTriple, OrePrefixes.plateQuadruple, OrePrefixes.plateQuintuple, OrePrefixes.plateDense, OrePrefixes.stick, OrePrefixes.lens, OrePrefixes.round, OrePrefixes.bolt, OrePrefixes.screw, OrePrefixes.ring, OrePrefixes.foil, OrePrefixes.cell, OrePrefixes.cellPlasma); + super( + "metaitem.01", + OrePrefixes.dustTiny, + OrePrefixes.dustSmall, + OrePrefixes.dust, + OrePrefixes.dustImpure, + OrePrefixes.dustPure, + OrePrefixes.crushed, + OrePrefixes.crushedPurified, + OrePrefixes.crushedCentrifuged, + OrePrefixes.gem, + OrePrefixes.nugget, + null, + OrePrefixes.ingot, + OrePrefixes.ingotHot, + OrePrefixes.ingotDouble, + OrePrefixes.ingotTriple, + OrePrefixes.ingotQuadruple, + OrePrefixes.ingotQuintuple, + OrePrefixes.plate, + OrePrefixes.plateDouble, + OrePrefixes.plateTriple, + OrePrefixes.plateQuadruple, + OrePrefixes.plateQuintuple, + OrePrefixes.plateDense, + OrePrefixes.stick, + OrePrefixes.lens, + OrePrefixes.round, + OrePrefixes.bolt, + OrePrefixes.screw, + OrePrefixes.ring, + OrePrefixes.foil, + OrePrefixes.cell, + OrePrefixes.cellPlasma); INSTANCE = this; int tLastID = 0; setBurnValue(17000 + Materials.Wood.mMetaItemSubID, 1600); GT_OreDictUnificator.addToBlacklist(new ItemStack(this, 1, 17000 + Materials.Wood.mMetaItemSubID)); - GT_ModHandler.addCompressionRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 8L), new ItemStack(this, 1, 17000 + Materials.Wood.mMetaItemSubID)); - GregTech_API.registerCover(new ItemStack(this, 1, 17000 + Materials.Wood.mMetaItemSubID), TextureFactory.of(COVER_WOOD_PLATE), null); + GT_ModHandler.addCompressionRecipe( + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 8L), + new ItemStack(this, 1, 17000 + Materials.Wood.mMetaItemSubID)); + GregTech_API.registerCover( + new ItemStack(this, 1, 17000 + Materials.Wood.mMetaItemSubID), + TextureFactory.of(COVER_WOOD_PLATE), + null); ItemStack tStack = new ItemStack(this, 1, 17000 + Materials.Wood.mMetaItemSubID); tStack.setStackDisplayName("The holy Planks of Sengir"); GT_Utility.ItemNBT.addEnchantment(tStack, Enchantment.smite, 10); - GT_ModHandler.addCraftingRecipe(tStack, GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"XXX", "XDX", "XXX", 'X', OrePrefixes.gem.get(Materials.NetherStar), 'D', new ItemStack(Blocks.dragon_egg, 1, 32767)}); + GT_ModHandler.addCraftingRecipe(tStack, GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[] { + "XXX", + "XDX", + "XXX", + 'X', + OrePrefixes.gem.get(Materials.NetherStar), + 'D', + new ItemStack(Blocks.dragon_egg, 1, 32767) + }); ItemList.Credit_Greg_Copper.set(addItem(tLastID = 0, "Copper GT Credit", "0.125 Credits")); - ItemList.Credit_Greg_Cupronickel.set(addItem(tLastID = 1, "Cupronickel GT Credit", "1 Credit", new ItemData(Materials.Cupronickel, 907200L))); - ItemList.Credit_Greg_Silver.set(addItem(tLastID = 2, "Silver GT Credit", "8 Credits", new TC_Aspects.TC_AspectStack(TC_Aspects.LUCRUM, 1L))); + ItemList.Credit_Greg_Cupronickel.set(addItem( + tLastID = 1, "Cupronickel GT Credit", "1 Credit", new ItemData(Materials.Cupronickel, 907200L))); + ItemList.Credit_Greg_Silver.set(addItem( + tLastID = 2, "Silver GT Credit", "8 Credits", new TC_Aspects.TC_AspectStack(TC_Aspects.LUCRUM, 1L))); ItemList.Credit_Greg_Gold.set(addItem(tLastID = 3, "Gold GT Credit", "64 Credits")); ItemList.Credit_Greg_Platinum.set(addItem(tLastID = 4, "Platinum GT Credit", "512 Credits")); ItemList.Credit_Greg_Osmium.set(addItem(tLastID = 5, "Osmium GT Credit", "4096 Credits")); ItemList.Credit_Greg_Naquadah.set(addItem(tLastID = 6, "Naquadah GT Credit", "32768 Credits")); ItemList.Credit_Greg_Neutronium.set(addItem(tLastID = 7, "Neutronium GT Credit", "262144 Credits")); - ItemList.Coin_Gold_Ancient.set(addItem(tLastID = 8, "Ancient Gold Coin", "Found in ancient Ruins", new ItemData(Materials.Gold, 907200L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUCRUM, 8L))); - ItemList.Coin_Doge.set(addItem(tLastID = 9, "Doge Coin", "wow much coin how money so crypto plz mine v rich very currency wow", new ItemData(Materials.Brass, 907200L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUCRUM, 1L))); - ItemList.Coin_Chocolate.set(addItem(tLastID = 10, "Chocolate Coin", "Wrapped in Gold", new ItemData(Materials.Gold, OrePrefixes.foil.mMaterialAmount), new GT_FoodStat(1, 0.1F, EnumAction.eat, GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Gold, 1L), true, false, false, Potion.moveSpeed.id, 200, 1, 100))); + ItemList.Coin_Gold_Ancient.set(addItem( + tLastID = 8, + "Ancient Gold Coin", + "Found in ancient Ruins", + new ItemData(Materials.Gold, 907200L), + new TC_Aspects.TC_AspectStack(TC_Aspects.LUCRUM, 8L))); + ItemList.Coin_Doge.set(addItem( + tLastID = 9, + "Doge Coin", + "wow much coin how money so crypto plz mine v rich very currency wow", + new ItemData(Materials.Brass, 907200L), + new TC_Aspects.TC_AspectStack(TC_Aspects.LUCRUM, 1L))); + ItemList.Coin_Chocolate.set(addItem( + tLastID = 10, + "Chocolate Coin", + "Wrapped in Gold", + new ItemData(Materials.Gold, OrePrefixes.foil.mMaterialAmount), + new GT_FoodStat( + 1, + 0.1F, + EnumAction.eat, + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Gold, 1L), + true, + false, + false, + Potion.moveSpeed.id, + 200, + 1, + 100))); ItemList.Credit_Copper.set(addItem(tLastID = 11, "Industrial Copper Credit", "0.125 Credits")); - ItemList.Credit_Silver.set(addItem(tLastID = 13, "Industrial Silver Credit", "8 Credits", new TC_Aspects.TC_AspectStack(TC_Aspects.LUCRUM, 1L))); + ItemList.Credit_Silver.set(addItem( + tLastID = 13, + "Industrial Silver Credit", + "8 Credits", + new TC_Aspects.TC_AspectStack(TC_Aspects.LUCRUM, 1L))); ItemList.Credit_Gold.set(addItem(tLastID = 14, "Industrial Gold Credit", "64 Credits")); ItemList.Credit_Platinum.set(addItem(tLastID = 15, "Industrial Platinum Credit", "512 Credits")); ItemList.Credit_Osmium.set(addItem(tLastID = 16, "Industrial Osmium Credit", "4096 Credits")); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Coin_Chocolate.get(1L), new Object[]{OrePrefixes.dust.get(Materials.Cocoa), OrePrefixes.dust.get(Materials.Milk), OrePrefixes.dust.get(Materials.Sugar), OrePrefixes.foil.get(Materials.Gold)}); - - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Copper.get(8L), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Iron}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Iron.get(8L), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Silver}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Silver.get(8L), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Gold}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Gold.get(8L), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Platinum}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Platinum.get(8L), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Osmium}); - - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Iron.get(1L), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Copper, ItemList.Credit_Copper, ItemList.Credit_Copper, ItemList.Credit_Copper, ItemList.Credit_Copper, ItemList.Credit_Copper, ItemList.Credit_Copper, ItemList.Credit_Copper}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Silver.get(1L), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Iron, ItemList.Credit_Iron, ItemList.Credit_Iron, ItemList.Credit_Iron, ItemList.Credit_Iron, ItemList.Credit_Iron, ItemList.Credit_Iron, ItemList.Credit_Iron}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Gold.get(1L), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Silver, ItemList.Credit_Silver, ItemList.Credit_Silver, ItemList.Credit_Silver, ItemList.Credit_Silver, ItemList.Credit_Silver, ItemList.Credit_Silver, ItemList.Credit_Silver}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Platinum.get(1L), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Gold, ItemList.Credit_Gold, ItemList.Credit_Gold, ItemList.Credit_Gold, ItemList.Credit_Gold, ItemList.Credit_Gold, ItemList.Credit_Gold, ItemList.Credit_Gold}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Osmium.get(1L), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Platinum, ItemList.Credit_Platinum, ItemList.Credit_Platinum, ItemList.Credit_Platinum, ItemList.Credit_Platinum, ItemList.Credit_Platinum, ItemList.Credit_Platinum, ItemList.Credit_Platinum}); - - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Greg_Copper.get(8L), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Greg_Cupronickel}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Greg_Cupronickel.get(8L), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Greg_Silver}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Greg_Silver.get(8L), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Greg_Gold}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Greg_Gold.get(8L), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Greg_Platinum}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Greg_Platinum.get(8L), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Greg_Osmium}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Greg_Osmium.get(8L), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Greg_Naquadah}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Greg_Naquadah.get(8L), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Greg_Neutronium}); - - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Greg_Cupronickel.get(1L), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Greg_Copper, ItemList.Credit_Greg_Copper, ItemList.Credit_Greg_Copper, ItemList.Credit_Greg_Copper, ItemList.Credit_Greg_Copper, ItemList.Credit_Greg_Copper, ItemList.Credit_Greg_Copper, ItemList.Credit_Greg_Copper}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Greg_Silver.get(1L), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Greg_Cupronickel, ItemList.Credit_Greg_Cupronickel, ItemList.Credit_Greg_Cupronickel, ItemList.Credit_Greg_Cupronickel, ItemList.Credit_Greg_Cupronickel, ItemList.Credit_Greg_Cupronickel, ItemList.Credit_Greg_Cupronickel, ItemList.Credit_Greg_Cupronickel}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Greg_Gold.get(1L), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Greg_Silver, ItemList.Credit_Greg_Silver, ItemList.Credit_Greg_Silver, ItemList.Credit_Greg_Silver, ItemList.Credit_Greg_Silver, ItemList.Credit_Greg_Silver, ItemList.Credit_Greg_Silver, ItemList.Credit_Greg_Silver}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Greg_Platinum.get(1L), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Greg_Gold, ItemList.Credit_Greg_Gold, ItemList.Credit_Greg_Gold, ItemList.Credit_Greg_Gold, ItemList.Credit_Greg_Gold, ItemList.Credit_Greg_Gold, ItemList.Credit_Greg_Gold, ItemList.Credit_Greg_Gold}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Greg_Osmium.get(1L), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Greg_Platinum, ItemList.Credit_Greg_Platinum, ItemList.Credit_Greg_Platinum, ItemList.Credit_Greg_Platinum, ItemList.Credit_Greg_Platinum, ItemList.Credit_Greg_Platinum, ItemList.Credit_Greg_Platinum, ItemList.Credit_Greg_Platinum}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Greg_Naquadah.get(1L), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Greg_Osmium, ItemList.Credit_Greg_Osmium, ItemList.Credit_Greg_Osmium, ItemList.Credit_Greg_Osmium, ItemList.Credit_Greg_Osmium, ItemList.Credit_Greg_Osmium, ItemList.Credit_Greg_Osmium, ItemList.Credit_Greg_Osmium}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Greg_Neutronium.get(1L), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Greg_Naquadah, ItemList.Credit_Greg_Naquadah, ItemList.Credit_Greg_Naquadah, ItemList.Credit_Greg_Naquadah, ItemList.Credit_Greg_Naquadah, ItemList.Credit_Greg_Naquadah, ItemList.Credit_Greg_Naquadah, ItemList.Credit_Greg_Naquadah}); - - ItemList.Component_Minecart_Wheels_Iron.set(addItem(tLastID = 100, "Iron Minecart Wheels", "To get things rolling", new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 2L))); - ItemList.Component_Minecart_Wheels_Steel.set(addItem(tLastID = 101, "Steel Minecart Wheels", "To get things rolling", new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 2L))); - - GT_ModHandler.addCraftingRecipe(ItemList.Component_Minecart_Wheels_Iron.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{" h ", "RSR", " w ", 'R', OrePrefixes.ring.get(Materials.AnyIron), 'S', OrePrefixes.stick.get(Materials.AnyIron)}); - GT_ModHandler.addCraftingRecipe(ItemList.Component_Minecart_Wheels_Steel.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{" h ", "RSR", " w ", 'R', OrePrefixes.ring.get(Materials.Steel), 'S', OrePrefixes.stick.get(Materials.Steel)}); + GT_ModHandler.addShapelessCraftingRecipe(ItemList.Coin_Chocolate.get(1L), new Object[] { + OrePrefixes.dust.get(Materials.Cocoa), + OrePrefixes.dust.get(Materials.Milk), + OrePrefixes.dust.get(Materials.Sugar), + OrePrefixes.foil.get(Materials.Gold) + }); + + GT_ModHandler.addShapelessCraftingRecipe( + ItemList.Credit_Copper.get(8L), + GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] {ItemList.Credit_Iron}); + GT_ModHandler.addShapelessCraftingRecipe( + ItemList.Credit_Iron.get(8L), + GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] {ItemList.Credit_Silver}); + GT_ModHandler.addShapelessCraftingRecipe( + ItemList.Credit_Silver.get(8L), + GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] {ItemList.Credit_Gold}); + GT_ModHandler.addShapelessCraftingRecipe( + ItemList.Credit_Gold.get(8L), + GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] {ItemList.Credit_Platinum}); + GT_ModHandler.addShapelessCraftingRecipe( + ItemList.Credit_Platinum.get(8L), + GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] {ItemList.Credit_Osmium}); + + GT_ModHandler.addShapelessCraftingRecipe( + ItemList.Credit_Iron.get(1L), + GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { + ItemList.Credit_Copper, + ItemList.Credit_Copper, + ItemList.Credit_Copper, + ItemList.Credit_Copper, + ItemList.Credit_Copper, + ItemList.Credit_Copper, + ItemList.Credit_Copper, + ItemList.Credit_Copper + }); + GT_ModHandler.addShapelessCraftingRecipe( + ItemList.Credit_Silver.get(1L), + GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { + ItemList.Credit_Iron, + ItemList.Credit_Iron, + ItemList.Credit_Iron, + ItemList.Credit_Iron, + ItemList.Credit_Iron, + ItemList.Credit_Iron, + ItemList.Credit_Iron, + ItemList.Credit_Iron + }); + GT_ModHandler.addShapelessCraftingRecipe( + ItemList.Credit_Gold.get(1L), + GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { + ItemList.Credit_Silver, + ItemList.Credit_Silver, + ItemList.Credit_Silver, + ItemList.Credit_Silver, + ItemList.Credit_Silver, + ItemList.Credit_Silver, + ItemList.Credit_Silver, + ItemList.Credit_Silver + }); + GT_ModHandler.addShapelessCraftingRecipe( + ItemList.Credit_Platinum.get(1L), + GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { + ItemList.Credit_Gold, + ItemList.Credit_Gold, + ItemList.Credit_Gold, + ItemList.Credit_Gold, + ItemList.Credit_Gold, + ItemList.Credit_Gold, + ItemList.Credit_Gold, + ItemList.Credit_Gold + }); + GT_ModHandler.addShapelessCraftingRecipe( + ItemList.Credit_Osmium.get(1L), + GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { + ItemList.Credit_Platinum, + ItemList.Credit_Platinum, + ItemList.Credit_Platinum, + ItemList.Credit_Platinum, + ItemList.Credit_Platinum, + ItemList.Credit_Platinum, + ItemList.Credit_Platinum, + ItemList.Credit_Platinum + }); + + GT_ModHandler.addShapelessCraftingRecipe( + ItemList.Credit_Greg_Copper.get(8L), + GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] {ItemList.Credit_Greg_Cupronickel}); + GT_ModHandler.addShapelessCraftingRecipe( + ItemList.Credit_Greg_Cupronickel.get(8L), + GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] {ItemList.Credit_Greg_Silver}); + GT_ModHandler.addShapelessCraftingRecipe( + ItemList.Credit_Greg_Silver.get(8L), + GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] {ItemList.Credit_Greg_Gold}); + GT_ModHandler.addShapelessCraftingRecipe( + ItemList.Credit_Greg_Gold.get(8L), + GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] {ItemList.Credit_Greg_Platinum}); + GT_ModHandler.addShapelessCraftingRecipe( + ItemList.Credit_Greg_Platinum.get(8L), + GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] {ItemList.Credit_Greg_Osmium}); + GT_ModHandler.addShapelessCraftingRecipe( + ItemList.Credit_Greg_Osmium.get(8L), + GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] {ItemList.Credit_Greg_Naquadah}); + GT_ModHandler.addShapelessCraftingRecipe( + ItemList.Credit_Greg_Naquadah.get(8L), + GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] {ItemList.Credit_Greg_Neutronium}); + + GT_ModHandler.addShapelessCraftingRecipe( + ItemList.Credit_Greg_Cupronickel.get(1L), + GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { + ItemList.Credit_Greg_Copper, + ItemList.Credit_Greg_Copper, + ItemList.Credit_Greg_Copper, + ItemList.Credit_Greg_Copper, + ItemList.Credit_Greg_Copper, + ItemList.Credit_Greg_Copper, + ItemList.Credit_Greg_Copper, + ItemList.Credit_Greg_Copper + }); + GT_ModHandler.addShapelessCraftingRecipe( + ItemList.Credit_Greg_Silver.get(1L), + GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { + ItemList.Credit_Greg_Cupronickel, + ItemList.Credit_Greg_Cupronickel, + ItemList.Credit_Greg_Cupronickel, + ItemList.Credit_Greg_Cupronickel, + ItemList.Credit_Greg_Cupronickel, + ItemList.Credit_Greg_Cupronickel, + ItemList.Credit_Greg_Cupronickel, + ItemList.Credit_Greg_Cupronickel + }); + GT_ModHandler.addShapelessCraftingRecipe( + ItemList.Credit_Greg_Gold.get(1L), + GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { + ItemList.Credit_Greg_Silver, + ItemList.Credit_Greg_Silver, + ItemList.Credit_Greg_Silver, + ItemList.Credit_Greg_Silver, + ItemList.Credit_Greg_Silver, + ItemList.Credit_Greg_Silver, + ItemList.Credit_Greg_Silver, + ItemList.Credit_Greg_Silver + }); + GT_ModHandler.addShapelessCraftingRecipe( + ItemList.Credit_Greg_Platinum.get(1L), + GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { + ItemList.Credit_Greg_Gold, + ItemList.Credit_Greg_Gold, + ItemList.Credit_Greg_Gold, + ItemList.Credit_Greg_Gold, + ItemList.Credit_Greg_Gold, + ItemList.Credit_Greg_Gold, + ItemList.Credit_Greg_Gold, + ItemList.Credit_Greg_Gold + }); + GT_ModHandler.addShapelessCraftingRecipe( + ItemList.Credit_Greg_Osmium.get(1L), + GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { + ItemList.Credit_Greg_Platinum, + ItemList.Credit_Greg_Platinum, + ItemList.Credit_Greg_Platinum, + ItemList.Credit_Greg_Platinum, + ItemList.Credit_Greg_Platinum, + ItemList.Credit_Greg_Platinum, + ItemList.Credit_Greg_Platinum, + ItemList.Credit_Greg_Platinum + }); + GT_ModHandler.addShapelessCraftingRecipe( + ItemList.Credit_Greg_Naquadah.get(1L), + GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { + ItemList.Credit_Greg_Osmium, + ItemList.Credit_Greg_Osmium, + ItemList.Credit_Greg_Osmium, + ItemList.Credit_Greg_Osmium, + ItemList.Credit_Greg_Osmium, + ItemList.Credit_Greg_Osmium, + ItemList.Credit_Greg_Osmium, + ItemList.Credit_Greg_Osmium + }); + GT_ModHandler.addShapelessCraftingRecipe( + ItemList.Credit_Greg_Neutronium.get(1L), + GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { + ItemList.Credit_Greg_Naquadah, + ItemList.Credit_Greg_Naquadah, + ItemList.Credit_Greg_Naquadah, + ItemList.Credit_Greg_Naquadah, + ItemList.Credit_Greg_Naquadah, + ItemList.Credit_Greg_Naquadah, + ItemList.Credit_Greg_Naquadah, + ItemList.Credit_Greg_Naquadah + }); + + ItemList.Component_Minecart_Wheels_Iron.set(addItem( + tLastID = 100, + "Iron Minecart Wheels", + "To get things rolling", + new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 2L))); + ItemList.Component_Minecart_Wheels_Steel.set(addItem( + tLastID = 101, + "Steel Minecart Wheels", + "To get things rolling", + new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 2L))); + + GT_ModHandler.addCraftingRecipe( + ItemList.Component_Minecart_Wheels_Iron.get(1L), + GT_ModHandler.RecipeBits.BUFFERED + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + " h ", + "RSR", + " w ", + 'R', + OrePrefixes.ring.get(Materials.AnyIron), + 'S', + OrePrefixes.stick.get(Materials.AnyIron) + }); + GT_ModHandler.addCraftingRecipe( + ItemList.Component_Minecart_Wheels_Steel.get(1L), + GT_ModHandler.RecipeBits.BUFFERED + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + " h ", + "RSR", + " w ", + 'R', + OrePrefixes.ring.get(Materials.Steel), + 'S', + OrePrefixes.stick.get(Materials.Steel) + }); ItemList.CompressedFireclay.set(addItem(tLastID = 110, "Compressed Fireclay", "Brick-shaped")); ItemList.Firebrick.set(addItem(tLastID = 111, "Firebrick", "Heat resistant")); - ItemList.Arrow_Head_Glass_Emtpy.set(addItem(tLastID = 200, "Empty Glass Arrow Head", "Fill with Potions before use", new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L))); - ItemList.Arrow_Head_Glass_Poison.set(addItem(tLastID = 201, "Poison Glass Arrow Head", "Glass Arrow filled with Poison", new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); - ItemList.Arrow_Head_Glass_Poison_Long.set(addItem(tLastID = 202, "Poison Glass Arrow Head", "Glass Arrow filled with stretched Poison", new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); - ItemList.Arrow_Head_Glass_Poison_Strong.set(addItem(tLastID = 203, "Poison Glass Arrow Head", "Glass Arrow filled with strong Poison", new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); - ItemList.Arrow_Head_Glass_Slowness.set(addItem(tLastID = 204, "Slowness Glass Arrow Head", "Glass Arrow filled with Laming Brew", new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); - ItemList.Arrow_Head_Glass_Slowness_Long.set(addItem(tLastID = 205, "Slowness Glass Arrow Head", "Glass Arrow filled with stretched Laming Brew", new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); - ItemList.Arrow_Head_Glass_Weakness.set(addItem(tLastID = 206, "Weakness Glass Arrow Head", "Glass Arrow filled with Weakening Brew", new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); - ItemList.Arrow_Head_Glass_Weakness_Long.set(addItem(tLastID = 207, "Weakness Glass Arrow Head", "Glass Arrow filled with stretched Weakening Brew", new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); - ItemList.Arrow_Head_Glass_Holy_Water.set(addItem(tLastID = 208, "Holy Water Glass Arrow Head", "Glass Arrow filled with Holy Water", new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AURAM, 1L))); - - ItemList.Arrow_Wooden_Glass_Emtpy.set(addItem(tLastID = 225, "Regular Glass Vial Arrow", "Empty Glass Arrow", new Behaviour_Arrow_Potion(1.0F, 6.0F), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L))); - ItemList.Arrow_Wooden_Glass_Poison.set(addItem(tLastID = 226, "Regular Poison Arrow", "Glass Arrow filled with Poison", new Behaviour_Arrow_Potion(1.0F, 6.0F, Potion.poison.id, 450, 0, 100), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); - ItemList.Arrow_Wooden_Glass_Poison_Long.set(addItem(tLastID = 227, "Regular Poison Arrow", "Glass Arrow filled with stretched Poison", new Behaviour_Arrow_Potion(1.0F, 6.0F, Potion.poison.id, 900, 0, 100), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); - ItemList.Arrow_Wooden_Glass_Poison_Strong.set(addItem(tLastID = 228, "Regular Poison Arrow", "Glass Arrow filled with strong Poison", new Behaviour_Arrow_Potion(1.0F, 6.0F, Potion.poison.id, 450, 1, 100), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); - ItemList.Arrow_Wooden_Glass_Slowness.set(addItem(tLastID = 229, "Regular Slowness Arrow", "Glass Arrow filled with Laming Brew", new Behaviour_Arrow_Potion(1.0F, 6.0F, Potion.moveSlowdown.id, 900, 0, 100), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); - ItemList.Arrow_Wooden_Glass_Slowness_Long.set(addItem(tLastID = 230, "Regular Slowness Arrow", "Glass Arrow filled with stretched Laming Brew", new Behaviour_Arrow_Potion(1.0F, 6.0F, Potion.moveSlowdown.id, 1800, 0, 100), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); - ItemList.Arrow_Wooden_Glass_Weakness.set(addItem(tLastID = 231, "Regular Weakness Arrow", "Glass Arrow filled with Weakening Brew", new Behaviour_Arrow_Potion(1.0F, 6.0F, Potion.weakness.id, 900, 0, 100), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); - ItemList.Arrow_Wooden_Glass_Weakness_Long.set(addItem(tLastID = 232, "Regular Weakness Arrow", "Glass Arrow filled with stretched Weakening Brew", new Behaviour_Arrow_Potion(1.0F, 6.0F, Potion.weakness.id, 1800, 0, 100), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); - ItemList.Arrow_Wooden_Glass_Holy_Water.set(addItem(tLastID = 233, "Regular Holy Water Arrow", "Glass Arrow filled with Holy Water", new Behaviour_Arrow_Potion(1.0F, 6.0F, Enchantment.smite, 10), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AURAM, 1L))); - - ItemList.Arrow_Plastic_Glass_Emtpy.set(addItem(tLastID = 250, "Light Glass Vial Arrow", "Empty Glass Arrow", new Behaviour_Arrow_Potion(1.5F, 6.0F), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L))); - ItemList.Arrow_Plastic_Glass_Poison.set(addItem(tLastID = 251, "Light Poison Arrow", "Glass Arrow filled with Poison", new Behaviour_Arrow_Potion(1.5F, 6.0F, Potion.poison.id, 450, 0, 100), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); - ItemList.Arrow_Plastic_Glass_Poison_Long.set(addItem(tLastID = 252, "Light Poison Arrow", "Glass Arrow filled with stretched Poison", new Behaviour_Arrow_Potion(1.5F, 6.0F, Potion.poison.id, 900, 0, 100), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); - ItemList.Arrow_Plastic_Glass_Poison_Strong.set(addItem(tLastID = 253, "Light Poison Arrow", "Glass Arrow filled with strong Poison", new Behaviour_Arrow_Potion(1.5F, 6.0F, Potion.poison.id, 450, 1, 100), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); - ItemList.Arrow_Plastic_Glass_Slowness.set(addItem(tLastID = 254, "Light Slowness Arrow", "Glass Arrow filled with Laming Brew", new Behaviour_Arrow_Potion(1.5F, 6.0F, Potion.moveSlowdown.id, 900, 0, 100), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); - ItemList.Arrow_Plastic_Glass_Slowness_Long.set(addItem(tLastID = 255, "Light Slowness Arrow", "Glass Arrow filled with stretched Laming Brew", new Behaviour_Arrow_Potion(1.5F, 6.0F, Potion.moveSlowdown.id, 1800, 0, 100), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); - ItemList.Arrow_Plastic_Glass_Weakness.set(addItem(tLastID = 256, "Light Weakness Arrow", "Glass Arrow filled with Weakening Brew", new Behaviour_Arrow_Potion(1.5F, 6.0F, Potion.weakness.id, 900, 0, 100), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); - ItemList.Arrow_Plastic_Glass_Weakness_Long.set(addItem(tLastID = 257, "Light Weakness Arrow", "Glass Arrow filled with stretched Weakening Brew", new Behaviour_Arrow_Potion(1.5F, 6.0F, Potion.weakness.id, 1800, 0, 100), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); - ItemList.Arrow_Plastic_Glass_Holy_Water.set(addItem(tLastID = 258, "Light Holy Water Arrow", "Glass Arrow filled with Holy Water", new Behaviour_Arrow_Potion(1.5F, 6.0F, Enchantment.smite, 10), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AURAM, 1L))); - - GT_ModHandler.addCraftingRecipe(ItemList.Arrow_Wooden_Glass_Emtpy.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextArrow, aTextStick, aTextFeather, 'A', ItemList.Arrow_Head_Glass_Emtpy, 'F', OreDictNames.craftingFeather, 'S', OrePrefixes.stick.get(Materials.Wood)}); - GT_ModHandler.addCraftingRecipe(ItemList.Arrow_Wooden_Glass_Poison.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextArrow, aTextStick, aTextFeather, 'A', ItemList.Arrow_Head_Glass_Poison, 'F', OreDictNames.craftingFeather, 'S', OrePrefixes.stick.get(Materials.Wood)}); - GT_ModHandler.addCraftingRecipe(ItemList.Arrow_Wooden_Glass_Poison_Long.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextArrow, aTextStick, aTextFeather, 'A', ItemList.Arrow_Head_Glass_Poison_Long, 'F', OreDictNames.craftingFeather, 'S', OrePrefixes.stick.get(Materials.Wood)}); - GT_ModHandler.addCraftingRecipe(ItemList.Arrow_Wooden_Glass_Poison_Strong.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextArrow, aTextStick, aTextFeather, 'A', ItemList.Arrow_Head_Glass_Poison_Strong, 'F', OreDictNames.craftingFeather, 'S', OrePrefixes.stick.get(Materials.Wood)}); - GT_ModHandler.addCraftingRecipe(ItemList.Arrow_Wooden_Glass_Slowness.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextArrow, aTextStick, aTextFeather, 'A', ItemList.Arrow_Head_Glass_Slowness, 'F', OreDictNames.craftingFeather, 'S', OrePrefixes.stick.get(Materials.Wood)}); - GT_ModHandler.addCraftingRecipe(ItemList.Arrow_Wooden_Glass_Slowness_Long.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextArrow, aTextStick, aTextFeather, 'A', ItemList.Arrow_Head_Glass_Slowness_Long, 'F', OreDictNames.craftingFeather, 'S', OrePrefixes.stick.get(Materials.Wood)}); - GT_ModHandler.addCraftingRecipe(ItemList.Arrow_Wooden_Glass_Weakness.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextArrow, aTextStick, aTextFeather, 'A', ItemList.Arrow_Head_Glass_Weakness, 'F', OreDictNames.craftingFeather, 'S', OrePrefixes.stick.get(Materials.Wood)}); - GT_ModHandler.addCraftingRecipe(ItemList.Arrow_Wooden_Glass_Weakness_Long.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextArrow, aTextStick, aTextFeather, 'A', ItemList.Arrow_Head_Glass_Weakness_Long, 'F', OreDictNames.craftingFeather, 'S', OrePrefixes.stick.get(Materials.Wood)}); - GT_ModHandler.addCraftingRecipe(ItemList.Arrow_Wooden_Glass_Holy_Water.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextArrow, aTextStick, aTextFeather, 'A', ItemList.Arrow_Head_Glass_Holy_Water, 'F', OreDictNames.craftingFeather, 'S', OrePrefixes.stick.get(Materials.Wood)}); - - GT_ModHandler.addCraftingRecipe(ItemList.Arrow_Plastic_Glass_Emtpy.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextArrow, aTextStick, aTextFeather, 'A', ItemList.Arrow_Head_Glass_Emtpy, 'F', OreDictNames.craftingFeather, 'S', OrePrefixes.stick.get(Materials.Plastic)}); - GT_ModHandler.addCraftingRecipe(ItemList.Arrow_Plastic_Glass_Poison.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextArrow, aTextStick, aTextFeather, 'A', ItemList.Arrow_Head_Glass_Poison, 'F', OreDictNames.craftingFeather, 'S', OrePrefixes.stick.get(Materials.Plastic)}); - GT_ModHandler.addCraftingRecipe(ItemList.Arrow_Plastic_Glass_Poison_Long.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextArrow, aTextStick, aTextFeather, 'A', ItemList.Arrow_Head_Glass_Poison_Long, 'F', OreDictNames.craftingFeather, 'S', OrePrefixes.stick.get(Materials.Plastic)}); - GT_ModHandler.addCraftingRecipe(ItemList.Arrow_Plastic_Glass_Poison_Strong.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextArrow, aTextStick, aTextFeather, 'A', ItemList.Arrow_Head_Glass_Poison_Strong, 'F', OreDictNames.craftingFeather, 'S', OrePrefixes.stick.get(Materials.Plastic)}); - GT_ModHandler.addCraftingRecipe(ItemList.Arrow_Plastic_Glass_Slowness.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextArrow, aTextStick, aTextFeather, 'A', ItemList.Arrow_Head_Glass_Slowness, 'F', OreDictNames.craftingFeather, 'S', OrePrefixes.stick.get(Materials.Plastic)}); - GT_ModHandler.addCraftingRecipe(ItemList.Arrow_Plastic_Glass_Slowness_Long.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextArrow, aTextStick, aTextFeather, 'A', ItemList.Arrow_Head_Glass_Slowness_Long, 'F', OreDictNames.craftingFeather, 'S', OrePrefixes.stick.get(Materials.Plastic)}); - GT_ModHandler.addCraftingRecipe(ItemList.Arrow_Plastic_Glass_Weakness.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextArrow, aTextStick, aTextFeather, 'A', ItemList.Arrow_Head_Glass_Weakness, 'F', OreDictNames.craftingFeather, 'S', OrePrefixes.stick.get(Materials.Plastic)}); - GT_ModHandler.addCraftingRecipe(ItemList.Arrow_Plastic_Glass_Weakness_Long.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextArrow, aTextStick, aTextFeather, 'A', ItemList.Arrow_Head_Glass_Weakness_Long, 'F', OreDictNames.craftingFeather, 'S', OrePrefixes.stick.get(Materials.Plastic)}); - GT_ModHandler.addCraftingRecipe(ItemList.Arrow_Plastic_Glass_Holy_Water.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextArrow, aTextStick, aTextFeather, 'A', ItemList.Arrow_Head_Glass_Holy_Water, 'F', OreDictNames.craftingFeather, 'S', OrePrefixes.stick.get(Materials.Plastic)}); - - ItemList.Shape_Empty.set(addItem(tLastID = 300, "Empty Shape Plate", "Raw Plate to make Molds and Extruder Shapes", new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 4L))); - - //GT_ModHandler.addCraftingRecipe(ItemList.Shape_Empty.get(1L, new Object[0]), GT_ModHandler.RecipeBits.MIRRORED | GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"hf", "PP", "PP", 'P', OrePrefixes.plate.get(Materials.Steel)}); + ItemList.Arrow_Head_Glass_Emtpy.set(addItem( + tLastID = 200, + "Empty Glass Arrow Head", + "Fill with Potions before use", + new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L))); + ItemList.Arrow_Head_Glass_Poison.set(addItem( + tLastID = 201, + "Poison Glass Arrow Head", + "Glass Arrow filled with Poison", + new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); + ItemList.Arrow_Head_Glass_Poison_Long.set(addItem( + tLastID = 202, + "Poison Glass Arrow Head", + "Glass Arrow filled with stretched Poison", + new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); + ItemList.Arrow_Head_Glass_Poison_Strong.set(addItem( + tLastID = 203, + "Poison Glass Arrow Head", + "Glass Arrow filled with strong Poison", + new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); + ItemList.Arrow_Head_Glass_Slowness.set(addItem( + tLastID = 204, + "Slowness Glass Arrow Head", + "Glass Arrow filled with Laming Brew", + new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); + ItemList.Arrow_Head_Glass_Slowness_Long.set(addItem( + tLastID = 205, + "Slowness Glass Arrow Head", + "Glass Arrow filled with stretched Laming Brew", + new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); + ItemList.Arrow_Head_Glass_Weakness.set(addItem( + tLastID = 206, + "Weakness Glass Arrow Head", + "Glass Arrow filled with Weakening Brew", + new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); + ItemList.Arrow_Head_Glass_Weakness_Long.set(addItem( + tLastID = 207, + "Weakness Glass Arrow Head", + "Glass Arrow filled with stretched Weakening Brew", + new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); + ItemList.Arrow_Head_Glass_Holy_Water.set(addItem( + tLastID = 208, + "Holy Water Glass Arrow Head", + "Glass Arrow filled with Holy Water", + new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AURAM, 1L))); + + ItemList.Arrow_Wooden_Glass_Emtpy.set(addItem( + tLastID = 225, + "Regular Glass Vial Arrow", + "Empty Glass Arrow", + new Behaviour_Arrow_Potion(1.0F, 6.0F), + new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L))); + ItemList.Arrow_Wooden_Glass_Poison.set(addItem( + tLastID = 226, + "Regular Poison Arrow", + "Glass Arrow filled with Poison", + new Behaviour_Arrow_Potion(1.0F, 6.0F, Potion.poison.id, 450, 0, 100), + new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); + ItemList.Arrow_Wooden_Glass_Poison_Long.set(addItem( + tLastID = 227, + "Regular Poison Arrow", + "Glass Arrow filled with stretched Poison", + new Behaviour_Arrow_Potion(1.0F, 6.0F, Potion.poison.id, 900, 0, 100), + new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); + ItemList.Arrow_Wooden_Glass_Poison_Strong.set(addItem( + tLastID = 228, + "Regular Poison Arrow", + "Glass Arrow filled with strong Poison", + new Behaviour_Arrow_Potion(1.0F, 6.0F, Potion.poison.id, 450, 1, 100), + new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); + ItemList.Arrow_Wooden_Glass_Slowness.set(addItem( + tLastID = 229, + "Regular Slowness Arrow", + "Glass Arrow filled with Laming Brew", + new Behaviour_Arrow_Potion(1.0F, 6.0F, Potion.moveSlowdown.id, 900, 0, 100), + new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); + ItemList.Arrow_Wooden_Glass_Slowness_Long.set(addItem( + tLastID = 230, + "Regular Slowness Arrow", + "Glass Arrow filled with stretched Laming Brew", + new Behaviour_Arrow_Potion(1.0F, 6.0F, Potion.moveSlowdown.id, 1800, 0, 100), + new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); + ItemList.Arrow_Wooden_Glass_Weakness.set(addItem( + tLastID = 231, + "Regular Weakness Arrow", + "Glass Arrow filled with Weakening Brew", + new Behaviour_Arrow_Potion(1.0F, 6.0F, Potion.weakness.id, 900, 0, 100), + new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); + ItemList.Arrow_Wooden_Glass_Weakness_Long.set(addItem( + tLastID = 232, + "Regular Weakness Arrow", + "Glass Arrow filled with stretched Weakening Brew", + new Behaviour_Arrow_Potion(1.0F, 6.0F, Potion.weakness.id, 1800, 0, 100), + new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); + ItemList.Arrow_Wooden_Glass_Holy_Water.set(addItem( + tLastID = 233, + "Regular Holy Water Arrow", + "Glass Arrow filled with Holy Water", + new Behaviour_Arrow_Potion(1.0F, 6.0F, Enchantment.smite, 10), + new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AURAM, 1L))); + + ItemList.Arrow_Plastic_Glass_Emtpy.set(addItem( + tLastID = 250, + "Light Glass Vial Arrow", + "Empty Glass Arrow", + new Behaviour_Arrow_Potion(1.5F, 6.0F), + new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L))); + ItemList.Arrow_Plastic_Glass_Poison.set(addItem( + tLastID = 251, + "Light Poison Arrow", + "Glass Arrow filled with Poison", + new Behaviour_Arrow_Potion(1.5F, 6.0F, Potion.poison.id, 450, 0, 100), + new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); + ItemList.Arrow_Plastic_Glass_Poison_Long.set(addItem( + tLastID = 252, + "Light Poison Arrow", + "Glass Arrow filled with stretched Poison", + new Behaviour_Arrow_Potion(1.5F, 6.0F, Potion.poison.id, 900, 0, 100), + new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); + ItemList.Arrow_Plastic_Glass_Poison_Strong.set(addItem( + tLastID = 253, + "Light Poison Arrow", + "Glass Arrow filled with strong Poison", + new Behaviour_Arrow_Potion(1.5F, 6.0F, Potion.poison.id, 450, 1, 100), + new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); + ItemList.Arrow_Plastic_Glass_Slowness.set(addItem( + tLastID = 254, + "Light Slowness Arrow", + "Glass Arrow filled with Laming Brew", + new Behaviour_Arrow_Potion(1.5F, 6.0F, Potion.moveSlowdown.id, 900, 0, 100), + new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); + ItemList.Arrow_Plastic_Glass_Slowness_Long.set(addItem( + tLastID = 255, + "Light Slowness Arrow", + "Glass Arrow filled with stretched Laming Brew", + new Behaviour_Arrow_Potion(1.5F, 6.0F, Potion.moveSlowdown.id, 1800, 0, 100), + new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); + ItemList.Arrow_Plastic_Glass_Weakness.set(addItem( + tLastID = 256, + "Light Weakness Arrow", + "Glass Arrow filled with Weakening Brew", + new Behaviour_Arrow_Potion(1.5F, 6.0F, Potion.weakness.id, 900, 0, 100), + new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); + ItemList.Arrow_Plastic_Glass_Weakness_Long.set(addItem( + tLastID = 257, + "Light Weakness Arrow", + "Glass Arrow filled with stretched Weakening Brew", + new Behaviour_Arrow_Potion(1.5F, 6.0F, Potion.weakness.id, 1800, 0, 100), + new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); + ItemList.Arrow_Plastic_Glass_Holy_Water.set(addItem( + tLastID = 258, + "Light Holy Water Arrow", + "Glass Arrow filled with Holy Water", + new Behaviour_Arrow_Potion(1.5F, 6.0F, Enchantment.smite, 10), + new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AURAM, 1L))); + + GT_ModHandler.addCraftingRecipe( + ItemList.Arrow_Wooden_Glass_Emtpy.get(1L), + GT_ModHandler.RecipeBits.BUFFERED + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + aTextArrow, + aTextStick, + aTextFeather, + 'A', + ItemList.Arrow_Head_Glass_Emtpy, + 'F', + OreDictNames.craftingFeather, + 'S', + OrePrefixes.stick.get(Materials.Wood) + }); + GT_ModHandler.addCraftingRecipe( + ItemList.Arrow_Wooden_Glass_Poison.get(1L), + GT_ModHandler.RecipeBits.BUFFERED + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + aTextArrow, + aTextStick, + aTextFeather, + 'A', + ItemList.Arrow_Head_Glass_Poison, + 'F', + OreDictNames.craftingFeather, + 'S', + OrePrefixes.stick.get(Materials.Wood) + }); + GT_ModHandler.addCraftingRecipe( + ItemList.Arrow_Wooden_Glass_Poison_Long.get(1L), + GT_ModHandler.RecipeBits.BUFFERED + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + aTextArrow, + aTextStick, + aTextFeather, + 'A', + ItemList.Arrow_Head_Glass_Poison_Long, + 'F', + OreDictNames.craftingFeather, + 'S', + OrePrefixes.stick.get(Materials.Wood) + }); + GT_ModHandler.addCraftingRecipe( + ItemList.Arrow_Wooden_Glass_Poison_Strong.get(1L), + GT_ModHandler.RecipeBits.BUFFERED + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + aTextArrow, + aTextStick, + aTextFeather, + 'A', + ItemList.Arrow_Head_Glass_Poison_Strong, + 'F', + OreDictNames.craftingFeather, + 'S', + OrePrefixes.stick.get(Materials.Wood) + }); + GT_ModHandler.addCraftingRecipe( + ItemList.Arrow_Wooden_Glass_Slowness.get(1L), + GT_ModHandler.RecipeBits.BUFFERED + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + aTextArrow, + aTextStick, + aTextFeather, + 'A', + ItemList.Arrow_Head_Glass_Slowness, + 'F', + OreDictNames.craftingFeather, + 'S', + OrePrefixes.stick.get(Materials.Wood) + }); + GT_ModHandler.addCraftingRecipe( + ItemList.Arrow_Wooden_Glass_Slowness_Long.get(1L), + GT_ModHandler.RecipeBits.BUFFERED + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + aTextArrow, + aTextStick, + aTextFeather, + 'A', + ItemList.Arrow_Head_Glass_Slowness_Long, + 'F', + OreDictNames.craftingFeather, + 'S', + OrePrefixes.stick.get(Materials.Wood) + }); + GT_ModHandler.addCraftingRecipe( + ItemList.Arrow_Wooden_Glass_Weakness.get(1L), + GT_ModHandler.RecipeBits.BUFFERED + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + aTextArrow, + aTextStick, + aTextFeather, + 'A', + ItemList.Arrow_Head_Glass_Weakness, + 'F', + OreDictNames.craftingFeather, + 'S', + OrePrefixes.stick.get(Materials.Wood) + }); + GT_ModHandler.addCraftingRecipe( + ItemList.Arrow_Wooden_Glass_Weakness_Long.get(1L), + GT_ModHandler.RecipeBits.BUFFERED + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + aTextArrow, + aTextStick, + aTextFeather, + 'A', + ItemList.Arrow_Head_Glass_Weakness_Long, + 'F', + OreDictNames.craftingFeather, + 'S', + OrePrefixes.stick.get(Materials.Wood) + }); + GT_ModHandler.addCraftingRecipe( + ItemList.Arrow_Wooden_Glass_Holy_Water.get(1L), + GT_ModHandler.RecipeBits.BUFFERED + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + aTextArrow, + aTextStick, + aTextFeather, + 'A', + ItemList.Arrow_Head_Glass_Holy_Water, + 'F', + OreDictNames.craftingFeather, + 'S', + OrePrefixes.stick.get(Materials.Wood) + }); + + GT_ModHandler.addCraftingRecipe( + ItemList.Arrow_Plastic_Glass_Emtpy.get(1L), + GT_ModHandler.RecipeBits.BUFFERED + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + aTextArrow, + aTextStick, + aTextFeather, + 'A', + ItemList.Arrow_Head_Glass_Emtpy, + 'F', + OreDictNames.craftingFeather, + 'S', + OrePrefixes.stick.get(Materials.Plastic) + }); + GT_ModHandler.addCraftingRecipe( + ItemList.Arrow_Plastic_Glass_Poison.get(1L), + GT_ModHandler.RecipeBits.BUFFERED + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + aTextArrow, + aTextStick, + aTextFeather, + 'A', + ItemList.Arrow_Head_Glass_Poison, + 'F', + OreDictNames.craftingFeather, + 'S', + OrePrefixes.stick.get(Materials.Plastic) + }); + GT_ModHandler.addCraftingRecipe( + ItemList.Arrow_Plastic_Glass_Poison_Long.get(1L), + GT_ModHandler.RecipeBits.BUFFERED + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + aTextArrow, + aTextStick, + aTextFeather, + 'A', + ItemList.Arrow_Head_Glass_Poison_Long, + 'F', + OreDictNames.craftingFeather, + 'S', + OrePrefixes.stick.get(Materials.Plastic) + }); + GT_ModHandler.addCraftingRecipe( + ItemList.Arrow_Plastic_Glass_Poison_Strong.get(1L), + GT_ModHandler.RecipeBits.BUFFERED + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + aTextArrow, + aTextStick, + aTextFeather, + 'A', + ItemList.Arrow_Head_Glass_Poison_Strong, + 'F', + OreDictNames.craftingFeather, + 'S', + OrePrefixes.stick.get(Materials.Plastic) + }); + GT_ModHandler.addCraftingRecipe( + ItemList.Arrow_Plastic_Glass_Slowness.get(1L), + GT_ModHandler.RecipeBits.BUFFERED + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + aTextArrow, + aTextStick, + aTextFeather, + 'A', + ItemList.Arrow_Head_Glass_Slowness, + 'F', + OreDictNames.craftingFeather, + 'S', + OrePrefixes.stick.get(Materials.Plastic) + }); + GT_ModHandler.addCraftingRecipe( + ItemList.Arrow_Plastic_Glass_Slowness_Long.get(1L), + GT_ModHandler.RecipeBits.BUFFERED + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + aTextArrow, + aTextStick, + aTextFeather, + 'A', + ItemList.Arrow_Head_Glass_Slowness_Long, + 'F', + OreDictNames.craftingFeather, + 'S', + OrePrefixes.stick.get(Materials.Plastic) + }); + GT_ModHandler.addCraftingRecipe( + ItemList.Arrow_Plastic_Glass_Weakness.get(1L), + GT_ModHandler.RecipeBits.BUFFERED + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + aTextArrow, + aTextStick, + aTextFeather, + 'A', + ItemList.Arrow_Head_Glass_Weakness, + 'F', + OreDictNames.craftingFeather, + 'S', + OrePrefixes.stick.get(Materials.Plastic) + }); + GT_ModHandler.addCraftingRecipe( + ItemList.Arrow_Plastic_Glass_Weakness_Long.get(1L), + GT_ModHandler.RecipeBits.BUFFERED + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + aTextArrow, + aTextStick, + aTextFeather, + 'A', + ItemList.Arrow_Head_Glass_Weakness_Long, + 'F', + OreDictNames.craftingFeather, + 'S', + OrePrefixes.stick.get(Materials.Plastic) + }); + GT_ModHandler.addCraftingRecipe( + ItemList.Arrow_Plastic_Glass_Holy_Water.get(1L), + GT_ModHandler.RecipeBits.BUFFERED + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + aTextArrow, + aTextStick, + aTextFeather, + 'A', + ItemList.Arrow_Head_Glass_Holy_Water, + 'F', + OreDictNames.craftingFeather, + 'S', + OrePrefixes.stick.get(Materials.Plastic) + }); + + ItemList.Shape_Empty.set(addItem( + tLastID = 300, + "Empty Shape Plate", + "Raw Plate to make Molds and Extruder Shapes", + new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 4L), + new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 4L))); + + // GT_ModHandler.addCraftingRecipe(ItemList.Shape_Empty.get(1L, new Object[0]), + // GT_ModHandler.RecipeBits.MIRRORED | GT_ModHandler.RecipeBits.BUFFERED | + // GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"hf", "PP", "PP", + // 'P', OrePrefixes.plate.get(Materials.Steel)}); ItemList.Shape_Mold_Plate.set(addItem(tLastID = 301, "Mold (Plate)", "Mold for making Plates")); ItemList.Shape_Mold_Casing.set(addItem(tLastID = 302, "Mold (Casing)", "Mold for making Item Casings")); ItemList.Shape_Mold_Gear.set(addItem(tLastID = 303, "Mold (Gear)", "Mold for making Gears")); - ItemList.Shape_Mold_Credit.set(addItem(tLastID = 304, "Mold (Coinage)", "Secure Mold for making Coins (Don't lose it!)")); + ItemList.Shape_Mold_Credit.set( + addItem(tLastID = 304, "Mold (Coinage)", "Secure Mold for making Coins (Don't lose it!)")); ItemList.Shape_Mold_Bottle.set(addItem(tLastID = 305, "Mold (Bottle)", "Mold for making Bottles")); ItemList.Shape_Mold_Ingot.set(addItem(tLastID = 306, "Mold (Ingot)", "Mold for making Ingots")); ItemList.Shape_Mold_Ball.set(addItem(tLastID = 307, "Mold (Ball)", "Mold for making Balls")); @@ -198,7 +931,8 @@ public class GT_MetaGenerated_Item_01 extends GT_MetaGenerated_Item_X32 { ItemList.Shape_Mold_Baguette.set(addItem(tLastID = 312, "Mold (Baguette)", "Mold for shaping Baguettes")); ItemList.Shape_Mold_Cylinder.set(addItem(tLastID = 313, "Mold (Cylinder)", "Mold for shaping Cylinders")); ItemList.Shape_Mold_Anvil.set(addItem(tLastID = 314, "Mold (Anvil)", "Mold for shaping Anvils")); - ItemList.Shape_Mold_Name.set(addItem(tLastID = 315, "Mold (Name)", "Mold for naming Items (rename Mold with Anvil)")); + ItemList.Shape_Mold_Name.set( + addItem(tLastID = 315, "Mold (Name)", "Mold for naming Items (rename Mold with Anvil)")); ItemList.Shape_Mold_Arrow.set(addItem(tLastID = 316, "Mold (Arrow Head)", "Mold for making Arrow Heads")); ItemList.Shape_Mold_Gear_Small.set(addItem(tLastID = 317, "Mold (Small Gear)", "Mold for making small Gears")); ItemList.Shape_Mold_Rod.set(addItem(tLastID = 318, "Mold (Rod)", "Mold for making Rods")); @@ -208,277 +942,1009 @@ public class GT_MetaGenerated_Item_01 extends GT_MetaGenerated_Item_X32 { ItemList.Shape_Mold_Ring.set(addItem(tLastID = 322, "Mold (Ring)", "Mold for making Rings")); ItemList.Shape_Mold_Rod_Long.set(addItem(tLastID = 323, "Mold (Long Rod)", "Mold for making Long Rods")); ItemList.Shape_Mold_Rotor.set(addItem(tLastID = 324, "Mold (Rotor)", "Mold for making a Rotor")); - ItemList.Shape_Mold_Turbine_Blade.set(addItem(tLastID = 325, "Mold (Turbine Blade)", "Mold for making a Turbine Blade")); + ItemList.Shape_Mold_Turbine_Blade.set( + addItem(tLastID = 325, "Mold (Turbine Blade)", "Mold for making a Turbine Blade")); ItemList.Shape_Mold_Pipe_Tiny.set(addItem(tLastID = 326, "Mold (Tiny Pipe)", "Mold for making tiny Pipes")); ItemList.Shape_Mold_Pipe_Small.set(addItem(tLastID = 327, "Mold (Small Pipe)", "Mold for making small Pipes")); ItemList.Shape_Mold_Pipe_Medium.set(addItem(tLastID = 328, "Mold (Normal Pipe)", "Mold for making Pipes")); ItemList.Shape_Mold_Pipe_Large.set(addItem(tLastID = 329, "Mold (Large Pipe)", "Mold for making large Pipes")); - ItemList.Shape_Mold_Pipe_Huge.set(addItem(tLastID = 330, "Mold (Huge Pipe)", "Mold for making full Block Pipes")); - GT_ModHandler.removeRecipe(new ItemStack(Blocks.glass), null, new ItemStack(Blocks.glass), null, new ItemStack(Blocks.glass)); - - ItemList.Shape_Extruder_Plate.set(addItem(tLastID = 350, "Extruder Shape (Plate)", "Extruder Shape for making Plates")); - ItemList.Shape_Extruder_Rod.set(addItem(tLastID = 351, "Extruder Shape (Rod)", "Extruder Shape for making Rods")); - ItemList.Shape_Extruder_Bolt.set(addItem(tLastID = 352, "Extruder Shape (Bolt)", "Extruder Shape for making Bolts")); - ItemList.Shape_Extruder_Ring.set(addItem(tLastID = 353, "Extruder Shape (Ring)", "Extruder Shape for making Rings")); - ItemList.Shape_Extruder_Cell.set(addItem(tLastID = 354, "Extruder Shape (Cell)", "Extruder Shape for making Cells")); - ItemList.Shape_Extruder_Ingot.set(addItem(tLastID = 355, "Extruder Shape (Ingot)", "Extruder Shape for, wait, can't we just use a Furnace?")); - ItemList.Shape_Extruder_Wire.set(addItem(tLastID = 356, "Extruder Shape (Wire)", "Extruder Shape for making Wires")); - ItemList.Shape_Extruder_Casing.set(addItem(tLastID = 357, "Extruder Shape (Casing)", "Extruder Shape for making Item Casings")); - ItemList.Shape_Extruder_Pipe_Tiny.set(addItem(tLastID = 358, "Extruder Shape (Tiny Pipe)", "Extruder Shape for making tiny Pipes")); - ItemList.Shape_Extruder_Pipe_Small.set(addItem(tLastID = 359, "Extruder Shape (Small Pipe)", "Extruder Shape for making small Pipes")); - ItemList.Shape_Extruder_Pipe_Medium.set(addItem(tLastID = 360, "Extruder Shape (Normal Pipe)", "Extruder Shape for making Pipes")); - ItemList.Shape_Extruder_Pipe_Large.set(addItem(tLastID = 361, "Extruder Shape (Large Pipe)", "Extruder Shape for making large Pipes")); - ItemList.Shape_Extruder_Pipe_Huge.set(addItem(tLastID = 362, "Extruder Shape (Huge Pipe)", "Extruder Shape for making full Block Pipes")); - ItemList.Shape_Extruder_Block.set(addItem(tLastID = 363, "Extruder Shape (Block)", "Extruder Shape for making Blocks")); - ItemList.Shape_Extruder_Sword.set(addItem(tLastID = 364, "Extruder Shape (Sword Blade)", "Extruder Shape for making Swords")); - ItemList.Shape_Extruder_Pickaxe.set(addItem(tLastID = 365, "Extruder Shape (Pickaxe Head)", "Extruder Shape for making Pickaxes")); - ItemList.Shape_Extruder_Shovel.set(addItem(tLastID = 366, "Extruder Shape (Shovel Head)", "Extruder Shape for making Shovels")); - ItemList.Shape_Extruder_Axe.set(addItem(tLastID = 367, "Extruder Shape (Axe Head)", "Extruder Shape for making Axes")); - ItemList.Shape_Extruder_Hoe.set(addItem(tLastID = 368, "Extruder Shape (Hoe Head)", "Extruder Shape for making Hoes")); - ItemList.Shape_Extruder_Hammer.set(addItem(tLastID = 369, "Extruder Shape (Hammer Head)", "Extruder Shape for making Hammers")); - ItemList.Shape_Extruder_File.set(addItem(tLastID = 370, "Extruder Shape (File Head)", "Extruder Shape for making Files")); - ItemList.Shape_Extruder_Saw.set(addItem(tLastID = 371, "Extruder Shape (Saw Blade)", "Extruder Shape for making Saws")); - ItemList.Shape_Extruder_Gear.set(addItem(tLastID = 372, "Extruder Shape (Gear)", "Extruder Shape for making Gears")); - ItemList.Shape_Extruder_Bottle.set(addItem(tLastID = 373, "Extruder Shape (Bottle)", "Extruder Shape for making Bottles")); - ItemList.Shape_Extruder_Rotor.set(addItem(tLastID = 374, "Extruder Shape (Rotor)", "Extruder Shape for a Rotor")); - ItemList.Shape_Extruder_Small_Gear.set(addItem(tLastID = 375, "Extruder Shape (Small Gear)", "Extruder Shape for a Small Gear")); - ItemList.Shape_Extruder_Turbine_Blade.set(addItem(tLastID = 376, "Extruder Shape (Turbine Blade)", "Extruder Shape for a Turbine Blade")); + ItemList.Shape_Mold_Pipe_Huge.set( + addItem(tLastID = 330, "Mold (Huge Pipe)", "Mold for making full Block Pipes")); + GT_ModHandler.removeRecipe( + new ItemStack(Blocks.glass), null, new ItemStack(Blocks.glass), null, new ItemStack(Blocks.glass)); + + ItemList.Shape_Extruder_Plate.set( + addItem(tLastID = 350, "Extruder Shape (Plate)", "Extruder Shape for making Plates")); + ItemList.Shape_Extruder_Rod.set( + addItem(tLastID = 351, "Extruder Shape (Rod)", "Extruder Shape for making Rods")); + ItemList.Shape_Extruder_Bolt.set( + addItem(tLastID = 352, "Extruder Shape (Bolt)", "Extruder Shape for making Bolts")); + ItemList.Shape_Extruder_Ring.set( + addItem(tLastID = 353, "Extruder Shape (Ring)", "Extruder Shape for making Rings")); + ItemList.Shape_Extruder_Cell.set( + addItem(tLastID = 354, "Extruder Shape (Cell)", "Extruder Shape for making Cells")); + ItemList.Shape_Extruder_Ingot.set(addItem( + tLastID = 355, "Extruder Shape (Ingot)", "Extruder Shape for, wait, can't we just use a Furnace?")); + ItemList.Shape_Extruder_Wire.set( + addItem(tLastID = 356, "Extruder Shape (Wire)", "Extruder Shape for making Wires")); + ItemList.Shape_Extruder_Casing.set( + addItem(tLastID = 357, "Extruder Shape (Casing)", "Extruder Shape for making Item Casings")); + ItemList.Shape_Extruder_Pipe_Tiny.set( + addItem(tLastID = 358, "Extruder Shape (Tiny Pipe)", "Extruder Shape for making tiny Pipes")); + ItemList.Shape_Extruder_Pipe_Small.set( + addItem(tLastID = 359, "Extruder Shape (Small Pipe)", "Extruder Shape for making small Pipes")); + ItemList.Shape_Extruder_Pipe_Medium.set( + addItem(tLastID = 360, "Extruder Shape (Normal Pipe)", "Extruder Shape for making Pipes")); + ItemList.Shape_Extruder_Pipe_Large.set( + addItem(tLastID = 361, "Extruder Shape (Large Pipe)", "Extruder Shape for making large Pipes")); + ItemList.Shape_Extruder_Pipe_Huge.set( + addItem(tLastID = 362, "Extruder Shape (Huge Pipe)", "Extruder Shape for making full Block Pipes")); + ItemList.Shape_Extruder_Block.set( + addItem(tLastID = 363, "Extruder Shape (Block)", "Extruder Shape for making Blocks")); + ItemList.Shape_Extruder_Sword.set( + addItem(tLastID = 364, "Extruder Shape (Sword Blade)", "Extruder Shape for making Swords")); + ItemList.Shape_Extruder_Pickaxe.set( + addItem(tLastID = 365, "Extruder Shape (Pickaxe Head)", "Extruder Shape for making Pickaxes")); + ItemList.Shape_Extruder_Shovel.set( + addItem(tLastID = 366, "Extruder Shape (Shovel Head)", "Extruder Shape for making Shovels")); + ItemList.Shape_Extruder_Axe.set( + addItem(tLastID = 367, "Extruder Shape (Axe Head)", "Extruder Shape for making Axes")); + ItemList.Shape_Extruder_Hoe.set( + addItem(tLastID = 368, "Extruder Shape (Hoe Head)", "Extruder Shape for making Hoes")); + ItemList.Shape_Extruder_Hammer.set( + addItem(tLastID = 369, "Extruder Shape (Hammer Head)", "Extruder Shape for making Hammers")); + ItemList.Shape_Extruder_File.set( + addItem(tLastID = 370, "Extruder Shape (File Head)", "Extruder Shape for making Files")); + ItemList.Shape_Extruder_Saw.set( + addItem(tLastID = 371, "Extruder Shape (Saw Blade)", "Extruder Shape for making Saws")); + ItemList.Shape_Extruder_Gear.set( + addItem(tLastID = 372, "Extruder Shape (Gear)", "Extruder Shape for making Gears")); + ItemList.Shape_Extruder_Bottle.set( + addItem(tLastID = 373, "Extruder Shape (Bottle)", "Extruder Shape for making Bottles")); + ItemList.Shape_Extruder_Rotor.set( + addItem(tLastID = 374, "Extruder Shape (Rotor)", "Extruder Shape for a Rotor")); + ItemList.Shape_Extruder_Small_Gear.set( + addItem(tLastID = 375, "Extruder Shape (Small Gear)", "Extruder Shape for a Small Gear")); + ItemList.Shape_Extruder_Turbine_Blade.set( + addItem(tLastID = 376, "Extruder Shape (Turbine Blade)", "Extruder Shape for a Turbine Blade")); ItemList.Shape_Slicer_Flat.set(addItem(tLastID = 398, "Slicer Blade (Flat)", "Slicer Blade for cutting Flat")); - ItemList.Shape_Slicer_Stripes.set(addItem(tLastID = 399, "Slicer Blade (Stripes)", "Slicer Blade for cutting Stripes")); - - GT_ModHandler.addCraftingRecipe(ItemList.Shape_Slicer_Flat.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"hXS", aTextShape, "fXd", 'P', ItemList.Shape_Extruder_Block, 'X', OrePrefixes.plate.get(Materials.StainlessSteel), 'S', OrePrefixes.screw.get(Materials.StainlessSteel)}); - GT_ModHandler.addCraftingRecipe(ItemList.Shape_Slicer_Stripes.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"hXS", "XPX", "fXd", 'P', ItemList.Shape_Extruder_Block, 'X', OrePrefixes.plate.get(Materials.StainlessSteel), 'S', OrePrefixes.screw.get(Materials.StainlessSteel)}); - - ItemList.Fuel_Can_Plastic_Empty.set(addItem(tLastID = 400, "Empty Plastic Fuel Can", "Used to store Fuels", new ItemData(Materials.Plastic, OrePrefixes.plate.mMaterialAmount * 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 1L))); - ItemList.Fuel_Can_Plastic_Filled.set(addItem(tLastID = 401, "Plastic Fuel Can", "Burns well in Diesel Generators", new ItemData(Materials.Plastic, OrePrefixes.plate.mMaterialAmount * 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 1L))); - - GT_ModHandler.addCraftingRecipe(ItemList.Fuel_Can_Plastic_Empty.get(7L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" PP", "P P", "PPP", 'P', OrePrefixes.plate.get(Materials.Plastic)}); - - ItemList.Spray_Empty.set(addItem(tLastID = 402, "Empty Spray Can", "Used for making Sprays", new ItemData(Materials.Tin, OrePrefixes.plate.mMaterialAmount * 2L, Materials.Redstone, OrePrefixes.dust.mMaterialAmount), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 1L))); - - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Redstone, 1L), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L), GT_Utility.getIntegratedCircuit(1)}, GT_Values.NF, ItemList.Spray_Empty.get(1L), 800, 1); - - ItemList.Crate_Empty.set(addItem(tLastID = 403, "Empty Crate", "To Package lots of Material", new ItemData(Materials.Wood, 3628800L, Materials.Iron, OrePrefixes.screw.mMaterialAmount), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 2L))); - - GT_ModHandler.addCraftingRecipe(ItemList.Crate_Empty.get(4L), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"SWS", "WdW", "SWS", 'W', OrePrefixes.plank.get(Materials.Wood), 'S', OrePrefixes.screw.get(Materials.AnyIron)}); - GT_ModHandler.addCraftingRecipe(ItemList.Crate_Empty.get(4L), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"SWS", "WdW", "SWS", 'W', OrePrefixes.plank.get(Materials.Wood), 'S', OrePrefixes.screw.get(Materials.Steel)}); - - ItemList.ThermosCan_Empty.set(addItem(tLastID = 404, "Empty Thermos Can", "Keeping hot things hot and cold things cold", new ItemData(Materials.Aluminium, OrePrefixes.plateDouble.mMaterialAmount * 1L + 2L * OrePrefixes.ring.mMaterialAmount), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.GELUM, 1L))); - - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Aluminium, 1L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Aluminium, 2L), GT_Utility.getIntegratedCircuit(1)}, GT_Values.NF, ItemList.ThermosCan_Empty.get(1L), 800, 1); - - ItemList.Large_Fluid_Cell_Steel.set(addItem(tLastID = 405, "Large Steel Fluid Cell", "", new ItemData(Materials.Steel, OrePrefixes.plateDouble.mMaterialAmount * 4L, new MaterialStack(Materials.Bronze, OrePrefixes.ring.mMaterialAmount * 4L)), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 2L))); + ItemList.Shape_Slicer_Stripes.set( + addItem(tLastID = 399, "Slicer Blade (Stripes)", "Slicer Blade for cutting Stripes")); + + GT_ModHandler.addCraftingRecipe( + ItemList.Shape_Slicer_Flat.get(1L), + GT_ModHandler.RecipeBits.BUFFERED + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + "hXS", + aTextShape, + "fXd", + 'P', + ItemList.Shape_Extruder_Block, + 'X', + OrePrefixes.plate.get(Materials.StainlessSteel), + 'S', + OrePrefixes.screw.get(Materials.StainlessSteel) + }); + GT_ModHandler.addCraftingRecipe( + ItemList.Shape_Slicer_Stripes.get(1L), + GT_ModHandler.RecipeBits.BUFFERED + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + "hXS", + "XPX", + "fXd", + 'P', + ItemList.Shape_Extruder_Block, + 'X', + OrePrefixes.plate.get(Materials.StainlessSteel), + 'S', + OrePrefixes.screw.get(Materials.StainlessSteel) + }); + + ItemList.Fuel_Can_Plastic_Empty.set(addItem( + tLastID = 400, + "Empty Plastic Fuel Can", + "Used to store Fuels", + new ItemData(Materials.Plastic, OrePrefixes.plate.mMaterialAmount * 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 1L))); + ItemList.Fuel_Can_Plastic_Filled.set(addItem( + tLastID = 401, + "Plastic Fuel Can", + "Burns well in Diesel Generators", + new ItemData(Materials.Plastic, OrePrefixes.plate.mMaterialAmount * 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 1L))); + + GT_ModHandler.addCraftingRecipe( + ItemList.Fuel_Can_Plastic_Empty.get(7L), + GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] {" PP", "P P", "PPP", 'P', OrePrefixes.plate.get(Materials.Plastic)}); + + ItemList.Spray_Empty.set(addItem( + tLastID = 402, + "Empty Spray Can", + "Used for making Sprays", + new ItemData( + Materials.Tin, + OrePrefixes.plate.mMaterialAmount * 2L, + Materials.Redstone, + OrePrefixes.dust.mMaterialAmount), + new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 1L))); + + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Redstone, 1L), + GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L), + GT_Utility.getIntegratedCircuit(1) + }, + GT_Values.NF, + ItemList.Spray_Empty.get(1L), + 800, + 1); + + ItemList.Crate_Empty.set(addItem( + tLastID = 403, + "Empty Crate", + "To Package lots of Material", + new ItemData(Materials.Wood, 3628800L, Materials.Iron, OrePrefixes.screw.mMaterialAmount), + new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 2L))); + + GT_ModHandler.addCraftingRecipe( + ItemList.Crate_Empty.get(4L), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[] { + "SWS", + "WdW", + "SWS", + 'W', + OrePrefixes.plank.get(Materials.Wood), + 'S', + OrePrefixes.screw.get(Materials.AnyIron) + }); + GT_ModHandler.addCraftingRecipe( + ItemList.Crate_Empty.get(4L), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[] { + "SWS", + "WdW", + "SWS", + 'W', + OrePrefixes.plank.get(Materials.Wood), + 'S', + OrePrefixes.screw.get(Materials.Steel) + }); + + ItemList.ThermosCan_Empty.set(addItem( + tLastID = 404, + "Empty Thermos Can", + "Keeping hot things hot and cold things cold", + new ItemData( + Materials.Aluminium, + OrePrefixes.plateDouble.mMaterialAmount * 1L + 2L * OrePrefixes.ring.mMaterialAmount), + new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.GELUM, 1L))); + + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Aluminium, 1L), + GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Aluminium, 2L), + GT_Utility.getIntegratedCircuit(1) + }, + GT_Values.NF, + ItemList.ThermosCan_Empty.get(1L), + 800, + 1); + + ItemList.Large_Fluid_Cell_Steel.set(addItem( + tLastID = 405, + "Large Steel Fluid Cell", + "", + new ItemData( + Materials.Steel, + OrePrefixes.plateDouble.mMaterialAmount * 4L, + new MaterialStack(Materials.Bronze, OrePrefixes.ring.mMaterialAmount * 4L)), + new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 4L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 2L))); setFluidContainerStats(32000 + tLastID, 8000L, 64L); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Steel, 4L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.AnyBronze, 4L), GT_Utility.getIntegratedCircuit(1)}, GT_Values.NF, ItemList.Large_Fluid_Cell_Steel.get(1L), 200, 30); - - ItemList.Large_Fluid_Cell_TungstenSteel.set(addItem(tLastID = 406, "Large Tungstensteel Fluid Cell", "", new ItemData(Materials.TungstenSteel, OrePrefixes.plateDouble.mMaterialAmount * 4L, new MaterialStack(Materials.Platinum, OrePrefixes.ring.mMaterialAmount * 4L)), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 9L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 7L))); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Steel, 4L), + GT_OreDictUnificator.get(OrePrefixes.ring, Materials.AnyBronze, 4L), + GT_Utility.getIntegratedCircuit(1) + }, + GT_Values.NF, + ItemList.Large_Fluid_Cell_Steel.get(1L), + 200, + 30); + + ItemList.Large_Fluid_Cell_TungstenSteel.set(addItem( + tLastID = 406, + "Large Tungstensteel Fluid Cell", + "", + new ItemData( + Materials.TungstenSteel, + OrePrefixes.plateDouble.mMaterialAmount * 4L, + new MaterialStack(Materials.Platinum, OrePrefixes.ring.mMaterialAmount * 4L)), + new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 9L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 7L))); setFluidContainerStats(32000 + tLastID, 512000L, 32L); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.TungstenSteel, 4L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Platinum, 4L), GT_Utility.getIntegratedCircuit(1)}, GT_Values.NF, ItemList.Large_Fluid_Cell_TungstenSteel.get(1L), 200, 480); - - ItemList.Large_Fluid_Cell_Aluminium.set(addItem(tLastID = 407, "Large Aluminium Fluid Cell", "", new ItemData(Materials.Aluminium, OrePrefixes.plateDouble.mMaterialAmount * 4L, new MaterialStack(Materials.Silver, OrePrefixes.ring.mMaterialAmount * 4L)), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 5L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 3L))); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.TungstenSteel, 4L), + GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Platinum, 4L), + GT_Utility.getIntegratedCircuit(1) + }, + GT_Values.NF, + ItemList.Large_Fluid_Cell_TungstenSteel.get(1L), + 200, + 480); + + ItemList.Large_Fluid_Cell_Aluminium.set(addItem( + tLastID = 407, + "Large Aluminium Fluid Cell", + "", + new ItemData( + Materials.Aluminium, + OrePrefixes.plateDouble.mMaterialAmount * 4L, + new MaterialStack(Materials.Silver, OrePrefixes.ring.mMaterialAmount * 4L)), + new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 5L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 3L))); setFluidContainerStats(32000 + tLastID, 32000L, 64L); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Aluminium, 4L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Silver, 4L), GT_Utility.getIntegratedCircuit(1)}, GT_Values.NF, ItemList.Large_Fluid_Cell_Aluminium.get(1L), 200, 64); - - ItemList.Large_Fluid_Cell_StainlessSteel.set(addItem(tLastID = 408, "Large Stainless Steel Fluid Cell", "", new ItemData(Materials.StainlessSteel, OrePrefixes.plateDouble.mMaterialAmount * 4L, new MaterialStack(Materials.Electrum, OrePrefixes.ring.mMaterialAmount * 4L)), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 6L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 4L))); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Aluminium, 4L), + GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Silver, 4L), + GT_Utility.getIntegratedCircuit(1) + }, + GT_Values.NF, + ItemList.Large_Fluid_Cell_Aluminium.get(1L), + 200, + 64); + + ItemList.Large_Fluid_Cell_StainlessSteel.set(addItem( + tLastID = 408, + "Large Stainless Steel Fluid Cell", + "", + new ItemData( + Materials.StainlessSteel, + OrePrefixes.plateDouble.mMaterialAmount * 4L, + new MaterialStack(Materials.Electrum, OrePrefixes.ring.mMaterialAmount * 4L)), + new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 6L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 4L))); setFluidContainerStats(32000 + tLastID, 64000L, 64L); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.StainlessSteel, 4L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Electrum, 4L), GT_Utility.getIntegratedCircuit(1)}, GT_Values.NF, ItemList.Large_Fluid_Cell_StainlessSteel.get(1L), 200, 120); - - ItemList.Large_Fluid_Cell_Titanium.set(addItem(tLastID = 409, "Large Titanium Fluid Cell", "", new ItemData(Materials.Titanium, OrePrefixes.plateDouble.mMaterialAmount * 4L, new MaterialStack(Materials.RoseGold, OrePrefixes.ring.mMaterialAmount * 4L)), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 7L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 5L))); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.StainlessSteel, 4L), + GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Electrum, 4L), + GT_Utility.getIntegratedCircuit(1) + }, + GT_Values.NF, + ItemList.Large_Fluid_Cell_StainlessSteel.get(1L), + 200, + 120); + + ItemList.Large_Fluid_Cell_Titanium.set(addItem( + tLastID = 409, + "Large Titanium Fluid Cell", + "", + new ItemData( + Materials.Titanium, + OrePrefixes.plateDouble.mMaterialAmount * 4L, + new MaterialStack(Materials.RoseGold, OrePrefixes.ring.mMaterialAmount * 4L)), + new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 7L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 5L))); setFluidContainerStats(32000 + tLastID, 128000L, 64L); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Titanium, 4L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.RoseGold, 4L), GT_Utility.getIntegratedCircuit(1)}, GT_Values.NF, ItemList.Large_Fluid_Cell_Titanium.get(1L), 200, 256); - - ItemList.Large_Fluid_Cell_Chrome.set(addItem(tLastID = 410, "Large Chrome Fluid Cell", "", new ItemData(Materials.Chrome, OrePrefixes.plateDouble.mMaterialAmount * 4L, new MaterialStack(Materials.Palladium, OrePrefixes.ring.mMaterialAmount * 4L)), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 6L))); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Titanium, 4L), + GT_OreDictUnificator.get(OrePrefixes.ring, Materials.RoseGold, 4L), + GT_Utility.getIntegratedCircuit(1) + }, + GT_Values.NF, + ItemList.Large_Fluid_Cell_Titanium.get(1L), + 200, + 256); + + ItemList.Large_Fluid_Cell_Chrome.set(addItem( + tLastID = 410, + "Large Chrome Fluid Cell", + "", + new ItemData( + Materials.Chrome, + OrePrefixes.plateDouble.mMaterialAmount * 4L, + new MaterialStack(Materials.Palladium, OrePrefixes.ring.mMaterialAmount * 4L)), + new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 8L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 6L))); setFluidContainerStats(32000 + tLastID, 2048000L, 8L); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Chrome, 4L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Palladium, 4L), GT_Utility.getIntegratedCircuit(1)}, GT_Values.NF, ItemList.Large_Fluid_Cell_Chrome.get(1L), 200, 1024); - - ItemList.Large_Fluid_Cell_Iridium.set(addItem(tLastID = 411, "Large Iridium Fluid Cell", "", new ItemData(Materials.Iridium, OrePrefixes.plateDouble.mMaterialAmount * 4L, new MaterialStack(Materials.Naquadah, OrePrefixes.ring.mMaterialAmount * 4L)), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 10L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 8L))); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Chrome, 4L), + GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Palladium, 4L), + GT_Utility.getIntegratedCircuit(1) + }, + GT_Values.NF, + ItemList.Large_Fluid_Cell_Chrome.get(1L), + 200, + 1024); + + ItemList.Large_Fluid_Cell_Iridium.set(addItem( + tLastID = 411, + "Large Iridium Fluid Cell", + "", + new ItemData( + Materials.Iridium, + OrePrefixes.plateDouble.mMaterialAmount * 4L, + new MaterialStack(Materials.Naquadah, OrePrefixes.ring.mMaterialAmount * 4L)), + new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 10L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 8L))); setFluidContainerStats(32000 + tLastID, 8192000L, 2L); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Iridium, 4L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Naquadah, 4L), GT_Utility.getIntegratedCircuit(1)}, GT_Values.NF, ItemList.Large_Fluid_Cell_Iridium.get(1L), 200, 1920); - - ItemList.Large_Fluid_Cell_Osmium.set(addItem(tLastID = 412, "Large Osmium Fluid Cell", "", new ItemData(Materials.Osmium, OrePrefixes.plateDouble.mMaterialAmount * 4L, new MaterialStack(Materials.ElectrumFlux, OrePrefixes.ring.mMaterialAmount * 4L)), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 11L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 9L))); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Iridium, 4L), + GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Naquadah, 4L), + GT_Utility.getIntegratedCircuit(1) + }, + GT_Values.NF, + ItemList.Large_Fluid_Cell_Iridium.get(1L), + 200, + 1920); + + ItemList.Large_Fluid_Cell_Osmium.set(addItem( + tLastID = 412, + "Large Osmium Fluid Cell", + "", + new ItemData( + Materials.Osmium, + OrePrefixes.plateDouble.mMaterialAmount * 4L, + new MaterialStack(Materials.ElectrumFlux, OrePrefixes.ring.mMaterialAmount * 4L)), + new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 11L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 9L))); setFluidContainerStats(32000 + tLastID, 32768000L, 1L); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Osmium, 4L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.ElectrumFlux, 4L), GT_Utility.getIntegratedCircuit(1)}, GT_Values.NF, ItemList.Large_Fluid_Cell_Osmium.get(1L), 200, 4096); - - ItemList.Large_Fluid_Cell_Neutronium.set(addItem(tLastID = 413, "Large Neutronium Fluid Cell", "", new ItemData(Materials.Neutronium, OrePrefixes.plateDouble.mMaterialAmount * 4L, new MaterialStack(Materials.Draconium, OrePrefixes.ring.mMaterialAmount * 4L)), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 12L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 10L))); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Osmium, 4L), + GT_OreDictUnificator.get(OrePrefixes.ring, Materials.ElectrumFlux, 4L), + GT_Utility.getIntegratedCircuit(1) + }, + GT_Values.NF, + ItemList.Large_Fluid_Cell_Osmium.get(1L), + 200, + 4096); + + ItemList.Large_Fluid_Cell_Neutronium.set(addItem( + tLastID = 413, + "Large Neutronium Fluid Cell", + "", + new ItemData( + Materials.Neutronium, + OrePrefixes.plateDouble.mMaterialAmount * 4L, + new MaterialStack(Materials.Draconium, OrePrefixes.ring.mMaterialAmount * 4L)), + new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 12L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 10L))); setFluidContainerStats(32000 + tLastID, 131072000L, 1L); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Neutronium, 4L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Draconium, 4L), GT_Utility.getIntegratedCircuit(1)}, GT_Values.NF, ItemList.Large_Fluid_Cell_Neutronium.get(1L), 200, 7680); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Neutronium, 4L), + GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Draconium, 4L), + GT_Utility.getIntegratedCircuit(1) + }, + GT_Values.NF, + ItemList.Large_Fluid_Cell_Neutronium.get(1L), + 200, + 7680); for (byte i = 0; i < 16; i = (byte) (i + 1)) { - ItemList.SPRAY_CAN_DYES[i].set(addItem(tLastID = 430 + 2 * i, "Spray Can (" + Dyes.get(i).mName + ")", "Full", new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 4L))); - ItemList.SPRAY_CAN_DYES_USED[i].set(addItem(tLastID + 1, "Spray Can (" + Dyes.get(i).mName + ")", "Used", new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 3L), SubTag.INVISIBLE)); - IItemBehaviour<GT_MetaBase_Item> tBehaviour = new Behaviour_Spray_Color(ItemList.Spray_Empty.get(1L), ItemList.SPRAY_CAN_DYES_USED[i].get(1L), ItemList.SPRAY_CAN_DYES[i].get(1L), 512L, i); + ItemList.SPRAY_CAN_DYES[i].set(addItem( + tLastID = 430 + 2 * i, + "Spray Can (" + Dyes.get(i).mName + ")", + "Full", + new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 4L))); + ItemList.SPRAY_CAN_DYES_USED[i].set(addItem( + tLastID + 1, + "Spray Can (" + Dyes.get(i).mName + ")", + "Used", + new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 3L), + SubTag.INVISIBLE)); + IItemBehaviour<GT_MetaBase_Item> tBehaviour = new Behaviour_Spray_Color( + ItemList.Spray_Empty.get(1L), + ItemList.SPRAY_CAN_DYES_USED[i].get(1L), + ItemList.SPRAY_CAN_DYES[i].get(1L), + 512L, + i); addItemBehavior(32000 + tLastID, tBehaviour); addItemBehavior(32001 + tLastID, tBehaviour); } - ItemList.Tool_Matches.set(addItem(tLastID = 471, "Match", "", new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L))); - ItemList.Tool_MatchBox_Used.set(addItem(tLastID = 472, "Match Box", "This is not a Car", new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L), SubTag.INVISIBLE)); - ItemList.Tool_MatchBox_Full.set(addItem(tLastID = 473, "Match Box (Full)", "This is not a Car", new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 2L))); - - IItemBehaviour<GT_MetaBase_Item> tBehaviour = new Behaviour_Lighter(null, ItemList.Tool_Matches.get(1L), ItemList.Tool_Matches.get(1L), 1L); + ItemList.Tool_Matches.set(addItem( + tLastID = 471, + "Match", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L))); + ItemList.Tool_MatchBox_Used.set(addItem( + tLastID = 472, + "Match Box", + "This is not a Car", + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L), + SubTag.INVISIBLE)); + ItemList.Tool_MatchBox_Full.set(addItem( + tLastID = 473, + "Match Box (Full)", + "This is not a Car", + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 2L))); + + IItemBehaviour<GT_MetaBase_Item> tBehaviour = + new Behaviour_Lighter(null, ItemList.Tool_Matches.get(1L), ItemList.Tool_Matches.get(1L), 1L); addItemBehavior(32471, tBehaviour); - tBehaviour = new Behaviour_Lighter(null, ItemList.Tool_MatchBox_Used.get(1L), ItemList.Tool_MatchBox_Full.get(1L), 16L); + tBehaviour = new Behaviour_Lighter( + null, ItemList.Tool_MatchBox_Used.get(1L), ItemList.Tool_MatchBox_Full.get(1L), 16L); addItemBehavior(32472, tBehaviour); addItemBehavior(32473, tBehaviour); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.bolt, Materials.Wood, 1L), GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Phosphorus, 1L), GT_Utility.getIntegratedCircuit(1)}, GT_Values.NF, ItemList.Tool_Matches.get(1L), 16, 16); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.bolt, Materials.Wood, 1L), GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.TricalciumPhosphate, 1L), GT_Utility.getIntegratedCircuit(1)}, GT_Values.NF, ItemList.Tool_Matches.get(1L), 16, 16); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.bolt, Materials.Wood, 4L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Phosphorus, 1L), GT_Utility.getIntegratedCircuit(1)}, GT_Values.NF, ItemList.Tool_Matches.get(4L), 64, 16); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.bolt, Materials.Wood, 4L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.TricalciumPhosphate, 1L), GT_Utility.getIntegratedCircuit(1)}, GT_Values.NF, ItemList.Tool_Matches.get(4L), 64, 16); - GT_Values.RA.addBoxingRecipe(ItemList.Tool_Matches.get(16L), GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Paper, 1L), ItemList.Tool_MatchBox_Full.get(1L), 64, 16); - GT_Values.RA.addUnboxingRecipe(ItemList.Tool_MatchBox_Full.get(1L), ItemList.Tool_Matches.get(16L), null, 32, 16); - - ItemList.Tool_Lighter_Invar_Empty.set(addItem(tLastID = 474, "Lighter (Empty)", "", new ItemData(Materials.Invar, OrePrefixes.plate.mMaterialAmount * 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L))); - ItemList.Tool_Lighter_Invar_Used.set(addItem(tLastID = 475, "Lighter", "", new ItemData(Materials.Invar, OrePrefixes.plate.mMaterialAmount * 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L), SubTag.INVISIBLE)); - ItemList.Tool_Lighter_Invar_Full.set(addItem(tLastID = 476, "Lighter (Full)", "", new ItemData(Materials.Invar, OrePrefixes.plate.mMaterialAmount * 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 2L))); - - tBehaviour = new Behaviour_Lighter(ItemList.Tool_Lighter_Invar_Empty.get(1L), ItemList.Tool_Lighter_Invar_Used.get(1L), ItemList.Tool_Lighter_Invar_Full.get(1L), 100L); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + GT_OreDictUnificator.get(OrePrefixes.bolt, Materials.Wood, 1L), + GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Phosphorus, 1L), + GT_Utility.getIntegratedCircuit(1) + }, + GT_Values.NF, + ItemList.Tool_Matches.get(1L), + 16, + 16); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + GT_OreDictUnificator.get(OrePrefixes.bolt, Materials.Wood, 1L), + GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.TricalciumPhosphate, 1L), + GT_Utility.getIntegratedCircuit(1) + }, + GT_Values.NF, + ItemList.Tool_Matches.get(1L), + 16, + 16); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + GT_OreDictUnificator.get(OrePrefixes.bolt, Materials.Wood, 4L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Phosphorus, 1L), + GT_Utility.getIntegratedCircuit(1) + }, + GT_Values.NF, + ItemList.Tool_Matches.get(4L), + 64, + 16); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + GT_OreDictUnificator.get(OrePrefixes.bolt, Materials.Wood, 4L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.TricalciumPhosphate, 1L), + GT_Utility.getIntegratedCircuit(1) + }, + GT_Values.NF, + ItemList.Tool_Matches.get(4L), + 64, + 16); + GT_Values.RA.addBoxingRecipe( + ItemList.Tool_Matches.get(16L), + GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Paper, 1L), + ItemList.Tool_MatchBox_Full.get(1L), + 64, + 16); + GT_Values.RA.addUnboxingRecipe( + ItemList.Tool_MatchBox_Full.get(1L), ItemList.Tool_Matches.get(16L), null, 32, 16); + + ItemList.Tool_Lighter_Invar_Empty.set(addItem( + tLastID = 474, + "Lighter (Empty)", + "", + new ItemData(Materials.Invar, OrePrefixes.plate.mMaterialAmount * 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L))); + ItemList.Tool_Lighter_Invar_Used.set(addItem( + tLastID = 475, + "Lighter", + "", + new ItemData(Materials.Invar, OrePrefixes.plate.mMaterialAmount * 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L), + SubTag.INVISIBLE)); + ItemList.Tool_Lighter_Invar_Full.set(addItem( + tLastID = 476, + "Lighter (Full)", + "", + new ItemData(Materials.Invar, OrePrefixes.plate.mMaterialAmount * 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 2L))); + + tBehaviour = new Behaviour_Lighter( + ItemList.Tool_Lighter_Invar_Empty.get(1L), + ItemList.Tool_Lighter_Invar_Used.get(1L), + ItemList.Tool_Lighter_Invar_Full.get(1L), + 100L); addItemBehavior(32475, tBehaviour); addItemBehavior(32476, tBehaviour); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Invar, 2L), new ItemStack(Items.flint, 1), GT_Utility.getIntegratedCircuit(1)}, GT_Values.NF, ItemList.Tool_Lighter_Invar_Empty.get(1L), 256, 16); - - ItemList.Tool_Lighter_Platinum_Empty.set(addItem(tLastID = 477, "Platinum Lighter (Empty)", "A known Prank Master is engraved on it", new ItemData(Materials.Platinum, OrePrefixes.plate.mMaterialAmount * 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.NEBRISUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L))); - ItemList.Tool_Lighter_Platinum_Used.set(addItem(tLastID = 478, "Platinum Lighter", "A known Prank Master is engraved on it", new ItemData(Materials.Platinum, OrePrefixes.plate.mMaterialAmount * 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.NEBRISUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L), SubTag.INVISIBLE)); - ItemList.Tool_Lighter_Platinum_Full.set(addItem(tLastID = 479, "Platinum Lighter (Full)", "A known Prank Master is engraved on it", new ItemData(Materials.Platinum, OrePrefixes.plate.mMaterialAmount * 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.NEBRISUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 2L))); - - tBehaviour = new Behaviour_Lighter(ItemList.Tool_Lighter_Platinum_Empty.get(1L), ItemList.Tool_Lighter_Platinum_Used.get(1L), ItemList.Tool_Lighter_Platinum_Full.get(1L), 1000L); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Invar, 2L), + new ItemStack(Items.flint, 1), + GT_Utility.getIntegratedCircuit(1) + }, + GT_Values.NF, + ItemList.Tool_Lighter_Invar_Empty.get(1L), + 256, + 16); + + ItemList.Tool_Lighter_Platinum_Empty.set(addItem( + tLastID = 477, + "Platinum Lighter (Empty)", + "A known Prank Master is engraved on it", + new ItemData(Materials.Platinum, OrePrefixes.plate.mMaterialAmount * 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.NEBRISUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L))); + ItemList.Tool_Lighter_Platinum_Used.set(addItem( + tLastID = 478, + "Platinum Lighter", + "A known Prank Master is engraved on it", + new ItemData(Materials.Platinum, OrePrefixes.plate.mMaterialAmount * 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.NEBRISUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L), + SubTag.INVISIBLE)); + ItemList.Tool_Lighter_Platinum_Full.set(addItem( + tLastID = 479, + "Platinum Lighter (Full)", + "A known Prank Master is engraved on it", + new ItemData(Materials.Platinum, OrePrefixes.plate.mMaterialAmount * 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.NEBRISUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 2L))); + + tBehaviour = new Behaviour_Lighter( + ItemList.Tool_Lighter_Platinum_Empty.get(1L), + ItemList.Tool_Lighter_Platinum_Used.get(1L), + ItemList.Tool_Lighter_Platinum_Full.get(1L), + 1000L); addItemBehavior(32478, tBehaviour); addItemBehavior(32479, tBehaviour); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Platinum, 2L), new ItemStack(Items.flint, 1), GT_Utility.getIntegratedCircuit(1)}, GT_Values.NF, ItemList.Tool_Lighter_Platinum_Empty.get(1L), 256, 256); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Platinum, 2L), + new ItemStack(Items.flint, 1), + GT_Utility.getIntegratedCircuit(1) + }, + GT_Values.NF, + ItemList.Tool_Lighter_Platinum_Empty.get(1L), + 256, + 256); if (Loader.isModLoaded("GalacticraftMars")) { - ItemList.Ingot_Heavy1.set(addItem(tLastID = 462, "Heavy Duty Alloy Ingot T1", "Used to make Heavy Duty Plates T1")); - ItemList.Ingot_Heavy2.set(addItem(tLastID = 463, "Heavy Duty Alloy Ingot T2", "Used to make Heavy Duty Plates T2")); - ItemList.Ingot_Heavy3.set(addItem(tLastID = 464, "Heavy Duty Alloy Ingot T3", "Used to make Heavy Duty Plates T3")); - - //GT_ModHandler.addCraftingRecipe(ItemList.Ingot_Heavy1.get(1L, new Object[0]), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"BhB", "CAS", "B B", 'B', OrePrefixes.bolt.get(Materials.StainlessSteel), 'C', OrePrefixes.compressed.get(Materials.Bronze), 'A', OrePrefixes.compressed.get(Materials.Aluminium), 'S', OrePrefixes.compressed.get(Materials.Steel)}); + ItemList.Ingot_Heavy1.set( + addItem(tLastID = 462, "Heavy Duty Alloy Ingot T1", "Used to make Heavy Duty Plates T1")); + ItemList.Ingot_Heavy2.set( + addItem(tLastID = 463, "Heavy Duty Alloy Ingot T2", "Used to make Heavy Duty Plates T2")); + ItemList.Ingot_Heavy3.set( + addItem(tLastID = 464, "Heavy Duty Alloy Ingot T3", "Used to make Heavy Duty Plates T3")); + + // GT_ModHandler.addCraftingRecipe(ItemList.Ingot_Heavy1.get(1L, new Object[0]), + // GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"BhB", "CAS", "B B", 'B', + // OrePrefixes.bolt.get(Materials.StainlessSteel), 'C', OrePrefixes.compressed.get(Materials.Bronze), 'A', + // OrePrefixes.compressed.get(Materials.Aluminium), 'S', OrePrefixes.compressed.get(Materials.Steel)}); } - ItemList.Ingot_IridiumAlloy.set(addItem(tLastID = 480, "Iridium Alloy Ingot", "Used to make Iridium Plates", new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 4L))); - - //GT_ModHandler.addRollingMachineRecipe(ItemList.Ingot_IridiumAlloy.get(1L, new Object[0]), new Object[]{"IAI", "ADA", "IAI", 'D', GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.harderrecipes, "iridiumplate", true) ? OreDictNames.craftingIndustrialDiamond : OrePrefixes.dust.get(Materials.Diamond), 'A', OrePrefixes.plateAlloy.get("Advanced"), 'I', OrePrefixes.plate.get(Materials.Iridium)}); - //GT_ModHandler.addCraftingRecipe(ItemList.Ingot_IridiumAlloy.get(1L, new Object[0]), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"IAI", "ADA", "IAI", 'D', GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.harderrecipes, "iridiumplate", true) ? OreDictNames.craftingIndustrialDiamond : OrePrefixes.dust.get(Materials.Diamond), 'A', OrePrefixes.plateAlloy.get("Advanced"), 'I', OrePrefixes.plate.get(Materials.Iridium)}); - - ItemList.Paper_Printed_Pages.set(addItem(tLastID = 481, "Printed Pages", "Used to make written Books", new ItemData(Materials.Paper, 10886400L), new Behaviour_PrintedPages(), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 2L))); - ItemList.Paper_Magic_Empty.set(addItem(tLastID = 482, "Magic Paper", "", SubTag.INVISIBLE, new ItemData(Materials.Paper, 3628800L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.PRAECANTATIO, 1L))); - ItemList.Paper_Magic_Page.set(addItem(tLastID = 483, "Enchanted Page", "", SubTag.INVISIBLE, new ItemData(Materials.Paper, 3628800L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.PRAECANTATIO, 2L))); - ItemList.Paper_Magic_Pages.set(addItem(tLastID = 484, "Enchanted Pages", "", SubTag.INVISIBLE, new ItemData(Materials.Paper, 10886400L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.PRAECANTATIO, 4L))); - ItemList.Paper_Punch_Card_Empty.set(addItem(tLastID = 485, "Punch Card", "", SubTag.INVISIBLE, new ItemData(Materials.Paper, 7257600L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 1L))); - ItemList.Paper_Punch_Card_Encoded.set(addItem(tLastID = 486, "Punched Card", "", SubTag.INVISIBLE, new ItemData(Materials.Paper, 7257600L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 2L))); - ItemList.Book_Written_01.set(addItem(tLastID = 487, "Book", "", new ItemData(Materials.Paper, 10886400L), "bookWritten", OreDictNames.craftingBook, new Behaviour_WrittenBook(), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 2L))); - ItemList.Book_Written_02.set(addItem(tLastID = 488, "Book", "", new ItemData(Materials.Paper, 10886400L), "bookWritten", OreDictNames.craftingBook, new Behaviour_WrittenBook(), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 2L))); - ItemList.Book_Written_03.set(addItem(tLastID = 489, "Book", "", new ItemData(Materials.Paper, 10886400L), "bookWritten", OreDictNames.craftingBook, new Behaviour_WrittenBook(), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 2L))); - - ItemList.Schematic.set(addItem(tLastID = 490, "Schematic", "EMPTY", new ItemData(Materials.Steel, 7257600L), new TC_Aspects.TC_AspectStack(TC_Aspects.STRONTIO, 1L))); - ItemList.Schematic_Crafting.set(addItem(tLastID = 491, "Schematic (Crafting)", "Crafts the Programmed Recipe", new ItemData(Materials.Steel, 7257600L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 1L))); - ItemList.Schematic_1by1.set(addItem(tLastID = 495, "Schematic (1x1)", "Crafts 1 Items as 1x1 (use in Packager)", new ItemData(Materials.Steel, 7257600L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 1L))); - ItemList.Schematic_2by2.set(addItem(tLastID = 496, "Schematic (2x2)", "Crafts 4 Items as 2x2 (use in Packager)", new ItemData(Materials.Steel, 7257600L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 1L))); - ItemList.Schematic_3by3.set(addItem(tLastID = 497, "Schematic (3x3)", "Crafts 9 Items as 3x3 (use in Packager)", new ItemData(Materials.Steel, 7257600L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 1L))); - ItemList.Schematic_Dust.set(addItem(tLastID = 498, "Schematic (Dusts)", "Combines Dusts (use in Packager)", new ItemData(Materials.Steel, 7257600L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 1L))); - - GT_ModHandler.addCraftingRecipe(ItemList.Schematic_1by1.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"d ", aTextShape, aTextEmptyRow, 'P', ItemList.Schematic}); - GT_ModHandler.addCraftingRecipe(ItemList.Schematic_2by2.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" d ", aTextShape, aTextEmptyRow, 'P', ItemList.Schematic}); - GT_ModHandler.addCraftingRecipe(ItemList.Schematic_3by3.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" d", aTextShape, aTextEmptyRow, 'P', ItemList.Schematic}); - GT_ModHandler.addCraftingRecipe(ItemList.Schematic_Dust.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{aTextEmptyRow, aTextShape, " d", 'P', ItemList.Schematic}); - - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Schematic.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Schematic_Crafting}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Schematic.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Schematic_1by1}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Schematic.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Schematic_2by2}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Schematic.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Schematic_3by3}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Schematic.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Schematic_Dust}); - - ItemList.Battery_Hull_LV.set(addItem(500, "Small Battery Hull", "An empty LV Battery Hull", new ItemData(Materials.BatteryAlloy, OrePrefixes.plate.mMaterialAmount * 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L))); - ItemList.Battery_Hull_MV.set(addItem(501, "Medium Battery Hull", "An empty MV Battery Hull", new ItemData(Materials.BatteryAlloy, OrePrefixes.plate.mMaterialAmount * 3L), new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L))); - ItemList.Battery_Hull_HV.set(addItem(502, "Large Battery Hull", "An empty HV Battery Hull", new ItemData(Materials.BatteryAlloy, OrePrefixes.plate.mMaterialAmount * 9L), new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L))); - - GT_ModHandler.addCraftingRecipe(ItemList.Battery_Hull_LV.get(1L), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"Cf ", "Ph ", "Ps ", 'P', OrePrefixes.plate.get(Materials.BatteryAlloy), 'C', OreDictNames.craftingWireTin}); - //GT_ModHandler.addCraftingRecipe(ItemList.Battery_Hull_MV.get(1L), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"C C", "PPP", "PPP", 'P', OrePrefixes.plate.get(Materials.BatteryAlloy), 'C', OreDictNames.craftingWireCopper}); + ItemList.Ingot_IridiumAlloy.set(addItem( + tLastID = 480, + "Iridium Alloy Ingot", + "Used to make Iridium Plates", + new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 4L), + new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 4L))); + + // GT_ModHandler.addRollingMachineRecipe(ItemList.Ingot_IridiumAlloy.get(1L, new Object[0]), new Object[]{"IAI", + // "ADA", "IAI", 'D', GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.harderrecipes, "iridiumplate", true) + // ? OreDictNames.craftingIndustrialDiamond : OrePrefixes.dust.get(Materials.Diamond), 'A', + // OrePrefixes.plateAlloy.get("Advanced"), 'I', OrePrefixes.plate.get(Materials.Iridium)}); + // GT_ModHandler.addCraftingRecipe(ItemList.Ingot_IridiumAlloy.get(1L, new Object[0]), + // GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"IAI", "ADA", "IAI", 'D', + // GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.harderrecipes, "iridiumplate", true) ? + // OreDictNames.craftingIndustrialDiamond : OrePrefixes.dust.get(Materials.Diamond), 'A', + // OrePrefixes.plateAlloy.get("Advanced"), 'I', OrePrefixes.plate.get(Materials.Iridium)}); + + ItemList.Paper_Printed_Pages.set(addItem( + tLastID = 481, + "Printed Pages", + "Used to make written Books", + new ItemData(Materials.Paper, 10886400L), + new Behaviour_PrintedPages(), + new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 2L))); + ItemList.Paper_Magic_Empty.set(addItem( + tLastID = 482, + "Magic Paper", + "", + SubTag.INVISIBLE, + new ItemData(Materials.Paper, 3628800L), + new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.PRAECANTATIO, 1L))); + ItemList.Paper_Magic_Page.set(addItem( + tLastID = 483, + "Enchanted Page", + "", + SubTag.INVISIBLE, + new ItemData(Materials.Paper, 3628800L), + new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.PRAECANTATIO, 2L))); + ItemList.Paper_Magic_Pages.set(addItem( + tLastID = 484, + "Enchanted Pages", + "", + SubTag.INVISIBLE, + new ItemData(Materials.Paper, 10886400L), + new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.PRAECANTATIO, 4L))); + ItemList.Paper_Punch_Card_Empty.set(addItem( + tLastID = 485, + "Punch Card", + "", + SubTag.INVISIBLE, + new ItemData(Materials.Paper, 7257600L), + new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 1L))); + ItemList.Paper_Punch_Card_Encoded.set(addItem( + tLastID = 486, + "Punched Card", + "", + SubTag.INVISIBLE, + new ItemData(Materials.Paper, 7257600L), + new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 2L))); + ItemList.Book_Written_01.set(addItem( + tLastID = 487, + "Book", + "", + new ItemData(Materials.Paper, 10886400L), + "bookWritten", + OreDictNames.craftingBook, + new Behaviour_WrittenBook(), + new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 2L))); + ItemList.Book_Written_02.set(addItem( + tLastID = 488, + "Book", + "", + new ItemData(Materials.Paper, 10886400L), + "bookWritten", + OreDictNames.craftingBook, + new Behaviour_WrittenBook(), + new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 2L))); + ItemList.Book_Written_03.set(addItem( + tLastID = 489, + "Book", + "", + new ItemData(Materials.Paper, 10886400L), + "bookWritten", + OreDictNames.craftingBook, + new Behaviour_WrittenBook(), + new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 2L))); + + ItemList.Schematic.set(addItem( + tLastID = 490, + "Schematic", + "EMPTY", + new ItemData(Materials.Steel, 7257600L), + new TC_Aspects.TC_AspectStack(TC_Aspects.STRONTIO, 1L))); + ItemList.Schematic_Crafting.set(addItem( + tLastID = 491, + "Schematic (Crafting)", + "Crafts the Programmed Recipe", + new ItemData(Materials.Steel, 7257600L), + new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 1L))); + ItemList.Schematic_1by1.set(addItem( + tLastID = 495, + "Schematic (1x1)", + "Crafts 1 Items as 1x1 (use in Packager)", + new ItemData(Materials.Steel, 7257600L), + new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 1L))); + ItemList.Schematic_2by2.set(addItem( + tLastID = 496, + "Schematic (2x2)", + "Crafts 4 Items as 2x2 (use in Packager)", + new ItemData(Materials.Steel, 7257600L), + new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 1L))); + ItemList.Schematic_3by3.set(addItem( + tLastID = 497, + "Schematic (3x3)", + "Crafts 9 Items as 3x3 (use in Packager)", + new ItemData(Materials.Steel, 7257600L), + new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 1L))); + ItemList.Schematic_Dust.set(addItem( + tLastID = 498, + "Schematic (Dusts)", + "Combines Dusts (use in Packager)", + new ItemData(Materials.Steel, 7257600L), + new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 1L))); + + GT_ModHandler.addCraftingRecipe( + ItemList.Schematic_1by1.get(1L), + GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] {"d ", aTextShape, aTextEmptyRow, 'P', ItemList.Schematic}); + GT_ModHandler.addCraftingRecipe( + ItemList.Schematic_2by2.get(1L), + GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] {" d ", aTextShape, aTextEmptyRow, 'P', ItemList.Schematic}); + GT_ModHandler.addCraftingRecipe( + ItemList.Schematic_3by3.get(1L), + GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] {" d", aTextShape, aTextEmptyRow, 'P', ItemList.Schematic}); + GT_ModHandler.addCraftingRecipe( + ItemList.Schematic_Dust.get(1L), + GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] {aTextEmptyRow, aTextShape, " d", 'P', ItemList.Schematic}); + + GT_ModHandler.addShapelessCraftingRecipe( + ItemList.Schematic.get(1L), + GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] {ItemList.Schematic_Crafting}); + GT_ModHandler.addShapelessCraftingRecipe( + ItemList.Schematic.get(1L), + GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] {ItemList.Schematic_1by1}); + GT_ModHandler.addShapelessCraftingRecipe( + ItemList.Schematic.get(1L), + GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] {ItemList.Schematic_2by2}); + GT_ModHandler.addShapelessCraftingRecipe( + ItemList.Schematic.get(1L), + GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] {ItemList.Schematic_3by3}); + GT_ModHandler.addShapelessCraftingRecipe( + ItemList.Schematic.get(1L), + GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] {ItemList.Schematic_Dust}); + + ItemList.Battery_Hull_LV.set(addItem( + 500, + "Small Battery Hull", + "An empty LV Battery Hull", + new ItemData(Materials.BatteryAlloy, OrePrefixes.plate.mMaterialAmount * 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L))); + ItemList.Battery_Hull_MV.set(addItem( + 501, + "Medium Battery Hull", + "An empty MV Battery Hull", + new ItemData(Materials.BatteryAlloy, OrePrefixes.plate.mMaterialAmount * 3L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L))); + ItemList.Battery_Hull_HV.set(addItem( + 502, + "Large Battery Hull", + "An empty HV Battery Hull", + new ItemData(Materials.BatteryAlloy, OrePrefixes.plate.mMaterialAmount * 9L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), + new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 4L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L))); + + GT_ModHandler.addCraftingRecipe( + ItemList.Battery_Hull_LV.get(1L), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[] { + "Cf ", + "Ph ", + "Ps ", + 'P', + OrePrefixes.plate.get(Materials.BatteryAlloy), + 'C', + OreDictNames.craftingWireTin + }); + // GT_ModHandler.addCraftingRecipe(ItemList.Battery_Hull_MV.get(1L), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new + // Object[]{"C C", "PPP", "PPP", 'P', OrePrefixes.plate.get(Materials.BatteryAlloy), 'C', + // OreDictNames.craftingWireCopper}); // ULV Batteries - ItemList.Battery_RE_ULV_Tantalum.set(addItem(tLastID = 499, "Tantalum Capacitor", "Reusable", "batteryULV", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L))); + ItemList.Battery_RE_ULV_Tantalum.set(addItem( + tLastID = 499, + "Tantalum Capacitor", + "Reusable", + "batteryULV", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L))); setElectricStats(32000 + tLastID, 1000L, GT_Values.V[0], 0L, -3L, false); OreDictionary.registerOre("ULV", ItemList.Battery_RE_ULV_Tantalum.get(1)); // LV Batteries - ItemList.Battery_SU_LV_SulfuricAcid.set(addItem(tLastID = 510, "Small Acid Battery", "Single Use", "batteryLV", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 2L))); + ItemList.Battery_SU_LV_SulfuricAcid.set(addItem( + tLastID = 510, + "Small Acid Battery", + "Single Use", + "batteryLV", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 2L))); setElectricStats(32000 + tLastID, 18000L, GT_Values.V[1], 1L, -2L, true); OreDictionary.registerOre("LV", ItemList.Battery_SU_LV_SulfuricAcid.get(1)); - ItemList.Battery_SU_LV_Mercury.set(addItem(tLastID = 511, "Small Mercury Battery", "Single Use", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 2L))); + ItemList.Battery_SU_LV_Mercury.set(addItem( + tLastID = 511, + "Small Mercury Battery", + "Single Use", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 2L))); setElectricStats(32000 + tLastID, 32000L, GT_Values.V[1], 1L, -2L, true); OreDictionary.registerOre("LV", ItemList.Battery_SU_LV_Mercury.get(1)); - ItemList.Battery_RE_LV_Cadmium.set(addItem(tLastID = 517, "Small Cadmium Battery", "Reusable", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L), "batteryLV")); + ItemList.Battery_RE_LV_Cadmium.set(addItem( + tLastID = 517, + "Small Cadmium Battery", + "Reusable", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L), + "batteryLV")); setElectricStats(32000 + tLastID, 75000L, GT_Values.V[1], 1L, -3L, true); OreDictionary.registerOre("LV", ItemList.Battery_RE_LV_Cadmium.get(1)); - OreDictionary.registerOre("calclavia:ADVANCED_BATTERY", ItemList.Battery_RE_LV_Cadmium.get(1)); // Annoying backwards compat - - ItemList.Battery_RE_LV_Lithium.set(addItem(tLastID = 518, "Small Lithium Battery", "Reusable", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L), "batteryLV")); + OreDictionary.registerOre( + "calclavia:ADVANCED_BATTERY", ItemList.Battery_RE_LV_Cadmium.get(1)); // Annoying backwards compat + + ItemList.Battery_RE_LV_Lithium.set(addItem( + tLastID = 518, + "Small Lithium Battery", + "Reusable", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L), + "batteryLV")); setElectricStats(32000 + tLastID, 100000L, GT_Values.V[1], 1L, -3L, true); OreDictionary.registerOre("LV", ItemList.Battery_RE_LV_Lithium.get(1)); - OreDictionary.registerOre("calclavia:ADVANCED_BATTERY", ItemList.Battery_RE_LV_Lithium.get(1)); // Annoying backwards compat - - ItemList.Battery_RE_LV_Sodium.set(addItem(tLastID = 519, "Small Sodium Battery", "Reusable", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L), "calclavia:ADVANCED_BATTERY")); + OreDictionary.registerOre( + "calclavia:ADVANCED_BATTERY", ItemList.Battery_RE_LV_Lithium.get(1)); // Annoying backwards compat + + ItemList.Battery_RE_LV_Sodium.set(addItem( + tLastID = 519, + "Small Sodium Battery", + "Reusable", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L), + "calclavia:ADVANCED_BATTERY")); setElectricStats(32000 + tLastID, 50000L, GT_Values.V[1], 1L, -3L, true); OreDictionary.registerOre("LV", ItemList.Battery_RE_LV_Sodium.get(1)); - OreDictionary.registerOre("calclavia:ADVANCED_BATTERY", ItemList.Battery_RE_LV_Sodium.get(1)); // Annoying backwards compat + OreDictionary.registerOre( + "calclavia:ADVANCED_BATTERY", ItemList.Battery_RE_LV_Sodium.get(1)); // Annoying backwards compat // MV Batteries - ItemList.Battery_SU_MV_SulfuricAcid.set(addItem(tLastID = 520, "Medium Acid Battery", "Single Use", "batteryMV", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 4L))); + ItemList.Battery_SU_MV_SulfuricAcid.set(addItem( + tLastID = 520, + "Medium Acid Battery", + "Single Use", + "batteryMV", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 4L))); setElectricStats(32000 + tLastID, 72000L, GT_Values.V[2], 2L, -2L, true); OreDictionary.registerOre("MV", ItemList.Battery_SU_MV_SulfuricAcid.get(1)); - ItemList.Battery_SU_MV_Mercury.set(addItem(tLastID = 521, "Medium Mercury Battery", "Single Use", "batteryMV", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 4L))); + ItemList.Battery_SU_MV_Mercury.set(addItem( + tLastID = 521, + "Medium Mercury Battery", + "Single Use", + "batteryMV", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 4L))); setElectricStats(32000 + tLastID, 128000L, GT_Values.V[2], 2L, -2L, true); OreDictionary.registerOre("MV", ItemList.Battery_SU_MV_Mercury.get(1)); - ItemList.Battery_RE_MV_Cadmium.set(addItem(tLastID = 527, "Medium Cadmium Battery", "Reusable", "batteryMV", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 2L))); + ItemList.Battery_RE_MV_Cadmium.set(addItem( + tLastID = 527, + "Medium Cadmium Battery", + "Reusable", + "batteryMV", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 2L))); setElectricStats(32000 + tLastID, 300000L, GT_Values.V[2], 2L, -3L, true); OreDictionary.registerOre("MV", ItemList.Battery_RE_MV_Cadmium.get(1)); - ItemList.Battery_RE_MV_Lithium.set(addItem(tLastID = 528, "Medium Lithium Battery", "Reusable", "batteryMV", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 2L))); + ItemList.Battery_RE_MV_Lithium.set(addItem( + tLastID = 528, + "Medium Lithium Battery", + "Reusable", + "batteryMV", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 2L))); setElectricStats(32000 + tLastID, 400000L, GT_Values.V[2], 2L, -3L, true); OreDictionary.registerOre("MV", ItemList.Battery_RE_MV_Lithium.get(1)); - ItemList.Battery_RE_MV_Sodium.set(addItem(tLastID = 529, "Medium Sodium Battery", "Reusable", "batteryMV", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 2L))); + ItemList.Battery_RE_MV_Sodium.set(addItem( + tLastID = 529, + "Medium Sodium Battery", + "Reusable", + "batteryMV", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 2L))); setElectricStats(32000 + tLastID, 200000L, GT_Values.V[2], 2L, -3L, true); OreDictionary.registerOre("MV", ItemList.Battery_RE_MV_Sodium.get(1)); // HV Batteries - ItemList.Battery_SU_HV_SulfuricAcid.set(addItem(tLastID = 530, "Large Acid Battery", "Single Use", "batteryHV", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 8L))); + ItemList.Battery_SU_HV_SulfuricAcid.set(addItem( + tLastID = 530, + "Large Acid Battery", + "Single Use", + "batteryHV", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), + new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 4L), + new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 8L))); setElectricStats(32000 + tLastID, 288000L, GT_Values.V[3], 3L, -2L, true); OreDictionary.registerOre("HV", ItemList.Battery_SU_HV_SulfuricAcid.get(1)); - ItemList.Battery_SU_HV_Mercury.set(addItem(tLastID = 531, "Large Mercury Battery", "Single Use", "batteryHV", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 8L))); + ItemList.Battery_SU_HV_Mercury.set(addItem( + tLastID = 531, + "Large Mercury Battery", + "Single Use", + "batteryHV", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), + new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 4L), + new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 8L))); setElectricStats(32000 + tLastID, 512000L, GT_Values.V[3], 3L, -2L, true); OreDictionary.registerOre("HV", ItemList.Battery_SU_HV_Mercury.get(1)); - ItemList.Battery_RE_HV_Cadmium.set(addItem(tLastID = 537, "Large Cadmium Battery", "Reusable", "batteryHV", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 4L))); + ItemList.Battery_RE_HV_Cadmium.set(addItem( + tLastID = 537, + "Large Cadmium Battery", + "Reusable", + "batteryHV", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), + new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 4L), + new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 4L))); setElectricStats(32000 + tLastID, 1200000L, GT_Values.V[3], 3L, -3L, true); OreDictionary.registerOre("HV", ItemList.Battery_RE_HV_Cadmium.get(1)); - ItemList.Battery_RE_HV_Lithium.set(addItem(tLastID = 538, "Large Lithium Battery", "Reusable", "batteryHV", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 4L))); + ItemList.Battery_RE_HV_Lithium.set(addItem( + tLastID = 538, + "Large Lithium Battery", + "Reusable", + "batteryHV", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), + new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 4L), + new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 4L))); setElectricStats(32000 + tLastID, 1600000L, GT_Values.V[3], 3L, -3L, true); OreDictionary.registerOre("HV", ItemList.Battery_RE_HV_Lithium.get(1)); - ItemList.Battery_RE_HV_Sodium.set(addItem(tLastID = 539, "Large Sodium Battery", "Reusable", "batteryHV", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 4L))); + ItemList.Battery_RE_HV_Sodium.set(addItem( + tLastID = 539, + "Large Sodium Battery", + "Reusable", + "batteryHV", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), + new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 4L), + new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 4L))); setElectricStats(32000 + tLastID, 800000L, GT_Values.V[3], 3L, -3L, true); OreDictionary.registerOre("HV", ItemList.Battery_RE_HV_Sodium.get(1)); - GT_ModHandler.addExtractionRecipe(ItemList.Battery_SU_LV_SulfuricAcid.get(1L), ItemList.Battery_Hull_LV.get(1L)); + GT_ModHandler.addExtractionRecipe( + ItemList.Battery_SU_LV_SulfuricAcid.get(1L), ItemList.Battery_Hull_LV.get(1L)); GT_ModHandler.addExtractionRecipe(ItemList.Battery_SU_LV_Mercury.get(1L), ItemList.Battery_Hull_LV.get(1L)); - GT_ModHandler.addExtractionRecipe(ItemList.Battery_SU_MV_SulfuricAcid.get(1L), ItemList.Battery_Hull_MV.get(1L)); + GT_ModHandler.addExtractionRecipe( + ItemList.Battery_SU_MV_SulfuricAcid.get(1L), ItemList.Battery_Hull_MV.get(1L)); GT_ModHandler.addExtractionRecipe(ItemList.Battery_SU_MV_Mercury.get(1L), ItemList.Battery_Hull_MV.get(1L)); - GT_ModHandler.addExtractionRecipe(ItemList.Battery_SU_HV_SulfuricAcid.get(1L), ItemList.Battery_Hull_HV.get(1L)); + GT_ModHandler.addExtractionRecipe( + ItemList.Battery_SU_HV_SulfuricAcid.get(1L), ItemList.Battery_Hull_HV.get(1L)); GT_ModHandler.addExtractionRecipe(ItemList.Battery_SU_HV_Mercury.get(1L), ItemList.Battery_Hull_HV.get(1L)); GT_ModHandler.addExtractionRecipe(ItemList.Battery_RE_LV_Cadmium.get(1L), ItemList.Battery_Hull_LV.get(1L)); GT_ModHandler.addExtractionRecipe(ItemList.Battery_RE_LV_Lithium.get(1L), ItemList.Battery_Hull_LV.get(1L)); @@ -490,468 +1956,2880 @@ public class GT_MetaGenerated_Item_01 extends GT_MetaGenerated_Item_X32 { GT_ModHandler.addExtractionRecipe(ItemList.Battery_RE_HV_Lithium.get(1L), ItemList.Battery_Hull_HV.get(1L)); GT_ModHandler.addExtractionRecipe(ItemList.Battery_RE_HV_Sodium.get(1L), ItemList.Battery_Hull_HV.get(1L)); - GT_Values.RA.addCannerRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Cadmium, 2L), ItemList.Battery_Hull_LV.get(1L), ItemList.Battery_RE_LV_Cadmium.get(1L), null, 100, 2); - GT_Values.RA.addCannerRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Lithium, 2L), ItemList.Battery_Hull_LV.get(1L), ItemList.Battery_RE_LV_Lithium.get(1L), null, 100, 2); - GT_Values.RA.addCannerRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 2L), ItemList.Battery_Hull_LV.get(1L), ItemList.Battery_RE_LV_Sodium.get(1L), null, 100, 2); - GT_Values.RA.addCannerRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Cadmium, 8L), ItemList.Battery_Hull_MV.get(1L), ItemList.Battery_RE_MV_Cadmium.get(1L), null, 400, 2); - GT_Values.RA.addCannerRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Lithium, 8L), ItemList.Battery_Hull_MV.get(1L), ItemList.Battery_RE_MV_Lithium.get(1L), null, 400, 2); - GT_Values.RA.addCannerRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 8L), ItemList.Battery_Hull_MV.get(1L), ItemList.Battery_RE_MV_Sodium.get(1L), null, 400, 2); - GT_Values.RA.addCannerRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Cadmium, 32L), ItemList.Battery_Hull_HV.get(1L), ItemList.Battery_RE_HV_Cadmium.get(1L), null, 1600, 2); - GT_Values.RA.addCannerRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Lithium, 32L), ItemList.Battery_Hull_HV.get(1L), ItemList.Battery_RE_HV_Lithium.get(1L), null, 1600, 2); - GT_Values.RA.addCannerRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 32L), ItemList.Battery_Hull_HV.get(1L), ItemList.Battery_RE_HV_Sodium.get(1L), null, 1600, 2); + GT_Values.RA.addCannerRecipe( + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Cadmium, 2L), + ItemList.Battery_Hull_LV.get(1L), + ItemList.Battery_RE_LV_Cadmium.get(1L), + null, + 100, + 2); + GT_Values.RA.addCannerRecipe( + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Lithium, 2L), + ItemList.Battery_Hull_LV.get(1L), + ItemList.Battery_RE_LV_Lithium.get(1L), + null, + 100, + 2); + GT_Values.RA.addCannerRecipe( + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 2L), + ItemList.Battery_Hull_LV.get(1L), + ItemList.Battery_RE_LV_Sodium.get(1L), + null, + 100, + 2); + GT_Values.RA.addCannerRecipe( + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Cadmium, 8L), + ItemList.Battery_Hull_MV.get(1L), + ItemList.Battery_RE_MV_Cadmium.get(1L), + null, + 400, + 2); + GT_Values.RA.addCannerRecipe( + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Lithium, 8L), + ItemList.Battery_Hull_MV.get(1L), + ItemList.Battery_RE_MV_Lithium.get(1L), + null, + 400, + 2); + GT_Values.RA.addCannerRecipe( + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 8L), + ItemList.Battery_Hull_MV.get(1L), + ItemList.Battery_RE_MV_Sodium.get(1L), + null, + 400, + 2); + GT_Values.RA.addCannerRecipe( + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Cadmium, 32L), + ItemList.Battery_Hull_HV.get(1L), + ItemList.Battery_RE_HV_Cadmium.get(1L), + null, + 1600, + 2); + GT_Values.RA.addCannerRecipe( + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Lithium, 32L), + ItemList.Battery_Hull_HV.get(1L), + ItemList.Battery_RE_HV_Lithium.get(1L), + null, + 1600, + 2); + GT_Values.RA.addCannerRecipe( + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 32L), + ItemList.Battery_Hull_HV.get(1L), + ItemList.Battery_RE_HV_Sodium.get(1L), + null, + 1600, + 2); // IV Battery - ItemList.Energy_LapotronicOrb.set(addItem(tLastID = 597, "Lapotronic Energy Orb", "Reusable battery", "batteryIV", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 16L), OrePrefixes.battery.get(Materials.Ultimate))); + ItemList.Energy_LapotronicOrb.set(addItem( + tLastID = 597, + "Lapotronic Energy Orb", + "Reusable battery", + "batteryIV", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 16L), + new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 16L), + OrePrefixes.battery.get(Materials.Ultimate))); setElectricStats(32000 + tLastID, 100000000L, GT_Values.V[5], 5L, -3L, true); OreDictionary.registerOre("IV", ItemList.Energy_LapotronicOrb.get(1)); // ZPM Module - ItemList.ZPM.set(addItem(tLastID = 598, "Zero Point Module", "Single use battery", "batteryZPM", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 64L))); + ItemList.ZPM.set(addItem( + tLastID = 598, + "Zero Point Module", + "Single use battery", + "batteryZPM", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 16L), + new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 64L))); setElectricStats(32000 + tLastID, 2000000000000L, GT_Values.V[7], 7L, -2L, true); OreDictionary.registerOre("ZPM", ItemList.ZPM.get(1)); // LuV Lapotron orb cluster battery - ItemList.Energy_LapotronicOrb2.set(addItem(tLastID = 599, "Lapotronic Energy Orb Cluster", "Reusable battery", "batteryLuV", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 16L), OrePrefixes.battery.get(Materials.Ultimate))); + ItemList.Energy_LapotronicOrb2.set(addItem( + tLastID = 599, + "Lapotronic Energy Orb Cluster", + "Reusable battery", + "batteryLuV", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 16L), + new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 16L), + OrePrefixes.battery.get(Materials.Ultimate))); setElectricStats(32000 + tLastID, 1000000000L, GT_Values.V[6], 6L, -3L, true); OreDictionary.registerOre("LuV", ItemList.Energy_LapotronicOrb2.get(1)); // UV Battery - ItemList.ZPM2.set(addItem(tLastID = 605, "Ultimate Battery", "Fill this to win minecraft", "batteryUV", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 64L))); + ItemList.ZPM2.set(addItem( + tLastID = 605, + "Ultimate Battery", + "Fill this to win minecraft", + "batteryUV", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 16L), + new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 64L))); setElectricStats(32000 + tLastID, Long.MAX_VALUE, GT_Values.V[8], 8L, -3L, true); OreDictionary.registerOre("UV", ItemList.ZPM2.get(1)); // UMV Battery - ItemList.ZPM3.set(addItem(tLastID = 609, "Really Ultimate Battery", "Fill this to be way older", "batteryUMV", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 64L))); + ItemList.ZPM3.set(addItem( + tLastID = 609, + "Really Ultimate Battery", + "Fill this to be way older", + "batteryUMV", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 16L), + new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 64L))); setElectricStats(32000 + tLastID, Long.MAX_VALUE, GT_Values.V[12], 12L, -3L, true); OreDictionary.registerOre("UMV", ItemList.ZPM3.get(1)); // ZPM Cluster - ItemList.Energy_Module.set(addItem(tLastID = 736, "Energy Module", "Reusable battery", "batteryZPM", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 16L), OrePrefixes.battery.get(Materials.Ultimate))); + ItemList.Energy_Module.set(addItem( + tLastID = 736, + "Energy Module", + "Reusable battery", + "batteryZPM", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 16L), + new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 16L), + OrePrefixes.battery.get(Materials.Ultimate))); setElectricStats(32000 + tLastID, 10000000000L, GT_Values.V[7], 7L, -3L, true); OreDictionary.registerOre("ZPM", ItemList.Energy_Module.get(1)); // UV Cluster - ItemList.Energy_Cluster.set(addItem(tLastID = 737, "Energy Cluster", "Reusable battery", "batteryUV", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 64L))); + ItemList.Energy_Cluster.set(addItem( + tLastID = 737, + "Energy Cluster", + "Reusable battery", + "batteryUV", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 16L), + new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 64L))); setElectricStats(32000 + tLastID, 100000000000L, GT_Values.V[8], 8L, -3L, true); OreDictionary.registerOre("UV", ItemList.Energy_Cluster.get(1)); // UIV, UMV, UXV and MAX component textures backported from gregicality. - ItemList.Electric_Motor_LV.set(addItem(600, "Electric Motor (LV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 1L))); - ItemList.Electric_Motor_MV.set(addItem(601, "Electric Motor (MV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 2L))); - ItemList.Electric_Motor_HV.set(addItem(602, "Electric Motor (HV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 4L))); - ItemList.Electric_Motor_EV.set(addItem(603, "Electric Motor (EV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 8L))); - ItemList.Electric_Motor_IV.set(addItem(604, "Electric Motor (IV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 16L))); - ItemList.Electric_Motor_LuV.set(addItem(606, "Electric Motor (LuV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 32L))); - ItemList.Electric_Motor_ZPM.set(addItem(607, "Electric Motor (ZPM)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 64L))); - ItemList.Electric_Motor_UV.set(addItem(608, "Electric Motor (UV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 128L))); - ItemList.Electric_Motor_UHV.set(addItem(596, "Electric Motor (UHV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 256L))); - ItemList.Electric_Motor_UEV.set(addItem(595, "Electric Motor (UEV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 512L))); - ItemList.Electric_Motor_UIV.set(addItem(17, "Electric Motor (UIV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 512L))); - ItemList.Electric_Motor_UMV.set(addItem(18, "Electric Motor (UMV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 512L))); - ItemList.Electric_Motor_UXV.set(addItem(19, "Electric Motor (UXV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 512L))); - ItemList.Electric_Motor_MAX.set(addItem(20, "Electric Motor (MAX)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 512L))); - - GT_ModHandler.addCraftingRecipe(ItemList.Electric_Motor_LV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CWR", "WIW", "RWC", 'I', OrePrefixes.stick.get(Materials.IronMagnetic), 'R', OrePrefixes.stick.get(Materials.AnyIron), 'W', OrePrefixes.wireGt01.get(Materials.AnyCopper), 'C', OrePrefixes.cableGt01.get(Materials.Tin)}); - GT_ModHandler.addCraftingRecipe(ItemList.Electric_Motor_LV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CWR", "WIW", "RWC", 'I', OrePrefixes.stick.get(Materials.SteelMagnetic), 'R', OrePrefixes.stick.get(Materials.Steel), 'W', OrePrefixes.wireGt01.get(Materials.AnyCopper), 'C', OrePrefixes.cableGt01.get(Materials.Tin)}); - GT_ModHandler.addCraftingRecipe(ItemList.Electric_Motor_MV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CWR", "WIW", "RWC", 'I', OrePrefixes.stick.get(Materials.SteelMagnetic), 'R', OrePrefixes.stick.get(Materials.Aluminium), 'W', OrePrefixes.wireGt02.get(Materials.Cupronickel), 'C', OrePrefixes.cableGt01.get(Materials.AnyCopper)}); - GT_ModHandler.addCraftingRecipe(ItemList.Electric_Motor_HV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CWR", "WIW", "RWC", 'I', OrePrefixes.stick.get(Materials.SteelMagnetic), 'R', OrePrefixes.stick.get(Materials.StainlessSteel), 'W', OrePrefixes.wireGt04.get(Materials.Electrum), 'C', OrePrefixes.cableGt02.get(Materials.Silver)}); - GT_ModHandler.addCraftingRecipe(ItemList.Electric_Motor_EV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CWR", "WIW", "RWC", 'I', OrePrefixes.stick.get(Materials.NeodymiumMagnetic), 'R', OrePrefixes.stick.get(Materials.Titanium), 'W', OrePrefixes.wireGt04.get(Materials.BlackSteel), 'C', OrePrefixes.cableGt02.get(Materials.Aluminium)}); - GT_ModHandler.addCraftingRecipe(ItemList.Electric_Motor_IV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CWR", "WIW", "RWC", 'I', OrePrefixes.stick.get(Materials.NeodymiumMagnetic), 'R', OrePrefixes.stick.get(Materials.TungstenSteel), 'W', OrePrefixes.wireGt04.get(Materials.Graphene), 'C', OrePrefixes.cableGt02.get(Materials.Tungsten)}); - - ItemList.Tesseract.set(addItem(415, "Raw Tesseract", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 1L))); - ItemList.GigaChad.set(addItem(416, "Giga Chad Token", "You are worthy", new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 1000L))); - ItemList.EnergisedTesseract.set(addItem(417, "Energised Tesseract", "Higher dimensional engineering", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 10L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 1L))); - - ItemList.Electric_Piston_LV.set(addItem(640, "Electric Piston (LV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 1L))); - ItemList.Electric_Piston_MV.set(addItem(641, "Electric Piston (MV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 2L))); - ItemList.Electric_Piston_HV.set(addItem(642, "Electric Piston (HV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 4L))); - ItemList.Electric_Piston_EV.set(addItem(643, "Electric Piston (EV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 8L))); - ItemList.Electric_Piston_IV.set(addItem(644, "Electric Piston (IV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 16L))); - ItemList.Electric_Piston_LuV.set(addItem(645, "Electric Piston (LuV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 32L))); - ItemList.Electric_Piston_ZPM.set(addItem(646, "Electric Piston (ZPM)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 64L))); - ItemList.Electric_Piston_UV.set(addItem(647, "Electric Piston (UV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 128L))); - ItemList.Electric_Piston_UHV.set(addItem(648, "Electric Piston (UHV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 256L))); - ItemList.Electric_Piston_UEV.set(addItem(649, "Electric Piston (UEV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 512L))); - ItemList.Electric_Piston_UIV.set(addItem(21, "Electric Piston (UIV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 512L))); - ItemList.Electric_Piston_UMV.set(addItem(22, "Electric Piston (UMV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 512L))); - ItemList.Electric_Piston_UXV.set(addItem(23, "Electric Piston (UXV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 512L))); - ItemList.Electric_Piston_MAX.set(addItem(24, "Electric Piston (MAX)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 512L))); - - GT_ModHandler.addCraftingRecipe(ItemList.Electric_Piston_LV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"PPP", "CSS", "CMG", 'P', OrePrefixes.plate.get(Materials.Steel), 'S', OrePrefixes.stick.get(Materials.Steel), 'G', OrePrefixes.gearGtSmall.get(Materials.Steel), 'M', ItemList.Electric_Motor_LV, 'C', OrePrefixes.cableGt01.get(Materials.Tin)}); - GT_ModHandler.addCraftingRecipe(ItemList.Electric_Piston_MV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"PPP", "CSS", "CMG", 'P', OrePrefixes.plate.get(Materials.Aluminium), 'S', OrePrefixes.stick.get(Materials.Aluminium), 'G', OrePrefixes.gearGtSmall.get(Materials.Aluminium), 'M', ItemList.Electric_Motor_MV, 'C', OrePrefixes.cableGt01.get(Materials.AnyCopper)}); - GT_ModHandler.addCraftingRecipe(ItemList.Electric_Piston_HV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"PPP", "CSS", "CMG", 'P', OrePrefixes.plate.get(Materials.StainlessSteel), 'S', OrePrefixes.stick.get(Materials.StainlessSteel), 'G', OrePrefixes.gearGtSmall.get(Materials.StainlessSteel), 'M', ItemList.Electric_Motor_HV, 'C', OrePrefixes.cableGt01.get(Materials.Gold)}); - GT_ModHandler.addCraftingRecipe(ItemList.Electric_Piston_EV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"PPP", "CSS", "CMG", 'P', OrePrefixes.plate.get(Materials.Titanium), 'S', OrePrefixes.stick.get(Materials.Titanium), 'G', OrePrefixes.gearGtSmall.get(Materials.Titanium), 'M', ItemList.Electric_Motor_EV, 'C', OrePrefixes.cableGt01.get(Materials.Aluminium)}); - GT_ModHandler.addCraftingRecipe(ItemList.Electric_Piston_IV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"PPP", "CSS", "CMG", 'P', OrePrefixes.plate.get(Materials.TungstenSteel), 'S', OrePrefixes.stick.get(Materials.TungstenSteel), 'G', OrePrefixes.gearGtSmall.get(Materials.TungstenSteel), 'M', ItemList.Electric_Motor_IV, 'C', OrePrefixes.cableGt01.get(Materials.Tungsten)}); - - ItemList.Electric_Pump_LV.set(addItem(610, "Electric Pump (LV)", GT_Utility.formatNumbers(32) + PartCoverText + GT_Utility.formatNumbers(32 * 20) + PartCoverText2, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L))); - ItemList.Electric_Pump_MV.set(addItem(611, "Electric Pump (MV)", GT_Utility.formatNumbers(128) + PartCoverText + GT_Utility.formatNumbers(128 * 20) + PartCoverText2, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 2L))); - ItemList.Electric_Pump_HV.set(addItem(612, "Electric Pump (HV)", GT_Utility.formatNumbers(512) + PartCoverText + GT_Utility.formatNumbers(512 * 20) + PartCoverText2, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 4L))); - ItemList.Electric_Pump_EV.set(addItem(613, "Electric Pump (EV)", GT_Utility.formatNumbers(2048) + PartCoverText + GT_Utility.formatNumbers(2048 * 20) + PartCoverText2, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 8L))); - ItemList.Electric_Pump_IV.set(addItem(614, "Electric Pump (IV)", GT_Utility.formatNumbers(8192) + PartCoverText + GT_Utility.formatNumbers(8192 * 20) + PartCoverText2, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 16L))); - ItemList.Electric_Pump_LuV.set(addItem(615, "Electric Pump (LuV)", GT_Utility.formatNumbers(32768) + PartCoverText + GT_Utility.formatNumbers(32768 * 20) + PartCoverText2, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 32L))); - ItemList.Electric_Pump_ZPM.set(addItem(616, "Electric Pump (ZPM)", GT_Utility.formatNumbers(131072) + PartCoverText + GT_Utility.formatNumbers(131072 * 20) + PartCoverText2, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 64L))); - ItemList.Electric_Pump_UV.set(addItem(617, "Electric Pump (UV)", GT_Utility.formatNumbers(524288) + PartCoverText + GT_Utility.formatNumbers(524288 * 20) + PartCoverText2, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 128L))); - ItemList.Electric_Pump_UHV.set(addItem(618, "Electric Pump (UHV)", GT_Utility.formatNumbers(1048576) + PartCoverText + GT_Utility.formatNumbers(1048576 * 20) + PartCoverText2, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 256L))); - ItemList.Electric_Pump_UEV.set(addItem(619, "Electric Pump (UEV)", GT_Utility.formatNumbers(2097152) + PartCoverText + GT_Utility.formatNumbers(2097152 * 20) + PartCoverText2, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 512L))); - ItemList.Electric_Pump_UIV.set(addItem(25, "Electric Pump (UIV)", PartNotCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 512L))); - ItemList.Electric_Pump_UMV.set(addItem(26, "Electric Pump (UMV)", PartNotCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 512L))); - ItemList.Electric_Pump_UXV.set(addItem(27, "Electric Pump (UXV)", PartNotCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 512L))); - ItemList.Electric_Pump_MAX.set(addItem(28, "Electric Pump (MAX)", PartNotCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 512L))); - - GregTech_API.registerCover(ItemList.Electric_Pump_LV.get(1L), TextureFactory.of(MACHINE_CASINGS[1][0], TextureFactory.of(OVERLAY_PUMP)), new GT_Cover_Pump(32)); - GregTech_API.registerCover(ItemList.Electric_Pump_MV.get(1L), TextureFactory.of(MACHINE_CASINGS[2][0], TextureFactory.of(OVERLAY_PUMP)), new GT_Cover_Pump(128)); - GregTech_API.registerCover(ItemList.Electric_Pump_HV.get(1L), TextureFactory.of(MACHINE_CASINGS[3][0], TextureFactory.of(OVERLAY_PUMP)), new GT_Cover_Pump(512)); - GregTech_API.registerCover(ItemList.Electric_Pump_EV.get(1L), TextureFactory.of(MACHINE_CASINGS[4][0], TextureFactory.of(OVERLAY_PUMP)), new GT_Cover_Pump(2048)); - GregTech_API.registerCover(ItemList.Electric_Pump_IV.get(1L), TextureFactory.of(MACHINE_CASINGS[5][0], TextureFactory.of(OVERLAY_PUMP)), new GT_Cover_Pump(8192)); - GregTech_API.registerCover(ItemList.Electric_Pump_LuV.get(1L), TextureFactory.of(MACHINE_CASINGS[6][0], TextureFactory.of(OVERLAY_PUMP)), new GT_Cover_Pump(32768)); - GregTech_API.registerCover(ItemList.Electric_Pump_ZPM.get(1L), TextureFactory.of(MACHINE_CASINGS[7][0], TextureFactory.of(OVERLAY_PUMP)), new GT_Cover_Pump(131072)); - GregTech_API.registerCover(ItemList.Electric_Pump_UV.get(1L), TextureFactory.of(MACHINE_CASINGS[8][0], TextureFactory.of(OVERLAY_PUMP)), new GT_Cover_Pump(524288)); - GregTech_API.registerCover(ItemList.Electric_Pump_UHV.get(1L), TextureFactory.of(MACHINE_CASINGS[9][0], TextureFactory.of(OVERLAY_PUMP)), new GT_Cover_Pump(1048576)); - GregTech_API.registerCover(ItemList.Electric_Pump_UEV.get(1L), TextureFactory.of(MACHINE_CASINGS[10][0], TextureFactory.of(OVERLAY_PUMP)), new GT_Cover_Pump(2097152)); - - GT_ModHandler.addCraftingRecipe(ItemList.Electric_Pump_LV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SXO", "dPw", "OMW", 'M', ItemList.Electric_Motor_LV, 'O', OrePrefixes.ring.get(Materials.AnyRubber), 'X', OrePrefixes.rotor.get(Materials.Tin), 'S', OrePrefixes.screw.get(Materials.Tin), 'W', OrePrefixes.cableGt01.get(Materials.Tin), 'P', OrePrefixes.pipeMedium.get(Materials.Bronze)}); - GT_ModHandler.addCraftingRecipe(ItemList.Electric_Pump_MV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SXO", "dPw", "OMW", 'M', ItemList.Electric_Motor_MV, 'O', OrePrefixes.ring.get(Materials.AnyRubber), 'X', OrePrefixes.rotor.get(Materials.Bronze), 'S', OrePrefixes.screw.get(Materials.Bronze), 'W', OrePrefixes.cableGt01.get(Materials.AnyCopper), 'P', OrePrefixes.pipeMedium.get(Materials.Steel)}); - GT_ModHandler.addCraftingRecipe(ItemList.Electric_Pump_HV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SXO", "dPw", "OMW", 'M', ItemList.Electric_Motor_HV, 'O', OrePrefixes.ring.get(Materials.AnyRubber), 'X', OrePrefixes.rotor.get(Materials.Steel), 'S', OrePrefixes.screw.get(Materials.Steel), 'W', OrePrefixes.cableGt01.get(Materials.Gold), 'P', OrePrefixes.pipeMedium.get(Materials.StainlessSteel)}); - GT_ModHandler.addCraftingRecipe(ItemList.Electric_Pump_EV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SXO", "dPw", "OMW", 'M', ItemList.Electric_Motor_EV, 'O', OrePrefixes.ring.get(Materials.AnyRubber), 'X', OrePrefixes.rotor.get(Materials.StainlessSteel), 'S', OrePrefixes.screw.get(Materials.StainlessSteel), 'W', OrePrefixes.cableGt01.get(Materials.Aluminium), 'P', OrePrefixes.pipeMedium.get(Materials.Titanium)}); - GT_ModHandler.addCraftingRecipe(ItemList.Electric_Pump_IV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SXO", "dPw", "OMW", 'M', ItemList.Electric_Motor_IV, 'O', OrePrefixes.ring.get(Materials.AnySyntheticRubber), 'X', OrePrefixes.rotor.get(Materials.TungstenSteel), 'S', OrePrefixes.screw.get(Materials.TungstenSteel), 'W', OrePrefixes.cableGt01.get(Materials.Tungsten), 'P', OrePrefixes.pipeMedium.get(Materials.TungstenSteel)}); - - ItemList.Steam_Valve_LV.set(addItem(620, "Steam Valve (LV)", GT_Utility.formatNumbers(1024) + PartCoverText + GT_Utility.formatNumbers(1024 * 20) + PartCoverText2, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L))); - ItemList.Steam_Valve_MV.set(addItem(621, "Steam Valve (MV)", GT_Utility.formatNumbers(2048) + PartCoverText + GT_Utility.formatNumbers(2048 * 20) + PartCoverText2, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 2L))); - ItemList.Steam_Valve_HV.set(addItem(622, "Steam Valve (HV)", GT_Utility.formatNumbers(4096) + PartCoverText + GT_Utility.formatNumbers(4096 * 20) + PartCoverText2, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 4L))); - ItemList.Steam_Valve_EV.set(addItem(623, "Steam Valve (EV)", GT_Utility.formatNumbers(8192) + PartCoverText + GT_Utility.formatNumbers(8192 * 20) + PartCoverText2, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 8L))); - ItemList.Steam_Valve_IV.set(addItem(624, "Steam Valve (IV)", GT_Utility.formatNumbers(16384) + PartCoverText + GT_Utility.formatNumbers(16384 * 20) + PartCoverText2, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 16L))); - - GregTech_API.registerCover(ItemList.Steam_Valve_LV.get(1L), TextureFactory.of(MACHINE_CASINGS[1][0], TextureFactory.of(OVERLAY_VALVE)), new GT_Cover_SteamValve(1024)); - GregTech_API.registerCover(ItemList.Steam_Valve_MV.get(1L), TextureFactory.of(MACHINE_CASINGS[2][0], TextureFactory.of(OVERLAY_VALVE)), new GT_Cover_SteamValve(2048)); - GregTech_API.registerCover(ItemList.Steam_Valve_HV.get(1L), TextureFactory.of(MACHINE_CASINGS[3][0], TextureFactory.of(OVERLAY_VALVE)), new GT_Cover_SteamValve(4096)); - GregTech_API.registerCover(ItemList.Steam_Valve_EV.get(1L), TextureFactory.of(MACHINE_CASINGS[4][0], TextureFactory.of(OVERLAY_VALVE)), new GT_Cover_SteamValve(8192)); - GregTech_API.registerCover(ItemList.Steam_Valve_IV.get(1L), TextureFactory.of(MACHINE_CASINGS[5][0], TextureFactory.of(OVERLAY_VALVE)), new GT_Cover_SteamValve(16384)); - - ItemList.FluidRegulator_LV.set(addItem(tLastID = 660, "Fluid Regulator (LV)", FRText1 + GT_Utility.formatNumbers(640) + FRText2)); - ItemList.FluidRegulator_MV.set(addItem(tLastID = 661, "Fluid Regulator (MV)", FRText1 + GT_Utility.formatNumbers(2560) + FRText2)); - ItemList.FluidRegulator_HV.set(addItem(tLastID = 662, "Fluid Regulator (HV)", FRText1 + GT_Utility.formatNumbers(10240) + FRText2)); - ItemList.FluidRegulator_EV.set(addItem(tLastID = 663, "Fluid Regulator (EV)", FRText1 + GT_Utility.formatNumbers(40960) + FRText2)); - ItemList.FluidRegulator_IV.set(addItem(tLastID = 664, "Fluid Regulator (IV)", FRText1 + GT_Utility.formatNumbers(163840) + FRText2)); - ItemList.FluidRegulator_LuV.set(addItem(tLastID = 665, "Fluid Regulator (LuV)", FRText1 + GT_Utility.formatNumbers(655360) + FRText2)); - ItemList.FluidRegulator_ZPM.set(addItem(tLastID = 666, "Fluid Regulator (ZPM)", FRText1 + GT_Utility.formatNumbers(2621440) + FRText2)); - ItemList.FluidRegulator_UV.set(addItem(tLastID = 667, "Fluid Regulator (UV)", FRText1 + GT_Utility.formatNumbers(10485760) + FRText2)); - - GregTech_API.registerCover(ItemList.FluidRegulator_LV.get(1L), TextureFactory.of(MACHINE_CASINGS[1][0], TextureFactory.of(OVERLAY_PUMP)), new GT_Cover_FluidRegulator(32)); - GregTech_API.registerCover(ItemList.FluidRegulator_MV.get(1L), TextureFactory.of(MACHINE_CASINGS[2][0], TextureFactory.of(OVERLAY_PUMP)), new GT_Cover_FluidRegulator(128)); - GregTech_API.registerCover(ItemList.FluidRegulator_HV.get(1L), TextureFactory.of(MACHINE_CASINGS[3][0], TextureFactory.of(OVERLAY_PUMP)), new GT_Cover_FluidRegulator(512)); - GregTech_API.registerCover(ItemList.FluidRegulator_EV.get(1L), TextureFactory.of(MACHINE_CASINGS[4][0], TextureFactory.of(OVERLAY_PUMP)), new GT_Cover_FluidRegulator(2048)); - GregTech_API.registerCover(ItemList.FluidRegulator_IV.get(1L), TextureFactory.of(MACHINE_CASINGS[5][0], TextureFactory.of(OVERLAY_PUMP)), new GT_Cover_FluidRegulator(8192)); - GregTech_API.registerCover(ItemList.FluidRegulator_LuV.get(1L), TextureFactory.of(MACHINE_CASINGS[6][0], TextureFactory.of(OVERLAY_PUMP)), new GT_Cover_FluidRegulator(32768)); - GregTech_API.registerCover(ItemList.FluidRegulator_ZPM.get(1L), TextureFactory.of(MACHINE_CASINGS[7][0], TextureFactory.of(OVERLAY_PUMP)), new GT_Cover_FluidRegulator(131072)); - GregTech_API.registerCover(ItemList.FluidRegulator_UV.get(1L), TextureFactory.of(MACHINE_CASINGS[8][0], TextureFactory.of(OVERLAY_PUMP)), new GT_Cover_FluidRegulator(524288)); - - ItemList.FluidFilter.set(addItem(669, "Fluid Filter Cover", "Set with Fluid Container to only accept one Fluid Type")); - GregTech_API.registerCover(ItemList.FluidFilter.get(1L), TextureFactory.of(MACHINE_CASINGS[1][0], TextureFactory.of(OVERLAY_SHUTTER)), new GT_Cover_Fluidfilter()); - ItemList.ItemFilter_Export.set(addItem(270,"Item Filter Cover (Export)", "Right click with an item to set filter (Only supports Export Mode)")); - GregTech_API.registerCover(ItemList.ItemFilter_Export.get(1L), TextureFactory.of(MACHINE_CASINGS[5][0], TextureFactory.of(OVERLAY_CONVEYOR)), new GT_Cover_ItemFilter(true)); - ItemList.ItemFilter_Import.set(addItem(271,"Item Filter Cover (Import)", "Right click with an item to set filter (Only supports Import Mode)")); - GregTech_API.registerCover(ItemList.ItemFilter_Import.get(1L), TextureFactory.of(MACHINE_CASINGS[5][0], TextureFactory.of(OVERLAY_CONVEYOR)), new GT_Cover_ItemFilter(false)); - ItemList.Cover_FluidLimiter.set(addItem(272, "Fluid Limiter Cover", "Limits fluid input depending on fill level")); - GregTech_API.registerCover(ItemList.Cover_FluidLimiter.get(1L), TextureFactory.of(MACHINE_CASINGS[1][0], TextureFactory.of(OVERLAY_SHUTTER)), new GT_Cover_FluidLimiter()); - - - - ItemList.Conveyor_Module_LV.set(addItem(630, "Conveyor Module (LV)", "1 stack every 20 secs (as Cover)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 1L))); - ItemList.Conveyor_Module_MV.set(addItem(631, "Conveyor Module (MV)", "1 stack every 5 secs (as Cover)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 2L))); - ItemList.Conveyor_Module_HV.set(addItem(632, "Conveyor Module (HV)", "1 stack every 1 sec (as Cover)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 4L))); - ItemList.Conveyor_Module_EV.set(addItem(633, "Conveyor Module (EV)", "1 stack every 1/5 sec (as Cover)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 8L))); - ItemList.Conveyor_Module_IV.set(addItem(634, "Conveyor Module (IV)", "1 stack every 1/20 sec (as Cover)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 16L))); - ItemList.Conveyor_Module_LuV.set(addItem(635, "Conveyor Module (LuV)", "2 stacks every 1/20 sec (as Cover)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 32L))); - ItemList.Conveyor_Module_ZPM.set(addItem(636, "Conveyor Module (ZPM)", "4 stacks every 1/20 sec (as Cover)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 64L))); - ItemList.Conveyor_Module_UV.set(addItem(637, "Conveyor Module (UV)", "8 stacks every 1/20 sec (as Cover)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 128L))); - ItemList.Conveyor_Module_UHV.set(addItem(638, "Conveyor Module (UHV)", "16 stacks every 1/20 sec (as Cover)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 256L))); - ItemList.Conveyor_Module_UEV.set(addItem(639, "Conveyor Module (UEV)", "32 stacks every 1/20 sec (as Cover)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 512L))); - ItemList.Conveyor_Module_UIV.set(addItem(29, "Conveyor Module (UIV)", PartNotCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 512L))); - ItemList.Conveyor_Module_UMV.set(addItem(30, "Conveyor Module (UMV)", PartNotCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 512L))); - ItemList.Conveyor_Module_UXV.set(addItem(31, "Conveyor Module (UXV)", PartNotCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 512L))); - ItemList.Conveyor_Module_MAX.set(addItem(32, "Conveyor Module (MAX)", PartNotCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 512L))); - - GT_ModHandler.addCraftingRecipe(ItemList.Conveyor_Module_LV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"RRR", "MCM", "RRR", 'M', ItemList.Electric_Motor_LV, 'C', OrePrefixes.cableGt01.get(Materials.Tin), 'R', OrePrefixes.plate.get(Materials.AnyRubber)}); - GT_ModHandler.addCraftingRecipe(ItemList.Conveyor_Module_MV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"RRR", "MCM", "RRR", 'M', ItemList.Electric_Motor_MV, 'C', OrePrefixes.cableGt01.get(Materials.AnyCopper), 'R', OrePrefixes.plate.get(Materials.AnyRubber)}); - GT_ModHandler.addCraftingRecipe(ItemList.Conveyor_Module_HV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"RRR", "MCM", "RRR", 'M', ItemList.Electric_Motor_HV, 'C', OrePrefixes.cableGt01.get(Materials.Gold), 'R', OrePrefixes.plate.get(Materials.AnyRubber)}); - GT_ModHandler.addCraftingRecipe(ItemList.Conveyor_Module_EV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"RRR", "MCM", "RRR", 'M', ItemList.Electric_Motor_EV, 'C', OrePrefixes.cableGt01.get(Materials.Aluminium), 'R', OrePrefixes.plate.get(Materials.AnyRubber)}); - GT_ModHandler.addCraftingRecipe(ItemList.Conveyor_Module_IV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"RRR", "MCM", "RRR", 'M', ItemList.Electric_Motor_IV, 'C', OrePrefixes.cableGt01.get(Materials.Tungsten), 'R', OrePrefixes.plate.get(Materials.AnySyntheticRubber)}); - - GregTech_API.registerCover(ItemList.Conveyor_Module_LV.get(1L), TextureFactory.of(MACHINE_CASINGS[1][0], TextureFactory.of(OVERLAY_CONVEYOR)), new GT_Cover_Conveyor(400, 1)); - GregTech_API.registerCover(ItemList.Conveyor_Module_MV.get(1L), TextureFactory.of(MACHINE_CASINGS[2][0], TextureFactory.of(OVERLAY_CONVEYOR)), new GT_Cover_Conveyor(100, 1)); - GregTech_API.registerCover(ItemList.Conveyor_Module_HV.get(1L), TextureFactory.of(MACHINE_CASINGS[3][0], TextureFactory.of(OVERLAY_CONVEYOR)), new GT_Cover_Conveyor(20, 1)); - GregTech_API.registerCover(ItemList.Conveyor_Module_EV.get(1L), TextureFactory.of(MACHINE_CASINGS[4][0], TextureFactory.of(OVERLAY_CONVEYOR)), new GT_Cover_Conveyor(4, 1)); - GregTech_API.registerCover(ItemList.Conveyor_Module_IV.get(1L), TextureFactory.of(MACHINE_CASINGS[5][0], TextureFactory.of(OVERLAY_CONVEYOR)), new GT_Cover_Conveyor(1, 1)); - GregTech_API.registerCover(ItemList.Conveyor_Module_LuV.get(1L), TextureFactory.of(MACHINE_CASINGS[6][0], TextureFactory.of(OVERLAY_CONVEYOR)), new GT_Cover_Conveyor(1, 2)); - GregTech_API.registerCover(ItemList.Conveyor_Module_ZPM.get(1L), TextureFactory.of(MACHINE_CASINGS[7][0], TextureFactory.of(OVERLAY_CONVEYOR)), new GT_Cover_Conveyor(1, 4)); - GregTech_API.registerCover(ItemList.Conveyor_Module_UV.get(1L), TextureFactory.of(MACHINE_CASINGS[8][0], TextureFactory.of(OVERLAY_CONVEYOR)), new GT_Cover_Conveyor(1, 8)); - GregTech_API.registerCover(ItemList.Conveyor_Module_UHV.get(1L), TextureFactory.of(MACHINE_CASINGS[9][0], TextureFactory.of(OVERLAY_CONVEYOR)), new GT_Cover_Conveyor(1, 16)); - GregTech_API.registerCover(ItemList.Conveyor_Module_UEV.get(1L), TextureFactory.of(MACHINE_CASINGS[10][0], TextureFactory.of(OVERLAY_CONVEYOR)), new GT_Cover_Conveyor(1, 32)); - - ItemList.Robot_Arm_LV.set(addItem(650, "Robot Arm (LV)", "1 stack every 20 secs (as Cover)/n " + RAText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 1L))); - ItemList.Robot_Arm_MV.set(addItem(651, "Robot Arm (MV)", "1 stack every 5 secs (as Cover)/n " + RAText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 2L))); - ItemList.Robot_Arm_HV.set(addItem(652, "Robot Arm (HV)", "1 stack every 1 sec (as Cover)/n " + RAText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 4L))); - ItemList.Robot_Arm_EV.set(addItem(653, "Robot Arm (EV)", "1 stack every 1/5 sec (as Cover)/n " + RAText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 8L))); - ItemList.Robot_Arm_IV.set(addItem(654, "Robot Arm (IV)", "1 stack every 1/20 sec (as Cover)/n " + RAText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 16L))); - ItemList.Robot_Arm_LuV.set(addItem(655, "Robot Arm (LuV)", PartNotCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 32L))); - ItemList.Robot_Arm_ZPM.set(addItem(656, "Robot Arm (ZPM)", PartNotCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 64L))); - ItemList.Robot_Arm_UV.set(addItem(657, "Robot Arm (UV)", PartNotCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 128L))); - ItemList.Robot_Arm_UHV.set(addItem(658, "Robot Arm (UHV)", PartNotCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 256L))); - ItemList.Robot_Arm_UEV.set(addItem(659, "Robot Arm (UEV)", PartNotCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1024L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 512L))); - ItemList.Robot_Arm_UIV.set(addItem(33, "Robot Arm (UIV)", PartNotCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1024L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 512L))); - ItemList.Robot_Arm_UMV.set(addItem(34, "Robot Arm (UMV)", PartNotCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1024L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 512L))); - ItemList.Robot_Arm_UXV.set(addItem(35, "Robot Arm (UXV)", PartNotCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1024L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 512L))); - ItemList.Robot_Arm_MAX.set(addItem(36, "Robot Arm (MAX)", PartNotCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1024L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 512L))); - - GT_ModHandler.addCraftingRecipe(ItemList.Robot_Arm_LV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CCC", "MSM", "PES", 'S', OrePrefixes.stick.get(Materials.Steel), 'M', ItemList.Electric_Motor_LV, 'P', ItemList.Electric_Piston_LV, 'E', OrePrefixes.circuit.get(Materials.Basic), 'C', OrePrefixes.cableGt01.get(Materials.Tin)}); - GT_ModHandler.addCraftingRecipe(ItemList.Robot_Arm_MV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CCC", "MSM", "PES", 'S', OrePrefixes.stick.get(Materials.Aluminium), 'M', ItemList.Electric_Motor_MV, 'P', ItemList.Electric_Piston_MV, 'E', OrePrefixes.circuit.get(Materials.Good), 'C', OrePrefixes.cableGt01.get(Materials.AnyCopper)}); - GT_ModHandler.addCraftingRecipe(ItemList.Robot_Arm_HV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CCC", "MSM", "PES", 'S', OrePrefixes.stick.get(Materials.StainlessSteel), 'M', ItemList.Electric_Motor_HV, 'P', ItemList.Electric_Piston_HV, 'E', OrePrefixes.circuit.get(Materials.Advanced), 'C', OrePrefixes.cableGt01.get(Materials.Gold)}); - GT_ModHandler.addCraftingRecipe(ItemList.Robot_Arm_EV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CCC", "MSM", "PES", 'S', OrePrefixes.stick.get(Materials.Titanium), 'M', ItemList.Electric_Motor_EV, 'P', ItemList.Electric_Piston_EV, 'E', OrePrefixes.circuit.get(Materials.Data), 'C', OrePrefixes.cableGt01.get(Materials.Aluminium)}); - GT_ModHandler.addCraftingRecipe(ItemList.Robot_Arm_IV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CCC", "MSM", "PES", 'S', OrePrefixes.stick.get(Materials.TungstenSteel), 'M', ItemList.Electric_Motor_IV, 'P', ItemList.Electric_Piston_IV, 'E', OrePrefixes.circuit.get(Materials.Elite), 'C', OrePrefixes.cableGt01.get(Materials.Tungsten)}); - - GregTech_API.registerCover(ItemList.Robot_Arm_LV.get(1L), TextureFactory.of(MACHINE_CASINGS[1][0], TextureFactory.of(OVERLAY_ARM)), new GT_Cover_Arm(400)); - GregTech_API.registerCover(ItemList.Robot_Arm_MV.get(1L), TextureFactory.of(MACHINE_CASINGS[2][0], TextureFactory.of(OVERLAY_ARM)), new GT_Cover_Arm(100)); - GregTech_API.registerCover(ItemList.Robot_Arm_HV.get(1L), TextureFactory.of(MACHINE_CASINGS[3][0], TextureFactory.of(OVERLAY_ARM)), new GT_Cover_Arm(20)); - GregTech_API.registerCover(ItemList.Robot_Arm_EV.get(1L), TextureFactory.of(MACHINE_CASINGS[4][0], TextureFactory.of(OVERLAY_ARM)), new GT_Cover_Arm(4)); - GregTech_API.registerCover(ItemList.Robot_Arm_IV.get(1L), TextureFactory.of(MACHINE_CASINGS[5][0], TextureFactory.of(OVERLAY_ARM)), new GT_Cover_Arm(1)); + ItemList.Electric_Motor_LV.set(addItem( + 600, + "Electric Motor (LV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 1L))); + ItemList.Electric_Motor_MV.set(addItem( + 601, + "Electric Motor (MV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 2L))); + ItemList.Electric_Motor_HV.set(addItem( + 602, + "Electric Motor (HV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 4L))); + ItemList.Electric_Motor_EV.set(addItem( + 603, + "Electric Motor (EV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 8L))); + ItemList.Electric_Motor_IV.set(addItem( + 604, + "Electric Motor (IV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 16L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 16L))); + ItemList.Electric_Motor_LuV.set(addItem( + 606, + "Electric Motor (LuV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 32L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 32L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 32L))); + ItemList.Electric_Motor_ZPM.set(addItem( + 607, + "Electric Motor (ZPM)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 64L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 64L))); + ItemList.Electric_Motor_UV.set(addItem( + 608, + "Electric Motor (UV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 128L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 128L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 128L))); + ItemList.Electric_Motor_UHV.set(addItem( + 596, + "Electric Motor (UHV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 256L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 256L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 256L))); + ItemList.Electric_Motor_UEV.set(addItem( + 595, + "Electric Motor (UEV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 512L))); + ItemList.Electric_Motor_UIV.set(addItem( + 17, + "Electric Motor (UIV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 512L))); + ItemList.Electric_Motor_UMV.set(addItem( + 18, + "Electric Motor (UMV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 512L))); + ItemList.Electric_Motor_UXV.set(addItem( + 19, + "Electric Motor (UXV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 512L))); + ItemList.Electric_Motor_MAX.set(addItem( + 20, + "Electric Motor (MAX)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 512L))); + + GT_ModHandler.addCraftingRecipe( + ItemList.Electric_Motor_LV.get(1L), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + "CWR", + "WIW", + "RWC", + 'I', + OrePrefixes.stick.get(Materials.IronMagnetic), + 'R', + OrePrefixes.stick.get(Materials.AnyIron), + 'W', + OrePrefixes.wireGt01.get(Materials.AnyCopper), + 'C', + OrePrefixes.cableGt01.get(Materials.Tin) + }); + GT_ModHandler.addCraftingRecipe( + ItemList.Electric_Motor_LV.get(1L), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + "CWR", + "WIW", + "RWC", + 'I', + OrePrefixes.stick.get(Materials.SteelMagnetic), + 'R', + OrePrefixes.stick.get(Materials.Steel), + 'W', + OrePrefixes.wireGt01.get(Materials.AnyCopper), + 'C', + OrePrefixes.cableGt01.get(Materials.Tin) + }); + GT_ModHandler.addCraftingRecipe( + ItemList.Electric_Motor_MV.get(1L), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + "CWR", + "WIW", + "RWC", + 'I', + OrePrefixes.stick.get(Materials.SteelMagnetic), + 'R', + OrePrefixes.stick.get(Materials.Aluminium), + 'W', + OrePrefixes.wireGt02.get(Materials.Cupronickel), + 'C', + OrePrefixes.cableGt01.get(Materials.AnyCopper) + }); + GT_ModHandler.addCraftingRecipe( + ItemList.Electric_Motor_HV.get(1L), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + "CWR", + "WIW", + "RWC", + 'I', + OrePrefixes.stick.get(Materials.SteelMagnetic), + 'R', + OrePrefixes.stick.get(Materials.StainlessSteel), + 'W', + OrePrefixes.wireGt04.get(Materials.Electrum), + 'C', + OrePrefixes.cableGt02.get(Materials.Silver) + }); + GT_ModHandler.addCraftingRecipe( + ItemList.Electric_Motor_EV.get(1L), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + "CWR", + "WIW", + "RWC", + 'I', + OrePrefixes.stick.get(Materials.NeodymiumMagnetic), + 'R', + OrePrefixes.stick.get(Materials.Titanium), + 'W', + OrePrefixes.wireGt04.get(Materials.BlackSteel), + 'C', + OrePrefixes.cableGt02.get(Materials.Aluminium) + }); + GT_ModHandler.addCraftingRecipe( + ItemList.Electric_Motor_IV.get(1L), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + "CWR", + "WIW", + "RWC", + 'I', + OrePrefixes.stick.get(Materials.NeodymiumMagnetic), + 'R', + OrePrefixes.stick.get(Materials.TungstenSteel), + 'W', + OrePrefixes.wireGt04.get(Materials.Graphene), + 'C', + OrePrefixes.cableGt02.get(Materials.Tungsten) + }); + + ItemList.Tesseract.set(addItem( + 415, + "Raw Tesseract", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 1L))); + ItemList.GigaChad.set(addItem( + 416, "Giga Chad Token", "You are worthy", new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 1000L))); + ItemList.EnergisedTesseract.set(addItem( + 417, + "Energised Tesseract", + "Higher dimensional engineering", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 10L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 1L))); + + ItemList.Electric_Piston_LV.set(addItem( + 640, + "Electric Piston (LV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 1L))); + ItemList.Electric_Piston_MV.set(addItem( + 641, + "Electric Piston (MV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 2L))); + ItemList.Electric_Piston_HV.set(addItem( + 642, + "Electric Piston (HV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 4L))); + ItemList.Electric_Piston_EV.set(addItem( + 643, + "Electric Piston (EV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 16L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 8L))); + ItemList.Electric_Piston_IV.set(addItem( + 644, + "Electric Piston (IV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 32L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 16L))); + ItemList.Electric_Piston_LuV.set(addItem( + 645, + "Electric Piston (LuV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 32L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 64L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 32L))); + ItemList.Electric_Piston_ZPM.set(addItem( + 646, + "Electric Piston (ZPM)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 64L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 64L))); + ItemList.Electric_Piston_UV.set(addItem( + 647, + "Electric Piston (UV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 128L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 128L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 128L))); + ItemList.Electric_Piston_UHV.set(addItem( + 648, + "Electric Piston (UHV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 256L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 256L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 256L))); + ItemList.Electric_Piston_UEV.set(addItem( + 649, + "Electric Piston (UEV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 512L))); + ItemList.Electric_Piston_UIV.set(addItem( + 21, + "Electric Piston (UIV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 512L))); + ItemList.Electric_Piston_UMV.set(addItem( + 22, + "Electric Piston (UMV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 512L))); + ItemList.Electric_Piston_UXV.set(addItem( + 23, + "Electric Piston (UXV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 512L))); + ItemList.Electric_Piston_MAX.set(addItem( + 24, + "Electric Piston (MAX)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 512L))); + + GT_ModHandler.addCraftingRecipe( + ItemList.Electric_Piston_LV.get(1L), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + "PPP", + "CSS", + "CMG", + 'P', + OrePrefixes.plate.get(Materials.Steel), + 'S', + OrePrefixes.stick.get(Materials.Steel), + 'G', + OrePrefixes.gearGtSmall.get(Materials.Steel), + 'M', + ItemList.Electric_Motor_LV, + 'C', + OrePrefixes.cableGt01.get(Materials.Tin) + }); + GT_ModHandler.addCraftingRecipe( + ItemList.Electric_Piston_MV.get(1L), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + "PPP", + "CSS", + "CMG", + 'P', + OrePrefixes.plate.get(Materials.Aluminium), + 'S', + OrePrefixes.stick.get(Materials.Aluminium), + 'G', + OrePrefixes.gearGtSmall.get(Materials.Aluminium), + 'M', + ItemList.Electric_Motor_MV, + 'C', + OrePrefixes.cableGt01.get(Materials.AnyCopper) + }); + GT_ModHandler.addCraftingRecipe( + ItemList.Electric_Piston_HV.get(1L), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + "PPP", + "CSS", + "CMG", + 'P', + OrePrefixes.plate.get(Materials.StainlessSteel), + 'S', + OrePrefixes.stick.get(Materials.StainlessSteel), + 'G', + OrePrefixes.gearGtSmall.get(Materials.StainlessSteel), + 'M', + ItemList.Electric_Motor_HV, + 'C', + OrePrefixes.cableGt01.get(Materials.Gold) + }); + GT_ModHandler.addCraftingRecipe( + ItemList.Electric_Piston_EV.get(1L), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + "PPP", + "CSS", + "CMG", + 'P', + OrePrefixes.plate.get(Materials.Titanium), + 'S', + OrePrefixes.stick.get(Materials.Titanium), + 'G', + OrePrefixes.gearGtSmall.get(Materials.Titanium), + 'M', + ItemList.Electric_Motor_EV, + 'C', + OrePrefixes.cableGt01.get(Materials.Aluminium) + }); + GT_ModHandler.addCraftingRecipe( + ItemList.Electric_Piston_IV.get(1L), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + "PPP", + "CSS", + "CMG", + 'P', + OrePrefixes.plate.get(Materials.TungstenSteel), + 'S', + OrePrefixes.stick.get(Materials.TungstenSteel), + 'G', + OrePrefixes.gearGtSmall.get(Materials.TungstenSteel), + 'M', + ItemList.Electric_Motor_IV, + 'C', + OrePrefixes.cableGt01.get(Materials.Tungsten) + }); + + ItemList.Electric_Pump_LV.set(addItem( + 610, + "Electric Pump (LV)", + GT_Utility.formatNumbers(32) + PartCoverText + GT_Utility.formatNumbers(32 * 20) + PartCoverText2, + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L))); + ItemList.Electric_Pump_MV.set(addItem( + 611, + "Electric Pump (MV)", + GT_Utility.formatNumbers(128) + PartCoverText + GT_Utility.formatNumbers(128 * 20) + PartCoverText2, + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 2L))); + ItemList.Electric_Pump_HV.set(addItem( + 612, + "Electric Pump (HV)", + GT_Utility.formatNumbers(512) + PartCoverText + GT_Utility.formatNumbers(512 * 20) + PartCoverText2, + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 4L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 4L))); + ItemList.Electric_Pump_EV.set(addItem( + 613, + "Electric Pump (EV)", + GT_Utility.formatNumbers(2048) + PartCoverText + GT_Utility.formatNumbers(2048 * 20) + PartCoverText2, + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 8L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 8L))); + ItemList.Electric_Pump_IV.set(addItem( + 614, + "Electric Pump (IV)", + GT_Utility.formatNumbers(8192) + PartCoverText + GT_Utility.formatNumbers(8192 * 20) + PartCoverText2, + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 16L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 16L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 16L))); + ItemList.Electric_Pump_LuV.set(addItem( + 615, + "Electric Pump (LuV)", + GT_Utility.formatNumbers(32768) + PartCoverText + GT_Utility.formatNumbers(32768 * 20) + PartCoverText2, + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 32L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 32L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 32L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 32L))); + ItemList.Electric_Pump_ZPM.set(addItem( + 616, + "Electric Pump (ZPM)", + GT_Utility.formatNumbers(131072) + + PartCoverText + + GT_Utility.formatNumbers(131072 * 20) + + PartCoverText2, + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 64L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 64L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 64L))); + ItemList.Electric_Pump_UV.set(addItem( + 617, + "Electric Pump (UV)", + GT_Utility.formatNumbers(524288) + + PartCoverText + + GT_Utility.formatNumbers(524288 * 20) + + PartCoverText2, + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 128L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 128L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 128L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 128L))); + ItemList.Electric_Pump_UHV.set(addItem( + 618, + "Electric Pump (UHV)", + GT_Utility.formatNumbers(1048576) + + PartCoverText + + GT_Utility.formatNumbers(1048576 * 20) + + PartCoverText2, + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 256L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 256L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 256L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 256L))); + ItemList.Electric_Pump_UEV.set(addItem( + 619, + "Electric Pump (UEV)", + GT_Utility.formatNumbers(2097152) + + PartCoverText + + GT_Utility.formatNumbers(2097152 * 20) + + PartCoverText2, + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 512L))); + ItemList.Electric_Pump_UIV.set(addItem( + 25, + "Electric Pump (UIV)", + PartNotCoverText, + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 512L))); + ItemList.Electric_Pump_UMV.set(addItem( + 26, + "Electric Pump (UMV)", + PartNotCoverText, + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 512L))); + ItemList.Electric_Pump_UXV.set(addItem( + 27, + "Electric Pump (UXV)", + PartNotCoverText, + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 512L))); + ItemList.Electric_Pump_MAX.set(addItem( + 28, + "Electric Pump (MAX)", + PartNotCoverText, + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 512L))); + + GregTech_API.registerCover( + ItemList.Electric_Pump_LV.get(1L), + TextureFactory.of(MACHINE_CASINGS[1][0], TextureFactory.of(OVERLAY_PUMP)), + new GT_Cover_Pump(32)); + GregTech_API.registerCover( + ItemList.Electric_Pump_MV.get(1L), + TextureFactory.of(MACHINE_CASINGS[2][0], TextureFactory.of(OVERLAY_PUMP)), + new GT_Cover_Pump(128)); + GregTech_API.registerCover( + ItemList.Electric_Pump_HV.get(1L), + TextureFactory.of(MACHINE_CASINGS[3][0], TextureFactory.of(OVERLAY_PUMP)), + new GT_Cover_Pump(512)); + GregTech_API.registerCover( + ItemList.Electric_Pump_EV.get(1L), + TextureFactory.of(MACHINE_CASINGS[4][0], TextureFactory.of(OVERLAY_PUMP)), + new GT_Cover_Pump(2048)); + GregTech_API.registerCover( + ItemList.Electric_Pump_IV.get(1L), + TextureFactory.of(MACHINE_CASINGS[5][0], TextureFactory.of(OVERLAY_PUMP)), + new GT_Cover_Pump(8192)); + GregTech_API.registerCover( + ItemList.Electric_Pump_LuV.get(1L), + TextureFactory.of(MACHINE_CASINGS[6][0], TextureFactory.of(OVERLAY_PUMP)), + new GT_Cover_Pump(32768)); + GregTech_API.registerCover( + ItemList.Electric_Pump_ZPM.get(1L), + TextureFactory.of(MACHINE_CASINGS[7][0], TextureFactory.of(OVERLAY_PUMP)), + new GT_Cover_Pump(131072)); + GregTech_API.registerCover( + ItemList.Electric_Pump_UV.get(1L), + TextureFactory.of(MACHINE_CASINGS[8][0], TextureFactory.of(OVERLAY_PUMP)), + new GT_Cover_Pump(524288)); + GregTech_API.registerCover( + ItemList.Electric_Pump_UHV.get(1L), + TextureFactory.of(MACHINE_CASINGS[9][0], TextureFactory.of(OVERLAY_PUMP)), + new GT_Cover_Pump(1048576)); + GregTech_API.registerCover( + ItemList.Electric_Pump_UEV.get(1L), + TextureFactory.of(MACHINE_CASINGS[10][0], TextureFactory.of(OVERLAY_PUMP)), + new GT_Cover_Pump(2097152)); + + GT_ModHandler.addCraftingRecipe( + ItemList.Electric_Pump_LV.get(1L), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + "SXO", + "dPw", + "OMW", + 'M', + ItemList.Electric_Motor_LV, + 'O', + OrePrefixes.ring.get(Materials.AnyRubber), + 'X', + OrePrefixes.rotor.get(Materials.Tin), + 'S', + OrePrefixes.screw.get(Materials.Tin), + 'W', + OrePrefixes.cableGt01.get(Materials.Tin), + 'P', + OrePrefixes.pipeMedium.get(Materials.Bronze) + }); + GT_ModHandler.addCraftingRecipe( + ItemList.Electric_Pump_MV.get(1L), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + "SXO", + "dPw", + "OMW", + 'M', + ItemList.Electric_Motor_MV, + 'O', + OrePrefixes.ring.get(Materials.AnyRubber), + 'X', + OrePrefixes.rotor.get(Materials.Bronze), + 'S', + OrePrefixes.screw.get(Materials.Bronze), + 'W', + OrePrefixes.cableGt01.get(Materials.AnyCopper), + 'P', + OrePrefixes.pipeMedium.get(Materials.Steel) + }); + GT_ModHandler.addCraftingRecipe( + ItemList.Electric_Pump_HV.get(1L), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + "SXO", + "dPw", + "OMW", + 'M', + ItemList.Electric_Motor_HV, + 'O', + OrePrefixes.ring.get(Materials.AnyRubber), + 'X', + OrePrefixes.rotor.get(Materials.Steel), + 'S', + OrePrefixes.screw.get(Materials.Steel), + 'W', + OrePrefixes.cableGt01.get(Materials.Gold), + 'P', + OrePrefixes.pipeMedium.get(Materials.StainlessSteel) + }); + GT_ModHandler.addCraftingRecipe( + ItemList.Electric_Pump_EV.get(1L), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + "SXO", + "dPw", + "OMW", + 'M', + ItemList.Electric_Motor_EV, + 'O', + OrePrefixes.ring.get(Materials.AnyRubber), + 'X', + OrePrefixes.rotor.get(Materials.StainlessSteel), + 'S', + OrePrefixes.screw.get(Materials.StainlessSteel), + 'W', + OrePrefixes.cableGt01.get(Materials.Aluminium), + 'P', + OrePrefixes.pipeMedium.get(Materials.Titanium) + }); + GT_ModHandler.addCraftingRecipe( + ItemList.Electric_Pump_IV.get(1L), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + "SXO", + "dPw", + "OMW", + 'M', + ItemList.Electric_Motor_IV, + 'O', + OrePrefixes.ring.get(Materials.AnySyntheticRubber), + 'X', + OrePrefixes.rotor.get(Materials.TungstenSteel), + 'S', + OrePrefixes.screw.get(Materials.TungstenSteel), + 'W', + OrePrefixes.cableGt01.get(Materials.Tungsten), + 'P', + OrePrefixes.pipeMedium.get(Materials.TungstenSteel) + }); + + ItemList.Steam_Valve_LV.set(addItem( + 620, + "Steam Valve (LV)", + GT_Utility.formatNumbers(1024) + PartCoverText + GT_Utility.formatNumbers(1024 * 20) + PartCoverText2, + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L))); + ItemList.Steam_Valve_MV.set(addItem( + 621, + "Steam Valve (MV)", + GT_Utility.formatNumbers(2048) + PartCoverText + GT_Utility.formatNumbers(2048 * 20) + PartCoverText2, + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 2L))); + ItemList.Steam_Valve_HV.set(addItem( + 622, + "Steam Valve (HV)", + GT_Utility.formatNumbers(4096) + PartCoverText + GT_Utility.formatNumbers(4096 * 20) + PartCoverText2, + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 4L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 4L))); + ItemList.Steam_Valve_EV.set(addItem( + 623, + "Steam Valve (EV)", + GT_Utility.formatNumbers(8192) + PartCoverText + GT_Utility.formatNumbers(8192 * 20) + PartCoverText2, + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 8L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 8L))); + ItemList.Steam_Valve_IV.set(addItem( + 624, + "Steam Valve (IV)", + GT_Utility.formatNumbers(16384) + PartCoverText + GT_Utility.formatNumbers(16384 * 20) + PartCoverText2, + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 16L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 16L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 16L))); + + GregTech_API.registerCover( + ItemList.Steam_Valve_LV.get(1L), + TextureFactory.of(MACHINE_CASINGS[1][0], TextureFactory.of(OVERLAY_VALVE)), + new GT_Cover_SteamValve(1024)); + GregTech_API.registerCover( + ItemList.Steam_Valve_MV.get(1L), + TextureFactory.of(MACHINE_CASINGS[2][0], TextureFactory.of(OVERLAY_VALVE)), + new GT_Cover_SteamValve(2048)); + GregTech_API.registerCover( + ItemList.Steam_Valve_HV.get(1L), + TextureFactory.of(MACHINE_CASINGS[3][0], TextureFactory.of(OVERLAY_VALVE)), + new GT_Cover_SteamValve(4096)); + GregTech_API.registerCover( + ItemList.Steam_Valve_EV.get(1L), + TextureFactory.of(MACHINE_CASINGS[4][0], TextureFactory.of(OVERLAY_VALVE)), + new GT_Cover_SteamValve(8192)); + GregTech_API.registerCover( + ItemList.Steam_Valve_IV.get(1L), + TextureFactory.of(MACHINE_CASINGS[5][0], TextureFactory.of(OVERLAY_VALVE)), + new GT_Cover_SteamValve(16384)); + + ItemList.FluidRegulator_LV.set( + addItem(tLastID = 660, "Fluid Regulator (LV)", FRText1 + GT_Utility.formatNumbers(640) + FRText2)); + ItemList.FluidRegulator_MV.set( + addItem(tLastID = 661, "Fluid Regulator (MV)", FRText1 + GT_Utility.formatNumbers(2560) + FRText2)); + ItemList.FluidRegulator_HV.set( + addItem(tLastID = 662, "Fluid Regulator (HV)", FRText1 + GT_Utility.formatNumbers(10240) + FRText2)); + ItemList.FluidRegulator_EV.set( + addItem(tLastID = 663, "Fluid Regulator (EV)", FRText1 + GT_Utility.formatNumbers(40960) + FRText2)); + ItemList.FluidRegulator_IV.set( + addItem(tLastID = 664, "Fluid Regulator (IV)", FRText1 + GT_Utility.formatNumbers(163840) + FRText2)); + ItemList.FluidRegulator_LuV.set( + addItem(tLastID = 665, "Fluid Regulator (LuV)", FRText1 + GT_Utility.formatNumbers(655360) + FRText2)); + ItemList.FluidRegulator_ZPM.set( + addItem(tLastID = 666, "Fluid Regulator (ZPM)", FRText1 + GT_Utility.formatNumbers(2621440) + FRText2)); + ItemList.FluidRegulator_UV.set( + addItem(tLastID = 667, "Fluid Regulator (UV)", FRText1 + GT_Utility.formatNumbers(10485760) + FRText2)); + + GregTech_API.registerCover( + ItemList.FluidRegulator_LV.get(1L), + TextureFactory.of(MACHINE_CASINGS[1][0], TextureFactory.of(OVERLAY_PUMP)), + new GT_Cover_FluidRegulator(32)); + GregTech_API.registerCover( + ItemList.FluidRegulator_MV.get(1L), + TextureFactory.of(MACHINE_CASINGS[2][0], TextureFactory.of(OVERLAY_PUMP)), + new GT_Cover_FluidRegulator(128)); + GregTech_API.registerCover( + ItemList.FluidRegulator_HV.get(1L), + TextureFactory.of(MACHINE_CASINGS[3][0], TextureFactory.of(OVERLAY_PUMP)), + new GT_Cover_FluidRegulator(512)); + GregTech_API.registerCover( + ItemList.FluidRegulator_EV.get(1L), + TextureFactory.of(MACHINE_CASINGS[4][0], TextureFactory.of(OVERLAY_PUMP)), + new GT_Cover_FluidRegulator(2048)); + GregTech_API.registerCover( + ItemList.FluidRegulator_IV.get(1L), + TextureFactory.of(MACHINE_CASINGS[5][0], TextureFactory.of(OVERLAY_PUMP)), + new GT_Cover_FluidRegulator(8192)); + GregTech_API.registerCover( + ItemList.FluidRegulator_LuV.get(1L), + TextureFactory.of(MACHINE_CASINGS[6][0], TextureFactory.of(OVERLAY_PUMP)), + new GT_Cover_FluidRegulator(32768)); + GregTech_API.registerCover( + ItemList.FluidRegulator_ZPM.get(1L), + TextureFactory.of(MACHINE_CASINGS[7][0], TextureFactory.of(OVERLAY_PUMP)), + new GT_Cover_FluidRegulator(131072)); + GregTech_API.registerCover( + ItemList.FluidRegulator_UV.get(1L), + TextureFactory.of(MACHINE_CASINGS[8][0], TextureFactory.of(OVERLAY_PUMP)), + new GT_Cover_FluidRegulator(524288)); + + ItemList.FluidFilter.set( + addItem(669, "Fluid Filter Cover", "Set with Fluid Container to only accept one Fluid Type")); + GregTech_API.registerCover( + ItemList.FluidFilter.get(1L), + TextureFactory.of(MACHINE_CASINGS[1][0], TextureFactory.of(OVERLAY_SHUTTER)), + new GT_Cover_Fluidfilter()); + ItemList.ItemFilter_Export.set(addItem( + 270, + "Item Filter Cover (Export)", + "Right click with an item to set filter (Only supports Export Mode)")); + GregTech_API.registerCover( + ItemList.ItemFilter_Export.get(1L), + TextureFactory.of(MACHINE_CASINGS[5][0], TextureFactory.of(OVERLAY_CONVEYOR)), + new GT_Cover_ItemFilter(true)); + ItemList.ItemFilter_Import.set(addItem( + 271, + "Item Filter Cover (Import)", + "Right click with an item to set filter (Only supports Import Mode)")); + GregTech_API.registerCover( + ItemList.ItemFilter_Import.get(1L), + TextureFactory.of(MACHINE_CASINGS[5][0], TextureFactory.of(OVERLAY_CONVEYOR)), + new GT_Cover_ItemFilter(false)); + ItemList.Cover_FluidLimiter.set( + addItem(272, "Fluid Limiter Cover", "Limits fluid input depending on fill level")); + GregTech_API.registerCover( + ItemList.Cover_FluidLimiter.get(1L), + TextureFactory.of(MACHINE_CASINGS[1][0], TextureFactory.of(OVERLAY_SHUTTER)), + new GT_Cover_FluidLimiter()); + + ItemList.Conveyor_Module_LV.set(addItem( + 630, + "Conveyor Module (LV)", + "1 stack every 20 secs (as Cover)", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 1L))); + ItemList.Conveyor_Module_MV.set(addItem( + 631, + "Conveyor Module (MV)", + "1 stack every 5 secs (as Cover)", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 2L))); + ItemList.Conveyor_Module_HV.set(addItem( + 632, + "Conveyor Module (HV)", + "1 stack every 1 sec (as Cover)", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 4L))); + ItemList.Conveyor_Module_EV.set(addItem( + 633, + "Conveyor Module (EV)", + "1 stack every 1/5 sec (as Cover)", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 8L))); + ItemList.Conveyor_Module_IV.set(addItem( + 634, + "Conveyor Module (IV)", + "1 stack every 1/20 sec (as Cover)", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 16L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 16L))); + ItemList.Conveyor_Module_LuV.set(addItem( + 635, + "Conveyor Module (LuV)", + "2 stacks every 1/20 sec (as Cover)", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 32L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 32L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 32L))); + ItemList.Conveyor_Module_ZPM.set(addItem( + 636, + "Conveyor Module (ZPM)", + "4 stacks every 1/20 sec (as Cover)", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 64L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 64L))); + ItemList.Conveyor_Module_UV.set(addItem( + 637, + "Conveyor Module (UV)", + "8 stacks every 1/20 sec (as Cover)", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 128L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 128L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 128L))); + ItemList.Conveyor_Module_UHV.set(addItem( + 638, + "Conveyor Module (UHV)", + "16 stacks every 1/20 sec (as Cover)", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 256L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 256L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 256L))); + ItemList.Conveyor_Module_UEV.set(addItem( + 639, + "Conveyor Module (UEV)", + "32 stacks every 1/20 sec (as Cover)", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 512L))); + ItemList.Conveyor_Module_UIV.set(addItem( + 29, + "Conveyor Module (UIV)", + PartNotCoverText, + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 512L))); + ItemList.Conveyor_Module_UMV.set(addItem( + 30, + "Conveyor Module (UMV)", + PartNotCoverText, + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 512L))); + ItemList.Conveyor_Module_UXV.set(addItem( + 31, + "Conveyor Module (UXV)", + PartNotCoverText, + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 512L))); + ItemList.Conveyor_Module_MAX.set(addItem( + 32, + "Conveyor Module (MAX)", + PartNotCoverText, + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 512L))); + + GT_ModHandler.addCraftingRecipe( + ItemList.Conveyor_Module_LV.get(1L), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + "RRR", + "MCM", + "RRR", + 'M', + ItemList.Electric_Motor_LV, + 'C', + OrePrefixes.cableGt01.get(Materials.Tin), + 'R', + OrePrefixes.plate.get(Materials.AnyRubber) + }); + GT_ModHandler.addCraftingRecipe( + ItemList.Conveyor_Module_MV.get(1L), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + "RRR", + "MCM", + "RRR", + 'M', + ItemList.Electric_Motor_MV, + 'C', + OrePrefixes.cableGt01.get(Materials.AnyCopper), + 'R', + OrePrefixes.plate.get(Materials.AnyRubber) + }); + GT_ModHandler.addCraftingRecipe( + ItemList.Conveyor_Module_HV.get(1L), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + "RRR", + "MCM", + "RRR", + 'M', + ItemList.Electric_Motor_HV, + 'C', + OrePrefixes.cableGt01.get(Materials.Gold), + 'R', + OrePrefixes.plate.get(Materials.AnyRubber) + }); + GT_ModHandler.addCraftingRecipe( + ItemList.Conveyor_Module_EV.get(1L), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + "RRR", + "MCM", + "RRR", + 'M', + ItemList.Electric_Motor_EV, + 'C', + OrePrefixes.cableGt01.get(Materials.Aluminium), + 'R', + OrePrefixes.plate.get(Materials.AnyRubber) + }); + GT_ModHandler.addCraftingRecipe( + ItemList.Conveyor_Module_IV.get(1L), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + "RRR", + "MCM", + "RRR", + 'M', + ItemList.Electric_Motor_IV, + 'C', + OrePrefixes.cableGt01.get(Materials.Tungsten), + 'R', + OrePrefixes.plate.get(Materials.AnySyntheticRubber) + }); + + GregTech_API.registerCover( + ItemList.Conveyor_Module_LV.get(1L), + TextureFactory.of(MACHINE_CASINGS[1][0], TextureFactory.of(OVERLAY_CONVEYOR)), + new GT_Cover_Conveyor(400, 1)); + GregTech_API.registerCover( + ItemList.Conveyor_Module_MV.get(1L), + TextureFactory.of(MACHINE_CASINGS[2][0], TextureFactory.of(OVERLAY_CONVEYOR)), + new GT_Cover_Conveyor(100, 1)); + GregTech_API.registerCover( + ItemList.Conveyor_Module_HV.get(1L), + TextureFactory.of(MACHINE_CASINGS[3][0], TextureFactory.of(OVERLAY_CONVEYOR)), + new GT_Cover_Conveyor(20, 1)); + GregTech_API.registerCover( + ItemList.Conveyor_Module_EV.get(1L), + TextureFactory.of(MACHINE_CASINGS[4][0], TextureFactory.of(OVERLAY_CONVEYOR)), + new GT_Cover_Conveyor(4, 1)); + GregTech_API.registerCover( + ItemList.Conveyor_Module_IV.get(1L), + TextureFactory.of(MACHINE_CASINGS[5][0], TextureFactory.of(OVERLAY_CONVEYOR)), + new GT_Cover_Conveyor(1, 1)); + GregTech_API.registerCover( + ItemList.Conveyor_Module_LuV.get(1L), + TextureFactory.of(MACHINE_CASINGS[6][0], TextureFactory.of(OVERLAY_CONVEYOR)), + new GT_Cover_Conveyor(1, 2)); + GregTech_API.registerCover( + ItemList.Conveyor_Module_ZPM.get(1L), + TextureFactory.of(MACHINE_CASINGS[7][0], TextureFactory.of(OVERLAY_CONVEYOR)), + new GT_Cover_Conveyor(1, 4)); + GregTech_API.registerCover( + ItemList.Conveyor_Module_UV.get(1L), + TextureFactory.of(MACHINE_CASINGS[8][0], TextureFactory.of(OVERLAY_CONVEYOR)), + new GT_Cover_Conveyor(1, 8)); + GregTech_API.registerCover( + ItemList.Conveyor_Module_UHV.get(1L), + TextureFactory.of(MACHINE_CASINGS[9][0], TextureFactory.of(OVERLAY_CONVEYOR)), + new GT_Cover_Conveyor(1, 16)); + GregTech_API.registerCover( + ItemList.Conveyor_Module_UEV.get(1L), + TextureFactory.of(MACHINE_CASINGS[10][0], TextureFactory.of(OVERLAY_CONVEYOR)), + new GT_Cover_Conveyor(1, 32)); + + ItemList.Robot_Arm_LV.set(addItem( + 650, + "Robot Arm (LV)", + "1 stack every 20 secs (as Cover)/n " + RAText, + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 1L))); + ItemList.Robot_Arm_MV.set(addItem( + 651, + "Robot Arm (MV)", + "1 stack every 5 secs (as Cover)/n " + RAText, + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 2L))); + ItemList.Robot_Arm_HV.set(addItem( + 652, + "Robot Arm (HV)", + "1 stack every 1 sec (as Cover)/n " + RAText, + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 4L), + new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 4L))); + ItemList.Robot_Arm_EV.set(addItem( + 653, + "Robot Arm (EV)", + "1 stack every 1/5 sec (as Cover)/n " + RAText, + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 16L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 8L), + new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 8L))); + ItemList.Robot_Arm_IV.set(addItem( + 654, + "Robot Arm (IV)", + "1 stack every 1/20 sec (as Cover)/n " + RAText, + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 32L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 16L), + new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 16L))); + ItemList.Robot_Arm_LuV.set(addItem( + 655, + "Robot Arm (LuV)", + PartNotCoverText, + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 32L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 64L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 32L), + new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 32L))); + ItemList.Robot_Arm_ZPM.set(addItem( + 656, + "Robot Arm (ZPM)", + PartNotCoverText, + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 128L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 64L), + new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 64L))); + ItemList.Robot_Arm_UV.set(addItem( + 657, + "Robot Arm (UV)", + PartNotCoverText, + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 128L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 256L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 128L), + new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 128L))); + ItemList.Robot_Arm_UHV.set(addItem( + 658, + "Robot Arm (UHV)", + PartNotCoverText, + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 256L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 256L), + new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 256L))); + ItemList.Robot_Arm_UEV.set(addItem( + 659, + "Robot Arm (UEV)", + PartNotCoverText, + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1024L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 512L))); + ItemList.Robot_Arm_UIV.set(addItem( + 33, + "Robot Arm (UIV)", + PartNotCoverText, + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1024L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 512L))); + ItemList.Robot_Arm_UMV.set(addItem( + 34, + "Robot Arm (UMV)", + PartNotCoverText, + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1024L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 512L))); + ItemList.Robot_Arm_UXV.set(addItem( + 35, + "Robot Arm (UXV)", + PartNotCoverText, + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1024L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 512L))); + ItemList.Robot_Arm_MAX.set(addItem( + 36, + "Robot Arm (MAX)", + PartNotCoverText, + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1024L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 512L))); + + GT_ModHandler.addCraftingRecipe( + ItemList.Robot_Arm_LV.get(1L), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + "CCC", + "MSM", + "PES", + 'S', + OrePrefixes.stick.get(Materials.Steel), + 'M', + ItemList.Electric_Motor_LV, + 'P', + ItemList.Electric_Piston_LV, + 'E', + OrePrefixes.circuit.get(Materials.Basic), + 'C', + OrePrefixes.cableGt01.get(Materials.Tin) + }); + GT_ModHandler.addCraftingRecipe( + ItemList.Robot_Arm_MV.get(1L), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + "CCC", + "MSM", + "PES", + 'S', + OrePrefixes.stick.get(Materials.Aluminium), + 'M', + ItemList.Electric_Motor_MV, + 'P', + ItemList.Electric_Piston_MV, + 'E', + OrePrefixes.circuit.get(Materials.Good), + 'C', + OrePrefixes.cableGt01.get(Materials.AnyCopper) + }); + GT_ModHandler.addCraftingRecipe( + ItemList.Robot_Arm_HV.get(1L), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + "CCC", + "MSM", + "PES", + 'S', + OrePrefixes.stick.get(Materials.StainlessSteel), + 'M', + ItemList.Electric_Motor_HV, + 'P', + ItemList.Electric_Piston_HV, + 'E', + OrePrefixes.circuit.get(Materials.Advanced), + 'C', + OrePrefixes.cableGt01.get(Materials.Gold) + }); + GT_ModHandler.addCraftingRecipe( + ItemList.Robot_Arm_EV.get(1L), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + "CCC", + "MSM", + "PES", + 'S', + OrePrefixes.stick.get(Materials.Titanium), + 'M', + ItemList.Electric_Motor_EV, + 'P', + ItemList.Electric_Piston_EV, + 'E', + OrePrefixes.circuit.get(Materials.Data), + 'C', + OrePrefixes.cableGt01.get(Materials.Aluminium) + }); + GT_ModHandler.addCraftingRecipe( + ItemList.Robot_Arm_IV.get(1L), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + "CCC", + "MSM", + "PES", + 'S', + OrePrefixes.stick.get(Materials.TungstenSteel), + 'M', + ItemList.Electric_Motor_IV, + 'P', + ItemList.Electric_Piston_IV, + 'E', + OrePrefixes.circuit.get(Materials.Elite), + 'C', + OrePrefixes.cableGt01.get(Materials.Tungsten) + }); + + GregTech_API.registerCover( + ItemList.Robot_Arm_LV.get(1L), + TextureFactory.of(MACHINE_CASINGS[1][0], TextureFactory.of(OVERLAY_ARM)), + new GT_Cover_Arm(400)); + GregTech_API.registerCover( + ItemList.Robot_Arm_MV.get(1L), + TextureFactory.of(MACHINE_CASINGS[2][0], TextureFactory.of(OVERLAY_ARM)), + new GT_Cover_Arm(100)); + GregTech_API.registerCover( + ItemList.Robot_Arm_HV.get(1L), + TextureFactory.of(MACHINE_CASINGS[3][0], TextureFactory.of(OVERLAY_ARM)), + new GT_Cover_Arm(20)); + GregTech_API.registerCover( + ItemList.Robot_Arm_EV.get(1L), + TextureFactory.of(MACHINE_CASINGS[4][0], TextureFactory.of(OVERLAY_ARM)), + new GT_Cover_Arm(4)); + GregTech_API.registerCover( + ItemList.Robot_Arm_IV.get(1L), + TextureFactory.of(MACHINE_CASINGS[5][0], TextureFactory.of(OVERLAY_ARM)), + new GT_Cover_Arm(1)); ItemList.QuantumEye.set(addItem(tLastID = 724, "Quantum Eye", "Improved Ender Eye")); ItemList.QuantumStar.set(addItem(tLastID = 725, "Quantum Star", "Improved Nether Star")); ItemList.Gravistar.set(addItem(tLastID = 726, "Gravi Star", "Ultimate Nether Star")); - ItemList.Emitter_LV.set(addItem(680, "Emitter (LV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 1L))); - ItemList.Emitter_MV.set(addItem(681, "Emitter (MV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 2L))); - ItemList.Emitter_HV.set(addItem(682, "Emitter (HV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 4L))); - ItemList.Emitter_EV.set(addItem(683, "Emitter (EV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 8L))); - ItemList.Emitter_IV.set(addItem(684, "Emitter (IV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 16L))); - ItemList.Emitter_LuV.set(addItem(685, "Emitter (LuV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 32L))); - ItemList.Emitter_ZPM.set(addItem(686, "Emitter (ZPM)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 64L))); - ItemList.Emitter_UV.set(addItem(687, "Emitter (UV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 128L))); - ItemList.Emitter_UHV.set(addItem(688, "Emitter (UHV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 256L))); - ItemList.Emitter_UEV.set(addItem(689, "Emitter (UEV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 512L))); - ItemList.Emitter_UIV.set(addItem(37, "Emitter (UIV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 512L))); - ItemList.Emitter_UMV.set(addItem(38, "Emitter (UMV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 512L))); - ItemList.Emitter_UXV.set(addItem(39, "Emitter (UXV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 512L))); - ItemList.Emitter_MAX.set(addItem(40, "Emitter (MAX)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 512L))); - - GT_ModHandler.addCraftingRecipe(ItemList.Emitter_LV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SSC", "WQS", "CWS", 'Q', OrePrefixes.gem.get(Materials.CertusQuartz), 'S', OrePrefixes.stick.get(Materials.Brass), 'C', OrePrefixes.circuit.get(Materials.Basic), 'W', OrePrefixes.cableGt01.get(Materials.Tin)}); - GT_ModHandler.addCraftingRecipe(ItemList.Emitter_MV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SSC", "WQS", "CWS", 'Q', OrePrefixes.gem.get(Materials.EnderPearl), 'S', OrePrefixes.stick.get(Materials.Electrum), 'C', OrePrefixes.circuit.get(Materials.Good), 'W', OrePrefixes.cableGt01.get(Materials.AnyCopper)}); - GT_ModHandler.addCraftingRecipe(ItemList.Emitter_HV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SSC", "WQS", "CWS", 'Q', OrePrefixes.gem.get(Materials.EnderEye), 'S', OrePrefixes.stick.get(Materials.Chrome), 'C', OrePrefixes.circuit.get(Materials.Advanced), 'W', OrePrefixes.cableGt01.get(Materials.Gold)}); - GT_ModHandler.addCraftingRecipe(ItemList.Emitter_EV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SSC", "WQS", "CWS", 'Q', ItemList.QuantumEye, 'S', OrePrefixes.stick.get(Materials.Platinum), 'C', OrePrefixes.circuit.get(Materials.Data), 'W', OrePrefixes.cableGt01.get(Materials.Aluminium)}); - GT_ModHandler.addCraftingRecipe(ItemList.Emitter_IV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SSC", "WQS", "CWS", 'Q', ItemList.QuantumStar, 'S', OrePrefixes.stick.get(Materials.Iridium), 'C', OrePrefixes.circuit.get(Materials.Elite), 'W', OrePrefixes.cableGt01.get(Materials.Tungsten)}); - - ItemList.Sensor_LV.set(addItem(690, "Sensor (LV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 1L))); - ItemList.Sensor_MV.set(addItem(691, "Sensor (MV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 2L))); - ItemList.Sensor_HV.set(addItem(692, "Sensor (HV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 4L))); - ItemList.Sensor_EV.set(addItem(693, "Sensor (EV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 8L))); - ItemList.Sensor_IV.set(addItem(694, "Sensor (IV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 16L))); - ItemList.Sensor_LuV.set(addItem(695, "Sensor (LuV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 32L))); - ItemList.Sensor_ZPM.set(addItem(696, "Sensor (ZPM)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 64L))); - ItemList.Sensor_UV.set(addItem(697, "Sensor (UV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 128L))); - ItemList.Sensor_UHV.set(addItem(698, "Sensor (UHV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 256L))); - ItemList.Sensor_UEV.set(addItem(699, "Sensor (UEV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 512L))); - ItemList.Sensor_UIV.set(addItem(41, "Sensor (UIV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 512L))); - ItemList.Sensor_UMV.set(addItem(42, "Sensor (UMV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 512L))); - ItemList.Sensor_UXV.set(addItem(43, "Sensor (UXV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 512L))); - ItemList.Sensor_MAX.set(addItem(44, "Sensor (MAX)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 512L))); - - GT_ModHandler.addCraftingRecipe(ItemList.Sensor_LV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"P Q", "PS ", "CPP", 'Q', OrePrefixes.gem.get(Materials.CertusQuartz), 'S', OrePrefixes.stick.get(Materials.Brass), 'P', OrePrefixes.plate.get(Materials.Steel), 'C', OrePrefixes.circuit.get(Materials.Basic)}); - GT_ModHandler.addCraftingRecipe(ItemList.Sensor_MV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"P Q", "PS ", "CPP", 'Q', OrePrefixes.gemFlawless.get(Materials.Emerald), 'S', OrePrefixes.stick.get(Materials.Electrum), 'P', OrePrefixes.plate.get(Materials.Aluminium), 'C', OrePrefixes.circuit.get(Materials.Good)}); - GT_ModHandler.addCraftingRecipe(ItemList.Sensor_HV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"P Q", "PS ", "CPP", 'Q', OrePrefixes.gem.get(Materials.EnderEye), 'S', OrePrefixes.stick.get(Materials.Chrome), 'P', OrePrefixes.plate.get(Materials.StainlessSteel), 'C', OrePrefixes.circuit.get(Materials.Advanced)}); - GT_ModHandler.addCraftingRecipe(ItemList.Sensor_EV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"P Q", "PS ", "CPP", 'Q', ItemList.QuantumEye, 'S', OrePrefixes.stick.get(Materials.Platinum), 'P', OrePrefixes.plate.get(Materials.Titanium), 'C', OrePrefixes.circuit.get(Materials.Data)}); - GT_ModHandler.addCraftingRecipe(ItemList.Sensor_IV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"P Q", "PS ", "CPP", 'Q', ItemList.QuantumStar, 'S', OrePrefixes.stick.get(Materials.Iridium), 'P', OrePrefixes.plate.get(Materials.TungstenSteel), 'C', OrePrefixes.circuit.get(Materials.Elite)}); - - ItemList.Field_Generator_LV.set(addItem(670, "Field Generator (LV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 1L))); - ItemList.Field_Generator_MV.set(addItem(671, "Field Generator (MV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 2L))); - ItemList.Field_Generator_HV.set(addItem(672, "Field Generator (HV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 4L))); - ItemList.Field_Generator_EV.set(addItem(673, "Field Generator (EV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 8L))); - ItemList.Field_Generator_IV.set(addItem(674, "Field Generator (IV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 16L))); - ItemList.Field_Generator_LuV.set(addItem(675, "Field Generator (LuV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 32L))); - ItemList.Field_Generator_ZPM.set(addItem(676, "Field Generator (ZPM)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 64L))); - ItemList.Field_Generator_UV.set(addItem(677, "Field Generator (UV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 128L))); - ItemList.Field_Generator_UHV.set(addItem(678, "Field Generator (UHV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 256L))); - ItemList.Field_Generator_UEV.set(addItem(679, "Field Generator (UEV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1024L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 512L))); - ItemList.Field_Generator_UIV.set(addItem(45, "Field Generator (UIV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1024L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 512L))); - ItemList.Field_Generator_UMV.set(addItem(46, "Field Generator (UMV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1024L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 512L))); - ItemList.Field_Generator_UXV.set(addItem(47, "Field Generator (UXV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1024L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 512L))); - ItemList.Field_Generator_MAX.set(addItem(48, "Field Generator (MAX)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1024L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 512L))); + ItemList.Emitter_LV.set(addItem( + 680, + "Emitter (LV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 1L))); + ItemList.Emitter_MV.set(addItem( + 681, + "Emitter (MV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 2L))); + ItemList.Emitter_HV.set(addItem( + 682, + "Emitter (HV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), + new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 4L))); + ItemList.Emitter_EV.set(addItem( + 683, + "Emitter (EV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), + new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 8L))); + ItemList.Emitter_IV.set(addItem( + 684, + "Emitter (IV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 16L), + new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 16L))); + ItemList.Emitter_LuV.set(addItem( + 685, + "Emitter (LuV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 32L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 32L), + new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 32L))); + ItemList.Emitter_ZPM.set(addItem( + 686, + "Emitter (ZPM)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 64L), + new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 64L))); + ItemList.Emitter_UV.set(addItem( + 687, + "Emitter (UV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 128L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 128L), + new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 128L))); + ItemList.Emitter_UHV.set(addItem( + 688, + "Emitter (UHV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 256L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 256L), + new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 256L))); + ItemList.Emitter_UEV.set(addItem( + 689, + "Emitter (UEV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 512L))); + ItemList.Emitter_UIV.set(addItem( + 37, + "Emitter (UIV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 512L))); + ItemList.Emitter_UMV.set(addItem( + 38, + "Emitter (UMV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 512L))); + ItemList.Emitter_UXV.set(addItem( + 39, + "Emitter (UXV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 512L))); + ItemList.Emitter_MAX.set(addItem( + 40, + "Emitter (MAX)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 512L))); + + GT_ModHandler.addCraftingRecipe( + ItemList.Emitter_LV.get(1L), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + "SSC", + "WQS", + "CWS", + 'Q', + OrePrefixes.gem.get(Materials.CertusQuartz), + 'S', + OrePrefixes.stick.get(Materials.Brass), + 'C', + OrePrefixes.circuit.get(Materials.Basic), + 'W', + OrePrefixes.cableGt01.get(Materials.Tin) + }); + GT_ModHandler.addCraftingRecipe( + ItemList.Emitter_MV.get(1L), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + "SSC", + "WQS", + "CWS", + 'Q', + OrePrefixes.gem.get(Materials.EnderPearl), + 'S', + OrePrefixes.stick.get(Materials.Electrum), + 'C', + OrePrefixes.circuit.get(Materials.Good), + 'W', + OrePrefixes.cableGt01.get(Materials.AnyCopper) + }); + GT_ModHandler.addCraftingRecipe( + ItemList.Emitter_HV.get(1L), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + "SSC", + "WQS", + "CWS", + 'Q', + OrePrefixes.gem.get(Materials.EnderEye), + 'S', + OrePrefixes.stick.get(Materials.Chrome), + 'C', + OrePrefixes.circuit.get(Materials.Advanced), + 'W', + OrePrefixes.cableGt01.get(Materials.Gold) + }); + GT_ModHandler.addCraftingRecipe( + ItemList.Emitter_EV.get(1L), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + "SSC", + "WQS", + "CWS", + 'Q', + ItemList.QuantumEye, + 'S', + OrePrefixes.stick.get(Materials.Platinum), + 'C', + OrePrefixes.circuit.get(Materials.Data), + 'W', + OrePrefixes.cableGt01.get(Materials.Aluminium) + }); + GT_ModHandler.addCraftingRecipe( + ItemList.Emitter_IV.get(1L), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + "SSC", + "WQS", + "CWS", + 'Q', + ItemList.QuantumStar, + 'S', + OrePrefixes.stick.get(Materials.Iridium), + 'C', + OrePrefixes.circuit.get(Materials.Elite), + 'W', + OrePrefixes.cableGt01.get(Materials.Tungsten) + }); + + ItemList.Sensor_LV.set(addItem( + 690, + "Sensor (LV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 1L))); + ItemList.Sensor_MV.set(addItem( + 691, + "Sensor (MV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 2L))); + ItemList.Sensor_HV.set(addItem( + 692, + "Sensor (HV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), + new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 4L))); + ItemList.Sensor_EV.set(addItem( + 693, + "Sensor (EV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), + new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 8L))); + ItemList.Sensor_IV.set(addItem( + 694, + "Sensor (IV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 16L), + new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 16L))); + ItemList.Sensor_LuV.set(addItem( + 695, + "Sensor (LuV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 32L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 32L), + new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 32L))); + ItemList.Sensor_ZPM.set(addItem( + 696, + "Sensor (ZPM)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 64L), + new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 64L))); + ItemList.Sensor_UV.set(addItem( + 697, + "Sensor (UV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 128L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 128L), + new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 128L))); + ItemList.Sensor_UHV.set(addItem( + 698, + "Sensor (UHV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 256L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 256L), + new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 256L))); + ItemList.Sensor_UEV.set(addItem( + 699, + "Sensor (UEV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 512L))); + ItemList.Sensor_UIV.set(addItem( + 41, + "Sensor (UIV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 512L))); + ItemList.Sensor_UMV.set(addItem( + 42, + "Sensor (UMV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 512L))); + ItemList.Sensor_UXV.set(addItem( + 43, + "Sensor (UXV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 512L))); + ItemList.Sensor_MAX.set(addItem( + 44, + "Sensor (MAX)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 512L))); + + GT_ModHandler.addCraftingRecipe( + ItemList.Sensor_LV.get(1L), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + "P Q", + "PS ", + "CPP", + 'Q', + OrePrefixes.gem.get(Materials.CertusQuartz), + 'S', + OrePrefixes.stick.get(Materials.Brass), + 'P', + OrePrefixes.plate.get(Materials.Steel), + 'C', + OrePrefixes.circuit.get(Materials.Basic) + }); + GT_ModHandler.addCraftingRecipe( + ItemList.Sensor_MV.get(1L), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + "P Q", + "PS ", + "CPP", + 'Q', + OrePrefixes.gemFlawless.get(Materials.Emerald), + 'S', + OrePrefixes.stick.get(Materials.Electrum), + 'P', + OrePrefixes.plate.get(Materials.Aluminium), + 'C', + OrePrefixes.circuit.get(Materials.Good) + }); + GT_ModHandler.addCraftingRecipe( + ItemList.Sensor_HV.get(1L), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + "P Q", + "PS ", + "CPP", + 'Q', + OrePrefixes.gem.get(Materials.EnderEye), + 'S', + OrePrefixes.stick.get(Materials.Chrome), + 'P', + OrePrefixes.plate.get(Materials.StainlessSteel), + 'C', + OrePrefixes.circuit.get(Materials.Advanced) + }); + GT_ModHandler.addCraftingRecipe( + ItemList.Sensor_EV.get(1L), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + "P Q", + "PS ", + "CPP", + 'Q', + ItemList.QuantumEye, + 'S', + OrePrefixes.stick.get(Materials.Platinum), + 'P', + OrePrefixes.plate.get(Materials.Titanium), + 'C', + OrePrefixes.circuit.get(Materials.Data) + }); + GT_ModHandler.addCraftingRecipe( + ItemList.Sensor_IV.get(1L), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + "P Q", + "PS ", + "CPP", + 'Q', + ItemList.QuantumStar, + 'S', + OrePrefixes.stick.get(Materials.Iridium), + 'P', + OrePrefixes.plate.get(Materials.TungstenSteel), + 'C', + OrePrefixes.circuit.get(Materials.Elite) + }); + + ItemList.Field_Generator_LV.set(addItem( + 670, + "Field Generator (LV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 1L))); + ItemList.Field_Generator_MV.set(addItem( + 671, + "Field Generator (MV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 2L))); + ItemList.Field_Generator_HV.set(addItem( + 672, + "Field Generator (HV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), + new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 4L))); + ItemList.Field_Generator_EV.set(addItem( + 673, + "Field Generator (EV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), + new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 8L))); + ItemList.Field_Generator_IV.set(addItem( + 674, + "Field Generator (IV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 32L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 16L), + new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 16L))); + ItemList.Field_Generator_LuV.set(addItem( + 675, + "Field Generator (LuV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 32L), + new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 32L))); + ItemList.Field_Generator_ZPM.set(addItem( + 676, + "Field Generator (ZPM)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 128L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 64L), + new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 64L))); + ItemList.Field_Generator_UV.set(addItem( + 677, + "Field Generator (UV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 256L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 128L), + new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 128L))); + ItemList.Field_Generator_UHV.set(addItem( + 678, + "Field Generator (UHV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 256L), + new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 256L))); + ItemList.Field_Generator_UEV.set(addItem( + 679, + "Field Generator (UEV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1024L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 512L))); + ItemList.Field_Generator_UIV.set(addItem( + 45, + "Field Generator (UIV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1024L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 512L))); + ItemList.Field_Generator_UMV.set(addItem( + 46, + "Field Generator (UMV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1024L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 512L))); + ItemList.Field_Generator_UXV.set(addItem( + 47, + "Field Generator (UXV)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1024L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 512L))); + ItemList.Field_Generator_MAX.set(addItem( + 48, + "Field Generator (MAX)", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1024L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 512L))); // Circuits ULV - LuV. - ItemList.Circuit_Primitive.set(addItem(tLastID = 700, "Vacuum Tube", "A very simple Circuit", OrePrefixes.circuit.get(Materials.Primitive), SubTag.NO_UNIFICATION)); - OreDictionary.registerOre("ULV" , ItemList.Circuit_Primitive.get(1)); - ItemList.Circuit_Basic.set(addItem(tLastID = 701, "Integrated Logic Circuit", "A Basic Circuit", OrePrefixes.circuit.get(Materials.Basic), SubTag.NO_UNIFICATION)); - OreDictionary.registerOre("LV" , ItemList.Circuit_Basic.get(1)); - ItemList.Circuit_Good.set(addItem(tLastID = 702, "Good Electronic Circuit", "A Good Circuit", OrePrefixes.circuit.get(Materials.Good), SubTag.NO_UNIFICATION)); - OreDictionary.registerOre("MV" , ItemList.Circuit_Good.get(1)); - ItemList.Circuit_Advanced.set(addItem(tLastID = 703, "Processor Assembly", "An Advanced Circuit", OrePrefixes.circuit.get(Materials.Advanced), SubTag.NO_UNIFICATION)); - OreDictionary.registerOre("HV" , ItemList.Circuit_Advanced.get(1)); - ItemList.Circuit_Data.set(addItem(tLastID = 704, "Workstation", "An Extreme Circuit", OrePrefixes.circuit.get(Materials.Data), SubTag.NO_UNIFICATION)); - OreDictionary.registerOre("EV" , ItemList.Circuit_Data.get(1)); - ItemList.Circuit_Elite.set(addItem(tLastID = 705, "Mainframe", "An Elite Circuit", OrePrefixes.circuit.get(Materials.Elite), SubTag.NO_UNIFICATION)); - OreDictionary.registerOre("IV" , ItemList.Circuit_Elite.get(1)); - ItemList.Circuit_Master.set(addItem(tLastID = 706, "Nanoprocessor Mainframe", "A Master Circuit", OrePrefixes.circuit.get(Materials.Master), SubTag.NO_UNIFICATION)); - OreDictionary.registerOre("LuV" , ItemList.Circuit_Master.get(1)); + ItemList.Circuit_Primitive.set(addItem( + tLastID = 700, + "Vacuum Tube", + "A very simple Circuit", + OrePrefixes.circuit.get(Materials.Primitive), + SubTag.NO_UNIFICATION)); + OreDictionary.registerOre("ULV", ItemList.Circuit_Primitive.get(1)); + ItemList.Circuit_Basic.set(addItem( + tLastID = 701, + "Integrated Logic Circuit", + "A Basic Circuit", + OrePrefixes.circuit.get(Materials.Basic), + SubTag.NO_UNIFICATION)); + OreDictionary.registerOre("LV", ItemList.Circuit_Basic.get(1)); + ItemList.Circuit_Good.set(addItem( + tLastID = 702, + "Good Electronic Circuit", + "A Good Circuit", + OrePrefixes.circuit.get(Materials.Good), + SubTag.NO_UNIFICATION)); + OreDictionary.registerOre("MV", ItemList.Circuit_Good.get(1)); + ItemList.Circuit_Advanced.set(addItem( + tLastID = 703, + "Processor Assembly", + "An Advanced Circuit", + OrePrefixes.circuit.get(Materials.Advanced), + SubTag.NO_UNIFICATION)); + OreDictionary.registerOre("HV", ItemList.Circuit_Advanced.get(1)); + ItemList.Circuit_Data.set(addItem( + tLastID = 704, + "Workstation", + "An Extreme Circuit", + OrePrefixes.circuit.get(Materials.Data), + SubTag.NO_UNIFICATION)); + OreDictionary.registerOre("EV", ItemList.Circuit_Data.get(1)); + ItemList.Circuit_Elite.set(addItem( + tLastID = 705, + "Mainframe", + "An Elite Circuit", + OrePrefixes.circuit.get(Materials.Elite), + SubTag.NO_UNIFICATION)); + OreDictionary.registerOre("IV", ItemList.Circuit_Elite.get(1)); + ItemList.Circuit_Master.set(addItem( + tLastID = 706, + "Nanoprocessor Mainframe", + "A Master Circuit", + OrePrefixes.circuit.get(Materials.Master), + SubTag.NO_UNIFICATION)); + OreDictionary.registerOre("LuV", ItemList.Circuit_Master.get(1)); // Backwards compatibility. ItemList.Circuit_Parts_Vacuum_Tube.set(ItemList.Circuit_Primitive.get(1)); ItemList.Circuit_Computer.set(ItemList.Circuit_Advanced.get(1)); - ItemList.Tool_DataOrb.set(addItem(tLastID = 707, "Data Orb", "A High Capacity Data Storage", SubTag.NO_UNIFICATION, new Behaviour_DataOrb())); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Tool_DataOrb.get(1L), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Tool_DataOrb.get(1L)}); - ItemList.Tool_DataStick.set(addItem(tLastID = 708, "Data Stick", "A Low Capacity Data Storage", SubTag.NO_UNIFICATION, new Behaviour_DataStick())); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Tool_DataStick.get(1L), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Tool_DataStick.get(1L)}); - ItemList.Tool_Cover_Copy_Paste.set(addItem(tLastID = 709, "Cover Copy/Paste tool", "Set Cover Massively.", Behaviour_Cover_Tool.INSTANCE, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 6L), new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 6L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 6L))); + ItemList.Tool_DataOrb.set(addItem( + tLastID = 707, + "Data Orb", + "A High Capacity Data Storage", + SubTag.NO_UNIFICATION, + new Behaviour_DataOrb())); + GT_ModHandler.addShapelessCraftingRecipe( + ItemList.Tool_DataOrb.get(1L), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] {ItemList.Tool_DataOrb.get(1L)}); + ItemList.Tool_DataStick.set(addItem( + tLastID = 708, + "Data Stick", + "A Low Capacity Data Storage", + SubTag.NO_UNIFICATION, + new Behaviour_DataStick())); + GT_ModHandler.addShapelessCraftingRecipe( + ItemList.Tool_DataStick.get(1L), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] {ItemList.Tool_DataStick.get(1L)}); + ItemList.Tool_Cover_Copy_Paste.set(addItem( + tLastID = 709, + "Cover Copy/Paste tool", + "Set Cover Massively.", + Behaviour_Cover_Tool.INSTANCE, + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 6L), + new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 6L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 6L))); setElectricStats(32000 + tLastID, 400000L, GT_Values.V[2], 2L, -1L, false); - ItemList.Circuit_Board_Basic.set(addItem(tLastID = 710, "Coated Circuit Board", "A Basic Board")); ItemList.Circuit_Board_Coated.set(ItemList.Circuit_Board_Basic.get(1)); - ItemList.Circuit_Board_Advanced.set(addItem(tLastID = 711, "Epoxy Circuit Board", "An Advanced Board")); ItemList.Circuit_Board_Epoxy.set(ItemList.Circuit_Board_Advanced.get(1)); - ItemList.Circuit_Board_Elite.set(addItem(tLastID = 712, "Multilayer Fiber-Reinforced Circuit Board", "An Elite Board")); ItemList.Circuit_Board_Multifiberglass.set(ItemList.Circuit_Board_Elite.get(1)); - ItemList.Circuit_Parts_Crystal_Chip_Elite.set(addItem(tLastID = 713, "Engraved Crystal Chip", "Needed for Circuits")); - ItemList.Circuit_Parts_Crystal_Chip_Master.set(addItem(tLastID = 714, "Engraved Lapotron Chip", "Needed for Circuits")); - ItemList.Circuit_Parts_Advanced.set(addItem(tLastID = 715, "Diode", "Basic Electronic Component")); ItemList.Circuit_Parts_Diode.set(ItemList.Circuit_Parts_Advanced.get(1)); - ItemList.Circuit_Parts_Wiring_Basic.set(addItem(tLastID = 716, "Resistor", "Basic Electronic Component")); ItemList.Circuit_Parts_Resistor.set(ItemList.Circuit_Parts_Wiring_Basic.get(1)); - ItemList.Circuit_Parts_Wiring_Advanced.set(addItem(tLastID = 717, "Transistor", "Basic Electronic Component")); ItemList.Circuit_Parts_Transistor.set(ItemList.Circuit_Parts_Wiring_Advanced.get(1)); - ItemList.Circuit_Parts_Wiring_Elite.set(addItem(tLastID = 718, "Capacitor", "Electronic Component")); ItemList.Circuit_Parts_Capacitor.set(ItemList.Circuit_Parts_Wiring_Elite.get(1)); - ItemList.Empty_Board_Basic.set(addItem(tLastID = 719, "Phenolic Circuit Board", "A Good Board")); ItemList.Circuit_Board_Phenolic.set(ItemList.Empty_Board_Basic.get(1)); - ItemList.Empty_Board_Elite.set(addItem(tLastID = 720, "Fiber-Reinforced Circuit Board", "An Extreme Board")); ItemList.Circuit_Board_Fiberglass.set(ItemList.Empty_Board_Elite.get(1)); - - ItemList.Component_Sawblade_Diamond.set(addItem(tLastID = 721, "Diamond Sawblade", "", new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERDITIO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 4L), OreDictNames.craftingDiamondBlade)); - ItemList.Component_Grinder_Diamond.set(addItem(tLastID = 722, "Diamond Grinding Head", "", new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERDITIO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 6L), OreDictNames.craftingGrinder)); - ItemList.Component_Grinder_Tungsten.set(addItem(tLastID = 723, "Tungsten Grinding Head", "", new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERDITIO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 6L), OreDictNames.craftingGrinder)); - - GT_ModHandler.addCraftingRecipe(ItemList.Component_Sawblade_Diamond.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{" D ", "DGD", " D ", 'D', OrePrefixes.dustSmall.get(Materials.Diamond), 'G', OrePrefixes.gearGt.get(Materials.CobaltBrass)}); - GT_ModHandler.addCraftingRecipe(ItemList.Component_Grinder_Diamond.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"DSD", "SIS", "DSD", 'I', OrePrefixes.gem.get(Materials.Diamond), 'D', OrePrefixes.dust.get(Materials.Diamond), 'S', OrePrefixes.plateDouble.get(Materials.Steel)}); - GT_ModHandler.addCraftingRecipe(ItemList.Component_Grinder_Tungsten.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"TST", "SIS", "TST", 'I', OreDictNames.craftingIndustrialDiamond, 'T', OrePrefixes.plate.get(Materials.Tungsten), 'S', OrePrefixes.plateDouble.get(Materials.Steel)}); - - ItemList.Upgrade_Muffler.set(addItem(tLastID = 727, "Muffler Upgrade", "Makes Machines silent", new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 2L))); - ItemList.Upgrade_Lock.set(addItem(tLastID = 728, "Lock Upgrade", "Protects your Machines", new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 4L))); - - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Aluminium, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Plastic, 2L), GT_Utility.getIntegratedCircuit(1)}, GT_Values.NF, ItemList.Upgrade_Muffler.get(1L), 1600, 2); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Aluminium, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 2L), GT_Utility.getIntegratedCircuit(1)}, GT_Values.NF, ItemList.Upgrade_Muffler.get(1L), 1600, 2); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iron, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Plastic, 2L), GT_Utility.getIntegratedCircuit(1)}, GT_Values.NF, ItemList.Upgrade_Muffler.get(1L), 1600, 2); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iron, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 2L), GT_Utility.getIntegratedCircuit(1)}, GT_Values.NF, ItemList.Upgrade_Muffler.get(1L), 1600, 2); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.plate, Materials.WroughtIron, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Plastic, 2L), GT_Utility.getIntegratedCircuit(1)}, GT_Values.NF, ItemList.Upgrade_Muffler.get(1L), 1600, 2); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.plate, Materials.WroughtIron, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 2L), GT_Utility.getIntegratedCircuit(1)}, GT_Values.NF, ItemList.Upgrade_Muffler.get(1L), 1600, 2); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Aluminium, 1L), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 1L), GT_Utility.getIntegratedCircuit(1)}, GT_Values.NF, ItemList.Upgrade_Lock.get(1L), 6400, 16); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iron, 1L), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 1L), GT_Utility.getIntegratedCircuit(1)}, GT_Values.NF, ItemList.Upgrade_Lock.get(1L), 6400, 16); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.plate, Materials.WroughtIron, 1L), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 1L), GT_Utility.getIntegratedCircuit(1)}, GT_Values.NF, ItemList.Upgrade_Lock.get(1L), 6400, 16); - - ItemList.Component_Filter.set(addItem(tLastID = 729, "Item Filter", "", new ItemData(Materials.Zinc, OrePrefixes.foil.mMaterialAmount * 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 1L), OreDictNames.craftingFilter)); - - ItemList.Cover_Controller.set(addItem(tLastID = 730, "Machine Controller Cover", "Turns Machines ON/OFF", new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L))); - ItemList.Cover_ActivityDetector.set(addItem(tLastID = 731, "Activity Detector Cover", "Gives out Activity as Redstone", new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L))); - ItemList.Cover_FluidDetector.set(addItem(tLastID = 732, "Fluid Detector Cover", "Gives out Fluid Amount as Redstone", new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L))); - ItemList.Cover_ItemDetector.set(addItem(tLastID = 733, "Item Detector Cover", "Gives out Item Amount as Redstone", new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.TERRA, 1L))); - ItemList.Cover_EnergyDetector.set(addItem(tLastID = 734, "Energy Detector Cover", "Gives out Energy Amount as Redstone", new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L))); - ItemList.Cover_PlayerDetector.set(addItem(tLastID = 735, "Player Detector Cover", "Gives out close Players as Redstone", new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L))); - ItemList.Cover_FluidStorageMonitor.set(addItem(tLastID = 577, "Fluid Storage Monitor Cover", "Displays the fluid stored in the Tank", new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L))); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Sensor_EV.get(1L), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Titanium, 1L), GT_Utility.getIntegratedCircuit(1)}, GT_Values.NF, ItemList.Cover_PlayerDetector.get(1L), 3200, 128); - - GregTech_API.registerCover(ItemList.Cover_Controller.get(1L), TextureFactory.of(MACHINE_CASINGS[2][0], TextureFactory.of(OVERLAY_CONTROLLER)), new GT_Cover_ControlsWork()); - GregTech_API.registerCover(ItemList.Cover_ActivityDetector.get(1L), TextureFactory.of(MACHINE_CASINGS[2][0], TextureFactory.of(TextureFactory.of(OVERLAY_ACTIVITYDETECTOR), TextureFactory.builder().addIcon(OVERLAY_ACTIVITYDETECTOR_GLOW).glow().build())), new GT_Cover_DoesWork()); - GregTech_API.registerCover(ItemList.Cover_FluidDetector.get(1L), TextureFactory.of(MACHINE_CASINGS[2][0], TextureFactory.of(OVERLAY_FLUIDDETECTOR)), new GT_Cover_LiquidMeter()); - GregTech_API.registerCover(ItemList.Cover_ItemDetector.get(1L), TextureFactory.of(MACHINE_CASINGS[2][0], TextureFactory.of(OVERLAY_ITEMDETECTOR)), new GT_Cover_ItemMeter()); - GregTech_API.registerCover(ItemList.Cover_EnergyDetector.get(1L), TextureFactory.of(MACHINE_CASINGS[2][0], TextureFactory.of(OVERLAY_ENERGYDETECTOR)), new GT_Cover_EUMeter()); - GregTech_API.registerCover(ItemList.Cover_PlayerDetector.get(1L), TextureFactory.of(MACHINE_CASINGS[2][0], TextureFactory.of(TextureFactory.of(OVERLAY_ACTIVITYDETECTOR), TextureFactory.builder().addIcon(OVERLAY_ACTIVITYDETECTOR_GLOW).glow().build())), new GT_Cover_PlayerDetector()); - GregTech_API.registerCover(ItemList.Cover_FluidStorageMonitor.get(1L), TextureFactory.of(OVERLAY_FLUID_STORAGE_MONITOR0), new GT_Cover_FluidStorageMonitor()); - - - ItemList.Cover_Screen.set(addItem(tLastID = 740, "Computer Monitor Cover", "Displays Data and GUI", new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L))); - ItemList.Cover_Crafting.set(addItem(tLastID = 744, "Crafting Table Cover", "Better than a wooden Workbench", new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 4L))); - ItemList.Cover_Drain.set(addItem(tLastID = 745, "Drain Module Cover", "Absorbs Fluids and collects Rain", new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 2L))); - - - ItemList.Cover_Shutter.set(addItem(tLastID = 749, "Shutter Module Cover", "Blocks Inventory/Tank Side. Use together with Machine Controller.", new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 1L))); - - GT_ModHandler.addCraftingRecipe(ItemList.Cover_Screen.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"AGA", "RPB", "ALA", 'A', OrePrefixes.plate.get(Materials.Aluminium), 'L', OrePrefixes.dust.get(Materials.Glowstone), 'R', Dyes.dyeRed, 'G', Dyes.dyeLime, 'B', Dyes.dyeBlue, 'P', OrePrefixes.plate.get(Materials.Glass)}); - - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Aluminium, 1L), ItemList.Cover_Drain.get(1L), GT_Utility.getIntegratedCircuit(1)}, GT_Values.NF, ItemList.Cover_Shutter.get(1L), 200, 64); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iron, 1L), ItemList.Cover_Drain.get(1L), GT_Utility.getIntegratedCircuit(1)}, GT_Values.NF, ItemList.Cover_Shutter.get(1L), 800, 16); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.plate, Materials.WroughtIron, 1L), ItemList.Cover_Drain.get(1L), GT_Utility.getIntegratedCircuit(1)}, GT_Values.NF, ItemList.Cover_Shutter.get(1L), 400, 30); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Aluminium, 2L), new ItemStack(Blocks.iron_bars, 2), GT_Utility.getIntegratedCircuit(1)}, GT_Values.NF, ItemList.Cover_Drain.get(1L), 200, 64); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iron, 2L), new ItemStack(Blocks.iron_bars, 2), GT_Utility.getIntegratedCircuit(1)}, GT_Values.NF, ItemList.Cover_Drain.get(1L), 800, 16); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.plate, Materials.WroughtIron, 2L), new ItemStack(Blocks.iron_bars, 2), GT_Utility.getIntegratedCircuit(1)}, GT_Values.NF, ItemList.Cover_Drain.get(1L), 400, 30); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Aluminium, 1L), new ItemStack(Blocks.crafting_table, 1), GT_Utility.getIntegratedCircuit(1)}, GT_Values.NF, ItemList.Cover_Crafting.get(1L), 200, 64); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iron, 1L), new ItemStack(Blocks.crafting_table, 1), GT_Utility.getIntegratedCircuit(1)}, GT_Values.NF, ItemList.Cover_Crafting.get(1L), 800, 16); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.plate, Materials.WroughtIron, 1L), new ItemStack(Blocks.crafting_table, 1), GT_Utility.getIntegratedCircuit(1)}, GT_Values.NF, ItemList.Cover_Crafting.get(1L), 800, 16); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Cover_Shutter.get(1L), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Basic, 1), GT_Utility.getIntegratedCircuit(1)}, GT_Values.NF, ItemList.FluidFilter.get(1L), 800, 4); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Cover_Screen.get(1L), ItemList.Cover_FluidDetector.get(1L), GT_Utility.getIntegratedCircuit(1)}, GT_Values.NF, ItemList.Cover_FluidStorageMonitor.get(1L), 1200, 128); - - GregTech_API.registerCover(ItemList.Cover_Screen.get(1L), TextureFactory.of(MACHINE_CASINGS[2][0], TextureFactory.of(TextureFactory.of(OVERLAY_SCREEN), TextureFactory.builder().addIcon(OVERLAY_SCREEN_GLOW).glow().build())), new GT_Cover_Screen()); - GregTech_API.registerCover(ItemList.Cover_Crafting.get(1L), TextureFactory.of(MACHINE_CASINGS[1][0], TextureFactory.of(OVERLAY_CRAFTING)), new GT_Cover_Crafting()); - GregTech_API.registerCover(ItemList.Cover_Drain.get(1L), TextureFactory.of(MACHINE_CASINGS[0][0], TextureFactory.of(OVERLAY_DRAIN)), new GT_Cover_Drain()); - GregTech_API.registerCover(ItemList.Cover_Shutter.get(1L), TextureFactory.of(MACHINE_CASINGS[1][0], TextureFactory.of(OVERLAY_SHUTTER)), new GT_Cover_Shutter()); - - ItemList.Cover_SolarPanel.set(addItem(tLastID = 750, "Solar Panel", "May the Sun be with you (Needs cleaning with right click)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 1L))); - ItemList.Cover_SolarPanel_8V.set(addItem(tLastID = 751, "Solar Panel (8V)", "8 Volt Solar Panel (Needs cleaning with right click)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 2L))); - ItemList.Cover_SolarPanel_LV.set(addItem(tLastID = 752, "Solar Panel (LV)", "Low Voltage Solar Panel (Needs cleaning with right click)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 4L))); - ItemList.Cover_SolarPanel_MV.set(addItem(tLastID = 753, "Solar Panel (MV)", "Medium Voltage Solar Panel (Needs cleaning with right click)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 8L))); - ItemList.Cover_SolarPanel_HV.set(addItem(tLastID = 754, "Solar Panel (HV)", "High Voltage Solar Panel (Needs cleaning with right click)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 16L))); - ItemList.Cover_SolarPanel_EV.set(addItem(tLastID = 755, "Solar Panel (EV)", "Extreme Solar Panel (Needs cleaning with right click)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 32L))); - ItemList.Cover_SolarPanel_IV.set(addItem(tLastID = 756, "Solar Panel (IV)", "Insane Solar Panel (Needs cleaning with right click)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 64L))); - ItemList.Cover_SolarPanel_LuV.set(addItem(tLastID = 757, "Solar Panel (LuV)", "Ludicrous Solar Panel (Needs cleaning with right click)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 64L))); - ItemList.Cover_SolarPanel_ZPM.set(addItem(tLastID = 758, "Solar Panel (ZPM)", "ZPM Voltage Solar Panel (Needs cleaning with right click)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 64L))); - ItemList.Cover_SolarPanel_UV.set(addItem(tLastID = 759, "Solar Panel (UV)", "Ultimate Solar Panel (Needs cleaning with right click)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 64L))); - - GregTech_API.registerCover(ItemList.Cover_SolarPanel.get(1L), TextureFactory.of(SOLARPANEL), new GT_Cover_SolarPanel(1)); - GregTech_API.registerCover(ItemList.Cover_SolarPanel_8V.get(1L), TextureFactory.of(SOLARPANEL_8V), new GT_Cover_SolarPanel(8)); - GregTech_API.registerCover(ItemList.Cover_SolarPanel_LV.get(1L), TextureFactory.of(SOLARPANEL_LV), new GT_Cover_SolarPanel(32)); - GregTech_API.registerCover(ItemList.Cover_SolarPanel_MV.get(1L), TextureFactory.of(SOLARPANEL_MV), new GT_Cover_SolarPanel(128)); - GregTech_API.registerCover(ItemList.Cover_SolarPanel_HV.get(1L), TextureFactory.of(SOLARPANEL_HV), new GT_Cover_SolarPanel(512)); - GregTech_API.registerCover(ItemList.Cover_SolarPanel_EV.get(1L), TextureFactory.of(SOLARPANEL_EV), new GT_Cover_SolarPanel(2048)); - GregTech_API.registerCover(ItemList.Cover_SolarPanel_IV.get(1L), TextureFactory.of(SOLARPANEL_IV), new GT_Cover_SolarPanel(8192)); - GregTech_API.registerCover(ItemList.Cover_SolarPanel_LuV.get(1L), TextureFactory.of(SOLARPANEL_LuV), new GT_Cover_SolarPanel(32768)); - GregTech_API.registerCover(ItemList.Cover_SolarPanel_ZPM.get(1L), TextureFactory.of(SOLARPANEL_ZPM), new GT_Cover_SolarPanel(131072)); - GregTech_API.registerCover(ItemList.Cover_SolarPanel_UV.get(1L), TextureFactory.of(SOLARPANEL_UV), new GT_Cover_SolarPanel(524288)); - - ItemList.Tool_Sonictron.set(addItem(tLastID = 760, "Sonictron", "Bring your Music with you", Behaviour_Sonictron.INSTANCE, new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 4L))); - ItemList.Tool_Cheat.set(addItem(tLastID = 761, "Debug Scanner", "Also an Infinite Energy Source", Behaviour_Scanner.INSTANCE, new TC_Aspects.TC_AspectStack(TC_Aspects.NEBRISUM, 64L))); + ItemList.Circuit_Board_Basic.set(addItem(tLastID = 710, "Coated Circuit Board", "A Basic Board")); + ItemList.Circuit_Board_Coated.set(ItemList.Circuit_Board_Basic.get(1)); + ItemList.Circuit_Board_Advanced.set(addItem(tLastID = 711, "Epoxy Circuit Board", "An Advanced Board")); + ItemList.Circuit_Board_Epoxy.set(ItemList.Circuit_Board_Advanced.get(1)); + ItemList.Circuit_Board_Elite.set( + addItem(tLastID = 712, "Multilayer Fiber-Reinforced Circuit Board", "An Elite Board")); + ItemList.Circuit_Board_Multifiberglass.set(ItemList.Circuit_Board_Elite.get(1)); + ItemList.Circuit_Parts_Crystal_Chip_Elite.set( + addItem(tLastID = 713, "Engraved Crystal Chip", "Needed for Circuits")); + ItemList.Circuit_Parts_Crystal_Chip_Master.set( + addItem(tLastID = 714, "Engraved Lapotron Chip", "Needed for Circuits")); + ItemList.Circuit_Parts_Advanced.set(addItem(tLastID = 715, "Diode", "Basic Electronic Component")); + ItemList.Circuit_Parts_Diode.set(ItemList.Circuit_Parts_Advanced.get(1)); + ItemList.Circuit_Parts_Wiring_Basic.set(addItem(tLastID = 716, "Resistor", "Basic Electronic Component")); + ItemList.Circuit_Parts_Resistor.set(ItemList.Circuit_Parts_Wiring_Basic.get(1)); + ItemList.Circuit_Parts_Wiring_Advanced.set(addItem(tLastID = 717, "Transistor", "Basic Electronic Component")); + ItemList.Circuit_Parts_Transistor.set(ItemList.Circuit_Parts_Wiring_Advanced.get(1)); + ItemList.Circuit_Parts_Wiring_Elite.set(addItem(tLastID = 718, "Capacitor", "Electronic Component")); + ItemList.Circuit_Parts_Capacitor.set(ItemList.Circuit_Parts_Wiring_Elite.get(1)); + ItemList.Empty_Board_Basic.set(addItem(tLastID = 719, "Phenolic Circuit Board", "A Good Board")); + ItemList.Circuit_Board_Phenolic.set(ItemList.Empty_Board_Basic.get(1)); + ItemList.Empty_Board_Elite.set(addItem(tLastID = 720, "Fiber-Reinforced Circuit Board", "An Extreme Board")); + ItemList.Circuit_Board_Fiberglass.set(ItemList.Empty_Board_Elite.get(1)); + + ItemList.Component_Sawblade_Diamond.set(addItem( + tLastID = 721, + "Diamond Sawblade", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.PERDITIO, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 4L), + OreDictNames.craftingDiamondBlade)); + ItemList.Component_Grinder_Diamond.set(addItem( + tLastID = 722, + "Diamond Grinding Head", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.PERDITIO, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 6L), + OreDictNames.craftingGrinder)); + ItemList.Component_Grinder_Tungsten.set(addItem( + tLastID = 723, + "Tungsten Grinding Head", + "", + new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.PERDITIO, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 6L), + OreDictNames.craftingGrinder)); + + GT_ModHandler.addCraftingRecipe( + ItemList.Component_Sawblade_Diamond.get(1L), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + " D ", + "DGD", + " D ", + 'D', + OrePrefixes.dustSmall.get(Materials.Diamond), + 'G', + OrePrefixes.gearGt.get(Materials.CobaltBrass) + }); + GT_ModHandler.addCraftingRecipe( + ItemList.Component_Grinder_Diamond.get(1L), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + "DSD", + "SIS", + "DSD", + 'I', + OrePrefixes.gem.get(Materials.Diamond), + 'D', + OrePrefixes.dust.get(Materials.Diamond), + 'S', + OrePrefixes.plateDouble.get(Materials.Steel) + }); + GT_ModHandler.addCraftingRecipe( + ItemList.Component_Grinder_Tungsten.get(1L), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + "TST", + "SIS", + "TST", + 'I', + OreDictNames.craftingIndustrialDiamond, + 'T', + OrePrefixes.plate.get(Materials.Tungsten), + 'S', + OrePrefixes.plateDouble.get(Materials.Steel) + }); + + ItemList.Upgrade_Muffler.set(addItem( + tLastID = 727, + "Muffler Upgrade", + "Makes Machines silent", + new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 2L))); + ItemList.Upgrade_Lock.set(addItem( + tLastID = 728, + "Lock Upgrade", + "Protects your Machines", + new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 4L))); + + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Aluminium, 1L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Plastic, 2L), + GT_Utility.getIntegratedCircuit(1) + }, + GT_Values.NF, + ItemList.Upgrade_Muffler.get(1L), + 1600, + 2); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Aluminium, 1L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 2L), + GT_Utility.getIntegratedCircuit(1) + }, + GT_Values.NF, + ItemList.Upgrade_Muffler.get(1L), + 1600, + 2); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iron, 1L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Plastic, 2L), + GT_Utility.getIntegratedCircuit(1) + }, + GT_Values.NF, + ItemList.Upgrade_Muffler.get(1L), + 1600, + 2); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iron, 1L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 2L), + GT_Utility.getIntegratedCircuit(1) + }, + GT_Values.NF, + ItemList.Upgrade_Muffler.get(1L), + 1600, + 2); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.WroughtIron, 1L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Plastic, 2L), + GT_Utility.getIntegratedCircuit(1) + }, + GT_Values.NF, + ItemList.Upgrade_Muffler.get(1L), + 1600, + 2); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.WroughtIron, 1L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 2L), + GT_Utility.getIntegratedCircuit(1) + }, + GT_Values.NF, + ItemList.Upgrade_Muffler.get(1L), + 1600, + 2); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Aluminium, 1L), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 1L), + GT_Utility.getIntegratedCircuit(1) + }, + GT_Values.NF, + ItemList.Upgrade_Lock.get(1L), + 6400, + 16); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iron, 1L), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 1L), + GT_Utility.getIntegratedCircuit(1) + }, + GT_Values.NF, + ItemList.Upgrade_Lock.get(1L), + 6400, + 16); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.WroughtIron, 1L), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 1L), + GT_Utility.getIntegratedCircuit(1) + }, + GT_Values.NF, + ItemList.Upgrade_Lock.get(1L), + 6400, + 16); + + ItemList.Component_Filter.set(addItem( + tLastID = 729, + "Item Filter", + "", + new ItemData(Materials.Zinc, OrePrefixes.foil.mMaterialAmount * 16L), + new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 1L), + OreDictNames.craftingFilter)); + + ItemList.Cover_Controller.set(addItem( + tLastID = 730, + "Machine Controller Cover", + "Turns Machines ON/OFF", + new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L))); + ItemList.Cover_ActivityDetector.set(addItem( + tLastID = 731, + "Activity Detector Cover", + "Gives out Activity as Redstone", + new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L))); + ItemList.Cover_FluidDetector.set(addItem( + tLastID = 732, + "Fluid Detector Cover", + "Gives out Fluid Amount as Redstone", + new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L))); + ItemList.Cover_ItemDetector.set(addItem( + tLastID = 733, + "Item Detector Cover", + "Gives out Item Amount as Redstone", + new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.TERRA, 1L))); + ItemList.Cover_EnergyDetector.set(addItem( + tLastID = 734, + "Energy Detector Cover", + "Gives out Energy Amount as Redstone", + new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L))); + ItemList.Cover_PlayerDetector.set(addItem( + tLastID = 735, + "Player Detector Cover", + "Gives out close Players as Redstone", + new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L))); + ItemList.Cover_FluidStorageMonitor.set(addItem( + tLastID = 577, + "Fluid Storage Monitor Cover", + "Displays the fluid stored in the Tank", + new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L))); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + ItemList.Sensor_EV.get(1L), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Titanium, 1L), + GT_Utility.getIntegratedCircuit(1) + }, + GT_Values.NF, + ItemList.Cover_PlayerDetector.get(1L), + 3200, + 128); + + GregTech_API.registerCover( + ItemList.Cover_Controller.get(1L), + TextureFactory.of(MACHINE_CASINGS[2][0], TextureFactory.of(OVERLAY_CONTROLLER)), + new GT_Cover_ControlsWork()); + GregTech_API.registerCover( + ItemList.Cover_ActivityDetector.get(1L), + TextureFactory.of( + MACHINE_CASINGS[2][0], + TextureFactory.of( + TextureFactory.of(OVERLAY_ACTIVITYDETECTOR), + TextureFactory.builder() + .addIcon(OVERLAY_ACTIVITYDETECTOR_GLOW) + .glow() + .build())), + new GT_Cover_DoesWork()); + GregTech_API.registerCover( + ItemList.Cover_FluidDetector.get(1L), + TextureFactory.of(MACHINE_CASINGS[2][0], TextureFactory.of(OVERLAY_FLUIDDETECTOR)), + new GT_Cover_LiquidMeter()); + GregTech_API.registerCover( + ItemList.Cover_ItemDetector.get(1L), + TextureFactory.of(MACHINE_CASINGS[2][0], TextureFactory.of(OVERLAY_ITEMDETECTOR)), + new GT_Cover_ItemMeter()); + GregTech_API.registerCover( + ItemList.Cover_EnergyDetector.get(1L), + TextureFactory.of(MACHINE_CASINGS[2][0], TextureFactory.of(OVERLAY_ENERGYDETECTOR)), + new GT_Cover_EUMeter()); + GregTech_API.registerCover( + ItemList.Cover_PlayerDetector.get(1L), + TextureFactory.of( + MACHINE_CASINGS[2][0], + TextureFactory.of( + TextureFactory.of(OVERLAY_ACTIVITYDETECTOR), + TextureFactory.builder() + .addIcon(OVERLAY_ACTIVITYDETECTOR_GLOW) + .glow() + .build())), + new GT_Cover_PlayerDetector()); + GregTech_API.registerCover( + ItemList.Cover_FluidStorageMonitor.get(1L), + TextureFactory.of(OVERLAY_FLUID_STORAGE_MONITOR0), + new GT_Cover_FluidStorageMonitor()); + + ItemList.Cover_Screen.set(addItem( + tLastID = 740, + "Computer Monitor Cover", + "Displays Data and GUI", + new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L))); + ItemList.Cover_Crafting.set(addItem( + tLastID = 744, + "Crafting Table Cover", + "Better than a wooden Workbench", + new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 4L))); + ItemList.Cover_Drain.set(addItem( + tLastID = 745, + "Drain Module Cover", + "Absorbs Fluids and collects Rain", + new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 2L))); + + ItemList.Cover_Shutter.set(addItem( + tLastID = 749, + "Shutter Module Cover", + "Blocks Inventory/Tank Side. Use together with Machine Controller.", + new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 1L))); + + GT_ModHandler.addCraftingRecipe( + ItemList.Cover_Screen.get(1L), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + "AGA", + "RPB", + "ALA", + 'A', + OrePrefixes.plate.get(Materials.Aluminium), + 'L', + OrePrefixes.dust.get(Materials.Glowstone), + 'R', + Dyes.dyeRed, + 'G', + Dyes.dyeLime, + 'B', + Dyes.dyeBlue, + 'P', + OrePrefixes.plate.get(Materials.Glass) + }); + + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Aluminium, 1L), + ItemList.Cover_Drain.get(1L), + GT_Utility.getIntegratedCircuit(1) + }, + GT_Values.NF, + ItemList.Cover_Shutter.get(1L), + 200, + 64); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iron, 1L), + ItemList.Cover_Drain.get(1L), + GT_Utility.getIntegratedCircuit(1) + }, + GT_Values.NF, + ItemList.Cover_Shutter.get(1L), + 800, + 16); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.WroughtIron, 1L), + ItemList.Cover_Drain.get(1L), + GT_Utility.getIntegratedCircuit(1) + }, + GT_Values.NF, + ItemList.Cover_Shutter.get(1L), + 400, + 30); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Aluminium, 2L), + new ItemStack(Blocks.iron_bars, 2), + GT_Utility.getIntegratedCircuit(1) + }, + GT_Values.NF, + ItemList.Cover_Drain.get(1L), + 200, + 64); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iron, 2L), + new ItemStack(Blocks.iron_bars, 2), + GT_Utility.getIntegratedCircuit(1) + }, + GT_Values.NF, + ItemList.Cover_Drain.get(1L), + 800, + 16); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.WroughtIron, 2L), + new ItemStack(Blocks.iron_bars, 2), + GT_Utility.getIntegratedCircuit(1) + }, + GT_Values.NF, + ItemList.Cover_Drain.get(1L), + 400, + 30); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Aluminium, 1L), + new ItemStack(Blocks.crafting_table, 1), + GT_Utility.getIntegratedCircuit(1) + }, + GT_Values.NF, + ItemList.Cover_Crafting.get(1L), + 200, + 64); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iron, 1L), + new ItemStack(Blocks.crafting_table, 1), + GT_Utility.getIntegratedCircuit(1) + }, + GT_Values.NF, + ItemList.Cover_Crafting.get(1L), + 800, + 16); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.WroughtIron, 1L), + new ItemStack(Blocks.crafting_table, 1), + GT_Utility.getIntegratedCircuit(1) + }, + GT_Values.NF, + ItemList.Cover_Crafting.get(1L), + 800, + 16); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + ItemList.Cover_Shutter.get(1L), + GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Basic, 1), + GT_Utility.getIntegratedCircuit(1) + }, + GT_Values.NF, + ItemList.FluidFilter.get(1L), + 800, + 4); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + ItemList.Cover_Screen.get(1L), + ItemList.Cover_FluidDetector.get(1L), + GT_Utility.getIntegratedCircuit(1) + }, + GT_Values.NF, + ItemList.Cover_FluidStorageMonitor.get(1L), + 1200, + 128); + + GregTech_API.registerCover( + ItemList.Cover_Screen.get(1L), + TextureFactory.of( + MACHINE_CASINGS[2][0], + TextureFactory.of( + TextureFactory.of(OVERLAY_SCREEN), + TextureFactory.builder() + .addIcon(OVERLAY_SCREEN_GLOW) + .glow() + .build())), + new GT_Cover_Screen()); + GregTech_API.registerCover( + ItemList.Cover_Crafting.get(1L), + TextureFactory.of(MACHINE_CASINGS[1][0], TextureFactory.of(OVERLAY_CRAFTING)), + new GT_Cover_Crafting()); + GregTech_API.registerCover( + ItemList.Cover_Drain.get(1L), + TextureFactory.of(MACHINE_CASINGS[0][0], TextureFactory.of(OVERLAY_DRAIN)), + new GT_Cover_Drain()); + GregTech_API.registerCover( + ItemList.Cover_Shutter.get(1L), + TextureFactory.of(MACHINE_CASINGS[1][0], TextureFactory.of(OVERLAY_SHUTTER)), + new GT_Cover_Shutter()); + + ItemList.Cover_SolarPanel.set(addItem( + tLastID = 750, + "Solar Panel", + "May the Sun be with you (Needs cleaning with right click)", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 1L))); + ItemList.Cover_SolarPanel_8V.set(addItem( + tLastID = 751, + "Solar Panel (8V)", + "8 Volt Solar Panel (Needs cleaning with right click)", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 2L))); + ItemList.Cover_SolarPanel_LV.set(addItem( + tLastID = 752, + "Solar Panel (LV)", + "Low Voltage Solar Panel (Needs cleaning with right click)", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), + new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 4L), + new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 4L))); + ItemList.Cover_SolarPanel_MV.set(addItem( + tLastID = 753, + "Solar Panel (MV)", + "Medium Voltage Solar Panel (Needs cleaning with right click)", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), + new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 8L), + new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 8L))); + ItemList.Cover_SolarPanel_HV.set(addItem( + tLastID = 754, + "Solar Panel (HV)", + "High Voltage Solar Panel (Needs cleaning with right click)", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), + new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 16L), + new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 16L))); + ItemList.Cover_SolarPanel_EV.set(addItem( + tLastID = 755, + "Solar Panel (EV)", + "Extreme Solar Panel (Needs cleaning with right click)", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 32L), + new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 32L), + new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 32L))); + ItemList.Cover_SolarPanel_IV.set(addItem( + tLastID = 756, + "Solar Panel (IV)", + "Insane Solar Panel (Needs cleaning with right click)", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), + new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 64L), + new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 64L))); + ItemList.Cover_SolarPanel_LuV.set(addItem( + tLastID = 757, + "Solar Panel (LuV)", + "Ludicrous Solar Panel (Needs cleaning with right click)", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), + new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 64L), + new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 64L))); + ItemList.Cover_SolarPanel_ZPM.set(addItem( + tLastID = 758, + "Solar Panel (ZPM)", + "ZPM Voltage Solar Panel (Needs cleaning with right click)", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), + new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 64L), + new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 64L))); + ItemList.Cover_SolarPanel_UV.set(addItem( + tLastID = 759, + "Solar Panel (UV)", + "Ultimate Solar Panel (Needs cleaning with right click)", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), + new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 64L), + new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 64L))); + + GregTech_API.registerCover( + ItemList.Cover_SolarPanel.get(1L), TextureFactory.of(SOLARPANEL), new GT_Cover_SolarPanel(1)); + GregTech_API.registerCover( + ItemList.Cover_SolarPanel_8V.get(1L), TextureFactory.of(SOLARPANEL_8V), new GT_Cover_SolarPanel(8)); + GregTech_API.registerCover( + ItemList.Cover_SolarPanel_LV.get(1L), TextureFactory.of(SOLARPANEL_LV), new GT_Cover_SolarPanel(32)); + GregTech_API.registerCover( + ItemList.Cover_SolarPanel_MV.get(1L), TextureFactory.of(SOLARPANEL_MV), new GT_Cover_SolarPanel(128)); + GregTech_API.registerCover( + ItemList.Cover_SolarPanel_HV.get(1L), TextureFactory.of(SOLARPANEL_HV), new GT_Cover_SolarPanel(512)); + GregTech_API.registerCover( + ItemList.Cover_SolarPanel_EV.get(1L), TextureFactory.of(SOLARPANEL_EV), new GT_Cover_SolarPanel(2048)); + GregTech_API.registerCover( + ItemList.Cover_SolarPanel_IV.get(1L), TextureFactory.of(SOLARPANEL_IV), new GT_Cover_SolarPanel(8192)); + GregTech_API.registerCover( + ItemList.Cover_SolarPanel_LuV.get(1L), + TextureFactory.of(SOLARPANEL_LuV), + new GT_Cover_SolarPanel(32768)); + GregTech_API.registerCover( + ItemList.Cover_SolarPanel_ZPM.get(1L), + TextureFactory.of(SOLARPANEL_ZPM), + new GT_Cover_SolarPanel(131072)); + GregTech_API.registerCover( + ItemList.Cover_SolarPanel_UV.get(1L), + TextureFactory.of(SOLARPANEL_UV), + new GT_Cover_SolarPanel(524288)); + + ItemList.Tool_Sonictron.set(addItem( + tLastID = 760, + "Sonictron", + "Bring your Music with you", + Behaviour_Sonictron.INSTANCE, + new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 4L))); + ItemList.Tool_Cheat.set(addItem( + tLastID = 761, + "Debug Scanner", + "Also an Infinite Energy Source", + Behaviour_Scanner.INSTANCE, + new TC_Aspects.TC_AspectStack(TC_Aspects.NEBRISUM, 64L))); setElectricStats(32000 + tLastID, -2000000000L, 1000000000L, -1L, -3L, false); - ItemList.Tool_Scanner.set(addItem(tLastID = 762, "Portable Scanner", "Tricorder", Behaviour_Scanner.INSTANCE, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 6L), new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 6L))); + ItemList.Tool_Scanner.set(addItem( + tLastID = 762, + "Portable Scanner", + "Tricorder", + Behaviour_Scanner.INSTANCE, + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 6L), + new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 6L))); setElectricStats(32000 + tLastID, 400000L, GT_Values.V[2], 2L, -1L, false); - GT_ModHandler.addCraftingRecipe(ItemList.Tool_Scanner.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"EPR", "CSC", "PBP", 'C', OrePrefixes.circuit.get(Materials.Advanced), 'P', OrePrefixes.plate.get(Materials.Aluminium), 'E', ItemList.Emitter_MV, 'R', ItemList.Sensor_MV, 'S', ItemList.Cover_Screen, 'B', ItemList.Battery_RE_MV_Lithium}); + GT_ModHandler.addCraftingRecipe( + ItemList.Tool_Scanner.get(1L), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + "EPR", + "CSC", + "PBP", + 'C', + OrePrefixes.circuit.get(Materials.Advanced), + 'P', + OrePrefixes.plate.get(Materials.Aluminium), + 'E', + ItemList.Emitter_MV, + 'R', + ItemList.Sensor_MV, + 'S', + ItemList.Cover_Screen, + 'B', + ItemList.Battery_RE_MV_Lithium + }); ItemList.NC_SensorKit.set(addItem(tLastID = 763, "GregTech Sensor Kit", "", new Behaviour_SensorKit())); - ItemList.Duct_Tape.set(addItem(tLastID = 764, "BrainTech Aerospace Advanced Reinforced Duct Tape FAL-84", "If you can't fix it with this, use more of it!", new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), OreDictNames.craftingDuctTape)); - ItemList.McGuffium_239.set(addItem(tLastID = 765, "Mc Guffium 239", "42% better than Phlebotnium", new TC_Aspects.TC_AspectStack(TC_Aspects.ALIENIS, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERMUTATIO, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.SPIRITUS, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.AURAM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.VITIUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.RADIO, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MAGNETO, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.NEBRISUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.STRONTIO, 8L))); - - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Sensor_LV.get(1L), ItemList.Emitter_LV.get(1L), GT_Utility.getIntegratedCircuit(1)}, GT_Values.NF, ItemList.NC_SensorKit.get(1L), 1600, 2); - - ItemList.Cover_RedstoneTransmitterExternal.set(addItem(tLastID = 741, "Redstone Transmitter (Out)", "Transfers Redstonesignals wireless", new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L))); - ItemList.Cover_RedstoneTransmitterInternal.set(addItem(tLastID = 742, "Redstone Transmitter (In)", "Transfers Redstonesignals wireless", new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L))); - ItemList.Cover_RedstoneReceiverExternal.set(addItem(tLastID = 746, "Redstone Receiver (Out)", "Transfers Redstonesignals wireless", new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L))); - ItemList.Cover_RedstoneReceiverInternal.set(addItem(tLastID = 747, "Redstone Receiver (In)", "Transfers Redstonesignals wireless", new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L))); - - GregTech_API.registerCover(ItemList.Cover_RedstoneTransmitterExternal.get(1L), TextureFactory.of(MACHINE_CASINGS[2][0], TextureFactory.of(TextureFactory.of(OVERLAY_ACTIVITYDETECTOR), TextureFactory.builder().addIcon(OVERLAY_ACTIVITYDETECTOR_GLOW).glow().build())), new GT_Cover_RedstoneTransmitterExternal()); - GregTech_API.registerCover(ItemList.Cover_RedstoneTransmitterInternal.get(1L), TextureFactory.of(MACHINE_CASINGS[2][0], TextureFactory.of(TextureFactory.of(OVERLAY_ACTIVITYDETECTOR), TextureFactory.builder().addIcon(OVERLAY_ACTIVITYDETECTOR_GLOW).glow().build())), new GT_Cover_RedstoneTransmitterInternal()); - GregTech_API.registerCover(ItemList.Cover_RedstoneReceiverExternal.get(1L), TextureFactory.of(MACHINE_CASINGS[2][0], TextureFactory.of(OVERLAY_FLUIDDETECTOR)), new GT_Cover_RedstoneReceiverExternal()); - GregTech_API.registerCover(ItemList.Cover_RedstoneReceiverInternal.get(1L), TextureFactory.of(MACHINE_CASINGS[2][0], TextureFactory.of(OVERLAY_FLUIDDETECTOR)), new GT_Cover_RedstoneReceiverInternal()); - - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Emitter_EV.get(1L), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.StainlessSteel, 1L), GT_Utility.getIntegratedCircuit(1)}, GT_Values.NF, ItemList.Cover_RedstoneTransmitterExternal.get(1L), 3200, 128); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Sensor_EV.get(1L), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.StainlessSteel, 1L), GT_Utility.getIntegratedCircuit(1)}, GT_Values.NF, ItemList.Cover_RedstoneReceiverExternal.get(1L), 3200, 128); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Cover_RedstoneTransmitterInternal.get(1L), new Object[]{ItemList.Cover_RedstoneTransmitterExternal.get(1L)}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Cover_RedstoneReceiverInternal.get(1L), new Object[]{ItemList.Cover_RedstoneReceiverExternal.get(1L)}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Cover_RedstoneTransmitterExternal.get(1L), new Object[]{ItemList.Cover_RedstoneTransmitterInternal.get(1L)}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Cover_RedstoneReceiverExternal.get(1L), new Object[]{ItemList.Cover_RedstoneReceiverInternal.get(1L)}); - - ItemList.Cover_NeedsMaintainance.set(addItem(tLastID = 748, "Needs Maintenance Cover", "Attach to Multiblock Controller. Emits Redstone Signal if needs Maintenance", new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L))); - GregTech_API.registerCover(ItemList.Cover_NeedsMaintainance.get(1L), TextureFactory.of(MACHINE_CASINGS[2][0], TextureFactory.of(TextureFactory.of(OVERLAY_ACTIVITYDETECTOR), TextureFactory.builder().addIcon(OVERLAY_ACTIVITYDETECTOR_GLOW).glow().build())), new GT_Cover_NeedMaintainance()); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Emitter_MV.get(1L), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Aluminium, 1L), GT_Utility.getIntegratedCircuit(1)}, GT_Values.NF, ItemList.Cover_NeedsMaintainance.get(1L), 600, 24); - - GT_ModHandler.addCraftingRecipe(ItemList.ItemFilter_Export.get(1L), new Object[]{"SPS", "dIC", "SPS", 'P', OrePrefixes.plate.get(Materials.Tin), 'S', OrePrefixes.screw.get(Materials.Iron), 'I', ItemList.Component_Filter, 'C', ItemList.Conveyor_Module_LV}); - GT_ModHandler.addCraftingRecipe(ItemList.ItemFilter_Import.get(1L), new Object[]{"SPS", "CId", "SPS", 'P', OrePrefixes.plate.get(Materials.Tin), 'S', OrePrefixes.screw.get(Materials.Iron), 'I', ItemList.Component_Filter, 'C', ItemList.Conveyor_Module_LV}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.ItemFilter_Export.get(1L), new Object[]{ItemList.ItemFilter_Import.get(1L)}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.ItemFilter_Import.get(1L), new Object[]{ItemList.ItemFilter_Export.get(1L)}); - - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.plate,Materials.Tin,2L), ItemList.Component_Filter.get(1L), ItemList.Conveyor_Module_LV.get(1L), GT_Utility.getIntegratedCircuit(1)}, null, ItemList.ItemFilter_Export.get(1L), 100, 30); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.plate,Materials.Tin,2L), ItemList.Component_Filter.get(1L), ItemList.Conveyor_Module_LV.get(1L), GT_Utility.getIntegratedCircuit(2)}, null, ItemList.ItemFilter_Import.get(1L), 100, 30); - - GT_ModHandler.addCraftingRecipe(ItemList.Tool_Cover_Copy_Paste.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"PSP", "PCP", "PBP", 'P', OrePrefixes.plate.get(Materials.Aluminium), 'S', ItemList.Tool_DataStick.get(1L), 'C', ItemList.Cover_Screen.get(1L), 'B', ItemList.Battery_RE_MV_Lithium.get(1L)}); + ItemList.Duct_Tape.set(addItem( + tLastID = 764, + "BrainTech Aerospace Advanced Reinforced Duct Tape FAL-84", + "If you can't fix it with this, use more of it!", + new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), + OreDictNames.craftingDuctTape)); + ItemList.McGuffium_239.set(addItem( + tLastID = 765, + "Mc Guffium 239", + "42% better than Phlebotnium", + new TC_Aspects.TC_AspectStack(TC_Aspects.ALIENIS, 8L), + new TC_Aspects.TC_AspectStack(TC_Aspects.PERMUTATIO, 8L), + new TC_Aspects.TC_AspectStack(TC_Aspects.SPIRITUS, 8L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AURAM, 8L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VITIUM, 8L), + new TC_Aspects.TC_AspectStack(TC_Aspects.RADIO, 8L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MAGNETO, 8L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), + new TC_Aspects.TC_AspectStack(TC_Aspects.NEBRISUM, 8L), + new TC_Aspects.TC_AspectStack(TC_Aspects.STRONTIO, 8L))); + + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + ItemList.Sensor_LV.get(1L), ItemList.Emitter_LV.get(1L), GT_Utility.getIntegratedCircuit(1) + }, + GT_Values.NF, + ItemList.NC_SensorKit.get(1L), + 1600, + 2); + + ItemList.Cover_RedstoneTransmitterExternal.set(addItem( + tLastID = 741, + "Redstone Transmitter (Out)", + "Transfers Redstonesignals wireless", + new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L))); + ItemList.Cover_RedstoneTransmitterInternal.set(addItem( + tLastID = 742, + "Redstone Transmitter (In)", + "Transfers Redstonesignals wireless", + new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L))); + ItemList.Cover_RedstoneReceiverExternal.set(addItem( + tLastID = 746, + "Redstone Receiver (Out)", + "Transfers Redstonesignals wireless", + new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L))); + ItemList.Cover_RedstoneReceiverInternal.set(addItem( + tLastID = 747, + "Redstone Receiver (In)", + "Transfers Redstonesignals wireless", + new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L))); + + GregTech_API.registerCover( + ItemList.Cover_RedstoneTransmitterExternal.get(1L), + TextureFactory.of( + MACHINE_CASINGS[2][0], + TextureFactory.of( + TextureFactory.of(OVERLAY_ACTIVITYDETECTOR), + TextureFactory.builder() + .addIcon(OVERLAY_ACTIVITYDETECTOR_GLOW) + .glow() + .build())), + new GT_Cover_RedstoneTransmitterExternal()); + GregTech_API.registerCover( + ItemList.Cover_RedstoneTransmitterInternal.get(1L), + TextureFactory.of( + MACHINE_CASINGS[2][0], + TextureFactory.of( + TextureFactory.of(OVERLAY_ACTIVITYDETECTOR), + TextureFactory.builder() + .addIcon(OVERLAY_ACTIVITYDETECTOR_GLOW) + .glow() + .build())), + new GT_Cover_RedstoneTransmitterInternal()); + GregTech_API.registerCover( + ItemList.Cover_RedstoneReceiverExternal.get(1L), + TextureFactory.of(MACHINE_CASINGS[2][0], TextureFactory.of(OVERLAY_FLUIDDETECTOR)), + new GT_Cover_RedstoneReceiverExternal()); + GregTech_API.registerCover( + ItemList.Cover_RedstoneReceiverInternal.get(1L), + TextureFactory.of(MACHINE_CASINGS[2][0], TextureFactory.of(OVERLAY_FLUIDDETECTOR)), + new GT_Cover_RedstoneReceiverInternal()); + + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + ItemList.Emitter_EV.get(1L), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.StainlessSteel, 1L), + GT_Utility.getIntegratedCircuit(1) + }, + GT_Values.NF, + ItemList.Cover_RedstoneTransmitterExternal.get(1L), + 3200, + 128); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + ItemList.Sensor_EV.get(1L), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.StainlessSteel, 1L), + GT_Utility.getIntegratedCircuit(1) + }, + GT_Values.NF, + ItemList.Cover_RedstoneReceiverExternal.get(1L), + 3200, + 128); + GT_ModHandler.addShapelessCraftingRecipe( + ItemList.Cover_RedstoneTransmitterInternal.get(1L), + new Object[] {ItemList.Cover_RedstoneTransmitterExternal.get(1L)}); + GT_ModHandler.addShapelessCraftingRecipe( + ItemList.Cover_RedstoneReceiverInternal.get(1L), + new Object[] {ItemList.Cover_RedstoneReceiverExternal.get(1L)}); + GT_ModHandler.addShapelessCraftingRecipe( + ItemList.Cover_RedstoneTransmitterExternal.get(1L), + new Object[] {ItemList.Cover_RedstoneTransmitterInternal.get(1L)}); + GT_ModHandler.addShapelessCraftingRecipe( + ItemList.Cover_RedstoneReceiverExternal.get(1L), + new Object[] {ItemList.Cover_RedstoneReceiverInternal.get(1L)}); + + ItemList.Cover_NeedsMaintainance.set(addItem( + tLastID = 748, + "Needs Maintenance Cover", + "Attach to Multiblock Controller. Emits Redstone Signal if needs Maintenance", + new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L))); + GregTech_API.registerCover( + ItemList.Cover_NeedsMaintainance.get(1L), + TextureFactory.of( + MACHINE_CASINGS[2][0], + TextureFactory.of( + TextureFactory.of(OVERLAY_ACTIVITYDETECTOR), + TextureFactory.builder() + .addIcon(OVERLAY_ACTIVITYDETECTOR_GLOW) + .glow() + .build())), + new GT_Cover_NeedMaintainance()); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + ItemList.Emitter_MV.get(1L), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Aluminium, 1L), + GT_Utility.getIntegratedCircuit(1) + }, + GT_Values.NF, + ItemList.Cover_NeedsMaintainance.get(1L), + 600, + 24); + + GT_ModHandler.addCraftingRecipe(ItemList.ItemFilter_Export.get(1L), new Object[] { + "SPS", + "dIC", + "SPS", + 'P', + OrePrefixes.plate.get(Materials.Tin), + 'S', + OrePrefixes.screw.get(Materials.Iron), + 'I', + ItemList.Component_Filter, + 'C', + ItemList.Conveyor_Module_LV + }); + GT_ModHandler.addCraftingRecipe(ItemList.ItemFilter_Import.get(1L), new Object[] { + "SPS", + "CId", + "SPS", + 'P', + OrePrefixes.plate.get(Materials.Tin), + 'S', + OrePrefixes.screw.get(Materials.Iron), + 'I', + ItemList.Component_Filter, + 'C', + ItemList.Conveyor_Module_LV + }); + GT_ModHandler.addShapelessCraftingRecipe( + ItemList.ItemFilter_Export.get(1L), new Object[] {ItemList.ItemFilter_Import.get(1L)}); + GT_ModHandler.addShapelessCraftingRecipe( + ItemList.ItemFilter_Import.get(1L), new Object[] {ItemList.ItemFilter_Export.get(1L)}); + + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Tin, 2L), + ItemList.Component_Filter.get(1L), + ItemList.Conveyor_Module_LV.get(1L), + GT_Utility.getIntegratedCircuit(1) + }, + null, + ItemList.ItemFilter_Export.get(1L), + 100, + 30); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Tin, 2L), + ItemList.Component_Filter.get(1L), + ItemList.Conveyor_Module_LV.get(1L), + GT_Utility.getIntegratedCircuit(2) + }, + null, + ItemList.ItemFilter_Import.get(1L), + 100, + 30); + + GT_ModHandler.addCraftingRecipe( + ItemList.Tool_Cover_Copy_Paste.get(1L), + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { + "PSP", + "PCP", + "PBP", + 'P', + OrePrefixes.plate.get(Materials.Aluminium), + 'S', + ItemList.Tool_DataStick.get(1L), + 'C', + ItemList.Cover_Screen.get(1L), + 'B', + ItemList.Battery_RE_MV_Lithium.get(1L) + }); } - private static final Map<Materials,Materials> cauldronRemap =new HashMap<>(); + private static final Map<Materials, Materials> cauldronRemap = new HashMap<>(); - public static void registerCauldronCleaningFor(Materials in,Materials out){ - cauldronRemap.put(in,out); + public static void registerCauldronCleaningFor(Materials in, Materials out) { + cauldronRemap.put(in, out); } @Override @@ -969,9 +4847,10 @@ public class GT_MetaGenerated_Item_01 extends GT_MetaGenerated_Item_X32 { byte tMetaData = (byte) aItemEntity.worldObj.getBlockMetadata(tX, tY, tZ); if ((tBlock == Blocks.cauldron) && (tMetaData > 0)) { - aMaterial= cauldronRemap.getOrDefault(aMaterial,aMaterial); + aMaterial = cauldronRemap.getOrDefault(aMaterial, aMaterial); - aItemEntity.setEntityItemStack(GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial, aItemEntity.getEntityItem().stackSize)); + aItemEntity.setEntityItemStack(GT_OreDictUnificator.get( + OrePrefixes.dust, aMaterial, aItemEntity.getEntityItem().stackSize)); aItemEntity.worldObj.setBlockMetadataWithNotify(tX, tY, tZ, tMetaData - 1, 3); return true; } @@ -979,11 +4858,12 @@ public class GT_MetaGenerated_Item_01 extends GT_MetaGenerated_Item_X32 { Block tBlock = aItemEntity.worldObj.getBlock(tX, tY, tZ); byte tMetaData = (byte) aItemEntity.worldObj.getBlockMetadata(tX, tY, tZ); if ((tBlock == Blocks.cauldron) && (tMetaData > 0)) { - aItemEntity.setEntityItemStack(GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial, aItemEntity.getEntityItem().stackSize)); + aItemEntity.setEntityItemStack(GT_OreDictUnificator.get( + OrePrefixes.crushedPurified, aMaterial, aItemEntity.getEntityItem().stackSize)); aItemEntity.worldObj.setBlockMetadataWithNotify(tX, tY, tZ, tMetaData - 1, 3); return true; } - } else if(aPrefix == OrePrefixes.dust && aMaterial == Materials.Wheat) { + } else if (aPrefix == OrePrefixes.dust && aMaterial == Materials.Wheat) { Block tBlock = aItemEntity.worldObj.getBlock(tX, tY, tZ); byte tMetaData = (byte) aItemEntity.worldObj.getBlockMetadata(tX, tY, tZ); if ((tBlock == Blocks.cauldron) && (tMetaData > 0)) { @@ -1014,11 +4894,11 @@ public class GT_MetaGenerated_Item_01 extends GT_MetaGenerated_Item_X32 { public boolean isPlasmaCellUsed(OrePrefixes aPrefix, Materials aMaterial) { Collection<GT_Recipe> fusionRecipes = GT_Recipe.GT_Recipe_Map.sFusionRecipes.mRecipeList; - if(aPrefix == OrePrefixes.cellPlasma && aMaterial.getPlasma(1L) != null) { //Materials has a plasma fluid - for(GT_Recipe recipe : fusionRecipes) { //Loop through fusion recipes - if(recipe.getFluidOutput(0) != null) { //Make sure fluid output can't be null (not sure if possible) + if (aPrefix == OrePrefixes.cellPlasma && aMaterial.getPlasma(1L) != null) { // Materials has a plasma fluid + for (GT_Recipe recipe : fusionRecipes) { // Loop through fusion recipes + if (recipe.getFluidOutput(0) != null) { // Make sure fluid output can't be null (not sure if possible) if (recipe.getFluidOutput(0).isFluidEqual(aMaterial.getPlasma(1L))) - return true; //Fusion recipe output matches current plasma cell fluid + return true; // Fusion recipe output matches current plasma cell fluid } } } @@ -1027,7 +4907,17 @@ public class GT_MetaGenerated_Item_01 extends GT_MetaGenerated_Item_X32 { @Override public boolean doesShowInCreative(OrePrefixes aPrefix, Materials aMaterial, boolean aDoShowAllItems) { - return (aDoShowAllItems) || (((aPrefix != OrePrefixes.gem) || (!aMaterial.mName.startsWith("Infused"))) && (aPrefix != OrePrefixes.dustTiny) && (aPrefix != OrePrefixes.dustSmall) && (aPrefix != OrePrefixes.dustImpure) && (aPrefix != OrePrefixes.dustPure) && (aPrefix != OrePrefixes.crushed) && (aPrefix != OrePrefixes.crushedPurified) && (aPrefix != OrePrefixes.crushedCentrifuged) && (aPrefix != OrePrefixes.ingotHot) && !(aPrefix == OrePrefixes.cellPlasma && !isPlasmaCellUsed(aPrefix, aMaterial))); + return (aDoShowAllItems) + || (((aPrefix != OrePrefixes.gem) || (!aMaterial.mName.startsWith("Infused"))) + && (aPrefix != OrePrefixes.dustTiny) + && (aPrefix != OrePrefixes.dustSmall) + && (aPrefix != OrePrefixes.dustImpure) + && (aPrefix != OrePrefixes.dustPure) + && (aPrefix != OrePrefixes.crushed) + && (aPrefix != OrePrefixes.crushedPurified) + && (aPrefix != OrePrefixes.crushedCentrifuged) + && (aPrefix != OrePrefixes.ingotHot) + && !(aPrefix == OrePrefixes.cellPlasma && !isPlasmaCellUsed(aPrefix, aMaterial))); } @Override diff --git a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_02.java b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_02.java index 6320ba9ead..af5c1dc457 100644 --- a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_02.java +++ b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_02.java @@ -34,222 +34,1774 @@ import net.minecraft.world.World; public class GT_MetaGenerated_Item_02 extends GT_MetaGenerated_Item_X32 { public static GT_MetaGenerated_Item_02 INSTANCE; - private static final String aTextCover = "Usable as Cover"; private static final String aTextForestry = "Forestry"; + private static final String aTextCover = "Usable as Cover"; + private static final String aTextForestry = "Forestry"; public GT_MetaGenerated_Item_02() { - super("metaitem.02", OrePrefixes.toolHeadSword, OrePrefixes.toolHeadPickaxe, OrePrefixes.toolHeadShovel, OrePrefixes.toolHeadAxe, OrePrefixes.toolHeadHoe, OrePrefixes.toolHeadHammer, OrePrefixes.toolHeadFile, OrePrefixes.toolHeadSaw, OrePrefixes.toolHeadDrill, OrePrefixes.toolHeadChainsaw, OrePrefixes.toolHeadWrench, OrePrefixes.toolHeadUniversalSpade, OrePrefixes.toolHeadSense, OrePrefixes.toolHeadPlow, OrePrefixes.toolHeadArrow, OrePrefixes.toolHeadBuzzSaw, OrePrefixes.turbineBlade, null, OrePrefixes.itemCasing, OrePrefixes.wireFine, OrePrefixes.gearGtSmall, OrePrefixes.rotor, OrePrefixes.stickLong, OrePrefixes.springSmall, OrePrefixes.spring, OrePrefixes.arrowGtWood, OrePrefixes.arrowGtPlastic, OrePrefixes.gemChipped, OrePrefixes.gemFlawed, OrePrefixes.gemFlawless, OrePrefixes.gemExquisite, OrePrefixes.gearGt); + super( + "metaitem.02", + OrePrefixes.toolHeadSword, + OrePrefixes.toolHeadPickaxe, + OrePrefixes.toolHeadShovel, + OrePrefixes.toolHeadAxe, + OrePrefixes.toolHeadHoe, + OrePrefixes.toolHeadHammer, + OrePrefixes.toolHeadFile, + OrePrefixes.toolHeadSaw, + OrePrefixes.toolHeadDrill, + OrePrefixes.toolHeadChainsaw, + OrePrefixes.toolHeadWrench, + OrePrefixes.toolHeadUniversalSpade, + OrePrefixes.toolHeadSense, + OrePrefixes.toolHeadPlow, + OrePrefixes.toolHeadArrow, + OrePrefixes.toolHeadBuzzSaw, + OrePrefixes.turbineBlade, + null, + OrePrefixes.itemCasing, + OrePrefixes.wireFine, + OrePrefixes.gearGtSmall, + OrePrefixes.rotor, + OrePrefixes.stickLong, + OrePrefixes.springSmall, + OrePrefixes.spring, + OrePrefixes.arrowGtWood, + OrePrefixes.arrowGtPlastic, + OrePrefixes.gemChipped, + OrePrefixes.gemFlawed, + OrePrefixes.gemFlawless, + OrePrefixes.gemExquisite, + OrePrefixes.gearGt); INSTANCE = this; int tLastID = 0; - ItemList.ThermosCan_Dark_Coffee.set(addItem(tLastID = 0, "Dark Coffee", "Coffee, dark, without anything else", new GT_FoodStat(2, 0.2F, EnumAction.drink, ItemList.ThermosCan_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.moveSpeed.id, 400, 1, 70, Potion.digSpeed.id, 400, 1, 70), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.GELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 2L))); - ItemList.ThermosCan_Dark_Cafe_au_lait.set(addItem(tLastID = 1, "Dark Coffee au lait", "Keeping you awake the whole night", SubTag.INVISIBLE, new GT_FoodStat(2, 0.2F, EnumAction.drink, ItemList.ThermosCan_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.moveSpeed.id, 400, 2, 90, Potion.digSpeed.id, 400, 2, 90), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.GELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 3L))); - ItemList.ThermosCan_Coffee.set(addItem(tLastID = 2, "Coffee", "Just the regular morning Coffee", new GT_FoodStat(3, 0.4F, EnumAction.drink, ItemList.ThermosCan_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.moveSpeed.id, 400, 0, 50, Potion.digSpeed.id, 400, 0, 50), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.GELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 1L))); - ItemList.ThermosCan_Cafe_au_lait.set(addItem(tLastID = 3, "Cafe au lait", "Sweet Coffee", new GT_FoodStat(3, 0.4F, EnumAction.drink, ItemList.ThermosCan_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.moveSpeed.id, 400, 1, 70, Potion.digSpeed.id, 400, 1, 70), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.GELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 2L))); - ItemList.ThermosCan_Lait_au_cafe.set(addItem(tLastID = 4, "Lait au cafe", "You want Coffee to your Sugar?", SubTag.INVISIBLE, new GT_FoodStat(3, 0.4F, EnumAction.drink, ItemList.ThermosCan_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.moveSpeed.id, 400, 2, 90, Potion.digSpeed.id, 400, 2, 90), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.GELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 3L))); - ItemList.ThermosCan_Dark_Chocolate_Milk.set(addItem(tLastID = 5, "Dark Chocolate Milk", "A bit bitter, better add a bit Sugar", new GT_FoodStat(3, 0.4F, EnumAction.drink, ItemList.ThermosCan_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.regeneration.id, 50, 1, 60), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.GELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.SANO, 1L))); - ItemList.ThermosCan_Chocolate_Milk.set(addItem(tLastID = 6, "Chocolate Milk", "Sweet Goodness", new GT_FoodStat(3, 0.4F, EnumAction.drink, ItemList.ThermosCan_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.regeneration.id, 50, 1, 90), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.GELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.SANO, 2L))); - ItemList.ThermosCan_Tea.set(addItem(tLastID = 7, "Tea", "Keep calm and carry on", new GT_FoodStat(2, 0.2F, EnumAction.drink, ItemList.ThermosCan_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.moveSlowdown.id, 300, 0, 50), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.GELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 2L))); - ItemList.ThermosCan_Sweet_Tea.set(addItem(tLastID = 8, "Sweet Tea", "How about a Tea Party? In Boston?", SubTag.INVISIBLE, new GT_FoodStat(2, 0.2F, EnumAction.drink, ItemList.ThermosCan_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.GELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 2L))); - ItemList.ThermosCan_Ice_Tea.set(addItem(tLastID = 9, "Ice Tea", "Better than this purple Junk Drink from failed Potions", new GT_FoodStat(2, 0.2F, EnumAction.drink, ItemList.ThermosCan_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.moveSlowdown.id, 300, 0, 50), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.GELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 2L))); + ItemList.ThermosCan_Dark_Coffee.set(addItem( + tLastID = 0, + "Dark Coffee", + "Coffee, dark, without anything else", + new GT_FoodStat( + 2, + 0.2F, + EnumAction.drink, + ItemList.ThermosCan_Empty.get(1L), + GregTech_API.sDrinksAlwaysDrinkable, + false, + false, + Potion.moveSpeed.id, + 400, + 1, + 70, + Potion.digSpeed.id, + 400, + 1, + 70), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.GELUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 2L))); + ItemList.ThermosCan_Dark_Cafe_au_lait.set(addItem( + tLastID = 1, + "Dark Coffee au lait", + "Keeping you awake the whole night", + SubTag.INVISIBLE, + new GT_FoodStat( + 2, + 0.2F, + EnumAction.drink, + ItemList.ThermosCan_Empty.get(1L), + GregTech_API.sDrinksAlwaysDrinkable, + false, + false, + Potion.moveSpeed.id, + 400, + 2, + 90, + Potion.digSpeed.id, + 400, + 2, + 90), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.GELUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 3L))); + ItemList.ThermosCan_Coffee.set(addItem( + tLastID = 2, + "Coffee", + "Just the regular morning Coffee", + new GT_FoodStat( + 3, + 0.4F, + EnumAction.drink, + ItemList.ThermosCan_Empty.get(1L), + GregTech_API.sDrinksAlwaysDrinkable, + false, + false, + Potion.moveSpeed.id, + 400, + 0, + 50, + Potion.digSpeed.id, + 400, + 0, + 50), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.GELUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 1L))); + ItemList.ThermosCan_Cafe_au_lait.set(addItem( + tLastID = 3, + "Cafe au lait", + "Sweet Coffee", + new GT_FoodStat( + 3, + 0.4F, + EnumAction.drink, + ItemList.ThermosCan_Empty.get(1L), + GregTech_API.sDrinksAlwaysDrinkable, + false, + false, + Potion.moveSpeed.id, + 400, + 1, + 70, + Potion.digSpeed.id, + 400, + 1, + 70), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.GELUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 2L))); + ItemList.ThermosCan_Lait_au_cafe.set(addItem( + tLastID = 4, + "Lait au cafe", + "You want Coffee to your Sugar?", + SubTag.INVISIBLE, + new GT_FoodStat( + 3, + 0.4F, + EnumAction.drink, + ItemList.ThermosCan_Empty.get(1L), + GregTech_API.sDrinksAlwaysDrinkable, + false, + false, + Potion.moveSpeed.id, + 400, + 2, + 90, + Potion.digSpeed.id, + 400, + 2, + 90), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.GELUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 3L))); + ItemList.ThermosCan_Dark_Chocolate_Milk.set(addItem( + tLastID = 5, + "Dark Chocolate Milk", + "A bit bitter, better add a bit Sugar", + new GT_FoodStat( + 3, + 0.4F, + EnumAction.drink, + ItemList.ThermosCan_Empty.get(1L), + GregTech_API.sDrinksAlwaysDrinkable, + false, + false, + Potion.regeneration.id, + 50, + 1, + 60), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.GELUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.SANO, 1L))); + ItemList.ThermosCan_Chocolate_Milk.set(addItem( + tLastID = 6, + "Chocolate Milk", + "Sweet Goodness", + new GT_FoodStat( + 3, + 0.4F, + EnumAction.drink, + ItemList.ThermosCan_Empty.get(1L), + GregTech_API.sDrinksAlwaysDrinkable, + false, + false, + Potion.regeneration.id, + 50, + 1, + 90), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.GELUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.SANO, 2L))); + ItemList.ThermosCan_Tea.set(addItem( + tLastID = 7, + "Tea", + "Keep calm and carry on", + new GT_FoodStat( + 2, + 0.2F, + EnumAction.drink, + ItemList.ThermosCan_Empty.get(1L), + GregTech_API.sDrinksAlwaysDrinkable, + false, + false, + Potion.moveSlowdown.id, + 300, + 0, + 50), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.GELUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 2L))); + ItemList.ThermosCan_Sweet_Tea.set(addItem( + tLastID = 8, + "Sweet Tea", + "How about a Tea Party? In Boston?", + SubTag.INVISIBLE, + new GT_FoodStat( + 2, + 0.2F, + EnumAction.drink, + ItemList.ThermosCan_Empty.get(1L), + GregTech_API.sDrinksAlwaysDrinkable, + false, + false), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.GELUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 2L))); + ItemList.ThermosCan_Ice_Tea.set(addItem( + tLastID = 9, + "Ice Tea", + "Better than this purple Junk Drink from failed Potions", + new GT_FoodStat( + 2, + 0.2F, + EnumAction.drink, + ItemList.ThermosCan_Empty.get(1L), + GregTech_API.sDrinksAlwaysDrinkable, + false, + false, + Potion.moveSlowdown.id, + 300, + 0, + 50), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.GELUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 2L))); ItemList.GelledToluene.set(addItem(tLastID = 10, "Gelled Toluene", "Raw Explosive")); - ItemList.Bottle_Purple_Drink.set(addItem(tLastID = 100, "Purple Drink", "How about Lemonade. Or some Ice Tea? I got Purple Drink!", new GT_FoodStat(8, 0.2F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.moveSlowdown.id, 400, 1, 90), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VINCULUM, 1L))); - ItemList.Bottle_Grape_Juice.set(addItem(tLastID = 101, "Grape Juice", "This has a cleaning effect on your internals.", new GT_FoodStat(4, 0.2F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.hunger.id, 400, 1, 60), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.SANO, 1L))); - ItemList.Bottle_Wine.set(addItem(tLastID = 102, "Wine", "Ordinary", new GT_FoodStat(2, 0.2F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.confusion.id, 400, 1, 60, Potion.heal.id, 0, 0, 60, Potion.poison.id, 200, 1, 5), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.SANO, 1L))); - ItemList.Bottle_Vinegar.set(addItem(tLastID = 103, "Vinegar", "Exquisite", new GT_FoodStat(2, 0.2F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.confusion.id, 400, 1, 90, Potion.heal.id, 0, 1, 90, Potion.poison.id, 200, 2, 10, Potion.harm.id, 0, 2, 5), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.SANO, 1L))); - ItemList.Bottle_Potato_Juice.set(addItem(tLastID = 104, "Potato Juice", "Ever seen Potato Juice in stores? No? That has a reason.", SubTag.INVISIBLE, new GT_FoodStat(3, 0.3F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L))); - ItemList.Bottle_Vodka.set(addItem(tLastID = 105, "Vodka", "Not to confuse with Water", new GT_FoodStat(2, 0.2F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.confusion.id, 500, 0, 60, Potion.damageBoost.id, 500, 1, 60, Potion.poison.id, 200, 1, 5), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L))); - ItemList.Bottle_Leninade.set(addItem(tLastID = 106, "Leninade", "Let the Communism flow through you!", SubTag.INVISIBLE, new GT_FoodStat(2, 0.2F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.confusion.id, 500, 1, 90, Potion.damageBoost.id, 500, 2, 90, Potion.poison.id, 200, 2, 10, Potion.harm.id, 0, 2, 5), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 2L))); - ItemList.Bottle_Mineral_Water.set(addItem(tLastID = 107, "Mineral Water", "The best Stuff you can drink to stay healthy", new GT_FoodStat(1, 0.1F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.regeneration.id, 100, 1, 10), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.SANO, 1L))); - ItemList.Bottle_Salty_Water.set(addItem(tLastID = 108, "Salty Water", "Like Sea Water but less dirty", SubTag.INVISIBLE, new GT_FoodStat(1, 0.0F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.hunger.id, 400, 2, 95), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.TEMPESTAS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); - ItemList.Bottle_Reed_Water.set(addItem(tLastID = 109, "Reed Water", "I guess this tastes better when fermented", new GT_FoodStat(1, 0.1F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L))); - ItemList.Bottle_Rum.set(addItem(tLastID = 110, "Rum", "A buddle o' rum", new GT_FoodStat(4, 0.4F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.confusion.id, 300, 0, 60, Potion.damageBoost.id, 300, 1, 60, Potion.poison.id, 200, 1, 5), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUCRUM, 1L))); - ItemList.Bottle_Pirate_Brew.set(addItem(tLastID = 111, "Pirate Brew", "Set the Sails, we are going to Torrentuga!", new GT_FoodStat(4, 0.4F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.confusion.id, 300, 1, 90, Potion.damageBoost.id, 300, 2, 90, Potion.poison.id, 200, 2, 10, Potion.harm.id, 0, 2, 5), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUCRUM, 2L))); - ItemList.Bottle_Hops_Juice.set(addItem(tLastID = 112, "Hops Juice", "Every Beer has a start", new GT_FoodStat(1, 0.1F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L))); - ItemList.Bottle_Dark_Beer.set(addItem(tLastID = 113, "Dark Beer", "Dark Beer, for the real Men", new GT_FoodStat(4, 0.4F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.confusion.id, 300, 1, 60, Potion.damageBoost.id, 300, 1, 60, Potion.poison.id, 200, 1, 5), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L))); - ItemList.Bottle_Dragon_Blood.set(addItem(tLastID = 114, "Dragon Blood", "FUS RO DAH!", new GT_FoodStat(4, 0.4F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.confusion.id, 300, 2, 90, Potion.damageBoost.id, 300, 2, 90, Potion.poison.id, 200, 2, 10, Potion.harm.id, 0, 2, 5), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 2L))); - ItemList.Bottle_Wheaty_Juice.set(addItem(tLastID = 115, "Wheaty Juice", "Is this liquefied Bread or what?", new GT_FoodStat(2, 0.1F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L))); - ItemList.Bottle_Scotch.set(addItem(tLastID = 116, "Scotch", "Technically this is just a Whisky", SubTag.INVISIBLE, new GT_FoodStat(2, 0.1F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.confusion.id, 400, 0, 60, Potion.resistance.id, 400, 1, 60, Potion.poison.id, 200, 1, 5), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 1L))); - ItemList.Bottle_Glen_McKenner.set(addItem(tLastID = 117, "Glen McKenner", "Don't hand to easily surprised people, they will shatter it.", SubTag.INVISIBLE, new GT_FoodStat(2, 0.1F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.confusion.id, 400, 1, 90, Potion.resistance.id, 400, 2, 90, Potion.poison.id, 200, 2, 10, Potion.harm.id, 0, 2, 5), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 2L))); - ItemList.Bottle_Wheaty_Hops_Juice.set(addItem(tLastID = 118, "Wheaty Hops Juice", "Also known as 'Duff-Lite'", new GT_FoodStat(1, 0.1F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 2L))); - ItemList.Bottle_Beer.set(addItem(tLastID = 119, "Beer", "Good old Beer", new GT_FoodStat(6, 0.4F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.confusion.id, 400, 0, 60, Potion.digSpeed.id, 400, 2, 60, Potion.poison.id, 100, 0, 5), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERFODIO, 1L))); - ItemList.Bottle_Chilly_Sauce.set(addItem(tLastID = 120, "Chilly Sauce", "Spicy", new GT_FoodStat(2, 0.1F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.confusion.id, 1000, 0, 10, Potion.fireResistance.id, 1000, 0, 60), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); - ItemList.Bottle_Hot_Sauce.set(addItem(tLastID = 121, "Hot Sauce", "Very Spicy, I guess?", new GT_FoodStat(2, 0.1F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.confusion.id, 2000, 0, 30, Potion.fireResistance.id, 2000, 0, 70), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 2L))); - ItemList.Bottle_Diabolo_Sauce.set(addItem(tLastID = 122, "Diabolo Sauce", "As if the Devil made this Sauce", SubTag.INVISIBLE, new GT_FoodStat(2, 0.1F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.confusion.id, 3000, 1, 50, Potion.fireResistance.id, 3000, 0, 80), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 3L))); - ItemList.Bottle_Diablo_Sauce.set(addItem(tLastID = 123, "Diablo Sauce", "Diablo always comes back!", SubTag.INVISIBLE, new GT_FoodStat(2, 0.1F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.confusion.id, 4000, 1, 70, Potion.fireResistance.id, 4000, 0, 90), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 4L))); - ItemList.Bottle_Snitches_Glitch_Sauce.set(addItem(tLastID = 124, "Old Man Snitches glitched Diablo Sauce", "[Missing No]", SubTag.INVISIBLE, new GT_FoodStat(2, 0.1F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.confusion.id, 9999, 2, 999, Potion.fireResistance.id, 9999, 9, 999), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 3L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 5L))); - ItemList.Bottle_Apple_Juice.set(addItem(tLastID = 125, "Apple Juice", "Made of the Apples from our best Oak Farms", new GT_FoodStat(4, 0.2F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.hunger.id, 400, 0, 20), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L))); - ItemList.Bottle_Cider.set(addItem(tLastID = 126, "Cider", "If you have nothing better to do with your Apples", new GT_FoodStat(4, 0.2F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.confusion.id, 400, 0, 60, Potion.resistance.id, 400, 1, 60, Potion.poison.id, 200, 1, 5), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 1L))); - ItemList.Bottle_Golden_Apple_Juice.set(addItem(tLastID = 127, "Golden Apple Juice", "A golden Apple in liquid form", SubTag.INVISIBLE, new GT_FoodStat(4, 0.2F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.hunger.id, 400, 0, 20, Potion.field_76444_x.id, 2400, 0, 100, Potion.regeneration.id, 100, 1, 100), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.SANO, 1L))); - ItemList.Bottle_Golden_Cider.set(addItem(tLastID = 128, "Golden Cider", "More Resistance, less Regeneration", SubTag.INVISIBLE, new GT_FoodStat(4, 0.2F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.confusion.id, 400, 0, 60, Potion.field_76444_x.id, 2400, 1, 95, Potion.poison.id, 200, 1, 5), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 1L))); - ItemList.Bottle_Iduns_Apple_Juice.set(addItem(tLastID = 129, "Idun's Apple Juice", "So you got the Idea of using Notch Apples for a drink?", SubTag.INVISIBLE, new GT_FoodStat(4, 0.2F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.regeneration.id, 600, 4, 100, Potion.field_76444_x.id, 2400, 0, 100, Potion.resistance.id, 6000, 0, 100, Potion.fireResistance.id, 6000, 0, 100), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.NEBRISUM, 9L))); - ItemList.Bottle_Notches_Brew.set(addItem(tLastID = 130, "Notches Brew", "This is just overpowered", SubTag.INVISIBLE, new GT_FoodStat(4, 0.2F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.regeneration.id, 700, 4, 95, Potion.field_76444_x.id, 3000, 1, 95, Potion.resistance.id, 7000, 1, 95, Potion.fireResistance.id, 7000, 0, 95, Potion.harm.id, 0, 2, 20), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.NEBRISUM, 9L))); - ItemList.Bottle_Lemon_Juice.set(addItem(tLastID = 131, "Lemon Juice", "Maybe adding Sugar will make it less sour", new GT_FoodStat(2, 0.4F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.digSpeed.id, 1200, 0, 60), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERFODIO, 1L))); - ItemList.Bottle_Limoncello.set(addItem(tLastID = 132, "Limoncello", "An alcoholic Drink which tastes like Lemons", new GT_FoodStat(2, 0.4F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.digSpeed.id, 1200, 0, 90, Potion.poison.id, 200, 1, 5), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERFODIO, 1L))); - ItemList.Bottle_Lemonade.set(addItem(tLastID = 133, "Lemonade", "Cold and refreshing Lemonade", new GT_FoodStat(4, 0.3F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.digSpeed.id, 900, 1, 90), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERFODIO, 1L))); - ItemList.Bottle_Alcopops.set(addItem(tLastID = 134, "Alcopops", "Don't let your Children drink this junk!", new GT_FoodStat(2, 0.2F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.digSpeed.id, 900, 1, 90, Potion.poison.id, 300, 2, 20), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VINCULUM, 1L))); - ItemList.Bottle_Cave_Johnsons_Grenade_Juice.set(addItem(tLastID = 135, "Cave Johnson's Grenade Juice", "When life gives you Lemons, make Life take them Lemons back!", SubTag.INVISIBLE, new GT_FoodStat(0, 0.0F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false).setExplosive(), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MORTUUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERDITIO, 1L))); - ItemList.Bottle_Milk.set(addItem(tLastID = 136, "Milk", "Got Milk?", OrePrefixes.bottle.get(Materials.Milk), new GT_FoodStat(0, 0.0F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false).setMilk(), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.SANO, 1L))); - ItemList.Bottle_Holy_Water.set(addItem(tLastID = 137, "Holy Water", "May the holy Planks be with you", OrePrefixes.bottle.get(Materials.HolyWater), new GT_FoodStat(0, 0.0F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.poison.id, 100, 1, 100).setMilk(), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AURAM, 1L))); - - - - ItemList.Food_Potato_On_Stick.set(addItem(tLastID = 200, "Potato on a Stick", "Totally looks like a Crab Claw", new GT_FoodStat(1, 0.3F, EnumAction.eat, new ItemStack(Items.stick, 1), false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); - ItemList.Food_Potato_On_Stick_Roasted.set(addItem(tLastID = 201, "Roasted Potato on a Stick", "Still looks like a Crab Claw", new GT_FoodStat(6, 0.6F, EnumAction.eat, new ItemStack(Items.stick, 1), false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); - ItemList.Food_Raw_Fries.set(addItem(tLastID = 202, "Potato Strips", "It's Potato in Stripe Form", new GT_FoodStat(1, 0.3F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L))); + ItemList.Bottle_Purple_Drink.set(addItem( + tLastID = 100, + "Purple Drink", + "How about Lemonade. Or some Ice Tea? I got Purple Drink!", + new GT_FoodStat( + 8, + 0.2F, + EnumAction.drink, + ItemList.Bottle_Empty.get(1L), + GregTech_API.sDrinksAlwaysDrinkable, + false, + false, + Potion.moveSlowdown.id, + 400, + 1, + 90), + new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VINCULUM, 1L))); + ItemList.Bottle_Grape_Juice.set(addItem( + tLastID = 101, + "Grape Juice", + "This has a cleaning effect on your internals.", + new GT_FoodStat( + 4, + 0.2F, + EnumAction.drink, + ItemList.Bottle_Empty.get(1L), + GregTech_API.sDrinksAlwaysDrinkable, + false, + false, + Potion.hunger.id, + 400, + 1, + 60), + new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.SANO, 1L))); + ItemList.Bottle_Wine.set(addItem( + tLastID = 102, + "Wine", + "Ordinary", + new GT_FoodStat( + 2, + 0.2F, + EnumAction.drink, + ItemList.Bottle_Empty.get(1L), + GregTech_API.sDrinksAlwaysDrinkable, + false, + false, + Potion.confusion.id, + 400, + 1, + 60, + Potion.heal.id, + 0, + 0, + 60, + Potion.poison.id, + 200, + 1, + 5), + new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.SANO, 1L))); + ItemList.Bottle_Vinegar.set(addItem( + tLastID = 103, + "Vinegar", + "Exquisite", + new GT_FoodStat( + 2, + 0.2F, + EnumAction.drink, + ItemList.Bottle_Empty.get(1L), + GregTech_API.sDrinksAlwaysDrinkable, + false, + false, + Potion.confusion.id, + 400, + 1, + 90, + Potion.heal.id, + 0, + 1, + 90, + Potion.poison.id, + 200, + 2, + 10, + Potion.harm.id, + 0, + 2, + 5), + new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.SANO, 1L))); + ItemList.Bottle_Potato_Juice.set(addItem( + tLastID = 104, + "Potato Juice", + "Ever seen Potato Juice in stores? No? That has a reason.", + SubTag.INVISIBLE, + new GT_FoodStat( + 3, + 0.3F, + EnumAction.drink, + ItemList.Bottle_Empty.get(1L), + GregTech_API.sDrinksAlwaysDrinkable, + false, + false), + new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L))); + ItemList.Bottle_Vodka.set(addItem( + tLastID = 105, + "Vodka", + "Not to confuse with Water", + new GT_FoodStat( + 2, + 0.2F, + EnumAction.drink, + ItemList.Bottle_Empty.get(1L), + GregTech_API.sDrinksAlwaysDrinkable, + false, + false, + Potion.confusion.id, + 500, + 0, + 60, + Potion.damageBoost.id, + 500, + 1, + 60, + Potion.poison.id, + 200, + 1, + 5), + new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L))); + ItemList.Bottle_Leninade.set(addItem( + tLastID = 106, + "Leninade", + "Let the Communism flow through you!", + SubTag.INVISIBLE, + new GT_FoodStat( + 2, + 0.2F, + EnumAction.drink, + ItemList.Bottle_Empty.get(1L), + GregTech_API.sDrinksAlwaysDrinkable, + false, + false, + Potion.confusion.id, + 500, + 1, + 90, + Potion.damageBoost.id, + 500, + 2, + 90, + Potion.poison.id, + 200, + 2, + 10, + Potion.harm.id, + 0, + 2, + 5), + new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 2L))); + ItemList.Bottle_Mineral_Water.set(addItem( + tLastID = 107, + "Mineral Water", + "The best Stuff you can drink to stay healthy", + new GT_FoodStat( + 1, + 0.1F, + EnumAction.drink, + ItemList.Bottle_Empty.get(1L), + GregTech_API.sDrinksAlwaysDrinkable, + false, + false, + Potion.regeneration.id, + 100, + 1, + 10), + new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.SANO, 1L))); + ItemList.Bottle_Salty_Water.set(addItem( + tLastID = 108, + "Salty Water", + "Like Sea Water but less dirty", + SubTag.INVISIBLE, + new GT_FoodStat( + 1, + 0.0F, + EnumAction.drink, + ItemList.Bottle_Empty.get(1L), + GregTech_API.sDrinksAlwaysDrinkable, + false, + false, + Potion.hunger.id, + 400, + 2, + 95), + new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.TEMPESTAS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); + ItemList.Bottle_Reed_Water.set(addItem( + tLastID = 109, + "Reed Water", + "I guess this tastes better when fermented", + new GT_FoodStat( + 1, + 0.1F, + EnumAction.drink, + ItemList.Bottle_Empty.get(1L), + GregTech_API.sDrinksAlwaysDrinkable, + false, + false), + new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L))); + ItemList.Bottle_Rum.set(addItem( + tLastID = 110, + "Rum", + "A buddle o' rum", + new GT_FoodStat( + 4, + 0.4F, + EnumAction.drink, + ItemList.Bottle_Empty.get(1L), + GregTech_API.sDrinksAlwaysDrinkable, + false, + false, + Potion.confusion.id, + 300, + 0, + 60, + Potion.damageBoost.id, + 300, + 1, + 60, + Potion.poison.id, + 200, + 1, + 5), + new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.LUCRUM, 1L))); + ItemList.Bottle_Pirate_Brew.set(addItem( + tLastID = 111, + "Pirate Brew", + "Set the Sails, we are going to Torrentuga!", + new GT_FoodStat( + 4, + 0.4F, + EnumAction.drink, + ItemList.Bottle_Empty.get(1L), + GregTech_API.sDrinksAlwaysDrinkable, + false, + false, + Potion.confusion.id, + 300, + 1, + 90, + Potion.damageBoost.id, + 300, + 2, + 90, + Potion.poison.id, + 200, + 2, + 10, + Potion.harm.id, + 0, + 2, + 5), + new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.LUCRUM, 2L))); + ItemList.Bottle_Hops_Juice.set(addItem( + tLastID = 112, + "Hops Juice", + "Every Beer has a start", + new GT_FoodStat( + 1, + 0.1F, + EnumAction.drink, + ItemList.Bottle_Empty.get(1L), + GregTech_API.sDrinksAlwaysDrinkable, + false, + false), + new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L))); + ItemList.Bottle_Dark_Beer.set(addItem( + tLastID = 113, + "Dark Beer", + "Dark Beer, for the real Men", + new GT_FoodStat( + 4, + 0.4F, + EnumAction.drink, + ItemList.Bottle_Empty.get(1L), + GregTech_API.sDrinksAlwaysDrinkable, + false, + false, + Potion.confusion.id, + 300, + 1, + 60, + Potion.damageBoost.id, + 300, + 1, + 60, + Potion.poison.id, + 200, + 1, + 5), + new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L))); + ItemList.Bottle_Dragon_Blood.set(addItem( + tLastID = 114, + "Dragon Blood", + "FUS RO DAH!", + new GT_FoodStat( + 4, + 0.4F, + EnumAction.drink, + ItemList.Bottle_Empty.get(1L), + GregTech_API.sDrinksAlwaysDrinkable, + false, + false, + Potion.confusion.id, + 300, + 2, + 90, + Potion.damageBoost.id, + 300, + 2, + 90, + Potion.poison.id, + 200, + 2, + 10, + Potion.harm.id, + 0, + 2, + 5), + new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 2L))); + ItemList.Bottle_Wheaty_Juice.set(addItem( + tLastID = 115, + "Wheaty Juice", + "Is this liquefied Bread or what?", + new GT_FoodStat( + 2, + 0.1F, + EnumAction.drink, + ItemList.Bottle_Empty.get(1L), + GregTech_API.sDrinksAlwaysDrinkable, + false, + false), + new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L))); + ItemList.Bottle_Scotch.set(addItem( + tLastID = 116, + "Scotch", + "Technically this is just a Whisky", + SubTag.INVISIBLE, + new GT_FoodStat( + 2, + 0.1F, + EnumAction.drink, + ItemList.Bottle_Empty.get(1L), + GregTech_API.sDrinksAlwaysDrinkable, + false, + false, + Potion.confusion.id, + 400, + 0, + 60, + Potion.resistance.id, + 400, + 1, + 60, + Potion.poison.id, + 200, + 1, + 5), + new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 1L))); + ItemList.Bottle_Glen_McKenner.set(addItem( + tLastID = 117, + "Glen McKenner", + "Don't hand to easily surprised people, they will shatter it.", + SubTag.INVISIBLE, + new GT_FoodStat( + 2, + 0.1F, + EnumAction.drink, + ItemList.Bottle_Empty.get(1L), + GregTech_API.sDrinksAlwaysDrinkable, + false, + false, + Potion.confusion.id, + 400, + 1, + 90, + Potion.resistance.id, + 400, + 2, + 90, + Potion.poison.id, + 200, + 2, + 10, + Potion.harm.id, + 0, + 2, + 5), + new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 2L))); + ItemList.Bottle_Wheaty_Hops_Juice.set(addItem( + tLastID = 118, + "Wheaty Hops Juice", + "Also known as 'Duff-Lite'", + new GT_FoodStat( + 1, + 0.1F, + EnumAction.drink, + ItemList.Bottle_Empty.get(1L), + GregTech_API.sDrinksAlwaysDrinkable, + false, + false), + new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 2L))); + ItemList.Bottle_Beer.set(addItem( + tLastID = 119, + "Beer", + "Good old Beer", + new GT_FoodStat( + 6, + 0.4F, + EnumAction.drink, + ItemList.Bottle_Empty.get(1L), + GregTech_API.sDrinksAlwaysDrinkable, + false, + false, + Potion.confusion.id, + 400, + 0, + 60, + Potion.digSpeed.id, + 400, + 2, + 60, + Potion.poison.id, + 100, + 0, + 5), + new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.PERFODIO, 1L))); + ItemList.Bottle_Chilly_Sauce.set(addItem( + tLastID = 120, + "Chilly Sauce", + "Spicy", + new GT_FoodStat( + 2, + 0.1F, + EnumAction.drink, + ItemList.Bottle_Empty.get(1L), + GregTech_API.sDrinksAlwaysDrinkable, + false, + false, + Potion.confusion.id, + 1000, + 0, + 10, + Potion.fireResistance.id, + 1000, + 0, + 60), + new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + ItemList.Bottle_Hot_Sauce.set(addItem( + tLastID = 121, + "Hot Sauce", + "Very Spicy, I guess?", + new GT_FoodStat( + 2, + 0.1F, + EnumAction.drink, + ItemList.Bottle_Empty.get(1L), + GregTech_API.sDrinksAlwaysDrinkable, + false, + false, + Potion.confusion.id, + 2000, + 0, + 30, + Potion.fireResistance.id, + 2000, + 0, + 70), + new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 2L))); + ItemList.Bottle_Diabolo_Sauce.set(addItem( + tLastID = 122, + "Diabolo Sauce", + "As if the Devil made this Sauce", + SubTag.INVISIBLE, + new GT_FoodStat( + 2, + 0.1F, + EnumAction.drink, + ItemList.Bottle_Empty.get(1L), + GregTech_API.sDrinksAlwaysDrinkable, + false, + false, + Potion.confusion.id, + 3000, + 1, + 50, + Potion.fireResistance.id, + 3000, + 0, + 80), + new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 3L))); + ItemList.Bottle_Diablo_Sauce.set(addItem( + tLastID = 123, + "Diablo Sauce", + "Diablo always comes back!", + SubTag.INVISIBLE, + new GT_FoodStat( + 2, + 0.1F, + EnumAction.drink, + ItemList.Bottle_Empty.get(1L), + GregTech_API.sDrinksAlwaysDrinkable, + false, + false, + Potion.confusion.id, + 4000, + 1, + 70, + Potion.fireResistance.id, + 4000, + 0, + 90), + new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 4L))); + ItemList.Bottle_Snitches_Glitch_Sauce.set(addItem( + tLastID = 124, + "Old Man Snitches glitched Diablo Sauce", + "[Missing No]", + SubTag.INVISIBLE, + new GT_FoodStat( + 2, + 0.1F, + EnumAction.drink, + ItemList.Bottle_Empty.get(1L), + GregTech_API.sDrinksAlwaysDrinkable, + false, + false, + Potion.confusion.id, + 9999, + 2, + 999, + Potion.fireResistance.id, + 9999, + 9, + 999), + new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 3L), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 5L))); + ItemList.Bottle_Apple_Juice.set(addItem( + tLastID = 125, + "Apple Juice", + "Made of the Apples from our best Oak Farms", + new GT_FoodStat( + 4, + 0.2F, + EnumAction.drink, + ItemList.Bottle_Empty.get(1L), + GregTech_API.sDrinksAlwaysDrinkable, + false, + false, + Potion.hunger.id, + 400, + 0, + 20), + new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L))); + ItemList.Bottle_Cider.set(addItem( + tLastID = 126, + "Cider", + "If you have nothing better to do with your Apples", + new GT_FoodStat( + 4, + 0.2F, + EnumAction.drink, + ItemList.Bottle_Empty.get(1L), + GregTech_API.sDrinksAlwaysDrinkable, + false, + false, + Potion.confusion.id, + 400, + 0, + 60, + Potion.resistance.id, + 400, + 1, + 60, + Potion.poison.id, + 200, + 1, + 5), + new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 1L))); + ItemList.Bottle_Golden_Apple_Juice.set(addItem( + tLastID = 127, + "Golden Apple Juice", + "A golden Apple in liquid form", + SubTag.INVISIBLE, + new GT_FoodStat( + 4, + 0.2F, + EnumAction.drink, + ItemList.Bottle_Empty.get(1L), + GregTech_API.sDrinksAlwaysDrinkable, + false, + false, + Potion.hunger.id, + 400, + 0, + 20, + Potion.field_76444_x.id, + 2400, + 0, + 100, + Potion.regeneration.id, + 100, + 1, + 100), + new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.SANO, 1L))); + ItemList.Bottle_Golden_Cider.set(addItem( + tLastID = 128, + "Golden Cider", + "More Resistance, less Regeneration", + SubTag.INVISIBLE, + new GT_FoodStat( + 4, + 0.2F, + EnumAction.drink, + ItemList.Bottle_Empty.get(1L), + GregTech_API.sDrinksAlwaysDrinkable, + false, + false, + Potion.confusion.id, + 400, + 0, + 60, + Potion.field_76444_x.id, + 2400, + 1, + 95, + Potion.poison.id, + 200, + 1, + 5), + new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 1L))); + ItemList.Bottle_Iduns_Apple_Juice.set(addItem( + tLastID = 129, + "Idun's Apple Juice", + "So you got the Idea of using Notch Apples for a drink?", + SubTag.INVISIBLE, + new GT_FoodStat( + 4, + 0.2F, + EnumAction.drink, + ItemList.Bottle_Empty.get(1L), + GregTech_API.sDrinksAlwaysDrinkable, + false, + false, + Potion.regeneration.id, + 600, + 4, + 100, + Potion.field_76444_x.id, + 2400, + 0, + 100, + Potion.resistance.id, + 6000, + 0, + 100, + Potion.fireResistance.id, + 6000, + 0, + 100), + new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.NEBRISUM, 9L))); + ItemList.Bottle_Notches_Brew.set(addItem( + tLastID = 130, + "Notches Brew", + "This is just overpowered", + SubTag.INVISIBLE, + new GT_FoodStat( + 4, + 0.2F, + EnumAction.drink, + ItemList.Bottle_Empty.get(1L), + GregTech_API.sDrinksAlwaysDrinkable, + false, + false, + Potion.regeneration.id, + 700, + 4, + 95, + Potion.field_76444_x.id, + 3000, + 1, + 95, + Potion.resistance.id, + 7000, + 1, + 95, + Potion.fireResistance.id, + 7000, + 0, + 95, + Potion.harm.id, + 0, + 2, + 20), + new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.NEBRISUM, 9L))); + ItemList.Bottle_Lemon_Juice.set(addItem( + tLastID = 131, + "Lemon Juice", + "Maybe adding Sugar will make it less sour", + new GT_FoodStat( + 2, + 0.4F, + EnumAction.drink, + ItemList.Bottle_Empty.get(1L), + GregTech_API.sDrinksAlwaysDrinkable, + false, + false, + Potion.digSpeed.id, + 1200, + 0, + 60), + new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.PERFODIO, 1L))); + ItemList.Bottle_Limoncello.set(addItem( + tLastID = 132, + "Limoncello", + "An alcoholic Drink which tastes like Lemons", + new GT_FoodStat( + 2, + 0.4F, + EnumAction.drink, + ItemList.Bottle_Empty.get(1L), + GregTech_API.sDrinksAlwaysDrinkable, + false, + false, + Potion.digSpeed.id, + 1200, + 0, + 90, + Potion.poison.id, + 200, + 1, + 5), + new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.PERFODIO, 1L))); + ItemList.Bottle_Lemonade.set(addItem( + tLastID = 133, + "Lemonade", + "Cold and refreshing Lemonade", + new GT_FoodStat( + 4, + 0.3F, + EnumAction.drink, + ItemList.Bottle_Empty.get(1L), + GregTech_API.sDrinksAlwaysDrinkable, + false, + false, + Potion.digSpeed.id, + 900, + 1, + 90), + new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.PERFODIO, 1L))); + ItemList.Bottle_Alcopops.set(addItem( + tLastID = 134, + "Alcopops", + "Don't let your Children drink this junk!", + new GT_FoodStat( + 2, + 0.2F, + EnumAction.drink, + ItemList.Bottle_Empty.get(1L), + GregTech_API.sDrinksAlwaysDrinkable, + false, + false, + Potion.digSpeed.id, + 900, + 1, + 90, + Potion.poison.id, + 300, + 2, + 20), + new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VINCULUM, 1L))); + ItemList.Bottle_Cave_Johnsons_Grenade_Juice.set(addItem( + tLastID = 135, + "Cave Johnson's Grenade Juice", + "When life gives you Lemons, make Life take them Lemons back!", + SubTag.INVISIBLE, + new GT_FoodStat( + 0, + 0.0F, + EnumAction.drink, + ItemList.Bottle_Empty.get(1L), + GregTech_API.sDrinksAlwaysDrinkable, + false, + false) + .setExplosive(), + new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MORTUUS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.PERDITIO, 1L))); + ItemList.Bottle_Milk.set(addItem( + tLastID = 136, + "Milk", + "Got Milk?", + OrePrefixes.bottle.get(Materials.Milk), + new GT_FoodStat( + 0, + 0.0F, + EnumAction.drink, + ItemList.Bottle_Empty.get(1L), + GregTech_API.sDrinksAlwaysDrinkable, + false, + false) + .setMilk(), + new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.SANO, 1L))); + ItemList.Bottle_Holy_Water.set(addItem( + tLastID = 137, + "Holy Water", + "May the holy Planks be with you", + OrePrefixes.bottle.get(Materials.HolyWater), + new GT_FoodStat( + 0, + 0.0F, + EnumAction.drink, + ItemList.Bottle_Empty.get(1L), + GregTech_API.sDrinksAlwaysDrinkable, + false, + false, + Potion.poison.id, + 100, + 1, + 100) + .setMilk(), + new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AURAM, 1L))); + + ItemList.Food_Potato_On_Stick.set(addItem( + tLastID = 200, + "Potato on a Stick", + "Totally looks like a Crab Claw", + new GT_FoodStat(1, 0.3F, EnumAction.eat, new ItemStack(Items.stick, 1), false, true, false), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + ItemList.Food_Potato_On_Stick_Roasted.set(addItem( + tLastID = 201, + "Roasted Potato on a Stick", + "Still looks like a Crab Claw", + new GT_FoodStat(6, 0.6F, EnumAction.eat, new ItemStack(Items.stick, 1), false, true, false), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + ItemList.Food_Raw_Fries.set(addItem( + tLastID = 202, + "Potato Strips", + "It's Potato in Stripe Form", + new GT_FoodStat(1, 0.3F, EnumAction.eat, null, false, true, false), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L))); setFluidContainerStats(32000 + tLastID, 0L, 16L); - ItemList.Food_Fries.set(addItem(tLastID = 203, "Fries", "Not to confuse with Fry the Delivery Boy", new GT_FoodStat(7, 0.5F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + ItemList.Food_Fries.set(addItem( + tLastID = 203, + "Fries", + "Not to confuse with Fry the Delivery Boy", + new GT_FoodStat(7, 0.5F, EnumAction.eat, null, false, true, false), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); setFluidContainerStats(32000 + tLastID, 0L, 16L); - ItemList.Food_Packaged_Fries.set(addItem(tLastID = 204, "Fries", "Ketchup not included", new GT_FoodStat(7, 0.5F, EnumAction.eat, GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Paper, 1L), false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); - ItemList.Food_Raw_PotatoChips.set(addItem(tLastID = 205, "Potato Chips (Raw)", "Just like a Potato", new GT_FoodStat(1, 0.3F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L))); + ItemList.Food_Packaged_Fries.set(addItem( + tLastID = 204, + "Fries", + "Ketchup not included", + new GT_FoodStat( + 7, + 0.5F, + EnumAction.eat, + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Paper, 1L), + false, + true, + false), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + ItemList.Food_Raw_PotatoChips.set(addItem( + tLastID = 205, + "Potato Chips (Raw)", + "Just like a Potato", + new GT_FoodStat(1, 0.3F, EnumAction.eat, null, false, true, false), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L))); setFluidContainerStats(32000 + tLastID, 0L, 16L); - ItemList.Food_PotatoChips.set(addItem(tLastID = 206, "Potato Chips", "Crunchy", new GT_FoodStat(7, 0.5F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + ItemList.Food_PotatoChips.set(addItem( + tLastID = 206, + "Potato Chips", + "Crunchy", + new GT_FoodStat(7, 0.5F, EnumAction.eat, null, false, true, false), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); setFluidContainerStats(32000 + tLastID, 0L, 16L); - ItemList.Food_ChiliChips.set(addItem(tLastID = 207, "Chili Chips", "Spicy", new GT_FoodStat(7, 0.6F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + ItemList.Food_ChiliChips.set(addItem( + tLastID = 207, + "Chili Chips", + "Spicy", + new GT_FoodStat(7, 0.6F, EnumAction.eat, null, false, true, false), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); setFluidContainerStats(32000 + tLastID, 0L, 16L); - ItemList.Food_Packaged_PotatoChips.set(addItem(tLastID = 208, "Bag of Potato Chips", "Full of delicious Air", new GT_FoodStat(7, 0.5F, EnumAction.eat, GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Aluminium, 1L), false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); - ItemList.Food_Packaged_ChiliChips.set(addItem(tLastID = 209, "Bag of Chili Chips", "Stop making noises Baj!", new GT_FoodStat(7, 0.6F, EnumAction.eat, GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Aluminium, 1L), false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); - ItemList.Food_Chum.set(addItem(tLastID = 210, "Chum", "Chum is Fum!", new GT_FoodStat(5, 0.2F, EnumAction.eat, null, true, false, true, Potion.hunger.id, 1000, 4, 100, Potion.confusion.id, 300, 1, 80), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); - ItemList.Food_Chum_On_Stick.set(addItem(tLastID = 211, "Chum on a Stick", "Don't forget to try our Chum-balaya", new GT_FoodStat(5, 0.2F, EnumAction.eat, new ItemStack(Items.stick, 1), true, false, true, Potion.hunger.id, 1000, 4, 100, Potion.confusion.id, 300, 1, 80), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); - ItemList.Food_Dough_Sugar.set(addItem(tLastID = 212, "Sugary Dough", "Don't eat the Dough before it is baken", new GT_FoodStat(1, 0.1F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); - ItemList.Food_Dough_Chocolate.set(addItem(tLastID = 213, "Chocolate Dough", "I said don't eat the Dough!", new GT_FoodStat(1, 0.1F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); - ItemList.Food_Raw_Cookie.set(addItem(tLastID = 214, "Cookie shaped Dough", "For baking Cookies", new GT_FoodStat(1, 0.1F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); - - ItemList.Food_Sliced_Buns.set(addItem(tLastID = 220, "Buns", "Pre Sliced", new GT_FoodStat(3, 0.5F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); - ItemList.Food_Burger_Veggie.set(addItem(tLastID = 221, "Veggieburger", "No matter how you call this, this is NOT a Burger!", new GT_FoodStat(3, 0.5F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); - ItemList.Food_Burger_Cheese.set(addItem(tLastID = 222, "Cheeseburger", "Cheesy!", new GT_FoodStat(3, 0.5F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new ItemData(Materials.Cheese, 907200L))); - ItemList.Food_Burger_Meat.set(addItem(tLastID = 223, "Hamburger", "The Mc Burger Queen Burger", new GT_FoodStat(3, 0.5F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.CORPUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); - ItemList.Food_Burger_Chum.set(addItem(tLastID = 224, "Chumburger", "Fum is Chum!", new GT_FoodStat(5, 0.2F, EnumAction.eat, null, true, false, true, Potion.hunger.id, 1000, 4, 100, Potion.confusion.id, 300, 1, 80), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); - - ItemList.Food_Sliced_Breads.set(addItem(tLastID = 230, "Breads", "Pre Sliced", new GT_FoodStat(5, 0.6F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); - ItemList.Food_Sandwich_Veggie.set(addItem(tLastID = 231, "Veggie Sandwich", "Meatless", new GT_FoodStat(7, 0.6F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + ItemList.Food_Packaged_PotatoChips.set(addItem( + tLastID = 208, + "Bag of Potato Chips", + "Full of delicious Air", + new GT_FoodStat( + 7, + 0.5F, + EnumAction.eat, + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Aluminium, 1L), + false, + true, + false), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + ItemList.Food_Packaged_ChiliChips.set(addItem( + tLastID = 209, + "Bag of Chili Chips", + "Stop making noises Baj!", + new GT_FoodStat( + 7, + 0.6F, + EnumAction.eat, + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Aluminium, 1L), + false, + true, + false), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + ItemList.Food_Chum.set(addItem( + tLastID = 210, + "Chum", + "Chum is Fum!", + new GT_FoodStat( + 5, + 0.2F, + EnumAction.eat, + null, + true, + false, + true, + Potion.hunger.id, + 1000, + 4, + 100, + Potion.confusion.id, + 300, + 1, + 80), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + ItemList.Food_Chum_On_Stick.set(addItem( + tLastID = 211, + "Chum on a Stick", + "Don't forget to try our Chum-balaya", + new GT_FoodStat( + 5, + 0.2F, + EnumAction.eat, + new ItemStack(Items.stick, 1), + true, + false, + true, + Potion.hunger.id, + 1000, + 4, + 100, + Potion.confusion.id, + 300, + 1, + 80), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + ItemList.Food_Dough_Sugar.set(addItem( + tLastID = 212, + "Sugary Dough", + "Don't eat the Dough before it is baken", + new GT_FoodStat(1, 0.1F, EnumAction.eat, null, false, true, false), + new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); + ItemList.Food_Dough_Chocolate.set(addItem( + tLastID = 213, + "Chocolate Dough", + "I said don't eat the Dough!", + new GT_FoodStat(1, 0.1F, EnumAction.eat, null, false, true, false), + new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); + ItemList.Food_Raw_Cookie.set(addItem( + tLastID = 214, + "Cookie shaped Dough", + "For baking Cookies", + new GT_FoodStat(1, 0.1F, EnumAction.eat, null, false, true, false), + new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); + + ItemList.Food_Sliced_Buns.set(addItem( + tLastID = 220, + "Buns", + "Pre Sliced", + new GT_FoodStat(3, 0.5F, EnumAction.eat, null, false, true, false), + new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + ItemList.Food_Burger_Veggie.set(addItem( + tLastID = 221, + "Veggieburger", + "No matter how you call this, this is NOT a Burger!", + new GT_FoodStat(3, 0.5F, EnumAction.eat, null, false, true, false), + new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + ItemList.Food_Burger_Cheese.set(addItem( + tLastID = 222, + "Cheeseburger", + "Cheesy!", + new GT_FoodStat(3, 0.5F, EnumAction.eat, null, false, true, false), + new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), + new ItemData(Materials.Cheese, 907200L))); + ItemList.Food_Burger_Meat.set(addItem( + tLastID = 223, + "Hamburger", + "The Mc Burger Queen Burger", + new GT_FoodStat(3, 0.5F, EnumAction.eat, null, false, true, false), + new TC_Aspects.TC_AspectStack(TC_Aspects.CORPUS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + ItemList.Food_Burger_Chum.set(addItem( + tLastID = 224, + "Chumburger", + "Fum is Chum!", + new GT_FoodStat( + 5, + 0.2F, + EnumAction.eat, + null, + true, + false, + true, + Potion.hunger.id, + 1000, + 4, + 100, + Potion.confusion.id, + 300, + 1, + 80), + new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + + ItemList.Food_Sliced_Breads.set(addItem( + tLastID = 230, + "Breads", + "Pre Sliced", + new GT_FoodStat(5, 0.6F, EnumAction.eat, null, false, true, false), + new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + ItemList.Food_Sandwich_Veggie.set(addItem( + tLastID = 231, + "Veggie Sandwich", + "Meatless", + new GT_FoodStat(7, 0.6F, EnumAction.eat, null, false, true, false), + new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); setFluidContainerStats(32000 + tLastID, 0L, 32L); - ItemList.Food_Sandwich_Cheese.set(addItem(tLastID = 232, "Cheese Sandwich", "Say Cheese!", new GT_FoodStat(7, 0.6F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + ItemList.Food_Sandwich_Cheese.set(addItem( + tLastID = 232, + "Cheese Sandwich", + "Say Cheese!", + new GT_FoodStat(7, 0.6F, EnumAction.eat, null, false, true, false), + new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); setFluidContainerStats(32000 + tLastID, 0L, 32L); - ItemList.Food_Sandwich_Bacon.set(addItem(tLastID = 233, "Bacon Sandwich", "The best Sandwich ever!", new GT_FoodStat(10, 0.8F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.CORPUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + ItemList.Food_Sandwich_Bacon.set(addItem( + tLastID = 233, + "Bacon Sandwich", + "The best Sandwich ever!", + new GT_FoodStat(10, 0.8F, EnumAction.eat, null, false, true, false), + new TC_Aspects.TC_AspectStack(TC_Aspects.CORPUS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); setFluidContainerStats(32000 + tLastID, 0L, 32L); - ItemList.Food_Sandwich_Steak.set(addItem(tLastID = 234, "Steak Sandwich", "Not a 'Steam Sandwich'", new GT_FoodStat(10, 0.8F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.CORPUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + ItemList.Food_Sandwich_Steak.set(addItem( + tLastID = 234, + "Steak Sandwich", + "Not a 'Steam Sandwich'", + new GT_FoodStat(10, 0.8F, EnumAction.eat, null, false, true, false), + new TC_Aspects.TC_AspectStack(TC_Aspects.CORPUS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); setFluidContainerStats(32000 + tLastID, 0L, 32L); - ItemList.Food_Sliced_Baguettes.set(addItem(tLastID = 240, "Baguettes", "Pre Sliced", new GT_FoodStat(8, 0.5F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); - ItemList.Food_Large_Sandwich_Veggie.set(addItem(tLastID = 241, "Large Veggie Sandwich", "Just not worth it", new GT_FoodStat(15, 0.8F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 3L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + ItemList.Food_Sliced_Baguettes.set(addItem( + tLastID = 240, + "Baguettes", + "Pre Sliced", + new GT_FoodStat(8, 0.5F, EnumAction.eat, null, false, true, false), + new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + ItemList.Food_Large_Sandwich_Veggie.set(addItem( + tLastID = 241, + "Large Veggie Sandwich", + "Just not worth it", + new GT_FoodStat(15, 0.8F, EnumAction.eat, null, false, true, false), + new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 3L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); setFluidContainerStats(32000 + tLastID, 0L, 16L); - ItemList.Food_Large_Sandwich_Cheese.set(addItem(tLastID = 242, "Large Cheese Sandwich", "I need another cheesy tooltip for this", new GT_FoodStat(15, 0.8F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 3L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + ItemList.Food_Large_Sandwich_Cheese.set(addItem( + tLastID = 242, + "Large Cheese Sandwich", + "I need another cheesy tooltip for this", + new GT_FoodStat(15, 0.8F, EnumAction.eat, null, false, true, false), + new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 3L), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); setFluidContainerStats(32000 + tLastID, 0L, 16L); - ItemList.Food_Large_Sandwich_Bacon.set(addItem(tLastID = 243, "Large Bacon Sandwich", "For Men! (and manly Women)", new GT_FoodStat(20, 1.0F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.CORPUS, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + ItemList.Food_Large_Sandwich_Bacon.set(addItem( + tLastID = 243, + "Large Bacon Sandwich", + "For Men! (and manly Women)", + new GT_FoodStat(20, 1.0F, EnumAction.eat, null, false, true, false), + new TC_Aspects.TC_AspectStack(TC_Aspects.CORPUS, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); setFluidContainerStats(32000 + tLastID, 0L, 16L); - ItemList.Food_Large_Sandwich_Steak.set(addItem(tLastID = 244, "Large Steak Sandwich", "Yes, I once accidentially called it 'Steam Sandwich'", new GT_FoodStat(20, 1.0F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.CORPUS, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + ItemList.Food_Large_Sandwich_Steak.set(addItem( + tLastID = 244, + "Large Steak Sandwich", + "Yes, I once accidentially called it 'Steam Sandwich'", + new GT_FoodStat(20, 1.0F, EnumAction.eat, null, false, true, false), + new TC_Aspects.TC_AspectStack(TC_Aspects.CORPUS, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); setFluidContainerStats(32000 + tLastID, 0L, 16L); - ItemList.Food_Raw_Pizza_Veggie.set(addItem(tLastID = 250, "Raw Veggie Pizza", "Into the Oven with it!", new GT_FoodStat(1, 0.2F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); - ItemList.Food_Raw_Pizza_Cheese.set(addItem(tLastID = 251, "Raw Cheese Pizza", "Into the Oven with it!", new GT_FoodStat(2, 0.2F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); - ItemList.Food_Raw_Pizza_Meat.set(addItem(tLastID = 252, "Raw Mince Meat Pizza", "Into the Oven with it!", new GT_FoodStat(2, 0.2F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.CORPUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); - - ItemList.Food_Baked_Pizza_Veggie.set(addItem(tLastID = 260, "Veggie Pizza", "The next they want is Gluten Free Pizzas...", new GT_FoodStat(3, 0.3F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); - ItemList.Food_Baked_Pizza_Cheese.set(addItem(tLastID = 261, "Cheese Pizza", "Pizza Magarita", new GT_FoodStat(4, 0.4F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); - ItemList.Food_Baked_Pizza_Meat.set(addItem(tLastID = 262, "Mince Meat Pizza", "Emo Pizza, it cuts itself!", new GT_FoodStat(5, 0.5F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.CORPUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + ItemList.Food_Raw_Pizza_Veggie.set(addItem( + tLastID = 250, + "Raw Veggie Pizza", + "Into the Oven with it!", + new GT_FoodStat(1, 0.2F, EnumAction.eat, null, false, true, false), + new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + ItemList.Food_Raw_Pizza_Cheese.set(addItem( + tLastID = 251, + "Raw Cheese Pizza", + "Into the Oven with it!", + new GT_FoodStat(2, 0.2F, EnumAction.eat, null, false, true, false), + new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + ItemList.Food_Raw_Pizza_Meat.set(addItem( + tLastID = 252, + "Raw Mince Meat Pizza", + "Into the Oven with it!", + new GT_FoodStat(2, 0.2F, EnumAction.eat, null, false, true, false), + new TC_Aspects.TC_AspectStack(TC_Aspects.CORPUS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + ItemList.Food_Baked_Pizza_Veggie.set(addItem( + tLastID = 260, + "Veggie Pizza", + "The next they want is Gluten Free Pizzas...", + new GT_FoodStat(3, 0.3F, EnumAction.eat, null, false, true, false), + new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + ItemList.Food_Baked_Pizza_Cheese.set(addItem( + tLastID = 261, + "Cheese Pizza", + "Pizza Magarita", + new GT_FoodStat(4, 0.4F, EnumAction.eat, null, false, true, false), + new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + ItemList.Food_Baked_Pizza_Meat.set(addItem( + tLastID = 262, + "Mince Meat Pizza", + "Emo Pizza, it cuts itself!", + new GT_FoodStat(5, 0.5F, EnumAction.eat, null, false, true, false), + new TC_Aspects.TC_AspectStack(TC_Aspects.CORPUS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); - ItemList.Dye_Indigo.set(addItem(tLastID = 410, "Indigo Dye", "Blue Dye", new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 1L), Dyes.dyeBlue)); + ItemList.Dye_Indigo.set(addItem( + tLastID = 410, + "Indigo Dye", + "Blue Dye", + new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 1L), + Dyes.dyeBlue)); for (byte i = 0; i < 16; i = (byte) (i + 1)) { - ItemList.DYE_ONLY_ITEMS[i].set(addItem(tLastID = 414 + i, Dyes.get(i).mName + " Dye", "", Dyes.get(i).name(), new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 1L))); + ItemList.DYE_ONLY_ITEMS[i].set(addItem( + tLastID = 414 + i, + Dyes.get(i).mName + " Dye", + "", + Dyes.get(i).name(), + new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 1L))); } - ItemList.Plank_Oak.set(addItem(tLastID = 470, "Oak Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + ItemList.Plank_Oak.set( + addItem(tLastID = 470, "Oak Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); setBurnValue(32000 + tLastID, 75); - ItemList.Plank_Spruce.set(addItem(tLastID = 471, "Spruce Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + ItemList.Plank_Spruce.set(addItem( + tLastID = 471, "Spruce Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); setBurnValue(32000 + tLastID, 75); - ItemList.Plank_Birch.set(addItem(tLastID = 472, "Birch Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + ItemList.Plank_Birch.set( + addItem(tLastID = 472, "Birch Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); setBurnValue(32000 + tLastID, 75); - ItemList.Plank_Jungle.set(addItem(tLastID = 473, "Jungle Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + ItemList.Plank_Jungle.set(addItem( + tLastID = 473, "Jungle Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); setBurnValue(32000 + tLastID, 75); - ItemList.Plank_Acacia.set(addItem(tLastID = 474, "Acacia Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + ItemList.Plank_Acacia.set(addItem( + tLastID = 474, "Acacia Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); setBurnValue(32000 + tLastID, 75); - ItemList.Plank_DarkOak.set(addItem(tLastID = 475, "Dark Oak Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + ItemList.Plank_DarkOak.set(addItem( + tLastID = 475, "Dark Oak Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); setBurnValue(32000 + tLastID, 75); - ItemList.Plank_Larch.set(addItem(tLastID = 476, "Larch Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + ItemList.Plank_Larch.set( + addItem(tLastID = 476, "Larch Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); setBurnValue(32000 + tLastID, 75); - ItemList.Plank_Teak.set(addItem(tLastID = 477, "Teak Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + ItemList.Plank_Teak.set( + addItem(tLastID = 477, "Teak Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); setBurnValue(32000 + tLastID, 75); - ItemList.Plank_Acacia_Green.set(addItem(tLastID = 478, "Green Acacia Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + ItemList.Plank_Acacia_Green.set(addItem( + tLastID = 478, "Green Acacia Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); setBurnValue(32000 + tLastID, 75); - ItemList.Plank_Lime.set(addItem(tLastID = 479, "Lime Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + ItemList.Plank_Lime.set( + addItem(tLastID = 479, "Lime Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); setBurnValue(32000 + tLastID, 75); - ItemList.Plank_Chestnut.set(addItem(tLastID = 480, "Chestnut Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + ItemList.Plank_Chestnut.set(addItem( + tLastID = 480, "Chestnut Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); setBurnValue(32000 + tLastID, 75); - ItemList.Plank_Wenge.set(addItem(tLastID = 481, "Wenge Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + ItemList.Plank_Wenge.set( + addItem(tLastID = 481, "Wenge Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); setBurnValue(32000 + tLastID, 75); - ItemList.Plank_Baobab.set(addItem(tLastID = 482, "Baobab Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + ItemList.Plank_Baobab.set(addItem( + tLastID = 482, "Baobab Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); setBurnValue(32000 + tLastID, 75); - ItemList.Plank_Sequoia.set(addItem(tLastID = 483, "Sequoia Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + ItemList.Plank_Sequoia.set(addItem( + tLastID = 483, "Sequoia Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); setBurnValue(32000 + tLastID, 75); - ItemList.Plank_Kapok.set(addItem(tLastID = 484, "Kapok Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + ItemList.Plank_Kapok.set( + addItem(tLastID = 484, "Kapok Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); setBurnValue(32000 + tLastID, 75); - ItemList.Plank_Ebony.set(addItem(tLastID = 485, "Ebony Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + ItemList.Plank_Ebony.set( + addItem(tLastID = 485, "Ebony Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); setBurnValue(32000 + tLastID, 75); - ItemList.Plank_Mahagony.set(addItem(tLastID = 486, "Mahagony Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + ItemList.Plank_Mahagony.set(addItem( + tLastID = 486, "Mahagony Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); setBurnValue(32000 + tLastID, 75); - ItemList.Plank_Balsa.set(addItem(tLastID = 487, "Balsa Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + ItemList.Plank_Balsa.set( + addItem(tLastID = 487, "Balsa Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); setBurnValue(32000 + tLastID, 75); - ItemList.Plank_Willow.set(addItem(tLastID = 488, "Willow Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + ItemList.Plank_Willow.set(addItem( + tLastID = 488, "Willow Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); setBurnValue(32000 + tLastID, 75); - ItemList.Plank_Walnut.set(addItem(tLastID = 489, "Walnut Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + ItemList.Plank_Walnut.set(addItem( + tLastID = 489, "Walnut Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); setBurnValue(32000 + tLastID, 75); - ItemList.Plank_Greenheart.set(addItem(tLastID = 490, "Greenheart Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + ItemList.Plank_Greenheart.set(addItem( + tLastID = 490, "Greenheart Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); setBurnValue(32000 + tLastID, 75); - ItemList.Plank_Cherry.set(addItem(tLastID = 491, "Cherry Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + ItemList.Plank_Cherry.set(addItem( + tLastID = 491, "Cherry Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); setBurnValue(32000 + tLastID, 75); - ItemList.Plank_Mahoe.set(addItem(tLastID = 492, "Mahoe Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + ItemList.Plank_Mahoe.set( + addItem(tLastID = 492, "Mahoe Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); setBurnValue(32000 + tLastID, 75); - ItemList.Plank_Poplar.set(addItem(tLastID = 493, "Poplar Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + ItemList.Plank_Poplar.set(addItem( + tLastID = 493, "Poplar Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); setBurnValue(32000 + tLastID, 75); - ItemList.Plank_Palm.set(addItem(tLastID = 494, "Palm Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + ItemList.Plank_Palm.set( + addItem(tLastID = 494, "Palm Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); setBurnValue(32000 + tLastID, 75); - ItemList.Plank_Papaya.set(addItem(tLastID = 495, "Papaya Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + ItemList.Plank_Papaya.set(addItem( + tLastID = 495, "Papaya Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); setBurnValue(32000 + tLastID, 75); - ItemList.Plank_Pine.set(addItem(tLastID = 496, "Pine Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + ItemList.Plank_Pine.set( + addItem(tLastID = 496, "Pine Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); setBurnValue(32000 + tLastID, 75); - ItemList.Plank_Plum.set(addItem(tLastID = 497, "Plum Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + ItemList.Plank_Plum.set( + addItem(tLastID = 497, "Plum Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); setBurnValue(32000 + tLastID, 75); - ItemList.Plank_Maple.set(addItem(tLastID = 498, "Maple Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + ItemList.Plank_Maple.set( + addItem(tLastID = 498, "Maple Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); setBurnValue(32000 + tLastID, 75); - ItemList.Plank_Citrus.set(addItem(tLastID = 499, "Citrus Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + ItemList.Plank_Citrus.set(addItem( + tLastID = 499, "Citrus Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); setBurnValue(32000 + tLastID, 75); ItemList.SFMixture.set(addItem(tLastID = 270, "Super Fuel Binder", "Raw Material")); ItemList.MSFMixture.set(addItem(tLastID = 271, "Magic Super Fuel Binder", "Raw Material")); - GT_ModHandler.addCraftingRecipe(ItemList.Plank_Oak.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', new ItemStack(Blocks.wooden_slab, 1, 0)}); - GT_ModHandler.addCraftingRecipe(ItemList.Plank_Spruce.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', new ItemStack(Blocks.wooden_slab, 1, 1)}); - GT_ModHandler.addCraftingRecipe(ItemList.Plank_Birch.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', new ItemStack(Blocks.wooden_slab, 1, 2)}); - GT_ModHandler.addCraftingRecipe(ItemList.Plank_Jungle.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', new ItemStack(Blocks.wooden_slab, 1, 3)}); - GT_ModHandler.addCraftingRecipe(ItemList.Plank_Acacia.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', new ItemStack(Blocks.wooden_slab, 1, 4)}); - GT_ModHandler.addCraftingRecipe(ItemList.Plank_DarkOak.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', new ItemStack(Blocks.wooden_slab, 1, 5)}); - GT_ModHandler.addCraftingRecipe(ItemList.Plank_Larch.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs1", 1L, 0)}); - GT_ModHandler.addCraftingRecipe(ItemList.Plank_Teak.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs1", 1L, 1)}); - GT_ModHandler.addCraftingRecipe(ItemList.Plank_Acacia_Green.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs1", 1L, 2)}); - GT_ModHandler.addCraftingRecipe(ItemList.Plank_Lime.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs1", 1L, 3)}); - GT_ModHandler.addCraftingRecipe(ItemList.Plank_Chestnut.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs1", 1L, 4)}); - GT_ModHandler.addCraftingRecipe(ItemList.Plank_Wenge.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs1", 1L, 5)}); - GT_ModHandler.addCraftingRecipe(ItemList.Plank_Baobab.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs1", 1L, 6)}); - GT_ModHandler.addCraftingRecipe(ItemList.Plank_Sequoia.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs1", 1L, 7)}); - GT_ModHandler.addCraftingRecipe(ItemList.Plank_Kapok.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs2", 1L, 0)}); - GT_ModHandler.addCraftingRecipe(ItemList.Plank_Ebony.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs2", 1L, 1)}); - GT_ModHandler.addCraftingRecipe(ItemList.Plank_Mahagony.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs2", 1L, 2)}); - GT_ModHandler.addCraftingRecipe(ItemList.Plank_Balsa.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs2", 1L, 3)}); - GT_ModHandler.addCraftingRecipe(ItemList.Plank_Willow.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs2", 1L, 4)}); - GT_ModHandler.addCraftingRecipe(ItemList.Plank_Walnut.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs2", 1L, 5)}); - GT_ModHandler.addCraftingRecipe(ItemList.Plank_Greenheart.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs2", 1L, 6)}); - GT_ModHandler.addCraftingRecipe(ItemList.Plank_Cherry.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs2", 1L, 7)}); - GT_ModHandler.addCraftingRecipe(ItemList.Plank_Mahoe.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs3", 1L, 0)}); - GT_ModHandler.addCraftingRecipe(ItemList.Plank_Poplar.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs3", 1L, 1)}); - GT_ModHandler.addCraftingRecipe(ItemList.Plank_Palm.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs3", 1L, 2)}); - GT_ModHandler.addCraftingRecipe(ItemList.Plank_Papaya.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs3", 1L, 3)}); - GT_ModHandler.addCraftingRecipe(ItemList.Plank_Pine.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs3", 1L, 4)}); - GT_ModHandler.addCraftingRecipe(ItemList.Plank_Plum.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs3", 1L, 5)}); - GT_ModHandler.addCraftingRecipe(ItemList.Plank_Maple.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs3", 1L, 6)}); - GT_ModHandler.addCraftingRecipe(ItemList.Plank_Citrus.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs3", 1L, 7)}); + GT_ModHandler.addCraftingRecipe( + ItemList.Plank_Oak.get(2L), + GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] {"s ", " P", 'P', new ItemStack(Blocks.wooden_slab, 1, 0)}); + GT_ModHandler.addCraftingRecipe( + ItemList.Plank_Spruce.get(2L), + GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] {"s ", " P", 'P', new ItemStack(Blocks.wooden_slab, 1, 1)}); + GT_ModHandler.addCraftingRecipe( + ItemList.Plank_Birch.get(2L), + GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] {"s ", " P", 'P', new ItemStack(Blocks.wooden_slab, 1, 2)}); + GT_ModHandler.addCraftingRecipe( + ItemList.Plank_Jungle.get(2L), + GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] {"s ", " P", 'P', new ItemStack(Blocks.wooden_slab, 1, 3)}); + GT_ModHandler.addCraftingRecipe( + ItemList.Plank_Acacia.get(2L), + GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] {"s ", " P", 'P', new ItemStack(Blocks.wooden_slab, 1, 4)}); + GT_ModHandler.addCraftingRecipe( + ItemList.Plank_DarkOak.get(2L), + GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] {"s ", " P", 'P', new ItemStack(Blocks.wooden_slab, 1, 5)}); + GT_ModHandler.addCraftingRecipe( + ItemList.Plank_Larch.get(2L), + GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] {"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs1", 1L, 0)}); + GT_ModHandler.addCraftingRecipe( + ItemList.Plank_Teak.get(2L), + GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] {"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs1", 1L, 1)}); + GT_ModHandler.addCraftingRecipe( + ItemList.Plank_Acacia_Green.get(2L), + GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] {"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs1", 1L, 2)}); + GT_ModHandler.addCraftingRecipe( + ItemList.Plank_Lime.get(2L), + GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] {"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs1", 1L, 3)}); + GT_ModHandler.addCraftingRecipe( + ItemList.Plank_Chestnut.get(2L), + GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] {"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs1", 1L, 4)}); + GT_ModHandler.addCraftingRecipe( + ItemList.Plank_Wenge.get(2L), + GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] {"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs1", 1L, 5)}); + GT_ModHandler.addCraftingRecipe( + ItemList.Plank_Baobab.get(2L), + GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] {"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs1", 1L, 6)}); + GT_ModHandler.addCraftingRecipe( + ItemList.Plank_Sequoia.get(2L), + GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] {"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs1", 1L, 7)}); + GT_ModHandler.addCraftingRecipe( + ItemList.Plank_Kapok.get(2L), + GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] {"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs2", 1L, 0)}); + GT_ModHandler.addCraftingRecipe( + ItemList.Plank_Ebony.get(2L), + GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] {"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs2", 1L, 1)}); + GT_ModHandler.addCraftingRecipe( + ItemList.Plank_Mahagony.get(2L), + GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] {"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs2", 1L, 2)}); + GT_ModHandler.addCraftingRecipe( + ItemList.Plank_Balsa.get(2L), + GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] {"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs2", 1L, 3)}); + GT_ModHandler.addCraftingRecipe( + ItemList.Plank_Willow.get(2L), + GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] {"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs2", 1L, 4)}); + GT_ModHandler.addCraftingRecipe( + ItemList.Plank_Walnut.get(2L), + GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] {"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs2", 1L, 5)}); + GT_ModHandler.addCraftingRecipe( + ItemList.Plank_Greenheart.get(2L), + GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] {"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs2", 1L, 6)}); + GT_ModHandler.addCraftingRecipe( + ItemList.Plank_Cherry.get(2L), + GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] {"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs2", 1L, 7)}); + GT_ModHandler.addCraftingRecipe( + ItemList.Plank_Mahoe.get(2L), + GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] {"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs3", 1L, 0)}); + GT_ModHandler.addCraftingRecipe( + ItemList.Plank_Poplar.get(2L), + GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] {"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs3", 1L, 1)}); + GT_ModHandler.addCraftingRecipe( + ItemList.Plank_Palm.get(2L), + GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] {"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs3", 1L, 2)}); + GT_ModHandler.addCraftingRecipe( + ItemList.Plank_Papaya.get(2L), + GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] {"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs3", 1L, 3)}); + GT_ModHandler.addCraftingRecipe( + ItemList.Plank_Pine.get(2L), + GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] {"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs3", 1L, 4)}); + GT_ModHandler.addCraftingRecipe( + ItemList.Plank_Plum.get(2L), + GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] {"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs3", 1L, 5)}); + GT_ModHandler.addCraftingRecipe( + ItemList.Plank_Maple.get(2L), + GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] {"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs3", 1L, 6)}); + GT_ModHandler.addCraftingRecipe( + ItemList.Plank_Citrus.get(2L), + GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] {"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs3", 1L, 7)}); GregTech_API.registerCover(ItemList.Plank_Oak.get(1L), TextureFactory.of(Blocks.planks, 0), null); GregTech_API.registerCover(ItemList.Plank_Spruce.get(1L), TextureFactory.of(Blocks.planks, 1), null); @@ -257,51 +1809,277 @@ public class GT_MetaGenerated_Item_02 extends GT_MetaGenerated_Item_X32 { GregTech_API.registerCover(ItemList.Plank_Jungle.get(1L), TextureFactory.of(Blocks.planks, 3), null); GregTech_API.registerCover(ItemList.Plank_Acacia.get(1L), TextureFactory.of(Blocks.planks, 4), null); GregTech_API.registerCover(ItemList.Plank_DarkOak.get(1L), TextureFactory.of(Blocks.planks, 5), null); - GregTech_API.registerCover(ItemList.Plank_Larch.get(1L), TextureFactory.of(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 0, new ItemStack(Blocks.planks, 1, 0))), 0), null); - GregTech_API.registerCover(ItemList.Plank_Teak.get(1L), TextureFactory.of(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 1, new ItemStack(Blocks.planks, 1, 0))), 1), null); - GregTech_API.registerCover(ItemList.Plank_Acacia_Green.get(1L), TextureFactory.of(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 2, new ItemStack(Blocks.planks, 1, 0))), 2), null); - GregTech_API.registerCover(ItemList.Plank_Lime.get(1L), TextureFactory.of(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 3, new ItemStack(Blocks.planks, 1, 0))), 3), null); - GregTech_API.registerCover(ItemList.Plank_Chestnut.get(1L), TextureFactory.of(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 4, new ItemStack(Blocks.planks, 1, 0))), 4), null); - GregTech_API.registerCover(ItemList.Plank_Wenge.get(1L), TextureFactory.of(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 5, new ItemStack(Blocks.planks, 1, 0))), 5), null); - GregTech_API.registerCover(ItemList.Plank_Baobab.get(1L), TextureFactory.of(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 6, new ItemStack(Blocks.planks, 1, 0))), 6), null); - GregTech_API.registerCover(ItemList.Plank_Sequoia.get(1L), TextureFactory.of(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 7, new ItemStack(Blocks.planks, 1, 0))), 7), null); - GregTech_API.registerCover(ItemList.Plank_Kapok.get(1L), TextureFactory.of(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 8, new ItemStack(Blocks.planks, 1, 0))), 8), null); - GregTech_API.registerCover(ItemList.Plank_Ebony.get(1L), TextureFactory.of(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 9, new ItemStack(Blocks.planks, 1, 0))), 9), null); - GregTech_API.registerCover(ItemList.Plank_Mahagony.get(1L), TextureFactory.of(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 10, new ItemStack(Blocks.planks, 1, 0))), 10), null); - GregTech_API.registerCover(ItemList.Plank_Balsa.get(1L), TextureFactory.of(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 11, new ItemStack(Blocks.planks, 1, 0))), 11), null); - GregTech_API.registerCover(ItemList.Plank_Willow.get(1L), TextureFactory.of(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 12, new ItemStack(Blocks.planks, 1, 0))), 12), null); - GregTech_API.registerCover(ItemList.Plank_Walnut.get(1L), TextureFactory.of(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 13, new ItemStack(Blocks.planks, 1, 0))), 13), null); - GregTech_API.registerCover(ItemList.Plank_Greenheart.get(1L), TextureFactory.of(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 14, new ItemStack(Blocks.planks, 1, 0))), 14), null); - GregTech_API.registerCover(ItemList.Plank_Cherry.get(1L), TextureFactory.of(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 15, new ItemStack(Blocks.planks, 1, 0))), 15), null); - GregTech_API.registerCover(ItemList.Plank_Mahoe.get(1L), TextureFactory.of(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 16, new ItemStack(Blocks.planks, 1, 0))), 0), null); - GregTech_API.registerCover(ItemList.Plank_Poplar.get(1L), TextureFactory.of(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 17, new ItemStack(Blocks.planks, 1, 0))), 1), null); - GregTech_API.registerCover(ItemList.Plank_Palm.get(1L), TextureFactory.of(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 18, new ItemStack(Blocks.planks, 1, 0))), 2), null); - GregTech_API.registerCover(ItemList.Plank_Papaya.get(1L), TextureFactory.of(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 19, new ItemStack(Blocks.planks, 1, 0))), 3), null); - GregTech_API.registerCover(ItemList.Plank_Pine.get(1L), TextureFactory.of(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 20, new ItemStack(Blocks.planks, 1, 0))), 4), null); - GregTech_API.registerCover(ItemList.Plank_Plum.get(1L), TextureFactory.of(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 21, new ItemStack(Blocks.planks, 1, 0))), 5), null); - GregTech_API.registerCover(ItemList.Plank_Maple.get(1L), TextureFactory.of(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 22, new ItemStack(Blocks.planks, 1, 0))), 6), null); - GregTech_API.registerCover(ItemList.Plank_Citrus.get(1L), TextureFactory.of(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 23, new ItemStack(Blocks.planks, 1, 0))), 7), null); - - ItemList.Crop_Drop_Plumbilia.set(addItem(tLastID = 500, "Plumbilia Leaf", "Source of Lead", new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 1L))); - ItemList.Crop_Drop_Argentia.set(addItem(tLastID = 501, "Argentia Leaf", "Source of Silver", new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUCRUM, 1L))); - ItemList.Crop_Drop_Indigo.set(addItem(tLastID = 502, "Indigo Blossom", "Used for making Blue Dye", new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 1L))); - ItemList.Crop_Drop_Ferru.set(addItem(tLastID = 503, "Ferru Leaf", "Source of Iron", new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 2L))); - ItemList.Crop_Drop_Aurelia.set(addItem(tLastID = 504, "Aurelia Leaf", "Source of Gold", new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUCRUM, 1L))); - ItemList.Crop_Drop_TeaLeaf.set(addItem(tLastID = 505, "Tea Leaf", "Source of Tea", "cropTea", new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.SANO, 1L))); - - ItemList.Crop_Drop_OilBerry.set(addItem(tLastID = 510, "Oil Berry", "Oil in Berry form", new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L))); - ItemList.Crop_Drop_BobsYerUncleRanks.set(addItem(tLastID = 511, "Bobs-Yer-Uncle-Berry", "Source of Emeralds", new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUCRUM, 1L))); - ItemList.Crop_Drop_UUMBerry.set(addItem(tLastID = 512, "UUM Berry", "UUM in Berry form", new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L))); - ItemList.Crop_Drop_UUABerry.set(addItem(tLastID = 513, "UUA Berry", "UUA in Berry form", new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L))); - - ItemList.Crop_Drop_MilkWart.set(addItem(tLastID = 520, "Milk Wart", "Source of Milk", new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.SANO, 1L))); - - ItemList.Crop_Drop_Coppon.set(addItem(tLastID = 530, "Coppon Fiber", "ORANGE WOOOOOOOL!!!", new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERMUTATIO, 1L))); - - ItemList.Crop_Drop_Tine.set(addItem(tLastID = 540, "Tine Twig", "Source of Tin", new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + GregTech_API.registerCover( + ItemList.Plank_Larch.get(1L), + TextureFactory.of( + GT_Utility.getBlockFromStack(GT_ModHandler.getModItem( + aTextForestry, "planks", 1L, 0, new ItemStack(Blocks.planks, 1, 0))), + 0), + null); + GregTech_API.registerCover( + ItemList.Plank_Teak.get(1L), + TextureFactory.of( + GT_Utility.getBlockFromStack(GT_ModHandler.getModItem( + aTextForestry, "planks", 1L, 1, new ItemStack(Blocks.planks, 1, 0))), + 1), + null); + GregTech_API.registerCover( + ItemList.Plank_Acacia_Green.get(1L), + TextureFactory.of( + GT_Utility.getBlockFromStack(GT_ModHandler.getModItem( + aTextForestry, "planks", 1L, 2, new ItemStack(Blocks.planks, 1, 0))), + 2), + null); + GregTech_API.registerCover( + ItemList.Plank_Lime.get(1L), + TextureFactory.of( + GT_Utility.getBlockFromStack(GT_ModHandler.getModItem( + aTextForestry, "planks", 1L, 3, new ItemStack(Blocks.planks, 1, 0))), + 3), + null); + GregTech_API.registerCover( + ItemList.Plank_Chestnut.get(1L), + TextureFactory.of( + GT_Utility.getBlockFromStack(GT_ModHandler.getModItem( + aTextForestry, "planks", 1L, 4, new ItemStack(Blocks.planks, 1, 0))), + 4), + null); + GregTech_API.registerCover( + ItemList.Plank_Wenge.get(1L), + TextureFactory.of( + GT_Utility.getBlockFromStack(GT_ModHandler.getModItem( + aTextForestry, "planks", 1L, 5, new ItemStack(Blocks.planks, 1, 0))), + 5), + null); + GregTech_API.registerCover( + ItemList.Plank_Baobab.get(1L), + TextureFactory.of( + GT_Utility.getBlockFromStack(GT_ModHandler.getModItem( + aTextForestry, "planks", 1L, 6, new ItemStack(Blocks.planks, 1, 0))), + 6), + null); + GregTech_API.registerCover( + ItemList.Plank_Sequoia.get(1L), + TextureFactory.of( + GT_Utility.getBlockFromStack(GT_ModHandler.getModItem( + aTextForestry, "planks", 1L, 7, new ItemStack(Blocks.planks, 1, 0))), + 7), + null); + GregTech_API.registerCover( + ItemList.Plank_Kapok.get(1L), + TextureFactory.of( + GT_Utility.getBlockFromStack(GT_ModHandler.getModItem( + aTextForestry, "planks", 1L, 8, new ItemStack(Blocks.planks, 1, 0))), + 8), + null); + GregTech_API.registerCover( + ItemList.Plank_Ebony.get(1L), + TextureFactory.of( + GT_Utility.getBlockFromStack(GT_ModHandler.getModItem( + aTextForestry, "planks", 1L, 9, new ItemStack(Blocks.planks, 1, 0))), + 9), + null); + GregTech_API.registerCover( + ItemList.Plank_Mahagony.get(1L), + TextureFactory.of( + GT_Utility.getBlockFromStack(GT_ModHandler.getModItem( + aTextForestry, "planks", 1L, 10, new ItemStack(Blocks.planks, 1, 0))), + 10), + null); + GregTech_API.registerCover( + ItemList.Plank_Balsa.get(1L), + TextureFactory.of( + GT_Utility.getBlockFromStack(GT_ModHandler.getModItem( + aTextForestry, "planks", 1L, 11, new ItemStack(Blocks.planks, 1, 0))), + 11), + null); + GregTech_API.registerCover( + ItemList.Plank_Willow.get(1L), + TextureFactory.of( + GT_Utility.getBlockFromStack(GT_ModHandler.getModItem( + aTextForestry, "planks", 1L, 12, new ItemStack(Blocks.planks, 1, 0))), + 12), + null); + GregTech_API.registerCover( + ItemList.Plank_Walnut.get(1L), + TextureFactory.of( + GT_Utility.getBlockFromStack(GT_ModHandler.getModItem( + aTextForestry, "planks", 1L, 13, new ItemStack(Blocks.planks, 1, 0))), + 13), + null); + GregTech_API.registerCover( + ItemList.Plank_Greenheart.get(1L), + TextureFactory.of( + GT_Utility.getBlockFromStack(GT_ModHandler.getModItem( + aTextForestry, "planks", 1L, 14, new ItemStack(Blocks.planks, 1, 0))), + 14), + null); + GregTech_API.registerCover( + ItemList.Plank_Cherry.get(1L), + TextureFactory.of( + GT_Utility.getBlockFromStack(GT_ModHandler.getModItem( + aTextForestry, "planks", 1L, 15, new ItemStack(Blocks.planks, 1, 0))), + 15), + null); + GregTech_API.registerCover( + ItemList.Plank_Mahoe.get(1L), + TextureFactory.of( + GT_Utility.getBlockFromStack(GT_ModHandler.getModItem( + aTextForestry, "planks", 1L, 16, new ItemStack(Blocks.planks, 1, 0))), + 0), + null); + GregTech_API.registerCover( + ItemList.Plank_Poplar.get(1L), + TextureFactory.of( + GT_Utility.getBlockFromStack(GT_ModHandler.getModItem( + aTextForestry, "planks", 1L, 17, new ItemStack(Blocks.planks, 1, 0))), + 1), + null); + GregTech_API.registerCover( + ItemList.Plank_Palm.get(1L), + TextureFactory.of( + GT_Utility.getBlockFromStack(GT_ModHandler.getModItem( + aTextForestry, "planks", 1L, 18, new ItemStack(Blocks.planks, 1, 0))), + 2), + null); + GregTech_API.registerCover( + ItemList.Plank_Papaya.get(1L), + TextureFactory.of( + GT_Utility.getBlockFromStack(GT_ModHandler.getModItem( + aTextForestry, "planks", 1L, 19, new ItemStack(Blocks.planks, 1, 0))), + 3), + null); + GregTech_API.registerCover( + ItemList.Plank_Pine.get(1L), + TextureFactory.of( + GT_Utility.getBlockFromStack(GT_ModHandler.getModItem( + aTextForestry, "planks", 1L, 20, new ItemStack(Blocks.planks, 1, 0))), + 4), + null); + GregTech_API.registerCover( + ItemList.Plank_Plum.get(1L), + TextureFactory.of( + GT_Utility.getBlockFromStack(GT_ModHandler.getModItem( + aTextForestry, "planks", 1L, 21, new ItemStack(Blocks.planks, 1, 0))), + 5), + null); + GregTech_API.registerCover( + ItemList.Plank_Maple.get(1L), + TextureFactory.of( + GT_Utility.getBlockFromStack(GT_ModHandler.getModItem( + aTextForestry, "planks", 1L, 22, new ItemStack(Blocks.planks, 1, 0))), + 6), + null); + GregTech_API.registerCover( + ItemList.Plank_Citrus.get(1L), + TextureFactory.of( + GT_Utility.getBlockFromStack(GT_ModHandler.getModItem( + aTextForestry, "planks", 1L, 23, new ItemStack(Blocks.planks, 1, 0))), + 7), + null); + + ItemList.Crop_Drop_Plumbilia.set(addItem( + tLastID = 500, + "Plumbilia Leaf", + "Source of Lead", + new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 1L))); + ItemList.Crop_Drop_Argentia.set(addItem( + tLastID = 501, + "Argentia Leaf", + "Source of Silver", + new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.LUCRUM, 1L))); + ItemList.Crop_Drop_Indigo.set(addItem( + tLastID = 502, + "Indigo Blossom", + "Used for making Blue Dye", + new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 1L))); + ItemList.Crop_Drop_Ferru.set(addItem( + tLastID = 503, + "Ferru Leaf", + "Source of Iron", + new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 2L))); + ItemList.Crop_Drop_Aurelia.set(addItem( + tLastID = 504, + "Aurelia Leaf", + "Source of Gold", + new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.LUCRUM, 1L))); + ItemList.Crop_Drop_TeaLeaf.set(addItem( + tLastID = 505, + "Tea Leaf", + "Source of Tea", + "cropTea", + new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.SANO, 1L))); + + ItemList.Crop_Drop_OilBerry.set(addItem( + tLastID = 510, + "Oil Berry", + "Oil in Berry form", + new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L))); + ItemList.Crop_Drop_BobsYerUncleRanks.set(addItem( + tLastID = 511, + "Bobs-Yer-Uncle-Berry", + "Source of Emeralds", + new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.LUCRUM, 1L))); + ItemList.Crop_Drop_UUMBerry.set(addItem( + tLastID = 512, + "UUM Berry", + "UUM in Berry form", + new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L))); + ItemList.Crop_Drop_UUABerry.set(addItem( + tLastID = 513, + "UUA Berry", + "UUA in Berry form", + new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L))); + + ItemList.Crop_Drop_MilkWart.set(addItem( + tLastID = 520, + "Milk Wart", + "Source of Milk", + new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.SANO, 1L))); + + ItemList.Crop_Drop_Coppon.set(addItem( + tLastID = 530, + "Coppon Fiber", + "ORANGE WOOOOOOOL!!!", + new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.PERMUTATIO, 1L))); + + ItemList.Crop_Drop_Tine.set(addItem( + tLastID = 540, + "Tine Twig", + "Source of Tin", + new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); setBurnValue(32000 + tLastID, 100); - ItemList.Crop_Drop_Mica.set(addItem(tLastID = 538, "Micadia Twig", "Source of Mica", new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + ItemList.Crop_Drop_Mica.set(addItem( + tLastID = 538, + "Micadia Twig", + "Source of Mica", + new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); setBurnValue(32000 + tLastID, 240); ItemList.Crop_Drop_Bauxite.set(addItem(tLastID = 521, "Bauxia Leaf", "Source of Aluminium")); @@ -318,34 +2096,206 @@ public class GT_MetaGenerated_Item_02 extends GT_MetaGenerated_Item_X32 { ItemList.Crop_Drop_Osmium.set(addItem(tLastID = 534, "Quantaria Leaf", "Source of Osmium")); ItemList.Crop_Drop_Naquadah.set(addItem(tLastID = 535, "Stargatium Leaf", "Source of Naquadah")); - ItemList.Crop_Drop_Chilly.set(addItem(tLastID = 550, "Chilly Pepper", "It is red and hot", "cropChilipepper", new GT_FoodStat(1, 0.3F, EnumAction.eat, null, false, true, false, Potion.confusion.id, 200, 1, 40), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); - ItemList.Crop_Drop_Lemon.set(addItem(tLastID = 551, "Lemon", "Don't make Lemonade", "cropLemon", new GT_FoodStat(1, 0.3F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); - ItemList.Crop_Drop_Tomato.set(addItem(tLastID = 552, "Tomato", "Solid Ketchup", "cropTomato", new GT_FoodStat(1, 0.2F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); - ItemList.Crop_Drop_MTomato.set(addItem(tLastID = 553, "Max Tomato", "Full Health in one Tomato", "cropTomato", new GT_FoodStat(9, 1.0F, EnumAction.eat, null, false, true, false, Potion.regeneration.id, 100, 100, 100), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.SANO, 3L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); - ItemList.Crop_Drop_Grapes.set(addItem(tLastID = 554, "Grapes", "Source of Wine", "cropGrape", new GT_FoodStat(2, 0.3F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); - ItemList.Crop_Drop_Onion.set(addItem(tLastID = 555, "Onion", "Taking over the whole Taste", "cropOnion", new GT_FoodStat(2, 0.2F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); - ItemList.Crop_Drop_Cucumber.set(addItem(tLastID = 556, "Cucumber", "Not a Sea Cucumber!", "cropCucumber", new GT_FoodStat(1, 0.2F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); - ItemList.Crop_Drop_Rape.set(addItem(tLastID = 557, "Rape", "Time to oil up!", new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L))); - - ItemList.Food_Cheese.set(addItem(tLastID = 558, "Cheese", "Click the Cheese", "foodCheese", new GT_FoodStat(3, 0.6F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 2L))); - ItemList.Food_Dough.set(addItem(tLastID = 559, "Dough", "For making Breads", "foodDough", new GT_FoodStat(1, 0.1F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); - ItemList.Food_Flat_Dough.set(addItem(tLastID = 560, "Flattened Dough", "For making Pizza", new GT_FoodStat(1, 0.1F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); - ItemList.Food_Raw_Bread.set(addItem(tLastID = 561, "Dough", "In Bread Shape", new GT_FoodStat(1, 0.2F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); - ItemList.Food_Raw_Bun.set(addItem(tLastID = 562, "Dough", "In Bun Shape", new GT_FoodStat(1, 0.1F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); - ItemList.Food_Raw_Baguette.set(addItem(tLastID = 563, "Dough", "In Baguette Shape", new GT_FoodStat(1, 0.3F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); - ItemList.Food_Baked_Bun.set(addItem(tLastID = 564, "Bun", "Do not teleport Bread!", new GT_FoodStat(3, 0.5F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); - ItemList.Food_Baked_Baguette.set(addItem(tLastID = 565, "Baguette", "I teleported nothing BUT Bread!!!", new GT_FoodStat(8, 0.5F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); - ItemList.Food_Sliced_Bread.set(addItem(tLastID = 566, "Sliced Bread", "Just half a Bread", new GT_FoodStat(2, 0.3F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); - ItemList.Food_Sliced_Bun.set(addItem(tLastID = 567, "Sliced Bun", "Just half a Bun", new GT_FoodStat(1, 0.3F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); - ItemList.Food_Sliced_Baguette.set(addItem(tLastID = 568, "Sliced Baguette", "Just half a Baguette", new GT_FoodStat(4, 0.3F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); - ItemList.Food_Raw_Cake.set(addItem(tLastID = 569, "Cake Bottom", "For making Cake", new GT_FoodStat(2, 0.2F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); - ItemList.Food_Baked_Cake.set(addItem(tLastID = 570, "Baked Cake Bottom", "I know I promised you an actual Cake, but well...", new GT_FoodStat(3, 0.3F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); - ItemList.Food_Sliced_Lemon.set(addItem(tLastID = 571, "Lemon Slice", "Ideal to put on your Drink", new GT_FoodStat(1, 0.075F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L))); - ItemList.Food_Sliced_Tomato.set(addItem(tLastID = 572, "Tomato Slice", "Solid Ketchup", new GT_FoodStat(1, 0.05F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L))); - ItemList.Food_Sliced_Onion.set(addItem(tLastID = 573, "Onion Slice", "ONIONS, UNITE!", new GT_FoodStat(1, 0.05F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L))); - ItemList.Food_Sliced_Cucumber.set(addItem(tLastID = 574, "Cucumber Slice", "QUEWWW-CUMMM-BERRR!!!", new GT_FoodStat(1, 0.05F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L))); - - ItemList.Food_Sliced_Cheese.set(addItem(tLastID = 576, "Cheese Slice", "ALIEN ATTACK!!!, throw the CHEEEEESE!!!", new GT_FoodStat(1, 0.1F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); + ItemList.Crop_Drop_Chilly.set(addItem( + tLastID = 550, + "Chilly Pepper", + "It is red and hot", + "cropChilipepper", + new GT_FoodStat(1, 0.3F, EnumAction.eat, null, false, true, false, Potion.confusion.id, 200, 1, 40), + new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); + ItemList.Crop_Drop_Lemon.set(addItem( + tLastID = 551, + "Lemon", + "Don't make Lemonade", + "cropLemon", + new GT_FoodStat(1, 0.3F, EnumAction.eat, null, false, true, false), + new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); + ItemList.Crop_Drop_Tomato.set(addItem( + tLastID = 552, + "Tomato", + "Solid Ketchup", + "cropTomato", + new GT_FoodStat(1, 0.2F, EnumAction.eat, null, false, true, false), + new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); + ItemList.Crop_Drop_MTomato.set(addItem( + tLastID = 553, + "Max Tomato", + "Full Health in one Tomato", + "cropTomato", + new GT_FoodStat( + 9, 1.0F, EnumAction.eat, null, false, true, false, Potion.regeneration.id, 100, 100, 100), + new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.SANO, 3L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); + ItemList.Crop_Drop_Grapes.set(addItem( + tLastID = 554, + "Grapes", + "Source of Wine", + "cropGrape", + new GT_FoodStat(2, 0.3F, EnumAction.eat, null, false, true, false), + new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); + ItemList.Crop_Drop_Onion.set(addItem( + tLastID = 555, + "Onion", + "Taking over the whole Taste", + "cropOnion", + new GT_FoodStat(2, 0.2F, EnumAction.eat, null, false, true, false), + new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); + ItemList.Crop_Drop_Cucumber.set(addItem( + tLastID = 556, + "Cucumber", + "Not a Sea Cucumber!", + "cropCucumber", + new GT_FoodStat(1, 0.2F, EnumAction.eat, null, false, true, false), + new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); + ItemList.Crop_Drop_Rape.set(addItem( + tLastID = 557, + "Rape", + "Time to oil up!", + new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L))); + + ItemList.Food_Cheese.set(addItem( + tLastID = 558, + "Cheese", + "Click the Cheese", + "foodCheese", + new GT_FoodStat(3, 0.6F, EnumAction.eat, null, false, true, false), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 2L))); + ItemList.Food_Dough.set(addItem( + tLastID = 559, + "Dough", + "For making Breads", + "foodDough", + new GT_FoodStat(1, 0.1F, EnumAction.eat, null, false, true, false), + new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); + ItemList.Food_Flat_Dough.set(addItem( + tLastID = 560, + "Flattened Dough", + "For making Pizza", + new GT_FoodStat(1, 0.1F, EnumAction.eat, null, false, true, false), + new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); + ItemList.Food_Raw_Bread.set(addItem( + tLastID = 561, + "Dough", + "In Bread Shape", + new GT_FoodStat(1, 0.2F, EnumAction.eat, null, false, true, false), + new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); + ItemList.Food_Raw_Bun.set(addItem( + tLastID = 562, + "Dough", + "In Bun Shape", + new GT_FoodStat(1, 0.1F, EnumAction.eat, null, false, true, false), + new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); + ItemList.Food_Raw_Baguette.set(addItem( + tLastID = 563, + "Dough", + "In Baguette Shape", + new GT_FoodStat(1, 0.3F, EnumAction.eat, null, false, true, false), + new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); + ItemList.Food_Baked_Bun.set(addItem( + tLastID = 564, + "Bun", + "Do not teleport Bread!", + new GT_FoodStat(3, 0.5F, EnumAction.eat, null, false, true, false), + new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + ItemList.Food_Baked_Baguette.set(addItem( + tLastID = 565, + "Baguette", + "I teleported nothing BUT Bread!!!", + new GT_FoodStat(8, 0.5F, EnumAction.eat, null, false, true, false), + new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + ItemList.Food_Sliced_Bread.set(addItem( + tLastID = 566, + "Sliced Bread", + "Just half a Bread", + new GT_FoodStat(2, 0.3F, EnumAction.eat, null, false, true, false), + new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + ItemList.Food_Sliced_Bun.set(addItem( + tLastID = 567, + "Sliced Bun", + "Just half a Bun", + new GT_FoodStat(1, 0.3F, EnumAction.eat, null, false, true, false), + new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + ItemList.Food_Sliced_Baguette.set(addItem( + tLastID = 568, + "Sliced Baguette", + "Just half a Baguette", + new GT_FoodStat(4, 0.3F, EnumAction.eat, null, false, true, false), + new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + ItemList.Food_Raw_Cake.set(addItem( + tLastID = 569, + "Cake Bottom", + "For making Cake", + new GT_FoodStat(2, 0.2F, EnumAction.eat, null, false, true, false), + new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); + ItemList.Food_Baked_Cake.set(addItem( + tLastID = 570, + "Baked Cake Bottom", + "I know I promised you an actual Cake, but well...", + new GT_FoodStat(3, 0.3F, EnumAction.eat, null, false, true, false), + new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); + ItemList.Food_Sliced_Lemon.set(addItem( + tLastID = 571, + "Lemon Slice", + "Ideal to put on your Drink", + new GT_FoodStat(1, 0.075F, EnumAction.eat, null, false, true, false), + new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L))); + ItemList.Food_Sliced_Tomato.set(addItem( + tLastID = 572, + "Tomato Slice", + "Solid Ketchup", + new GT_FoodStat(1, 0.05F, EnumAction.eat, null, false, true, false), + new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L))); + ItemList.Food_Sliced_Onion.set(addItem( + tLastID = 573, + "Onion Slice", + "ONIONS, UNITE!", + new GT_FoodStat(1, 0.05F, EnumAction.eat, null, false, true, false), + new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L))); + ItemList.Food_Sliced_Cucumber.set(addItem( + tLastID = 574, + "Cucumber Slice", + "QUEWWW-CUMMM-BERRR!!!", + new GT_FoodStat(1, 0.05F, EnumAction.eat, null, false, true, false), + new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L))); + + ItemList.Food_Sliced_Cheese.set(addItem( + tLastID = 576, + "Cheese Slice", + "ALIEN ATTACK!!!, throw the CHEEEEESE!!!", + new GT_FoodStat(1, 0.1F, EnumAction.eat, null, false, true, false), + new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); GT_ModHandler.addExtractionRecipe(new ItemStack(Blocks.red_flower, 1, 0), new ItemStack(Items.dye, 2, 1)); GT_ModHandler.addExtractionRecipe(new ItemStack(Blocks.red_flower, 1, 1), new ItemStack(Items.dye, 2, 12)); @@ -361,49 +2311,108 @@ public class GT_MetaGenerated_Item_02 extends GT_MetaGenerated_Item_X32 { GT_ModHandler.addExtractionRecipe(new ItemStack(Blocks.double_plant, 1, 1), new ItemStack(Items.dye, 3, 13)); GT_ModHandler.addExtractionRecipe(new ItemStack(Blocks.double_plant, 1, 4), new ItemStack(Items.dye, 3, 1)); GT_ModHandler.addExtractionRecipe(new ItemStack(Blocks.double_plant, 1, 5), new ItemStack(Items.dye, 3, 9)); - GT_ModHandler.addExtractionRecipe(ItemList.Crop_Drop_Plumbilia.get(1L), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Lead, 1L)); - GT_ModHandler.addExtractionRecipe(ItemList.Crop_Drop_Argentia.get(1L), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Silver, 1L)); + GT_ModHandler.addExtractionRecipe( + ItemList.Crop_Drop_Plumbilia.get(1L), + GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Lead, 1L)); + GT_ModHandler.addExtractionRecipe( + ItemList.Crop_Drop_Argentia.get(1L), + GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Silver, 1L)); GT_ModHandler.addExtractionRecipe(ItemList.Crop_Drop_Indigo.get(1L), ItemList.Dye_Indigo.get(1L)); - GT_ModHandler.addExtractionRecipe(ItemList.Crop_Drop_MilkWart.get(1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Milk, 1L)); - GT_ModHandler.addExtractionRecipe(ItemList.Crop_Drop_Coppon.get(1L), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Copper, 1L)); - GT_ModHandler.addExtractionRecipe(ItemList.Crop_Drop_Tine.get(1L), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Tin, 1L)); + GT_ModHandler.addExtractionRecipe( + ItemList.Crop_Drop_MilkWart.get(1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Milk, 1L)); + GT_ModHandler.addExtractionRecipe( + ItemList.Crop_Drop_Coppon.get(1L), + GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Copper, 1L)); + GT_ModHandler.addExtractionRecipe( + ItemList.Crop_Drop_Tine.get(1L), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Tin, 1L)); GT_ModHandler.addCompressionRecipe(ItemList.Crop_Drop_Coppon.get(4L), new ItemStack(Blocks.wool, 1, 1)); - GT_ModHandler.addCompressionRecipe(ItemList.Crop_Drop_Plumbilia.get(4L), ItemList.IC2_PlantballCompressed.get(1L)); - GT_ModHandler.addCompressionRecipe(ItemList.Crop_Drop_Argentia.get(4L), ItemList.IC2_PlantballCompressed.get(1L)); + GT_ModHandler.addCompressionRecipe( + ItemList.Crop_Drop_Plumbilia.get(4L), ItemList.IC2_PlantballCompressed.get(1L)); + GT_ModHandler.addCompressionRecipe( + ItemList.Crop_Drop_Argentia.get(4L), ItemList.IC2_PlantballCompressed.get(1L)); GT_ModHandler.addCompressionRecipe(ItemList.Crop_Drop_Indigo.get(4L), ItemList.IC2_PlantballCompressed.get(1L)); GT_ModHandler.addCompressionRecipe(ItemList.Crop_Drop_Ferru.get(4L), ItemList.IC2_PlantballCompressed.get(1L)); - GT_ModHandler.addCompressionRecipe(ItemList.Crop_Drop_Aurelia.get(4L), ItemList.IC2_PlantballCompressed.get(1L)); - GT_ModHandler.addCompressionRecipe(ItemList.Crop_Drop_OilBerry.get(4L), ItemList.IC2_PlantballCompressed.get(1L)); - GT_ModHandler.addCompressionRecipe(ItemList.Crop_Drop_BobsYerUncleRanks.get(4L), ItemList.IC2_PlantballCompressed.get(1L)); + GT_ModHandler.addCompressionRecipe( + ItemList.Crop_Drop_Aurelia.get(4L), ItemList.IC2_PlantballCompressed.get(1L)); + GT_ModHandler.addCompressionRecipe( + ItemList.Crop_Drop_OilBerry.get(4L), ItemList.IC2_PlantballCompressed.get(1L)); + GT_ModHandler.addCompressionRecipe( + ItemList.Crop_Drop_BobsYerUncleRanks.get(4L), ItemList.IC2_PlantballCompressed.get(1L)); GT_ModHandler.addCompressionRecipe(ItemList.Crop_Drop_Tine.get(4L), ItemList.IC2_PlantballCompressed.get(1L)); GT_ModHandler.addCompressionRecipe(ItemList.Crop_Drop_Rape.get(4L), ItemList.IC2_PlantballCompressed.get(1L)); - GT_ModHandler.addCompressionRecipe(new ItemStack(Blocks.red_flower, 8, 32767), ItemList.IC2_PlantballCompressed.get(1L)); - GT_ModHandler.addCompressionRecipe(new ItemStack(Blocks.yellow_flower, 8, 32767), ItemList.IC2_PlantballCompressed.get(1L)); - - GT_ModHandler.addPulverisationRecipe(ItemList.Food_Sliced_Cheese.get(1L), GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Cheese, 1L)); - GT_ModHandler.addPulverisationRecipe(ItemList.Dye_Cocoa.get(1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Cocoa, 1L)); - GT_ModHandler.addPulverisationRecipe(ItemList.Crop_Drop_Tine.get(1L), GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Wood, 2L)); - GT_ModHandler.addPulverisationRecipe(new ItemStack(Items.reeds, 1), new ItemStack(Items.sugar, 1), null, 0, false); - GT_ModHandler.addPulverisationRecipe(new ItemStack(Blocks.melon_block, 1, 0), new ItemStack(Items.melon, 8, 0), new ItemStack(Items.melon_seeds, 1), 80, false); - GT_ModHandler.addPulverisationRecipe(new ItemStack(Blocks.pumpkin, 1, 0), new ItemStack(Items.pumpkin_seeds, 4, 0), null, 0, false); - GT_ModHandler.addPulverisationRecipe(new ItemStack(Items.melon, 1, 0), new ItemStack(Items.melon_seeds, 1, 0), null, 0, false); - GT_ModHandler.addPulverisationRecipe(new ItemStack(Items.wheat, 1, 0), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wheat, 1L), null, 0, false); - GT_ModHandler.addPulverisationRecipe(GT_ModHandler.getIC2Item("crop", 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 1L), null, 0, false); - GT_ModHandler.addPulverisationRecipe(new ItemStack(Items.stick, 1), GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Wood, 2L), null, 0, false); - GT_ModHandler.addPulverisationRecipe(new ItemStack(Blocks.wool, 1, 32767), new ItemStack(Items.string, 2), new ItemStack(Items.string, 1), 50, false); - GT_ModHandler.addPulverisationRecipe(ItemList.Tesseract.get(1), new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.dust, Materials.TranscendentMetal, 8L)}, new int[] {10000}, 32_000_000, 100); + GT_ModHandler.addCompressionRecipe( + new ItemStack(Blocks.red_flower, 8, 32767), ItemList.IC2_PlantballCompressed.get(1L)); + GT_ModHandler.addCompressionRecipe( + new ItemStack(Blocks.yellow_flower, 8, 32767), ItemList.IC2_PlantballCompressed.get(1L)); + + GT_ModHandler.addPulverisationRecipe( + ItemList.Food_Sliced_Cheese.get(1L), + GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Cheese, 1L)); + GT_ModHandler.addPulverisationRecipe( + ItemList.Dye_Cocoa.get(1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Cocoa, 1L)); + GT_ModHandler.addPulverisationRecipe( + ItemList.Crop_Drop_Tine.get(1L), GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Wood, 2L)); + GT_ModHandler.addPulverisationRecipe( + new ItemStack(Items.reeds, 1), new ItemStack(Items.sugar, 1), null, 0, false); + GT_ModHandler.addPulverisationRecipe( + new ItemStack(Blocks.melon_block, 1, 0), + new ItemStack(Items.melon, 8, 0), + new ItemStack(Items.melon_seeds, 1), + 80, + false); + GT_ModHandler.addPulverisationRecipe( + new ItemStack(Blocks.pumpkin, 1, 0), new ItemStack(Items.pumpkin_seeds, 4, 0), null, 0, false); + GT_ModHandler.addPulverisationRecipe( + new ItemStack(Items.melon, 1, 0), new ItemStack(Items.melon_seeds, 1, 0), null, 0, false); + GT_ModHandler.addPulverisationRecipe( + new ItemStack(Items.wheat, 1, 0), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wheat, 1L), + null, + 0, + false); + GT_ModHandler.addPulverisationRecipe( + GT_ModHandler.getIC2Item("crop", 1L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 1L), + null, + 0, + false); + GT_ModHandler.addPulverisationRecipe( + new ItemStack(Items.stick, 1), + GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Wood, 2L), + null, + 0, + false); + GT_ModHandler.addPulverisationRecipe( + new ItemStack(Blocks.wool, 1, 32767), + new ItemStack(Items.string, 2), + new ItemStack(Items.string, 1), + 50, + false); + GT_ModHandler.addPulverisationRecipe( + ItemList.Tesseract.get(1), + new ItemStack[] {GT_OreDictUnificator.get(OrePrefixes.dust, Materials.TranscendentMetal, 8L)}, + new int[] {10000}, + 32_000_000, + 100); try { ic2.api.crops.CropCard tCrop; - GT_Utility.getField(tCrop = ic2.api.crops.Crops.instance.getCropList()[13], "mDrop").set(tCrop, ItemList.Crop_Drop_Ferru.get(1L)); - GT_Utility.getField(tCrop = ic2.api.crops.Crops.instance.getCropList()[14], "mDrop").set(tCrop, ItemList.Crop_Drop_Aurelia.get(1L)); + GT_Utility.getField(tCrop = ic2.api.crops.Crops.instance.getCropList()[13], "mDrop") + .set(tCrop, ItemList.Crop_Drop_Ferru.get(1L)); + GT_Utility.getField(tCrop = ic2.api.crops.Crops.instance.getCropList()[14], "mDrop") + .set(tCrop, ItemList.Crop_Drop_Aurelia.get(1L)); } catch (Throwable e) { if (GT_Values.D1) { e.printStackTrace(GT_Log.err); } } - ItemList.Display_ITS_FREE.set(addItem(tLastID = 766, "ITS FREE", "(or at least almost free)", SubTag.INVISIBLE, new TC_Aspects.TC_AspectStack(TC_Aspects.LUCRUM, 1L))); -} + ItemList.Display_ITS_FREE.set(addItem( + tLastID = 766, + "ITS FREE", + "(or at least almost free)", + SubTag.INVISIBLE, + new TC_Aspects.TC_AspectStack(TC_Aspects.LUCRUM, 1L))); + } @Override public boolean onLeftClickEntity(ItemStack aStack, EntityPlayer aPlayer, Entity aEntity) { @@ -425,7 +2434,8 @@ public class GT_MetaGenerated_Item_02 extends GT_MetaGenerated_Item_X32 { } @Override - public EntityArrow getProjectile(SubTag aProjectileType, ItemStack aStack, World aWorld, double aX, double aY, double aZ) { + public EntityArrow getProjectile( + SubTag aProjectileType, ItemStack aStack, World aWorld, double aX, double aY, double aZ) { int aDamage = aStack.getItemDamage(); if ((aDamage >= 25000) && (aDamage < 27000)) { if (aDamage >= 26000) { @@ -437,11 +2447,13 @@ public class GT_MetaGenerated_Item_02 extends GT_MetaGenerated_Item_X32 { } @Override - public EntityArrow getProjectile(SubTag aProjectileType, ItemStack aStack, World aWorld, EntityLivingBase aEntity, float aSpeed) { + public EntityArrow getProjectile( + SubTag aProjectileType, ItemStack aStack, World aWorld, EntityLivingBase aEntity, float aSpeed) { int aDamage = aStack.getItemDamage(); if ((aDamage >= 25000) && (aDamage < 27000)) { if (aDamage >= 26000) { - return Behaviour_Arrow.DEFAULT_PLASTIC.getProjectile(this, aProjectileType, aStack, aWorld, aEntity, aSpeed); + return Behaviour_Arrow.DEFAULT_PLASTIC.getProjectile( + this, aProjectileType, aStack, aWorld, aEntity, aSpeed); } return Behaviour_Arrow.DEFAULT_WOODEN.getProjectile(this, aProjectileType, aStack, aWorld, aEntity, aSpeed); } @@ -453,7 +2465,9 @@ public class GT_MetaGenerated_Item_02 extends GT_MetaGenerated_Item_X32 { int aDamage = aStack.getItemDamage(); Materials aMaterial = GregTech_API.sGeneratedMaterials[(aDamage % 1000)]; if ((aDamage >= 25000) && (aDamage < 27000) && (aMaterial != null) && (aMaterial.mEnchantmentTools != null)) { - Enchantment tEnchant = aMaterial.mEnchantmentTools == Enchantment.fortune ? Enchantment.looting : aMaterial.mEnchantmentTools; + Enchantment tEnchant = aMaterial.mEnchantmentTools == Enchantment.fortune + ? Enchantment.looting + : aMaterial.mEnchantmentTools; if (tEnchant.type == EnumEnchantmentType.weapon) { NBTTagCompound tNBT = GT_Utility.ItemNBT.getNBT(aStack); if (!tNBT.getBoolean("GT.HasBeenUpdated")) { diff --git a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_03.java b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_03.java index 1e3402618a..59abe764fb 100644 --- a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_03.java +++ b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_03.java @@ -1,5 +1,9 @@ package gregtech.common.items; +import static gregtech.api.enums.Textures.BlockIcons.SOLARPANEL_UEV; +import static gregtech.api.enums.Textures.BlockIcons.SOLARPANEL_UHV; +import static gregtech.api.enums.Textures.BlockIcons.SOLARPANEL_UIV; + import gregtech.api.GregTech_API; import gregtech.api.enums.*; import gregtech.api.items.GT_MetaGenerated_Item_X32; @@ -8,16 +12,16 @@ import gregtech.api.util.GT_OreDictUnificator; import gregtech.common.covers.GT_Cover_SolarPanel; import net.minecraftforge.oredict.OreDictionary; -import static gregtech.api.enums.Textures.BlockIcons.SOLARPANEL_UEV; -import static gregtech.api.enums.Textures.BlockIcons.SOLARPANEL_UHV; -import static gregtech.api.enums.Textures.BlockIcons.SOLARPANEL_UIV; - -public class GT_MetaGenerated_Item_03 - extends GT_MetaGenerated_Item_X32 { +public class GT_MetaGenerated_Item_03 extends GT_MetaGenerated_Item_X32 { public static GT_MetaGenerated_Item_03 INSTANCE; public GT_MetaGenerated_Item_03() { - super("metaitem.03", OrePrefixes.crateGtDust, OrePrefixes.crateGtIngot, OrePrefixes.crateGtGem, OrePrefixes.crateGtPlate); + super( + "metaitem.03", + OrePrefixes.crateGtDust, + OrePrefixes.crateGtIngot, + OrePrefixes.crateGtGem, + OrePrefixes.crateGtPlate); INSTANCE = this; int tLastID = 0; Object[] o = new Object[0]; @@ -31,7 +35,8 @@ public class GT_MetaGenerated_Item_03 * fiberglass circuit board (simple + multilayer) / glass + plastic + electrum foil + sulfurci acid * wetware lifesupport board / fiberglass CB + teflon + */ - ItemList.Circuit_Board_Wetware.set(addItem(tLastID = 6, "Wetware Lifesupport Circuit Board", "The Board that keeps life", o)); + ItemList.Circuit_Board_Wetware.set( + addItem(tLastID = 6, "Wetware Lifesupport Circuit Board", "The Board that keeps life", o)); ItemList.Circuit_Board_Plastic.set(addItem(tLastID = 7, "Plastic Circuit Board", "A Good Board", o)); ItemList.Circuit_Board_Bio.set(addItem(tLastID = 8, "Bio Circuit Board", "Bio genetic mutated Board", o)); @@ -45,41 +50,85 @@ public class GT_MetaGenerated_Item_03 * capacitors normal+smd * Glass Fibers */ - ItemList.Circuit_Parts_ResistorSMD.set(addItem(tLastID = 11, "SMD Resistor", "Electronic Component", OrePrefixes.componentCircuit.get(Materials.Resistor), SubTag.NO_UNIFICATION)); + ItemList.Circuit_Parts_ResistorSMD.set(addItem( + tLastID = 11, + "SMD Resistor", + "Electronic Component", + OrePrefixes.componentCircuit.get(Materials.Resistor), + SubTag.NO_UNIFICATION)); ItemList.Circuit_Parts_Glass_Tube.set(addItem(tLastID = 12, "Glass Tube", "", o)); ItemList.Circuit_Parts_Coil.set(addItem(tLastID = 14, "Small Coil", "Basic Electronic Component", o)); - ItemList.Circuit_Parts_DiodeSMD.set(addItem(tLastID = 16, "SMD Diode", "Electronic Component", OrePrefixes.componentCircuit.get(Materials.Diode), SubTag.NO_UNIFICATION)); - ItemList.Circuit_Parts_TransistorSMD.set(addItem(tLastID = 18, "SMD Transistor", "Electronic Component", OrePrefixes.componentCircuit.get(Materials.Transistor), SubTag.NO_UNIFICATION)); - ItemList.Circuit_Parts_CapacitorSMD.set(addItem(tLastID = 20, "SMD Capacitor", "Electronic Component", OrePrefixes.componentCircuit.get(Materials.Capacitor), SubTag.NO_UNIFICATION)); - ItemList.Circuit_Parts_GlassFiber.set(addItem(tLastID = 21, "Glass Fiber", Materials.BorosilicateGlass.mChemicalFormula, o)); + ItemList.Circuit_Parts_DiodeSMD.set(addItem( + tLastID = 16, + "SMD Diode", + "Electronic Component", + OrePrefixes.componentCircuit.get(Materials.Diode), + SubTag.NO_UNIFICATION)); + ItemList.Circuit_Parts_TransistorSMD.set(addItem( + tLastID = 18, + "SMD Transistor", + "Electronic Component", + OrePrefixes.componentCircuit.get(Materials.Transistor), + SubTag.NO_UNIFICATION)); + ItemList.Circuit_Parts_CapacitorSMD.set(addItem( + tLastID = 20, + "SMD Capacitor", + "Electronic Component", + OrePrefixes.componentCircuit.get(Materials.Capacitor), + SubTag.NO_UNIFICATION)); + ItemList.Circuit_Parts_GlassFiber.set( + addItem(tLastID = 21, "Glass Fiber", Materials.BorosilicateGlass.mChemicalFormula, o)); ItemList.Circuit_Parts_PetriDish.set(addItem(tLastID = 22, "Petri Dish", "For cultivating cells", o)); ItemList.Circuit_Parts_Reinforced_Glass_Tube.set(addItem(tLastID = 23, "Reinforced Glass Tube", "", o)); - ItemList.Circuit_Parts_ResistorASMD.set(addItem(tLastID = 24, "Advanced SMD Resistor", "Advanced Electronic Component", o)); - ItemList.Circuit_Parts_DiodeASMD.set(addItem(tLastID = 25, "Advanced SMD Diode", "Advanced Electronic Component", o)); - ItemList.Circuit_Parts_TransistorASMD.set(addItem(tLastID = 26, "Advanced SMD Transistor", "Advanced Electronic Component", o)); - ItemList.Circuit_Parts_CapacitorASMD.set(addItem(tLastID = 27, "Advanced SMD Capacitor", "Advanced Electronic Component", o)); - - ItemList.Circuit_Parts_ResistorXSMD.set(addItem(tLastID = 178, "Optical SMD Resistor", "Highly Advanced Electronic Component", o)); - ItemList.Circuit_Parts_DiodeXSMD.set(addItem(tLastID = 179, "Optical SMD Diode", "Highly Advanced Electronic Component", o)); - ItemList.Circuit_Parts_TransistorXSMD.set(addItem(tLastID = 180, "Optical SMD Transistor", "Highly Advanced Electronic Component", o)); - ItemList.Circuit_Parts_CapacitorXSMD.set(addItem(tLastID = 181, "Optical SMD Capacitor", "Highly Advanced Electronic Component", o)); - - ItemList.Circuit_Parts_InductorSMD.set(addItem(tLastID = 182, "SMD Inductor", "Electronic Component", OrePrefixes.componentCircuit.get(Materials.Inductor), SubTag.NO_UNIFICATION)); - ItemList.Circuit_Parts_InductorASMD.set(addItem(tLastID = 183, "Advanced SMD Inductor", "Advanced Electronic Component", o)); - ItemList.Circuit_Parts_InductorXSMD.set(addItem(tLastID = 184, "Optical SMD Inductor", "Highly Advanced Electronic Component", o)); - - GT_OreDictUnificator.set(OrePrefixes.componentCircuit, Materials.Resistor, ItemList.Circuit_Parts_Resistor.get(1L)); + ItemList.Circuit_Parts_ResistorASMD.set( + addItem(tLastID = 24, "Advanced SMD Resistor", "Advanced Electronic Component", o)); + ItemList.Circuit_Parts_DiodeASMD.set( + addItem(tLastID = 25, "Advanced SMD Diode", "Advanced Electronic Component", o)); + ItemList.Circuit_Parts_TransistorASMD.set( + addItem(tLastID = 26, "Advanced SMD Transistor", "Advanced Electronic Component", o)); + ItemList.Circuit_Parts_CapacitorASMD.set( + addItem(tLastID = 27, "Advanced SMD Capacitor", "Advanced Electronic Component", o)); + + ItemList.Circuit_Parts_ResistorXSMD.set( + addItem(tLastID = 178, "Optical SMD Resistor", "Highly Advanced Electronic Component", o)); + ItemList.Circuit_Parts_DiodeXSMD.set( + addItem(tLastID = 179, "Optical SMD Diode", "Highly Advanced Electronic Component", o)); + ItemList.Circuit_Parts_TransistorXSMD.set( + addItem(tLastID = 180, "Optical SMD Transistor", "Highly Advanced Electronic Component", o)); + ItemList.Circuit_Parts_CapacitorXSMD.set( + addItem(tLastID = 181, "Optical SMD Capacitor", "Highly Advanced Electronic Component", o)); + + ItemList.Circuit_Parts_InductorSMD.set(addItem( + tLastID = 182, + "SMD Inductor", + "Electronic Component", + OrePrefixes.componentCircuit.get(Materials.Inductor), + SubTag.NO_UNIFICATION)); + ItemList.Circuit_Parts_InductorASMD.set( + addItem(tLastID = 183, "Advanced SMD Inductor", "Advanced Electronic Component", o)); + ItemList.Circuit_Parts_InductorXSMD.set( + addItem(tLastID = 184, "Optical SMD Inductor", "Highly Advanced Electronic Component", o)); + + GT_OreDictUnificator.set( + OrePrefixes.componentCircuit, Materials.Resistor, ItemList.Circuit_Parts_Resistor.get(1L)); GT_OreDictUnificator.set(OrePrefixes.componentCircuit, Materials.Diode, ItemList.Circuit_Parts_Diode.get(1L)); - GT_OreDictUnificator.set(OrePrefixes.componentCircuit, Materials.Transistor, ItemList.Circuit_Parts_Transistor.get(1L)); + GT_OreDictUnificator.set( + OrePrefixes.componentCircuit, Materials.Transistor, ItemList.Circuit_Parts_Transistor.get(1L)); GT_OreDictUnificator.set(OrePrefixes.componentCircuit, Materials.Inductor, ItemList.Circuit_Parts_Coil.get(1L)); - GT_OreDictUnificator.set(OrePrefixes.componentCircuit, Materials.Capacitor, ItemList.Circuit_Parts_Capacitor.get(1L)); - - GT_OreDictUnificator.addAssociation(OrePrefixes.componentCircuit, Materials.Resistor, ItemList.Circuit_Parts_ResistorSMD.get(1L), true); - GT_OreDictUnificator.addAssociation(OrePrefixes.componentCircuit, Materials.Diode, ItemList.Circuit_Parts_DiodeSMD.get(1L), true); - GT_OreDictUnificator.addAssociation(OrePrefixes.componentCircuit, Materials.Transistor, ItemList.Circuit_Parts_TransistorSMD.get(1L), true); - GT_OreDictUnificator.addAssociation(OrePrefixes.componentCircuit, Materials.Capacitor, ItemList.Circuit_Parts_CapacitorSMD.get(1L), true); - GT_OreDictUnificator.addAssociation(OrePrefixes.componentCircuit, Materials.Inductor, ItemList.Circuit_Parts_InductorSMD.get(1L), true); + GT_OreDictUnificator.set( + OrePrefixes.componentCircuit, Materials.Capacitor, ItemList.Circuit_Parts_Capacitor.get(1L)); + + GT_OreDictUnificator.addAssociation( + OrePrefixes.componentCircuit, Materials.Resistor, ItemList.Circuit_Parts_ResistorSMD.get(1L), true); + GT_OreDictUnificator.addAssociation( + OrePrefixes.componentCircuit, Materials.Diode, ItemList.Circuit_Parts_DiodeSMD.get(1L), true); + GT_OreDictUnificator.addAssociation( + OrePrefixes.componentCircuit, Materials.Transistor, ItemList.Circuit_Parts_TransistorSMD.get(1L), true); + GT_OreDictUnificator.addAssociation( + OrePrefixes.componentCircuit, Materials.Capacitor, ItemList.Circuit_Parts_CapacitorSMD.get(1L), true); + GT_OreDictUnificator.addAssociation( + OrePrefixes.componentCircuit, Materials.Inductor, ItemList.Circuit_Parts_InductorSMD.get(1L), true); /** * ICs @@ -100,10 +149,14 @@ public class GT_MetaGenerated_Item_03 * quantum chips */ ItemList.Circuit_Silicon_Ingot.set(addItem(tLastID = 30, "Monocrystalline Silicon Boule", "Raw Circuit", o)); - ItemList.Circuit_Silicon_Ingot2.set(addItem(tLastID = 31, "Phosphorus doped Monocrystalline Silicon Boule", "Raw Circuit", o)); - ItemList.Circuit_Silicon_Ingot3.set(addItem(tLastID = 32, "Naquadah doped Monocrystalline Silicon Boule", "Raw Circuit", o)); - ItemList.Circuit_Silicon_Ingot4.set(addItem(tLastID = 150, "Europium doped Monocrystalline Silicon Boule", "Raw Circuit", o)); - ItemList.Circuit_Silicon_Ingot5.set(addItem(tLastID = 152, "Americium doped Monocrystalline Silicon Boule", "Raw Circuit", o)); + ItemList.Circuit_Silicon_Ingot2.set( + addItem(tLastID = 31, "Phosphorus doped Monocrystalline Silicon Boule", "Raw Circuit", o)); + ItemList.Circuit_Silicon_Ingot3.set( + addItem(tLastID = 32, "Naquadah doped Monocrystalline Silicon Boule", "Raw Circuit", o)); + ItemList.Circuit_Silicon_Ingot4.set( + addItem(tLastID = 150, "Europium doped Monocrystalline Silicon Boule", "Raw Circuit", o)); + ItemList.Circuit_Silicon_Ingot5.set( + addItem(tLastID = 152, "Americium doped Monocrystalline Silicon Boule", "Raw Circuit", o)); ItemList.Circuit_Silicon_Wafer.set(addItem(tLastID = 33, "Wafer", "Raw Circuit", o)); ItemList.Circuit_Silicon_Wafer2.set(addItem(tLastID = 34, "Phosphorus doped Wafer", "Raw Circuit", o)); @@ -139,7 +192,8 @@ public class GT_MetaGenerated_Item_03 ItemList.Circuit_Chip_HPIC.set(addItem(tLastID = 53, "High Power IC", "High Power Circuit", o)); ItemList.Circuit_Wafer_NanoCPU.set(addItem(tLastID = 54, "NanoCPU Wafer", "Raw Circuit", o)); - ItemList.Circuit_Chip_NanoCPU.set(addItem(tLastID = 55, "Nanocomponent Central Processing Unit", "Power Circuit", o)); + ItemList.Circuit_Chip_NanoCPU.set( + addItem(tLastID = 55, "Nanocomponent Central Processing Unit", "Power Circuit", o)); ItemList.Circuit_Wafer_QuantumCPU.set(addItem(tLastID = 56, "QBit Wafer", "Raw Circuit", o)); ItemList.Circuit_Chip_QuantumCPU.set(addItem(tLastID = 57, "QBit Processing Unit", "Quantum CPU", o)); @@ -171,149 +225,379 @@ public class GT_MetaGenerated_Item_03 * SoCrystal * stem cells (disassemble eggs) */ - ItemList.Circuit_Chip_CrystalSoC2.set(addItem(tLastID = 68, "Raw Advanced Crystal Chip", "Raw Advanced Crystal Processor", o)); - ItemList.Circuit_Parts_RawCrystalChip.set(addItem(tLastID = 69, "Raw Crystal Chip", "Raw Crystal Processor", o)); - ItemList.Circuit_Chip_CrystalCPU.set(addItem(tLastID = 70, "Crystal Processing Unit", "Crystal CPU", o)); //Crystal chip elite part + ItemList.Circuit_Chip_CrystalSoC2.set( + addItem(tLastID = 68, "Raw Advanced Crystal Chip", "Raw Advanced Crystal Processor", o)); + ItemList.Circuit_Parts_RawCrystalChip.set( + addItem(tLastID = 69, "Raw Crystal Chip", "Raw Crystal Processor", o)); + ItemList.Circuit_Chip_CrystalCPU.set( + addItem(tLastID = 70, "Crystal Processing Unit", "Crystal CPU", o)); // Crystal chip elite part ItemList.Circuit_Chip_CrystalSoC.set(addItem(tLastID = 71, "Crystal SoC", "Crystal System on a Chip", o)); ItemList.Circuit_Chip_NeuroCPU.set(addItem(tLastID = 72, "Neuro Processing Unit", "Neuro CPU", o)); ItemList.Circuit_Chip_Stemcell.set(addItem(tLastID = 73, "Stemcells", "Raw inteligence", o)); - ItemList.Circuit_Parts_RawCrystalParts.set(addItem(tLastID = 74, "Raw Crystal Chip Parts", "Raw Crystal Processor Parts", o)); + ItemList.Circuit_Parts_RawCrystalParts.set( + addItem(tLastID = 74, "Raw Crystal Chip Parts", "Raw Crystal Processor Parts", o)); ItemList.Circuit_Chip_Biocell.set(addItem(tLastID = 76, "Biocells", "Mutated Raw inteligence", o)); ItemList.Circuit_Chip_BioCPU.set(addItem(tLastID = 77, "Bio Processing Unit", "Bio CPU", o)); - //Nand Chip - ItemList.NandChip.set(addItem(tLastID = 75, "NAND Chip", "A very simple Circuit", OrePrefixes.circuit.get(Materials.Primitive), SubTag.NO_UNIFICATION)); - OreDictionary.registerOre("ULV" , ItemList.NandChip.get(1)); - //Vacuum Tube Item01 - //Basic Circuit IC2 - //Good Circuit Item01 - - //Integrated Logic Circuit Item01 - ItemList.Circuit_Integrated_Good.set(addItem(tLastID = 79, "Good Integrated Circuit", "Good Circuit", OrePrefixes.circuit.get(Materials.Good), SubTag.NO_UNIFICATION)); - OreDictionary.registerOre("MV" , ItemList.Circuit_Integrated_Good.get(1)); - //Good Integrated Circuit Item01 - //Advanced Circuit IC2 - - ItemList.Circuit_Microprocessor.set(addItem(tLastID = 78, "Microprocessor", "A Basic Circuit", OrePrefixes.circuit.get(Materials.Basic), SubTag.NO_UNIFICATION)); - OreDictionary.registerOre("LV" , ItemList.Circuit_Microprocessor.get(1)); - ItemList.Circuit_Processor.set(addItem(tLastID = 80, "Integrated Processor", "A Good Circuit", OrePrefixes.circuit.get(Materials.Good), SubTag.NO_UNIFICATION)); - OreDictionary.registerOre("MV" , ItemList.Circuit_Processor.get(1)); - //ItemList.Circuit_Computer.set(addItem(tLastID = 81, "Processor Assembly", "Advanced Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Advanced), SubTag.NO_UNIFICATION})); - //Workstation/ Item01 Datacircuit - //Mainframe Item01 DataProcessor - - ItemList.Circuit_Nanoprocessor.set(addItem(tLastID = 82, "Nanoprocessor", "An Advanced Circuit", OrePrefixes.circuit.get(Materials.Advanced), SubTag.NO_UNIFICATION)); - OreDictionary.registerOre("HV" , ItemList.Circuit_Nanoprocessor.get(1)); - ItemList.Circuit_Nanocomputer.set(addItem(tLastID = 83, "Nanoprocessor Assembly", "An Extreme Circuit", OrePrefixes.circuit.get(Materials.Data), SubTag.NO_UNIFICATION)); - OreDictionary.registerOre("EV" , ItemList.Circuit_Nanocomputer.get(1)); - ItemList.Circuit_Elitenanocomputer.set(addItem(tLastID = 84, "Elite Nanocomputer", "An Elite Circuit", OrePrefixes.circuit.get(Materials.Elite), SubTag.NO_UNIFICATION)); - OreDictionary.registerOre("IV" , ItemList.Circuit_Elitenanocomputer.get(1)); - //Nanoprocessor Mainframe Item01 Energy Flow Circuit + // Nand Chip + ItemList.NandChip.set(addItem( + tLastID = 75, + "NAND Chip", + "A very simple Circuit", + OrePrefixes.circuit.get(Materials.Primitive), + SubTag.NO_UNIFICATION)); + OreDictionary.registerOre("ULV", ItemList.NandChip.get(1)); + // Vacuum Tube Item01 + // Basic Circuit IC2 + // Good Circuit Item01 + + // Integrated Logic Circuit Item01 + ItemList.Circuit_Integrated_Good.set(addItem( + tLastID = 79, + "Good Integrated Circuit", + "Good Circuit", + OrePrefixes.circuit.get(Materials.Good), + SubTag.NO_UNIFICATION)); + OreDictionary.registerOre("MV", ItemList.Circuit_Integrated_Good.get(1)); + // Good Integrated Circuit Item01 + // Advanced Circuit IC2 + + ItemList.Circuit_Microprocessor.set(addItem( + tLastID = 78, + "Microprocessor", + "A Basic Circuit", + OrePrefixes.circuit.get(Materials.Basic), + SubTag.NO_UNIFICATION)); + OreDictionary.registerOre("LV", ItemList.Circuit_Microprocessor.get(1)); + ItemList.Circuit_Processor.set(addItem( + tLastID = 80, + "Integrated Processor", + "A Good Circuit", + OrePrefixes.circuit.get(Materials.Good), + SubTag.NO_UNIFICATION)); + OreDictionary.registerOre("MV", ItemList.Circuit_Processor.get(1)); + // ItemList.Circuit_Computer.set(addItem(tLastID = 81, "Processor Assembly", "Advanced Circuit", new + // Object[]{OrePrefixes.circuit.get(Materials.Advanced), SubTag.NO_UNIFICATION})); + // Workstation/ Item01 Datacircuit + // Mainframe Item01 DataProcessor + + ItemList.Circuit_Nanoprocessor.set(addItem( + tLastID = 82, + "Nanoprocessor", + "An Advanced Circuit", + OrePrefixes.circuit.get(Materials.Advanced), + SubTag.NO_UNIFICATION)); + OreDictionary.registerOre("HV", ItemList.Circuit_Nanoprocessor.get(1)); + ItemList.Circuit_Nanocomputer.set(addItem( + tLastID = 83, + "Nanoprocessor Assembly", + "An Extreme Circuit", + OrePrefixes.circuit.get(Materials.Data), + SubTag.NO_UNIFICATION)); + OreDictionary.registerOre("EV", ItemList.Circuit_Nanocomputer.get(1)); + ItemList.Circuit_Elitenanocomputer.set(addItem( + tLastID = 84, + "Elite Nanocomputer", + "An Elite Circuit", + OrePrefixes.circuit.get(Materials.Elite), + SubTag.NO_UNIFICATION)); + OreDictionary.registerOre("IV", ItemList.Circuit_Elitenanocomputer.get(1)); + // Nanoprocessor Mainframe Item01 Energy Flow Circuit // Quantum circuits - ItemList.Circuit_Quantumprocessor.set(addItem(tLastID = 85, "Quantumprocessor", "An Extreme Circuit", OrePrefixes.circuit.get(Materials.Data), SubTag.NO_UNIFICATION)); - OreDictionary.registerOre("EV" , ItemList.Circuit_Quantumprocessor.get(1)); - ItemList.Circuit_Quantumcomputer.set(addItem(tLastID = 86, "Quantumprocessor Assembly", "An Elite Circuit", OrePrefixes.circuit.get(Materials.Elite), SubTag.NO_UNIFICATION)); - OreDictionary.registerOre("IV" , ItemList.Circuit_Quantumcomputer.get(1)); - ItemList.Circuit_Masterquantumcomputer.set(addItem(tLastID = 87, "Master Quantumcomputer", "A Master Circuit", OrePrefixes.circuit.get(Materials.Master), SubTag.NO_UNIFICATION)); - OreDictionary.registerOre("LuV" , ItemList.Circuit_Masterquantumcomputer.get(1)); - ItemList.Circuit_Quantummainframe.set(addItem(tLastID = 88, "Quantumprocessor Mainframe", "An Ultimate Circuit", OrePrefixes.circuit.get(Materials.Ultimate), SubTag.NO_UNIFICATION)); - OreDictionary.registerOre("ZPM" , ItemList.Circuit_Quantummainframe.get(1)); - + ItemList.Circuit_Quantumprocessor.set(addItem( + tLastID = 85, + "Quantumprocessor", + "An Extreme Circuit", + OrePrefixes.circuit.get(Materials.Data), + SubTag.NO_UNIFICATION)); + OreDictionary.registerOre("EV", ItemList.Circuit_Quantumprocessor.get(1)); + ItemList.Circuit_Quantumcomputer.set(addItem( + tLastID = 86, + "Quantumprocessor Assembly", + "An Elite Circuit", + OrePrefixes.circuit.get(Materials.Elite), + SubTag.NO_UNIFICATION)); + OreDictionary.registerOre("IV", ItemList.Circuit_Quantumcomputer.get(1)); + ItemList.Circuit_Masterquantumcomputer.set(addItem( + tLastID = 87, + "Master Quantumcomputer", + "A Master Circuit", + OrePrefixes.circuit.get(Materials.Master), + SubTag.NO_UNIFICATION)); + OreDictionary.registerOre("LuV", ItemList.Circuit_Masterquantumcomputer.get(1)); + ItemList.Circuit_Quantummainframe.set(addItem( + tLastID = 88, + "Quantumprocessor Mainframe", + "An Ultimate Circuit", + OrePrefixes.circuit.get(Materials.Ultimate), + SubTag.NO_UNIFICATION)); + OreDictionary.registerOre("ZPM", ItemList.Circuit_Quantummainframe.get(1)); // Crystal circuits - ItemList.Circuit_Crystalprocessor.set(addItem(tLastID = 89, "Crystalprocessor", "An Elite Circuit", OrePrefixes.circuit.get(Materials.Elite), SubTag.NO_UNIFICATION)); - OreDictionary.registerOre("IV" , ItemList.Circuit_Crystalprocessor.get(1)); - ItemList.Circuit_Crystalcomputer.set(addItem(tLastID = 96, "Crystalprocessor Assembly", "A Master Circuit", OrePrefixes.circuit.get(Materials.Master), SubTag.NO_UNIFICATION)); + ItemList.Circuit_Crystalprocessor.set(addItem( + tLastID = 89, + "Crystalprocessor", + "An Elite Circuit", + OrePrefixes.circuit.get(Materials.Elite), + SubTag.NO_UNIFICATION)); + OreDictionary.registerOre("IV", ItemList.Circuit_Crystalprocessor.get(1)); + ItemList.Circuit_Crystalcomputer.set(addItem( + tLastID = 96, + "Crystalprocessor Assembly", + "A Master Circuit", + OrePrefixes.circuit.get(Materials.Master), + SubTag.NO_UNIFICATION)); OreDictionary.registerOre("LuV", ItemList.Circuit_Crystalcomputer.get(1)); - ItemList.Circuit_Ultimatecrystalcomputer.set(addItem(tLastID = 90, "Ultimate Crystalcomputer", "An Ultimate Circuit", OrePrefixes.circuit.get(Materials.Ultimate), SubTag.NO_UNIFICATION)); + ItemList.Circuit_Ultimatecrystalcomputer.set(addItem( + tLastID = 90, + "Ultimate Crystalcomputer", + "An Ultimate Circuit", + OrePrefixes.circuit.get(Materials.Ultimate), + SubTag.NO_UNIFICATION)); OreDictionary.registerOre("ZPM", ItemList.Circuit_Ultimatecrystalcomputer.get(1)); - ItemList.Circuit_Crystalmainframe.set(addItem(tLastID = 91, "Crystalprocessor Mainframe", "A Super Circuit", OrePrefixes.circuit.get(Materials.Superconductor), SubTag.NO_UNIFICATION)); - OreDictionary.registerOre("UV" , ItemList.Circuit_Crystalmainframe.get(1)); + ItemList.Circuit_Crystalmainframe.set(addItem( + tLastID = 91, + "Crystalprocessor Mainframe", + "A Super Circuit", + OrePrefixes.circuit.get(Materials.Superconductor), + SubTag.NO_UNIFICATION)); + OreDictionary.registerOre("UV", ItemList.Circuit_Crystalmainframe.get(1)); // ???? Scared to remove. - ItemList.Circuit_Ultimate.set(ItemList.Circuit_Ultimatecrystalcomputer.get(1L)); //maybe should be removed + ItemList.Circuit_Ultimate.set(ItemList.Circuit_Ultimatecrystalcomputer.get(1L)); // maybe should be removed // Wetware circuits - ItemList.Circuit_Neuroprocessor.set(addItem(tLastID = 92, "Wetwareprocessor", "A Master Circuit", OrePrefixes.circuit.get(Materials.Master), SubTag.NO_UNIFICATION)); + ItemList.Circuit_Neuroprocessor.set(addItem( + tLastID = 92, + "Wetwareprocessor", + "A Master Circuit", + OrePrefixes.circuit.get(Materials.Master), + SubTag.NO_UNIFICATION)); OreDictionary.registerOre("LuV", ItemList.Circuit_Neuroprocessor.get(1)); - ItemList.Circuit_Wetwarecomputer.set(addItem(tLastID = 93, "Wetwareprocessor Assembly", "An Ultimate Circuit", OrePrefixes.circuit.get(Materials.Ultimate), SubTag.NO_UNIFICATION)); + ItemList.Circuit_Wetwarecomputer.set(addItem( + tLastID = 93, + "Wetwareprocessor Assembly", + "An Ultimate Circuit", + OrePrefixes.circuit.get(Materials.Ultimate), + SubTag.NO_UNIFICATION)); OreDictionary.registerOre("ZPM", ItemList.Circuit_Wetwarecomputer.get(1)); - ItemList.Circuit_Wetwaresupercomputer.set(addItem(tLastID = 94, "Wetware Supercomputer", "A Super Circuit", OrePrefixes.circuit.get(Materials.Superconductor), SubTag.NO_UNIFICATION)); + ItemList.Circuit_Wetwaresupercomputer.set(addItem( + tLastID = 94, + "Wetware Supercomputer", + "A Super Circuit", + OrePrefixes.circuit.get(Materials.Superconductor), + SubTag.NO_UNIFICATION)); OreDictionary.registerOre("UV", ItemList.Circuit_Wetwaresupercomputer.get(1)); - ItemList.Circuit_Wetwaremainframe.set(addItem(tLastID = 95, "Wetware Mainframe", "An Infinite Circuit", OrePrefixes.circuit.get(Materials.Infinite), SubTag.NO_UNIFICATION)); + ItemList.Circuit_Wetwaremainframe.set(addItem( + tLastID = 95, + "Wetware Mainframe", + "An Infinite Circuit", + OrePrefixes.circuit.get(Materials.Infinite), + SubTag.NO_UNIFICATION)); OreDictionary.registerOre("UHV", ItemList.Circuit_Wetwaremainframe.get(1)); // Bioware circuits. - ItemList.Circuit_Bioprocessor.set(addItem(tLastID = 97, "Bioprocessor", "An Ultimate Circuit", OrePrefixes.circuit.get(Materials.Ultimate), SubTag.NO_UNIFICATION)); + ItemList.Circuit_Bioprocessor.set(addItem( + tLastID = 97, + "Bioprocessor", + "An Ultimate Circuit", + OrePrefixes.circuit.get(Materials.Ultimate), + SubTag.NO_UNIFICATION)); OreDictionary.registerOre("ZPM", ItemList.Circuit_Bioprocessor.get(1)); - ItemList.Circuit_Biowarecomputer.set(addItem(tLastID = 98, "Biowareprocessor Assembly", "A Super Circuit", OrePrefixes.circuit.get(Materials.Superconductor), SubTag.NO_UNIFICATION)); + ItemList.Circuit_Biowarecomputer.set(addItem( + tLastID = 98, + "Biowareprocessor Assembly", + "A Super Circuit", + OrePrefixes.circuit.get(Materials.Superconductor), + SubTag.NO_UNIFICATION)); OreDictionary.registerOre("UV", ItemList.Circuit_Biowarecomputer.get(1)); - ItemList.Circuit_Biowaresupercomputer.set(addItem(tLastID = 99, "Bioware Supercomputer", "An Infinite Circuit", OrePrefixes.circuit.get(Materials.Infinite), SubTag.NO_UNIFICATION)); + ItemList.Circuit_Biowaresupercomputer.set(addItem( + tLastID = 99, + "Bioware Supercomputer", + "An Infinite Circuit", + OrePrefixes.circuit.get(Materials.Infinite), + SubTag.NO_UNIFICATION)); OreDictionary.registerOre("UHV", ItemList.Circuit_Biowaresupercomputer.get(1)); - ItemList.Circuit_Biomainframe.set(addItem(tLastID = 120, "Bio Mainframe", "A Bio Circuit", OrePrefixes.circuit.get(Materials.Bio), SubTag.NO_UNIFICATION)); + ItemList.Circuit_Biomainframe.set(addItem( + tLastID = 120, + "Bio Mainframe", + "A Bio Circuit", + OrePrefixes.circuit.get(Materials.Bio), + SubTag.NO_UNIFICATION)); OreDictionary.registerOre("UEV", ItemList.Circuit_Biomainframe.get(1)); ItemList.Circuit_Board_Coated_Basic.set(addItem(tLastID = 100, "Circuit Board", "A basic Circuit Board", o)); - ItemList.Circuit_Board_Phenolic_Good.set(addItem(tLastID = 101, "Good Circuit Board", "A good Circuit Board", o)); - ItemList.Circuit_Board_Epoxy_Advanced.set(addItem(tLastID = 102, "Advanced Circuit Board", "A advanced Circuit Board", o)); - ItemList.Circuit_Board_Fiberglass_Advanced.set(addItem(tLastID = 103, "More Advanced Circuit Board", "A more advanced Circuit Board", o)); - ItemList.Circuit_Board_Multifiberglass_Elite.set(addItem(tLastID = 104, "Elite Circuit Board", "A elite Circuit Board", o)); - ItemList.Circuit_Board_Wetware_Extreme.set(addItem(tLastID = 105, "Extreme Wetware Lifesupport Circuit Board", "The Board that keeps life", o)); + ItemList.Circuit_Board_Phenolic_Good.set( + addItem(tLastID = 101, "Good Circuit Board", "A good Circuit Board", o)); + ItemList.Circuit_Board_Epoxy_Advanced.set( + addItem(tLastID = 102, "Advanced Circuit Board", "A advanced Circuit Board", o)); + ItemList.Circuit_Board_Fiberglass_Advanced.set( + addItem(tLastID = 103, "More Advanced Circuit Board", "A more advanced Circuit Board", o)); + ItemList.Circuit_Board_Multifiberglass_Elite.set( + addItem(tLastID = 104, "Elite Circuit Board", "A elite Circuit Board", o)); + ItemList.Circuit_Board_Wetware_Extreme.set( + addItem(tLastID = 105, "Extreme Wetware Lifesupport Circuit Board", "The Board that keeps life", o)); ItemList.Circuit_Board_Plastic_Advanced.set(addItem(tLastID = 106, "Plastic Circuit Board", "A good Board", o)); - ItemList.Circuit_Board_Bio_Ultra.set(addItem(tLastID = 107, "Ultra Bio Mutated Circuit Board", "Bio genetic mutated Board", o)); + ItemList.Circuit_Board_Bio_Ultra.set( + addItem(tLastID = 107, "Ultra Bio Mutated Circuit Board", "Bio genetic mutated Board", o)); // Optical circuits - ItemList.Circuit_OpticalProcessor.set(addItem(tLastID = 154, "Optical Processor", "An Optical Circuit", OrePrefixes.circuit.get(Materials.Superconductor), SubTag.NO_UNIFICATION)); + ItemList.Circuit_OpticalProcessor.set(addItem( + tLastID = 154, + "Optical Processor", + "An Optical Circuit", + OrePrefixes.circuit.get(Materials.Superconductor), + SubTag.NO_UNIFICATION)); OreDictionary.registerOre("UV", ItemList.Circuit_OpticalProcessor.get(1)); - ItemList.Circuit_OpticalAssembly.set(addItem(tLastID = 155, "Optical Assembly", "An Optical Circuit", OrePrefixes.circuit.get(Materials.Infinite), SubTag.NO_UNIFICATION)); + ItemList.Circuit_OpticalAssembly.set(addItem( + tLastID = 155, + "Optical Assembly", + "An Optical Circuit", + OrePrefixes.circuit.get(Materials.Infinite), + SubTag.NO_UNIFICATION)); OreDictionary.registerOre("UHV", ItemList.Circuit_OpticalAssembly.get(1)); - ItemList.Circuit_OpticalComputer.set(addItem(tLastID = 156, "Optical Computer", "An Optical Circuit", OrePrefixes.circuit.get(Materials.Bio), SubTag.NO_UNIFICATION)); + ItemList.Circuit_OpticalComputer.set(addItem( + tLastID = 156, + "Optical Computer", + "An Optical Circuit", + OrePrefixes.circuit.get(Materials.Bio), + SubTag.NO_UNIFICATION)); OreDictionary.registerOre("UEV", ItemList.Circuit_OpticalComputer.get(1)); - ItemList.Circuit_OpticalMainframe.set(addItem(tLastID = 157, "Optical Mainframe", "An Optical Circuit", OrePrefixes.circuit.get(Materials.Optical), SubTag.NO_UNIFICATION)); + ItemList.Circuit_OpticalMainframe.set(addItem( + tLastID = 157, + "Optical Mainframe", + "An Optical Circuit", + OrePrefixes.circuit.get(Materials.Optical), + SubTag.NO_UNIFICATION)); OreDictionary.registerOre("UIV", ItemList.Circuit_OpticalMainframe.get(1)); - // Exotic circuits - ItemList.Circuit_ExoticProcessor.set(addItem(tLastID = 166, "Exotic Processor", "An Exotic Circuit", OrePrefixes.circuit.get(Materials.Infinite), SubTag.NO_UNIFICATION)); + ItemList.Circuit_ExoticProcessor.set(addItem( + tLastID = 166, + "Exotic Processor", + "An Exotic Circuit", + OrePrefixes.circuit.get(Materials.Infinite), + SubTag.NO_UNIFICATION)); OreDictionary.registerOre("UHV", ItemList.Circuit_ExoticProcessor.get(1)); - ItemList.Circuit_ExoticAssembly.set(addItem(tLastID = 167, "Exotic Assembly", "An Exotic Circuit", OrePrefixes.circuit.get(Materials.Bio), SubTag.NO_UNIFICATION)); + ItemList.Circuit_ExoticAssembly.set(addItem( + tLastID = 167, + "Exotic Assembly", + "An Exotic Circuit", + OrePrefixes.circuit.get(Materials.Bio), + SubTag.NO_UNIFICATION)); OreDictionary.registerOre("UEV", ItemList.Circuit_ExoticAssembly.get(1)); - ItemList.Circuit_ExoticComputer.set(addItem(tLastID = 168, "Exotic Computer", "An Exotic Circuit", OrePrefixes.circuit.get(Materials.Optical), SubTag.NO_UNIFICATION)); + ItemList.Circuit_ExoticComputer.set(addItem( + tLastID = 168, + "Exotic Computer", + "An Exotic Circuit", + OrePrefixes.circuit.get(Materials.Optical), + SubTag.NO_UNIFICATION)); OreDictionary.registerOre("UIV", ItemList.Circuit_ExoticComputer.get(1)); - ItemList.Circuit_ExoticMainframe.set(addItem(tLastID = 169, "Exotic Mainframe", "An Exotic Circuit", OrePrefixes.circuit.get(Materials.Exotic), SubTag.NO_UNIFICATION)); + ItemList.Circuit_ExoticMainframe.set(addItem( + tLastID = 169, + "Exotic Mainframe", + "An Exotic Circuit", + OrePrefixes.circuit.get(Materials.Exotic), + SubTag.NO_UNIFICATION)); OreDictionary.registerOre("UMV", ItemList.Circuit_ExoticMainframe.get(1)); // Cosmic circuits - ItemList.Circuit_CosmicProcessor.set(addItem(tLastID = 170, "Cosmic Processor", "A Cosmic Circuit", OrePrefixes.circuit.get(Materials.Bio), SubTag.NO_UNIFICATION)); + ItemList.Circuit_CosmicProcessor.set(addItem( + tLastID = 170, + "Cosmic Processor", + "A Cosmic Circuit", + OrePrefixes.circuit.get(Materials.Bio), + SubTag.NO_UNIFICATION)); OreDictionary.registerOre("UEV", ItemList.Circuit_CosmicProcessor.get(1)); - ItemList.Circuit_CosmicAssembly.set(addItem(tLastID = 171, "Cosmic Assembly", "A Cosmic Circuit", OrePrefixes.circuit.get(Materials.Optical), SubTag.NO_UNIFICATION)); + ItemList.Circuit_CosmicAssembly.set(addItem( + tLastID = 171, + "Cosmic Assembly", + "A Cosmic Circuit", + OrePrefixes.circuit.get(Materials.Optical), + SubTag.NO_UNIFICATION)); OreDictionary.registerOre("UIV", ItemList.Circuit_CosmicAssembly.get(1)); - ItemList.Circuit_CosmicComputer.set(addItem(tLastID = 172, "Cosmic Computer", "A Cosmic Circuit", OrePrefixes.circuit.get(Materials.Exotic), SubTag.NO_UNIFICATION)); + ItemList.Circuit_CosmicComputer.set(addItem( + tLastID = 172, + "Cosmic Computer", + "A Cosmic Circuit", + OrePrefixes.circuit.get(Materials.Exotic), + SubTag.NO_UNIFICATION)); OreDictionary.registerOre("UMV", ItemList.Circuit_CosmicComputer.get(1)); - ItemList.Circuit_CosmicMainframe.set(addItem(tLastID = 173, "Cosmic Mainframe", "A Cosmic Circuit", OrePrefixes.circuit.get(Materials.Cosmic), SubTag.NO_UNIFICATION)); + ItemList.Circuit_CosmicMainframe.set(addItem( + tLastID = 173, + "Cosmic Mainframe", + "A Cosmic Circuit", + OrePrefixes.circuit.get(Materials.Cosmic), + SubTag.NO_UNIFICATION)); OreDictionary.registerOre("UXV", ItemList.Circuit_CosmicMainframe.get(1)); // Transcendent circuits - ItemList.Circuit_TranscendentProcessor.set(addItem(tLastID = 174, "Temporally Transcendent Processor", "A circuit operating outside of known spacetime", OrePrefixes.circuit.get(Materials.Optical), SubTag.NO_UNIFICATION)); + ItemList.Circuit_TranscendentProcessor.set(addItem( + tLastID = 174, + "Temporally Transcendent Processor", + "A circuit operating outside of known spacetime", + OrePrefixes.circuit.get(Materials.Optical), + SubTag.NO_UNIFICATION)); OreDictionary.registerOre("UIV", ItemList.Circuit_TranscendentProcessor.get(1)); - ItemList.Circuit_TranscendentAssembly.set(addItem(tLastID = 175, "Temporally Transcendent Assembly", "A circuit operating outside of known spacetime", OrePrefixes.circuit.get(Materials.Exotic), SubTag.NO_UNIFICATION)); + ItemList.Circuit_TranscendentAssembly.set(addItem( + tLastID = 175, + "Temporally Transcendent Assembly", + "A circuit operating outside of known spacetime", + OrePrefixes.circuit.get(Materials.Exotic), + SubTag.NO_UNIFICATION)); OreDictionary.registerOre("UMV", ItemList.Circuit_TranscendentAssembly.get(1)); - ItemList.Circuit_TranscendentComputer.set(addItem(tLastID = 176, "Temporally Transcendent Computer", "A circuit operating outside of known spacetime", OrePrefixes.circuit.get(Materials.Cosmic), SubTag.NO_UNIFICATION)); + ItemList.Circuit_TranscendentComputer.set(addItem( + tLastID = 176, + "Temporally Transcendent Computer", + "A circuit operating outside of known spacetime", + OrePrefixes.circuit.get(Materials.Cosmic), + SubTag.NO_UNIFICATION)); OreDictionary.registerOre("UXV", ItemList.Circuit_TranscendentComputer.get(1)); - ItemList.Circuit_TranscendentMainframe.set(addItem(tLastID = 177, "Temporally Transcendent Mainframe", "A circuit operating outside of known spacetime", OrePrefixes.circuit.get(Materials.Transcendent), SubTag.NO_UNIFICATION)); + ItemList.Circuit_TranscendentMainframe.set(addItem( + tLastID = 177, + "Temporally Transcendent Mainframe", + "A circuit operating outside of known spacetime", + OrePrefixes.circuit.get(Materials.Transcendent), + SubTag.NO_UNIFICATION)); OreDictionary.registerOre("MAX", ItemList.Circuit_TranscendentMainframe.get(1)); - ItemList.Tube_Wires.set(addItem(tLastID = 110, "Tube Wires", "For the Vacuum Tubes", o)); - ItemList.Cover_SolarPanel_UHV.set(addItem(tLastID = 130, "Solar Panel (UHV)", "Ultimate High Voltage Solar Panel (Needs cleaning with right click)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 128L))); - ItemList.Cover_SolarPanel_UEV.set(addItem(tLastID = 131, "Solar Panel (UEV)", "Ultimate Extreme Voltage Solar Panel (Needs cleaning with right click)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 256L))); - ItemList.Cover_SolarPanel_UIV.set(addItem(tLastID = 132, "Solar Panel (UIV)", "Ultimate Insane Voltage Solar Panel (Needs cleaning with right click)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 512L))); - - GregTech_API.registerCover(ItemList.Cover_SolarPanel_UHV.get(1L), TextureFactory.of(SOLARPANEL_UHV), new GT_Cover_SolarPanel(2097152)); - GregTech_API.registerCover(ItemList.Cover_SolarPanel_UEV.get(1L), TextureFactory.of(SOLARPANEL_UEV), new GT_Cover_SolarPanel(8388608)); - GregTech_API.registerCover(ItemList.Cover_SolarPanel_UIV.get(1L), TextureFactory.of(SOLARPANEL_UIV), new GT_Cover_SolarPanel(33554432)); + ItemList.Cover_SolarPanel_UHV.set(addItem( + tLastID = 130, + "Solar Panel (UHV)", + "Ultimate High Voltage Solar Panel (Needs cleaning with right click)", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 128L), + new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 128L), + new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 128L))); + ItemList.Cover_SolarPanel_UEV.set(addItem( + tLastID = 131, + "Solar Panel (UEV)", + "Ultimate Extreme Voltage Solar Panel (Needs cleaning with right click)", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 256L), + new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 256L), + new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 256L))); + ItemList.Cover_SolarPanel_UIV.set(addItem( + tLastID = 132, + "Solar Panel (UIV)", + "Ultimate Insane Voltage Solar Panel (Needs cleaning with right click)", + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 512L), + new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 512L))); + + GregTech_API.registerCover( + ItemList.Cover_SolarPanel_UHV.get(1L), + TextureFactory.of(SOLARPANEL_UHV), + new GT_Cover_SolarPanel(2097152)); + GregTech_API.registerCover( + ItemList.Cover_SolarPanel_UEV.get(1L), + TextureFactory.of(SOLARPANEL_UEV), + new GT_Cover_SolarPanel(8388608)); + GregTech_API.registerCover( + ItemList.Cover_SolarPanel_UIV.get(1L), + TextureFactory.of(SOLARPANEL_UIV), + new GT_Cover_SolarPanel(33554432)); ItemList.ULV_Coil.set(addItem(tLastID = 140, "Ultra Low Voltage Coil", "Primitive Coil", o)); ItemList.LV_Coil.set(addItem(tLastID = 141, "Low Voltage Coil", "Basic Coil", o)); @@ -327,20 +611,57 @@ public class GT_MetaGenerated_Item_03 ItemList.UHV_Coil.set(addItem(tLastID = 149, "Highly Ultimate Voltage Coil", "Infinite Coil", o)); ItemList.GalliumArsenideCrystal.set(addItem(tLastID = 190, "Gallium Arsenide Crystal", "For making boules", o)); - ItemList.GalliumArsenideCrystalSmallPart.set(addItem(tLastID = 191, "Small Gallium Arsenide Crystal", "For making boules", o)); + ItemList.GalliumArsenideCrystalSmallPart.set( + addItem(tLastID = 191, "Small Gallium Arsenide Crystal", "For making boules", o)); ItemList.KevlarFiber.set(addItem(tLastID = 192, "Kevlar Fiber", "For make Kevlar Plates", o)); ItemList.WovenKevlar.set(addItem(tLastID = 193, "Woven Kevlar", "For make Kevlar Plates", o)); ItemList.Spinneret.set(addItem(tLastID = 194, "Spinneret", "For make Kevlar Fiber", o)); - ItemList.IndustrialApiary_Upgrade_Acceleration_1.set(addItem(tLastID = 200, "Acceleration Upgrade x2", "Acceleration upgrade for Industrial Apiary/n Unlocks 2x acceleration level", OrePrefixes.apiaryUpgrade.name())); - ItemList.IndustrialApiary_Upgrade_Acceleration_2.set(addItem(tLastID = 201, "Acceleration Upgrade x4", "Acceleration upgrade for Industrial Apiary/n Unlocks 4x acceleration level", OrePrefixes.apiaryUpgrade.name())); - ItemList.IndustrialApiary_Upgrade_Acceleration_3.set(addItem(tLastID = 202, "Acceleration Upgrade x8", "Acceleration upgrade for Industrial Apiary/n Unlocks 8x acceleration level", OrePrefixes.apiaryUpgrade.name())); - ItemList.IndustrialApiary_Upgrade_Acceleration_4.set(addItem(tLastID = 203, "Acceleration Upgrade x16", "Acceleration upgrade for Industrial Apiary/n Unlocks 16x acceleration level", OrePrefixes.apiaryUpgrade.name())); - ItemList.IndustrialApiary_Upgrade_Acceleration_5.set(addItem(tLastID = 204, "Acceleration Upgrade x32", "Acceleration upgrade for Industrial Apiary/n Unlocks 32x acceleration level", OrePrefixes.apiaryUpgrade.name())); - ItemList.IndustrialApiary_Upgrade_Acceleration_6.set(addItem(tLastID = 205, "Acceleration Upgrade x64", "Acceleration upgrade for Industrial Apiary/n Unlocks 64x acceleration level", OrePrefixes.apiaryUpgrade.name())); - ItemList.IndustrialApiary_Upgrade_Acceleration_7.set(addItem(tLastID = 206, "Acceleration Upgrade x128", "Acceleration upgrade for Industrial Apiary/n Unlocks 128x acceleration level", OrePrefixes.apiaryUpgrade.name())); - ItemList.IndustrialApiary_Upgrade_Acceleration_8.set(addItem(tLastID = 207, "Acceleration Upgrade x256", "Acceleration upgrade for Industrial Apiary/n Unlocks 256x acceleration level", OrePrefixes.apiaryUpgrade.name())); - ItemList.IndustrialApiary_Upgrade_Acceleration_8_Upgraded.set(addItem(tLastID = 208, "Upgraded Acceleration Upgrade x256", "Acceleration upgrade for Industrial Apiary/n Unlocks 256x acceleration level/n Will also grant 8x production upgrade", OrePrefixes.apiaryUpgrade.name())); + ItemList.IndustrialApiary_Upgrade_Acceleration_1.set(addItem( + tLastID = 200, + "Acceleration Upgrade x2", + "Acceleration upgrade for Industrial Apiary/n Unlocks 2x acceleration level", + OrePrefixes.apiaryUpgrade.name())); + ItemList.IndustrialApiary_Upgrade_Acceleration_2.set(addItem( + tLastID = 201, + "Acceleration Upgrade x4", + "Acceleration upgrade for Industrial Apiary/n Unlocks 4x acceleration level", + OrePrefixes.apiaryUpgrade.name())); + ItemList.IndustrialApiary_Upgrade_Acceleration_3.set(addItem( + tLastID = 202, + "Acceleration Upgrade x8", + "Acceleration upgrade for Industrial Apiary/n Unlocks 8x acceleration level", + OrePrefixes.apiaryUpgrade.name())); + ItemList.IndustrialApiary_Upgrade_Acceleration_4.set(addItem( + tLastID = 203, + "Acceleration Upgrade x16", + "Acceleration upgrade for Industrial Apiary/n Unlocks 16x acceleration level", + OrePrefixes.apiaryUpgrade.name())); + ItemList.IndustrialApiary_Upgrade_Acceleration_5.set(addItem( + tLastID = 204, + "Acceleration Upgrade x32", + "Acceleration upgrade for Industrial Apiary/n Unlocks 32x acceleration level", + OrePrefixes.apiaryUpgrade.name())); + ItemList.IndustrialApiary_Upgrade_Acceleration_6.set(addItem( + tLastID = 205, + "Acceleration Upgrade x64", + "Acceleration upgrade for Industrial Apiary/n Unlocks 64x acceleration level", + OrePrefixes.apiaryUpgrade.name())); + ItemList.IndustrialApiary_Upgrade_Acceleration_7.set(addItem( + tLastID = 206, + "Acceleration Upgrade x128", + "Acceleration upgrade for Industrial Apiary/n Unlocks 128x acceleration level", + OrePrefixes.apiaryUpgrade.name())); + ItemList.IndustrialApiary_Upgrade_Acceleration_8.set(addItem( + tLastID = 207, + "Acceleration Upgrade x256", + "Acceleration upgrade for Industrial Apiary/n Unlocks 256x acceleration level", + OrePrefixes.apiaryUpgrade.name())); + ItemList.IndustrialApiary_Upgrade_Acceleration_8_Upgraded.set(addItem( + tLastID = 208, + "Upgraded Acceleration Upgrade x256", + "Acceleration upgrade for Industrial Apiary/n Unlocks 256x acceleration level/n Will also grant 8x production upgrade", + OrePrefixes.apiaryUpgrade.name())); OrePrefixes.apiaryUpgrade.add(ItemList.IndustrialApiary_Upgrade_Acceleration_1.get(1L)); OrePrefixes.apiaryUpgrade.add(ItemList.IndustrialApiary_Upgrade_Acceleration_2.get(1L)); @@ -351,7 +672,6 @@ public class GT_MetaGenerated_Item_03 OrePrefixes.apiaryUpgrade.add(ItemList.IndustrialApiary_Upgrade_Acceleration_7.get(1L)); OrePrefixes.apiaryUpgrade.add(ItemList.IndustrialApiary_Upgrade_Acceleration_8.get(1L)); OrePrefixes.apiaryUpgrade.add(ItemList.IndustrialApiary_Upgrade_Acceleration_8_Upgraded.get(1L)); - } @Override diff --git a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_98.java b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_98.java index fb65e907ff..b183cc6f73 100644 --- a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_98.java +++ b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_98.java @@ -11,16 +11,6 @@ import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidContainerRegistry; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; - -import javax.annotation.Nullable; import java.util.Arrays; import java.util.EnumMap; import java.util.HashMap; @@ -29,6 +19,15 @@ import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Set; +import javax.annotation.Nullable; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; /** This class holds cells for non-GT fluids. */ public class GT_MetaGenerated_Item_98 extends GT_MetaGenerated_Item { @@ -98,6 +97,7 @@ public class GT_MetaGenerated_Item_98 extends GT_MetaGenerated_Item { private final int mId; /** This is the Forge internal fluid name. */ private final String mfluidName; + private final CellType mType; @Nullable @@ -193,6 +193,7 @@ public class GT_MetaGenerated_Item_98 extends GT_MetaGenerated_Item { * <p>Only contains IDs that were successfully registered. */ private final Map<Integer, RegisteredFluidData> registeredFluidDataMap; + private final EnumMap<CellType, IIconContainer> iconContainerMap; private GT_MetaGenerated_Item_98() { @@ -210,8 +211,7 @@ public class GT_MetaGenerated_Item_98 extends GT_MetaGenerated_Item { * However, cell icons seem to be deleted some time between load and post-load, so we must pre-cache them. */ public static synchronized void preInit() { - if (INSTANCE == null) - INSTANCE = new GT_MetaGenerated_Item_98(); + if (INSTANCE == null) INSTANCE = new GT_MetaGenerated_Item_98(); // We'll just steal the icons from Water. They are all the same anyway (except _NULL is broken for cells). for (CellType cellType : CellType.values()) { @@ -258,7 +258,9 @@ public class GT_MetaGenerated_Item_98 extends GT_MetaGenerated_Item { GT_LanguageManager.addStringLocalization( getUnlocalizedName(itemStack) + ".name", - cellType.prefix.mLocalizedMaterialPre + fluid.getLocalizedName(fluidStack) + cellType.prefix.mLocalizedMaterialPost); + cellType.prefix.mLocalizedMaterialPre + + fluid.getLocalizedName(fluidStack) + + cellType.prefix.mLocalizedMaterialPost); int color = fluid.getColor(); short[] rgba = new short[4]; diff --git a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_99.java b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_99.java index 820c28fea3..fb435a5b55 100644 --- a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_99.java +++ b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_99.java @@ -1,5 +1,8 @@ package gregtech.common.items; +import static gregtech.api.enums.GT_Values.M; +import static gregtech.api.enums.OrePrefixes.cellMolten; + import com.google.common.collect.ImmutableList; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -11,17 +14,13 @@ import gregtech.api.interfaces.IIconContainer; import gregtech.api.items.GT_MetaGenerated_Item; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_OreDictUnificator; +import java.util.BitSet; +import java.util.List; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; -import java.util.BitSet; -import java.util.List; - -import static gregtech.api.enums.GT_Values.M; -import static gregtech.api.enums.OrePrefixes.cellMolten; - public class GT_MetaGenerated_Item_99 extends GT_MetaGenerated_Item { public static GT_MetaGenerated_Item_99 INSTANCE; @@ -31,10 +30,14 @@ public class GT_MetaGenerated_Item_99 extends GT_MetaGenerated_Item { * <p>In order to avoid breaking existing worlds, the entries in this list must not be re-ordered! The only safe * modification that can be made to this list is adding new entries to the end. */ - private static final ImmutableList<OrePrefixes> CRACKED_CELL_TYPES = - ImmutableList.of( - OrePrefixes.cellHydroCracked1, OrePrefixes.cellHydroCracked2, OrePrefixes.cellHydroCracked3, - OrePrefixes.cellSteamCracked1, OrePrefixes.cellSteamCracked2, OrePrefixes.cellSteamCracked3); + private static final ImmutableList<OrePrefixes> CRACKED_CELL_TYPES = ImmutableList.of( + OrePrefixes.cellHydroCracked1, + OrePrefixes.cellHydroCracked2, + OrePrefixes.cellHydroCracked3, + OrePrefixes.cellSteamCracked1, + OrePrefixes.cellSteamCracked2, + OrePrefixes.cellSteamCracked3); + private static final int NUM_CRACKED_CELL_TYPES = CRACKED_CELL_TYPES.size(); /** @@ -54,10 +57,13 @@ public class GT_MetaGenerated_Item_99 extends GT_MetaGenerated_Item { continue; } - if ((tMaterial.contains(SubTag.SMELTING_TO_FLUID)) && (!tMaterial.contains(SubTag.NO_SMELTING)) && !tMaterial.contains(SubTag.SMELTING_TO_GEM)) { + if ((tMaterial.contains(SubTag.SMELTING_TO_FLUID)) + && (!tMaterial.contains(SubTag.NO_SMELTING)) + && !tMaterial.contains(SubTag.SMELTING_TO_GEM)) { registerMolten(tMaterial, tMaterial.mMetaItemSubID); if (tMaterial.mSmeltInto != tMaterial - && tMaterial.mSmeltInto.mMetaItemSubID >= 0 && tMaterial.mSmeltInto.mMetaItemSubID < 1_000) { + && tMaterial.mSmeltInto.mMetaItemSubID >= 0 + && tMaterial.mSmeltInto.mMetaItemSubID < 1_000) { registerMolten(tMaterial.mSmeltInto, tMaterial.mSmeltInto.mMetaItemSubID); } } @@ -72,12 +78,14 @@ public class GT_MetaGenerated_Item_99 extends GT_MetaGenerated_Item { mVisibleItems.clear(); } - private void registerMolten(Materials tMaterial,int i){ + private void registerMolten(Materials tMaterial, int i) { ItemStack tStack = new ItemStack(this, 1, i); enabled.set(i); - GT_LanguageManager.addStringLocalization(getUnlocalizedName(tStack) + ".name", cellMolten.getDefaultLocalNameFormatForItem(tMaterial)); - GT_LanguageManager.addStringLocalization(getUnlocalizedName(tStack) + ".tooltip", tMaterial.getToolTip(cellMolten.mMaterialAmount / M)); + GT_LanguageManager.addStringLocalization( + getUnlocalizedName(tStack) + ".name", cellMolten.getDefaultLocalNameFormatForItem(tMaterial)); + GT_LanguageManager.addStringLocalization( + getUnlocalizedName(tStack) + ".tooltip", tMaterial.getToolTip(cellMolten.mMaterialAmount / M)); if (cellMolten.mIsUnificatable) { GT_OreDictUnificator.set(cellMolten, tMaterial, tStack); @@ -92,8 +100,10 @@ public class GT_MetaGenerated_Item_99 extends GT_MetaGenerated_Item { ItemStack tStack = new ItemStack(this, 1, offset + i); enabled.set(offset + i); - GT_LanguageManager.addStringLocalization(getUnlocalizedName(tStack) + ".name", prefix.getDefaultLocalNameFormatForItem(tMaterial)); - GT_LanguageManager.addStringLocalization(getUnlocalizedName(tStack) + ".tooltip", tMaterial.getToolTip(prefix.mMaterialAmount / M)); + GT_LanguageManager.addStringLocalization( + getUnlocalizedName(tStack) + ".name", prefix.getDefaultLocalNameFormatForItem(tMaterial)); + GT_LanguageManager.addStringLocalization( + getUnlocalizedName(tStack) + ".tooltip", tMaterial.getToolTip(prefix.mMaterialAmount / M)); if (prefix.mIsUnificatable) { GT_OreDictUnificator.set(prefix, tMaterial, tStack); @@ -162,9 +172,7 @@ public class GT_MetaGenerated_Item_99 extends GT_MetaGenerated_Item { @Override @SideOnly(Side.CLIENT) public void getSubItems(Item aItem, CreativeTabs aCreativeTab, List aList) { - enabled.stream() - .mapToObj(i -> new ItemStack(this, 1, i)) - .forEach(aList::add); + enabled.stream().mapToObj(i -> new ItemStack(this, 1, i)).forEach(aList::add); } @Override diff --git a/src/main/java/gregtech/common/items/GT_MetaGenerated_Tool_01.java b/src/main/java/gregtech/common/items/GT_MetaGenerated_Tool_01.java index fdb29f15c8..29ea0d94ab 100644 --- a/src/main/java/gregtech/common/items/GT_MetaGenerated_Tool_01.java +++ b/src/main/java/gregtech/common/items/GT_MetaGenerated_Tool_01.java @@ -10,7 +10,7 @@ import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; -public class GT_MetaGenerated_Tool_01 extends GT_MetaGenerated_Tool { +public class GT_MetaGenerated_Tool_01 extends GT_MetaGenerated_Tool { public static final short SWORD = 0; public static final short PICKAXE = 2; public static final short SHOVEL = 4; @@ -19,8 +19,10 @@ public class GT_MetaGenerated_Tool_01 extends GT_MetaGenerated_Tool { public static final short SAW = 10; public static final short HARDHAMMER = 12; public static final short SOFTMALLET = 14; + @Deprecated public static final short SOFTHAMMER = SOFTMALLET; + public static final short WRENCH = 16; public static final short FILE = 18; public static final short CROWBAR = 20; @@ -32,8 +34,10 @@ public class GT_MetaGenerated_Tool_01 extends GT_MetaGenerated_Tool { public static final short UNIVERSALSPADE = 32; public static final short KNIFE = 34; public static final short BUTCHERYKNIFE = 36; + @Deprecated public static final short SICKLE = 38; + public static final short SENSE = 40; public static final short PLOW = 42; public static final short PLUNGER = 44; @@ -51,8 +55,10 @@ public class GT_MetaGenerated_Tool_01 extends GT_MetaGenerated_Tool { public static final short BUZZSAW_LV = 140; public static final short BUZZSAW_MV = 142; public static final short BUZZSAW_HV = 144; + @Deprecated public static final short BUZZSAW = BUZZSAW_LV; + public static final short SCREWDRIVER_LV = 150; public static final short SCREWDRIVER_MV = 152; public static final short SCREWDRIVER_HV = 154; @@ -63,119 +69,725 @@ public class GT_MetaGenerated_Tool_01 extends GT_MetaGenerated_Tool { public static final short TURBINE = 172; public static final short TURBINE_LARGE = 174; public static final short TURBINE_HUGE = 176; + @Deprecated public static final short TURBINE_BLADE = 178; + public static GT_MetaGenerated_Tool_01 INSTANCE; public GT_MetaGenerated_Tool_01() { super("metatool.01"); INSTANCE = this; - addTool(SWORD, "Sword", "", new GT_Tool_Sword(), ToolDictNames.craftingToolSword, ToolDictNames.craftingToolBlade, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 4L)); - addTool(PICKAXE, "Pickaxe", "", new GT_Tool_Pickaxe(), ToolDictNames.craftingToolPickaxe, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERFODIO, 4L)); - addTool(SHOVEL, "Shovel", "", new GT_Tool_Shovel(), ToolDictNames.craftingToolShovel, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERFODIO, 4L)); - addTool(AXE, "Axe", "", new GT_Tool_Axe(), ToolDictNames.craftingToolAxe, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 2L)); - addTool(HOE, "Hoe", "", new GT_Tool_Hoe(), ToolDictNames.craftingToolHoe, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 4L)); - addTool(SAW, "Saw", "Can also harvest Ice", new GT_Tool_Saw(), ToolDictNames.craftingToolSaw, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 2L)); - GregTech_API.registerTool(addTool(HARDHAMMER, "Hammer", "Crushes Ores instead of harvesting them", new GT_Tool_HardHammer(), ToolDictNames.craftingToolHardHammer, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)), GregTech_API.sHardHammerList); - GregTech_API.registerTool(addTool(SOFTMALLET, "Soft Mallet", "", new GT_Tool_SoftHammer(), ToolDictNames.craftingToolSoftHammer, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.LIMUS, 4L)), GregTech_API.sSoftHammerList); - GregTech_API.registerTool(addTool(WRENCH, "Wrench", "Hold Leftclick to dismantle Machines", new GT_Tool_Wrench(), ToolDictNames.craftingToolWrench, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)), GregTech_API.sWrenchList); - addTool(FILE, "File", "", new GT_Tool_File(), ToolDictNames.craftingToolFile, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)); - GregTech_API.registerTool(addTool(CROWBAR, "Crowbar", "Dismounts Covers and Rotates Rails", new GT_Tool_Crowbar(), ToolDictNames.craftingToolCrowbar, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 2L)), GregTech_API.sCrowbarList); - GregTech_API.registerTool(addTool(SCREWDRIVER, "Screwdriver", "Adjusts Covers and Machines", new GT_Tool_Screwdriver(), ToolDictNames.craftingToolScrewdriver, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)), GregTech_API.sScrewdriverList); - addTool(MORTAR, "Mortar", "", new GT_Tool_Mortar(), ToolDictNames.craftingToolMortar, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERDITIO, 2L)); - GregTech_API.registerTool(addTool(WIRECUTTER, "Wire Cutter", "", new GT_Tool_WireCutter(), ToolDictNames.craftingToolWireCutter, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)), GregTech_API.sWireCutterList); - addTool(SCOOP, "Scoop", "", new GT_Tool_Scoop(), ToolDictNames.craftingToolScoop, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.BESTIA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.PANNUS, 2L)); - addTool(BRANCHCUTTER, "Branch Cutter", "", new GT_Tool_BranchCutter(), ToolDictNames.craftingToolBranchCutter, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 2L)); - GregTech_API.registerTool(addTool(UNIVERSALSPADE, "Universal Spade", "", new GT_Tool_UniversalSpade(), ToolDictNames.craftingToolBlade, ToolDictNames.craftingToolShovel, ToolDictNames.craftingToolCrowbar, ToolDictNames.craftingToolSaw, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.METO, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 1L)), GregTech_API.sCrowbarList); - addTool(KNIFE, "Knife", "", new GT_Tool_Knife(), ToolDictNames.craftingToolBlade, ToolDictNames.craftingToolKnife, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.CORPUS, 2L)); - addTool(BUTCHERYKNIFE, "Butchery Knife", "Has a slow Attack Rate", new GT_Tool_ButcheryKnife(), ToolDictNames.craftingToolBlade, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.CORPUS, 4L)); - - addTool(SENSE, "Sense", "Because a Scythe doesn't make Sense", new GT_Tool_Sense(), ToolDictNames.craftingToolBlade, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MORTUUS, 2L)); - addTool(PLOW, "Plow", "Used to get rid of Snow", new GT_Tool_Plow(), ToolDictNames.craftingToolPlow, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.GELUM, 2L)); - addTool(PLUNGER, "Plunger", "", new GT_Tool_Plunger(), ToolDictNames.craftingToolPlunger, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 2L)); - addTool(ROLLING_PIN, "Rolling Pin", "", new GT_Tool_RollingPin(), ToolDictNames.craftingToolRollingPin, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.LIMUS, 4L)); - - addTool(DRILL_LV, "Drill (LV)", "", new GT_Tool_Drill_LV(), ToolDictNames.craftingToolMiningDrill, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERFODIO, 4L)); - addTool(DRILL_MV, "Drill (MV)", "", new GT_Tool_Drill_MV(), ToolDictNames.craftingToolMiningDrill, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERFODIO, 4L)); - addTool(DRILL_HV, "Drill (HV)", "", new GT_Tool_Drill_HV(), ToolDictNames.craftingToolMiningDrill, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERFODIO, 4L)); - addTool(CHAINSAW_LV, "Chainsaw (LV)", "Can also harvest Ice", new GT_Tool_Chainsaw_LV(), ToolDictNames.craftingToolSaw, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 2L)); - addTool(CHAINSAW_MV, "Chainsaw (MV)", "Can also harvest Ice", new GT_Tool_Chainsaw_MV(), ToolDictNames.craftingToolSaw, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 2L)); - addTool(CHAINSAW_HV, "Chainsaw (HV)", "Can also harvest Ice", new GT_Tool_Chainsaw_HV(), ToolDictNames.craftingToolSaw, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 2L)); - GregTech_API.registerTool(addTool(WRENCH_LV, "Wrench (LV)", "Hold Left Button to dismantle Machines", new GT_Tool_Wrench_LV(), ToolDictNames.craftingToolWrench, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)), GregTech_API.sWrenchList); - GregTech_API.registerTool(addTool(WRENCH_MV, "Wrench (MV)", "Hold Left Button to dismantle Machines", new GT_Tool_Wrench_MV(), ToolDictNames.craftingToolWrench, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)), GregTech_API.sWrenchList); - GregTech_API.registerTool(addTool(WRENCH_HV, "Wrench (HV)", "Hold Left Button to dismantle Machines", new GT_Tool_Wrench_HV(), ToolDictNames.craftingToolWrench, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)), GregTech_API.sWrenchList); - addTool(JACKHAMMER, "JackHammer (HV)", "Breaks Rocks into pieces", new GT_Tool_JackHammer(), ToolDictNames.craftingToolJackHammer, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERFODIO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERDITIO, 2L)); - addTool(BUZZSAW_LV, "Buzzsaw (LV)", "Not suitable for harvesting Blocks", new GT_Tool_BuzzSaw(), ToolDictNames.craftingToolSaw, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 2L)); - addTool(BUZZSAW_MV, "Buzzsaw (MV)", "Not suitable for harvesting Blocks", new GT_Tool_BuzzSaw(), ToolDictNames.craftingToolSaw, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 2L)); - addTool(BUZZSAW_HV, "Buzzsaw (HV)", "Not suitable for harvesting Blocks", new GT_Tool_BuzzSaw(), ToolDictNames.craftingToolSaw, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 2L)); - GregTech_API.registerTool(addTool(SCREWDRIVER_LV, "Screwdriver (LV)", "Adjusts Covers and Machines", new GT_Tool_Screwdriver_LV(), ToolDictNames.craftingToolScrewdriver, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)), GregTech_API.sScrewdriverList); - GregTech_API.registerTool(addTool(SCREWDRIVER_MV, "Screwdriver (MV)", "Adjusts Covers and Machines", new GT_Tool_Screwdriver_LV(), ToolDictNames.craftingToolScrewdriver, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)), GregTech_API.sScrewdriverList); - GregTech_API.registerTool(addTool(SCREWDRIVER_HV, "Screwdriver (HV)", "Adjusts Covers and Machines", new GT_Tool_Screwdriver_LV(), ToolDictNames.craftingToolScrewdriver, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)), GregTech_API.sScrewdriverList); - GregTech_API.registerTool(addTool(SOLDERING_IRON_LV, "Soldering Iron (LV)", "Fixes burned out Circuits. Needs soldering materials in inventory.", new GT_Tool_Soldering_Iron(), ToolDictNames.craftingToolSolderingIron, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)), GregTech_API.sSolderingToolList); - GregTech_API.registerTool(addTool(SOLDERING_IRON_MV, "Soldering Iron (MV)", "Fixes burned out Circuits. Needs soldering materials in inventory.", new GT_Tool_Soldering_Iron(), ToolDictNames.craftingToolSolderingIron, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)), GregTech_API.sSolderingToolList); - GregTech_API.registerTool(addTool(SOLDERING_IRON_HV, "Soldering Iron (HV)", "Fixes burned out Circuits. Needs soldering materials in inventory.", new GT_Tool_Soldering_Iron(), ToolDictNames.craftingToolSolderingIron, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)), GregTech_API.sSolderingToolList); + addTool( + SWORD, + "Sword", + "", + new GT_Tool_Sword(), + ToolDictNames.craftingToolSword, + ToolDictNames.craftingToolBlade, + new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 4L)); + addTool( + PICKAXE, + "Pickaxe", + "", + new GT_Tool_Pickaxe(), + ToolDictNames.craftingToolPickaxe, + new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.PERFODIO, 4L)); + addTool( + SHOVEL, + "Shovel", + "", + new GT_Tool_Shovel(), + ToolDictNames.craftingToolShovel, + new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.PERFODIO, 4L)); + addTool( + AXE, + "Axe", + "", + new GT_Tool_Axe(), + ToolDictNames.craftingToolAxe, + new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.METO, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 2L)); + addTool( + HOE, + "Hoe", + "", + new GT_Tool_Hoe(), + ToolDictNames.craftingToolHoe, + new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 4L)); + addTool( + SAW, + "Saw", + "Can also harvest Ice", + new GT_Tool_Saw(), + ToolDictNames.craftingToolSaw, + new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.METO, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 2L)); + GregTech_API.registerTool( + addTool( + HARDHAMMER, + "Hammer", + "Crushes Ores instead of harvesting them", + new GT_Tool_HardHammer(), + ToolDictNames.craftingToolHardHammer, + new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)), + GregTech_API.sHardHammerList); + GregTech_API.registerTool( + addTool( + SOFTMALLET, + "Soft Mallet", + "", + new GT_Tool_SoftHammer(), + ToolDictNames.craftingToolSoftHammer, + new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.LIMUS, 4L)), + GregTech_API.sSoftHammerList); + GregTech_API.registerTool( + addTool( + WRENCH, + "Wrench", + "Hold Leftclick to dismantle Machines", + new GT_Tool_Wrench(), + ToolDictNames.craftingToolWrench, + new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)), + GregTech_API.sWrenchList); + addTool( + FILE, + "File", + "", + new GT_Tool_File(), + ToolDictNames.craftingToolFile, + new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)); + GregTech_API.registerTool( + addTool( + CROWBAR, + "Crowbar", + "Dismounts Covers and Rotates Rails", + new GT_Tool_Crowbar(), + ToolDictNames.craftingToolCrowbar, + new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 2L)), + GregTech_API.sCrowbarList); + GregTech_API.registerTool( + addTool( + SCREWDRIVER, + "Screwdriver", + "Adjusts Covers and Machines", + new GT_Tool_Screwdriver(), + ToolDictNames.craftingToolScrewdriver, + new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)), + GregTech_API.sScrewdriverList); + addTool( + MORTAR, + "Mortar", + "", + new GT_Tool_Mortar(), + ToolDictNames.craftingToolMortar, + new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.PERDITIO, 2L)); + GregTech_API.registerTool( + addTool( + WIRECUTTER, + "Wire Cutter", + "", + new GT_Tool_WireCutter(), + ToolDictNames.craftingToolWireCutter, + new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)), + GregTech_API.sWireCutterList); + addTool( + SCOOP, + "Scoop", + "", + new GT_Tool_Scoop(), + ToolDictNames.craftingToolScoop, + new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.BESTIA, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.PANNUS, 2L)); + addTool( + BRANCHCUTTER, + "Branch Cutter", + "", + new GT_Tool_BranchCutter(), + ToolDictNames.craftingToolBranchCutter, + new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.METO, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 2L)); + GregTech_API.registerTool( + addTool( + UNIVERSALSPADE, + "Universal Spade", + "", + new GT_Tool_UniversalSpade(), + ToolDictNames.craftingToolBlade, + ToolDictNames.craftingToolShovel, + ToolDictNames.craftingToolCrowbar, + ToolDictNames.craftingToolSaw, + new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.METO, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 1L)), + GregTech_API.sCrowbarList); + addTool( + KNIFE, + "Knife", + "", + new GT_Tool_Knife(), + ToolDictNames.craftingToolBlade, + ToolDictNames.craftingToolKnife, + new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.CORPUS, 2L)); + addTool( + BUTCHERYKNIFE, + "Butchery Knife", + "Has a slow Attack Rate", + new GT_Tool_ButcheryKnife(), + ToolDictNames.craftingToolBlade, + new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.CORPUS, 4L)); + + addTool( + SENSE, + "Sense", + "Because a Scythe doesn't make Sense", + new GT_Tool_Sense(), + ToolDictNames.craftingToolBlade, + new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.METO, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.MORTUUS, 2L)); + addTool( + PLOW, + "Plow", + "Used to get rid of Snow", + new GT_Tool_Plow(), + ToolDictNames.craftingToolPlow, + new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.METO, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.GELUM, 2L)); + addTool( + PLUNGER, + "Plunger", + "", + new GT_Tool_Plunger(), + ToolDictNames.craftingToolPlunger, + new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 2L)); + addTool( + ROLLING_PIN, + "Rolling Pin", + "", + new GT_Tool_RollingPin(), + ToolDictNames.craftingToolRollingPin, + new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.LIMUS, 4L)); + + addTool( + DRILL_LV, + "Drill (LV)", + "", + new GT_Tool_Drill_LV(), + ToolDictNames.craftingToolMiningDrill, + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.PERFODIO, 4L)); + addTool( + DRILL_MV, + "Drill (MV)", + "", + new GT_Tool_Drill_MV(), + ToolDictNames.craftingToolMiningDrill, + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.PERFODIO, 4L)); + addTool( + DRILL_HV, + "Drill (HV)", + "", + new GT_Tool_Drill_HV(), + ToolDictNames.craftingToolMiningDrill, + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.PERFODIO, 4L)); + addTool( + CHAINSAW_LV, + "Chainsaw (LV)", + "Can also harvest Ice", + new GT_Tool_Chainsaw_LV(), + ToolDictNames.craftingToolSaw, + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.METO, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 2L)); + addTool( + CHAINSAW_MV, + "Chainsaw (MV)", + "Can also harvest Ice", + new GT_Tool_Chainsaw_MV(), + ToolDictNames.craftingToolSaw, + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.METO, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 2L)); + addTool( + CHAINSAW_HV, + "Chainsaw (HV)", + "Can also harvest Ice", + new GT_Tool_Chainsaw_HV(), + ToolDictNames.craftingToolSaw, + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.METO, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 2L)); + GregTech_API.registerTool( + addTool( + WRENCH_LV, + "Wrench (LV)", + "Hold Left Button to dismantle Machines", + new GT_Tool_Wrench_LV(), + ToolDictNames.craftingToolWrench, + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)), + GregTech_API.sWrenchList); + GregTech_API.registerTool( + addTool( + WRENCH_MV, + "Wrench (MV)", + "Hold Left Button to dismantle Machines", + new GT_Tool_Wrench_MV(), + ToolDictNames.craftingToolWrench, + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)), + GregTech_API.sWrenchList); + GregTech_API.registerTool( + addTool( + WRENCH_HV, + "Wrench (HV)", + "Hold Left Button to dismantle Machines", + new GT_Tool_Wrench_HV(), + ToolDictNames.craftingToolWrench, + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)), + GregTech_API.sWrenchList); + addTool( + JACKHAMMER, + "JackHammer (HV)", + "Breaks Rocks into pieces", + new GT_Tool_JackHammer(), + ToolDictNames.craftingToolJackHammer, + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.PERFODIO, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.PERDITIO, 2L)); + addTool( + BUZZSAW_LV, + "Buzzsaw (LV)", + "Not suitable for harvesting Blocks", + new GT_Tool_BuzzSaw(), + ToolDictNames.craftingToolSaw, + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 2L)); + addTool( + BUZZSAW_MV, + "Buzzsaw (MV)", + "Not suitable for harvesting Blocks", + new GT_Tool_BuzzSaw(), + ToolDictNames.craftingToolSaw, + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 2L)); + addTool( + BUZZSAW_HV, + "Buzzsaw (HV)", + "Not suitable for harvesting Blocks", + new GT_Tool_BuzzSaw(), + ToolDictNames.craftingToolSaw, + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 2L)); + GregTech_API.registerTool( + addTool( + SCREWDRIVER_LV, + "Screwdriver (LV)", + "Adjusts Covers and Machines", + new GT_Tool_Screwdriver_LV(), + ToolDictNames.craftingToolScrewdriver, + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)), + GregTech_API.sScrewdriverList); + GregTech_API.registerTool( + addTool( + SCREWDRIVER_MV, + "Screwdriver (MV)", + "Adjusts Covers and Machines", + new GT_Tool_Screwdriver_LV(), + ToolDictNames.craftingToolScrewdriver, + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)), + GregTech_API.sScrewdriverList); + GregTech_API.registerTool( + addTool( + SCREWDRIVER_HV, + "Screwdriver (HV)", + "Adjusts Covers and Machines", + new GT_Tool_Screwdriver_LV(), + ToolDictNames.craftingToolScrewdriver, + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)), + GregTech_API.sScrewdriverList); + GregTech_API.registerTool( + addTool( + SOLDERING_IRON_LV, + "Soldering Iron (LV)", + "Fixes burned out Circuits. Needs soldering materials in inventory.", + new GT_Tool_Soldering_Iron(), + ToolDictNames.craftingToolSolderingIron, + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)), + GregTech_API.sSolderingToolList); + GregTech_API.registerTool( + addTool( + SOLDERING_IRON_MV, + "Soldering Iron (MV)", + "Fixes burned out Circuits. Needs soldering materials in inventory.", + new GT_Tool_Soldering_Iron(), + ToolDictNames.craftingToolSolderingIron, + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)), + GregTech_API.sSolderingToolList); + GregTech_API.registerTool( + addTool( + SOLDERING_IRON_HV, + "Soldering Iron (HV)", + "Fixes burned out Circuits. Needs soldering materials in inventory.", + new GT_Tool_Soldering_Iron(), + ToolDictNames.craftingToolSolderingIron, + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)), + GregTech_API.sSolderingToolList); addTool(TURBINE_SMALL, "Small Turbine", "Turbine Rotors for your power station", new GT_Tool_Turbine_Small()); addTool(TURBINE, "Turbine", "Turbine Rotors for your power station", new GT_Tool_Turbine_Normal()); addTool(TURBINE_LARGE, "Large Turbine", "Turbine Rotors for your power station", new GT_Tool_Turbine_Large()); addTool(TURBINE_HUGE, "Huge Turbine", "Turbine Rotors for your power station", new GT_Tool_Turbine_Huge()); - GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.Flint, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", 'I', new ItemStack(Items.flint, 1), 'S', OrePrefixes.stone}); - GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.Bronze, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.Bronze), 'S', OrePrefixes.stone}); - GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.Iron, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.Iron), 'S', OrePrefixes.stone}); - GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.Steel, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.Steel), 'S', OrePrefixes.stone}); - GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.WroughtIron, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.WroughtIron), 'S', OrePrefixes.stone}); - GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.RedSteel, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.RedSteel), 'S', OrePrefixes.stone}); - GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.BlueSteel, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.BlueSteel), 'S', OrePrefixes.stone}); - GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.BlackSteel, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.BlackSteel), 'S', OrePrefixes.stone}); - GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.DamascusSteel, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.DamascusSteel), 'S', OrePrefixes.stone}); - GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.Thaumium, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.Thaumium), 'S', OrePrefixes.stone}); - - GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(ROLLING_PIN, 1, Materials.Wood, Materials.Wood, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" S", " I ", "S f", 'I', OrePrefixes.plank.get(Materials.Wood), 'S', OrePrefixes.stick.get(Materials.Wood)}); - GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(ROLLING_PIN, 1, Materials.Plastic, Materials.Plastic, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" S", " I ", "S f", 'I', OrePrefixes.ingot.get(Materials.Plastic), 'S', OrePrefixes.stick.get(Materials.Plastic)}); - GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(ROLLING_PIN, 1, Materials.Aluminium, Materials.Aluminium, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" S", " I ", "S f", 'I', OrePrefixes.ingot.get(Materials.Aluminium), 'S', OrePrefixes.stick.get(Materials.Aluminium)}); - GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(ROLLING_PIN, 1, Materials.StainlessSteel, Materials.StainlessSteel, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" S", " I ", "S f", 'I', OrePrefixes.ingot.get(Materials.StainlessSteel), 'S', OrePrefixes.stick.get(Materials.StainlessSteel)}); + GT_ModHandler.addCraftingRecipe( + INSTANCE.getToolWithStats(MORTAR, 1, Materials.Flint, Materials.Stone, null), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] {" I ", "SIS", "SSS", 'I', new ItemStack(Items.flint, 1), 'S', OrePrefixes.stone}); + GT_ModHandler.addCraftingRecipe( + INSTANCE.getToolWithStats(MORTAR, 1, Materials.Bronze, Materials.Stone, null), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] {" I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.Bronze), 'S', OrePrefixes.stone + }); + GT_ModHandler.addCraftingRecipe( + INSTANCE.getToolWithStats(MORTAR, 1, Materials.Iron, Materials.Stone, null), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] {" I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.Iron), 'S', OrePrefixes.stone}); + GT_ModHandler.addCraftingRecipe( + INSTANCE.getToolWithStats(MORTAR, 1, Materials.Steel, Materials.Stone, null), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] {" I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.Steel), 'S', OrePrefixes.stone + }); + GT_ModHandler.addCraftingRecipe( + INSTANCE.getToolWithStats(MORTAR, 1, Materials.WroughtIron, Materials.Stone, null), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { + " I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.WroughtIron), 'S', OrePrefixes.stone + }); + GT_ModHandler.addCraftingRecipe( + INSTANCE.getToolWithStats(MORTAR, 1, Materials.RedSteel, Materials.Stone, null), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { + " I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.RedSteel), 'S', OrePrefixes.stone + }); + GT_ModHandler.addCraftingRecipe( + INSTANCE.getToolWithStats(MORTAR, 1, Materials.BlueSteel, Materials.Stone, null), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { + " I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.BlueSteel), 'S', OrePrefixes.stone + }); + GT_ModHandler.addCraftingRecipe( + INSTANCE.getToolWithStats(MORTAR, 1, Materials.BlackSteel, Materials.Stone, null), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { + " I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.BlackSteel), 'S', OrePrefixes.stone + }); + GT_ModHandler.addCraftingRecipe( + INSTANCE.getToolWithStats(MORTAR, 1, Materials.DamascusSteel, Materials.Stone, null), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { + " I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.DamascusSteel), 'S', OrePrefixes.stone + }); + GT_ModHandler.addCraftingRecipe( + INSTANCE.getToolWithStats(MORTAR, 1, Materials.Thaumium, Materials.Stone, null), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { + " I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.Thaumium), 'S', OrePrefixes.stone + }); + GT_ModHandler.addCraftingRecipe( + INSTANCE.getToolWithStats(ROLLING_PIN, 1, Materials.Wood, Materials.Wood, null), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { + " S", + " I ", + "S f", + 'I', + OrePrefixes.plank.get(Materials.Wood), + 'S', + OrePrefixes.stick.get(Materials.Wood) + }); + GT_ModHandler.addCraftingRecipe( + INSTANCE.getToolWithStats(ROLLING_PIN, 1, Materials.Plastic, Materials.Plastic, null), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { + " S", + " I ", + "S f", + 'I', + OrePrefixes.ingot.get(Materials.Plastic), + 'S', + OrePrefixes.stick.get(Materials.Plastic) + }); + GT_ModHandler.addCraftingRecipe( + INSTANCE.getToolWithStats(ROLLING_PIN, 1, Materials.Aluminium, Materials.Aluminium, null), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { + " S", + " I ", + "S f", + 'I', + OrePrefixes.ingot.get(Materials.Aluminium), + 'S', + OrePrefixes.stick.get(Materials.Aluminium) + }); + GT_ModHandler.addCraftingRecipe( + INSTANCE.getToolWithStats(ROLLING_PIN, 1, Materials.StainlessSteel, Materials.StainlessSteel, null), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { + " S", + " I ", + "S f", + 'I', + OrePrefixes.ingot.get(Materials.StainlessSteel), + 'S', + OrePrefixes.stick.get(Materials.StainlessSteel) + }); if (!GregTech_API.sSpecialFile.get(ConfigCategories.general, "DisableFlintTools", false)) { - GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(SWORD, 1, Materials.Flint, Materials.Wood, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"F", "F", "S", 'S', OrePrefixes.stick.get(Materials.Wood), 'F', new ItemStack(Items.flint, 1)}); - GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(PICKAXE, 1, Materials.Flint, Materials.Wood, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"FFF", " S ", " S ", 'S', OrePrefixes.stick.get(Materials.Wood), 'F', new ItemStack(Items.flint, 1)}); - GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(SHOVEL, 1, Materials.Flint, Materials.Wood, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"F", "S", "S", 'S', OrePrefixes.stick.get(Materials.Wood), 'F', new ItemStack(Items.flint, 1)}); - GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(AXE, 1, Materials.Flint, Materials.Wood, null), GT_ModHandler.RecipeBits.MIRRORED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"FF", "FS", " S", 'S', OrePrefixes.stick.get(Materials.Wood), 'F', new ItemStack(Items.flint, 1)}); - GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(HOE, 1, Materials.Flint, Materials.Wood, null), GT_ModHandler.RecipeBits.MIRRORED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"FF", " S", " S", 'S', OrePrefixes.stick.get(Materials.Wood), 'F', new ItemStack(Items.flint, 1)}); - GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(KNIFE, 1, Materials.Flint, Materials.Wood, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"F", "S", 'S', OrePrefixes.stick.get(Materials.Wood), 'F', new ItemStack(Items.flint, 1)}); - - GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.Flint, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", 'I', new ItemStack(Items.flint, 1), 'S', OrePrefixes.stone}); - GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.Bronze, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.Bronze), 'S', OrePrefixes.stone}); - GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.Iron, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.Iron), 'S', OrePrefixes.stone}); - GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.Steel, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.Steel), 'S', OrePrefixes.stone}); - GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.WroughtIron, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.WroughtIron), 'S', OrePrefixes.stone}); - GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.RedSteel, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.RedSteel), 'S', OrePrefixes.stone}); - GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.BlueSteel, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.BlueSteel), 'S', OrePrefixes.stone}); - GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.BlackSteel, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.BlackSteel), 'S', OrePrefixes.stone}); - GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.DamascusSteel, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.DamascusSteel), 'S', OrePrefixes.stone}); - GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.Thaumium, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.Thaumium), 'S', OrePrefixes.stone}); - - GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(ROLLING_PIN, 1, Materials.Wood, Materials.Wood, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" S", " I ", "S f", 'I', OrePrefixes.plank.get(Materials.Wood), 'S', OrePrefixes.stick.get(Materials.Wood)}); - GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(ROLLING_PIN, 1, Materials.Plastic, Materials.Plastic, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" S", " I ", "S f", 'I', OrePrefixes.ingot.get(Materials.Plastic), 'S', OrePrefixes.stick.get(Materials.Plastic)}); - GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(ROLLING_PIN, 1, Materials.Aluminium, Materials.Aluminium, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" S", " I ", "S f", 'I', OrePrefixes.ingot.get(Materials.Aluminium), 'S', OrePrefixes.stick.get(Materials.Aluminium)}); - GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(ROLLING_PIN, 1, Materials.StainlessSteel, Materials.StainlessSteel, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" S", " I ", "S f", 'I', OrePrefixes.ingot.get(Materials.StainlessSteel), 'S', OrePrefixes.stick.get(Materials.StainlessSteel)}); - GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(ROLLING_PIN, 1, Materials.IronWood, Materials.IronWood, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" S", " I ", "S f", 'I', OrePrefixes.ingot.get(Materials.IronWood), 'S', OrePrefixes.stick.get(Materials.IronWood)}); + GT_ModHandler.addCraftingRecipe( + INSTANCE.getToolWithStats(SWORD, 1, Materials.Flint, Materials.Wood, null), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { + "F", "F", "S", 'S', OrePrefixes.stick.get(Materials.Wood), 'F', new ItemStack(Items.flint, 1) + }); + GT_ModHandler.addCraftingRecipe( + INSTANCE.getToolWithStats(PICKAXE, 1, Materials.Flint, Materials.Wood, null), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { + "FFF", + " S ", + " S ", + 'S', + OrePrefixes.stick.get(Materials.Wood), + 'F', + new ItemStack(Items.flint, 1) + }); + GT_ModHandler.addCraftingRecipe( + INSTANCE.getToolWithStats(SHOVEL, 1, Materials.Flint, Materials.Wood, null), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { + "F", "S", "S", 'S', OrePrefixes.stick.get(Materials.Wood), 'F', new ItemStack(Items.flint, 1) + }); + GT_ModHandler.addCraftingRecipe( + INSTANCE.getToolWithStats(AXE, 1, Materials.Flint, Materials.Wood, null), + GT_ModHandler.RecipeBits.MIRRORED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { + "FF", "FS", " S", 'S', OrePrefixes.stick.get(Materials.Wood), 'F', new ItemStack(Items.flint, 1) + }); + GT_ModHandler.addCraftingRecipe( + INSTANCE.getToolWithStats(HOE, 1, Materials.Flint, Materials.Wood, null), + GT_ModHandler.RecipeBits.MIRRORED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { + "FF", " S", " S", 'S', OrePrefixes.stick.get(Materials.Wood), 'F', new ItemStack(Items.flint, 1) + }); + GT_ModHandler.addCraftingRecipe( + INSTANCE.getToolWithStats(KNIFE, 1, Materials.Flint, Materials.Wood, null), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { + "F", "S", 'S', OrePrefixes.stick.get(Materials.Wood), 'F', new ItemStack(Items.flint, 1) + }); + + GT_ModHandler.addCraftingRecipe( + INSTANCE.getToolWithStats(MORTAR, 1, Materials.Flint, Materials.Stone, null), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] {" I ", "SIS", "SSS", 'I', new ItemStack(Items.flint, 1), 'S', OrePrefixes.stone}); + GT_ModHandler.addCraftingRecipe( + INSTANCE.getToolWithStats(MORTAR, 1, Materials.Bronze, Materials.Stone, null), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { + " I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.Bronze), 'S', OrePrefixes.stone + }); + GT_ModHandler.addCraftingRecipe( + INSTANCE.getToolWithStats(MORTAR, 1, Materials.Iron, Materials.Stone, null), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { + " I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.Iron), 'S', OrePrefixes.stone + }); + GT_ModHandler.addCraftingRecipe( + INSTANCE.getToolWithStats(MORTAR, 1, Materials.Steel, Materials.Stone, null), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { + " I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.Steel), 'S', OrePrefixes.stone + }); + GT_ModHandler.addCraftingRecipe( + INSTANCE.getToolWithStats(MORTAR, 1, Materials.WroughtIron, Materials.Stone, null), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { + " I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.WroughtIron), 'S', OrePrefixes.stone + }); + GT_ModHandler.addCraftingRecipe( + INSTANCE.getToolWithStats(MORTAR, 1, Materials.RedSteel, Materials.Stone, null), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { + " I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.RedSteel), 'S', OrePrefixes.stone + }); + GT_ModHandler.addCraftingRecipe( + INSTANCE.getToolWithStats(MORTAR, 1, Materials.BlueSteel, Materials.Stone, null), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { + " I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.BlueSteel), 'S', OrePrefixes.stone + }); + GT_ModHandler.addCraftingRecipe( + INSTANCE.getToolWithStats(MORTAR, 1, Materials.BlackSteel, Materials.Stone, null), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { + " I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.BlackSteel), 'S', OrePrefixes.stone + }); + GT_ModHandler.addCraftingRecipe( + INSTANCE.getToolWithStats(MORTAR, 1, Materials.DamascusSteel, Materials.Stone, null), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { + " I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.DamascusSteel), 'S', OrePrefixes.stone + }); + GT_ModHandler.addCraftingRecipe( + INSTANCE.getToolWithStats(MORTAR, 1, Materials.Thaumium, Materials.Stone, null), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { + " I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.Thaumium), 'S', OrePrefixes.stone + }); + + GT_ModHandler.addCraftingRecipe( + INSTANCE.getToolWithStats(ROLLING_PIN, 1, Materials.Wood, Materials.Wood, null), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { + " S", + " I ", + "S f", + 'I', + OrePrefixes.plank.get(Materials.Wood), + 'S', + OrePrefixes.stick.get(Materials.Wood) + }); + GT_ModHandler.addCraftingRecipe( + INSTANCE.getToolWithStats(ROLLING_PIN, 1, Materials.Plastic, Materials.Plastic, null), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { + " S", + " I ", + "S f", + 'I', + OrePrefixes.ingot.get(Materials.Plastic), + 'S', + OrePrefixes.stick.get(Materials.Plastic) + }); + GT_ModHandler.addCraftingRecipe( + INSTANCE.getToolWithStats(ROLLING_PIN, 1, Materials.Aluminium, Materials.Aluminium, null), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { + " S", + " I ", + "S f", + 'I', + OrePrefixes.ingot.get(Materials.Aluminium), + 'S', + OrePrefixes.stick.get(Materials.Aluminium) + }); + GT_ModHandler.addCraftingRecipe( + INSTANCE.getToolWithStats(ROLLING_PIN, 1, Materials.StainlessSteel, Materials.StainlessSteel, null), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { + " S", + " I ", + "S f", + 'I', + OrePrefixes.ingot.get(Materials.StainlessSteel), + 'S', + OrePrefixes.stick.get(Materials.StainlessSteel) + }); + GT_ModHandler.addCraftingRecipe( + INSTANCE.getToolWithStats(ROLLING_PIN, 1, Materials.IronWood, Materials.IronWood, null), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { + " S", + " I ", + "S f", + 'I', + OrePrefixes.ingot.get(Materials.IronWood), + 'S', + OrePrefixes.stick.get(Materials.IronWood) + }); if (GregTech_API.sRecipeFile.get(ConfigCategories.Tools.mortar, "Coal", true)) { - GT_ModHandler.addShapelessCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Coal, 1L), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ToolDictNames.craftingToolMortar, new ItemStack(Items.coal, 1)}); + GT_ModHandler.addShapelessCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Coal, 1L), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] {ToolDictNames.craftingToolMortar, new ItemStack(Items.coal, 1)}); } if (GregTech_API.sRecipeFile.get(ConfigCategories.Tools.mortar, "Clay", true)) { - GT_ModHandler.addShapelessCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Clay, 1L), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ToolDictNames.craftingToolMortar, new ItemStack(Blocks.clay, 1)}); + GT_ModHandler.addShapelessCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Clay, 1L), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] {ToolDictNames.craftingToolMortar, new ItemStack(Blocks.clay, 1)}); } if (GregTech_API.sRecipeFile.get(ConfigCategories.Tools.mortar, "Wheat", true)) { - GT_ModHandler.addShapelessCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wheat, 1L), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ToolDictNames.craftingToolMortar, new ItemStack(Items.wheat, 1)}); + GT_ModHandler.addShapelessCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wheat, 1L), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] {ToolDictNames.craftingToolMortar, new ItemStack(Items.wheat, 1)}); } if (GregTech_API.sRecipeFile.get(ConfigCategories.Tools.mortar, "Flint", true)) { - GT_ModHandler.addShapelessCraftingRecipe(new ItemStack(Items.flint, 1), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ToolDictNames.craftingToolMortar, new ItemStack(Blocks.gravel, 1)}); + GT_ModHandler.addShapelessCraftingRecipe( + new ItemStack(Items.flint, 1), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] {ToolDictNames.craftingToolMortar, new ItemStack(Blocks.gravel, 1)}); } if (GregTech_API.sRecipeFile.get(ConfigCategories.Tools.mortar, "Blaze", true)) { - GT_ModHandler.addShapelessCraftingRecipe(new ItemStack(Items.blaze_powder, 2), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ToolDictNames.craftingToolMortar, new ItemStack(Items.blaze_rod, 1)}); + GT_ModHandler.addShapelessCraftingRecipe( + new ItemStack(Items.blaze_powder, 2), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] {ToolDictNames.craftingToolMortar, new ItemStack(Items.blaze_rod, 1)}); } } } diff --git a/src/main/java/gregtech/common/items/GT_NeutronReflector_Item.java b/src/main/java/gregtech/common/items/GT_NeutronReflector_Item.java index 255b705f5c..5e307694f4 100644 --- a/src/main/java/gregtech/common/items/GT_NeutronReflector_Item.java +++ b/src/main/java/gregtech/common/items/GT_NeutronReflector_Item.java @@ -13,9 +13,18 @@ public class GT_NeutronReflector_Item extends GT_Generic_Item implements IReacto } @Override - public boolean acceptUraniumPulse(IReactor reactor, ItemStack yourStack, ItemStack pulsingStack, int youX, int youY, int pulseX, int pulseY, boolean heatrun) { + public boolean acceptUraniumPulse( + IReactor reactor, + ItemStack yourStack, + ItemStack pulsingStack, + int youX, + int youY, + int pulseX, + int pulseY, + boolean heatrun) { if (!heatrun) { - ((IReactorComponent) pulsingStack.getItem()).acceptUraniumPulse(reactor, pulsingStack, yourStack, pulseX, pulseY, youX, youY, heatrun); + ((IReactorComponent) pulsingStack.getItem()) + .acceptUraniumPulse(reactor, pulsingStack, yourStack, pulseX, pulseY, youX, youY, heatrun); } return true; } @@ -46,6 +55,5 @@ public class GT_NeutronReflector_Item extends GT_Generic_Item implements IReacto } @Override - public void processChamber(IReactor aReactor, ItemStack aStack, int x, int y, boolean aHeatRun) { - } + public void processChamber(IReactor aReactor, ItemStack aStack, int x, int y, boolean aHeatRun) {} } diff --git a/src/main/java/gregtech/common/items/GT_SensorCard_Item.java b/src/main/java/gregtech/common/items/GT_SensorCard_Item.java index b2f73d304f..da8467422a 100644 --- a/src/main/java/gregtech/common/items/GT_SensorCard_Item.java +++ b/src/main/java/gregtech/common/items/GT_SensorCard_Item.java @@ -5,6 +5,10 @@ import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.interfaces.tileentity.IGregTechDeviceInformation; import gregtech.api.items.GT_Generic_Item; import gregtech.api.util.GT_LanguageManager; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.UUID; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; @@ -15,11 +19,6 @@ import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.World; import shedar.mods.ic2.nuclearcontrol.api.*; -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; -import java.util.UUID; - public class GT_SensorCard_Item extends GT_Generic_Item implements IRemoteSensor, IPanelDataSource { private static final UUID CARD_TYPE = new UUID(0L, 41L); @@ -39,7 +38,8 @@ public class GT_SensorCard_Item extends GT_Generic_Item implements IRemoteSensor aList.add(transItem("014", "Missing Coodinates!")); } else { aList.add(transItem("015", "Device at:")); - aList.add(String.format("x: %d, y: %d, z: %d", tNBT.getInteger("x"), tNBT.getInteger("y"), tNBT.getInteger("z"))); + aList.add(String.format( + "x: %d, y: %d, z: %d", tNBT.getInteger("x"), tNBT.getInteger("y"), tNBT.getInteger("z"))); } } } @@ -54,12 +54,13 @@ public class GT_SensorCard_Item extends GT_Generic_Item implements IRemoteSensor ChunkCoordinates target = aCard.getTarget(); TileEntity tTileEntity = world.getTileEntity(target.posX, target.posY, target.posZ); - if (((tTileEntity instanceof IGregTechDeviceInformation)) && (((IGregTechDeviceInformation) tTileEntity).isGivingInformation())) { + if (((tTileEntity instanceof IGregTechDeviceInformation)) + && (((IGregTechDeviceInformation) tTileEntity).isGivingInformation())) { String[] tInfoData = ((IGregTechDeviceInformation) tTileEntity).getInfoData(); for (int i = 0; i < tInfoData.length; i++) { aCard.setString("mString" + i, tInfoData[i]); } - aCard.setInt("mString",strCount=tInfoData.length); + aCard.setInt("mString", strCount = tInfoData.length); return CardState.OK; } return CardState.NO_TARGET; @@ -68,7 +69,7 @@ public class GT_SensorCard_Item extends GT_Generic_Item implements IRemoteSensor @Override public List<PanelString> getStringData(int aSettings, ICardWrapper aCard, boolean aLabels) { List<PanelString> rList = new LinkedList<>(); - for (int i = 0; i < (strCount=aCard.getInt("mString")); i++) { + for (int i = 0; i < (strCount = aCard.getInt("mString")); i++) { if ((aSettings & 1 << i) != 0) { PanelString line = new PanelString(); line.textLeft = GT_LanguageManager.getTranslation(aCard.getString("mString" + i), "\\\\"); @@ -94,6 +95,5 @@ public class GT_SensorCard_Item extends GT_Generic_Item implements IRemoteSensor @Override @SideOnly(Side.CLIENT) - public void getSubItems(Item aItem, CreativeTabs aCreativeTab, List aOutputSubItems) { - } + public void getSubItems(Item aItem, CreativeTabs aCreativeTab, List aOutputSubItems) {} } diff --git a/src/main/java/gregtech/common/items/GT_VolumetricFlask.java b/src/main/java/gregtech/common/items/GT_VolumetricFlask.java index 8578f4812c..e2549462e3 100644 --- a/src/main/java/gregtech/common/items/GT_VolumetricFlask.java +++ b/src/main/java/gregtech/common/items/GT_VolumetricFlask.java @@ -1,12 +1,17 @@ - package gregtech.common.items; +import static gregtech.api.enums.GT_Values.RES_PATH_ITEM; +import static ic2.core.util.LiquidUtil.drainContainerStack; +import static ic2.core.util.LiquidUtil.fillContainerStack; +import static ic2.core.util.LiquidUtil.placeFluid; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.GT_Values; import gregtech.api.interfaces.INetworkUpdatableItem; import gregtech.api.items.GT_Generic_Item; import ic2.core.util.LiquidUtil; +import java.util.List; import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; @@ -30,17 +35,10 @@ import net.minecraftforge.fluids.IFluidBlock; import net.minecraftforge.fluids.IFluidContainerItem; import net.minecraftforge.fluids.IFluidHandler; -import java.util.List; - -import static gregtech.api.enums.GT_Values.RES_PATH_ITEM; -import static ic2.core.util.LiquidUtil.drainContainerStack; -import static ic2.core.util.LiquidUtil.fillContainerStack; -import static ic2.core.util.LiquidUtil.placeFluid; - - public class GT_VolumetricFlask extends GT_Generic_Item implements IFluidContainerItem, INetworkUpdatableItem { private final int maxCapacity; private final String unlocalFlaskName; + @SideOnly(Side.CLIENT) public IIcon iconWindow; @@ -60,12 +58,21 @@ public class GT_VolumetricFlask extends GT_Generic_Item implements IFluidContain } @Override - public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float xOffset, float yOffset, float zOffset) { + public boolean onItemUse( + ItemStack stack, + EntityPlayer player, + World world, + int x, + int y, + int z, + int side, + float xOffset, + float yOffset, + float zOffset) { if (player instanceof FakePlayer) { return false; } - if (world.isRemote) - return false; + if (world.isRemote) return false; if (interactWithTank(stack, player, world, x, y, z, side)) { return true; } @@ -85,9 +92,10 @@ public class GT_VolumetricFlask extends GT_Generic_Item implements IFluidContain } ForgeDirection dir = ForgeDirection.VALID_DIRECTIONS[mop.sideHit]; FluidStack fluidStack = drainContainerStack(stack, player, 1000, true); - if (placeFluid(fluidStack, world, x, y, z) || (player.canPlayerEdit(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, mop.sideHit, stack) && placeFluid(fluidStack, world, x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ))) { - if (!player.capabilities.isCreativeMode) - drainContainerStack(stack, player, 1000, false); + if (placeFluid(fluidStack, world, x, y, z) + || (player.canPlayerEdit(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, mop.sideHit, stack) + && placeFluid(fluidStack, world, x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ))) { + if (!player.capabilities.isCreativeMode) drainContainerStack(stack, player, 1000, false); return true; } } @@ -116,8 +124,7 @@ public class GT_VolumetricFlask extends GT_Generic_Item implements IFluidContain int capacity = 1000; if (stack.hasTagCompound()) { NBTTagCompound nbt = stack.getTagCompound(); - if (nbt.hasKey("Capacity", 3)) - capacity = nbt.getInteger("Capacity"); + if (nbt.hasKey("Capacity", 3)) capacity = nbt.getInteger("Capacity"); } return Math.min(getMaxCapacity(), capacity); } @@ -126,7 +133,7 @@ public class GT_VolumetricFlask extends GT_Generic_Item implements IFluidContain @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister aIconRegister) { super.registerIcons(aIconRegister); - iconWindow = aIconRegister.registerIcon(RES_PATH_ITEM + "gt."+unlocalFlaskName+".window"); + iconWindow = aIconRegister.registerIcon(RES_PATH_ITEM + "gt." + unlocalFlaskName + ".window"); } public void setCapacity(ItemStack stack, int capacity) { @@ -142,8 +149,7 @@ public class GT_VolumetricFlask extends GT_Generic_Item implements IFluidContain public FluidStack getFluid(ItemStack stack) { if (stack.hasTagCompound()) { NBTTagCompound nbt = stack.getTagCompound(); - if (nbt.hasKey("Fluid", 10)) - return FluidStack.loadFluidStackFromNBT(nbt.getCompoundTag("Fluid")); + if (nbt.hasKey("Fluid", 10)) return FluidStack.loadFluidStackFromNBT(nbt.getCompoundTag("Fluid")); } return null; } @@ -152,8 +158,7 @@ public class GT_VolumetricFlask extends GT_Generic_Item implements IFluidContain boolean removeFluid = (fluidStack == null) || (fluidStack.amount <= 0); NBTTagCompound nbt = stack.getTagCompound(); if (nbt == null) { - if (removeFluid) - return; + if (removeFluid) return; stack.setTagCompound(nbt = new NBTTagCompound()); } if (removeFluid) { @@ -168,8 +173,7 @@ public class GT_VolumetricFlask extends GT_Generic_Item implements IFluidContain @Override public int fill(ItemStack stack, FluidStack resource, boolean doFill) { - if (stack.stackSize != 1) - return 0; + if (stack.stackSize != 1) return 0; if ((resource == null) || (resource.amount <= 0)) { return 0; } @@ -189,11 +193,9 @@ public class GT_VolumetricFlask extends GT_Generic_Item implements IFluidContain @Override public FluidStack drain(ItemStack stack, int maxDrain, boolean doDrain) { - if (stack.stackSize != 1) - return null; + if (stack.stackSize != 1) return null; FluidStack fluidStack = getFluid(stack); - if (fluidStack == null) - return null; + if (fluidStack == null) return null; maxDrain = Math.min(fluidStack.amount, maxDrain); if (doDrain) { fluidStack.amount -= maxDrain; @@ -301,8 +303,7 @@ public class GT_VolumetricFlask extends GT_Generic_Item implements IFluidContain public boolean receive(ItemStack stack, EntityPlayerMP player, NBTTagCompound tag) { if (stack != null && stack.stackSize > 0) { Item item = stack.getItem(); - if (item == this) - setCapacity(stack, tag.getInteger("cap")); + if (item == this) setCapacity(stack, tag.getInteger("cap")); return true; } return false; diff --git a/src/main/java/gregtech/common/items/ItemComb.java b/src/main/java/gregtech/common/items/ItemComb.java index b6484d394f..e3fc978978 100644 --- a/src/main/java/gregtech/common/items/ItemComb.java +++ b/src/main/java/gregtech/common/items/ItemComb.java @@ -1,5 +1,7 @@ package gregtech.common.items; +import static gregtech.api.enums.GT_Values.*; + import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap.Builder; import cpw.mods.fml.common.Loader; @@ -12,583 +14,2038 @@ import gregtech.GT_Mod; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; -import gregtech.api.objects.MaterialStack; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; import gregtech.loaders.materialprocessing.ProcessingModSupport; import gregtech.loaders.misc.GT_Bees; +import java.util.Arrays; +import java.util.List; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; -import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; -import java.util.List; -import java.util.Arrays; +public class ItemComb extends Item { + @SideOnly(Side.CLIENT) + private IIcon secondIcon; -import static gregtech.api.enums.GT_Values.*; + public ItemComb() { + super(); + this.setCreativeTab(Tabs.tabApiculture); + this.setHasSubtypes(true); + this.setUnlocalizedName("gt.comb"); + GameRegistry.registerItem(this, "gt.comb", MOD_ID); + } -public class ItemComb extends Item { - @SideOnly(Side.CLIENT) - private IIcon secondIcon; - - public ItemComb() { - super(); - this.setCreativeTab(Tabs.tabApiculture); - this.setHasSubtypes(true); - this.setUnlocalizedName("gt.comb"); - GameRegistry.registerItem(this, "gt.comb", MOD_ID); - } - - public ItemStack getStackForType(CombType type) { - return new ItemStack(this, 1, type.getId()); - } - - public ItemStack getStackForType(CombType type, int count) { - return new ItemStack(this, count, type.getId()); - } - - @Override - @SideOnly(Side.CLIENT) - public void getSubItems(Item item, CreativeTabs tabs, List list) { - for (CombType type : CombType.values()) { - if (type.showInList) { - list.add(this.getStackForType(type)); - } - } - } - - @Override - @SideOnly(Side.CLIENT) - public boolean requiresMultipleRenderPasses() { - return true; - } - - @Override - public int getRenderPasses(int meta) { - return 2; - } - - @Override + public ItemStack getStackForType(CombType type) { + return new ItemStack(this, 1, type.getId()); + } + + public ItemStack getStackForType(CombType type, int count) { + return new ItemStack(this, count, type.getId()); + } + + @Override + @SideOnly(Side.CLIENT) + public void getSubItems(Item item, CreativeTabs tabs, List list) { + for (CombType type : CombType.values()) { + if (type.showInList) { + list.add(this.getStackForType(type)); + } + } + } + + @Override + @SideOnly(Side.CLIENT) + public boolean requiresMultipleRenderPasses() { + return true; + } + + @Override + public int getRenderPasses(int meta) { + return 2; + } + + @Override @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister iconRegister) { - this.itemIcon = iconRegister.registerIcon("forestry:beeCombs.0"); - this.secondIcon = iconRegister.registerIcon("forestry:beeCombs.1"); - } - - @Override - public IIcon getIcon(ItemStack stack, int pass) { - return (pass == 0) ? itemIcon : secondIcon; - } - - @Override - @SideOnly(Side.CLIENT) - public int getColorFromItemStack(ItemStack stack, int pass) { + public void registerIcons(IIconRegister iconRegister) { + this.itemIcon = iconRegister.registerIcon("forestry:beeCombs.0"); + this.secondIcon = iconRegister.registerIcon("forestry:beeCombs.1"); + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) { + return (pass == 0) ? itemIcon : secondIcon; + } + + @Override + @SideOnly(Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) { CombType type = CombType.valueOf(stack.getItemDamage()); return type.getColours()[GT_Utility.clamp(pass, 0, 1)]; - } - - @Override - public String getItemStackDisplayName(ItemStack stack) { - return CombType.valueOf(stack.getItemDamage()).getName(); - } - public void initCombsRecipes() { - - //Organic - addProcessGT(CombType.LIGNIE, new Materials[] {Materials.Lignite}, Voltage.LV); - addProcessGT(CombType.COAL, new Materials[] {Materials.Coal}, Voltage.LV); - addCentrifugeToItemStack(CombType.STICKY, new ItemStack[] { ItemList.IC2_Resin.get(1), ItemList.IC2_Plantball.get(1), ItemList.FR_Wax.get(1) }, new int[] {50 * 100, 15 * 100, 50 * 100}, Voltage.ULV); - addProcessGT(CombType.OIL, new Materials[] {Materials.Oilsands}, Voltage.LV); - addProcessGT(CombType.APATITE, new Materials[] {Materials.Apatite }, Voltage.LV); - addCentrifugeToMaterial(CombType.ASH, new Materials[] {Materials.DarkAsh, Materials.Ash}, new int[] { 50*100, 50*100}, new int[] {}, Voltage.ULV, NI, 50 * 100); - addCentrifugeToItemStack(CombType.PHOSPHORUS, new ItemStack[] { Materials.Phosphorus.getDust(3), Materials.TricalciumPhosphate.getDust(2), ItemList.FR_Wax.get(1) }, new int[] {100 * 100, 75 * 100, 100 * 100}, Voltage.HV); - addCentrifugeToItemStack(CombType.MICA, new ItemStack[] { Materials.Mica.getDust(2), ItemList.FR_Wax.get(1) }, new int[] {100 * 100, 75 * 100}, Voltage.HV); - if(GT_Mod.gregtechproxy.mNerfedCombs) { - addCentrifugeToItemStack(CombType.LIGNIE, new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Lignite, 1), ItemList.FR_Wax.get(1) }, new int[] {90 * 100, 50 * 100}, Voltage.ULV); - addCentrifugeToItemStack(CombType.COAL, new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Coal, 1), ItemList.FR_Wax.get(1) }, new int[] {5 * 100, 50 * 100}, Voltage.ULV); - addCentrifugeToItemStack(CombType.OIL, new ItemStack[] { ItemList.Crop_Drop_OilBerry.get(6), GT_Bees.drop.getStackForType(DropType.OIL), ItemList.FR_Wax.get(1) }, new int[] {100 * 100, 100 * 100, 50 * 100}, Voltage.ULV); - }else { - addCentrifugeToItemStack(CombType.LIGNIE, new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Lignite, 1), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Lignite, 1), ItemList.FR_Wax.get(1) }, new int[] {90 * 100, 100 * 100, 50 * 100}, Voltage.ULV); - addCentrifugeToItemStack(CombType.COAL, new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Coal, 1), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Coal, 1), ItemList.FR_Wax.get(1) }, new int[] {5 * 100, 100 * 100, 50 * 100}, Voltage.ULV); - addCentrifugeToItemStack(CombType.OIL, new ItemStack[] { ItemList.Crop_Drop_OilBerry.get(6), GT_Bees.drop.getStackForType(DropType.OIL), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Oilsands, 1), ItemList.FR_Wax.get(1) }, new int[] {100 * 100, 100 * 100, 100 * 100, 50 * 100}, Voltage.ULV); - addCentrifugeToMaterial(CombType.APATITE, new Materials[] { Materials.Apatite, Materials.Phosphate }, new int[] {100 * 100, 80 * 100 }, new int[] {}, Voltage.ULV, NI, 30 * 100); - } - - //ic2 - addCentrifugeToItemStack(CombType.COOLANT, new ItemStack[] { GT_Bees.drop.getStackForType(DropType.COOLANT), ItemList.FR_Wax.get(1) }, new int[] {100 * 100, 100 * 100}, Voltage.HV, 196); - addCentrifugeToItemStack(CombType.ENERGY, new ItemStack[] {GT_Bees.drop.getStackForType(DropType.HOT_COOLANT), ItemList.IC2_Energium_Dust.get(1L), ItemList.FR_RefractoryWax.get(1)}, new int[] {20 * 100, 20 * 100, 50 * 100}, Voltage.HV, 196); - addCentrifugeToItemStack(CombType.LAPOTRON, new ItemStack[] {GT_Bees.drop.getStackForType(DropType.LAPIS), GT_ModHandler.getModItem(MOD_ID_DC, "item.LapotronDust", 1, 0), GT_ModHandler.getModItem("MagicBees", "wax", 1, 2) }, new int[] {20 * 100, 15 * 100, 40 * 100}, Voltage.HV, 196); - addCentrifugeToMaterial(CombType.PYROTHEUM, new Materials[] {Materials.Blaze, Materials.Pyrotheum}, new int[] { 25 * 100, 20 * 100}, new int[] {}, Voltage.HV, NI, 30 * 100); - addCentrifugeToItemStack(CombType.CRYOTHEUM, new ItemStack[] { ItemList.FR_RefractoryWax.get(1), Materials.Blizz.getDust(1) }, new int[] {50 * 100, 100 * 100}, Voltage.MV); - - //Alloy - addProcessGT(CombType.REDALLOY, new Materials[] {Materials.RedAlloy}, Voltage.LV); - addProcessGT(CombType.REDSTONEALLOY, new Materials[] {Materials.RedstoneAlloy}, Voltage.LV); - addProcessGT(CombType.CONDUCTIVEIRON, new Materials[] {Materials.ConductiveIron }, Voltage.MV); - addProcessGT(CombType.VIBRANTALLOY, new Materials[] {Materials.VibrantAlloy }, Voltage.HV); - addProcessGT(CombType.ENERGETICALLOY, new Materials[] {Materials.EnergeticAlloy }, Voltage.HV); - addProcessGT(CombType.ELECTRICALSTEEL, new Materials[] {Materials.ElectricalSteel }, Voltage.LV); - addProcessGT(CombType.DARKSTEEL, new Materials[] {Materials.DarkSteel }, Voltage.MV); - addProcessGT(CombType.PULSATINGIRON, new Materials[] { Materials.PulsatingIron } , Voltage.HV); - addProcessGT(CombType.STAINLESSSTEEL, new Materials[] { Materials.StainlessSteel }, Voltage.HV); - addProcessGT(CombType.BEDROCKIUM, new Materials[] { Materials.Bedrockium }, Voltage.EV); - addCentrifugeToItemStack(CombType.ENDERIUM, new ItemStack[] {ItemList.FR_RefractoryWax.get(1), GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.EnderiumBase, 1), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Enderium, 1) }, new int[] {50 * 100, 30 * 100, 50 * 100 }, Voltage.HV); - if(GT_Mod.gregtechproxy.mNerfedCombs) { - addCentrifugeToMaterial(CombType.REDALLOY, new Materials[] {Materials.RedAlloy}, new int[] {100 * 100 }, new int[] {}, Voltage.ULV, ItemList.FR_RefractoryWax.get(1), 50 * 100); - addCentrifugeToMaterial(CombType.REDSTONEALLOY, new Materials[] {Materials.RedstoneAlloy}, new int[] {100 * 100 }, new int[] {}, Voltage.ULV, ItemList.FR_RefractoryWax.get(1), 50 * 100); - addCentrifugeToMaterial(CombType.CONDUCTIVEIRON, new Materials[] {Materials.ConductiveIron }, new int[] {90 * 100}, new int[] {}, Voltage.MV, ItemList.FR_RefractoryWax.get(1), 50 * 100); - addCentrifugeToMaterial(CombType.VIBRANTALLOY, new Materials[] {Materials.VibrantAlloy }, new int[] {70 * 100}, new int[] {}, Voltage.HV, ItemList.FR_RefractoryWax.get(1), 50 * 100); - addCentrifugeToMaterial(CombType.ENERGETICALLOY, new Materials[] {Materials.EnergeticAlloy }, new int[] {80 * 100}, new int[] {}, Voltage.HV, ItemList.FR_RefractoryWax.get(1), 50 * 100); - addCentrifugeToMaterial(CombType.ELECTRICALSTEEL, new Materials[] {Materials.ElectricalSteel }, new int[] {100 * 100}, new int[] {}, Voltage.ULV, ItemList.FR_RefractoryWax.get(1), 50 * 100); - addCentrifugeToMaterial(CombType.DARKSTEEL, new Materials[] {Materials.DarkSteel }, new int[] {100 * 100}, new int[] {}, Voltage.MV, ItemList.FR_RefractoryWax.get(1), 50 * 100); - addCentrifugeToMaterial(CombType.PULSATINGIRON, new Materials[] {Materials.PulsatingIron }, new int[] {80 * 100}, new int[] {}, Voltage.HV, ItemList.FR_RefractoryWax.get(1), 50 * 100); - addCentrifugeToMaterial(CombType.STAINLESSSTEEL, new Materials[] {Materials.StainlessSteel }, new int[] {50 * 100}, new int[] {}, Voltage.HV, ItemList.FR_RefractoryWax.get(1), 50 * 100); - addCentrifugeToMaterial(CombType.BEDROCKIUM, new Materials[] {Materials.Bedrockium }, new int[] {50 * 100}, new int[] {}, Voltage.EV, ItemList.FR_RefractoryWax.get(1), 50 * 100); - - }else { - addCentrifugeToMaterial(CombType.REDALLOY, new Materials[] {Materials.RedAlloy, Materials.Redstone, Materials.Copper}, new int[] {100 * 100, 75 * 100, 90 * 100 }, new int[] {}, Voltage.ULV, ItemList.FR_RefractoryWax.get(1), 50 * 100); - addCentrifugeToMaterial(CombType.REDSTONEALLOY, new Materials[] {Materials.RedstoneAlloy, Materials.Redstone, Materials.Silicon, Materials.Coal}, new int[] {100 * 100, 90 * 100, 75 * 100, 75 * 100 }, new int[] {}, Voltage.ULV, ItemList.FR_RefractoryWax.get(1), 50 * 100); - addCentrifugeToMaterial(CombType.CONDUCTIVEIRON, new Materials[] {Materials.ConductiveIron, Materials.Silver, Materials.Iron }, new int[] {90 * 100, 55 * 100, 65 * 100}, new int[] {}, Voltage.MV, ItemList.FR_RefractoryWax.get(1), 50 * 100); - addCentrifugeToMaterial(CombType.VIBRANTALLOY, new Materials[] {Materials.VibrantAlloy, Materials.Chrome }, new int[] {70 * 100, 50 * 100}, new int[] {}, Voltage.HV, ItemList.FR_RefractoryWax.get(1), 50 * 100); - addCentrifugeToMaterial(CombType.ENERGETICALLOY, new Materials[] {Materials.EnergeticAlloy, Materials.Gold }, new int[] {80 * 100, 60 * 100}, new int[] {}, Voltage.HV, ItemList.FR_RefractoryWax.get(1), 50 * 100); - addCentrifugeToMaterial(CombType.ELECTRICALSTEEL, new Materials[] {Materials.ElectricalSteel, Materials.Silicon, Materials.Coal }, new int[] {100 * 100, 75 * 100, 75 * 100}, new int[] {}, Voltage.ULV, ItemList.FR_RefractoryWax.get(1), 50 * 100); - addCentrifugeToMaterial(CombType.DARKSTEEL, new Materials[] {Materials.DarkSteel, Materials.Coal }, new int[] {100 * 100, 75 * 100 }, new int[] {}, Voltage.MV, ItemList.FR_RefractoryWax.get(1), 50 * 100); - addCentrifugeToMaterial(CombType.PULSATINGIRON, new Materials[] {Materials.PulsatingIron, Materials.Iron }, new int[] {80 * 100, 75 * 100 }, new int[] {}, Voltage.HV, ItemList.FR_RefractoryWax.get(1), 50 * 100); - addCentrifugeToMaterial(CombType.STAINLESSSTEEL, new Materials[] {Materials.StainlessSteel, Materials.Iron, Materials.Chrome, Materials.Manganese, Materials.Nickel }, new int[] {50 * 100, 75 * 100, 55 * 100, 75 * 100, 75 * 100 }, new int[] {}, Voltage.HV, ItemList.FR_RefractoryWax.get(1), 50 * 100); - addCentrifugeToMaterial(CombType.BEDROCKIUM, new Materials[] {Materials.Bedrockium }, new int[] {50 * 100}, new int[] {}, Voltage.EV, ItemList.FR_RefractoryWax.get(1), 50 * 100); + } + + @Override + public String getItemStackDisplayName(ItemStack stack) { + return CombType.valueOf(stack.getItemDamage()).getName(); + } + + public void initCombsRecipes() { + + // Organic + addProcessGT(CombType.LIGNIE, new Materials[] {Materials.Lignite}, Voltage.LV); + addProcessGT(CombType.COAL, new Materials[] {Materials.Coal}, Voltage.LV); + addCentrifugeToItemStack( + CombType.STICKY, + new ItemStack[] {ItemList.IC2_Resin.get(1), ItemList.IC2_Plantball.get(1), ItemList.FR_Wax.get(1)}, + new int[] {50 * 100, 15 * 100, 50 * 100}, + Voltage.ULV); + addProcessGT(CombType.OIL, new Materials[] {Materials.Oilsands}, Voltage.LV); + addProcessGT(CombType.APATITE, new Materials[] {Materials.Apatite}, Voltage.LV); + addCentrifugeToMaterial( + CombType.ASH, + new Materials[] {Materials.DarkAsh, Materials.Ash}, + new int[] {50 * 100, 50 * 100}, + new int[] {}, + Voltage.ULV, + NI, + 50 * 100); + addCentrifugeToItemStack( + CombType.PHOSPHORUS, + new ItemStack[] { + Materials.Phosphorus.getDust(3), Materials.TricalciumPhosphate.getDust(2), ItemList.FR_Wax.get(1) + }, + new int[] {100 * 100, 75 * 100, 100 * 100}, + Voltage.HV); + addCentrifugeToItemStack( + CombType.MICA, + new ItemStack[] {Materials.Mica.getDust(2), ItemList.FR_Wax.get(1)}, + new int[] {100 * 100, 75 * 100}, + Voltage.HV); + if (GT_Mod.gregtechproxy.mNerfedCombs) { + addCentrifugeToItemStack( + CombType.LIGNIE, + new ItemStack[] { + GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Lignite, 1), ItemList.FR_Wax.get(1) + }, + new int[] {90 * 100, 50 * 100}, + Voltage.ULV); + addCentrifugeToItemStack( + CombType.COAL, + new ItemStack[] { + GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Coal, 1), ItemList.FR_Wax.get(1) + }, + new int[] {5 * 100, 50 * 100}, + Voltage.ULV); + addCentrifugeToItemStack( + CombType.OIL, + new ItemStack[] { + ItemList.Crop_Drop_OilBerry.get(6), + GT_Bees.drop.getStackForType(DropType.OIL), + ItemList.FR_Wax.get(1) + }, + new int[] {100 * 100, 100 * 100, 50 * 100}, + Voltage.ULV); + } else { + addCentrifugeToItemStack( + CombType.LIGNIE, + new ItemStack[] { + GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Lignite, 1), + GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Lignite, 1), + ItemList.FR_Wax.get(1) + }, + new int[] {90 * 100, 100 * 100, 50 * 100}, + Voltage.ULV); + addCentrifugeToItemStack( + CombType.COAL, + new ItemStack[] { + GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Coal, 1), + GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Coal, 1), + ItemList.FR_Wax.get(1) + }, + new int[] {5 * 100, 100 * 100, 50 * 100}, + Voltage.ULV); + addCentrifugeToItemStack( + CombType.OIL, + new ItemStack[] { + ItemList.Crop_Drop_OilBerry.get(6), + GT_Bees.drop.getStackForType(DropType.OIL), + GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Oilsands, 1), + ItemList.FR_Wax.get(1) + }, + new int[] {100 * 100, 100 * 100, 100 * 100, 50 * 100}, + Voltage.ULV); + addCentrifugeToMaterial( + CombType.APATITE, + new Materials[] {Materials.Apatite, Materials.Phosphate}, + new int[] {100 * 100, 80 * 100}, + new int[] {}, + Voltage.ULV, + NI, + 30 * 100); + } + + // ic2 + addCentrifugeToItemStack( + CombType.COOLANT, + new ItemStack[] {GT_Bees.drop.getStackForType(DropType.COOLANT), ItemList.FR_Wax.get(1)}, + new int[] {100 * 100, 100 * 100}, + Voltage.HV, + 196); + addCentrifugeToItemStack( + CombType.ENERGY, + new ItemStack[] { + GT_Bees.drop.getStackForType(DropType.HOT_COOLANT), + ItemList.IC2_Energium_Dust.get(1L), + ItemList.FR_RefractoryWax.get(1) + }, + new int[] {20 * 100, 20 * 100, 50 * 100}, + Voltage.HV, + 196); + addCentrifugeToItemStack( + CombType.LAPOTRON, + new ItemStack[] { + GT_Bees.drop.getStackForType(DropType.LAPIS), + GT_ModHandler.getModItem(MOD_ID_DC, "item.LapotronDust", 1, 0), + GT_ModHandler.getModItem("MagicBees", "wax", 1, 2) + }, + new int[] {20 * 100, 15 * 100, 40 * 100}, + Voltage.HV, + 196); + addCentrifugeToMaterial( + CombType.PYROTHEUM, + new Materials[] {Materials.Blaze, Materials.Pyrotheum}, + new int[] {25 * 100, 20 * 100}, + new int[] {}, + Voltage.HV, + NI, + 30 * 100); + addCentrifugeToItemStack( + CombType.CRYOTHEUM, + new ItemStack[] {ItemList.FR_RefractoryWax.get(1), Materials.Blizz.getDust(1)}, + new int[] {50 * 100, 100 * 100}, + Voltage.MV); + + // Alloy + addProcessGT(CombType.REDALLOY, new Materials[] {Materials.RedAlloy}, Voltage.LV); + addProcessGT(CombType.REDSTONEALLOY, new Materials[] {Materials.RedstoneAlloy}, Voltage.LV); + addProcessGT(CombType.CONDUCTIVEIRON, new Materials[] {Materials.ConductiveIron}, Voltage.MV); + addProcessGT(CombType.VIBRANTALLOY, new Materials[] {Materials.VibrantAlloy}, Voltage.HV); + addProcessGT(CombType.ENERGETICALLOY, new Materials[] {Materials.EnergeticAlloy}, Voltage.HV); + addProcessGT(CombType.ELECTRICALSTEEL, new Materials[] {Materials.ElectricalSteel}, Voltage.LV); + addProcessGT(CombType.DARKSTEEL, new Materials[] {Materials.DarkSteel}, Voltage.MV); + addProcessGT(CombType.PULSATINGIRON, new Materials[] {Materials.PulsatingIron}, Voltage.HV); + addProcessGT(CombType.STAINLESSSTEEL, new Materials[] {Materials.StainlessSteel}, Voltage.HV); + addProcessGT(CombType.BEDROCKIUM, new Materials[] {Materials.Bedrockium}, Voltage.EV); + addCentrifugeToItemStack( + CombType.ENDERIUM, + new ItemStack[] { + ItemList.FR_RefractoryWax.get(1), + GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.EnderiumBase, 1), + GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Enderium, 1) + }, + new int[] {50 * 100, 30 * 100, 50 * 100}, + Voltage.HV); + if (GT_Mod.gregtechproxy.mNerfedCombs) { + addCentrifugeToMaterial( + CombType.REDALLOY, + new Materials[] {Materials.RedAlloy}, + new int[] {100 * 100}, + new int[] {}, + Voltage.ULV, + ItemList.FR_RefractoryWax.get(1), + 50 * 100); + addCentrifugeToMaterial( + CombType.REDSTONEALLOY, + new Materials[] {Materials.RedstoneAlloy}, + new int[] {100 * 100}, + new int[] {}, + Voltage.ULV, + ItemList.FR_RefractoryWax.get(1), + 50 * 100); + addCentrifugeToMaterial( + CombType.CONDUCTIVEIRON, + new Materials[] {Materials.ConductiveIron}, + new int[] {90 * 100}, + new int[] {}, + Voltage.MV, + ItemList.FR_RefractoryWax.get(1), + 50 * 100); + addCentrifugeToMaterial( + CombType.VIBRANTALLOY, + new Materials[] {Materials.VibrantAlloy}, + new int[] {70 * 100}, + new int[] {}, + Voltage.HV, + ItemList.FR_RefractoryWax.get(1), + 50 * 100); + addCentrifugeToMaterial( + CombType.ENERGETICALLOY, + new Materials[] {Materials.EnergeticAlloy}, + new int[] {80 * 100}, + new int[] {}, + Voltage.HV, + ItemList.FR_RefractoryWax.get(1), + 50 * 100); + addCentrifugeToMaterial( + CombType.ELECTRICALSTEEL, + new Materials[] {Materials.ElectricalSteel}, + new int[] {100 * 100}, + new int[] {}, + Voltage.ULV, + ItemList.FR_RefractoryWax.get(1), + 50 * 100); + addCentrifugeToMaterial( + CombType.DARKSTEEL, + new Materials[] {Materials.DarkSteel}, + new int[] {100 * 100}, + new int[] {}, + Voltage.MV, + ItemList.FR_RefractoryWax.get(1), + 50 * 100); + addCentrifugeToMaterial( + CombType.PULSATINGIRON, + new Materials[] {Materials.PulsatingIron}, + new int[] {80 * 100}, + new int[] {}, + Voltage.HV, + ItemList.FR_RefractoryWax.get(1), + 50 * 100); + addCentrifugeToMaterial( + CombType.STAINLESSSTEEL, + new Materials[] {Materials.StainlessSteel}, + new int[] {50 * 100}, + new int[] {}, + Voltage.HV, + ItemList.FR_RefractoryWax.get(1), + 50 * 100); + addCentrifugeToMaterial( + CombType.BEDROCKIUM, + new Materials[] {Materials.Bedrockium}, + new int[] {50 * 100}, + new int[] {}, + Voltage.EV, + ItemList.FR_RefractoryWax.get(1), + 50 * 100); + + } else { + addCentrifugeToMaterial( + CombType.REDALLOY, + new Materials[] {Materials.RedAlloy, Materials.Redstone, Materials.Copper}, + new int[] {100 * 100, 75 * 100, 90 * 100}, + new int[] {}, + Voltage.ULV, + ItemList.FR_RefractoryWax.get(1), + 50 * 100); + addCentrifugeToMaterial( + CombType.REDSTONEALLOY, + new Materials[] {Materials.RedstoneAlloy, Materials.Redstone, Materials.Silicon, Materials.Coal}, + new int[] {100 * 100, 90 * 100, 75 * 100, 75 * 100}, + new int[] {}, + Voltage.ULV, + ItemList.FR_RefractoryWax.get(1), + 50 * 100); + addCentrifugeToMaterial( + CombType.CONDUCTIVEIRON, + new Materials[] {Materials.ConductiveIron, Materials.Silver, Materials.Iron}, + new int[] {90 * 100, 55 * 100, 65 * 100}, + new int[] {}, + Voltage.MV, + ItemList.FR_RefractoryWax.get(1), + 50 * 100); + addCentrifugeToMaterial( + CombType.VIBRANTALLOY, + new Materials[] {Materials.VibrantAlloy, Materials.Chrome}, + new int[] {70 * 100, 50 * 100}, + new int[] {}, + Voltage.HV, + ItemList.FR_RefractoryWax.get(1), + 50 * 100); + addCentrifugeToMaterial( + CombType.ENERGETICALLOY, + new Materials[] {Materials.EnergeticAlloy, Materials.Gold}, + new int[] {80 * 100, 60 * 100}, + new int[] {}, + Voltage.HV, + ItemList.FR_RefractoryWax.get(1), + 50 * 100); + addCentrifugeToMaterial( + CombType.ELECTRICALSTEEL, + new Materials[] {Materials.ElectricalSteel, Materials.Silicon, Materials.Coal}, + new int[] {100 * 100, 75 * 100, 75 * 100}, + new int[] {}, + Voltage.ULV, + ItemList.FR_RefractoryWax.get(1), + 50 * 100); + addCentrifugeToMaterial( + CombType.DARKSTEEL, + new Materials[] {Materials.DarkSteel, Materials.Coal}, + new int[] {100 * 100, 75 * 100}, + new int[] {}, + Voltage.MV, + ItemList.FR_RefractoryWax.get(1), + 50 * 100); + addCentrifugeToMaterial( + CombType.PULSATINGIRON, + new Materials[] {Materials.PulsatingIron, Materials.Iron}, + new int[] {80 * 100, 75 * 100}, + new int[] {}, + Voltage.HV, + ItemList.FR_RefractoryWax.get(1), + 50 * 100); + addCentrifugeToMaterial( + CombType.STAINLESSSTEEL, + new Materials[] { + Materials.StainlessSteel, + Materials.Iron, + Materials.Chrome, + Materials.Manganese, + Materials.Nickel + }, + new int[] {50 * 100, 75 * 100, 55 * 100, 75 * 100, 75 * 100}, + new int[] {}, + Voltage.HV, + ItemList.FR_RefractoryWax.get(1), + 50 * 100); + addCentrifugeToMaterial( + CombType.BEDROCKIUM, + new Materials[] {Materials.Bedrockium}, + new int[] {50 * 100}, + new int[] {}, + Voltage.EV, + ItemList.FR_RefractoryWax.get(1), + 50 * 100); + } + // Thaumic + addProcessGT(CombType.THAUMIUMDUST, new Materials[] {Materials.Thaumium}, Voltage.MV); + addCentrifugeToItemStack( + CombType.THAUMIUMSHARD, + new ItemStack[] { + GT_ModHandler.getModItem("MagicBees", "propolis", 1, 1), + GT_ModHandler.getModItem("MagicBees", "propolis", 1, 2), + GT_ModHandler.getModItem("MagicBees", "propolis", 1, 3), + GT_ModHandler.getModItem("MagicBees", "propolis", 1, 4), + GT_ModHandler.getModItem("MagicBees", "propolis", 1, 5), + GT_ModHandler.getModItem("MagicBees", "propolis", 1, 6), + GT_ModHandler.getModItem("MagicBees", "wax", 1, 0) + }, + new int[] {20 * 100, 20 * 100, 20 * 100, 20 * 100, 20 * 100, 20 * 100, 50 * 100}, + Voltage.ULV); + addProcessGT(CombType.AMBER, new Materials[] {Materials.Amber}, Voltage.LV); + addProcessGT(CombType.QUICKSILVER, new Materials[] {Materials.Cinnabar}, Voltage.LV); + addCentrifugeToItemStack( + CombType.SALISMUNDUS, + new ItemStack[] { + GT_ModHandler.getModItem("Thaumcraft", "ItemResource", 1, 14), + GT_ModHandler.getModItem("MagicBees", "wax", 1, 0) + }, + new int[] {100 * 100, 50 * 100}, + Voltage.MV); + addCentrifugeToItemStack( + CombType.TAINTED, + new ItemStack[] { + GT_ModHandler.getModItem("Thaumcraft", "ItemResource", 1, 11), + GT_ModHandler.getModItem("Thaumcraft", "ItemResource", 1, 12), + GT_ModHandler.getModItem("Thaumcraft", "blockTaintFibres", 1, 0), + GT_ModHandler.getModItem("Thaumcraft", "blockTaintFibres", 1, 1), + GT_ModHandler.getModItem("Thaumcraft", "blockTaintFibres", 1, 2), + GT_ModHandler.getModItem("MagicBees", "wax", 1, 0) + }, + new int[] {15 * 100, 15 * 100, 15 * 100, 15 * 100, 15 * 100, 50 * 100}, + Voltage.ULV); + addProcessGT(CombType.MITHRIL, new Materials[] {Materials.Mithril}, Voltage.HV); + addProcessGT(CombType.ASTRALSILVER, new Materials[] {Materials.AstralSilver}, Voltage.HV); + addCentrifugeToMaterial( + CombType.ASTRALSILVER, + new Materials[] {Materials.AstralSilver, Materials.Silver}, + new int[] {20 * 100, (GT_Mod.gregtechproxy.mNerfedCombs ? 10 : 75) * 100}, + new int[] {}, + Voltage.HV, + GT_ModHandler.getModItem("MagicBees", "wax", 1, 0), + 50 * 100); + addCentrifugeToItemStack( + CombType.THAUMINITE, + new ItemStack[] { + GT_ModHandler.getModItem("thaumicbases", "resource", 1, 0), + GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Thaumium, 1), + GT_ModHandler.getModItem("MagicBees", "wax", 1, 0) + }, + new int[] {20 * 100, 10 * 100, 50 * 100}, + Voltage.HV); + addProcessGT(CombType.SHADOWMETAL, new Materials[] {Materials.Shadow}, Voltage.HV); + addCentrifugeToMaterial( + CombType.SHADOWMETAL, + new Materials[] {Materials.Shadow, Materials.ShadowSteel}, + new int[] {(GT_Mod.gregtechproxy.mNerfedCombs ? 20 : 75) * 100, 10 * 100}, + new int[] {}, + Voltage.HV, + GT_ModHandler.getModItem("MagicBees", "wax", 1, 0), + 50 * 100); + addProcessGT(CombType.DIVIDED, new Materials[] {Materials.Diamond}, Voltage.HV); + addCentrifugeToItemStack( + CombType.DIVIDED, + new ItemStack[] { + GT_ModHandler.getModItem("MagicBees", "wax", 1, 0), + GT_ModHandler.getModItem("ExtraUtilities", "unstableingot", 1, 1), + GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Iron, 1), + GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Diamond, 1) + }, + new int[] { + 50 * 100, + 20 * 100, + (GT_Mod.gregtechproxy.mNerfedCombs ? 10 : 75) * 100, + (GT_Mod.gregtechproxy.mNerfedCombs ? 5 : 55) * 100 + }, + Voltage.HV); + addProcessGT(CombType.SPARKELING, new Materials[] {Materials.NetherStar}, Voltage.EV); + addCentrifugeToItemStack( + CombType.SPARKELING, + new ItemStack[] { + GT_ModHandler.getModItem("MagicBees", "wax", 1, 0), + GT_ModHandler.getModItem("MagicBees", "miscResources", 2, 5), + GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.NetherStar, 1) + }, + new int[] {50 * 100, 10 * 100, (GT_Mod.gregtechproxy.mNerfedCombs ? 10 : 50) * 100}, + Voltage.EV); + if (GT_Mod.gregtechproxy.mNerfedCombs) { + addCentrifugeToMaterial( + CombType.THAUMIUMDUST, + new Materials[] {Materials.Thaumium}, + new int[] {100 * 100}, + new int[] {}, + Voltage.MV, + GT_ModHandler.getModItem("MagicBees", "wax", 1, 0), + 50 * 100); + addCentrifugeToItemStack( + CombType.QUICKSILVER, + new ItemStack[] { + GT_ModHandler.getModItem("MagicBees", "wax", 1, 0), + GT_ModHandler.getModItem("Thaumcraft", "ItemNugget", 1, 5) + }, + new int[] {50 * 100, 100 * 100}, + Voltage.ULV); + } else { + addCentrifugeToMaterial( + CombType.THAUMIUMDUST, + new Materials[] {Materials.Thaumium, Materials.Iron}, + new int[] {100 * 100, 75 * 100}, + new int[] {}, + Voltage.MV, + GT_ModHandler.getModItem("MagicBees", "wax", 1, 0), + 50 * 100); + addCentrifugeToMaterial( + CombType.AMBER, + new Materials[] {Materials.Amber}, + new int[] {100 * 100}, + new int[] {}, + Voltage.ULV, + GT_ModHandler.getModItem("MagicBees", "wax", 1, 0), + 50 * 100); + addCentrifugeToItemStack( + CombType.QUICKSILVER, + new ItemStack[] { + GT_ModHandler.getModItem("MagicBees", "wax", 1, 0), + GT_ModHandler.getModItem("Thaumcraft", "ItemNugget", 1, 5), + GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Cinnabar, 1) + }, + new int[] {50 * 100, 100 * 100, 85 * 100}, + Voltage.ULV); + addCentrifugeToMaterial( + CombType.MITHRIL, + new Materials[] {Materials.Mithril, Materials.Platinum}, + new int[] {75 * 100, 55 * 100}, + new int[] {}, + Voltage.HV, + GT_ModHandler.getModItem("MagicBees", "wax", 1, 0), + 50 * 100); } - //Thaumic - addProcessGT(CombType.THAUMIUMDUST, new Materials[] {Materials.Thaumium }, Voltage.MV); - addCentrifugeToItemStack(CombType.THAUMIUMSHARD, new ItemStack[] {GT_ModHandler.getModItem("MagicBees", "propolis", 1, 1), GT_ModHandler.getModItem("MagicBees", "propolis", 1, 2), GT_ModHandler.getModItem("MagicBees", "propolis", 1, 3), GT_ModHandler.getModItem("MagicBees", "propolis", 1, 4), GT_ModHandler.getModItem("MagicBees", "propolis", 1, 5), GT_ModHandler.getModItem("MagicBees", "propolis", 1, 6), GT_ModHandler.getModItem("MagicBees", "wax", 1, 0) }, new int[] {20 * 100, 20 * 100, 20 * 100, 20 * 100, 20 * 100, 20 * 100, 50 * 100 }, Voltage.ULV); - addProcessGT(CombType.AMBER, new Materials[] {Materials.Amber}, Voltage.LV); - addProcessGT(CombType.QUICKSILVER, new Materials[] {Materials.Cinnabar}, Voltage.LV); - addCentrifugeToItemStack(CombType.SALISMUNDUS, new ItemStack[] {GT_ModHandler.getModItem("Thaumcraft", "ItemResource", 1, 14), GT_ModHandler.getModItem("MagicBees", "wax", 1, 0)}, new int[] {100 * 100, 50 * 100}, Voltage.MV); - addCentrifugeToItemStack(CombType.TAINTED, new ItemStack[] {GT_ModHandler.getModItem("Thaumcraft", "ItemResource", 1, 11), GT_ModHandler.getModItem("Thaumcraft", "ItemResource", 1, 12), GT_ModHandler.getModItem("Thaumcraft", "blockTaintFibres", 1, 0), GT_ModHandler.getModItem("Thaumcraft", "blockTaintFibres", 1, 1), GT_ModHandler.getModItem("Thaumcraft", "blockTaintFibres", 1, 2), GT_ModHandler.getModItem("MagicBees", "wax", 1, 0)}, new int[] {15 * 100, 15 * 100, 15 * 100, 15 * 100, 15 * 100, 50 * 100}, Voltage.ULV); - addProcessGT(CombType.MITHRIL, new Materials[] {Materials.Mithril }, Voltage.HV); - addProcessGT(CombType.ASTRALSILVER, new Materials[] {Materials.AstralSilver }, Voltage.HV); - addCentrifugeToMaterial(CombType.ASTRALSILVER, new Materials[] {Materials.AstralSilver, Materials.Silver}, new int[] {20 * 100, (GT_Mod.gregtechproxy.mNerfedCombs ? 10:75) * 100}, new int[] {}, Voltage.HV, GT_ModHandler.getModItem("MagicBees", "wax", 1, 0), 50 * 100); - addCentrifugeToItemStack(CombType.THAUMINITE, new ItemStack[] {GT_ModHandler.getModItem("thaumicbases", "resource", 1, 0), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Thaumium, 1), GT_ModHandler.getModItem("MagicBees", "wax", 1, 0)}, new int[] {20 * 100, 10 * 100, 50 *100}, Voltage.HV); - addProcessGT(CombType.SHADOWMETAL, new Materials[] {Materials.Shadow }, Voltage.HV); - addCentrifugeToMaterial(CombType.SHADOWMETAL, new Materials[] {Materials.Shadow, Materials.ShadowSteel}, new int[] {(GT_Mod.gregtechproxy.mNerfedCombs ? 20:75) * 100, 10 * 100}, new int[] {}, Voltage.HV, GT_ModHandler.getModItem("MagicBees", "wax", 1, 0) , 50 * 100); - addProcessGT(CombType.DIVIDED, new Materials[] {Materials.Diamond }, Voltage.HV); - addCentrifugeToItemStack(CombType.DIVIDED, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "wax", 1, 0), GT_ModHandler.getModItem("ExtraUtilities", "unstableingot", 1, 1), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Iron, 1), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Diamond, 1)}, new int[] {50 * 100, 20 * 100, (GT_Mod.gregtechproxy.mNerfedCombs ? 10:75) * 100, (GT_Mod.gregtechproxy.mNerfedCombs ? 5:55) * 100}, Voltage.HV); - addProcessGT(CombType.SPARKELING, new Materials[] {Materials.NetherStar}, Voltage.EV); - addCentrifugeToItemStack(CombType.SPARKELING, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "wax", 1, 0), GT_ModHandler.getModItem("MagicBees", "miscResources", 2, 5), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.NetherStar, 1)}, new int[] {50 * 100, 10 * 100, (GT_Mod.gregtechproxy.mNerfedCombs ? 10:50) * 100}, Voltage.EV); - if(GT_Mod.gregtechproxy.mNerfedCombs) { - addCentrifugeToMaterial(CombType.THAUMIUMDUST, new Materials[] {Materials.Thaumium }, new int[] {100 * 100}, new int[] {}, Voltage.MV, GT_ModHandler.getModItem("MagicBees", "wax", 1, 0), 50 * 100); - addCentrifugeToItemStack(CombType.QUICKSILVER, new ItemStack[] {GT_ModHandler.getModItem("MagicBees", "wax", 1, 0), GT_ModHandler.getModItem("Thaumcraft", "ItemNugget", 1, 5) }, new int[] {50 * 100, 100 * 100 }, Voltage.ULV); - }else { - addCentrifugeToMaterial(CombType.THAUMIUMDUST, new Materials[] {Materials.Thaumium, Materials.Iron }, new int[] {100 * 100, 75 * 100 }, new int[] {}, Voltage.MV, GT_ModHandler.getModItem("MagicBees", "wax", 1, 0), 50 * 100); - addCentrifugeToMaterial(CombType.AMBER, new Materials[] {Materials.Amber }, new int[] {100 * 100 }, new int[] {}, Voltage.ULV, GT_ModHandler.getModItem("MagicBees", "wax", 1, 0), 50 * 100); - addCentrifugeToItemStack(CombType.QUICKSILVER, new ItemStack[] {GT_ModHandler.getModItem("MagicBees", "wax", 1, 0), GT_ModHandler.getModItem("Thaumcraft", "ItemNugget", 1, 5), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Cinnabar, 1) }, new int[] {50 * 100, 100 * 100, 85 * 100 }, Voltage.ULV); - addCentrifugeToMaterial(CombType.MITHRIL, new Materials[] {Materials.Mithril, Materials.Platinum}, new int[] {75 * 100, 55 * 100}, new int[] {}, Voltage.HV, GT_ModHandler.getModItem("MagicBees", "wax", 1, 0), 50 * 100); - } - - //Gem Line - addProcessGT(CombType.STONE, new Materials[] {Materials.Soapstone}, Voltage.LV); - addProcessGT(CombType.CERTUS, new Materials[] {Materials.CertusQuartz}, Voltage.LV); - addProcessGT(CombType.FLUIX, new Materials[] {Materials.Fluix}, Voltage.LV); - addProcessGT(CombType.REDSTONE, new Materials[] {Materials.Redstone}, Voltage.LV); - addCentrifugeToMaterial(CombType.RAREEARTH, new Materials[] {Materials.RareEarth}, new int[] {100 * 100}, new int[] { 1}, Voltage.ULV, NI, 30 * 100); - addProcessGT(CombType.LAPIS, new Materials[] {Materials.Lapis}, Voltage.LV); - addProcessGT(CombType.RUBY, new Materials[] {Materials.Ruby}, Voltage.LV); - addProcessGT(CombType.REDGARNET, new Materials[] {Materials.GarnetRed}, Voltage.LV); - addProcessGT(CombType.YELLOWGARNET, new Materials[] {Materials.GarnetYellow}, Voltage.LV); - addProcessGT(CombType.SAPPHIRE, new Materials[] {Materials.Sapphire}, Voltage.LV); - addProcessGT(CombType.DIAMOND, new Materials[] {Materials.Diamond}, Voltage.LV); - addProcessGT(CombType.OLIVINE, new Materials[] {Materials.Olivine}, Voltage.LV); - addProcessGT(CombType.EMERALD, new Materials[] {Materials.Emerald}, Voltage.LV); - addProcessGT(CombType.FIRESTONE, new Materials[] {Materials.Firestone}, Voltage.LV); - addProcessGT(CombType.PYROPE, new Materials[] {Materials.Pyrope}, Voltage.LV); - addProcessGT(CombType.GROSSULAR, new Materials[] {Materials.Grossular}, Voltage.LV); - if(GT_Mod.gregtechproxy.mNerfedCombs) { - addCentrifugeToMaterial(CombType.STONE, new Materials[] {Materials.Stone, Materials.GraniteBlack, Materials.GraniteRed, Materials.Basalt, Materials.Marble, Materials.Redrock}, new int[] {70 * 100, 50 * 100, 50 * 100, 50 * 100, 50 * 100, 50 * 100}, new int[] { 9, 9, 9, 9, 9, 9}, Voltage.ULV, NI, 50 * 100); - addCentrifugeToMaterial(CombType.FLUIX, new Materials[] {Materials.Fluix}, new int[] {25 * 100}, new int[] { 9}, Voltage.ULV, NI, 30 * 100); - }else { - addCentrifugeToMaterial(CombType.STONE, new Materials[] {Materials.Soapstone, Materials.Talc, Materials.Apatite, Materials.Phosphate, Materials.TricalciumPhosphate}, new int[] {95 * 100, 90 * 100, 80 * 100, 75 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 50 * 100); - addCentrifugeToMaterial(CombType.CERTUS, new Materials[] {Materials.CertusQuartz, Materials.Quartzite, Materials.Barite}, new int[] {100 * 100, 80 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 50 * 100); - addCentrifugeToMaterial(CombType.FLUIX, new Materials[] {Materials.Fluix, Materials.Redstone, Materials.CertusQuartz, Materials.NetherQuartz}, new int[] {25 * 100, 90 * 100, 90 * 100, 90 * 100}, new int[] { 9, 1, 1, 1}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(CombType.REDSTONE, new Materials[] {Materials.Redstone, Materials.Cinnabar }, new int[] {100 * 100, 80 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(CombType.LAPIS, new Materials[] {Materials.Lapis, Materials.Sodalite, Materials.Lazurite, Materials.Calcite }, new int[] {100 * 100, 90 * 100, 90 * 100, 85 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(CombType.RUBY, new Materials[] {Materials.Ruby, Materials.Redstone }, new int[] {100 * 100, 90 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(CombType.REDGARNET, new Materials[] {Materials.GarnetRed, Materials.GarnetYellow }, new int[] {100 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(CombType.YELLOWGARNET, new Materials[] {Materials.GarnetYellow, Materials.GarnetRed }, new int[] {100 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(CombType.SAPPHIRE, new Materials[] {Materials.Sapphire, Materials.GreenSapphire, Materials.Almandine, Materials.Pyrope}, new int[] {100 * 100, 90 * 100, 90 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(CombType.DIAMOND, new Materials[] {Materials.Diamond, Materials.Graphite}, new int[] {100 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(CombType.OLIVINE, new Materials[] {Materials.Olivine, Materials.Bentonite, Materials.Magnesite, Materials.Glauconite}, new int[] {100 * 100, 90 * 100, 80 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(CombType.EMERALD, new Materials[] {Materials.Emerald, Materials.Beryllium, Materials.Thorium}, new int[] {100 * 100, 85 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(CombType.FIRESTONE, new Materials[] {Materials.Firestone}, new int[] {100 * 100}, new int[] {}, Voltage.ULV, ItemList.FR_RefractoryWax.get(1), 30 * 100); - addCentrifugeToMaterial(CombType.PYROPE, new Materials[] {Materials.Pyrope, Materials.Aluminium, Materials.Magnesium, Materials.Silicon}, new int[] {100 * 100, 75 * 100, 80 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(CombType.GROSSULAR, new Materials[] {Materials.Grossular, Materials.Aluminium, Materials.Silicon}, new int[] {100 * 100, 75 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - } - - // Metals Line - addProcessGT(CombType.SLAG, new Materials[] {Materials.Limestone}, Voltage.LV); - addProcessGT(CombType.COPPER, new Materials[] {Materials.Copper}, Voltage.LV); - addProcessGT(CombType.TIN, new Materials[] {Materials.Tin}, Voltage.LV); - addProcessGT(CombType.LEAD, new Materials[] {Materials.Lead}, Voltage.LV); + + // Gem Line + addProcessGT(CombType.STONE, new Materials[] {Materials.Soapstone}, Voltage.LV); + addProcessGT(CombType.CERTUS, new Materials[] {Materials.CertusQuartz}, Voltage.LV); + addProcessGT(CombType.FLUIX, new Materials[] {Materials.Fluix}, Voltage.LV); + addProcessGT(CombType.REDSTONE, new Materials[] {Materials.Redstone}, Voltage.LV); + addCentrifugeToMaterial( + CombType.RAREEARTH, + new Materials[] {Materials.RareEarth}, + new int[] {100 * 100}, + new int[] {1}, + Voltage.ULV, + NI, + 30 * 100); + addProcessGT(CombType.LAPIS, new Materials[] {Materials.Lapis}, Voltage.LV); + addProcessGT(CombType.RUBY, new Materials[] {Materials.Ruby}, Voltage.LV); + addProcessGT(CombType.REDGARNET, new Materials[] {Materials.GarnetRed}, Voltage.LV); + addProcessGT(CombType.YELLOWGARNET, new Materials[] {Materials.GarnetYellow}, Voltage.LV); + addProcessGT(CombType.SAPPHIRE, new Materials[] {Materials.Sapphire}, Voltage.LV); + addProcessGT(CombType.DIAMOND, new Materials[] {Materials.Diamond}, Voltage.LV); + addProcessGT(CombType.OLIVINE, new Materials[] {Materials.Olivine}, Voltage.LV); + addProcessGT(CombType.EMERALD, new Materials[] {Materials.Emerald}, Voltage.LV); + addProcessGT(CombType.FIRESTONE, new Materials[] {Materials.Firestone}, Voltage.LV); + addProcessGT(CombType.PYROPE, new Materials[] {Materials.Pyrope}, Voltage.LV); + addProcessGT(CombType.GROSSULAR, new Materials[] {Materials.Grossular}, Voltage.LV); + if (GT_Mod.gregtechproxy.mNerfedCombs) { + addCentrifugeToMaterial( + CombType.STONE, + new Materials[] { + Materials.Stone, + Materials.GraniteBlack, + Materials.GraniteRed, + Materials.Basalt, + Materials.Marble, + Materials.Redrock + }, + new int[] {70 * 100, 50 * 100, 50 * 100, 50 * 100, 50 * 100, 50 * 100}, + new int[] {9, 9, 9, 9, 9, 9}, + Voltage.ULV, + NI, + 50 * 100); + addCentrifugeToMaterial( + CombType.FLUIX, + new Materials[] {Materials.Fluix}, + new int[] {25 * 100}, + new int[] {9}, + Voltage.ULV, + NI, + 30 * 100); + } else { + addCentrifugeToMaterial( + CombType.STONE, + new Materials[] { + Materials.Soapstone, + Materials.Talc, + Materials.Apatite, + Materials.Phosphate, + Materials.TricalciumPhosphate + }, + new int[] {95 * 100, 90 * 100, 80 * 100, 75 * 100, 75 * 100}, + new int[] {}, + Voltage.ULV, + NI, + 50 * 100); + addCentrifugeToMaterial( + CombType.CERTUS, + new Materials[] {Materials.CertusQuartz, Materials.Quartzite, Materials.Barite}, + new int[] {100 * 100, 80 * 100, 75 * 100}, + new int[] {}, + Voltage.ULV, + NI, + 50 * 100); + addCentrifugeToMaterial( + CombType.FLUIX, + new Materials[] {Materials.Fluix, Materials.Redstone, Materials.CertusQuartz, Materials.NetherQuartz + }, + new int[] {25 * 100, 90 * 100, 90 * 100, 90 * 100}, + new int[] {9, 1, 1, 1}, + Voltage.ULV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.REDSTONE, + new Materials[] {Materials.Redstone, Materials.Cinnabar}, + new int[] {100 * 100, 80 * 100}, + new int[] {}, + Voltage.ULV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.LAPIS, + new Materials[] {Materials.Lapis, Materials.Sodalite, Materials.Lazurite, Materials.Calcite}, + new int[] {100 * 100, 90 * 100, 90 * 100, 85 * 100}, + new int[] {}, + Voltage.ULV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.RUBY, + new Materials[] {Materials.Ruby, Materials.Redstone}, + new int[] {100 * 100, 90 * 100}, + new int[] {}, + Voltage.ULV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.REDGARNET, + new Materials[] {Materials.GarnetRed, Materials.GarnetYellow}, + new int[] {100 * 100, 75 * 100}, + new int[] {}, + Voltage.ULV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.YELLOWGARNET, + new Materials[] {Materials.GarnetYellow, Materials.GarnetRed}, + new int[] {100 * 100, 75 * 100}, + new int[] {}, + Voltage.ULV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.SAPPHIRE, + new Materials[] {Materials.Sapphire, Materials.GreenSapphire, Materials.Almandine, Materials.Pyrope + }, + new int[] {100 * 100, 90 * 100, 90 * 100, 75 * 100}, + new int[] {}, + Voltage.ULV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.DIAMOND, + new Materials[] {Materials.Diamond, Materials.Graphite}, + new int[] {100 * 100, 75 * 100}, + new int[] {}, + Voltage.ULV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.OLIVINE, + new Materials[] {Materials.Olivine, Materials.Bentonite, Materials.Magnesite, Materials.Glauconite}, + new int[] {100 * 100, 90 * 100, 80 * 100, 75 * 100}, + new int[] {}, + Voltage.ULV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.EMERALD, + new Materials[] {Materials.Emerald, Materials.Beryllium, Materials.Thorium}, + new int[] {100 * 100, 85 * 100, 75 * 100}, + new int[] {}, + Voltage.ULV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.FIRESTONE, + new Materials[] {Materials.Firestone}, + new int[] {100 * 100}, + new int[] {}, + Voltage.ULV, + ItemList.FR_RefractoryWax.get(1), + 30 * 100); + addCentrifugeToMaterial( + CombType.PYROPE, + new Materials[] {Materials.Pyrope, Materials.Aluminium, Materials.Magnesium, Materials.Silicon}, + new int[] {100 * 100, 75 * 100, 80 * 100, 75 * 100}, + new int[] {}, + Voltage.ULV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.GROSSULAR, + new Materials[] {Materials.Grossular, Materials.Aluminium, Materials.Silicon}, + new int[] {100 * 100, 75 * 100, 75 * 100}, + new int[] {}, + Voltage.ULV, + NI, + 30 * 100); + } + + // Metals Line + addProcessGT(CombType.SLAG, new Materials[] {Materials.Limestone}, Voltage.LV); + addProcessGT(CombType.COPPER, new Materials[] {Materials.Copper}, Voltage.LV); + addProcessGT(CombType.TIN, new Materials[] {Materials.Tin}, Voltage.LV); + addProcessGT(CombType.LEAD, new Materials[] {Materials.Lead}, Voltage.LV); addProcessGT(CombType.INDIUM, new Materials[] {Materials.Indium}, Voltage.ZPM); - addProcessGT(CombType.NICKEL, new Materials[] {Materials.Nickel}, Voltage.LV); - addProcessGT(CombType.ZINC, new Materials[] {Materials.Zinc}, Voltage.LV); - addProcessGT(CombType.SILVER, new Materials[] {Materials.Silver}, Voltage.LV); - addProcessGT(CombType.CRYOLITE, new Materials[] {Materials.Cryolite}, Voltage.LV); - addProcessGT(CombType.GOLD, new Materials[] {Materials.Gold}, Voltage.LV); - addProcessGT(CombType.SULFUR, new Materials[] {Materials.Sulfur}, Voltage.LV); - addProcessGT(CombType.GALLIUM, new Materials[] {Materials.Gallium}, Voltage.LV); - addProcessGT(CombType.ARSENIC, new Materials[] {Materials.Arsenic}, Voltage.LV); - if (ProcessingModSupport.aEnableGCMarsMats) { - addProcessGT(CombType.IRON, new Materials[] {Materials.Iron}, Voltage.LV); - addProcessGT(CombType.STEEL, new Materials[] {Materials.Steel}, Voltage.LV); - }else { - addProcessGT(CombType.IRON, new Materials[] {Materials.Iron}, Voltage.LV); - addProcessGT(CombType.STEEL, new Materials[] {Materials.Steel}, Voltage.LV); - } - if(GT_Mod.gregtechproxy.mNerfedCombs) { - addCentrifugeToMaterial(CombType.SLAG, new Materials[] {Materials.Stone, Materials.GraniteBlack, Materials.GraniteRed}, new int[] {50 * 100, 20 * 100, 20 * 100}, new int[] { 9, 9, 9}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(CombType.COPPER, new Materials[] {Materials.Copper}, new int[] {70 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(CombType.TIN, new Materials[] {Materials.Tin}, new int[] {60 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(CombType.LEAD, new Materials[] {Materials.Lead}, new int[] {45 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(CombType.IRON, new Materials[] {Materials.Iron}, new int[] {30 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(CombType.STEEL, new Materials[] {Materials.Steel}, new int[] {40 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(CombType.SILVER, new Materials[] {Materials.Silver}, new int[] {80 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(CombType.CRYOLITE, new Materials[] {Materials.Cryolite}, new int[] {80 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(CombType.SULFUR, new Materials[] {Materials.Sulfur}, new int[] {100 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - }else { - addCentrifugeToMaterial(CombType.SLAG, new Materials[] {Materials.Salt, Materials.RockSalt, Materials.Lepidolite, Materials.Spodumene, Materials.Monazite}, new int[] {100 * 100, 100 * 100, 100 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(CombType.COPPER, new Materials[] {Materials.Copper, Materials.Tetrahedrite, Materials.Chalcopyrite, Materials.Malachite, Materials.Pyrite, Materials.Stibnite}, new int[] {100 * 100, 85 * 100, 95 * 100, 80 * 100, 75 * 100, 65 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(CombType.TIN, new Materials[] {Materials.Tin, Materials.Cassiterite, Materials.CassiteriteSand}, new int[] {100 * 100, 85 * 100, 65 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(CombType.LEAD, new Materials[] {Materials.Lead, Materials.Galena}, new int[] {100 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - if (ProcessingModSupport.aEnableGCMarsMats) { - addCentrifugeToMaterial(CombType.IRON, new Materials[] {Materials.Iron, Materials.Magnetite, Materials.BrownLimonite, Materials.YellowLimonite, Materials.VanadiumMagnetite, Materials.MeteoricIron}, new int[] {100 * 100, 90 * 100, 85 * 100, 85 * 100, 80 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(CombType.LEAD, new Materials[] {Materials.Steel, Materials.Magnetite, Materials.VanadiumMagnetite, Materials.Molybdenite, Materials.Molybdenum, Materials.MeteoricIron }, new int[] {100 * 100, 90 * 100, 80 * 100, 65 * 100, 65 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - }else { - addCentrifugeToMaterial(CombType.IRON, new Materials[] {Materials.Iron, Materials.Magnetite, Materials.BrownLimonite, Materials.YellowLimonite, Materials.VanadiumMagnetite, Materials.BandedIron}, new int[] {100 * 100, 90 * 100, 85 * 100, 85 * 100, 80 * 100, 85 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(CombType.STEEL, new Materials[] {Materials.Steel, Materials.Magnetite, Materials.VanadiumMagnetite, Materials.BandedIron, Materials.Molybdenite, Materials.Molybdenum }, new int[] {100 * 100, 90 * 100, 80 * 100, 85 * 100, 65 * 100, 65 * 100 }, new int[] {}, Voltage.ULV, NI, 30 * 100); - } - addCentrifugeToMaterial(CombType.NICKEL, new Materials[] {Materials.Nickel, Materials.Garnierite, Materials.Pentlandite, Materials.Cobaltite, Materials.Wulfenite, Materials.Powellite}, new int[] {100 * 100, 85 * 100, 85 * 100, 80 * 100, 75 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(CombType.ZINC, new Materials[] {Materials.Zinc, Materials.Sphalerite, Materials.Sulfur}, new int[] {100 * 100, 80 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(CombType.SILVER, new Materials[] {Materials.Silver, Materials.Galena}, new int[] {100 * 100, 80 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(CombType.CRYOLITE, new Materials[] {Materials.Cryolite, Materials.Silver}, new int[] {100 * 100, 80 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(CombType.GOLD, new Materials[] {Materials.Gold}, new int[] {100 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(CombType.SULFUR, new Materials[] {Materials.Sulfur, Materials.Pyrite, Materials.Sphalerite}, new int[] {100 * 100, 90 * 100, 80 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(CombType.GALLIUM, new Materials[] {Materials.Gallium, Materials.Niobium}, new int[] { 80 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(CombType.ARSENIC, new Materials[] {Materials.Arsenic, Materials.Bismuth, Materials.Antimony}, new int[] {80 * 100, 70 * 100, 70 * 100}, new int[] {}, Voltage.ULV , NI, 30 * 100); - } - - // Rare Metals Line - addProcessGT(CombType.BAUXITE, new Materials[] {Materials.Bauxite}, Voltage.LV); - addProcessGT(CombType.ALUMINIUM, new Materials[] {Materials.Aluminium}, Voltage.LV); - addProcessGT(CombType.MANGANESE, new Materials[] {Materials.Manganese}, Voltage.LV); - addProcessGT(CombType.TITANIUM, new Materials[] {Materials.Titanium}, Voltage.EV); - addProcessGT(CombType.MAGNESIUM, new Materials[] {Materials.Magnesium}, Voltage.LV); - addProcessGT(CombType.CHROME, new Materials[] {Materials.Chrome}, Voltage.HV); - addProcessGT(CombType.TUNGSTEN, new Materials[] {Materials.Tungsten}, Voltage.IV); - addProcessGT(CombType.PLATINUM, new Materials[] {Materials.Platinum}, Voltage.HV); - addProcessGT(CombType.MOLYBDENUM, new Materials[] {Materials.Molybdenum}, Voltage.LV); - addAutoclaveProcess(CombType.MOLYBDENUM, Materials.Osmium, Voltage.IV, 5); - addProcessGT(CombType.IRIDIUM, new Materials[] {Materials.Iridium}, Voltage.IV); - addProcessGT(CombType.OSMIUM, new Materials[] {Materials.Osmium}, Voltage.IV); - addProcessGT(CombType.LITHIUM, new Materials[] {Materials.Lithium}, Voltage.MV); - addProcessGT(CombType.ELECTROTINE, new Materials[] {Materials.Electrotine}, Voltage.MV); - if(GT_Mod.gregtechproxy.mNerfedCombs) { - addCentrifugeToItemStack(CombType.SALT, new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Salt, 6), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.RockSalt, 6), ItemList.FR_Wax.get(1), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Saltpeter, 6)}, new int[] {100 * 100, 100 * 100, 50 * 100, 25 * 100}, Voltage.MV, 160); }else { - addCentrifugeToMaterial(CombType.BAUXITE, new Materials[] {Materials.Bauxite, Materials.Aluminium}, new int[] { 75 * 100, 55 * 100}, new int[] {}, Voltage.ULV , NI, 30 * 100); - addCentrifugeToMaterial(CombType.ALUMINIUM, new Materials[] {Materials.Aluminium, Materials.Bauxite}, new int[] { 60 * 100, 80 * 100}, new int[] {}, Voltage.ULV , NI, 30 * 100); - addCentrifugeToMaterial(CombType.MANGANESE, new Materials[] {Materials.Manganese, Materials.Grossular, Materials.Spessartine, Materials.Pyrolusite, Materials.Tantalite}, new int[] { 30 * 100, 100 * 100, 100 * 100, 100 * 100, 100 * 100}, new int[] {}, Voltage.ULV , NI, 30 * 100); - addCentrifugeToMaterial(CombType.TITANIUM, new Materials[] {Materials.Titanium, Materials.Ilmenite, Materials.Bauxite, Materials.Rutile}, new int[] { 90 * 100, 80 * 100, 75 * 100, 75 * 100}, new int[] {}, Voltage.EV, NI, 30 * 100); - addCentrifugeToMaterial(CombType.MAGNESIUM, new Materials[] {Materials.Magnesium, Materials.Magnesite}, new int[] { 100 * 100, 80 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(CombType.CHROME, new Materials[] {Materials.Chrome, Materials.Ruby, Materials.Chromite, Materials.Redstone, Materials.Neodymium, Materials.Bastnasite}, new int[] { 50 * 100, 100 * 100, 50 * 100, 100 * 100, 80 * 100, 80 * 100}, new int[] {}, Voltage.HV, NI, 30 * 100); - addCentrifugeToMaterial(CombType.TUNGSTEN, new Materials[] {Materials.Tungsten, Materials.Tungstate, Materials.Scheelite, Materials.Lithium}, new int[] { 50 * 100, 80 * 100, 75 * 100, 75 * 100}, new int[] {}, Voltage.IV, NI, 30 * 100); - addCentrifugeToMaterial(CombType.PLATINUM, new Materials[] {Materials.Platinum, Materials.Cooperite, Materials.Palladium}, new int[] { 40 * 100, 40 * 100, 40 * 100}, new int[] {}, Voltage.HV, NI, 30 * 100); - addCentrifugeToMaterial(CombType.MOLYBDENUM, new Materials[] {Materials.Molybdenum, Materials.Molybdenite, Materials.Powellite, Materials.Wulfenite}, new int[] { 100 * 100, 80 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(CombType.IRIDIUM, new Materials[] {Materials.Iridium, Materials.Osmium}, new int[] { 20 * 100, 15 * 100}, new int[] {}, Voltage.IV, NI, 30 * 100); - addCentrifugeToMaterial(CombType.OSMIUM, new Materials[] {Materials.Osmium, Materials.Iridium}, new int[] { 25 * 100, 15 * 100}, new int[] {}, Voltage.IV, NI, 30 * 100); - addCentrifugeToMaterial(CombType.LITHIUM, new Materials[] {Materials.Lithium, Materials.Aluminium}, new int[] { 85 * 100, 75 * 100}, new int[] {}, Voltage.MV, NI, 30 * 100); - addCentrifugeToItemStack(CombType.SALT, new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Salt, 6), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.RockSalt, 6), ItemList.FR_Wax.get(1), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Saltpeter, 6)}, new int[] {100 * 100, 100 * 100, 50 * 100, 25 * 100}, Voltage.MV, 160); + addProcessGT(CombType.NICKEL, new Materials[] {Materials.Nickel}, Voltage.LV); + addProcessGT(CombType.ZINC, new Materials[] {Materials.Zinc}, Voltage.LV); + addProcessGT(CombType.SILVER, new Materials[] {Materials.Silver}, Voltage.LV); + addProcessGT(CombType.CRYOLITE, new Materials[] {Materials.Cryolite}, Voltage.LV); + addProcessGT(CombType.GOLD, new Materials[] {Materials.Gold}, Voltage.LV); + addProcessGT(CombType.SULFUR, new Materials[] {Materials.Sulfur}, Voltage.LV); + addProcessGT(CombType.GALLIUM, new Materials[] {Materials.Gallium}, Voltage.LV); + addProcessGT(CombType.ARSENIC, new Materials[] {Materials.Arsenic}, Voltage.LV); + if (ProcessingModSupport.aEnableGCMarsMats) { + addProcessGT(CombType.IRON, new Materials[] {Materials.Iron}, Voltage.LV); + addProcessGT(CombType.STEEL, new Materials[] {Materials.Steel}, Voltage.LV); + } else { + addProcessGT(CombType.IRON, new Materials[] {Materials.Iron}, Voltage.LV); + addProcessGT(CombType.STEEL, new Materials[] {Materials.Steel}, Voltage.LV); + } + if (GT_Mod.gregtechproxy.mNerfedCombs) { + addCentrifugeToMaterial( + CombType.SLAG, + new Materials[] {Materials.Stone, Materials.GraniteBlack, Materials.GraniteRed}, + new int[] {50 * 100, 20 * 100, 20 * 100}, + new int[] {9, 9, 9}, + Voltage.ULV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.COPPER, + new Materials[] {Materials.Copper}, + new int[] {70 * 100}, + new int[] {}, + Voltage.ULV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.TIN, + new Materials[] {Materials.Tin}, + new int[] {60 * 100}, + new int[] {}, + Voltage.ULV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.LEAD, + new Materials[] {Materials.Lead}, + new int[] {45 * 100}, + new int[] {}, + Voltage.ULV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.IRON, + new Materials[] {Materials.Iron}, + new int[] {30 * 100}, + new int[] {}, + Voltage.ULV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.STEEL, + new Materials[] {Materials.Steel}, + new int[] {40 * 100}, + new int[] {}, + Voltage.ULV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.SILVER, + new Materials[] {Materials.Silver}, + new int[] {80 * 100}, + new int[] {}, + Voltage.ULV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.CRYOLITE, + new Materials[] {Materials.Cryolite}, + new int[] {80 * 100}, + new int[] {}, + Voltage.ULV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.SULFUR, + new Materials[] {Materials.Sulfur}, + new int[] {100 * 100}, + new int[] {}, + Voltage.ULV, + NI, + 30 * 100); + } else { + addCentrifugeToMaterial( + CombType.SLAG, + new Materials[] { + Materials.Salt, + Materials.RockSalt, + Materials.Lepidolite, + Materials.Spodumene, + Materials.Monazite + }, + new int[] {100 * 100, 100 * 100, 100 * 100}, + new int[] {}, + Voltage.ULV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.COPPER, + new Materials[] { + Materials.Copper, + Materials.Tetrahedrite, + Materials.Chalcopyrite, + Materials.Malachite, + Materials.Pyrite, + Materials.Stibnite + }, + new int[] {100 * 100, 85 * 100, 95 * 100, 80 * 100, 75 * 100, 65 * 100}, + new int[] {}, + Voltage.ULV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.TIN, + new Materials[] {Materials.Tin, Materials.Cassiterite, Materials.CassiteriteSand}, + new int[] {100 * 100, 85 * 100, 65 * 100}, + new int[] {}, + Voltage.ULV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.LEAD, + new Materials[] {Materials.Lead, Materials.Galena}, + new int[] {100 * 100, 75 * 100}, + new int[] {}, + Voltage.ULV, + NI, + 30 * 100); + if (ProcessingModSupport.aEnableGCMarsMats) { + addCentrifugeToMaterial( + CombType.IRON, + new Materials[] { + Materials.Iron, + Materials.Magnetite, + Materials.BrownLimonite, + Materials.YellowLimonite, + Materials.VanadiumMagnetite, + Materials.MeteoricIron + }, + new int[] {100 * 100, 90 * 100, 85 * 100, 85 * 100, 80 * 100, 75 * 100}, + new int[] {}, + Voltage.ULV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.LEAD, + new Materials[] { + Materials.Steel, + Materials.Magnetite, + Materials.VanadiumMagnetite, + Materials.Molybdenite, + Materials.Molybdenum, + Materials.MeteoricIron + }, + new int[] {100 * 100, 90 * 100, 80 * 100, 65 * 100, 65 * 100, 75 * 100}, + new int[] {}, + Voltage.ULV, + NI, + 30 * 100); + } else { + addCentrifugeToMaterial( + CombType.IRON, + new Materials[] { + Materials.Iron, + Materials.Magnetite, + Materials.BrownLimonite, + Materials.YellowLimonite, + Materials.VanadiumMagnetite, + Materials.BandedIron + }, + new int[] {100 * 100, 90 * 100, 85 * 100, 85 * 100, 80 * 100, 85 * 100}, + new int[] {}, + Voltage.ULV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.STEEL, + new Materials[] { + Materials.Steel, + Materials.Magnetite, + Materials.VanadiumMagnetite, + Materials.BandedIron, + Materials.Molybdenite, + Materials.Molybdenum + }, + new int[] {100 * 100, 90 * 100, 80 * 100, 85 * 100, 65 * 100, 65 * 100}, + new int[] {}, + Voltage.ULV, + NI, + 30 * 100); + } + addCentrifugeToMaterial( + CombType.NICKEL, + new Materials[] { + Materials.Nickel, + Materials.Garnierite, + Materials.Pentlandite, + Materials.Cobaltite, + Materials.Wulfenite, + Materials.Powellite + }, + new int[] {100 * 100, 85 * 100, 85 * 100, 80 * 100, 75 * 100, 75 * 100}, + new int[] {}, + Voltage.ULV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.ZINC, + new Materials[] {Materials.Zinc, Materials.Sphalerite, Materials.Sulfur}, + new int[] {100 * 100, 80 * 100, 75 * 100}, + new int[] {}, + Voltage.ULV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.SILVER, + new Materials[] {Materials.Silver, Materials.Galena}, + new int[] {100 * 100, 80 * 100}, + new int[] {}, + Voltage.ULV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.CRYOLITE, + new Materials[] {Materials.Cryolite, Materials.Silver}, + new int[] {100 * 100, 80 * 100}, + new int[] {}, + Voltage.ULV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.GOLD, + new Materials[] {Materials.Gold}, + new int[] {100 * 100}, + new int[] {}, + Voltage.ULV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.SULFUR, + new Materials[] {Materials.Sulfur, Materials.Pyrite, Materials.Sphalerite}, + new int[] {100 * 100, 90 * 100, 80 * 100}, + new int[] {}, + Voltage.ULV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.GALLIUM, + new Materials[] {Materials.Gallium, Materials.Niobium}, + new int[] {80 * 100, 75 * 100}, + new int[] {}, + Voltage.ULV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.ARSENIC, + new Materials[] {Materials.Arsenic, Materials.Bismuth, Materials.Antimony}, + new int[] {80 * 100, 70 * 100, 70 * 100}, + new int[] {}, + Voltage.ULV, + NI, + 30 * 100); + } + + // Rare Metals Line + addProcessGT(CombType.BAUXITE, new Materials[] {Materials.Bauxite}, Voltage.LV); + addProcessGT(CombType.ALUMINIUM, new Materials[] {Materials.Aluminium}, Voltage.LV); + addProcessGT(CombType.MANGANESE, new Materials[] {Materials.Manganese}, Voltage.LV); + addProcessGT(CombType.TITANIUM, new Materials[] {Materials.Titanium}, Voltage.EV); + addProcessGT(CombType.MAGNESIUM, new Materials[] {Materials.Magnesium}, Voltage.LV); + addProcessGT(CombType.CHROME, new Materials[] {Materials.Chrome}, Voltage.HV); + addProcessGT(CombType.TUNGSTEN, new Materials[] {Materials.Tungsten}, Voltage.IV); + addProcessGT(CombType.PLATINUM, new Materials[] {Materials.Platinum}, Voltage.HV); + addProcessGT(CombType.MOLYBDENUM, new Materials[] {Materials.Molybdenum}, Voltage.LV); + addAutoclaveProcess(CombType.MOLYBDENUM, Materials.Osmium, Voltage.IV, 5); + addProcessGT(CombType.IRIDIUM, new Materials[] {Materials.Iridium}, Voltage.IV); + addProcessGT(CombType.OSMIUM, new Materials[] {Materials.Osmium}, Voltage.IV); + addProcessGT(CombType.LITHIUM, new Materials[] {Materials.Lithium}, Voltage.MV); + addProcessGT(CombType.ELECTROTINE, new Materials[] {Materials.Electrotine}, Voltage.MV); + if (GT_Mod.gregtechproxy.mNerfedCombs) { + addCentrifugeToItemStack( + CombType.SALT, + new ItemStack[] { + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Salt, 6), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.RockSalt, 6), + ItemList.FR_Wax.get(1), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Saltpeter, 6) + }, + new int[] {100 * 100, 100 * 100, 50 * 100, 25 * 100}, + Voltage.MV, + 160); + } else { + addCentrifugeToMaterial( + CombType.BAUXITE, + new Materials[] {Materials.Bauxite, Materials.Aluminium}, + new int[] {75 * 100, 55 * 100}, + new int[] {}, + Voltage.ULV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.ALUMINIUM, + new Materials[] {Materials.Aluminium, Materials.Bauxite}, + new int[] {60 * 100, 80 * 100}, + new int[] {}, + Voltage.ULV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.MANGANESE, + new Materials[] { + Materials.Manganese, + Materials.Grossular, + Materials.Spessartine, + Materials.Pyrolusite, + Materials.Tantalite + }, + new int[] {30 * 100, 100 * 100, 100 * 100, 100 * 100, 100 * 100}, + new int[] {}, + Voltage.ULV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.TITANIUM, + new Materials[] {Materials.Titanium, Materials.Ilmenite, Materials.Bauxite, Materials.Rutile}, + new int[] {90 * 100, 80 * 100, 75 * 100, 75 * 100}, + new int[] {}, + Voltage.EV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.MAGNESIUM, + new Materials[] {Materials.Magnesium, Materials.Magnesite}, + new int[] {100 * 100, 80 * 100}, + new int[] {}, + Voltage.ULV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.CHROME, + new Materials[] { + Materials.Chrome, + Materials.Ruby, + Materials.Chromite, + Materials.Redstone, + Materials.Neodymium, + Materials.Bastnasite + }, + new int[] {50 * 100, 100 * 100, 50 * 100, 100 * 100, 80 * 100, 80 * 100}, + new int[] {}, + Voltage.HV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.TUNGSTEN, + new Materials[] {Materials.Tungsten, Materials.Tungstate, Materials.Scheelite, Materials.Lithium}, + new int[] {50 * 100, 80 * 100, 75 * 100, 75 * 100}, + new int[] {}, + Voltage.IV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.PLATINUM, + new Materials[] {Materials.Platinum, Materials.Cooperite, Materials.Palladium}, + new int[] {40 * 100, 40 * 100, 40 * 100}, + new int[] {}, + Voltage.HV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.MOLYBDENUM, + new Materials[] { + Materials.Molybdenum, Materials.Molybdenite, Materials.Powellite, Materials.Wulfenite + }, + new int[] {100 * 100, 80 * 100, 75 * 100}, + new int[] {}, + Voltage.ULV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.IRIDIUM, + new Materials[] {Materials.Iridium, Materials.Osmium}, + new int[] {20 * 100, 15 * 100}, + new int[] {}, + Voltage.IV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.OSMIUM, + new Materials[] {Materials.Osmium, Materials.Iridium}, + new int[] {25 * 100, 15 * 100}, + new int[] {}, + Voltage.IV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.LITHIUM, + new Materials[] {Materials.Lithium, Materials.Aluminium}, + new int[] {85 * 100, 75 * 100}, + new int[] {}, + Voltage.MV, + NI, + 30 * 100); + addCentrifugeToItemStack( + CombType.SALT, + new ItemStack[] { + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Salt, 6), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.RockSalt, 6), + ItemList.FR_Wax.get(1), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Saltpeter, 6) + }, + new int[] {100 * 100, 100 * 100, 50 * 100, 25 * 100}, + Voltage.MV, + 160); + } + + // Radioactive Line + addProcessGT(CombType.ALMANDINE, new Materials[] {Materials.Almandine}, Voltage.LV); + addProcessGT(CombType.URANIUM, new Materials[] {Materials.Uranium}, Voltage.EV); + addProcessGT(CombType.PLUTONIUM, new Materials[] {Materials.Plutonium}, Voltage.EV); + addProcessGT(CombType.NAQUADAH, new Materials[] {Materials.Naquadah}, Voltage.IV); + addProcessGT(CombType.NAQUADRIA, new Materials[] {Materials.Naquadria}, Voltage.LUV); + addProcessGT(CombType.THORIUM, new Materials[] {Materials.Thorium}, Voltage.EV); + addProcessGT(CombType.LUTETIUM, new Materials[] {Materials.Lutetium}, Voltage.IV); + addProcessGT(CombType.AMERICIUM, new Materials[] {Materials.Americium}, Voltage.LUV); + addProcessGT(CombType.NEUTRONIUM, new Materials[] {Materials.Neutronium}, Voltage.UHV); + if (!GT_Mod.gregtechproxy.mNerfedCombs) { + addCentrifugeToMaterial( + CombType.ALMANDINE, + new Materials[] {Materials.Almandine, Materials.Pyrope, Materials.Sapphire, Materials.GreenSapphire + }, + new int[] {90 * 100, 80 * 100, 75 * 100, 75 * 100}, + new int[] {}, + Voltage.ULV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.URANIUM, + new Materials[] {Materials.Uranium, Materials.Pitchblende, Materials.Uraninite, Materials.Uranium235 + }, + new int[] {50 * 100, 65 * 100, 75 * 100, 50 * 100}, + new int[] {}, + Voltage.EV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.PLUTONIUM, + new Materials[] {Materials.Plutonium, Materials.Uranium235}, + new int[] {10, 5}, + new int[] {}, + Voltage.EV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.NAQUADAH, + new Materials[] {Materials.Naquadah, Materials.NaquadahEnriched, Materials.Naquadria}, + new int[] {10 * 100, 5 * 100, 5 * 100}, + new int[] {}, + Voltage.IV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.NAQUADRIA, + new Materials[] {Materials.Naquadria, Materials.NaquadahEnriched, Materials.Naquadah}, + new int[] {10 * 100, 10 * 100, 15 * 100}, + new int[] {}, + Voltage.LUV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.THORIUM, + new Materials[] {Materials.Thorium, Materials.Uranium, Materials.Coal}, + new int[] {75 * 100, 75 * 100 * 100, 95 * 100}, + new int[] {}, + Voltage.EV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.LUTETIUM, + new Materials[] {Materials.Lutetium, Materials.Thorium}, + new int[] {35 * 100, 55 * 100}, + new int[] {}, + Voltage.IV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.AMERICIUM, + new Materials[] {Materials.Americium, Materials.Lutetium}, + new int[] {25 * 100, 45 * 100}, + new int[] {}, + Voltage.LUV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.NEUTRONIUM, + new Materials[] {Materials.Neutronium, Materials.Americium}, + new int[] {15 * 100, 35 * 100}, + new int[] {}, + Voltage.UHV, + NI, + 30 * 100); } - //Radioactive Line - addProcessGT(CombType.ALMANDINE, new Materials[] {Materials.Almandine}, Voltage.LV); - addProcessGT(CombType.URANIUM, new Materials[] {Materials.Uranium}, Voltage.EV); - addProcessGT(CombType.PLUTONIUM,new Materials[] {Materials.Plutonium}, Voltage.EV); - addProcessGT(CombType.NAQUADAH,new Materials[] {Materials.Naquadah}, Voltage.IV); - addProcessGT(CombType.NAQUADRIA,new Materials[] {Materials.Naquadria}, Voltage.LUV); - addProcessGT(CombType.THORIUM,new Materials[] {Materials.Thorium}, Voltage.EV); - addProcessGT(CombType.LUTETIUM,new Materials[] {Materials.Lutetium}, Voltage.IV); - addProcessGT(CombType.AMERICIUM,new Materials[] {Materials.Americium}, Voltage.LUV); - addProcessGT(CombType.NEUTRONIUM,new Materials[] {Materials.Neutronium}, Voltage.UHV); - if(!GT_Mod.gregtechproxy.mNerfedCombs) { - addCentrifugeToMaterial(CombType.ALMANDINE, new Materials[] {Materials.Almandine, Materials.Pyrope, Materials.Sapphire, Materials.GreenSapphire}, new int[] { 90 * 100, 80 * 100, 75 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(CombType.URANIUM, new Materials[] {Materials.Uranium, Materials.Pitchblende, Materials.Uraninite, Materials.Uranium235}, new int[] { 50 * 100, 65 * 100, 75 * 100, 50 * 100}, new int[] {}, Voltage.EV, NI, 30 * 100); - addCentrifugeToMaterial(CombType.PLUTONIUM,new Materials[] {Materials.Plutonium, Materials.Uranium235}, new int[] {10, 5}, new int[] {}, Voltage.EV, NI, 30 * 100); - addCentrifugeToMaterial(CombType.NAQUADAH,new Materials[] {Materials.Naquadah, Materials.NaquadahEnriched, Materials.Naquadria}, new int[] {10 * 100, 5 * 100, 5 * 100}, new int[] {}, Voltage.IV, NI, 30 * 100); - addCentrifugeToMaterial(CombType.NAQUADRIA,new Materials[] {Materials.Naquadria, Materials.NaquadahEnriched, Materials.Naquadah}, new int[] {10 * 100, 10 * 100, 15 * 100}, new int[] {}, Voltage.LUV, NI, 30 * 100); - addCentrifugeToMaterial(CombType.THORIUM,new Materials[] {Materials.Thorium, Materials.Uranium, Materials.Coal}, new int[] {75 * 100, 75 * 100 * 100, 95 * 100}, new int[] {}, Voltage.EV, NI, 30 * 100); - addCentrifugeToMaterial(CombType.LUTETIUM,new Materials[] {Materials.Lutetium, Materials.Thorium}, new int[] {35 * 100, 55 * 100}, new int[] {}, Voltage.IV, NI, 30 * 100); - addCentrifugeToMaterial(CombType.AMERICIUM,new Materials[] {Materials.Americium, Materials.Lutetium}, new int[] {25 * 100, 45 * 100}, new int[] {}, Voltage.LUV, NI, 30 * 100); - addCentrifugeToMaterial(CombType.NEUTRONIUM,new Materials[] {Materials.Neutronium, Materials.Americium}, new int[] {15 * 100, 35 * 100}, new int[] {}, Voltage.UHV, NI, 30 * 100); - } - - // Twilight - addCentrifugeToItemStack(CombType.NAGA, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 4), GT_ModHandler.getModItem(MOD_ID_DC, "item.NagaScaleChip", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.NagaScaleFragment", 1L, 0), ItemList.FR_Wax.get(1)}, new int[]{5 * 100, 33 * 100, 8 * 100, 30 * 100}, Voltage.MV); - addCentrifugeToItemStack(CombType.LICH, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 5), GT_ModHandler.getModItem(MOD_ID_DC, "item.LichBoneChip", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.LichBoneFragment", 1L, 0), ItemList.FR_Wax.get(1)}, new int[]{5 * 100, 33 * 100, 8 * 100, 30 * 100}, Voltage.HV); - addCentrifugeToItemStack(CombType.HYDRA, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 1), GT_ModHandler.getModItem(MOD_ID_DC, "item.FieryBloodDrop", 1L, 0), GT_Bees.drop.getStackForType(DropType.HYDRA), ItemList.FR_Wax.get(1)}, new int[]{5 * 100, 33 * 100, 8 * 100, 30 * 100}, Voltage.HV); - addCentrifugeToItemStack(CombType.URGHAST, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 2), GT_ModHandler.getModItem(MOD_ID_DC, "item.CarminiteChip", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.CarminiteFragment", 1L, 0), ItemList.FR_Wax.get(1)}, new int[]{5 * 100, 33 * 100, 8 * 100, 30 * 100}, Voltage.EV); - addCentrifugeToItemStack(CombType.SNOWQUEEN, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 3), GT_ModHandler.getModItem(MOD_ID_DC, "item.SnowQueenBloodDrop", 1L, 0), GT_Bees.drop.getStackForType(DropType.SNOW_QUEEN), ItemList.FR_Wax.get(1)}, new int[]{5 * 100, 33 * 100, 8 * 100, 30 * 100}, Voltage.EV); - - // HEE - addCentrifugeToItemStack(CombType.ENDDUST, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), GT_Bees.propolis.getStackForType(PropolisType.End), GT_Bees.drop.getStackForType(DropType.ENDERGOO), }, new int[]{20 * 100, 15 * 100, 10 * 100}, Voltage.HV); - addCentrifugeToItemStack(CombType.STARDUST, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), GT_Bees.propolis.getStackForType(PropolisType.Stardust), GT_Bees.drop.getStackForType(DropType.ENDERGOO) }, new int[]{20 * 100, 15 * 100, 10 * 100}, Voltage.HV); - addCentrifugeToItemStack(CombType.ECTOPLASMA, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), GT_Bees.propolis.getStackForType(PropolisType.Ectoplasma), GT_Bees.drop.getStackForType(DropType.ENDERGOO) }, new int[]{25 * 100, 10 * 100, 15 * 100}, Voltage.EV); - addCentrifugeToItemStack(CombType.ARCANESHARD, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), GT_Bees.propolis.getStackForType(PropolisType.Arcaneshard), GT_Bees.drop.getStackForType(DropType.ENDERGOO) }, new int[]{25 * 100, 10 * 100, 15 * 100}, Voltage.EV); - addCentrifugeToItemStack(CombType.DRAGONESSENCE, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), GT_Bees.propolis.getStackForType(PropolisType.Dragonessence), GT_Bees.drop.getStackForType(DropType.ENDERGOO) }, new int[]{30 * 100, (int) (7.5 * 100), 20 * 100}, Voltage.IV); - addCentrifugeToItemStack(CombType.ENDERMAN, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), GT_Bees.propolis.getStackForType(PropolisType.Enderman), GT_Bees.drop.getStackForType(DropType.ENDERGOO) }, new int[]{3000, 750, 2000}, Voltage.IV); - addCentrifugeToItemStack(CombType.SILVERFISH, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), GT_Bees.propolis.getStackForType(PropolisType.Silverfish), GT_Bees.drop.getStackForType(DropType.ENDERGOO), new ItemStack(Items.spawn_egg, 1,60) }, new int[]{25 * 100, 10 * 100, 20 * 100, 15 * 100}, Voltage.EV); - addProcessGT(CombType.ENDIUM,new Materials[] {Materials.HeeEndium}, Voltage.HV); - if(!GT_Mod.gregtechproxy.mNerfedCombs) { - addCentrifugeToMaterial(CombType.ENDIUM,new Materials[] {Materials.HeeEndium}, new int[] {50 * 100}, new int[] {}, Voltage.HV, GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), 20 * 100); - } - addCentrifugeToItemStack(CombType.RUNEI, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.RuneOfPowerFragment", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.RuneOfAgilityFragment", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.RuneOfVigorFragment", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.RuneOfDefenseFragment", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.RuneOfMagicFragment", 1L, 0) }, new int[]{25 * 100, 5 * 100, 5 * 100, 5 * 100, 5 * 100, 5 * 100}, Voltage.IV); - addCentrifugeToItemStack(CombType.RUNEII, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.RuneOfVoidFragment", 1L, 0) }, new int[]{50 * 100, (int) (2.5 * 100)}, Voltage.IV); - addCentrifugeToItemStack(CombType.FIREESSENSE, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), GT_Bees.propolis.getStackForType(PropolisType.Fireessence), GT_Bees.drop.getStackForType(DropType.ENDERGOO) }, new int[]{30 * 100, (int) (7.5 * 100), 20 * 100}, Voltage.IV); - //Walrus Recipe + // Twilight + addCentrifugeToItemStack( + CombType.NAGA, + new ItemStack[] { + GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 4), + GT_ModHandler.getModItem(MOD_ID_DC, "item.NagaScaleChip", 1L, 0), + GT_ModHandler.getModItem(MOD_ID_DC, "item.NagaScaleFragment", 1L, 0), + ItemList.FR_Wax.get(1) + }, + new int[] {5 * 100, 33 * 100, 8 * 100, 30 * 100}, + Voltage.MV); + addCentrifugeToItemStack( + CombType.LICH, + new ItemStack[] { + GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 5), + GT_ModHandler.getModItem(MOD_ID_DC, "item.LichBoneChip", 1L, 0), + GT_ModHandler.getModItem(MOD_ID_DC, "item.LichBoneFragment", 1L, 0), + ItemList.FR_Wax.get(1) + }, + new int[] {5 * 100, 33 * 100, 8 * 100, 30 * 100}, + Voltage.HV); + addCentrifugeToItemStack( + CombType.HYDRA, + new ItemStack[] { + GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 1), + GT_ModHandler.getModItem(MOD_ID_DC, "item.FieryBloodDrop", 1L, 0), + GT_Bees.drop.getStackForType(DropType.HYDRA), + ItemList.FR_Wax.get(1) + }, + new int[] {5 * 100, 33 * 100, 8 * 100, 30 * 100}, + Voltage.HV); + addCentrifugeToItemStack( + CombType.URGHAST, + new ItemStack[] { + GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 2), + GT_ModHandler.getModItem(MOD_ID_DC, "item.CarminiteChip", 1L, 0), + GT_ModHandler.getModItem(MOD_ID_DC, "item.CarminiteFragment", 1L, 0), + ItemList.FR_Wax.get(1) + }, + new int[] {5 * 100, 33 * 100, 8 * 100, 30 * 100}, + Voltage.EV); + addCentrifugeToItemStack( + CombType.SNOWQUEEN, + new ItemStack[] { + GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 3), + GT_ModHandler.getModItem(MOD_ID_DC, "item.SnowQueenBloodDrop", 1L, 0), + GT_Bees.drop.getStackForType(DropType.SNOW_QUEEN), + ItemList.FR_Wax.get(1) + }, + new int[] {5 * 100, 33 * 100, 8 * 100, 30 * 100}, + Voltage.EV); + + // HEE + addCentrifugeToItemStack( + CombType.ENDDUST, + new ItemStack[] { + GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), + GT_Bees.propolis.getStackForType(PropolisType.End), + GT_Bees.drop.getStackForType(DropType.ENDERGOO), + }, + new int[] {20 * 100, 15 * 100, 10 * 100}, + Voltage.HV); + addCentrifugeToItemStack( + CombType.STARDUST, + new ItemStack[] { + GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), + GT_Bees.propolis.getStackForType(PropolisType.Stardust), + GT_Bees.drop.getStackForType(DropType.ENDERGOO) + }, + new int[] {20 * 100, 15 * 100, 10 * 100}, + Voltage.HV); + addCentrifugeToItemStack( + CombType.ECTOPLASMA, + new ItemStack[] { + GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), + GT_Bees.propolis.getStackForType(PropolisType.Ectoplasma), + GT_Bees.drop.getStackForType(DropType.ENDERGOO) + }, + new int[] {25 * 100, 10 * 100, 15 * 100}, + Voltage.EV); + addCentrifugeToItemStack( + CombType.ARCANESHARD, + new ItemStack[] { + GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), + GT_Bees.propolis.getStackForType(PropolisType.Arcaneshard), + GT_Bees.drop.getStackForType(DropType.ENDERGOO) + }, + new int[] {25 * 100, 10 * 100, 15 * 100}, + Voltage.EV); + addCentrifugeToItemStack( + CombType.DRAGONESSENCE, + new ItemStack[] { + GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), + GT_Bees.propolis.getStackForType(PropolisType.Dragonessence), + GT_Bees.drop.getStackForType(DropType.ENDERGOO) + }, + new int[] {30 * 100, (int) (7.5 * 100), 20 * 100}, + Voltage.IV); + addCentrifugeToItemStack( + CombType.ENDERMAN, + new ItemStack[] { + GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), + GT_Bees.propolis.getStackForType(PropolisType.Enderman), + GT_Bees.drop.getStackForType(DropType.ENDERGOO) + }, + new int[] {3000, 750, 2000}, + Voltage.IV); + addCentrifugeToItemStack( + CombType.SILVERFISH, + new ItemStack[] { + GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), + GT_Bees.propolis.getStackForType(PropolisType.Silverfish), + GT_Bees.drop.getStackForType(DropType.ENDERGOO), + new ItemStack(Items.spawn_egg, 1, 60) + }, + new int[] {25 * 100, 10 * 100, 20 * 100, 15 * 100}, + Voltage.EV); + addProcessGT(CombType.ENDIUM, new Materials[] {Materials.HeeEndium}, Voltage.HV); + if (!GT_Mod.gregtechproxy.mNerfedCombs) { + addCentrifugeToMaterial( + CombType.ENDIUM, + new Materials[] {Materials.HeeEndium}, + new int[] {50 * 100}, + new int[] {}, + Voltage.HV, + GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), + 20 * 100); + } + addCentrifugeToItemStack( + CombType.RUNEI, + new ItemStack[] { + GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), + GT_ModHandler.getModItem(MOD_ID_DC, "item.RuneOfPowerFragment", 1L, 0), + GT_ModHandler.getModItem(MOD_ID_DC, "item.RuneOfAgilityFragment", 1L, 0), + GT_ModHandler.getModItem(MOD_ID_DC, "item.RuneOfVigorFragment", 1L, 0), + GT_ModHandler.getModItem(MOD_ID_DC, "item.RuneOfDefenseFragment", 1L, 0), + GT_ModHandler.getModItem(MOD_ID_DC, "item.RuneOfMagicFragment", 1L, 0) + }, + new int[] {25 * 100, 5 * 100, 5 * 100, 5 * 100, 5 * 100, 5 * 100}, + Voltage.IV); + addCentrifugeToItemStack( + CombType.RUNEII, + new ItemStack[] { + GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), + GT_ModHandler.getModItem(MOD_ID_DC, "item.RuneOfVoidFragment", 1L, 0) + }, + new int[] {50 * 100, (int) (2.5 * 100)}, + Voltage.IV); + addCentrifugeToItemStack( + CombType.FIREESSENSE, + new ItemStack[] { + GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), + GT_Bees.propolis.getStackForType(PropolisType.Fireessence), + GT_Bees.drop.getStackForType(DropType.ENDERGOO) + }, + new int[] {30 * 100, (int) (7.5 * 100), 20 * 100}, + Voltage.IV); + // Walrus Recipe if (Loader.isModLoaded("extracells")) { - addCentrifugeToItemStack(CombType.WALRUS, new ItemStack[] {GT_ModHandler.getModItem("extracells", "walrus", 1L, 0) }, new int[] { 100 * 100}, Voltage.LV); + addCentrifugeToItemStack( + CombType.WALRUS, + new ItemStack[] {GT_ModHandler.getModItem("extracells", "walrus", 1L, 0)}, + new int[] {100 * 100}, + Voltage.LV); } - //Space Line - addCentrifugeToItemStack(CombType.SPACE, new ItemStack[] { ItemList.FR_Wax.get(1L), ItemList.FR_RefractoryWax.get(1L), GT_Bees.drop.getStackForType(DropType.OXYGEN), GT_ModHandler.getModItem(MOD_ID_DC, "item.CoinSpace", 1L, 0)}, new int[]{50 * 100, 30 * 100, 15 * 100, 5 * 100}, Voltage.HV); - addProcessGT(CombType.METEORICIRON, new Materials[] {Materials.MeteoricIron}, Voltage.HV); - addProcessGT(CombType.DESH, new Materials[] {Materials.Desh}, Voltage.EV); - addProcessGT(CombType.LEDOX, new Materials[] {Materials.Ledox}, Voltage.EV); - addProcessGT(CombType.CALLISTOICE, new Materials[] {Materials.CallistoIce}, Voltage.IV); - addProcessGT(CombType.MYTRYL, new Materials[] {Materials.Mytryl}, Voltage.IV); - addProcessGT(CombType.QUANTIUM, new Materials[] {Materials.Quantium}, Voltage.IV); - addProcessGT(CombType.ORIHARUKON, new Materials[] {Materials.Oriharukon}, Voltage.IV); - addProcessGT(CombType.MYSTERIOUSCRYSTAL, new Materials[] {Materials.MysteriousCrystal}, Voltage.LUV); - addCentrifugeToMaterial(CombType.MYSTERIOUSCRYSTAL, new Materials[] {Materials.MysteriousCrystal}, new int[] {(GT_Mod.gregtechproxy.mNerfedCombs ? 10 : 40) * 100, (GT_Mod.gregtechproxy.mNerfedCombs ? 15 : 50) * 100}, new int[] {}, Voltage.LUV, 512, NI, 50 * 100); - addProcessGT(CombType.BLACKPLUTONIUM, new Materials[] {Materials.BlackPlutonium}, Voltage.LUV); - addProcessGT(CombType.TRINIUM, new Materials[] {Materials.Trinium}, Voltage.ZPM); - if(!GT_Mod.gregtechproxy.mNerfedCombs) { - addCentrifugeToMaterial(CombType.METEORICIRON, new Materials[] {Materials.MeteoricIron, Materials.Iron}, new int[] {85 * 100, 100 * 100}, new int[] {}, Voltage.HV, NI, 30 * 100); - addCentrifugeToMaterial(CombType.DESH, new Materials[] {Materials.Desh, Materials.Titanium}, new int[] {75 * 100, 50 * 100}, new int[] {}, Voltage.EV, NI, 30 * 100); - addCentrifugeToMaterial(CombType.LEDOX, new Materials[] {Materials.Ledox, Materials.CallistoIce, Materials.Lead}, new int[] {65 * 100, 55 * 100, 85 *100}, new int[] {}, Voltage.EV, NI, 30 * 100); - addCentrifugeToMaterial(CombType.CALLISTOICE, new Materials[] {Materials.CallistoIce, Materials.Ledox, Materials.Lead}, new int[] {65 * 100, 75 * 100, 100 *100}, new int[] {}, Voltage.IV, NI, 30 * 100); - addCentrifugeToMaterial(CombType.MYTRYL, new Materials[] {Materials.Mytryl, Materials.Mithril}, new int[] {55 * 100, 50 * 100}, new int[] {}, Voltage.IV, NI, 30 * 100); - addCentrifugeToMaterial(CombType.QUANTIUM, new Materials[] {Materials.Quantium, Materials.Osmium}, new int[] {50 * 100, 60 * 100}, new int[] {}, Voltage.IV, NI, 30 * 100); - addCentrifugeToMaterial(CombType.ORIHARUKON, new Materials[] {Materials.Oriharukon, Materials.Lead}, new int[] {50 * 100, 75 * 100}, new int[] {}, Voltage.IV, NI, 30 * 100); - addCentrifugeToMaterial(CombType.BLACKPLUTONIUM, new Materials[] {Materials.BlackPlutonium, Materials.Plutonium}, new int[] {25 * 100, 50 * 100}, new int[] {}, Voltage.LUV, NI, 30 * 100); - addCentrifugeToMaterial(CombType.TRINIUM, new Materials[] {Materials.Trinium, Materials.Iridium}, new int[] {35 * 100, 45 * 100}, new int[] {}, Voltage.ZPM, NI, 30 * 100); - } - - //Planet Line - addCentrifugeToItemStack(CombType.MOON, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem(MOD_ID_DC, "item.MoonStoneDust", 1L, 0)}, new int[]{50 * 100, 30 * 100 }, Voltage.MV, 300); - addCentrifugeToItemStack(CombType.MARS, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem(MOD_ID_DC, "item.MarsStoneDust", 1L, 0)}, new int[]{50 * 100, 30 * 100 }, Voltage.HV, 300); - addCentrifugeToItemStack(CombType.JUPITER, new ItemStack[] { GT_ModHandler.getModItem(MOD_ID_DC, "item.IoStoneDust", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.EuropaIceDust", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.EuropaStoneDust", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.GanymedeStoneDust", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.CallistoStoneDust", 1L, 0), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.CallistoIce, 1L), ItemList.FR_Wax.get(1L)}, new int[]{30 * 100, 30 * 100, 30 * 100, 30 * 100, 30 * 100, 5 * 100, 50 * 100 }, Voltage.HV, 300); - addCentrifugeToItemStack(CombType.MERCURY, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem(MOD_ID_DC, "item.MercuryCoreDust", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.MercuryStoneDust", 1L, 0)}, new int[]{50 * 100, 30 * 100, 30 * 100 }, Voltage.EV, 300); - addCentrifugeToItemStack(CombType.VENUS, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem(MOD_ID_DC, "item.VenusStoneDust", 1L, 0)}, new int[]{50 * 100, 30 * 100 }, Voltage.EV, 300); - addCentrifugeToItemStack(CombType.SATURN, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem(MOD_ID_DC, "item.EnceladusStoneDust", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.TitanStoneDust", 1L, 0)}, new int[]{50 * 100, 30 * 100, 30 * 100 }, Voltage.IV, 300); - addCentrifugeToItemStack(CombType.URANUS, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem(MOD_ID_DC, "item.MirandaStoneDust", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.OberonStoneDust", 1L, 0)}, new int[]{50 * 100, 30 * 100, 30 * 100 }, Voltage.IV, 300); - addCentrifugeToItemStack(CombType.NEPTUN, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem(MOD_ID_DC, "item.ProteusStoneDust", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.TritonStoneDust", 1L, 0)}, new int[]{50 * 100, 30 * 100, 30 * 100 }, Voltage.IV, 300); - addCentrifugeToItemStack(CombType.PLUTO, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem(MOD_ID_DC, "item.PlutoStoneDust", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.PlutoIceDust", 1L, 0)}, new int[]{50 * 100, 30 * 100, 30 * 100 }, Voltage.LUV, 300); - addCentrifugeToItemStack(CombType.HAUMEA, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem(MOD_ID_DC, "item.HaumeaStoneDust", 1L, 0)}, new int[]{50 * 100, 30 * 100 }, Voltage.LUV, 300); - addCentrifugeToItemStack(CombType.MAKEMAKE, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem(MOD_ID_DC, "item.MakeMakeStoneDust", 1L, 0)}, new int[]{50 * 100, 30 * 100 }, Voltage.LUV, 300); - addCentrifugeToItemStack(CombType.CENTAURI, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem(MOD_ID_DC, "item.CentauriASurfaceDust", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.CentauriAStoneDust", 1L, 0)}, new int[]{50 * 100, 30 * 100, 30 * 100 }, Voltage.ZPM, 300); - addCentrifugeToItemStack(CombType.TCETI, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem(MOD_ID_DC, "item.TCetiEStoneDust", 1L, 0)}, new int[]{50 * 100, 30 * 100 }, Voltage.ZPM, 300); - addCentrifugeToItemStack(CombType.BARNARDA, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem(MOD_ID_DC, "item.BarnardaEStoneDust", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.BarnardaFStoneDust", 1L, 0)}, new int[]{50 * 100, 30 * 100, 30 * 100 }, Voltage.ZPM, 300); - addCentrifugeToItemStack(CombType.VEGA, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem(MOD_ID_DC, "item.VegaBStoneDust", 1L, 0)}, new int[]{50 * 100, 30 * 100 }, Voltage.ZPM, 300); + // Space Line + addCentrifugeToItemStack( + CombType.SPACE, + new ItemStack[] { + ItemList.FR_Wax.get(1L), + ItemList.FR_RefractoryWax.get(1L), + GT_Bees.drop.getStackForType(DropType.OXYGEN), + GT_ModHandler.getModItem(MOD_ID_DC, "item.CoinSpace", 1L, 0) + }, + new int[] {50 * 100, 30 * 100, 15 * 100, 5 * 100}, + Voltage.HV); + addProcessGT(CombType.METEORICIRON, new Materials[] {Materials.MeteoricIron}, Voltage.HV); + addProcessGT(CombType.DESH, new Materials[] {Materials.Desh}, Voltage.EV); + addProcessGT(CombType.LEDOX, new Materials[] {Materials.Ledox}, Voltage.EV); + addProcessGT(CombType.CALLISTOICE, new Materials[] {Materials.CallistoIce}, Voltage.IV); + addProcessGT(CombType.MYTRYL, new Materials[] {Materials.Mytryl}, Voltage.IV); + addProcessGT(CombType.QUANTIUM, new Materials[] {Materials.Quantium}, Voltage.IV); + addProcessGT(CombType.ORIHARUKON, new Materials[] {Materials.Oriharukon}, Voltage.IV); + addProcessGT(CombType.MYSTERIOUSCRYSTAL, new Materials[] {Materials.MysteriousCrystal}, Voltage.LUV); + addCentrifugeToMaterial( + CombType.MYSTERIOUSCRYSTAL, + new Materials[] {Materials.MysteriousCrystal}, + new int[] { + (GT_Mod.gregtechproxy.mNerfedCombs ? 10 : 40) * 100, + (GT_Mod.gregtechproxy.mNerfedCombs ? 15 : 50) * 100 + }, + new int[] {}, + Voltage.LUV, + 512, + NI, + 50 * 100); + addProcessGT(CombType.BLACKPLUTONIUM, new Materials[] {Materials.BlackPlutonium}, Voltage.LUV); + addProcessGT(CombType.TRINIUM, new Materials[] {Materials.Trinium}, Voltage.ZPM); + if (!GT_Mod.gregtechproxy.mNerfedCombs) { + addCentrifugeToMaterial( + CombType.METEORICIRON, + new Materials[] {Materials.MeteoricIron, Materials.Iron}, + new int[] {85 * 100, 100 * 100}, + new int[] {}, + Voltage.HV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.DESH, + new Materials[] {Materials.Desh, Materials.Titanium}, + new int[] {75 * 100, 50 * 100}, + new int[] {}, + Voltage.EV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.LEDOX, + new Materials[] {Materials.Ledox, Materials.CallistoIce, Materials.Lead}, + new int[] {65 * 100, 55 * 100, 85 * 100}, + new int[] {}, + Voltage.EV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.CALLISTOICE, + new Materials[] {Materials.CallistoIce, Materials.Ledox, Materials.Lead}, + new int[] {65 * 100, 75 * 100, 100 * 100}, + new int[] {}, + Voltage.IV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.MYTRYL, + new Materials[] {Materials.Mytryl, Materials.Mithril}, + new int[] {55 * 100, 50 * 100}, + new int[] {}, + Voltage.IV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.QUANTIUM, + new Materials[] {Materials.Quantium, Materials.Osmium}, + new int[] {50 * 100, 60 * 100}, + new int[] {}, + Voltage.IV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.ORIHARUKON, + new Materials[] {Materials.Oriharukon, Materials.Lead}, + new int[] {50 * 100, 75 * 100}, + new int[] {}, + Voltage.IV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.BLACKPLUTONIUM, + new Materials[] {Materials.BlackPlutonium, Materials.Plutonium}, + new int[] {25 * 100, 50 * 100}, + new int[] {}, + Voltage.LUV, + NI, + 30 * 100); + addCentrifugeToMaterial( + CombType.TRINIUM, + new Materials[] {Materials.Trinium, Materials.Iridium}, + new int[] {35 * 100, 45 * 100}, + new int[] {}, + Voltage.ZPM, + NI, + 30 * 100); + } + + // Planet Line + addCentrifugeToItemStack( + CombType.MOON, + new ItemStack[] { + ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem(MOD_ID_DC, "item.MoonStoneDust", 1L, 0) + }, + new int[] {50 * 100, 30 * 100}, + Voltage.MV, + 300); + addCentrifugeToItemStack( + CombType.MARS, + new ItemStack[] { + ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem(MOD_ID_DC, "item.MarsStoneDust", 1L, 0) + }, + new int[] {50 * 100, 30 * 100}, + Voltage.HV, + 300); + addCentrifugeToItemStack( + CombType.JUPITER, + new ItemStack[] { + GT_ModHandler.getModItem(MOD_ID_DC, "item.IoStoneDust", 1L, 0), + GT_ModHandler.getModItem(MOD_ID_DC, "item.EuropaIceDust", 1L, 0), + GT_ModHandler.getModItem(MOD_ID_DC, "item.EuropaStoneDust", 1L, 0), + GT_ModHandler.getModItem(MOD_ID_DC, "item.GanymedeStoneDust", 1L, 0), + GT_ModHandler.getModItem(MOD_ID_DC, "item.CallistoStoneDust", 1L, 0), + GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.CallistoIce, 1L), + ItemList.FR_Wax.get(1L) + }, + new int[] {30 * 100, 30 * 100, 30 * 100, 30 * 100, 30 * 100, 5 * 100, 50 * 100}, + Voltage.HV, + 300); + addCentrifugeToItemStack( + CombType.MERCURY, + new ItemStack[] { + ItemList.FR_Wax.get(1L), + GT_ModHandler.getModItem(MOD_ID_DC, "item.MercuryCoreDust", 1L, 0), + GT_ModHandler.getModItem(MOD_ID_DC, "item.MercuryStoneDust", 1L, 0) + }, + new int[] {50 * 100, 30 * 100, 30 * 100}, + Voltage.EV, + 300); + addCentrifugeToItemStack( + CombType.VENUS, + new ItemStack[] { + ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem(MOD_ID_DC, "item.VenusStoneDust", 1L, 0) + }, + new int[] {50 * 100, 30 * 100}, + Voltage.EV, + 300); + addCentrifugeToItemStack( + CombType.SATURN, + new ItemStack[] { + ItemList.FR_Wax.get(1L), + GT_ModHandler.getModItem(MOD_ID_DC, "item.EnceladusStoneDust", 1L, 0), + GT_ModHandler.getModItem(MOD_ID_DC, "item.TitanStoneDust", 1L, 0) + }, + new int[] {50 * 100, 30 * 100, 30 * 100}, + Voltage.IV, + 300); + addCentrifugeToItemStack( + CombType.URANUS, + new ItemStack[] { + ItemList.FR_Wax.get(1L), + GT_ModHandler.getModItem(MOD_ID_DC, "item.MirandaStoneDust", 1L, 0), + GT_ModHandler.getModItem(MOD_ID_DC, "item.OberonStoneDust", 1L, 0) + }, + new int[] {50 * 100, 30 * 100, 30 * 100}, + Voltage.IV, + 300); + addCentrifugeToItemStack( + CombType.NEPTUN, + new ItemStack[] { + ItemList.FR_Wax.get(1L), + GT_ModHandler.getModItem(MOD_ID_DC, "item.ProteusStoneDust", 1L, 0), + GT_ModHandler.getModItem(MOD_ID_DC, "item.TritonStoneDust", 1L, 0) + }, + new int[] {50 * 100, 30 * 100, 30 * 100}, + Voltage.IV, + 300); + addCentrifugeToItemStack( + CombType.PLUTO, + new ItemStack[] { + ItemList.FR_Wax.get(1L), + GT_ModHandler.getModItem(MOD_ID_DC, "item.PlutoStoneDust", 1L, 0), + GT_ModHandler.getModItem(MOD_ID_DC, "item.PlutoIceDust", 1L, 0) + }, + new int[] {50 * 100, 30 * 100, 30 * 100}, + Voltage.LUV, + 300); + addCentrifugeToItemStack( + CombType.HAUMEA, + new ItemStack[] { + ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem(MOD_ID_DC, "item.HaumeaStoneDust", 1L, 0) + }, + new int[] {50 * 100, 30 * 100}, + Voltage.LUV, + 300); + addCentrifugeToItemStack( + CombType.MAKEMAKE, + new ItemStack[] { + ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem(MOD_ID_DC, "item.MakeMakeStoneDust", 1L, 0) + }, + new int[] {50 * 100, 30 * 100}, + Voltage.LUV, + 300); + addCentrifugeToItemStack( + CombType.CENTAURI, + new ItemStack[] { + ItemList.FR_Wax.get(1L), + GT_ModHandler.getModItem(MOD_ID_DC, "item.CentauriASurfaceDust", 1L, 0), + GT_ModHandler.getModItem(MOD_ID_DC, "item.CentauriAStoneDust", 1L, 0) + }, + new int[] {50 * 100, 30 * 100, 30 * 100}, + Voltage.ZPM, + 300); + addCentrifugeToItemStack( + CombType.TCETI, + new ItemStack[] { + ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem(MOD_ID_DC, "item.TCetiEStoneDust", 1L, 0) + }, + new int[] {50 * 100, 30 * 100}, + Voltage.ZPM, + 300); + addCentrifugeToItemStack( + CombType.BARNARDA, + new ItemStack[] { + ItemList.FR_Wax.get(1L), + GT_ModHandler.getModItem(MOD_ID_DC, "item.BarnardaEStoneDust", 1L, 0), + GT_ModHandler.getModItem(MOD_ID_DC, "item.BarnardaFStoneDust", 1L, 0) + }, + new int[] {50 * 100, 30 * 100, 30 * 100}, + Voltage.ZPM, + 300); + addCentrifugeToItemStack( + CombType.VEGA, + new ItemStack[] { + ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem(MOD_ID_DC, "item.VegaBStoneDust", 1L, 0) + }, + new int[] {50 * 100, 30 * 100}, + Voltage.ZPM, + 300); if (Loader.isModLoaded("GalaxySpace")) { - addCentrifugeToItemStack(CombType.SEAWEED, new ItemStack[]{ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem("GalaxySpace", "tcetiedandelions", 1L, 0)}, new int[]{50 * 100, 100 * 100}, Voltage.UV, 100); + addCentrifugeToItemStack( + CombType.SEAWEED, + new ItemStack[] { + ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem("GalaxySpace", "tcetiedandelions", 1L, 0) + }, + new int[] {50 * 100, 100 * 100}, + Voltage.UV, + 100); } - //Infinity Line - addCentrifugeToMaterial(CombType.COSMICNEUTRONIUM, new Materials[] {Materials.CosmicNeutronium, Materials.Neutronium}, new int[] {(int) (15 * 100), 1 * 100}, new int[] {}, Voltage.UHV, 1200, NI, 50 * 100); - addCentrifugeToMaterial(CombType.INFINITYCATALYST, new Materials[] {Materials.InfinityCatalyst, Materials.Neutronium}, new int[] {(int) (25 * 100), 20 * 100}, new int[] {}, Voltage.ZPM, 100, NI, 50 * 100); - addCentrifugeToMaterial(CombType.INFINITY, new Materials[] {Materials.Infinity, Materials.InfinityCatalyst}, new int[] {(int) (20 * 100), (int) (0.05 * 100)}, new int[] {}, Voltage.UV, 1000, NI, 50 * 100); + // Infinity Line + addCentrifugeToMaterial( + CombType.COSMICNEUTRONIUM, + new Materials[] {Materials.CosmicNeutronium, Materials.Neutronium}, + new int[] {(int) (15 * 100), 1 * 100}, + new int[] {}, + Voltage.UHV, + 1200, + NI, + 50 * 100); + addCentrifugeToMaterial( + CombType.INFINITYCATALYST, + new Materials[] {Materials.InfinityCatalyst, Materials.Neutronium}, + new int[] {(int) (25 * 100), 20 * 100}, + new int[] {}, + Voltage.ZPM, + 100, + NI, + 50 * 100); + addCentrifugeToMaterial( + CombType.INFINITY, + new Materials[] {Materials.Infinity, Materials.InfinityCatalyst}, + new int[] {(int) (20 * 100), (int) (0.05 * 100)}, + new int[] {}, + Voltage.UV, + 1000, + NI, + 50 * 100); - //(Noble)gas Line + // (Noble)gas Line addFluidExtractorProcess(CombType.HELIUM, Materials.Helium.getGas(250), Voltage.HV); addFluidExtractorProcess(CombType.ARGON, Materials.Argon.getGas(250), Voltage.MV); addFluidExtractorProcess(CombType.NITROGEN, Materials.Nitrogen.getGas(250), Voltage.MV); addFluidExtractorProcess(CombType.HYDROGEN, Materials.Hydrogen.getGas(250), Voltage.MV); addFluidExtractorProcess(CombType.FLUORINE, Materials.Fluorine.getGas(250), Voltage.MV); addFluidExtractorProcess(CombType.OXYGEN, Materials.Oxygen.getGas(250), Voltage.MV); - //Organic part 2, unknown liquid - //yes, unknowwater. Its not my typo, its how it is spelled. Stupid game. + // Organic part 2, unknown liquid + // yes, unknowwater. Its not my typo, its how it is spelled. Stupid game. addFluidExtractorProcess(CombType.UNKNOWNWATER, FluidRegistry.getFluidStack("unknowwater", 250), Voltage.ZPM); /** * The Centrifuge Recipes for Infused Shards and Nether/End-Shard from the Infused Shard Line are below the NobleGas * Lines for Xenon and co. in Gt_MachineRecipeLoader.java In Lines 1525 * **/ + } - - + /** + * Currently only used for CombType.MOLYBDENUM + * @param circuitNumber should not conflict with addProcessGT + * + * **/ + public void addAutoclaveProcess(CombType comb, Materials aMaterial, Voltage volt, int circuitNumber) { + if (GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial, 4) == NI) return; + RA.addAutoclaveRecipe( + GT_Utility.copyAmount(9, getStackForType(comb)), + GT_Utility.getIntegratedCircuit(circuitNumber), + Materials.UUMatter.getFluid(Math.max(1, ((aMaterial.getMass() + volt.getUUAmplifier()) / 10))), + GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial, 4), + 10000, + (int) (aMaterial.getMass() * 128), + volt.getAutoClaveEnergy(), + volt.compareTo(Voltage.HV) > 0); } - /** - * Currently only used for CombType.MOLYBDENUM - * @param circuitNumber should not conflict with addProcessGT - * - * **/ - public void addAutoclaveProcess(CombType comb, Materials aMaterial, Voltage volt, int circuitNumber){ - if(GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial, 4) == NI) return; - RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, getStackForType(comb)), GT_Utility.getIntegratedCircuit(circuitNumber), Materials.UUMatter.getFluid(Math.max(1, ((aMaterial.getMass()+volt.getUUAmplifier())/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial, 4), 10000, (int) (aMaterial.getMass() * 128), volt.getAutoClaveEnergy(), volt.compareTo(Voltage.HV) > 0); - } - - public void addFluidExtractorProcess(CombType comb, FluidStack fluid, Voltage volt){ - if(fluid == null) - return; - RA.addFluidExtractionRecipe(GT_Utility.copyAmount(1, getStackForType(comb)), null, fluid, 100 * 100, (fluid.getFluid().getDensity() * 128 > 0 ? (int) (fluid.getFluid().getDensity() * 100) : 128), volt.getSimpleEnergy()/2); + public void addFluidExtractorProcess(CombType comb, FluidStack fluid, Voltage volt) { + if (fluid == null) return; + RA.addFluidExtractionRecipe( + GT_Utility.copyAmount(1, getStackForType(comb)), + null, + fluid, + 100 * 100, + (fluid.getFluid().getDensity() * 128 > 0 + ? (int) (fluid.getFluid().getDensity() * 100) + : 128), + volt.getSimpleEnergy() / 2); } - /** - * this only adds Chemical and AutoClave process. - * If you need Centrifuge recipe. use addCentrifugeToMaterial or addCentrifugeToItemStack - * @param volt This determine the required Tier of process for this recipes. This decide the required aEU/t, progress time, required additional UU-Matter, requirement of cleanRoom, needed fluid stack for Chemical. - * @param aMaterial result of Material that should be generated by this process. - * **/ - public void addProcessGT(CombType comb, Materials[] aMaterial, Voltage volt) { - ItemStack tComb = getStackForType(comb); - for(int i=0; i < aMaterial.length; i++) { - if(GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial[i], 4)!= NI) { - switch(comb) { + /** + * this only adds Chemical and AutoClave process. + * If you need Centrifuge recipe. use addCentrifugeToMaterial or addCentrifugeToItemStack + * @param volt This determine the required Tier of process for this recipes. This decide the required aEU/t, progress time, required additional UU-Matter, requirement of cleanRoom, needed fluid stack for Chemical. + * @param aMaterial result of Material that should be generated by this process. + * **/ + public void addProcessGT(CombType comb, Materials[] aMaterial, Voltage volt) { + ItemStack tComb = getStackForType(comb); + for (int i = 0; i < aMaterial.length; i++) { + if (GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial[i], 4) != NI) { + switch (comb) { case NEUTRONIUM: - RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(i+1), Materials.UUMatter.getFluid(Math.max(1, ((aMaterial[i].getMass()+volt.getUUAmplifier())/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial[i], 4), 10000, (int) (aMaterial[i].getMass() * 128), volt.getAutoClaveEnergy(), volt.compareTo(Voltage.HV) > 0); - RA.addChemicalRecipe(GT_Utility.copyAmount(4, tComb), null, volt.getFluidAccordingToCombTier(), Materials.Neutronium.getMolten(576l), Materials.Neutronium.getNuggets(1), NI, volt.getComplexTime()*17, volt.getChemicalEnergy(), volt.compareTo(Voltage.IV) > 0); + RA.addAutoclaveRecipe( + GT_Utility.copyAmount(9, tComb), + GT_Utility.getIntegratedCircuit(i + 1), + Materials.UUMatter.getFluid( + Math.max(1, ((aMaterial[i].getMass() + volt.getUUAmplifier()) / 10))), + GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial[i], 4), + 10000, + (int) (aMaterial[i].getMass() * 128), + volt.getAutoClaveEnergy(), + volt.compareTo(Voltage.HV) > 0); + RA.addChemicalRecipe( + GT_Utility.copyAmount(4, tComb), + null, + volt.getFluidAccordingToCombTier(), + Materials.Neutronium.getMolten(576l), + Materials.Neutronium.getNuggets(1), + NI, + volt.getComplexTime() * 17, + volt.getChemicalEnergy(), + volt.compareTo(Voltage.IV) > 0); case OSMIUM: - RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(i+1), Materials.UUMatter.getFluid(Math.max(1, ((aMaterial[i].getMass()+volt.getUUAmplifier())/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial[i], 4), 10000, (int) (aMaterial[i].getMass() * 128), volt.getAutoClaveEnergy(), volt.compareTo(Voltage.HV) > 0); - RA.addChemicalRecipe(GT_Utility.copyAmount(4, tComb), null, volt.getFluidAccordingToCombTier(), Materials.Osmium.getMolten(288l), Materials.Osmium.getNuggets(1), NI, volt.getComplexTime()*17, volt.getChemicalEnergy(), volt.compareTo(Voltage.IV) > 0); + RA.addAutoclaveRecipe( + GT_Utility.copyAmount(9, tComb), + GT_Utility.getIntegratedCircuit(i + 1), + Materials.UUMatter.getFluid( + Math.max(1, ((aMaterial[i].getMass() + volt.getUUAmplifier()) / 10))), + GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial[i], 4), + 10000, + (int) (aMaterial[i].getMass() * 128), + volt.getAutoClaveEnergy(), + volt.compareTo(Voltage.HV) > 0); + RA.addChemicalRecipe( + GT_Utility.copyAmount(4, tComb), + null, + volt.getFluidAccordingToCombTier(), + Materials.Osmium.getMolten(288l), + Materials.Osmium.getNuggets(1), + NI, + volt.getComplexTime() * 17, + volt.getChemicalEnergy(), + volt.compareTo(Voltage.IV) > 0); case PLATINUM: - RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(i+1), Materials.UUMatter.getFluid(Math.max(1, ((aMaterial[i].getMass()+volt.getUUAmplifier())/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial[i], 4), 10000, (int) (aMaterial[i].getMass() * 128), volt.getAutoClaveEnergy(), volt.compareTo(Voltage.HV) > 0); - RA.addChemicalRecipe(GT_Utility.copyAmount(4, tComb), null, volt.getFluidAccordingToCombTier(), Materials.Platinum.getMolten(288l), Materials.Platinum.getNuggets(1), NI, volt.getComplexTime()*10, volt.getChemicalEnergy(), volt.compareTo(Voltage.HV) > 0); + RA.addAutoclaveRecipe( + GT_Utility.copyAmount(9, tComb), + GT_Utility.getIntegratedCircuit(i + 1), + Materials.UUMatter.getFluid( + Math.max(1, ((aMaterial[i].getMass() + volt.getUUAmplifier()) / 10))), + GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial[i], 4), + 10000, + (int) (aMaterial[i].getMass() * 128), + volt.getAutoClaveEnergy(), + volt.compareTo(Voltage.HV) > 0); + RA.addChemicalRecipe( + GT_Utility.copyAmount(4, tComb), + null, + volt.getFluidAccordingToCombTier(), + Materials.Platinum.getMolten(288l), + Materials.Platinum.getNuggets(1), + NI, + volt.getComplexTime() * 10, + volt.getChemicalEnergy(), + volt.compareTo(Voltage.HV) > 0); case IRIDIUM: - RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(i+1), Materials.UUMatter.getFluid(Math.max(1, ((aMaterial[i].getMass()+volt.getUUAmplifier())/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial[i], 4), 10000, (int) (aMaterial[i].getMass() * 128), volt.getAutoClaveEnergy(), volt.compareTo(Voltage.HV) > 0); - RA.addChemicalRecipe(GT_Utility.copyAmount(4, tComb), null, volt.getFluidAccordingToCombTier(), Materials.Iridium.getMolten(288l), Materials.Iridium.getNuggets(1), NI, volt.getComplexTime()*14, volt.getChemicalEnergy(), volt.compareTo(Voltage.EV) > 0); + RA.addAutoclaveRecipe( + GT_Utility.copyAmount(9, tComb), + GT_Utility.getIntegratedCircuit(i + 1), + Materials.UUMatter.getFluid( + Math.max(1, ((aMaterial[i].getMass() + volt.getUUAmplifier()) / 10))), + GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial[i], 4), + 10000, + (int) (aMaterial[i].getMass() * 128), + volt.getAutoClaveEnergy(), + volt.compareTo(Voltage.HV) > 0); + RA.addChemicalRecipe( + GT_Utility.copyAmount(4, tComb), + null, + volt.getFluidAccordingToCombTier(), + Materials.Iridium.getMolten(288l), + Materials.Iridium.getNuggets(1), + NI, + volt.getComplexTime() * 14, + volt.getChemicalEnergy(), + volt.compareTo(Voltage.EV) > 0); default: - RA.addChemicalRecipe(GT_Utility.copyAmount(4, tComb),null, volt.getFluidAccordingToCombTier(), null, GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial[i], 4), NI, volt.getComplexTime(), volt.getChemicalEnergy(), volt.compareTo(Voltage.IV) > 0); - RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(i+1), Materials.UUMatter.getFluid(Math.max(1, ((aMaterial[i].getMass()+volt.getUUAmplifier())/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial[i], 4), 10000, (int) (aMaterial[i].getMass() * 128), volt.getAutoClaveEnergy(), volt.compareTo(Voltage.HV) > 0); + RA.addChemicalRecipe( + GT_Utility.copyAmount(4, tComb), + null, + volt.getFluidAccordingToCombTier(), + null, + GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial[i], 4), + NI, + volt.getComplexTime(), + volt.getChemicalEnergy(), + volt.compareTo(Voltage.IV) > 0); + RA.addAutoclaveRecipe( + GT_Utility.copyAmount(9, tComb), + GT_Utility.getIntegratedCircuit(i + 1), + Materials.UUMatter.getFluid( + Math.max(1, ((aMaterial[i].getMass() + volt.getUUAmplifier()) / 10))), + GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial[i], 4), + 10000, + (int) (aMaterial[i].getMass() * 128), + volt.getAutoClaveEnergy(), + volt.compareTo(Voltage.HV) > 0); break; - }} - } - } - - /** - * this method only adds Centrifuge based on Material. If volt is lower than MV than it will also adds forestry centrifuge recipe. - * @param comb BeeComb - * @param aMaterial resulting Material of processing. can be more than 6. but over 6 will be ignored in Gregtech Centrifuge. - * @param chance chance to get result, 10000 == 100% - * @param volt required Voltage Tier for this recipe, this also affect the duration, amount of UU-Matter, and needed liquid type and amount for chemical reactor - * @param stackSize This parameter can be null, in that case stack size will be just 1. This handle the stackSize of the resulting Item, and Also the Type of Item. if this value is multiple of 9, than related Material output will be dust, if this value is multiple of 4 than output will be Small dust, else the output will be Tiny dust - * @param beeWax if this is null, then the comb will product default Bee wax. But if aMaterial is more than 5, beeWax will be ignored in Gregtech Centrifuge. - * @param waxChance have same format like "chance" - **/ - public void addCentrifugeToMaterial(CombType comb, Materials[] aMaterial, int[] chance, int[] stackSize, Voltage volt, ItemStack beeWax, int waxChance) { - addCentrifugeToMaterial(comb, aMaterial, chance, stackSize, volt, volt.getSimpleTime(), beeWax, waxChance); - } - public void addCentrifugeToMaterial(CombType comb, Materials[] aMaterial, int[] chance, int[] stackSize, Voltage volt, int duration, ItemStack beeWax, int waxChance) { - ItemStack[] aOutPut = new ItemStack[aMaterial.length+1]; - stackSize = Arrays.copyOf(stackSize, aMaterial.length); - chance = Arrays.copyOf(chance, aOutPut.length); - chance[chance.length - 1] = waxChance; - for(int i = 0; i < (aMaterial.length); i++) { - if(chance[i] == 0) { - continue; - } - if(Math.max(1, stackSize[i]) % 9 == 0) { - aOutPut[i] = GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial[i], (Math.max(1, stackSize[i])/9) ); - }else if(Math.max(1, stackSize[i]) % 4 == 0) { - aOutPut[i] = GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial[i], (Math.max(1, stackSize[i])/4) ); - }else { - aOutPut[i] = GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial[i], Math.max(1, stackSize[i])); - } - } - if(beeWax != NI) { - aOutPut[aOutPut.length - 1] = beeWax; - }else { - aOutPut[aOutPut.length - 1] = ItemList.FR_Wax.get(1); - } - - addCentrifugeToItemStack(comb, aOutPut, chance, volt, duration); - } - - /** - * @param volt required Tier of system. If it's lower than MV, it will also add forestry centrifuge. - * @param aItem can be more than 6. but Over 6 will be ignored in Gregtech Centrifuge. - **/ - public void addCentrifugeToItemStack(CombType comb, ItemStack[] aItem, int[] chance, Voltage volt) { - addCentrifugeToItemStack(comb, aItem, chance, volt, volt.getSimpleTime()); - } - public void addCentrifugeToItemStack(CombType comb, ItemStack[] aItem, int[] chance, Voltage volt, int duration) { - ItemStack tComb = getStackForType(comb); - Builder<ItemStack,Float> Product = new ImmutableMap.Builder<ItemStack, Float>(); - for(int i=0; i < aItem.length; i++) { - if(aItem[i] == NI) { continue; } - Product.put(aItem[i],chance[i]/10000.0f); - } - - if(volt.compareTo(Voltage.MV) < 0 || !GT_Mod.gregtechproxy.mNerfedCombs) { - RecipeManagers.centrifugeManager.addRecipe(40, tComb, Product.build()); - } - - aItem = Arrays.copyOf(aItem, 6); - if(aItem.length > 6) { - chance = Arrays.copyOf(chance, 6); - } - - RA.addCentrifugeRecipe(tComb, NI, NF, NF, aItem[0], aItem[1], aItem[2], aItem[3], aItem[4], aItem[5], chance, duration, volt.getSimpleEnergy()); - } - - enum Voltage { - ULV, LV, MV, - HV, EV, IV, - LUV, ZPM, UV, - UHV, UEV, UIV, - UMV, UXV, MAX; - public int getVoltage() { - return (int) V[this.ordinal()]; - } - /**@return aEU/t needed for chemical and autoclave process related to the Tier**/ - public int getVoltageFromEU() { return (int) Math.max(Math.floor(Math.log(2*this.getVoltage())/Math.log(4)-1), 0); } + } + } + } + } + + /** + * this method only adds Centrifuge based on Material. If volt is lower than MV than it will also adds forestry centrifuge recipe. + * @param comb BeeComb + * @param aMaterial resulting Material of processing. can be more than 6. but over 6 will be ignored in Gregtech Centrifuge. + * @param chance chance to get result, 10000 == 100% + * @param volt required Voltage Tier for this recipe, this also affect the duration, amount of UU-Matter, and needed liquid type and amount for chemical reactor + * @param stackSize This parameter can be null, in that case stack size will be just 1. This handle the stackSize of the resulting Item, and Also the Type of Item. if this value is multiple of 9, than related Material output will be dust, if this value is multiple of 4 than output will be Small dust, else the output will be Tiny dust + * @param beeWax if this is null, then the comb will product default Bee wax. But if aMaterial is more than 5, beeWax will be ignored in Gregtech Centrifuge. + * @param waxChance have same format like "chance" + **/ + public void addCentrifugeToMaterial( + CombType comb, + Materials[] aMaterial, + int[] chance, + int[] stackSize, + Voltage volt, + ItemStack beeWax, + int waxChance) { + addCentrifugeToMaterial(comb, aMaterial, chance, stackSize, volt, volt.getSimpleTime(), beeWax, waxChance); + } + + public void addCentrifugeToMaterial( + CombType comb, + Materials[] aMaterial, + int[] chance, + int[] stackSize, + Voltage volt, + int duration, + ItemStack beeWax, + int waxChance) { + ItemStack[] aOutPut = new ItemStack[aMaterial.length + 1]; + stackSize = Arrays.copyOf(stackSize, aMaterial.length); + chance = Arrays.copyOf(chance, aOutPut.length); + chance[chance.length - 1] = waxChance; + for (int i = 0; i < (aMaterial.length); i++) { + if (chance[i] == 0) { + continue; + } + if (Math.max(1, stackSize[i]) % 9 == 0) { + aOutPut[i] = GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial[i], (Math.max(1, stackSize[i]) / 9)); + } else if (Math.max(1, stackSize[i]) % 4 == 0) { + aOutPut[i] = GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial[i], (Math.max(1, stackSize[i]) / 4)); + } else { + aOutPut[i] = GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial[i], Math.max(1, stackSize[i])); + } + } + if (beeWax != NI) { + aOutPut[aOutPut.length - 1] = beeWax; + } else { + aOutPut[aOutPut.length - 1] = ItemList.FR_Wax.get(1); + } + + addCentrifugeToItemStack(comb, aOutPut, chance, volt, duration); + } + + /** + * @param volt required Tier of system. If it's lower than MV, it will also add forestry centrifuge. + * @param aItem can be more than 6. but Over 6 will be ignored in Gregtech Centrifuge. + **/ + public void addCentrifugeToItemStack(CombType comb, ItemStack[] aItem, int[] chance, Voltage volt) { + addCentrifugeToItemStack(comb, aItem, chance, volt, volt.getSimpleTime()); + } + + public void addCentrifugeToItemStack(CombType comb, ItemStack[] aItem, int[] chance, Voltage volt, int duration) { + ItemStack tComb = getStackForType(comb); + Builder<ItemStack, Float> Product = new ImmutableMap.Builder<ItemStack, Float>(); + for (int i = 0; i < aItem.length; i++) { + if (aItem[i] == NI) { + continue; + } + Product.put(aItem[i], chance[i] / 10000.0f); + } + + if (volt.compareTo(Voltage.MV) < 0 || !GT_Mod.gregtechproxy.mNerfedCombs) { + RecipeManagers.centrifugeManager.addRecipe(40, tComb, Product.build()); + } + + aItem = Arrays.copyOf(aItem, 6); + if (aItem.length > 6) { + chance = Arrays.copyOf(chance, 6); + } + + RA.addCentrifugeRecipe( + tComb, + NI, + NF, + NF, + aItem[0], + aItem[1], + aItem[2], + aItem[3], + aItem[4], + aItem[5], + chance, + duration, + volt.getSimpleEnergy()); + } + + enum Voltage { + ULV, + LV, + MV, + HV, + EV, + IV, + LUV, + ZPM, + UV, + UHV, + UEV, + UIV, + UMV, + UXV, + MAX; + + public int getVoltage() { + return (int) V[this.ordinal()]; + } + /**@return aEU/t needed for chemical and autoclave process related to the Tier**/ + public int getVoltageFromEU() { + return (int) Math.max(Math.floor(Math.log(2 * this.getVoltage()) / Math.log(4) - 1), 0); + } /**@return Voltage tier according to EU provided. 0 = ULV, 1 = LV, 2 = MV ...**/ - public int getChemicalEnergy() { - return this.getVoltage()*3/4; - } - public int getAutoClaveEnergy() { - return (int) ((this.getVoltage()*3/4) * (Math.max(1, Math.pow(2, 5 - this.ordinal())))); - } - /**@return FluidStack needed for chemical process related to the Tier**/ - public FluidStack getComplexChemical() { - if(this.compareTo(Voltage.MV) < 0) { - return Materials.HydrofluoricAcid.getFluid((this.compareTo(Voltage.ULV) > 0) ? 1000 : 500); - }else if(this.compareTo(Voltage.HV) < 0) { - return GT_ModHandler.getDistilledWater(1000L); - }else if(this.compareTo(Voltage.LUV) < 0) { - return Materials.HydrofluoricAcid.getFluid((long) (Math.pow(2, this.compareTo(Voltage.HV)) * L)); - }else if(this.compareTo(Voltage.UHV) < 0) { - return FluidRegistry.getFluidStack("mutagen", (int) (Math.pow(2, this.compareTo(Voltage.LUV)) * L)); - }else { - return NF; - } - } + public int getChemicalEnergy() { + return this.getVoltage() * 3 / 4; + } + + public int getAutoClaveEnergy() { + return (int) ((this.getVoltage() * 3 / 4) * (Math.max(1, Math.pow(2, 5 - this.ordinal())))); + } + /**@return FluidStack needed for chemical process related to the Tier**/ + public FluidStack getComplexChemical() { + if (this.compareTo(Voltage.MV) < 0) { + return Materials.HydrofluoricAcid.getFluid((this.compareTo(Voltage.ULV) > 0) ? 1000 : 500); + } else if (this.compareTo(Voltage.HV) < 0) { + return GT_ModHandler.getDistilledWater(1000L); + } else if (this.compareTo(Voltage.LUV) < 0) { + return Materials.HydrofluoricAcid.getFluid((long) (Math.pow(2, this.compareTo(Voltage.HV)) * L)); + } else if (this.compareTo(Voltage.UHV) < 0) { + return FluidRegistry.getFluidStack("mutagen", (int) (Math.pow(2, this.compareTo(Voltage.LUV)) * L)); + } else { + return NF; + } + } /**@return FluidStack needed for chemical process related to the Tier**/ public FluidStack getFluidAccordingToCombTier() { - //checking what Voltage tier the Comb is - //cascading from IV to UMV since all recipes use HydrofluiricAcid - //for later tiers, just add the corresponding tier to a case + // checking what Voltage tier the Comb is + // cascading from IV to UMV since all recipes use HydrofluiricAcid + // for later tiers, just add the corresponding tier to a case int fluidAmount = this.getFluidAmount(); - switch(this.getVoltageFromEU()){ - case 0: /**ULV**/ + switch (this.getVoltageFromEU()) { + case 0: + /**ULV**/ return Materials.Water.getFluid(fluidAmount); - case 1: /**LV**/ + case 1: + /**LV**/ return Materials.SulfuricAcid.getFluid(fluidAmount); - case 2: /**MV**/ + case 2: + /**MV**/ return Materials.HydrochloricAcid.getFluid(fluidAmount); - case 3: /**HV**/ + case 3: + /**HV**/ return Materials.PhosphoricAcid.getFluid(fluidAmount); - case 4: /**EV**/ + case 4: + /**EV**/ return Materials.PhthalicAcid.getFluid(fluidAmount); default: return Materials.HydrofluoricAcid.getFluid(this.getFluidAmount()); @@ -598,34 +2055,31 @@ public class ItemComb extends Item { public int getUUAmplifier() { return 9 * ((this.compareTo(Voltage.MV) < 0) ? 1 : this.compareTo(Voltage.MV)); } - /**@return duration needed for Chemical process related to the Tier**/ - public int getComplexTime() { - return 64 + this.ordinal() * 32; - - } + /**@return duration needed for Chemical process related to the Tier**/ + public int getComplexTime() { + return 64 + this.ordinal() * 32; + } /**@return Fluid amount needed for Chemical process related to the Tier**/ public int getFluidAmount() { - return 9 * this.getSimpleTime()/3; + return 9 * this.getSimpleTime() / 3; } - - - /**@return duration needed for Centrifuge process related to the Tier**/ - public int getSimpleTime() { - if(!GT_Mod.gregtechproxy.mNerfedCombs) { - return 96 + this.ordinal() * 32; - } else { - //ULV, LV needs 128ticks, MV need 256 ticks, HV need 384 ticks, EV need 512 ticks, IV need 640 ticks - return 128 * (Math.max(1, this.ordinal())); - } - } - /**@return aEU/t needed for Centrifuge process related to the Tier**/ - public int getSimpleEnergy() { - if(this == Voltage.ULV) { - return 5; - }else { - return (int) (this.getVoltage() / 16) * 15; - } - } - } + /**@return duration needed for Centrifuge process related to the Tier**/ + public int getSimpleTime() { + if (!GT_Mod.gregtechproxy.mNerfedCombs) { + return 96 + this.ordinal() * 32; + } else { + // ULV, LV needs 128ticks, MV need 256 ticks, HV need 384 ticks, EV need 512 ticks, IV need 640 ticks + return 128 * (Math.max(1, this.ordinal())); + } + } + /**@return aEU/t needed for Centrifuge process related to the Tier**/ + public int getSimpleEnergy() { + if (this == Voltage.ULV) { + return 5; + } else { + return (int) (this.getVoltage() / 16) * 15; + } + } + } } diff --git a/src/main/java/gregtech/common/items/ItemDrop.java b/src/main/java/gregtech/common/items/ItemDrop.java index b48072dbd1..37b9d583c5 100644 --- a/src/main/java/gregtech/common/items/ItemDrop.java +++ b/src/main/java/gregtech/common/items/ItemDrop.java @@ -1,5 +1,8 @@ package gregtech.common.items; +import static gregtech.api.enums.GT_Values.MOD_ID; +import static gregtech.api.enums.GT_Values.MOD_ID_DC; + import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; @@ -9,6 +12,7 @@ import forestry.api.recipes.RecipeManagers; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; import gregtech.api.util.GT_ModHandler; +import java.util.List; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; @@ -17,118 +21,180 @@ import net.minecraft.util.IIcon; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; -import java.util.List; +public class ItemDrop extends Item { + @SideOnly(Side.CLIENT) + private IIcon secondIcon; -import static gregtech.api.enums.GT_Values.MOD_ID; -import static gregtech.api.enums.GT_Values.MOD_ID_DC; + public ItemDrop() { + super(); + this.setCreativeTab(Tabs.tabApiculture); + this.setHasSubtypes(true); + this.setUnlocalizedName("gt.drop"); + GameRegistry.registerItem(this, "gt.drop", MOD_ID); + } -public class ItemDrop extends Item { - @SideOnly(Side.CLIENT) - private IIcon secondIcon; - - public ItemDrop() { - super(); - this.setCreativeTab(Tabs.tabApiculture); - this.setHasSubtypes(true); - this.setUnlocalizedName("gt.drop"); - GameRegistry.registerItem(this, "gt.drop", MOD_ID); - } - - public ItemStack getStackForType(DropType type) { - return new ItemStack(this, 1, type.ordinal()); - } - - public ItemStack getStackForType(DropType type, int count) { - return new ItemStack(this, count, type.ordinal()); - } - - @Override - @SideOnly(Side.CLIENT) - public void getSubItems(Item item, CreativeTabs tabs, List list) { - for (DropType type : DropType.values()) { - if (type.showInList) { - list.add(this.getStackForType(type)); - } - } - } - - @Override - @SideOnly(Side.CLIENT) - public boolean requiresMultipleRenderPasses() { - return true; - } - - @Override - public int getRenderPasses(int meta) { - return 2; - } - - @Override + public ItemStack getStackForType(DropType type) { + return new ItemStack(this, 1, type.ordinal()); + } + + public ItemStack getStackForType(DropType type, int count) { + return new ItemStack(this, count, type.ordinal()); + } + + @Override + @SideOnly(Side.CLIENT) + public void getSubItems(Item item, CreativeTabs tabs, List list) { + for (DropType type : DropType.values()) { + if (type.showInList) { + list.add(this.getStackForType(type)); + } + } + } + + @Override + @SideOnly(Side.CLIENT) + public boolean requiresMultipleRenderPasses() { + return true; + } + + @Override + public int getRenderPasses(int meta) { + return 2; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) { + this.itemIcon = iconRegister.registerIcon("forestry:honeyDrop.0"); + this.secondIcon = iconRegister.registerIcon("forestry:honeyDrop.1"); + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) { + return (pass == 0) ? itemIcon : secondIcon; + } + + @Override @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister iconRegister) { - this.itemIcon = iconRegister.registerIcon("forestry:honeyDrop.0"); - this.secondIcon = iconRegister.registerIcon("forestry:honeyDrop.1"); - } - - @Override - public IIcon getIcon(ItemStack stack, int pass) { - return (pass == 0) ? itemIcon : secondIcon; - } - - @Override - @SideOnly(Side.CLIENT) - public int getColorFromItemStack(ItemStack stack, int pass) { - int meta = Math.max(0, Math.min(DropType.values().length - 1, stack.getItemDamage())); - int colour = DropType.values()[meta].getColours()[0]; - - if (pass >= 1) { - colour = DropType.values()[meta].getColours()[1]; - } - - return colour; - } - - @Override - public String getItemStackDisplayName(ItemStack stack) { - return DropType.values()[stack.getItemDamage()].getName(); - } - public void initDropsRecipes() { - ItemStack tDrop; - - tDrop = getStackForType(DropType.OIL); - addProcessLV(tDrop, Materials.OilHeavy.getFluid(100L), GT_ModHandler.getModItem("Forestry", "propolis", 1L, 0), 3000, 8); - RecipeManagers.squeezerManager.addRecipe(40, new ItemStack[]{tDrop}, Materials.OilHeavy.getFluid(100L), GT_ModHandler.getModItem("Forestry", "propolis", 1L, 0), 30); - tDrop = getStackForType(DropType.COOLANT); - addProcessLV(tDrop, new FluidStack(FluidRegistry.getFluid("ic2coolant"), 100), GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 0), 3000, 8); - RecipeManagers.squeezerManager.addRecipe(40, new ItemStack[]{tDrop}, new FluidStack(FluidRegistry.getFluid("ic2coolant"), 100), GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 0), 30); - tDrop = getStackForType(DropType.HOT_COOLANT); - addProcessLV(tDrop, new FluidStack(FluidRegistry.getFluid("ic2hotcoolant"), 100), GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 2), 3000, 8); - RecipeManagers.squeezerManager.addRecipe(40, new ItemStack[]{tDrop}, new FluidStack(FluidRegistry.getFluid("ic2hotcoolant"), 100), GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 2), 30); - tDrop = getStackForType(DropType.SNOW_QUEEN); - addProcessMV(tDrop, Materials.FierySteel.getFluid(200L), GT_ModHandler.getModItem(MOD_ID_DC, "SnowQueenBloodDrop", 1L, 0), 1500, 48); - tDrop = getStackForType(DropType.LAPIS); - addProcessLV(tDrop,new FluidStack(FluidRegistry.getFluid("ic2coolant"), 200), GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 3), 5000, 1200,2); - RecipeManagers.squeezerManager.addRecipe(400, new ItemStack[]{tDrop}, new FluidStack(FluidRegistry.getFluid("ic2coolant"), 100), GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 3), 30); - tDrop = getStackForType(DropType.HYDRA); - addProcessMV(tDrop, Materials.FierySteel.getFluid(50L), GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 2), 3000, 8); - tDrop = getStackForType(DropType.OXYGEN); - addProcessLV(tDrop, new FluidStack(FluidRegistry.getFluid("liquidoxygen"), 100), GT_ModHandler.getModItem("ExtraBees", "propolis", 1L, 2), 250, 1200,8); - RecipeManagers.squeezerManager.addRecipe(400, new ItemStack[]{tDrop}, new FluidStack(FluidRegistry.getFluid("ic2coolant"), 100), GT_ModHandler.getModItem("ExtraBees", "propolis", 1L, 2), 30); - tDrop = getStackForType(DropType.ENDERGOO); - if ( Loader.isModLoaded("HardcoreEnderExpansion")) - addProcessHV(tDrop, new FluidStack(FluidRegistry.getFluid("endergoo"), 500), GT_Values.NI ,1000); - } - - public void addProcessLV(ItemStack tDrop, FluidStack aOutput, ItemStack aOutput2, int aChance, int aEUt) { - GT_Values.RA.addFluidExtractionRecipe(tDrop, aOutput2, aOutput, aChance, 32, aEUt); - } - public void addProcessLV(ItemStack tDrop, FluidStack aOutput, ItemStack aOutput2, int aChance, int aDuration, int aEUt) { - GT_Values.RA.addFluidExtractionRecipe(tDrop, aOutput2, aOutput, aChance, aDuration, aEUt); - } - public void addProcessMV(ItemStack tDrop, FluidStack aOutput, ItemStack aOutput2, int aChance, int aEUt) { - GT_Values.RA.addFluidExtractionRecipe(tDrop, aOutput2, aOutput, aChance, 128, aEUt); - } - public void addProcessHV(ItemStack tDrop, FluidStack aOutput, ItemStack aOutput2, int aChance) { - GT_Values.RA.addFluidExtractionRecipe(tDrop, aOutput2, aOutput, aChance, 480, 480); - } + public int getColorFromItemStack(ItemStack stack, int pass) { + int meta = Math.max(0, Math.min(DropType.values().length - 1, stack.getItemDamage())); + int colour = DropType.values()[meta].getColours()[0]; + + if (pass >= 1) { + colour = DropType.values()[meta].getColours()[1]; + } + + return colour; + } + + @Override + public String getItemStackDisplayName(ItemStack stack) { + return DropType.values()[stack.getItemDamage()].getName(); + } + + public void initDropsRecipes() { + ItemStack tDrop; + + tDrop = getStackForType(DropType.OIL); + addProcessLV( + tDrop, + Materials.OilHeavy.getFluid(100L), + GT_ModHandler.getModItem("Forestry", "propolis", 1L, 0), + 3000, + 8); + RecipeManagers.squeezerManager.addRecipe( + 40, + new ItemStack[] {tDrop}, + Materials.OilHeavy.getFluid(100L), + GT_ModHandler.getModItem("Forestry", "propolis", 1L, 0), + 30); + tDrop = getStackForType(DropType.COOLANT); + addProcessLV( + tDrop, + new FluidStack(FluidRegistry.getFluid("ic2coolant"), 100), + GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 0), + 3000, + 8); + RecipeManagers.squeezerManager.addRecipe( + 40, + new ItemStack[] {tDrop}, + new FluidStack(FluidRegistry.getFluid("ic2coolant"), 100), + GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 0), + 30); + tDrop = getStackForType(DropType.HOT_COOLANT); + addProcessLV( + tDrop, + new FluidStack(FluidRegistry.getFluid("ic2hotcoolant"), 100), + GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 2), + 3000, + 8); + RecipeManagers.squeezerManager.addRecipe( + 40, + new ItemStack[] {tDrop}, + new FluidStack(FluidRegistry.getFluid("ic2hotcoolant"), 100), + GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 2), + 30); + tDrop = getStackForType(DropType.SNOW_QUEEN); + addProcessMV( + tDrop, + Materials.FierySteel.getFluid(200L), + GT_ModHandler.getModItem(MOD_ID_DC, "SnowQueenBloodDrop", 1L, 0), + 1500, + 48); + tDrop = getStackForType(DropType.LAPIS); + addProcessLV( + tDrop, + new FluidStack(FluidRegistry.getFluid("ic2coolant"), 200), + GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 3), + 5000, + 1200, + 2); + RecipeManagers.squeezerManager.addRecipe( + 400, + new ItemStack[] {tDrop}, + new FluidStack(FluidRegistry.getFluid("ic2coolant"), 100), + GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 3), + 30); + tDrop = getStackForType(DropType.HYDRA); + addProcessMV( + tDrop, + Materials.FierySteel.getFluid(50L), + GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 2), + 3000, + 8); + tDrop = getStackForType(DropType.OXYGEN); + addProcessLV( + tDrop, + new FluidStack(FluidRegistry.getFluid("liquidoxygen"), 100), + GT_ModHandler.getModItem("ExtraBees", "propolis", 1L, 2), + 250, + 1200, + 8); + RecipeManagers.squeezerManager.addRecipe( + 400, + new ItemStack[] {tDrop}, + new FluidStack(FluidRegistry.getFluid("ic2coolant"), 100), + GT_ModHandler.getModItem("ExtraBees", "propolis", 1L, 2), + 30); + tDrop = getStackForType(DropType.ENDERGOO); + if (Loader.isModLoaded("HardcoreEnderExpansion")) + addProcessHV(tDrop, new FluidStack(FluidRegistry.getFluid("endergoo"), 500), GT_Values.NI, 1000); + } + + public void addProcessLV(ItemStack tDrop, FluidStack aOutput, ItemStack aOutput2, int aChance, int aEUt) { + GT_Values.RA.addFluidExtractionRecipe(tDrop, aOutput2, aOutput, aChance, 32, aEUt); + } + + public void addProcessLV( + ItemStack tDrop, FluidStack aOutput, ItemStack aOutput2, int aChance, int aDuration, int aEUt) { + GT_Values.RA.addFluidExtractionRecipe(tDrop, aOutput2, aOutput, aChance, aDuration, aEUt); + } + + public void addProcessMV(ItemStack tDrop, FluidStack aOutput, ItemStack aOutput2, int aChance, int aEUt) { + GT_Values.RA.addFluidExtractionRecipe(tDrop, aOutput2, aOutput, aChance, 128, aEUt); + } + + public void addProcessHV(ItemStack tDrop, FluidStack aOutput, ItemStack aOutput2, int aChance) { + GT_Values.RA.addFluidExtractionRecipe(tDrop, aOutput2, aOutput, aChance, 480, 480); + } } diff --git a/src/main/java/gregtech/common/items/ItemPollen.java b/src/main/java/gregtech/common/items/ItemPollen.java index bc41b1c83d..0532d52f9d 100644 --- a/src/main/java/gregtech/common/items/ItemPollen.java +++ b/src/main/java/gregtech/common/items/ItemPollen.java @@ -1,89 +1,86 @@ package gregtech.common.items; +import static gregtech.api.enums.GT_Values.MOD_ID; + import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import forestry.api.core.Tabs; +import java.util.List; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; -import java.util.List; - -import static gregtech.api.enums.GT_Values.MOD_ID; - public class ItemPollen extends Item { - @SideOnly(Side.CLIENT) - private IIcon secondIcon; - - public ItemPollen() { - super(); - this.setCreativeTab(Tabs.tabApiculture); - this.setHasSubtypes(true); - this.setUnlocalizedName("gt.pollen"); - GameRegistry.registerItem(this, "gt.pollen", MOD_ID); - } - - public ItemStack getStackForType(PollenType type) { - return new ItemStack(this, 1, type.ordinal()); - } - - public ItemStack getStackForType(PollenType type, int count) { - return new ItemStack(this, count, type.ordinal()); - } + @SideOnly(Side.CLIENT) + private IIcon secondIcon; - @Override - @SideOnly(Side.CLIENT) - public void getSubItems(Item item, CreativeTabs tabs, List list) { - for (PollenType type : PollenType.values()) { - if (type.showInList) { - list.add(this.getStackForType(type)); - } - } - } + public ItemPollen() { + super(); + this.setCreativeTab(Tabs.tabApiculture); + this.setHasSubtypes(true); + this.setUnlocalizedName("gt.pollen"); + GameRegistry.registerItem(this, "gt.pollen", MOD_ID); + } - @Override - @SideOnly(Side.CLIENT) - public boolean requiresMultipleRenderPasses() { - return true; - } + public ItemStack getStackForType(PollenType type) { + return new ItemStack(this, 1, type.ordinal()); + } - @Override - public int getRenderPasses(int meta) { - return 2; - } + public ItemStack getStackForType(PollenType type, int count) { + return new ItemStack(this, count, type.ordinal()); + } - @Override + @Override @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister iconRegister) { - this.itemIcon = iconRegister.registerIcon("forestry:pollen.0"); - this.secondIcon = iconRegister.registerIcon("forestry:pollen.1"); - } + public void getSubItems(Item item, CreativeTabs tabs, List list) { + for (PollenType type : PollenType.values()) { + if (type.showInList) { + list.add(this.getStackForType(type)); + } + } + } + + @Override + @SideOnly(Side.CLIENT) + public boolean requiresMultipleRenderPasses() { + return true; + } - @Override - public IIcon getIcon(ItemStack stack, int pass) { - return (pass == 0) ? itemIcon : secondIcon; - } + @Override + public int getRenderPasses(int meta) { + return 2; + } - @Override - @SideOnly(Side.CLIENT) - public int getColorFromItemStack(ItemStack stack, int pass) { - int meta = Math.max(0, Math.min(PollenType.values().length - 1, stack.getItemDamage())); - int colour = PollenType.values()[meta].getColours()[0]; + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) { + this.itemIcon = iconRegister.registerIcon("forestry:pollen.0"); + this.secondIcon = iconRegister.registerIcon("forestry:pollen.1"); + } - if (pass >= 1) { - colour = PollenType.values()[meta].getColours()[1]; - } + @Override + public IIcon getIcon(ItemStack stack, int pass) { + return (pass == 0) ? itemIcon : secondIcon; + } - return colour; - } + @Override + @SideOnly(Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) { + int meta = Math.max(0, Math.min(PollenType.values().length - 1, stack.getItemDamage())); + int colour = PollenType.values()[meta].getColours()[0]; - @Override - public String getItemStackDisplayName(ItemStack stack) { - return PollenType.values()[stack.getItemDamage()].getName(); - } + if (pass >= 1) { + colour = PollenType.values()[meta].getColours()[1]; + } + return colour; + } + @Override + public String getItemStackDisplayName(ItemStack stack) { + return PollenType.values()[stack.getItemDamage()].getName(); + } } diff --git a/src/main/java/gregtech/common/items/ItemPropolis.java b/src/main/java/gregtech/common/items/ItemPropolis.java index 729958a72e..dbb5f45786 100644 --- a/src/main/java/gregtech/common/items/ItemPropolis.java +++ b/src/main/java/gregtech/common/items/ItemPropolis.java @@ -1,5 +1,8 @@ package gregtech.common.items; +import static gregtech.api.enums.GT_Values.MOD_ID; +import static gregtech.api.enums.GT_Values.MOD_ID_DC; + import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -9,6 +12,7 @@ import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; +import java.util.List; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; @@ -16,96 +20,96 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraftforge.fluids.FluidRegistry; -import java.util.List; +public class ItemPropolis extends Item { + @SideOnly(Side.CLIENT) + private IIcon secondIcon; -import static gregtech.api.enums.GT_Values.MOD_ID; -import static gregtech.api.enums.GT_Values.MOD_ID_DC; + public ItemPropolis() { + super(); + this.setCreativeTab(Tabs.tabApiculture); + this.setHasSubtypes(true); + this.setUnlocalizedName("gt.propolis"); + GameRegistry.registerItem(this, "gt.propolis", MOD_ID); + } -public class ItemPropolis extends Item { - @SideOnly(Side.CLIENT) - private IIcon secondIcon; - - public ItemPropolis() { - super(); - this.setCreativeTab(Tabs.tabApiculture); - this.setHasSubtypes(true); - this.setUnlocalizedName("gt.propolis"); - GameRegistry.registerItem(this, "gt.propolis", MOD_ID); - } - - public ItemStack getStackForType(PropolisType type) { - return new ItemStack(this, 1, type.ordinal()); - } - - public ItemStack getStackForType(PropolisType type, int count) { - return new ItemStack(this, count, type.ordinal()); - } - - @Override - @SideOnly(Side.CLIENT) - public void getSubItems(Item item, CreativeTabs tabs, List list) { - for (PropolisType type : PropolisType.values()) { - if (type.showInList) { - list.add(this.getStackForType(type)); - } - } - } - - - @Override + public ItemStack getStackForType(PropolisType type) { + return new ItemStack(this, 1, type.ordinal()); + } + + public ItemStack getStackForType(PropolisType type, int count) { + return new ItemStack(this, count, type.ordinal()); + } + + @Override + @SideOnly(Side.CLIENT) + public void getSubItems(Item item, CreativeTabs tabs, List list) { + for (PropolisType type : PropolisType.values()) { + if (type.showInList) { + list.add(this.getStackForType(type)); + } + } + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) { + this.itemIcon = iconRegister.registerIcon("forestry:propolis.0"); + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) { + return itemIcon; + } + + @Override @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister iconRegister) { - this.itemIcon = iconRegister.registerIcon("forestry:propolis.0"); - } - - @Override - public IIcon getIcon(ItemStack stack, int pass) { - return itemIcon; - } - - @Override - @SideOnly(Side.CLIENT) - public int getColorFromItemStack(ItemStack stack, int pass) { - int meta = Math.max(0, Math.min(PropolisType.values().length - 1, stack.getItemDamage())); - return PropolisType.values()[meta].getColours(); - } - - @Override - public String getItemStackDisplayName(ItemStack stack) { - return PropolisType.values()[stack.getItemDamage()].getName(); - } - public void initPropolisRecipes() { - ItemStack tPropolis; - - tPropolis = getStackForType(PropolisType.End); - addProcessHV(tPropolis, GT_ModHandler.getModItem("HardcoreEnderExpansion", "end_powder", 1, 0)); - tPropolis = getStackForType(PropolisType.Stardust); - addProcessHV(tPropolis, GT_ModHandler.getModItem("HardcoreEnderExpansion", "stardust", 1, 0)); - tPropolis = getStackForType(PropolisType.Ectoplasma); - addProcessEV(tPropolis, GT_ModHandler.getModItem(MOD_ID_DC, "item.EctoplasmaChip", 1, 0)); - tPropolis = getStackForType(PropolisType.Arcaneshard); - addProcessEV(tPropolis, GT_ModHandler.getModItem(MOD_ID_DC, "item.ArcaneShardChip", 1, 0)); - tPropolis = getStackForType(PropolisType.Dragonessence); - addProcessIV(tPropolis, GT_ModHandler.getModItem("HardcoreEnderExpansion", "essence", 16, 0)); - tPropolis = getStackForType(PropolisType.Enderman); - addProcessIV(tPropolis, GT_ModHandler.getModItem("HardcoreEnderExpansion", "enderman_head", 1, 0)); - tPropolis = getStackForType(PropolisType.Silverfish); - addProcessEV(tPropolis, GT_ModHandler.getModItem("HardcoreEnderExpansion", "silverfish_blood", 1, 0)); - tPropolis = getStackForType(PropolisType.Endium); - addProcessHV(tPropolis, GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.HeeEndium, 1)); - tPropolis = getStackForType(PropolisType.Fireessence); - addProcessIV(tPropolis, GT_ModHandler.getModItem("HardcoreEnderExpansion", "essence", 16, 1)); - - //addRecipe(tDrop, aOutput, aOutput2, aChance, aDuration, aEUt); - } - - public void addProcessHV(ItemStack tPropolis, ItemStack aOutput2) { - GT_Values.RA.addFluidExtractionRecipe(tPropolis, aOutput2, FluidRegistry.getFluidStack("endergoo",100), 5000, 50, 480); - } - public void addProcessEV(ItemStack tPropolis, ItemStack aOutput2) { - GT_Values.RA.addFluidExtractionRecipe(tPropolis, aOutput2, FluidRegistry.getFluidStack("endergoo",200), 2500, 100, 1920); - } - public void addProcessIV(ItemStack tPropolis, ItemStack aOutput2) { - GT_Values.RA.addFluidExtractionRecipe(tPropolis, aOutput2, FluidRegistry.getFluidStack("endergoo",300), 1500, 150, 7680); - } + public int getColorFromItemStack(ItemStack stack, int pass) { + int meta = Math.max(0, Math.min(PropolisType.values().length - 1, stack.getItemDamage())); + return PropolisType.values()[meta].getColours(); + } + + @Override + public String getItemStackDisplayName(ItemStack stack) { + return PropolisType.values()[stack.getItemDamage()].getName(); + } + + public void initPropolisRecipes() { + ItemStack tPropolis; + + tPropolis = getStackForType(PropolisType.End); + addProcessHV(tPropolis, GT_ModHandler.getModItem("HardcoreEnderExpansion", "end_powder", 1, 0)); + tPropolis = getStackForType(PropolisType.Stardust); + addProcessHV(tPropolis, GT_ModHandler.getModItem("HardcoreEnderExpansion", "stardust", 1, 0)); + tPropolis = getStackForType(PropolisType.Ectoplasma); + addProcessEV(tPropolis, GT_ModHandler.getModItem(MOD_ID_DC, "item.EctoplasmaChip", 1, 0)); + tPropolis = getStackForType(PropolisType.Arcaneshard); + addProcessEV(tPropolis, GT_ModHandler.getModItem(MOD_ID_DC, "item.ArcaneShardChip", 1, 0)); + tPropolis = getStackForType(PropolisType.Dragonessence); + addProcessIV(tPropolis, GT_ModHandler.getModItem("HardcoreEnderExpansion", "essence", 16, 0)); + tPropolis = getStackForType(PropolisType.Enderman); + addProcessIV(tPropolis, GT_ModHandler.getModItem("HardcoreEnderExpansion", "enderman_head", 1, 0)); + tPropolis = getStackForType(PropolisType.Silverfish); + addProcessEV(tPropolis, GT_ModHandler.getModItem("HardcoreEnderExpansion", "silverfish_blood", 1, 0)); + tPropolis = getStackForType(PropolisType.Endium); + addProcessHV(tPropolis, GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.HeeEndium, 1)); + tPropolis = getStackForType(PropolisType.Fireessence); + addProcessIV(tPropolis, GT_ModHandler.getModItem("HardcoreEnderExpansion", "essence", 16, 1)); + + // addRecipe(tDrop, aOutput, aOutput2, aChance, aDuration, aEUt); + } + + public void addProcessHV(ItemStack tPropolis, ItemStack aOutput2) { + GT_Values.RA.addFluidExtractionRecipe( + tPropolis, aOutput2, FluidRegistry.getFluidStack("endergoo", 100), 5000, 50, 480); + } + + public void addProcessEV(ItemStack tPropolis, ItemStack aOutput2) { + GT_Values.RA.addFluidExtractionRecipe( + tPropolis, aOutput2, FluidRegistry.getFluidStack("endergoo", 200), 2500, 100, 1920); + } + + public void addProcessIV(ItemStack tPropolis, ItemStack aOutput2) { + GT_Values.RA.addFluidExtractionRecipe( + tPropolis, aOutput2, FluidRegistry.getFluidStack("endergoo", 300), 1500, 150, 7680); + } } diff --git a/src/main/java/gregtech/common/items/PollenType.java b/src/main/java/gregtech/common/items/PollenType.java index a4d670a0d0..cb7499e862 100644 --- a/src/main/java/gregtech/common/items/PollenType.java +++ b/src/main/java/gregtech/common/items/PollenType.java @@ -4,16 +4,16 @@ import gregtech.api.enums.Materials; import gregtech.api.util.GT_LanguageManager; public enum PollenType { + MATRIX("matrix", true); - MATRIX("matrix",true); - - private static int[][] colours = new int[][]{ - {0x19191B, 0x303032}, + private static int[][] colours = new int[][] { + {0x19191B, 0x303032}, }; public boolean showInList; public Materials material; public int chance; private String name; + private PollenType(String pName, boolean show) { this.name = pName; this.showInList = show; @@ -24,7 +24,8 @@ public enum PollenType { } public String getName() { - return GT_LanguageManager.addStringLocalization("pollen." + this.name, this.name.substring(0, 1).toUpperCase() + this.name.substring(1) + " Pollen"); + return GT_LanguageManager.addStringLocalization( + "pollen." + this.name, this.name.substring(0, 1).toUpperCase() + this.name.substring(1) + " Pollen"); } public int[] getColours() { diff --git a/src/main/java/gregtech/common/items/PropolisType.java b/src/main/java/gregtech/common/items/PropolisType.java index 04550e899b..4d3d7407f8 100644 --- a/src/main/java/gregtech/common/items/PropolisType.java +++ b/src/main/java/gregtech/common/items/PropolisType.java @@ -4,33 +4,24 @@ import gregtech.api.enums.Materials; import gregtech.api.util.GT_LanguageManager; public enum PropolisType { - - End("End",true), - Ectoplasma("Ectoplasma",true), - Arcaneshard("Arcaneshard",true), - Stardust("Stardust",true), - Dragonessence("Dragonessence",true), - Enderman("Enderman",true), - Silverfish("Silverfish", true), + End("End", true), + Ectoplasma("Ectoplasma", true), + Arcaneshard("Arcaneshard", true), + Stardust("Stardust", true), + Dragonessence("Dragonessence", true), + Enderman("Enderman", true), + Silverfish("Silverfish", true), Endium("Endium", true), - Fireessence("Fireessence",true); - - private static int[] colours = new int[]{ - 0xCC00FA, - 0xDCB0E5, - 0x9010AD, - 0xFFFF00, - 0x911ECE, - 0x161616, - 0xEE053D, - 0xa0ffff, - 0xD41238 - }; + Fireessence("Fireessence", true); + + private static int[] colours = + new int[] {0xCC00FA, 0xDCB0E5, 0x9010AD, 0xFFFF00, 0x911ECE, 0x161616, 0xEE053D, 0xa0ffff, 0xD41238}; public boolean showInList; public Materials material; public int chance; private String name; + private PropolisType(String pName, boolean show) { this.name = pName; this.showInList = show; @@ -41,8 +32,10 @@ public enum PropolisType { } public String getName() { -// return "gt.comb."+this.name; - return GT_LanguageManager.addStringLocalization("propolis." + this.name, this.name.substring(0, 1).toUpperCase() + this.name.substring(1) + " Propolis"); + // return "gt.comb."+this.name; + return GT_LanguageManager.addStringLocalization( + "propolis." + this.name, + this.name.substring(0, 1).toUpperCase() + this.name.substring(1) + " Propolis"); } public int getColours() { diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Arrow.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Arrow.java index 1ff076dd78..9c7d261eb6 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Arrow.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Arrow.java @@ -30,7 +30,12 @@ public class Behaviour_Arrow extends Behaviour_None { this(aArrow, aSpeed, aPrecision, null, 0); } - public Behaviour_Arrow(Class<? extends GT_Entity_Arrow> aArrow, float aSpeed, float aPrecision, Enchantment aEnchantment, int aLevel) { + public Behaviour_Arrow( + Class<? extends GT_Entity_Arrow> aArrow, + float aSpeed, + float aPrecision, + Enchantment aEnchantment, + int aLevel) { this.mArrow = aArrow; this.mSpeedMultiplier = aSpeed; this.mPrecision = aPrecision; @@ -77,9 +82,15 @@ public class Behaviour_Arrow extends Behaviour_None { World aWorld = aSource.getWorld(); IPosition tPosition = BlockDispenser.func_149939_a(aSource); EnumFacing tFacing = BlockDispenser.func_149937_b(aSource.getBlockMetadata()); - GT_Entity_Arrow tEntityArrow = (GT_Entity_Arrow) getProjectile(aItem, SubTag.PROJECTILE_ARROW, aStack, aWorld, tPosition.getX(), tPosition.getY(), tPosition.getZ()); + GT_Entity_Arrow tEntityArrow = (GT_Entity_Arrow) getProjectile( + aItem, SubTag.PROJECTILE_ARROW, aStack, aWorld, tPosition.getX(), tPosition.getY(), tPosition.getZ()); if (tEntityArrow != null) { - tEntityArrow.setThrowableHeading(tFacing.getFrontOffsetX(), tFacing.getFrontOffsetY() + 0.1F, tFacing.getFrontOffsetZ(), this.mSpeedMultiplier * 1.1F, this.mPrecision); + tEntityArrow.setThrowableHeading( + tFacing.getFrontOffsetX(), + tFacing.getFrontOffsetY() + 0.1F, + tFacing.getFrontOffsetZ(), + this.mSpeedMultiplier * 1.1F, + this.mPrecision); tEntityArrow.setArrowItem(aStack); tEntityArrow.canBePickedUp = 1; aWorld.spawnEntityInWorld(tEntityArrow); @@ -97,21 +108,40 @@ public class Behaviour_Arrow extends Behaviour_None { } @Override - public EntityArrow getProjectile(GT_MetaBase_Item aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, double aX, double aY, double aZ) { + public EntityArrow getProjectile( + GT_MetaBase_Item aItem, + SubTag aProjectileType, + ItemStack aStack, + World aWorld, + double aX, + double aY, + double aZ) { if (!hasProjectile(aItem, aProjectileType, aStack)) { return null; } - GT_Entity_Arrow rArrow = (GT_Entity_Arrow) GT_Utility.callConstructor(this.mArrow.getName(), -1, null, true, new Object[]{aWorld, Double.valueOf(aX), Double.valueOf(aY), Double.valueOf(aZ)}); + GT_Entity_Arrow rArrow = + (GT_Entity_Arrow) GT_Utility.callConstructor(this.mArrow.getName(), -1, null, true, new Object[] { + aWorld, Double.valueOf(aX), Double.valueOf(aY), Double.valueOf(aZ) + }); rArrow.setArrowItem(aStack); return rArrow; } @Override - public EntityArrow getProjectile(GT_MetaBase_Item aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, EntityLivingBase aEntity, float aSpeed) { + public EntityArrow getProjectile( + GT_MetaBase_Item aItem, + SubTag aProjectileType, + ItemStack aStack, + World aWorld, + EntityLivingBase aEntity, + float aSpeed) { if (!hasProjectile(aItem, aProjectileType, aStack)) { return null; } - GT_Entity_Arrow rArrow = (GT_Entity_Arrow) GT_Utility.callConstructor(this.mArrow.getName(), -1, null, true, new Object[]{aWorld, aEntity, Float.valueOf(this.mSpeedMultiplier * aSpeed)}); + GT_Entity_Arrow rArrow = + (GT_Entity_Arrow) GT_Utility.callConstructor(this.mArrow.getName(), -1, null, true, new Object[] { + aWorld, aEntity, Float.valueOf(this.mSpeedMultiplier * aSpeed) + }); rArrow.setArrowItem(aStack); return rArrow; } diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Arrow_Potion.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Arrow_Potion.java index d6f035119d..8b2d4ab4ce 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Arrow_Potion.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Arrow_Potion.java @@ -20,7 +20,8 @@ public class Behaviour_Arrow_Potion extends Behaviour_Arrow { this.mPotions = aPotions; } - public Behaviour_Arrow_Potion(float aSpeed, float aPrecision, Enchantment aEnchantment, int aLevel, int... aPotions) { + public Behaviour_Arrow_Potion( + float aSpeed, float aPrecision, Enchantment aEnchantment, int aLevel, int... aPotions) { super(GT_Entity_Arrow_Potion.class, aSpeed, aPrecision, aEnchantment, aLevel); this.mPotions = aPotions; } @@ -30,7 +31,9 @@ public class Behaviour_Arrow_Potion extends Behaviour_Arrow { if ((aEntity instanceof EntityLivingBase)) { for (int i = 3; i < this.mPotions.length; i += 4) { if (aEntity.worldObj.rand.nextInt(100) < this.mPotions[i]) { - ((EntityLivingBase) aEntity).addPotionEffect(new PotionEffect(this.mPotions[(i - 3)], this.mPotions[(i - 2)], this.mPotions[(i - 1)], false)); + ((EntityLivingBase) aEntity) + .addPotionEffect(new PotionEffect( + this.mPotions[(i - 3)], this.mPotions[(i - 2)], this.mPotions[(i - 1)], false)); } } } @@ -38,7 +41,14 @@ public class Behaviour_Arrow_Potion extends Behaviour_Arrow { } @Override - public EntityArrow getProjectile(GT_MetaBase_Item aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, double aX, double aY, double aZ) { + public EntityArrow getProjectile( + GT_MetaBase_Item aItem, + SubTag aProjectileType, + ItemStack aStack, + World aWorld, + double aX, + double aY, + double aZ) { if (!hasProjectile(aItem, aProjectileType, aStack)) { return null; } @@ -49,7 +59,13 @@ public class Behaviour_Arrow_Potion extends Behaviour_Arrow { } @Override - public EntityArrow getProjectile(GT_MetaBase_Item aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, EntityLivingBase aEntity, float aSpeed) { + public EntityArrow getProjectile( + GT_MetaBase_Item aItem, + SubTag aProjectileType, + ItemStack aStack, + World aWorld, + EntityLivingBase aEntity, + float aSpeed) { if (!hasProjectile(aItem, aProjectileType, aStack)) { return null; } diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Cover_Tool.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Cover_Tool.java index 192acfc4a3..c0bda95262 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Cover_Tool.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Cover_Tool.java @@ -6,6 +6,8 @@ import gregtech.api.interfaces.IItemBehaviour; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.items.GT_MetaBase_Item; import gregtech.api.util.*; +import java.util.ArrayList; +import java.util.List; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; @@ -16,18 +18,27 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import java.util.ArrayList; -import java.util.List; - -public class Behaviour_Cover_Tool extends Behaviour_None { +public class Behaviour_Cover_Tool extends Behaviour_None { public static final IItemBehaviour<GT_MetaBase_Item> INSTANCE = new Behaviour_Cover_Tool(); - private final String mTooltip = GT_LanguageManager.addStringLocalization("gt.behaviour.cover_copy_paste", "Can copy/paste cover data."); + private final String mTooltip = + GT_LanguageManager.addStringLocalization("gt.behaviour.cover_copy_paste", "Can copy/paste cover data."); private ISerializableObject mStoredData = GregTech_API.sNoBehavior.createDataObject(); private int mCoverType; @Override - public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { + public boolean onItemUseFirst( + GT_MetaBase_Item aItem, + ItemStack aStack, + EntityPlayer aPlayer, + World aWorld, + int aX, + int aY, + int aZ, + int aSide, + float hitX, + float hitY, + float hitZ) { if (aWorld.isRemote) { return false; } @@ -42,8 +53,7 @@ public class Behaviour_Cover_Tool extends Behaviour_None { aItem.discharge(aStack, 100.0D, Integer.MAX_VALUE, true, false, false); writeListToNBT(tList, tNBT, aPlayer); saveDataToNBT(tNBT); - } - else { + } else { doPaste(tTileEntity, aSide, hitX, hitY, hitZ, aPlayer); aItem.discharge(aStack, 25.0D, Integer.MAX_VALUE, true, false, false); } @@ -57,10 +67,8 @@ public class Behaviour_Cover_Tool extends Behaviour_None { mCoverType = aNBT.getInteger("mCoverType"); GT_CoverBehaviorBase<?> tBehavior = GregTech_API.getCoverBehaviorNew(mCoverType); NBTBase tData = aNBT.getTag("mCoverData"); - if (tData != null) - mStoredData = tBehavior.createDataObject(tData); - else - mStoredData = GregTech_API.sNoBehavior.createDataObject(); + if (tData != null) mStoredData = tBehavior.createDataObject(tData); + else mStoredData = GregTech_API.sNoBehavior.createDataObject(); } } @@ -83,42 +91,46 @@ public class Behaviour_Cover_Tool extends Behaviour_None { } @SuppressWarnings({"unchecked", "rawtypes"}) - private void doCopy(TileEntity aTileEntity, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ, List aList) { + private void doCopy( + TileEntity aTileEntity, + World aWorld, + int aX, + int aY, + int aZ, + int aSide, + float hitX, + float hitY, + float hitZ, + List aList) { aList.add( - "----- X: " + EnumChatFormatting.AQUA + GT_Utility.formatNumbers(aX) + EnumChatFormatting.RESET + - " Y: " + EnumChatFormatting.AQUA + GT_Utility.formatNumbers(aY) + EnumChatFormatting.RESET + - " Z: " + EnumChatFormatting.AQUA + GT_Utility.formatNumbers(aZ) + EnumChatFormatting.RESET + - " D: " + EnumChatFormatting.AQUA + aWorld.provider.dimensionId + EnumChatFormatting.RESET + " -----" - ); + "----- X: " + EnumChatFormatting.AQUA + GT_Utility.formatNumbers(aX) + EnumChatFormatting.RESET + " Y: " + + EnumChatFormatting.AQUA + GT_Utility.formatNumbers(aY) + EnumChatFormatting.RESET + " Z: " + + EnumChatFormatting.AQUA + GT_Utility.formatNumbers(aZ) + EnumChatFormatting.RESET + " D: " + + EnumChatFormatting.AQUA + aWorld.provider.dimensionId + EnumChatFormatting.RESET + " -----"); if (aTileEntity instanceof ICoverable) { ICoverable tCoverable = (ICoverable) aTileEntity; - int tSide = tCoverable.getCoverItemAtSide((byte) aSide) != null ? aSide : - tCoverable.getCoverItemAtSide(GT_Utility.determineWrenchingSide((byte) aSide, hitX, hitY, hitZ)) != null ? - GT_Utility.determineWrenchingSide((byte) aSide, hitX, hitY, hitZ) : -1; + int tSide = tCoverable.getCoverItemAtSide((byte) aSide) != null + ? aSide + : tCoverable.getCoverItemAtSide(GT_Utility.determineWrenchingSide((byte) aSide, hitX, hitY, hitZ)) + != null + ? GT_Utility.determineWrenchingSide((byte) aSide, hitX, hitY, hitZ) + : -1; if (tSide != -1) { mStoredData = tCoverable.getComplexCoverDataAtSide((byte) tSide); mCoverType = tCoverable.getCoverIDAtSide((byte) tSide); - aList.add( - "Block Side: " + EnumChatFormatting.AQUA + ForgeDirection.getOrientation(tSide).name() + EnumChatFormatting.RESET - ); - aList.add( - "Cover Type: " + EnumChatFormatting.GREEN + tCoverable.getCoverItemAtSide((byte) tSide).getDisplayName() + EnumChatFormatting.RESET - ); - } - else { + aList.add("Block Side: " + EnumChatFormatting.AQUA + + ForgeDirection.getOrientation(tSide).name() + EnumChatFormatting.RESET); + aList.add("Cover Type: " + EnumChatFormatting.GREEN + + tCoverable.getCoverItemAtSide((byte) tSide).getDisplayName() + EnumChatFormatting.RESET); + } else { mStoredData = GregTech_API.sNoBehavior.createDataObject(); mCoverType = 0; - aList.add( - "No Cover Found" - ); + aList.add("No Cover Found"); } - } - else { + } else { mStoredData = GregTech_API.sNoBehavior.createDataObject(); mCoverType = 0; - aList.add( - "No Cover Found" - ); + aList.add("No Cover Found"); } } @@ -129,20 +141,21 @@ public class Behaviour_Cover_Tool extends Behaviour_None { GT_Utility.sendChatToPlayer(aPlayer, "Please Copy a Valid Cover First."); return; } - int tSide = tCoverable.getCoverItemAtSide((byte) aSide) != null ? aSide : - tCoverable.getCoverItemAtSide(GT_Utility.determineWrenchingSide((byte) aSide, hitX, hitY, hitZ)) != null ? - GT_Utility.determineWrenchingSide((byte) aSide, hitX, hitY, hitZ) : -1; + int tSide = tCoverable.getCoverItemAtSide((byte) aSide) != null + ? aSide + : tCoverable.getCoverItemAtSide(GT_Utility.determineWrenchingSide((byte) aSide, hitX, hitY, hitZ)) + != null + ? GT_Utility.determineWrenchingSide((byte) aSide, hitX, hitY, hitZ) + : -1; if (tSide != -1) { int tCoverID = tCoverable.getCoverIDAtSide((byte) tSide); if (tCoverID == mCoverType) { tCoverable.setCoverDataAtSide((byte) tSide, mStoredData); GT_Utility.sendChatToPlayer(aPlayer, "Cover Data Pasted."); - } - else { + } else { GT_Utility.sendChatToPlayer(aPlayer, "Not Matched Cover."); } - } - else { + } else { GT_Utility.sendChatToPlayer(aPlayer, "No Cover Found."); } } @@ -154,11 +167,11 @@ public class Behaviour_Cover_Tool extends Behaviour_None { NBTTagCompound tNBT = aStack.getTagCompound(); int tSize = tNBT.getInteger("dataLinesCount"); if (tSize < 1) throw new Exception(); - aList.add(EnumChatFormatting.BLUE+"Stored Cover Data:"); + aList.add(EnumChatFormatting.BLUE + "Stored Cover Data:"); for (int i = 0; i < tSize; i++) { aList.add(EnumChatFormatting.RESET + tNBT.getString("dataLines" + i)); } - } catch (Exception e){ + } catch (Exception e) { aList.add(this.mTooltip); } return aList; diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Crowbar.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Crowbar.java index afaa2f7016..866eb6b9e9 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Crowbar.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Crowbar.java @@ -20,7 +20,18 @@ public class Behaviour_Crowbar extends Behaviour_None { } @Override - public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { + public boolean onItemUseFirst( + GT_MetaBase_Item aItem, + ItemStack aStack, + EntityPlayer aPlayer, + World aWorld, + int aX, + int aY, + int aZ, + int aSide, + float hitX, + float hitY, + float hitZ) { if (aWorld.isRemote) { return false; } diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_DataOrb.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_DataOrb.java index a5393cdec5..f219db6e0c 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_DataOrb.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_DataOrb.java @@ -2,12 +2,11 @@ package gregtech.common.items.behaviors; import gregtech.api.items.GT_MetaBase_Item; import gregtech.api.util.GT_Utility; +import java.util.List; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; -import java.util.List; - public class Behaviour_DataOrb extends Behaviour_None { public static void copyInventory(ItemStack[] aInventory, ItemStack[] aNewContent, int aIndexlength) { for (int i = 0; i < aIndexlength; i++) { diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_DataStick.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_DataStick.java index bf1c4a2be0..27efe7230d 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_DataStick.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_DataStick.java @@ -2,9 +2,8 @@ package gregtech.common.items.behaviors; import gregtech.api.items.GT_MetaBase_Item; import gregtech.api.util.GT_Utility; -import net.minecraft.item.ItemStack; - import java.util.List; +import net.minecraft.item.ItemStack; public class Behaviour_DataStick extends Behaviour_None { @Override @@ -24,34 +23,34 @@ public class Behaviour_DataStick extends Behaviour_None { tString = GT_Utility.ItemNBT.getPunchCardData(aStack); if (GT_Utility.isStringValid(tString)) { aList.add("Punch Card Data"); - int i = 0;int j = tString.length(); + int i = 0; + int j = tString.length(); for (; i < j; i += 64) { aList.add(tString.substring(i, Math.min(i + 64, j))); } } short sTier = GT_Utility.ItemNBT.getNBT(aStack).getShort("rocket_tier"); - if (sTier > 0 && sTier<100) { - aList.add("Rocket Schematic Tier: " + sTier); - }else if (sTier>=100) { - switch (sTier) { - case 100: { - aList.add("Moonbuggy Schematic"); - break; - } - case 101: { - aList.add("Cargo-Rocket Schematic"); - break; - } - case 102: { - aList.add("Astro-Miner Schematic"); - break; - } - } + if (sTier > 0 && sTier < 100) { + aList.add("Rocket Schematic Tier: " + sTier); + } else if (sTier >= 100) { + switch (sTier) { + case 100: { + aList.add("Moonbuggy Schematic"); + break; + } + case 101: { + aList.add("Cargo-Rocket Schematic"); + break; + } + case 102: { + aList.add("Astro-Miner Schematic"); + break; + } + } } - long lastUpdate = GT_Utility.ItemNBT.getNBT(aStack).getLong("lastUpdate"); - if (lastUpdate != 0) - aList.add(String.format("Last update at: %tc", lastUpdate)); - + long lastUpdate = GT_Utility.ItemNBT.getNBT(aStack).getLong("lastUpdate"); + if (lastUpdate != 0) aList.add(String.format("Last update at: %tc", lastUpdate)); + return aList; } } diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Hoe.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Hoe.java index 882f136cfa..6194537a5b 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Hoe.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Hoe.java @@ -6,6 +6,7 @@ import gregtech.api.items.GT_MetaGenerated_Tool; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Utility; import gregtech.api.util.WorldSpawnedEventBuilder; +import java.util.List; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; @@ -14,8 +15,6 @@ import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.player.UseHoeEvent; -import java.util.List; - public class Behaviour_Hoe extends Behaviour_None { private final int mCosts; private final String mTooltip = GT_LanguageManager.addStringLocalization("gt.behaviour.hoe", "Can till Dirt"); @@ -25,7 +24,18 @@ public class Behaviour_Hoe extends Behaviour_None { } @Override - public boolean onItemUse(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { + public boolean onItemUse( + GT_MetaBase_Item aItem, + ItemStack aStack, + EntityPlayer aPlayer, + World aWorld, + int aX, + int aY, + int aZ, + int aSide, + float hitX, + float hitY, + float hitZ) { if (!aPlayer.canPlayerEdit(aX, aY, aZ, aSide, aStack)) { return false; } @@ -40,7 +50,9 @@ public class Behaviour_Hoe extends Behaviour_None { return true; } Block aBlock = aWorld.getBlock(aX, aY, aZ); - if ((aSide != 0) && (GT_Utility.isBlockAir(aWorld, aX, aY + 1, aZ)) && ((aBlock == Blocks.grass) || (aBlock == Blocks.dirt))) { + if ((aSide != 0) + && (GT_Utility.isBlockAir(aWorld, aX, aY + 1, aZ)) + && ((aBlock == Blocks.grass) || (aBlock == Blocks.dirt))) { new WorldSpawnedEventBuilder.SoundEventBuilder() .setVolume((Blocks.farmland.stepSound.getVolume() + 1.0F) / 2.0F) .setPitch(Blocks.farmland.stepSound.getPitch() * 0.8F) diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Lighter.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Lighter.java index 61081f060d..f18f9cd17a 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Lighter.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Lighter.java @@ -5,6 +5,7 @@ import gregtech.api.enums.SoundResource; import gregtech.api.items.GT_MetaBase_Item; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Utility; +import java.util.List; import net.minecraft.entity.Entity; import net.minecraft.entity.monster.EntityCreeper; import net.minecraft.entity.player.EntityPlayer; @@ -15,18 +16,20 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import java.util.List; - public class Behaviour_Lighter extends Behaviour_None { private final ItemStack mEmptyLighter; private final ItemStack mUsedLighter; private final ItemStack mFullLighter; private final long mFuelAmount; - private final String mTooltip = GT_LanguageManager.addStringLocalization("gt.behaviour.lighter.tooltip", "Can light things on Fire"); - private final String mTooltipUses = GT_LanguageManager.addStringLocalization("gt.behaviour.lighter.uses", "Remaining Uses:"); - private final String mTooltipUnstackable = GT_LanguageManager.addStringLocalization("gt.behaviour.unstackable", "Not usable when stacked!"); + private final String mTooltip = + GT_LanguageManager.addStringLocalization("gt.behaviour.lighter.tooltip", "Can light things on Fire"); + private final String mTooltipUses = + GT_LanguageManager.addStringLocalization("gt.behaviour.lighter.uses", "Remaining Uses:"); + private final String mTooltipUnstackable = + GT_LanguageManager.addStringLocalization("gt.behaviour.unstackable", "Not usable when stacked!"); - public Behaviour_Lighter(ItemStack aEmptyLighter, ItemStack aUsedLighter, ItemStack aFullLighter, long aFuelAmount) { + public Behaviour_Lighter( + ItemStack aEmptyLighter, ItemStack aUsedLighter, ItemStack aFullLighter, long aFuelAmount) { this.mFullLighter = aFullLighter; this.mUsedLighter = aUsedLighter; this.mEmptyLighter = aEmptyLighter; @@ -43,7 +46,14 @@ public class Behaviour_Lighter extends Behaviour_None { prepare(aStack); long tFuelAmount = GT_Utility.ItemNBT.getLighterFuel(aStack); if (GT_Utility.areStacksEqual(aStack, this.mUsedLighter, true)) { - GT_Utility.sendSoundToPlayers(aPlayer.worldObj, SoundResource.FIRE_IGNITE, 1.0F, 1.0F, MathHelper.floor_double(aEntity.posX), MathHelper.floor_double(aEntity.posY), MathHelper.floor_double(aEntity.posZ)); + GT_Utility.sendSoundToPlayers( + aPlayer.worldObj, + SoundResource.FIRE_IGNITE, + 1.0F, + 1.0F, + MathHelper.floor_double(aEntity.posX), + MathHelper.floor_double(aEntity.posY), + MathHelper.floor_double(aEntity.posZ)); ((EntityCreeper) aEntity).func_146079_cb(); if (!aPlayer.capabilities.isCreativeMode) { tFuelAmount -= 1L; @@ -59,12 +69,34 @@ public class Behaviour_Lighter extends Behaviour_None { } @Override - public boolean onItemUse(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { + public boolean onItemUse( + GT_MetaBase_Item aItem, + ItemStack aStack, + EntityPlayer aPlayer, + World aWorld, + int aX, + int aY, + int aZ, + int aSide, + float hitX, + float hitY, + float hitZ) { return false; } @Override - public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { + public boolean onItemUseFirst( + GT_MetaBase_Item aItem, + ItemStack aStack, + EntityPlayer aPlayer, + World aWorld, + int aX, + int aY, + int aZ, + int aSide, + float hitX, + float hitY, + float hitZ) { if ((aWorld.isRemote) || (aStack.stackSize != 1)) { return false; } @@ -115,7 +147,11 @@ public class Behaviour_Lighter extends Behaviour_None { public List<String> getAdditionalToolTips(GT_MetaBase_Item aItem, List<String> aList, ItemStack aStack) { aList.add(this.mTooltip); NBTTagCompound tNBT = aStack.getTagCompound(); - long tFuelAmount = tNBT == null ? 0L : GT_Utility.areStacksEqual(aStack, this.mFullLighter, true) ? this.mFuelAmount : tNBT.getLong("GT.LighterFuel"); + long tFuelAmount = tNBT == null + ? 0L + : GT_Utility.areStacksEqual(aStack, this.mFullLighter, true) + ? this.mFuelAmount + : tNBT.getLong("GT.LighterFuel"); aList.add(this.mTooltipUses + " " + tFuelAmount); aList.add(this.mTooltipUnstackable); return aList; diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_None.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_None.java index def807e0ba..f40d200410 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_None.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_None.java @@ -4,6 +4,7 @@ import gregtech.api.enums.SubTag; import gregtech.api.interfaces.IItemBehaviour; import gregtech.api.items.GT_MetaBase_Item; import gregtech.api.util.GT_Utility; +import java.util.List; import net.minecraft.block.BlockDispenser; import net.minecraft.dispenser.BehaviorDefaultDispenseItem; import net.minecraft.dispenser.IBlockSource; @@ -16,8 +17,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; import net.minecraft.world.World; -import java.util.List; - public class Behaviour_None implements IItemBehaviour<GT_MetaBase_Item> { @Override public boolean onLeftClickEntity(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, Entity aEntity) { @@ -25,12 +24,34 @@ public class Behaviour_None implements IItemBehaviour<GT_MetaBase_Item> { } @Override - public boolean onItemUse(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { + public boolean onItemUse( + GT_MetaBase_Item aItem, + ItemStack aStack, + EntityPlayer aPlayer, + World aWorld, + int aX, + int aY, + int aZ, + int aSide, + float hitX, + float hitY, + float hitZ) { return false; } @Override - public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { + public boolean onItemUseFirst( + GT_MetaBase_Item aItem, + ItemStack aStack, + EntityPlayer aPlayer, + World aWorld, + int aX, + int aY, + int aZ, + int aSide, + float hitX, + float hitY, + float hitZ) { return false; } @@ -45,8 +66,8 @@ public class Behaviour_None implements IItemBehaviour<GT_MetaBase_Item> { } @Override - public void onUpdate(GT_MetaBase_Item aItem, ItemStack aStack, World aWorld, Entity aPlayer, int aTimer, boolean aIsInHand) { - } + public void onUpdate( + GT_MetaBase_Item aItem, ItemStack aStack, World aWorld, Entity aPlayer, int aTimer, boolean aIsInHand) {} @Override public boolean isItemStackUsable(GT_MetaBase_Item aItem, ItemStack aStack) { @@ -73,17 +94,30 @@ public class Behaviour_None implements IItemBehaviour<GT_MetaBase_Item> { } @Override - public EntityArrow getProjectile(GT_MetaBase_Item aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, double aX, double aY, double aZ) { + public EntityArrow getProjectile( + GT_MetaBase_Item aItem, + SubTag aProjectileType, + ItemStack aStack, + World aWorld, + double aX, + double aY, + double aZ) { return null; } @Override - public EntityArrow getProjectile(GT_MetaBase_Item aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, EntityLivingBase aEntity, float aSpeed) { + public EntityArrow getProjectile( + GT_MetaBase_Item aItem, + SubTag aProjectileType, + ItemStack aStack, + World aWorld, + EntityLivingBase aEntity, + float aSpeed) { return null; - } + } @Deprecated - public String trans(String aKey, String aEnglish){ - return GT_Utility.trans(aKey, aEnglish); + public String trans(String aKey, String aEnglish) { + return GT_Utility.trans(aKey, aEnglish); } } diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Essentia.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Essentia.java index 8aa3c86057..959e97aff3 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Essentia.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Essentia.java @@ -5,6 +5,7 @@ import gregtech.api.items.GT_MetaBase_Item; import gregtech.api.items.GT_MetaGenerated_Tool; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Utility; +import java.util.List; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; @@ -12,27 +13,42 @@ import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; import thaumcraft.api.aspects.IEssentiaTransport; -import java.util.List; - public class Behaviour_Plunger_Essentia extends Behaviour_None { private final int mCosts; - private final String mTooltip = GT_LanguageManager.addStringLocalization("gt.behaviour.plunger.essentia", "Clears Essentia from Containers and Tubes"); + private final String mTooltip = GT_LanguageManager.addStringLocalization( + "gt.behaviour.plunger.essentia", "Clears Essentia from Containers and Tubes"); public Behaviour_Plunger_Essentia(int aCosts) { this.mCosts = aCosts; } @Override - public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { + public boolean onItemUseFirst( + GT_MetaBase_Item aItem, + ItemStack aStack, + EntityPlayer aPlayer, + World aWorld, + int aX, + int aY, + int aZ, + int aSide, + float hitX, + float hitY, + float hitZ) { if (aWorld.isRemote) { return false; } TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if (((aTileEntity instanceof IEssentiaTransport)) && ( - (aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) { + if (((aTileEntity instanceof IEssentiaTransport)) + && ((aPlayer.capabilities.isCreativeMode) + || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) { GT_Utility.sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, 1.0F, -1.0F, aX, aY, aZ); for (ForgeDirection tDirection : ForgeDirection.VALID_DIRECTIONS) { - ((IEssentiaTransport) aTileEntity).takeEssentia(((IEssentiaTransport) aTileEntity).getEssentiaType(tDirection), ((IEssentiaTransport) aTileEntity).getEssentiaAmount(tDirection), tDirection); + ((IEssentiaTransport) aTileEntity) + .takeEssentia( + ((IEssentiaTransport) aTileEntity).getEssentiaType(tDirection), + ((IEssentiaTransport) aTileEntity).getEssentiaAmount(tDirection), + tDirection); } return true; } diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Fluid.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Fluid.java index 56d7418d71..be14a44d09 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Fluid.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Fluid.java @@ -8,6 +8,7 @@ import gregtech.api.items.GT_MetaGenerated_Tool; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Utility; +import java.util.List; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; @@ -15,18 +16,28 @@ import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.IFluidHandler; -import java.util.List; - public class Behaviour_Plunger_Fluid extends Behaviour_None { private final int mCosts; - private final String mTooltip = GT_LanguageManager.addStringLocalization("gt.behaviour.plunger.fluid", "Clears 1000 Liters of Fluid from Tanks"); + private final String mTooltip = GT_LanguageManager.addStringLocalization( + "gt.behaviour.plunger.fluid", "Clears 1000 Liters of Fluid from Tanks"); public Behaviour_Plunger_Fluid(int aCosts) { this.mCosts = aCosts; } @Override - public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { + public boolean onItemUseFirst( + GT_MetaBase_Item aItem, + ItemStack aStack, + EntityPlayer aPlayer, + World aWorld, + int aX, + int aY, + int aZ, + int aSide, + float hitX, + float hitY, + float hitZ) { if (aWorld.isRemote) { return false; } @@ -34,14 +45,15 @@ public class Behaviour_Plunger_Fluid extends Behaviour_None { if ((aTileEntity instanceof IFluidHandler)) { for (ForgeDirection tDirection : ForgeDirection.VALID_DIRECTIONS) { if (((IFluidHandler) aTileEntity).drain(tDirection, 1000, false) != null) { - if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { + if ((aPlayer.capabilities.isCreativeMode) + || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { ((IFluidHandler) aTileEntity).drain(tDirection, 1000, true); - GT_Utility.sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, 1.0F, -1.0F, aX, aY, aZ); + GT_Utility.sendSoundToPlayers( + aWorld, SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, 1.0F, -1.0F, aX, aY, aZ); return true; } } } - } if (aTileEntity instanceof IGregTechTileEntity) { IGregTechTileEntity tTileEntity = (IGregTechTileEntity) aTileEntity; @@ -50,7 +62,8 @@ public class Behaviour_Plunger_Fluid extends Behaviour_None { GT_MetaTileEntity_BasicTank machine = (GT_MetaTileEntity_BasicTank) mTileEntity; if (machine.mFluid != null && machine.mFluid.amount > 0) machine.mFluid.amount = machine.mFluid.amount - Math.min(machine.mFluid.amount, 1000); - GT_Utility.sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, 1.0F, -1.0F, aX, aY, aZ); + GT_Utility.sendSoundToPlayers( + aWorld, SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, 1.0F, -1.0F, aX, aY, aZ); return true; } } diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Item.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Item.java index c5f231b3a8..e98702629b 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Item.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Item.java @@ -8,25 +8,36 @@ import gregtech.api.items.GT_MetaBase_Item; import gregtech.api.items.GT_MetaGenerated_Tool; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Utility; +import java.util.HashMap; +import java.util.List; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; -import java.util.HashMap; -import java.util.List; - public class Behaviour_Plunger_Item extends Behaviour_None { private final int mCosts; - private final String mTooltip = GT_LanguageManager.addStringLocalization("gt.behaviour.plunger.item", "Clears Items from Pipes"); + private final String mTooltip = + GT_LanguageManager.addStringLocalization("gt.behaviour.plunger.item", "Clears Items from Pipes"); public Behaviour_Plunger_Item(int aCosts) { this.mCosts = aCosts; } @Override - public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { + public boolean onItemUseFirst( + GT_MetaBase_Item aItem, + ItemStack aStack, + EntityPlayer aPlayer, + World aWorld, + int aX, + int aY, + int aZ, + int aSide, + float hitX, + float hitY, + float hitZ) { if (aWorld.isRemote) { return false; } @@ -34,20 +45,30 @@ public class Behaviour_Plunger_Item extends Behaviour_None { if ((aTileEntity instanceof IGregTechTileEntity)) { IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity) aTileEntity).getMetaTileEntity(); if ((tMetaTileEntity instanceof IMetaTileEntityItemPipe)) { - for (IMetaTileEntityItemPipe tTileEntity : GT_Utility.sortMapByValuesAcending(IMetaTileEntityItemPipe.Util.scanPipes((IMetaTileEntityItemPipe) tMetaTileEntity, new HashMap<>(), 0L, false, true)).keySet()) { + for (IMetaTileEntityItemPipe tTileEntity : GT_Utility.sortMapByValuesAcending( + IMetaTileEntityItemPipe.Util.scanPipes( + (IMetaTileEntityItemPipe) tMetaTileEntity, new HashMap<>(), 0L, false, true)) + .keySet()) { int i = 0; for (int j = tTileEntity.getSizeInventory(); i < j; i++) { if (tTileEntity.isValidSlot(i)) { - if ((tTileEntity.getStackInSlot(i) != null) && ( - (aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) { + if ((tTileEntity.getStackInSlot(i) != null) + && ((aPlayer.capabilities.isCreativeMode) + || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) { ItemStack tStack = tTileEntity.decrStackSize(i, 64); if (tStack != null) { - EntityItem tEntity = new EntityItem(aWorld, ((IGregTechTileEntity) aTileEntity).getOffsetX((byte) aSide, 1) + 0.5D, ((IGregTechTileEntity) aTileEntity).getOffsetY((byte) aSide, 1) + 0.5D, ((IGregTechTileEntity) aTileEntity).getOffsetZ((byte) aSide, 1) + 0.5D, tStack); + EntityItem tEntity = new EntityItem( + aWorld, + ((IGregTechTileEntity) aTileEntity).getOffsetX((byte) aSide, 1) + 0.5D, + ((IGregTechTileEntity) aTileEntity).getOffsetY((byte) aSide, 1) + 0.5D, + ((IGregTechTileEntity) aTileEntity).getOffsetZ((byte) aSide, 1) + 0.5D, + tStack); tEntity.motionX = 0.0D; tEntity.motionY = 0.0D; tEntity.motionZ = 0.0D; aWorld.spawnEntityInWorld(tEntity); - GT_Utility.sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, 1.0F, -1.0F, aX, aY, aZ); + GT_Utility.sendSoundToPlayers( + aWorld, SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, 1.0F, -1.0F, aX, aY, aZ); } return true; } diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_PrintedPages.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_PrintedPages.java index cdbd5e4424..7562c0fb80 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_PrintedPages.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_PrintedPages.java @@ -2,11 +2,10 @@ package gregtech.common.items.behaviors; import gregtech.api.items.GT_MetaBase_Item; import gregtech.api.util.GT_Utility; +import java.util.List; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import java.util.List; - public class Behaviour_PrintedPages extends Behaviour_None { public static String getTitle(ItemStack aStack) { NBTTagCompound tNBT = aStack.getTagCompound(); diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Prospecting.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Prospecting.java index 5be17965cd..771e1f696f 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Prospecting.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Prospecting.java @@ -13,6 +13,8 @@ import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; import gregtech.common.blocks.GT_Block_Ores_Abstract; import gregtech.common.blocks.GT_TileEntity_Ores; +import java.util.List; +import java.util.Random; import net.minecraft.block.Block; import net.minecraft.block.BlockLiquid; import net.minecraft.entity.player.EntityPlayer; @@ -23,13 +25,11 @@ import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.IFluidBlock; -import java.util.List; -import java.util.Random; - public class Behaviour_Prospecting extends Behaviour_None { private final int mVanillaCosts; private final int mEUCosts; - private final String mTooltip = GT_LanguageManager.addStringLocalization("gt.behaviour.prospecting", "Usable for Prospecting"); + private final String mTooltip = + GT_LanguageManager.addStringLocalization("gt.behaviour.prospecting", "Usable for Prospecting"); public Behaviour_Prospecting(int aVanillaCosts, int aEUCosts) { this.mVanillaCosts = aVanillaCosts; @@ -37,7 +37,18 @@ public class Behaviour_Prospecting extends Behaviour_None { } @Override - public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { + public boolean onItemUseFirst( + GT_MetaBase_Item aItem, + ItemStack aStack, + EntityPlayer aPlayer, + World aWorld, + int aX, + int aY, + int aZ, + int aSide, + float hitX, + float hitY, + float hitZ) { if (aWorld.isRemote) { return false; } @@ -47,24 +58,29 @@ public class Behaviour_Prospecting extends Behaviour_None { } byte aMeta = (byte) aWorld.getBlockMetadata(aX, aY, aZ); - ItemData tAssociation = GT_OreDictUnificator.getAssociation(new ItemStack(aBlock, 1, aMeta)); - if (tAssociation != null && tAssociation.mPrefix != null && tAssociation.mMaterial != null - && tAssociation.mPrefix.toString().startsWith("ore")) { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("100", "This is ") + tAssociation.mMaterial.mMaterial.mDefaultLocalName + GT_Utility.trans("101", " Ore.")); + if (tAssociation != null + && tAssociation.mPrefix != null + && tAssociation.mMaterial != null + && tAssociation.mPrefix.toString().startsWith("ore")) { + GT_Utility.sendChatToPlayer( + aPlayer, + GT_Utility.trans("100", "This is ") + + tAssociation.mMaterial.mMaterial.mDefaultLocalName + + GT_Utility.trans("101", " Ore.")); GT_Utility.sendSoundToPlayers(aWorld, SoundResource.RANDOM_ANVIL_USE, 1.0F, -1.0F, aX, aY, aZ); return true; } - if (aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.stone) || - aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.netherrack) || - aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.end_stone) || - aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, GregTech_API.sBlockStones) || - aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, GregTech_API.sBlockGranites) || - aBlock == GregTech_API.sBlockOresUb1 || - aBlock == GregTech_API.sBlockOresUb2 || - aBlock == GregTech_API.sBlockOresUb3 || - aBlock == GregTech_API.sBlockOres1) { + if (aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.stone) + || aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.netherrack) + || aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.end_stone) + || aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, GregTech_API.sBlockStones) + || aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, GregTech_API.sBlockGranites) + || aBlock == GregTech_API.sBlockOresUb1 + || aBlock == GregTech_API.sBlockOresUb2 + || aBlock == GregTech_API.sBlockOresUb3 + || aBlock == GregTech_API.sBlockOres1) { if (GT_ModHandler.damageOrDechargeItem(aStack, this.mVanillaCosts, this.mEUCosts, aPlayer)) { GT_Utility.sendSoundToPlayers(aWorld, SoundResource.RANDOM_ANVIL_USE, 1.0F, -1.0F, aX, aY, aZ); int tMetaID; @@ -78,20 +94,24 @@ public class Behaviour_Prospecting extends Behaviour_None { tBlock = aWorld.getBlock(tX, tY, tZ); if (tBlock == Blocks.lava || tBlock == Blocks.flowing_lava) { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("102", "There is Lava behind this Rock.")); + GT_Utility.sendChatToPlayer( + aPlayer, GT_Utility.trans("102", "There is Lava behind this Rock.")); break; } if (tBlock instanceof BlockLiquid || tBlock instanceof IFluidBlock) { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("103", "There is a Liquid behind this Rock.")); + GT_Utility.sendChatToPlayer( + aPlayer, GT_Utility.trans("103", "There is a Liquid behind this Rock.")); break; } if (tBlock == Blocks.monster_egg || !GT_Utility.hasBlockHitBox(aWorld, tX, tY, tZ)) { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("104", "There is an Air Pocket behind this Rock.")); + GT_Utility.sendChatToPlayer( + aPlayer, GT_Utility.trans("104", "There is an Air Pocket behind this Rock.")); break; } if (tBlock != aBlock) { if (i < 4) - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("105", "Material is changing behind this Rock.")); + GT_Utility.sendChatToPlayer( + aPlayer, GT_Utility.trans("105", "Material is changing behind this Rock.")); break; } } @@ -105,18 +125,29 @@ public class Behaviour_Prospecting extends Behaviour_None { if (tBlock instanceof GT_Block_Ores_Abstract) { TileEntity tTileEntity = aWorld.getTileEntity(tX, tY, tZ); if (tTileEntity instanceof GT_TileEntity_Ores) { - Materials tMaterial = GregTech_API.sGeneratedMaterials[((GT_TileEntity_Ores) tTileEntity).mMetaData % 1000]; + Materials tMaterial = GregTech_API.sGeneratedMaterials[ + ((GT_TileEntity_Ores) tTileEntity).mMetaData % 1000]; if (tMaterial != null && tMaterial != Materials._NULL) { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("106", "Found traces of ") + tMaterial.mDefaultLocalName + GT_Utility.trans("101", " Ore.")); + GT_Utility.sendChatToPlayer( + aPlayer, + GT_Utility.trans("106", "Found traces of ") + + tMaterial.mDefaultLocalName + + GT_Utility.trans("101", " Ore.")); return true; } } } else { tMetaID = aWorld.getBlockMetadata(tX, tY, tZ); tAssociation = GT_OreDictUnificator.getAssociation(new ItemStack(tBlock, 1, tMetaID)); - if (tAssociation != null && tAssociation.mPrefix != null && tAssociation.mMaterial != null - && tAssociation.mPrefix.toString().startsWith("ore")) { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("106", "Found traces of ") + tAssociation.mMaterial.mMaterial.mDefaultLocalName + GT_Utility.trans("101", " Ore.")); + if (tAssociation != null + && tAssociation.mPrefix != null + && tAssociation.mMaterial != null + && tAssociation.mPrefix.toString().startsWith("ore")) { + GT_Utility.sendChatToPlayer( + aPlayer, + GT_Utility.trans("106", "Found traces of ") + + tAssociation.mMaterial.mMaterial.mDefaultLocalName + + GT_Utility.trans("101", " Ore.")); return true; } } diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Scanner.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Scanner.java index 9f244a6162..a24105bf75 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Scanner.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Scanner.java @@ -5,6 +5,8 @@ import gregtech.api.interfaces.IItemBehaviour; import gregtech.api.items.GT_MetaBase_Item; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Utility; +import java.util.ArrayList; +import java.util.List; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; @@ -12,30 +14,42 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.World; -import java.util.ArrayList; -import java.util.List; - public class Behaviour_Scanner extends Behaviour_None { public static final IItemBehaviour<GT_MetaBase_Item> INSTANCE = new Behaviour_Scanner(); - private final String mTooltip = GT_LanguageManager.addStringLocalization("gt.behaviour.scanning", "Can scan Blocks in World"); + private final String mTooltip = + GT_LanguageManager.addStringLocalization("gt.behaviour.scanning", "Can scan Blocks in World"); @Override - public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { + public boolean onItemUseFirst( + GT_MetaBase_Item aItem, + ItemStack aStack, + EntityPlayer aPlayer, + World aWorld, + int aX, + int aY, + int aZ, + int aSide, + float hitX, + float hitY, + float hitZ) { NBTTagCompound tNBT = aStack.getTagCompound(); if (((aPlayer instanceof EntityPlayerMP)) && (aItem.canUse(aStack, 20000.0D))) { ArrayList<String> tList = new ArrayList<>(); - if (aItem.use(aStack, GT_Utility.getCoordinateScan(tList, aPlayer, aWorld, 1, aX, aY, aZ, aSide, hitX, hitY, hitZ), aPlayer)) { - int tList_sS=tList.size(); - tNBT.setInteger("dataLinesCount",tList_sS); + if (aItem.use( + aStack, + GT_Utility.getCoordinateScan(tList, aPlayer, aWorld, 1, aX, aY, aZ, aSide, hitX, hitY, hitZ), + aPlayer)) { + int tList_sS = tList.size(); + tNBT.setInteger("dataLinesCount", tList_sS); for (int i = 0; i < tList_sS; i++) { - tNBT.setString("dataLines"+ i, tList.get(i)); + tNBT.setString("dataLines" + i, tList.get(i)); GT_Utility.sendChatToPlayer(aPlayer, tList.get(i)); } } return true; } GT_Utility.doSoundAtClient(SoundResource.IC2_TOOLS_OD_SCANNER, 1, 1.0F, aX, aY, aZ); - //doGuiAtClient() + // doGuiAtClient() return aPlayer instanceof EntityPlayerMP; } @@ -44,15 +58,14 @@ public class Behaviour_Scanner extends Behaviour_None { try { NBTTagCompound tNBT = aStack.getTagCompound(); int lines = tNBT.getInteger("dataLinesCount"); - if(lines<1) throw new Exception(); - aList.add(EnumChatFormatting.BLUE+"Block scan data result:"); + if (lines < 1) throw new Exception(); + aList.add(EnumChatFormatting.BLUE + "Block scan data result:"); for (int i = 0; i < lines; i++) { - aList.add(EnumChatFormatting.RESET+tNBT.getString("dataLines" + i)); + aList.add(EnumChatFormatting.RESET + tNBT.getString("dataLines" + i)); } - }catch(Exception e){ + } catch (Exception e) { aList.add(this.mTooltip); } return aList; } - } diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Scoop.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Scoop.java index 73190c5751..1cc81b764f 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Scoop.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Scoop.java @@ -6,16 +6,16 @@ import forestry.api.lepidopterology.IEntityButterfly; import gregtech.api.items.GT_MetaBase_Item; import gregtech.api.items.GT_MetaGenerated_Tool; import gregtech.api.util.GT_LanguageManager; +import java.util.List; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import java.util.List; - public class Behaviour_Scoop extends Behaviour_None { private final int mCosts; - private final String mTooltip = GT_LanguageManager.addStringLocalization("gt.behaviour.scoop", "Catches Butterflies on Leftclick"); + private final String mTooltip = + GT_LanguageManager.addStringLocalization("gt.behaviour.scoop", "Catches Butterflies on Leftclick"); public Behaviour_Scoop(int aCosts) { this.mCosts = aCosts; @@ -27,10 +27,26 @@ public class Behaviour_Scoop extends Behaviour_None { if (aPlayer.worldObj.isRemote) { return true; } - if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { + if ((aPlayer.capabilities.isCreativeMode) + || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { Object tButterfly = ((IEntityButterfly) aEntity).getButterfly(); - ((IButterfly) tButterfly).getGenome().getPrimary().getRoot().getBreedingTracker(aEntity.worldObj, aPlayer.getGameProfile()).registerCatch((IButterfly) tButterfly); - aPlayer.worldObj.spawnEntityInWorld(new EntityItem(aPlayer.worldObj, aEntity.posX, aEntity.posY, aEntity.posZ, ((IButterfly) tButterfly).getGenome().getPrimary().getRoot().getMemberStack(((IButterfly) tButterfly).copy(), EnumFlutterType.BUTTERFLY.ordinal()))); + ((IButterfly) tButterfly) + .getGenome() + .getPrimary() + .getRoot() + .getBreedingTracker(aEntity.worldObj, aPlayer.getGameProfile()) + .registerCatch((IButterfly) tButterfly); + aPlayer.worldObj.spawnEntityInWorld(new EntityItem( + aPlayer.worldObj, + aEntity.posX, + aEntity.posY, + aEntity.posZ, + ((IButterfly) tButterfly) + .getGenome() + .getPrimary() + .getRoot() + .getMemberStack( + ((IButterfly) tButterfly).copy(), EnumFlutterType.BUTTERFLY.ordinal()))); aEntity.setDead(); } return true; diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Screwdriver.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Screwdriver.java index a6e047cb6d..2ab5167453 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Screwdriver.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Screwdriver.java @@ -20,7 +20,18 @@ public class Behaviour_Screwdriver extends Behaviour_None { } @Override - public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { + public boolean onItemUseFirst( + GT_MetaBase_Item aItem, + ItemStack aStack, + EntityPlayer aPlayer, + World aWorld, + int aX, + int aY, + int aZ, + int aSide, + float hitX, + float hitY, + float hitZ) { if (aWorld.isRemote) { return false; } diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Sense.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Sense.java index b75edf426c..4dfc685103 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Sense.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Sense.java @@ -4,23 +4,34 @@ import gregtech.api.items.GT_MetaBase_Item; import gregtech.api.items.GT_MetaGenerated_Tool; import gregtech.api.util.GT_LanguageManager; import ic2.api.crops.ICropTile; +import java.util.List; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; -import java.util.List; - public class Behaviour_Sense extends Behaviour_None { private final int mCosts; - private final String mTooltip = GT_LanguageManager.addStringLocalization("gt.behaviour.sense", "Rightclick to harvest Crop Sticks"); + private final String mTooltip = + GT_LanguageManager.addStringLocalization("gt.behaviour.sense", "Rightclick to harvest Crop Sticks"); public Behaviour_Sense(int aCosts) { this.mCosts = aCosts; } @Override - public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { + public boolean onItemUseFirst( + GT_MetaBase_Item aItem, + ItemStack aStack, + EntityPlayer aPlayer, + World aWorld, + int aX, + int aY, + int aZ, + int aSide, + float hitX, + float hitY, + float hitZ) { if (aWorld.isRemote) { return false; } @@ -29,8 +40,11 @@ public class Behaviour_Sense extends Behaviour_None { for (int i = -2; i < 3; i++) { for (int j = -2; j < 3; j++) { for (int k = -2; k < 3; k++) { - if ((aStack.stackSize > 0) && (((tTileEntity = aWorld.getTileEntity(aX + i, aY + j, aZ + k)) instanceof ICropTile)) && (((ICropTile) tTileEntity).harvest(true)) && (!aPlayer.capabilities.isCreativeMode)) { - ((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts/20); + if ((aStack.stackSize > 0) + && (((tTileEntity = aWorld.getTileEntity(aX + i, aY + j, aZ + k)) instanceof ICropTile)) + && (((ICropTile) tTileEntity).harvest(true)) + && (!aPlayer.capabilities.isCreativeMode)) { + ((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts / 20); } } } diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_SensorKit.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_SensorKit.java index 21d7168827..5b7fb8556f 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_SensorKit.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_SensorKit.java @@ -5,6 +5,7 @@ import gregtech.api.interfaces.tileentity.IGregTechDeviceInformation; import gregtech.api.items.GT_MetaBase_Item; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Utility; +import java.util.List; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.inventory.IInventory; @@ -13,19 +14,30 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; -import java.util.List; - public class Behaviour_SensorKit extends Behaviour_None { - private final String mTooltip = GT_LanguageManager.addStringLocalization("gt.behaviour.sensorkit.tooltip", "Used to display Information using the Mod Nuclear Control"); + private final String mTooltip = GT_LanguageManager.addStringLocalization( + "gt.behaviour.sensorkit.tooltip", "Used to display Information using the Mod Nuclear Control"); @Override - public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { + public boolean onItemUseFirst( + GT_MetaBase_Item aItem, + ItemStack aStack, + EntityPlayer aPlayer, + World aWorld, + int aX, + int aY, + int aZ, + int aSide, + float hitX, + float hitY, + float hitZ) { if ((aPlayer instanceof EntityPlayerMP)) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); if (((tTileEntity instanceof IInventory)) && (!((IInventory) tTileEntity).isUseableByPlayer(aPlayer))) { return false; } - if (((tTileEntity instanceof IGregTechDeviceInformation)) && (((IGregTechDeviceInformation) tTileEntity).isGivingInformation())) { + if (((tTileEntity instanceof IGregTechDeviceInformation)) + && (((IGregTechDeviceInformation) tTileEntity).isGivingInformation())) { GT_Utility.setStack(aStack, ItemList.NC_SensorCard.get(aStack.stackSize)); NBTTagCompound tNBT = aStack.getTagCompound(); if (tNBT == null) { diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_SoftHammer.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_SoftHammer.java index e4edc6b8e2..a102e07dcb 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_SoftHammer.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_SoftHammer.java @@ -5,24 +5,35 @@ import gregtech.api.items.GT_MetaBase_Item; import gregtech.api.items.GT_MetaGenerated_Tool; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Utility; +import java.util.List; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.world.World; -import java.util.List; - public class Behaviour_SoftHammer extends Behaviour_None { private final int mCosts; - private final String mTooltip = GT_LanguageManager.addStringLocalization("gt.behaviour.softhammer", "Activates and Deactivates Machines"); + private final String mTooltip = + GT_LanguageManager.addStringLocalization("gt.behaviour.softhammer", "Activates and Deactivates Machines"); public Behaviour_SoftHammer(int aCosts) { this.mCosts = aCosts; } @Override - public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { + public boolean onItemUseFirst( + GT_MetaBase_Item aItem, + ItemStack aStack, + EntityPlayer aPlayer, + World aWorld, + int aX, + int aY, + int aZ, + int aSide, + float hitX, + float hitY, + float hitZ) { if (aWorld.isRemote) { return false; } @@ -32,65 +43,88 @@ public class Behaviour_SoftHammer extends Behaviour_None { } byte aMeta = (byte) aWorld.getBlockMetadata(aX, aY, aZ); if (aBlock == Blocks.lit_redstone_lamp) { - if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { + if ((aPlayer.capabilities.isCreativeMode) + || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { aWorld.isRemote = true; aWorld.setBlock(aX, aY, aZ, Blocks.redstone_lamp, 0, 0); aWorld.isRemote = false; - GT_Utility.sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, 1.0F, -1.0F, aX, aY, aZ); + GT_Utility.sendSoundToPlayers( + aWorld, SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, 1.0F, -1.0F, aX, aY, aZ); } return true; } if (aBlock == Blocks.redstone_lamp) { - if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { + if ((aPlayer.capabilities.isCreativeMode) + || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { aWorld.isRemote = true; aWorld.setBlock(aX, aY, aZ, Blocks.lit_redstone_lamp, 0, 0); aWorld.isRemote = false; - GT_Utility.sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, 1.0F, -1.0F, aX, aY, aZ); + GT_Utility.sendSoundToPlayers( + aWorld, SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, 1.0F, -1.0F, aX, aY, aZ); } return true; } if (aBlock == Blocks.golden_rail) { - if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { + if ((aPlayer.capabilities.isCreativeMode) + || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { aWorld.isRemote = true; aWorld.setBlock(aX, aY, aZ, aBlock, (aMeta + 8) % 16, 0); aWorld.isRemote = false; - GT_Utility.sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, 1.0F, -1.0F, aX, aY, aZ); + GT_Utility.sendSoundToPlayers( + aWorld, SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, 1.0F, -1.0F, aX, aY, aZ); } return true; } if (aBlock == Blocks.activator_rail) { - if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { + if ((aPlayer.capabilities.isCreativeMode) + || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { aWorld.isRemote = true; aWorld.setBlock(aX, aY, aZ, aBlock, (aMeta + 8) % 16, 0); aWorld.isRemote = false; - GT_Utility.sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, 1.0F, -1.0F, aX, aY, aZ); + GT_Utility.sendSoundToPlayers( + aWorld, SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, 1.0F, -1.0F, aX, aY, aZ); } return true; } if ((aBlock == Blocks.log) || (aBlock == Blocks.log2) || (aBlock == Blocks.hay_block)) { - if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { + if ((aPlayer.capabilities.isCreativeMode) + || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { aWorld.setBlockMetadataWithNotify(aX, aY, aZ, (aMeta + 4) % 12, 3); } return true; } - if ((aBlock == Blocks.piston) || (aBlock == Blocks.sticky_piston) || (aBlock == Blocks.dispenser) || (aBlock == Blocks.dropper)) { - if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { + if ((aBlock == Blocks.piston) + || (aBlock == Blocks.sticky_piston) + || (aBlock == Blocks.dispenser) + || (aBlock == Blocks.dropper)) { + if ((aPlayer.capabilities.isCreativeMode) + || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { aWorld.setBlockMetadataWithNotify(aX, aY, aZ, (aMeta + 1) % 6, 3); - GT_Utility.sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, 1.0F, -1.0F, aX, aY, aZ); + GT_Utility.sendSoundToPlayers( + aWorld, SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, 1.0F, -1.0F, aX, aY, aZ); } return true; } - if ((aBlock == Blocks.pumpkin) || (aBlock == Blocks.lit_pumpkin) || (aBlock == Blocks.furnace) || (aBlock == Blocks.lit_furnace) || (aBlock == Blocks.chest) || (aBlock == Blocks.trapped_chest)) { - if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { + if ((aBlock == Blocks.pumpkin) + || (aBlock == Blocks.lit_pumpkin) + || (aBlock == Blocks.furnace) + || (aBlock == Blocks.lit_furnace) + || (aBlock == Blocks.chest) + || (aBlock == Blocks.trapped_chest)) { + if ((aPlayer.capabilities.isCreativeMode) + || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { aWorld.setBlockMetadataWithNotify(aX, aY, aZ, (aMeta - 1) % 4 + 2, 3); - GT_Utility.sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, 1.0F, -1.0F, aX, aY, aZ); + GT_Utility.sendSoundToPlayers( + aWorld, SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, 1.0F, -1.0F, aX, aY, aZ); } return true; } if (aBlock == Blocks.hopper) { - if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { + if ((aPlayer.capabilities.isCreativeMode) + || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { aWorld.setBlockMetadataWithNotify(aX, aY, aZ, (aMeta + 1) % 6 != 1 ? (aMeta + 1) % 6 : 2, 3); - GT_Utility.sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, 1.0F, -1.0F, aX, aY, aZ); + GT_Utility.sendSoundToPlayers( + aWorld, SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, 1.0F, -1.0F, aX, aY, aZ); } return true; } diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Sonictron.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Sonictron.java index bcaa8242f3..c29591a560 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Sonictron.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Sonictron.java @@ -96,7 +96,18 @@ public class Behaviour_Sonictron extends Behaviour_None { } @Override - public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { + public boolean onItemUseFirst( + GT_MetaBase_Item aItem, + ItemStack aStack, + EntityPlayer aPlayer, + World aWorld, + int aX, + int aY, + int aZ, + int aSide, + float hitX, + float hitY, + float hitZ) { setCurrentIndex(aStack, -1); return false; } @@ -108,12 +119,14 @@ public class Behaviour_Sonictron extends Behaviour_None { } @Override - public void onUpdate(GT_MetaBase_Item aItem, ItemStack aStack, World aWorld, Entity aPlayer, int aTimer, boolean aIsInHand) { + public void onUpdate( + GT_MetaBase_Item aItem, ItemStack aStack, World aWorld, Entity aPlayer, int aTimer, boolean aIsInHand) { int tTickTimer = getTickTimer(aStack); int tCurrentIndex = getCurrentIndex(aStack); if ((tTickTimer++ % 2 == 0) && (tCurrentIndex > -1)) { ItemStack[] tInventory = getNBTInventory(aStack); - GT_Values.GT.doSonictronSound(tInventory[tCurrentIndex], aPlayer.worldObj, aPlayer.posX, aPlayer.posY, aPlayer.posZ); + GT_Values.GT.doSonictronSound( + tInventory[tCurrentIndex], aPlayer.worldObj, aPlayer.posX, aPlayer.posY, aPlayer.posZ); tCurrentIndex++; if (tCurrentIndex > 63) { tCurrentIndex = -1; diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Spray_Color.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Spray_Color.java index d2d1d60240..2ea4eac2ad 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Spray_Color.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Spray_Color.java @@ -6,6 +6,9 @@ import gregtech.api.enums.SoundResource; import gregtech.api.items.GT_MetaBase_Item; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Utility; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; import net.minecraft.block.Block; import net.minecraft.block.BlockColored; import net.minecraft.entity.player.EntityPlayer; @@ -16,20 +19,25 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import java.util.Arrays; -import java.util.Collection; -import java.util.List; - public class Behaviour_Spray_Color extends Behaviour_None { private final ItemStack mEmpty; private final ItemStack mUsed; private final ItemStack mFull; private final long mUses; private final byte mColor; - private final Collection<Block> mAllowedVanillaBlocks = Arrays.asList(Blocks.glass, Blocks.glass_pane, Blocks.stained_glass, Blocks.stained_glass_pane, Blocks.carpet, Blocks.hardened_clay, ItemList.TE_Rockwool.getBlock()); + private final Collection<Block> mAllowedVanillaBlocks = Arrays.asList( + Blocks.glass, + Blocks.glass_pane, + Blocks.stained_glass, + Blocks.stained_glass_pane, + Blocks.carpet, + Blocks.hardened_clay, + ItemList.TE_Rockwool.getBlock()); private final String mTooltip; - private final String mTooltipUses = GT_LanguageManager.addStringLocalization("gt.behaviour.paintspray.uses", "Remaining Uses:"); - private final String mTooltipUnstackable = GT_LanguageManager.addStringLocalization("gt.behaviour.unstackable", "Not usable when stacked!"); + private final String mTooltipUses = + GT_LanguageManager.addStringLocalization("gt.behaviour.paintspray.uses", "Remaining Uses:"); + private final String mTooltipUnstackable = + GT_LanguageManager.addStringLocalization("gt.behaviour.unstackable", "Not usable when stacked!"); public Behaviour_Spray_Color(ItemStack aEmpty, ItemStack aUsed, ItemStack aFull, long aUses, int aColor) { this.mEmpty = aEmpty; @@ -37,11 +45,24 @@ public class Behaviour_Spray_Color extends Behaviour_None { this.mFull = aFull; this.mUses = aUses; this.mColor = ((byte) aColor); - this.mTooltip = GT_LanguageManager.addStringLocalization("gt.behaviour.paintspray." + this.mColor + ".tooltip", "Can Color things in " + Dyes.get(this.mColor).mName); + this.mTooltip = GT_LanguageManager.addStringLocalization( + "gt.behaviour.paintspray." + this.mColor + ".tooltip", + "Can Color things in " + Dyes.get(this.mColor).mName); } @Override - public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { + public boolean onItemUseFirst( + GT_MetaBase_Item aItem, + ItemStack aStack, + EntityPlayer aPlayer, + World aWorld, + int aX, + int aY, + int aZ, + int aSide, + float hitX, + float hitY, + float hitZ) { if ((aWorld.isRemote) || (aStack.stackSize != 1)) { return false; } @@ -88,7 +109,8 @@ public class Behaviour_Spray_Color extends Behaviour_None { private boolean colorize(World aWorld, int aX, int aY, int aZ, int aSide) { Block aBlock = aWorld.getBlock(aX, aY, aZ); - if ((aBlock != Blocks.air) && ((this.mAllowedVanillaBlocks.contains(aBlock)) || ((aBlock instanceof BlockColored)))) { + if ((aBlock != Blocks.air) + && ((this.mAllowedVanillaBlocks.contains(aBlock)) || ((aBlock instanceof BlockColored)))) { if (aBlock == Blocks.hardened_clay) { aWorld.setBlock(aX, aY, aZ, Blocks.stained_hardened_clay, (~this.mColor) & 0xF, 3); return true; @@ -114,7 +136,9 @@ public class Behaviour_Spray_Color extends Behaviour_None { public List<String> getAdditionalToolTips(GT_MetaBase_Item aItem, List<String> aList, ItemStack aStack) { aList.add(this.mTooltip); NBTTagCompound tNBT = aStack.getTagCompound(); - long tRemainingPaint = tNBT == null ? 0L : GT_Utility.areStacksEqual(aStack, this.mFull, true) ? this.mUses : tNBT.getLong("GT.RemainingPaint"); + long tRemainingPaint = tNBT == null + ? 0L + : GT_Utility.areStacksEqual(aStack, this.mFull, true) ? this.mUses : tNBT.getLong("GT.RemainingPaint"); aList.add(this.mTooltipUses + " " + tRemainingPaint); aList.add(this.mTooltipUnstackable); return aList; diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Wrench.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Wrench.java index 2a29578706..8ccbe915b9 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Wrench.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Wrench.java @@ -7,6 +7,8 @@ import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Utility; import ic2.api.tile.IWrenchable; +import java.util.Arrays; +import java.util.List; import net.minecraft.block.Block; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; @@ -16,19 +18,28 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import java.util.Arrays; -import java.util.List; - public class Behaviour_Wrench extends Behaviour_None { private final int mCosts; - private final String mTooltip = GT_LanguageManager.addStringLocalization("gt.behaviour.wrench", "Rotates Blocks on Rightclick"); + private final String mTooltip = + GT_LanguageManager.addStringLocalization("gt.behaviour.wrench", "Rotates Blocks on Rightclick"); public Behaviour_Wrench(int aCosts) { this.mCosts = aCosts; } @Override - public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { + public boolean onItemUseFirst( + GT_MetaBase_Item aItem, + ItemStack aStack, + EntityPlayer aPlayer, + World aWorld, + int aX, + int aY, + int aZ, + int aSide, + float hitX, + float hitY, + float hitZ) { if (aWorld.isRemote) { return false; } @@ -42,7 +53,8 @@ public class Behaviour_Wrench extends Behaviour_None { try { if (((aTileEntity instanceof IWrenchable))) { if (((IWrenchable) aTileEntity).wrenchCanSetFacing(aPlayer, aTargetSide)) { - if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { + if ((aPlayer.capabilities.isCreativeMode) + || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { ((IWrenchable) aTileEntity).setFacing(aTargetSide); GT_Utility.sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_WRENCH, 1.0F, -1.0F, aX, aY, aZ); } @@ -50,13 +62,16 @@ public class Behaviour_Wrench extends Behaviour_None { } if (((IWrenchable) aTileEntity).wrenchCanRemove(aPlayer)) { int tDamage = ((IWrenchable) aTileEntity).getWrenchDropRate() < 1.0F ? 10 : 3; - if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, (long) tDamage * this.mCosts))) { + if ((aPlayer.capabilities.isCreativeMode) + || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, (long) tDamage * this.mCosts))) { ItemStack tOutput = ((IWrenchable) aTileEntity).getWrenchDrop(aPlayer); for (ItemStack tStack : aBlock.getDrops(aWorld, aX, aY, aZ, aMeta, 0)) { if (tOutput == null) { - aWorld.spawnEntityInWorld(new EntityItem(aWorld, aX + 0.5D, aY + 0.5D, aZ + 0.5D, tStack)); + aWorld.spawnEntityInWorld( + new EntityItem(aWorld, aX + 0.5D, aY + 0.5D, aZ + 0.5D, tStack)); } else { - aWorld.spawnEntityInWorld(new EntityItem(aWorld, aX + 0.5D, aY + 0.5D, aZ + 0.5D, tOutput)); + aWorld.spawnEntityInWorld( + new EntityItem(aWorld, aX + 0.5D, aY + 0.5D, aZ + 0.5D, tOutput)); tOutput = null; } } @@ -70,69 +85,105 @@ public class Behaviour_Wrench extends Behaviour_None { } catch (Throwable ignored) { } if ((aBlock == Blocks.log) || (aBlock == Blocks.log2) || (aBlock == Blocks.hay_block)) { - if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { + if ((aPlayer.capabilities.isCreativeMode) + || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { aWorld.setBlockMetadataWithNotify(aX, aY, aZ, (aMeta + 4) % 12, 3); GT_Utility.sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_WRENCH, 1.0F, -1.0F, aX, aY, aZ); } return true; } if ((aBlock == Blocks.powered_repeater) || (aBlock == Blocks.unpowered_repeater)) { - if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { + if ((aPlayer.capabilities.isCreativeMode) + || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { aWorld.setBlockMetadataWithNotify(aX, aY, aZ, aMeta / 4 * 4 + (aMeta % 4 + 1) % 4, 3); GT_Utility.sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_WRENCH, 1.0F, -1.0F, aX, aY, aZ); } return true; } if ((aBlock == Blocks.powered_comparator) || (aBlock == Blocks.unpowered_comparator)) { - if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { + if ((aPlayer.capabilities.isCreativeMode) + || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { aWorld.setBlockMetadataWithNotify(aX, aY, aZ, aMeta / 4 * 4 + (aMeta % 4 + 1) % 4, 3); GT_Utility.sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_WRENCH, 1.0F, -1.0F, aX, aY, aZ); } return true; } if ((aBlock == Blocks.crafting_table) || (aBlock == Blocks.bookshelf)) { - if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { - aWorld.spawnEntityInWorld(new EntityItem(aWorld, aX + 0.5D, aY + 0.5D, aZ + 0.5D, new ItemStack(aBlock, 1, aMeta))); + if ((aPlayer.capabilities.isCreativeMode) + || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { + aWorld.spawnEntityInWorld( + new EntityItem(aWorld, aX + 0.5D, aY + 0.5D, aZ + 0.5D, new ItemStack(aBlock, 1, aMeta))); aWorld.setBlockToAir(aX, aY, aZ); GT_Utility.sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_WRENCH, 1.0F, -1.0F, aX, aY, aZ); } return true; } if (aMeta == aTargetSide) { - if ((aBlock == Blocks.pumpkin) || (aBlock == Blocks.lit_pumpkin) || (aBlock == Blocks.piston) || (aBlock == Blocks.sticky_piston) || (aBlock == Blocks.dispenser) || (aBlock == Blocks.dropper) || (aBlock == Blocks.furnace) || (aBlock == Blocks.lit_furnace) || (aBlock == Blocks.chest) || (aBlock == Blocks.trapped_chest) || (aBlock == Blocks.ender_chest) || (aBlock == Blocks.hopper)) { - if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { - aWorld.spawnEntityInWorld(new EntityItem(aWorld, aX + 0.5D, aY + 0.5D, aZ + 0.5D, new ItemStack(aBlock, 1, 0))); + if ((aBlock == Blocks.pumpkin) + || (aBlock == Blocks.lit_pumpkin) + || (aBlock == Blocks.piston) + || (aBlock == Blocks.sticky_piston) + || (aBlock == Blocks.dispenser) + || (aBlock == Blocks.dropper) + || (aBlock == Blocks.furnace) + || (aBlock == Blocks.lit_furnace) + || (aBlock == Blocks.chest) + || (aBlock == Blocks.trapped_chest) + || (aBlock == Blocks.ender_chest) + || (aBlock == Blocks.hopper)) { + if ((aPlayer.capabilities.isCreativeMode) + || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { + aWorld.spawnEntityInWorld( + new EntityItem(aWorld, aX + 0.5D, aY + 0.5D, aZ + 0.5D, new ItemStack(aBlock, 1, 0))); aWorld.setBlockToAir(aX, aY, aZ); GT_Utility.sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_WRENCH, 1.0F, -1.0F, aX, aY, aZ); } return true; } } else { - if ((aBlock == Blocks.piston) || (aBlock == Blocks.sticky_piston) || (aBlock == Blocks.dispenser) || (aBlock == Blocks.dropper)) { - if ((aMeta < 6) && ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) { + if ((aBlock == Blocks.piston) + || (aBlock == Blocks.sticky_piston) + || (aBlock == Blocks.dispenser) + || (aBlock == Blocks.dropper)) { + if ((aMeta < 6) + && ((aPlayer.capabilities.isCreativeMode) + || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) { aWorld.setBlockMetadataWithNotify(aX, aY, aZ, aTargetSide, 3); GT_Utility.sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_WRENCH, 1.0F, -1.0F, aX, aY, aZ); } return true; } - if ((aBlock == Blocks.pumpkin) || (aBlock == Blocks.lit_pumpkin) || (aBlock == Blocks.furnace) || (aBlock == Blocks.lit_furnace) || (aBlock == Blocks.chest) || (aBlock == Blocks.ender_chest) || (aBlock == Blocks.trapped_chest)) { - if ((aTargetSide > 1) && ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) { + if ((aBlock == Blocks.pumpkin) + || (aBlock == Blocks.lit_pumpkin) + || (aBlock == Blocks.furnace) + || (aBlock == Blocks.lit_furnace) + || (aBlock == Blocks.chest) + || (aBlock == Blocks.ender_chest) + || (aBlock == Blocks.trapped_chest)) { + if ((aTargetSide > 1) + && ((aPlayer.capabilities.isCreativeMode) + || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) { aWorld.setBlockMetadataWithNotify(aX, aY, aZ, aTargetSide, 3); GT_Utility.sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_WRENCH, 1.0F, -1.0F, aX, aY, aZ); } return true; } if (aBlock == Blocks.hopper) { - if ((aTargetSide != 1) && ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) { + if ((aTargetSide != 1) + && ((aPlayer.capabilities.isCreativeMode) + || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) { aWorld.setBlockMetadataWithNotify(aX, aY, aZ, aTargetSide, 3); GT_Utility.sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_WRENCH, 1.0F, -1.0F, aX, aY, aZ); } return true; } } - if ((Arrays.asList(aBlock.getValidRotations(aWorld, aX, aY, aZ)).contains(ForgeDirection.getOrientation(aTargetSide))) && - ((aPlayer.capabilities.isCreativeMode) || (!GT_ModHandler.isElectricItem(aStack)) || (GT_ModHandler.canUseElectricItem(aStack, this.mCosts))) && - (aBlock.rotateBlock(aWorld, aX, aY, aZ, ForgeDirection.getOrientation(aTargetSide)))) { + if ((Arrays.asList(aBlock.getValidRotations(aWorld, aX, aY, aZ)) + .contains(ForgeDirection.getOrientation(aTargetSide))) + && ((aPlayer.capabilities.isCreativeMode) + || (!GT_ModHandler.isElectricItem(aStack)) + || (GT_ModHandler.canUseElectricItem(aStack, this.mCosts))) + && (aBlock.rotateBlock(aWorld, aX, aY, aZ, ForgeDirection.getOrientation(aTargetSide)))) { if (!aPlayer.capabilities.isCreativeMode) { ((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts); } diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_WrittenBook.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_WrittenBook.java index e9a771a894..c923a54948 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_WrittenBook.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_WrittenBook.java @@ -4,6 +4,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.items.GT_MetaBase_Item; import gregtech.api.util.GT_Utility; +import java.util.List; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.client.gui.GuiScreenBook; @@ -11,13 +12,23 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.world.World; -import java.util.List; - public class Behaviour_WrittenBook extends Behaviour_None { @Override @SideOnly(Side.CLIENT) - public boolean onItemUse(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { - if ((GT_Utility.isStringValid(GT_Utility.ItemNBT.getBookTitle(aStack))) && ((aPlayer instanceof EntityPlayerSP))) { + public boolean onItemUse( + GT_MetaBase_Item aItem, + ItemStack aStack, + EntityPlayer aPlayer, + World aWorld, + int aX, + int aY, + int aZ, + int aSide, + float hitX, + float hitY, + float hitZ) { + if ((GT_Utility.isStringValid(GT_Utility.ItemNBT.getBookTitle(aStack))) + && ((aPlayer instanceof EntityPlayerSP))) { Minecraft.getMinecraft().displayGuiScreen(new GuiScreenBook(aPlayer, aStack, false)); } return true; diff --git a/src/main/java/gregtech/common/misc/GT_ClientPollutionMap.java b/src/main/java/gregtech/common/misc/GT_ClientPollutionMap.java index d666408807..b05e25e1c8 100644 --- a/src/main/java/gregtech/common/misc/GT_ClientPollutionMap.java +++ b/src/main/java/gregtech/common/misc/GT_ClientPollutionMap.java @@ -6,18 +6,17 @@ import net.minecraft.util.MathHelper; public class GT_ClientPollutionMap { private static final byte RADIUS = 24; - private static final byte DISTANCE_RELOAD_MAP = 5; //When player moved x chunks, shift the map to new center. - private static final byte SIZE = RADIUS*2+1; //Area to keep stored. + private static final byte DISTANCE_RELOAD_MAP = 5; // When player moved x chunks, shift the map to new center. + private static final byte SIZE = RADIUS * 2 + 1; // Area to keep stored. private int x0, z0; private int dim; private boolean initialized = false; - private static short[][] chunkMatrix; //short because reasons. + private static short[][] chunkMatrix; // short because reasons. - - public GT_ClientPollutionMap(){ } + public GT_ClientPollutionMap() {} public void reset() { initialized = false; @@ -33,11 +32,10 @@ public class GT_ClientPollutionMap { public void addChunkPollution(int chunkX, int chunkZ, int pollution) { EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer; - if (player == null || player.worldObj == null) - return; + if (player == null || player.worldObj == null) return; int playerXChunk = MathHelper.floor_double(player.posX) >> 4; - int playerZChunk = MathHelper.floor_double(player.posZ) >> 4; //posX/Z seems to be always loaded, + int playerZChunk = MathHelper.floor_double(player.posZ) >> 4; // posX/Z seems to be always loaded, if (!initialized) { initialize(playerXChunk, playerZChunk, player.dimension); @@ -51,62 +49,56 @@ public class GT_ClientPollutionMap { shiftCenter(playerXChunk, playerZChunk); int relX = chunkX - x0 + RADIUS; - if (relX >= SIZE || relX < 0) //out of bounds - return; + if (relX >= SIZE || relX < 0) // out of bounds + return; int relZ = chunkZ - z0 + RADIUS; - if (relZ >= SIZE || relZ < 0) //out of bounds - return; - - pollution = pollution/225; - if (pollution > Short.MAX_VALUE) //Sanity - chunkMatrix[relX][relZ] = Short.MAX_VALUE; //Max pollution = 7,3mill - else if (pollution < 0) - chunkMatrix[relX][relZ] = 0; - else - chunkMatrix[relX][relZ] = (short) (pollution); + if (relZ >= SIZE || relZ < 0) // out of bounds + return; + + pollution = pollution / 225; + if (pollution > Short.MAX_VALUE) // Sanity + chunkMatrix[relX][relZ] = Short.MAX_VALUE; // Max pollution = 7,3mill + else if (pollution < 0) chunkMatrix[relX][relZ] = 0; + else chunkMatrix[relX][relZ] = (short) (pollution); } - //xy interpolation, between 4 chunks as corners, unknown treated as 0. + // xy interpolation, between 4 chunks as corners, unknown treated as 0. public int getPollution(double fx, double fz) { - if (!initialized) - return 0; + if (!initialized) return 0; int x = MathHelper.floor_double(fx); int z = MathHelper.floor_double(fz); - int xDiff = ((x-8) >> 4) - x0; - int zDiff = ((z-8) >> 4) - z0; + int xDiff = ((x - 8) >> 4) - x0; + int zDiff = ((z - 8) >> 4) - z0; - if (xDiff < -RADIUS || zDiff < -RADIUS || xDiff >= RADIUS || zDiff >= RADIUS ) - return 0; + if (xDiff < -RADIUS || zDiff < -RADIUS || xDiff >= RADIUS || zDiff >= RADIUS) return 0; - //coordinates in shifted chunk. - x = (x-8) % 16; - z = (z-8) % 16; - if (x < 0) - x = 16+x; - if (z < 0) - z = 16+z; + // coordinates in shifted chunk. + x = (x - 8) % 16; + z = (z - 8) % 16; + if (x < 0) x = 16 + x; + if (z < 0) z = 16 + z; int xi = 15 - x; int zi = 15 - z; - //read pollution in 4 corner chunks - int offsetX = RADIUS+xDiff; - int offsetZ = RADIUS+zDiff; + // read pollution in 4 corner chunks + int offsetX = RADIUS + xDiff; + int offsetZ = RADIUS + zDiff; int c00 = chunkMatrix[offsetX][offsetZ]; - int c10 = chunkMatrix[offsetX+1][offsetZ]; - int c01 = chunkMatrix[offsetX][offsetZ+1]; - int c11 = chunkMatrix[offsetX+1][offsetZ+1]; + int c10 = chunkMatrix[offsetX + 1][offsetZ]; + int c01 = chunkMatrix[offsetX][offsetZ + 1]; + int c11 = chunkMatrix[offsetX + 1][offsetZ + 1]; - //Is divided by 15*15 but is handled when storing chunk data. - return c00*xi*zi + c10*x*zi + c01*xi*z + c11*x*z; + // Is divided by 15*15 but is handled when storing chunk data. + return c00 * xi * zi + c10 * x * zi + c01 * xi * z + c11 * x * z; } - //shift the matrix to fit new center + // shift the matrix to fit new center private void shiftCenter(int chunkX, int chunkZ) { int xDiff = chunkX - x0; int zDiff = chunkZ - z0; - boolean[] allEmpty = new boolean[SIZE]; //skip check z row if its empty. + boolean[] allEmpty = new boolean[SIZE]; // skip check z row if its empty. if (xDiff > 0) for (byte x = 0; x < SIZE; x++) { int xOff = x + xDiff; @@ -118,7 +110,7 @@ public class GT_ClientPollutionMap { } } else if (xDiff < 0) - for (byte x = SIZE-1; x >= 0; x--) { + for (byte x = SIZE - 1; x >= 0; x--) { int xOff = x + xDiff; if (xOff > 0) { chunkMatrix[x] = chunkMatrix[xOff].clone(); @@ -130,19 +122,17 @@ public class GT_ClientPollutionMap { if (zDiff > 0) for (byte x = 0; x < SIZE; x++) { - if (allEmpty[x]) - continue; - for (int z = 0; z < SIZE ; z++) { + if (allEmpty[x]) continue; + for (int z = 0; z < SIZE; z++) { int zOff = z + zDiff; chunkMatrix[x][z] = (zOff < SIZE) ? chunkMatrix[x][zOff] : 0; } } else if (zDiff < 0) for (byte x = 0; x < SIZE; x++) { - if (allEmpty[x]) - continue; - for (int z = SIZE-1; z >= 0 ; z--) { - int zOff = z+zDiff; + if (allEmpty[x]) continue; + for (int z = SIZE - 1; z >= 0; z--) { + int zOff = z + zDiff; chunkMatrix[x][z] = (zOff > 0) ? chunkMatrix[x][zOff] : 0; } } diff --git a/src/main/java/gregtech/common/misc/GT_Command.java b/src/main/java/gregtech/common/misc/GT_Command.java index 29fd7a0226..8c896253fa 100644 --- a/src/main/java/gregtech/common/misc/GT_Command.java +++ b/src/main/java/gregtech/common/misc/GT_Command.java @@ -7,17 +7,16 @@ import gregtech.api.interfaces.IGlobalWirelessEnergy; import gregtech.api.objects.GT_ChunkManager; import gregtech.api.util.GT_Utility; import gregtech.common.GT_Pollution; +import java.lang.reflect.Field; +import java.math.BigInteger; +import java.util.*; +import java.util.stream.Stream; import net.minecraft.command.CommandBase; import net.minecraft.command.ICommandSender; import net.minecraft.util.ChatComponentText; import net.minecraft.util.ChunkCoordinates; import net.minecraft.util.EnumChatFormatting; -import java.lang.reflect.Field; -import java.math.BigInteger; -import java.util.*; -import java.util.stream.Stream; - public final class GT_Command extends CommandBase implements IGlobalWirelessEnergy { @Override @@ -31,14 +30,16 @@ public final class GT_Command extends CommandBase implements IGlobalWirelessEner } private void printHelp(ICommandSender sender) { - sender.addChatMessage(new ChatComponentText("Usage: gt <toggle|chunks|pollution|global_energy_add|global_energy_set|global_energy_join>")); + sender.addChatMessage(new ChatComponentText( + "Usage: gt <toggle|chunks|pollution|global_energy_add|global_energy_set|global_energy_join>")); sender.addChatMessage(new ChatComponentText("\"toggle D1\" - toggles general.Debug (D1)")); sender.addChatMessage(new ChatComponentText("\"toggle D2\" - toggles general.Debug2 (D2)")); sender.addChatMessage(new ChatComponentText("\"toggle debugCleanroom\" - toggles cleanroom debug log")); sender.addChatMessage(new ChatComponentText("\"toggle debugDriller\" - toggles oil drill debug log")); sender.addChatMessage(new ChatComponentText("\"toggle debugBlockPump\" - Possible issues with pumps")); sender.addChatMessage(new ChatComponentText("\"toggle debugBlockMiner\" - Possible issues with miners")); - sender.addChatMessage(new ChatComponentText("\"toggle debugEntityCramming\" - How long it takes and how many entities it finds")); + sender.addChatMessage(new ChatComponentText( + "\"toggle debugEntityCramming\" - How long it takes and how many entities it finds")); sender.addChatMessage(new ChatComponentText("\"toggle debugWorldGen\" - toggles generic worldgen debug")); sender.addChatMessage(new ChatComponentText("\"toggle debugOrevein\" - toggles worldgen ore vein debug")); sender.addChatMessage(new ChatComponentText("\"toggle debugSmallOres\" - toggles worldgen small vein debug")); @@ -47,33 +48,70 @@ public final class GT_Command extends CommandBase implements IGlobalWirelessEner sender.addChatMessage(new ChatComponentText("\"toggle debugMulti\" - toggles structurelib debug")); sender.addChatMessage(new ChatComponentText("\"chunks\" - print a list of the force loaded chunks")); sender.addChatMessage(new ChatComponentText( - "\"pollution <amount>\" - adds the <amount> of the pollution to the current chunk, " + - "\n if <amount> isnt specified, will add" + GT_Mod.gregtechproxy.mPollutionSmogLimit + "gibbl." - )); + "\"pollution <amount>\" - adds the <amount> of the pollution to the current chunk, " + + "\n if <amount> isnt specified, will add" + GT_Mod.gregtechproxy.mPollutionSmogLimit + + "gibbl.")); sender.addChatMessage(new ChatComponentText(EnumChatFormatting.GOLD + " --- Global wireless EU controls ---")); sender.addChatMessage(new ChatComponentText("Allows you to set the amount of EU in a users wireless network.")); - sender.addChatMessage(new ChatComponentText("Usage:" + EnumChatFormatting.RED + " global_energy_set " + EnumChatFormatting.BLUE + "[Name] " + EnumChatFormatting.LIGHT_PURPLE + "[EU]")); - sender.addChatMessage(new ChatComponentText("Allows you to add EU to a users wireless network. Also accepts negative numbers.")); - sender.addChatMessage(new ChatComponentText("Usage:" + EnumChatFormatting.RED + " global_energy_add " + EnumChatFormatting.BLUE + "[Name] " + EnumChatFormatting.LIGHT_PURPLE + "[EU]")); - sender.addChatMessage(new ChatComponentText("Allows you to join two users together into one network. Can be undone by writing the users name twice.")); - sender.addChatMessage(new ChatComponentText("Usage:" + EnumChatFormatting.RED + " global_energy_join " + EnumChatFormatting.BLUE + "[User joining] [User to join]")); + sender.addChatMessage(new ChatComponentText("Usage:" + EnumChatFormatting.RED + " global_energy_set " + + EnumChatFormatting.BLUE + "[Name] " + EnumChatFormatting.LIGHT_PURPLE + "[EU]")); + sender.addChatMessage(new ChatComponentText( + "Allows you to add EU to a users wireless network. Also accepts negative numbers.")); + sender.addChatMessage(new ChatComponentText("Usage:" + EnumChatFormatting.RED + " global_energy_add " + + EnumChatFormatting.BLUE + "[Name] " + EnumChatFormatting.LIGHT_PURPLE + "[EU]")); + sender.addChatMessage( + new ChatComponentText( + "Allows you to join two users together into one network. Can be undone by writing the users name twice.")); + sender.addChatMessage(new ChatComponentText("Usage:" + EnumChatFormatting.RED + " global_energy_join " + + EnumChatFormatting.BLUE + "[User joining] [User to join]")); sender.addChatMessage(new ChatComponentText("Shows the amount of EU in a users energy network.")); - sender.addChatMessage(new ChatComponentText("Usage:" + EnumChatFormatting.RED + " global_energy_display " + EnumChatFormatting.BLUE + "[Name]")); - + sender.addChatMessage(new ChatComponentText( + "Usage:" + EnumChatFormatting.RED + " global_energy_display " + EnumChatFormatting.BLUE + "[Name]")); } @Override public List addTabCompletionOptions(ICommandSender sender, String[] ss) { List<String> l = new ArrayList<>(); String test = ss.length == 0 ? "" : ss[0].trim(); - if (ss.length == 0 || ss.length == 1 && (test.isEmpty() || Stream.of("toggle", "chunks", "pollution", "global_energy_add", "global_energy_set", "global_energy_join", "global_energy_display").anyMatch(s -> s.startsWith(test)))) { - Stream.of("toggle", "chunks", "pollution", "global_energy_add", "global_energy_set", "global_energy_join", "global_energy_display") + if (ss.length == 0 + || ss.length == 1 + && (test.isEmpty() + || Stream.of( + "toggle", + "chunks", + "pollution", + "global_energy_add", + "global_energy_set", + "global_energy_join", + "global_energy_display") + .anyMatch(s -> s.startsWith(test)))) { + Stream.of( + "toggle", + "chunks", + "pollution", + "global_energy_add", + "global_energy_set", + "global_energy_join", + "global_energy_display") .filter(s -> test.isEmpty() || s.startsWith(test)) .forEach(l::add); } else if (test.equals("toggle")) { String test1 = ss[1].trim(); - Stream.of("D1", "D2", "debugCleanroom", "debugDriller", "debugBlockPump", "debugBlockMiner", "debugWorldGen", "debugEntityCramming", - "debugOrevein", "debugSmallOres", "debugStones", "debugChunkloaders", "debugMulti", "debugWorldData") + Stream.of( + "D1", + "D2", + "debugCleanroom", + "debugDriller", + "debugBlockPump", + "debugBlockMiner", + "debugWorldGen", + "debugEntityCramming", + "debugOrevein", + "debugSmallOres", + "debugStones", + "debugChunkloaders", + "debugMulti", + "debugWorldData") .filter(s -> test1.isEmpty() || s.startsWith(test1)) .forEach(l::add); } @@ -94,7 +132,8 @@ public final class GT_Command extends CommandBase implements IGlobalWirelessEner } if ("debugMulti".equals(strings[1])) { StructureLib.DEBUG_MODE = !StructureLib.DEBUG_MODE; - sender.addChatMessage(new ChatComponentText(strings[1] + " = " + (StructureLib.DEBUG_MODE ? "true" : "false"))); + sender.addChatMessage( + new ChatComponentText(strings[1] + " = " + (StructureLib.DEBUG_MODE ? "true" : "false"))); return; } try { @@ -116,15 +155,10 @@ public final class GT_Command extends CommandBase implements IGlobalWirelessEner break; case "pollution": ChunkCoordinates coordinates = sender.getPlayerCoordinates(); - int amount = (strings.length < 2) ? GT_Mod.gregtechproxy.mPollutionSmogLimit : Integer.parseInt(strings[1]); - GT_Pollution.addPollution(sender - .getEntityWorld() - .getChunkFromBlockCoords( - coordinates.posX, - coordinates.posZ - ), - amount - ); + int amount = + (strings.length < 2) ? GT_Mod.gregtechproxy.mPollutionSmogLimit : Integer.parseInt(strings[1]); + GT_Pollution.addPollution( + sender.getEntityWorld().getChunkFromBlockCoords(coordinates.posX, coordinates.posZ), amount); break; case "global_energy_add": { String username = strings[1]; @@ -136,23 +170,28 @@ public final class GT_Command extends CommandBase implements IGlobalWirelessEner // Usage is /gt global_energy_add username EU if (uuid.equals("")) { - sender.addChatMessage(new ChatComponentText("User " + formatted_username + " has no global energy network.")); + sender.addChatMessage( + new ChatComponentText("User " + formatted_username + " has no global energy network.")); break; } - String EU_string_formatted = EnumChatFormatting.RED + GT_Utility.formatNumbers(new BigInteger(EU_String)) + EnumChatFormatting.RESET; + String EU_string_formatted = EnumChatFormatting.RED + + GT_Utility.formatNumbers(new BigInteger(EU_String)) + + EnumChatFormatting.RESET; if (addEUToGlobalEnergyMap(uuid, new BigInteger(EU_String))) - sender.addChatMessage(new ChatComponentText("Successfully added " - + EU_string_formatted + "EU to the global energy network of " + formatted_username + ".")); + sender.addChatMessage(new ChatComponentText("Successfully added " + EU_string_formatted + + "EU to the global energy network of " + formatted_username + ".")); else sender.addChatMessage(new ChatComponentText( - "Failed to add " + EU_string_formatted + "EU to the global energy map of " + - formatted_username + ". Insufficient energy in network. ")); + "Failed to add " + EU_string_formatted + "EU to the global energy map of " + + formatted_username + ". Insufficient energy in network. ")); - sender.addChatMessage(new ChatComponentText(formatted_username + " currently has " + EnumChatFormatting.RED + - GT_Utility.formatNumbers(new BigInteger(getUserEU(uuid).toString())) + EnumChatFormatting.RESET + - "EU in their network.")); + sender.addChatMessage( + new ChatComponentText(formatted_username + " currently has " + EnumChatFormatting.RED + + GT_Utility.formatNumbers( + new BigInteger(getUserEU(uuid).toString())) + + EnumChatFormatting.RESET + "EU in their network.")); break; } @@ -165,24 +204,24 @@ public final class GT_Command extends CommandBase implements IGlobalWirelessEner String uuid = getUUIDFromUsername(username); if (uuid.equals("")) { - sender.addChatMessage(new ChatComponentText( - "User " + formatted_username + " has no global energy network.")); + sender.addChatMessage( + new ChatComponentText("User " + formatted_username + " has no global energy network.")); break; } String EU_String_0 = strings[2]; if ((new BigInteger(EU_String_0).compareTo(BigInteger.ZERO)) < 0) { - sender.addChatMessage(new ChatComponentText("Cannot set a users energy network to a negative value.")); + sender.addChatMessage( + new ChatComponentText("Cannot set a users energy network to a negative value.")); break; } setUserEU(uuid, new BigInteger(EU_String_0)); - sender.addChatMessage(new ChatComponentText( - "Successfully set " + formatted_username + "'s global energy network to " + EnumChatFormatting.RED + - GT_Utility.formatNumbers(new BigInteger(EU_String_0)) + EnumChatFormatting.RESET + "EU.") - ); + sender.addChatMessage(new ChatComponentText("Successfully set " + formatted_username + + "'s global energy network to " + EnumChatFormatting.RED + + GT_Utility.formatNumbers(new BigInteger(EU_String_0)) + EnumChatFormatting.RESET + "EU.")); break; } @@ -202,38 +241,40 @@ public final class GT_Command extends CommandBase implements IGlobalWirelessEner if (uuid_1.equals("") && uuid_0.equals("")) { if (username_0.equals(username_1)) { sender.addChatMessage(new ChatComponentText( - "User " + formatted_username_0 + " has no global energy network.")); + "User " + formatted_username_0 + " has no global energy network.")); } else { - sender.addChatMessage(new ChatComponentText( - "User " + formatted_username_0 + " and " + formatted_username_1 + - " have no global energy networks.")); + sender.addChatMessage(new ChatComponentText("User " + formatted_username_0 + " and " + + formatted_username_1 + " have no global energy networks.")); } break; } if (uuid_0.equals("")) { - sender.addChatMessage(new ChatComponentText( - "User " + formatted_username_0 + " has no global energy network.")); + sender.addChatMessage( + new ChatComponentText("User " + formatted_username_0 + " has no global energy network.")); break; } if (uuid_1.equals("")) { - sender.addChatMessage(new ChatComponentText( - "User " + formatted_username_1 + " has no global energy network.")); + sender.addChatMessage( + new ChatComponentText("User " + formatted_username_1 + " has no global energy network.")); break; } if (uuid_0.equals(uuid_1)) { joinUserNetwork(uuid_0, uuid_1); - sender.addChatMessage(new ChatComponentText("User " + formatted_username_0 + - " has rejoined their own global energy network.")); + sender.addChatMessage(new ChatComponentText( + "User " + formatted_username_0 + " has rejoined their own global energy network.")); break; } joinUserNetwork(uuid_0, uuid_1); - sender.addChatMessage(new ChatComponentText("Success! " + formatted_username_0 + " has joined " + formatted_username_1 + ".")); - sender.addChatMessage(new ChatComponentText("To undo this simply join your own network again with /gt global_energy_join " + formatted_username_0 + " " + formatted_username_0 + ".")); + sender.addChatMessage(new ChatComponentText( + "Success! " + formatted_username_0 + " has joined " + formatted_username_1 + ".")); + sender.addChatMessage(new ChatComponentText( + "To undo this simply join your own network again with /gt global_energy_join " + + formatted_username_0 + " " + formatted_username_0 + ".")); break; } @@ -246,20 +287,20 @@ public final class GT_Command extends CommandBase implements IGlobalWirelessEner String uuid = getUUIDFromUsername(username); if (uuid.equals("")) { - sender.addChatMessage(new ChatComponentText( - "User " + formatted_username + " has no global energy network.")); + sender.addChatMessage( + new ChatComponentText("User " + formatted_username + " has no global energy network.")); break; } - sender.addChatMessage(new ChatComponentText( - "User " + formatted_username + " has " - + EnumChatFormatting.RED + GT_Utility.formatNumbers(getUserEU(uuid)) + EnumChatFormatting.RESET + sender.addChatMessage(new ChatComponentText("User " + formatted_username + " has " + + EnumChatFormatting.RED + GT_Utility.formatNumbers(getUserEU(uuid)) + EnumChatFormatting.RESET + "EU in their network.")); break; } default: - sender.addChatMessage(new ChatComponentText( EnumChatFormatting.RED + "Invalid command/syntax detected.")); + sender.addChatMessage( + new ChatComponentText(EnumChatFormatting.RED + "Invalid command/syntax detected.")); printHelp(sender); } } diff --git a/src/main/java/gregtech/common/misc/GT_DrillingLogicDelegate.java b/src/main/java/gregtech/common/misc/GT_DrillingLogicDelegate.java index 8f06f70140..35a47fed87 100644 --- a/src/main/java/gregtech/common/misc/GT_DrillingLogicDelegate.java +++ b/src/main/java/gregtech/common/misc/GT_DrillingLogicDelegate.java @@ -1,25 +1,26 @@ package gregtech.common.misc; -import java.util.List; +import static gregtech.api.enums.GT_Values.debugBlockMiner; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.util.GT_Log; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Utility; import gregtech.common.blocks.GT_TileEntity_Ores; +import java.util.List; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.FakePlayer; -import static gregtech.api.enums.GT_Values.debugBlockMiner; /** @author Relvl on 27.01.2022 */ @SuppressWarnings("ObjectEquality") public class GT_DrillingLogicDelegate { public static final ItemStack MINING_PIPE_STACK = GT_ModHandler.getIC2Item("miningPipe", 0); public static final Block MINING_PIPE_BLOCK = GT_Utility.getBlockFromStack(MINING_PIPE_STACK); - public static final Block MINING_PIPE_TIP_BLOCK = GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 0)); + public static final Block MINING_PIPE_TIP_BLOCK = + GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 0)); /** The owner machine pointer */ private final GT_IDrillingLogicDelegateOwner owner; @@ -139,7 +140,9 @@ public class GT_DrillingLogicDelegate { owner.getBaseMetaTileEntity().getWorld().setBlock(xCoord, actualDrillY + 1, zCoord, MINING_PIPE_TIP_BLOCK); } // Remove the old pipe tip - aBaseMetaTileEntity.getWorld().setBlock(xCoord, actualDrillY, zCoord, Blocks.air, 0, /*send to client without neighbour updates*/2); + aBaseMetaTileEntity + .getWorld() + .setBlock(xCoord, actualDrillY, zCoord, Blocks.air, 0, /*send to client without neighbour updates*/ 2); // Return the pipe back to the machine (inputs allowed for this case!) owner.pushOutputs(MINING_PIPE_STACK, 1, false, true); @@ -169,11 +172,18 @@ public class GT_DrillingLogicDelegate { short metaData = 0; TileEntity tTileEntity = owner.getBaseMetaTileEntity().getTileEntity(x, y, z); if (tTileEntity instanceof GT_TileEntity_Ores) { - metaData = ((GT_TileEntity_Ores)tTileEntity).mMetaData; + metaData = ((GT_TileEntity_Ores) tTileEntity).mMetaData; } ItemStack cobble = GT_Utility.getCobbleForOre(block, metaData); - te.getWorld().setBlock(x, y, z, Block.getBlockFromItem(cobble.getItem()), cobble.getItemDamage(), /*cause updates(1) + send to client(2)*/ 3); + te.getWorld() + .setBlock( + x, + y, + z, + Block.getBlockFromItem(cobble.getItem()), + cobble.getItemDamage(), /*cause updates(1) + send to client(2)*/ + 3); } /** Returns NEGATIVE (eg -5) depth of current drilling Y world level. RELATIVELY TO MINER ENTITY! This means '(miner world Y) + depth = (actual world Y)'. */ @@ -209,12 +219,19 @@ public class GT_DrillingLogicDelegate { } public boolean canFakePlayerInteract(IGregTechTileEntity te, int xCoord, int yCoord, int zCoord) { - return GT_Utility.setBlockByFakePlayer(getFakePlayer(te), xCoord, yCoord, zCoord, MINING_PIPE_TIP_BLOCK, 0, true); + return GT_Utility.setBlockByFakePlayer( + getFakePlayer(te), xCoord, yCoord, zCoord, MINING_PIPE_TIP_BLOCK, 0, true); } /** Get target block drops. We need to encapsulate everyting of mining in this class. */ private List<ItemStack> getBlockDrops(final Block oreBlock, int posX, int posY, int posZ) { - return oreBlock.getDrops(owner.getBaseMetaTileEntity().getWorld(), posX, posY, posZ, owner.getBaseMetaTileEntity().getMetaID(posX, posY, posZ), owner.getMachineTier()); + return oreBlock.getDrops( + owner.getBaseMetaTileEntity().getWorld(), + posX, + posY, + posZ, + owner.getBaseMetaTileEntity().getMetaID(posX, posY, posZ), + owner.getMachineTier()); } /** Can the owner continue doing its work? If we await new pipes - it cannot. */ diff --git a/src/main/java/gregtech/common/net/MessageSetFlaskCapacity.java b/src/main/java/gregtech/common/net/MessageSetFlaskCapacity.java index d9cffaa784..7ef0244b36 100644 --- a/src/main/java/gregtech/common/net/MessageSetFlaskCapacity.java +++ b/src/main/java/gregtech/common/net/MessageSetFlaskCapacity.java @@ -57,8 +57,7 @@ public final class MessageSetFlaskCapacity extends GT_Packet_New { ItemStack stack = ((EntityPlayer) w.getEntityByID(playerID)).getHeldItem(); if ((stack != null) && (stack.stackSize > 0)) { Item item = stack.getItem(); - if ((item instanceof GT_VolumetricFlask)) - ((GT_VolumetricFlask) item).setCapacity(stack, capacity); + if ((item instanceof GT_VolumetricFlask)) ((GT_VolumetricFlask) item).setCapacity(stack, capacity); } } } diff --git a/src/main/java/gregtech/common/power/BasicMachineEUPower.java b/src/main/java/gregtech/common/power/BasicMachineEUPower.java index aad3a72718..9a858838a9 100644 --- a/src/main/java/gregtech/common/power/BasicMachineEUPower.java +++ b/src/main/java/gregtech/common/power/BasicMachineEUPower.java @@ -14,10 +14,10 @@ public class BasicMachineEUPower extends EUPower { public void computePowerUsageAndDuration(int euPerTick, int duration) { super.computePowerUsageAndDuration(euPerTick, duration); if (tier == 0) { - //Long time calculation + // Long time calculation long xMaxProgresstime = ((long) duration) << 1; if (xMaxProgresstime > Integer.MAX_VALUE - 1) { - //make impossible if too long + // make impossible if too long recipeEuPerTick = Integer.MAX_VALUE - 1; recipeDuration = Integer.MAX_VALUE - 1; } else { @@ -25,28 +25,28 @@ public class BasicMachineEUPower extends EUPower { recipeDuration = (int) xMaxProgresstime; } } else { - //Long EUt calculation + // Long EUt calculation long xEUt = euPerTick; - //Isnt too low EUt check? + // Isnt too low EUt check? long tempEUt = Math.max(xEUt, V[1]); recipeDuration = duration; while (tempEUt <= V[tier - 1] * (long) amperage) { - tempEUt <<= 2;//this actually controls overclocking - //xEUt *= 4;//this is effect of everclocking - recipeDuration >>= 1;//this is effect of overclocking - xEUt = recipeDuration == 0 ? xEUt >> 1 : xEUt << 2;//U know, if the time is less than 1 tick make the machine use 2x less power + tempEUt <<= 2; // this actually controls overclocking + // xEUt *= 4;//this is effect of everclocking + recipeDuration >>= 1; // this is effect of overclocking + xEUt = recipeDuration == 0 + ? xEUt >> 1 + : xEUt << 2; // U know, if the time is less than 1 tick make the machine use 2x less power } if (xEUt > Integer.MAX_VALUE - 1) { recipeEuPerTick = Integer.MAX_VALUE - 1; recipeDuration = Integer.MAX_VALUE - 1; } else { recipeEuPerTick = (int) xEUt; - if (recipeEuPerTick == 0) - recipeEuPerTick = 1; - if (recipeDuration == 0) - recipeDuration = 1;//set time to 1 tick + if (recipeEuPerTick == 0) recipeEuPerTick = 1; + if (recipeDuration == 0) recipeDuration = 1; // set time to 1 tick } } wasOverclocked = checkIfOverclocked(); diff --git a/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_BasicLogic.java b/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_BasicLogic.java index ab4f7eda69..41ccf9f98c 100644 --- a/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_BasicLogic.java +++ b/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_BasicLogic.java @@ -26,21 +26,41 @@ public class GT_Circuit_BasicLogic extends GT_CircuitryBehavior { @Override public void onTick(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) { if (aCircuitData[0] < 2) { - aRedstoneCircuitBlock.setRedstone((byte) (aCircuitData[0] % 2 == (getAnyRedstone(aRedstoneCircuitBlock) ? 0 : 1) ? 15 : 0), aRedstoneCircuitBlock.getOutputFacing()); + aRedstoneCircuitBlock.setRedstone( + (byte) (aCircuitData[0] % 2 == (getAnyRedstone(aRedstoneCircuitBlock) ? 0 : 1) ? 15 : 0), + aRedstoneCircuitBlock.getOutputFacing()); } else if (aCircuitData[0] < 4) { - aRedstoneCircuitBlock.setRedstone((byte) (aCircuitData[0] % 2 == (getOneRedstone(aRedstoneCircuitBlock) ? 0 : 1) ? 15 : 0), aRedstoneCircuitBlock.getOutputFacing()); + aRedstoneCircuitBlock.setRedstone( + (byte) (aCircuitData[0] % 2 == (getOneRedstone(aRedstoneCircuitBlock) ? 0 : 1) ? 15 : 0), + aRedstoneCircuitBlock.getOutputFacing()); } else if (aCircuitData[0] < 6) { - aRedstoneCircuitBlock.setRedstone((byte) (aCircuitData[0] % 2 == (getAllRedstone(aRedstoneCircuitBlock) ? 0 : 1) ? 15 : 0), aRedstoneCircuitBlock.getOutputFacing()); + aRedstoneCircuitBlock.setRedstone( + (byte) (aCircuitData[0] % 2 == (getAllRedstone(aRedstoneCircuitBlock) ? 0 : 1) ? 15 : 0), + aRedstoneCircuitBlock.getOutputFacing()); } else if (aCircuitData[0] < 7) { - aRedstoneCircuitBlock.setRedstone((byte) (15 - getStrongestRedstone(aRedstoneCircuitBlock)), aRedstoneCircuitBlock.getOutputFacing()); + aRedstoneCircuitBlock.setRedstone( + (byte) (15 - getStrongestRedstone(aRedstoneCircuitBlock)), aRedstoneCircuitBlock.getOutputFacing()); } else if (aCircuitData[0] < 9) { - aRedstoneCircuitBlock.setRedstone((byte) ((aCircuitData[0] % 2 == 0 ? 15 : 0) ^ (getStrongestRedstone(aRedstoneCircuitBlock) | getWeakestRedstone(aRedstoneCircuitBlock))), aRedstoneCircuitBlock.getOutputFacing()); + aRedstoneCircuitBlock.setRedstone( + (byte) ((aCircuitData[0] % 2 == 0 ? 15 : 0) + ^ (getStrongestRedstone(aRedstoneCircuitBlock) + | getWeakestRedstone(aRedstoneCircuitBlock))), + aRedstoneCircuitBlock.getOutputFacing()); } else if (aCircuitData[0] < 11) { - aRedstoneCircuitBlock.setRedstone((byte) ((aCircuitData[0] % 2 == 0 ? 15 : 0) ^ getStrongestRedstone(aRedstoneCircuitBlock) ^ getWeakestRedstone(aRedstoneCircuitBlock)), aRedstoneCircuitBlock.getOutputFacing()); + aRedstoneCircuitBlock.setRedstone( + (byte) ((aCircuitData[0] % 2 == 0 ? 15 : 0) + ^ getStrongestRedstone(aRedstoneCircuitBlock) + ^ getWeakestRedstone(aRedstoneCircuitBlock)), + aRedstoneCircuitBlock.getOutputFacing()); } else if (aCircuitData[0] < 13) { - aRedstoneCircuitBlock.setRedstone((byte) ((aCircuitData[0] % 2 == 0 ? 15 : 0) ^ getStrongestRedstone(aRedstoneCircuitBlock) & getWeakestRedstone(aRedstoneCircuitBlock)), aRedstoneCircuitBlock.getOutputFacing()); + aRedstoneCircuitBlock.setRedstone( + (byte) ((aCircuitData[0] % 2 == 0 ? 15 : 0) + ^ getStrongestRedstone(aRedstoneCircuitBlock) & getWeakestRedstone(aRedstoneCircuitBlock)), + aRedstoneCircuitBlock.getOutputFacing()); } else if (aCircuitData[0] < 14) { - aRedstoneCircuitBlock.setRedstone((byte) (getStrongestRedstone(aRedstoneCircuitBlock) ^ 0xF), aRedstoneCircuitBlock.getOutputFacing()); + aRedstoneCircuitBlock.setRedstone( + (byte) (getStrongestRedstone(aRedstoneCircuitBlock) ^ 0xF), + aRedstoneCircuitBlock.getOutputFacing()); } } diff --git a/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_BitAnd.java b/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_BitAnd.java index 2ea61ddf51..501f7b7785 100644 --- a/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_BitAnd.java +++ b/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_BitAnd.java @@ -46,7 +46,17 @@ public class GT_Circuit_BitAnd extends GT_CircuitryBehavior { @Override public void onTick(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) { - aRedstoneCircuitBlock.setRedstone((byte) ((getStrongestRedstone(aRedstoneCircuitBlock) & (aCircuitData[0] | aCircuitData[1] << 1 | aCircuitData[2] << 2 | aCircuitData[3] << 3)) != 0 ? 15 : 0), aRedstoneCircuitBlock.getOutputFacing()); + aRedstoneCircuitBlock.setRedstone( + (byte) + ((getStrongestRedstone(aRedstoneCircuitBlock) + & (aCircuitData[0] + | aCircuitData[1] << 1 + | aCircuitData[2] << 2 + | aCircuitData[3] << 3)) + != 0 + ? 15 + : 0), + aRedstoneCircuitBlock.getOutputFacing()); } @Override diff --git a/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Equals.java b/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Equals.java index f5bd99e09e..c493e32e29 100644 --- a/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Equals.java +++ b/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Equals.java @@ -32,7 +32,12 @@ public class GT_Circuit_Equals extends GT_CircuitryBehavior { @Override public void onTick(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) { - aRedstoneCircuitBlock.setRedstone(((byte) (((aCircuitData[1] != 0) == (getStrongestRedstone(aRedstoneCircuitBlock) == aCircuitData[0])) ? 0 : 15)), aRedstoneCircuitBlock.getOutputFacing()); + aRedstoneCircuitBlock.setRedstone( + ((byte) + (((aCircuitData[1] != 0) == (getStrongestRedstone(aRedstoneCircuitBlock) == aCircuitData[0])) + ? 0 + : 15)), + aRedstoneCircuitBlock.getOutputFacing()); } @Override diff --git a/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Pulser.java b/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Pulser.java index d1360df7cb..844817e4c3 100644 --- a/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Pulser.java +++ b/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Pulser.java @@ -3,8 +3,7 @@ package gregtech.common.redstonecircuits; import gregtech.api.interfaces.IRedstoneCircuitBlock; import gregtech.api.util.GT_CircuitryBehavior; -public class GT_Circuit_Pulser - extends GT_CircuitryBehavior { +public class GT_Circuit_Pulser extends GT_CircuitryBehavior { public GT_Circuit_Pulser(int aIndex) { super(aIndex); } @@ -34,7 +33,9 @@ public class GT_Circuit_Pulser @Override public void onTick(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) { - byte tRedstone = aCircuitData[1] == 0 ? getWeakestNonZeroRedstone(aRedstoneCircuitBlock) : getStrongestRedstone(aRedstoneCircuitBlock); + byte tRedstone = aCircuitData[1] == 0 + ? getWeakestNonZeroRedstone(aRedstoneCircuitBlock) + : getStrongestRedstone(aRedstoneCircuitBlock); if (aCircuitData[4] == 0) { aCircuitData[5] = tRedstone; } @@ -47,7 +48,12 @@ public class GT_Circuit_Pulser aCircuitData[4] = 0; } } - aRedstoneCircuitBlock.setRedstone((byte) ((aCircuitData[4] > 0) && (aCircuitData[4] <= aCircuitData[0]) ? (byte) aCircuitData[1] : (aCircuitData[1] <= 0) || (aCircuitData[1] > 15) ? (byte) aCircuitData[5] : 0), aRedstoneCircuitBlock.getOutputFacing()); + aRedstoneCircuitBlock.setRedstone( + (byte) + ((aCircuitData[4] > 0) && (aCircuitData[4] <= aCircuitData[0]) + ? (byte) aCircuitData[1] + : (aCircuitData[1] <= 0) || (aCircuitData[1] > 15) ? (byte) aCircuitData[5] : 0), + aRedstoneCircuitBlock.getOutputFacing()); } @Override diff --git a/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Randomizer.java b/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Randomizer.java index a04e2e94d1..e666d50e99 100644 --- a/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Randomizer.java +++ b/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Randomizer.java @@ -45,7 +45,8 @@ public class GT_Circuit_Randomizer extends GT_CircuitryBehavior { } if (aCircuitData[4] >= aCircuitData[0]) { aCircuitData[4] = 0; - aRedstoneCircuitBlock.setRedstone((byte) aRedstoneCircuitBlock.getRandom(16), aRedstoneCircuitBlock.getOutputFacing()); + aRedstoneCircuitBlock.setRedstone( + (byte) aRedstoneCircuitBlock.getRandom(16), aRedstoneCircuitBlock.getOutputFacing()); } } diff --git a/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_RedstoneMeter.java b/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_RedstoneMeter.java index 973e6f3963..2dd4f73bb5 100644 --- a/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_RedstoneMeter.java +++ b/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_RedstoneMeter.java @@ -50,7 +50,13 @@ public class GT_Circuit_RedstoneMeter extends GT_CircuitryBehavior { @Override public void onTick(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) { byte tRedstone = getStrongestRedstone(aRedstoneCircuitBlock); - aRedstoneCircuitBlock.setRedstone((byte) (((tRedstone >= aCircuitData[0]) && (tRedstone <= aCircuitData[1]) ? 1 : 0) != (aCircuitData[2] != 0 ? 1 : 0) ? (byte) aCircuitData[3] : 0), aRedstoneCircuitBlock.getOutputFacing()); + aRedstoneCircuitBlock.setRedstone( + (byte) + (((tRedstone >= aCircuitData[0]) && (tRedstone <= aCircuitData[1]) ? 1 : 0) + != (aCircuitData[2] != 0 ? 1 : 0) + ? (byte) aCircuitData[3] + : 0), + aRedstoneCircuitBlock.getOutputFacing()); } @Override diff --git a/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Timer.java b/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Timer.java index 57af0c4598..f207609940 100644 --- a/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Timer.java +++ b/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Timer.java @@ -57,7 +57,9 @@ public class GT_Circuit_Timer extends GT_CircuitryBehavior { aRedstoneCircuitBlock.setRedstone((byte) 15, aRedstoneCircuitBlock.getOutputFacing()); aCircuitData[4] = 0; } else { - aRedstoneCircuitBlock.setRedstone((byte) ((aCircuitData[4] - aCircuitData[0]) % aCircuitData[2] == 0 ? 15 : 0), aRedstoneCircuitBlock.getOutputFacing()); + aRedstoneCircuitBlock.setRedstone( + (byte) ((aCircuitData[4] - aCircuitData[0]) % aCircuitData[2] == 0 ? 15 : 0), + aRedstoneCircuitBlock.getOutputFacing()); } } else { aRedstoneCircuitBlock.setRedstone((byte) 15, aRedstoneCircuitBlock.getOutputFacing()); diff --git a/src/main/java/gregtech/common/render/CosmicItemRendererGT.java b/src/main/java/gregtech/common/render/CosmicItemRendererGT.java index 0055e8ad08..d8539a6f9a 100644 --- a/src/main/java/gregtech/common/render/CosmicItemRendererGT.java +++ b/src/main/java/gregtech/common/render/CosmicItemRendererGT.java @@ -1,8 +1,7 @@ package gregtech.common.render; -import java.util.*; - import fox.spiteful.avaritia.render.CosmicItemRenderer; +import java.util.*; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.client.MinecraftForgeClient; @@ -10,65 +9,64 @@ import net.minecraftforge.oredict.OreDictionary; public class CosmicItemRendererGT extends CosmicItemRenderer { - private static CosmicItemRendererGT sInstance = null; - public static HashMap<Item, List<Integer>> sCosmicItemRendererGtMapping = new HashMap<Item, List<Integer>>(); - private static boolean sInit = false; + private static CosmicItemRendererGT sInstance = null; + public static HashMap<Item, List<Integer>> sCosmicItemRendererGtMapping = new HashMap<Item, List<Integer>>(); + private static boolean sInit = false; - public static void registerItemWithMeta(Item aItem, List<Integer> aMeta) { - if (aItem != null) { - if (aMeta == null || aMeta.isEmpty()) { - ArrayList<Integer> aWildCard = new ArrayList<Integer>(); - aWildCard.add(OreDictionary.WILDCARD_VALUE); - sCosmicItemRendererGtMapping.put(aItem, aWildCard); - } - else { - sCosmicItemRendererGtMapping.put(aItem, aMeta); - } - } - } + public static void registerItemWithMeta(Item aItem, List<Integer> aMeta) { + if (aItem != null) { + if (aMeta == null || aMeta.isEmpty()) { + ArrayList<Integer> aWildCard = new ArrayList<Integer>(); + aWildCard.add(OreDictionary.WILDCARD_VALUE); + sCosmicItemRendererGtMapping.put(aItem, aWildCard); + } else { + sCosmicItemRendererGtMapping.put(aItem, aMeta); + } + } + } - public static void registerItemWithMeta(Item aItem, int aMeta) { - if (aItem != null) { - ArrayList<Integer> aSingleMeta = new ArrayList<Integer>(); - aSingleMeta.add(aMeta); - sCosmicItemRendererGtMapping.put(aItem, aSingleMeta); - } - } + public static void registerItemWithMeta(Item aItem, int aMeta) { + if (aItem != null) { + ArrayList<Integer> aSingleMeta = new ArrayList<Integer>(); + aSingleMeta.add(aMeta); + sCosmicItemRendererGtMapping.put(aItem, aSingleMeta); + } + } - public static void init() { - if (sInstance == null) { - sInstance = new CosmicItemRendererGT(); - } - if (!sInit) { - for (Item aItem : sCosmicItemRendererGtMapping.keySet()) { MinecraftForgeClient.registerItemRenderer(aItem, sInstance); } - sInit = true; - } - } + public static void init() { + if (sInstance == null) { + sInstance = new CosmicItemRendererGT(); + } + if (!sInit) { + for (Item aItem : sCosmicItemRendererGtMapping.keySet()) { + MinecraftForgeClient.registerItemRenderer(aItem, sInstance); + } + sInit = true; + } + } - private boolean isSupported(ItemStack aStack) { - List<Integer> aMeta = sCosmicItemRendererGtMapping.get(aStack.getItem()); - if (aMeta != null && !aMeta.isEmpty()) { + private boolean isSupported(ItemStack aStack) { + List<Integer> aMeta = sCosmicItemRendererGtMapping.get(aStack.getItem()); + if (aMeta != null && !aMeta.isEmpty()) { - for (int meta : aMeta) { - if (meta == OreDictionary.WILDCARD_VALUE) { - return true; - } - else { - if (aStack.getItemDamage() == meta) { - return true; - } - } - } - } - return false; - } + for (int meta : aMeta) { + if (meta == OreDictionary.WILDCARD_VALUE) { + return true; + } else { + if (aStack.getItemDamage() == meta) { + return true; + } + } + } + } + return false; + } - @Override - public void renderItem(ItemRenderType type, ItemStack item, Object... data) { - if (!isSupported(item)) { - return; - } - super.renderItem(type, item, data); - } - + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object... data) { + if (!isSupported(item)) { + return; + } + super.renderItem(type, item, data); + } } diff --git a/src/main/java/gregtech/common/render/GT_CapeRenderer.java b/src/main/java/gregtech/common/render/GT_CapeRenderer.java index 7609f6b257..0ec2778165 100644 --- a/src/main/java/gregtech/common/render/GT_CapeRenderer.java +++ b/src/main/java/gregtech/common/render/GT_CapeRenderer.java @@ -3,6 +3,7 @@ package gregtech.common.render; import gregtech.api.enums.GT_Values; import gregtech.api.util.GT_Log; import gregtech.api.util.GT_Utility; +import java.util.Collection; import net.minecraft.client.entity.AbstractClientPlayer; import net.minecraft.client.model.ModelBiped; import net.minecraft.client.renderer.entity.RenderManager; @@ -13,16 +14,16 @@ import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.event.RenderPlayerEvent; import org.lwjgl.opengl.GL11; -import java.util.Collection; - public class GT_CapeRenderer extends RenderPlayer { - private final ResourceLocation[] mCapes = { new ResourceLocation("gregtech:textures/BrainTechCape.png"), - new ResourceLocation("gregtech:textures/GregTechCape.png"), - new ResourceLocation("gregtech:textures/MrBrainCape.png"), - new ResourceLocation("gregtech:textures/GregoriusCape.png"), - new ResourceLocation("gregtech:textures/DonorCape.png"), - new ResourceLocation("gregtech:textures/DevCape.png"), - new ResourceLocation("gregtech:textures/TecCape.png")}; + private final ResourceLocation[] mCapes = { + new ResourceLocation("gregtech:textures/BrainTechCape.png"), + new ResourceLocation("gregtech:textures/GregTechCape.png"), + new ResourceLocation("gregtech:textures/MrBrainCape.png"), + new ResourceLocation("gregtech:textures/GregoriusCape.png"), + new ResourceLocation("gregtech:textures/DonorCape.png"), + new ResourceLocation("gregtech:textures/DevCape.png"), + new ResourceLocation("gregtech:textures/TecCape.png") + }; private final Collection<String> mCapeList; public GT_CapeRenderer(Collection<String> aCapeList) { @@ -44,7 +45,7 @@ public class GT_CapeRenderer extends RenderPlayer { return; } try { - ResourceLocation tResource = aPlayer.getLocationCape(); + ResourceLocation tResource = aPlayer.getLocationCape(); if (aPlayer.getDisplayName().equalsIgnoreCase("Friedi4321")) { tResource = this.mCapes[0]; } @@ -57,13 +58,13 @@ public class GT_CapeRenderer extends RenderPlayer { if (aPlayer.getDisplayName().equalsIgnoreCase("GregoriusT")) { tResource = this.mCapes[3]; } - if (this.mCapeList.contains(aPlayer.getDisplayName().toLowerCase()+":capedonor")) { + if (this.mCapeList.contains(aPlayer.getDisplayName().toLowerCase() + ":capedonor")) { tResource = this.mCapes[4]; } - if (this.mCapeList.contains(aPlayer.getDisplayName().toLowerCase()+":capedev")) { + if (this.mCapeList.contains(aPlayer.getDisplayName().toLowerCase() + ":capedev")) { tResource = this.mCapes[5]; } - if (this.mCapeList.contains(aPlayer.getDisplayName().toLowerCase()+":capetec")) { + if (this.mCapeList.contains(aPlayer.getDisplayName().toLowerCase() + ":capetec")) { tResource = this.mCapes[6]; } @@ -71,10 +72,17 @@ public class GT_CapeRenderer extends RenderPlayer { bindTexture(tResource); GL11.glPushMatrix(); GL11.glTranslatef(0.0F, 0.0F, 0.125F); - double d0 = aPlayer.field_71091_bM + (aPlayer.field_71094_bP - aPlayer.field_71091_bM) * aPartialTicks - (aPlayer.prevPosX + (aPlayer.posX - aPlayer.prevPosX) * aPartialTicks); - double d1 = aPlayer.field_71096_bN + (aPlayer.field_71095_bQ - aPlayer.field_71096_bN) * aPartialTicks - (aPlayer.prevPosY + (aPlayer.posY - aPlayer.prevPosY) * aPartialTicks); - double d2 = aPlayer.field_71097_bO + (aPlayer.field_71085_bR - aPlayer.field_71097_bO) * aPartialTicks - (aPlayer.prevPosZ + (aPlayer.posZ - aPlayer.prevPosZ) * aPartialTicks); - float f6 = aPlayer.prevRenderYawOffset + (aPlayer.renderYawOffset - aPlayer.prevRenderYawOffset) * aPartialTicks; + double d0 = aPlayer.field_71091_bM + + (aPlayer.field_71094_bP - aPlayer.field_71091_bM) * aPartialTicks + - (aPlayer.prevPosX + (aPlayer.posX - aPlayer.prevPosX) * aPartialTicks); + double d1 = aPlayer.field_71096_bN + + (aPlayer.field_71095_bQ - aPlayer.field_71096_bN) * aPartialTicks + - (aPlayer.prevPosY + (aPlayer.posY - aPlayer.prevPosY) * aPartialTicks); + double d2 = aPlayer.field_71097_bO + + (aPlayer.field_71085_bR - aPlayer.field_71097_bO) * aPartialTicks + - (aPlayer.prevPosZ + (aPlayer.posZ - aPlayer.prevPosZ) * aPartialTicks); + float f6 = aPlayer.prevRenderYawOffset + + (aPlayer.renderYawOffset - aPlayer.prevRenderYawOffset) * aPartialTicks; double d3 = MathHelper.sin(f6 * 3.141593F / 180.0F); double d4 = -MathHelper.cos(f6 * 3.141593F / 180.0F); float f7 = (float) d1 * 10.0F; @@ -90,7 +98,12 @@ public class GT_CapeRenderer extends RenderPlayer { f8 = 0.0F; } float f10 = aPlayer.prevCameraYaw + (aPlayer.cameraYaw - aPlayer.prevCameraYaw) * aPartialTicks; - f7 += MathHelper.sin((aPlayer.prevDistanceWalkedModified + (aPlayer.distanceWalkedModified - aPlayer.prevDistanceWalkedModified) * aPartialTicks) * 6.0F) * 32.0F * f10; + f7 += MathHelper.sin((aPlayer.prevDistanceWalkedModified + + (aPlayer.distanceWalkedModified - aPlayer.prevDistanceWalkedModified) + * aPartialTicks) + * 6.0F) + * 32.0F + * f10; if (aPlayer.isSneaking()) { f7 += 25.0F; } diff --git a/src/main/java/gregtech/common/render/GT_CopiedBlockTexture.java b/src/main/java/gregtech/common/render/GT_CopiedBlockTexture.java index ce089091d3..2f6c691253 100644 --- a/src/main/java/gregtech/common/render/GT_CopiedBlockTexture.java +++ b/src/main/java/gregtech/common/render/GT_CopiedBlockTexture.java @@ -57,9 +57,9 @@ public class GT_CopiedBlockTexture extends GT_TextureBase implements ITexture, I public void renderYPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { startDrawingQuads(aRenderer, 0.0f, 1.0f, 0.0f); final IIcon aIcon = getIcon(ForgeDirection.UP.ordinal()); - new LightingHelper(aRenderer) - .setupLightingYPos(aBlock, aX, aY, aZ) - .setupColor(ForgeDirection.UP.ordinal(), 0xffffff); + new LightingHelper(aRenderer) + .setupLightingYPos(aBlock, aX, aY, aZ) + .setupColor(ForgeDirection.UP.ordinal(), 0xffffff); aRenderer.renderFaceYPos(aBlock, aX, aY, aZ, aIcon); draw(aRenderer); } diff --git a/src/main/java/gregtech/common/render/GT_CopiedCTMBlockTexture.java b/src/main/java/gregtech/common/render/GT_CopiedCTMBlockTexture.java index 366da77420..5b9ed1bb29 100644 --- a/src/main/java/gregtech/common/render/GT_CopiedCTMBlockTexture.java +++ b/src/main/java/gregtech/common/render/GT_CopiedCTMBlockTexture.java @@ -14,7 +14,8 @@ class GT_CopiedCTMBlockTexture extends GT_TextureBase implements ITexture, IBloc private final byte mSide, mMeta; GT_CopiedCTMBlockTexture(Block aBlock, int aSide, int aMeta, short[] aRGBa, boolean allowAlpha) { - if (aRGBa.length != 4) throw new IllegalArgumentException("RGBa doesn't have 4 Values @ GT_CopiedCTMBlockTexture"); + if (aRGBa.length != 4) + throw new IllegalArgumentException("RGBa doesn't have 4 Values @ GT_CopiedCTMBlockTexture"); mBlock = aBlock; mSide = (byte) aSide; mMeta = (byte) aMeta; @@ -41,7 +42,8 @@ class GT_CopiedCTMBlockTexture extends GT_TextureBase implements ITexture, IBloc startDrawingQuads(aRenderer, 1.0f, 0.0f, 0.0f); new LightingHelper(aRenderer) .setupLightingXPos(aBlock, aX, aY, aZ) - .setupColor(ForgeDirection.EAST.ordinal(), mBlock.colorMultiplier(getBlockAccess(aRenderer), aX, aY, aZ)); + .setupColor( + ForgeDirection.EAST.ordinal(), mBlock.colorMultiplier(getBlockAccess(aRenderer), aX, aY, aZ)); aRenderer.renderFaceXPos(aBlock, aX, aY, aZ, aIcon); draw(aRenderer); aRenderer.field_152631_f = false; @@ -53,7 +55,8 @@ class GT_CopiedCTMBlockTexture extends GT_TextureBase implements ITexture, IBloc final IIcon aIcon = getIcon(ForgeDirection.WEST.ordinal(), aX, aY, aZ, aRenderer); new LightingHelper(aRenderer) .setupLightingXNeg(aBlock, aX, aY, aZ) - .setupColor(ForgeDirection.WEST.ordinal(), mBlock.colorMultiplier(getBlockAccess(aRenderer), aX, aY, aZ)); + .setupColor( + ForgeDirection.WEST.ordinal(), mBlock.colorMultiplier(getBlockAccess(aRenderer), aX, aY, aZ)); aRenderer.renderFaceXNeg(aBlock, aX, aY, aZ, aIcon); draw(aRenderer); } @@ -75,7 +78,8 @@ class GT_CopiedCTMBlockTexture extends GT_TextureBase implements ITexture, IBloc final IIcon aIcon = getIcon(ForgeDirection.DOWN.ordinal(), aX, aY, aZ, aRenderer); new LightingHelper(aRenderer) .setupLightingYNeg(aBlock, aX, aY, aZ) - .setupColor(ForgeDirection.DOWN.ordinal(), mBlock.colorMultiplier(getBlockAccess(aRenderer), aX, aY, aZ)); + .setupColor( + ForgeDirection.DOWN.ordinal(), mBlock.colorMultiplier(getBlockAccess(aRenderer), aX, aY, aZ)); aRenderer.renderFaceYNeg(aBlock, aX, aY, aZ, aIcon); draw(aRenderer); } @@ -86,7 +90,8 @@ class GT_CopiedCTMBlockTexture extends GT_TextureBase implements ITexture, IBloc final IIcon aIcon = getIcon(ForgeDirection.SOUTH.ordinal(), aX, aY, aZ, aRenderer); new LightingHelper(aRenderer) .setupLightingZPos(aBlock, aX, aY, aZ) - .setupColor(ForgeDirection.SOUTH.ordinal(), mBlock.colorMultiplier(getBlockAccess(aRenderer), aX, aY, aZ)); + .setupColor( + ForgeDirection.SOUTH.ordinal(), mBlock.colorMultiplier(getBlockAccess(aRenderer), aX, aY, aZ)); aRenderer.renderFaceZPos(aBlock, aX, aY, aZ, aIcon); draw(aRenderer); } @@ -98,7 +103,8 @@ class GT_CopiedCTMBlockTexture extends GT_TextureBase implements ITexture, IBloc aRenderer.field_152631_f = true; new LightingHelper(aRenderer) .setupLightingZNeg(aBlock, aX, aY, aZ) - .setupColor(ForgeDirection.NORTH.ordinal(), mBlock.colorMultiplier(getBlockAccess(aRenderer), aX, aY, aZ)); + .setupColor( + ForgeDirection.NORTH.ordinal(), mBlock.colorMultiplier(getBlockAccess(aRenderer), aX, aY, aZ)); aRenderer.renderFaceZNeg(aBlock, aX, aY, aZ, aIcon); draw(aRenderer); aRenderer.field_152631_f = false; diff --git a/src/main/java/gregtech/common/render/GT_FlaskRenderer.java b/src/main/java/gregtech/common/render/GT_FlaskRenderer.java index 48d9b0bf90..18fb47cffc 100644 --- a/src/main/java/gregtech/common/render/GT_FlaskRenderer.java +++ b/src/main/java/gregtech/common/render/GT_FlaskRenderer.java @@ -27,7 +27,6 @@ public final class GT_FlaskRenderer implements IItemRenderer { return type != ItemRenderType.FIRST_PERSON_MAP; } - @Override public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, IItemRenderer.ItemRendererHelper helper) { return type == ItemRenderType.ENTITY; @@ -85,7 +84,15 @@ public final class GT_FlaskRenderer implements IItemRenderer { if (type.equals(ItemRenderType.INVENTORY)) { DrawUtil.renderIcon(icon, 16.0D, 0.001D, 0.0F, 0.0F, -1.0F); } else { - ItemRenderer.renderItemIn2D(Tessellator.instance, icon.getMaxU(), icon.getMinV(), icon.getMinU(), icon.getMaxV(), icon.getIconWidth(), icon.getIconHeight(), 0.0625F); + ItemRenderer.renderItemIn2D( + Tessellator.instance, + icon.getMaxU(), + icon.getMinV(), + icon.getMinU(), + icon.getMaxV(), + icon.getIconWidth(), + icon.getIconHeight(), + 0.0625F); } GL11.glDisable(GL11.GL_ALPHA_TEST); GL11.glDisable(GL11.GL_BLEND); diff --git a/src/main/java/gregtech/common/render/GT_FluidDisplayStackRenderer.java b/src/main/java/gregtech/common/render/GT_FluidDisplayStackRenderer.java index c4e23eab6e..221c6cd8aa 100644 --- a/src/main/java/gregtech/common/render/GT_FluidDisplayStackRenderer.java +++ b/src/main/java/gregtech/common/render/GT_FluidDisplayStackRenderer.java @@ -21,24 +21,20 @@ public class GT_FluidDisplayStackRenderer implements IItemRenderer { } @Override - public boolean handleRenderType (ItemStack item, ItemRenderType type) - { - if(!item.hasTagCompound()) - return false; + public boolean handleRenderType(ItemStack item, ItemRenderType type) { + if (!item.hasTagCompound()) return false; return type == ItemRenderType.INVENTORY; } @Override - public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) - { - //not sure what this does. + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { + // not sure what this does. return false; } @Override - public void renderItem (ItemRenderType type, ItemStack item, Object... data) { - if (item == null || item.getItem() == null || !(item.getItem() instanceof GT_FluidDisplayItem)) - return; + public void renderItem(ItemRenderType type, ItemStack item, Object... data) { + if (item == null || item.getItem() == null || !(item.getItem() instanceof GT_FluidDisplayItem)) return; OpenGlHelper.glBlendFunc(770, 771, 1, 0); GL11.glEnable(GL11.GL_BLEND); @@ -53,13 +49,13 @@ public class GT_FluidDisplayStackRenderer implements IItemRenderer { final float x_max = icon.getMaxU(); final float y_min = icon.getMinV(); final float y_max = icon.getMaxV(); - tess.addVertexWithUV( 0, 16, 0, x_min, y_max); + tess.addVertexWithUV(0, 16, 0, x_min, y_max); tess.addVertexWithUV(16, 16, 0, x_max, y_max); - tess.addVertexWithUV(16, 0, 0, x_max, y_min); - tess.addVertexWithUV( 0, 0, 0, x_min, y_min); + tess.addVertexWithUV(16, 0, 0, x_max, y_min); + tess.addVertexWithUV(0, 0, 0, x_min, y_min); tess.draw(); - if(item.getTagCompound() == null) { + if (item.getTagCompound() == null) { GL11.glDisable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_ALPHA_TEST); return; @@ -75,9 +71,10 @@ public class GT_FluidDisplayStackRenderer implements IItemRenderer { } else { int exp = (int) (Math.log(fluidAmount) / Math.log(1000)); double shortAmount = fluidAmount / Math.pow(1000, exp); - if ( shortAmount >= 100) { - amountString = String.format("%.0f%cL", shortAmount, "kMGTPE".charAt(exp - 1)); //heard it here first, PetaLiters - } else if ( shortAmount >= 10) { + if (shortAmount >= 100) { + amountString = String.format( + "%.0f%cL", shortAmount, "kMGTPE".charAt(exp - 1)); // heard it here first, PetaLiters + } else if (shortAmount >= 10) { amountString = String.format("%.1f%cL", shortAmount, "kMGTPE".charAt(exp - 1)); } else { amountString = String.format("%.2f%cL", shortAmount, "kMGTPE".charAt(exp - 1)); @@ -85,11 +82,12 @@ public class GT_FluidDisplayStackRenderer implements IItemRenderer { } FontRenderer fontRender = Minecraft.getMinecraft().fontRenderer; - float smallTextScale = fontRender.getUnicodeFlag() ? 3F/4F : 1F/2F; + float smallTextScale = fontRender.getUnicodeFlag() ? 3F / 4F : 1F / 2F; GL11.glDisable(GL11.GL_BLEND); GL11.glScalef(smallTextScale, smallTextScale, 1.0f); - fontRender.drawString( amountString, 0, (int) (16/smallTextScale) - fontRender.FONT_HEIGHT + 1, 0xFFFFFF, true); + fontRender.drawString( + amountString, 0, (int) (16 / smallTextScale) - fontRender.FONT_HEIGHT + 1, 0xFFFFFF, true); GL11.glScalef(1f, 1f, 1f); GL11.glDisable(GL11.GL_ALPHA_TEST); } diff --git a/src/main/java/gregtech/common/render/GT_MetaGenerated_Tool_Renderer.java b/src/main/java/gregtech/common/render/GT_MetaGenerated_Tool_Renderer.java index a57f97792c..52e99f4539 100644 --- a/src/main/java/gregtech/common/render/GT_MetaGenerated_Tool_Renderer.java +++ b/src/main/java/gregtech/common/render/GT_MetaGenerated_Tool_Renderer.java @@ -29,11 +29,15 @@ public class GT_MetaGenerated_Tool_Renderer implements IItemRenderer { if ((GT_Utility.isStackInvalid(aStack)) || (aStack.getItemDamage() < 0)) { return false; } - return (aType == IItemRenderer.ItemRenderType.EQUIPPED_FIRST_PERSON) || (aType == IItemRenderer.ItemRenderType.INVENTORY) || (aType == IItemRenderer.ItemRenderType.EQUIPPED) || (aType == IItemRenderer.ItemRenderType.ENTITY); + return (aType == IItemRenderer.ItemRenderType.EQUIPPED_FIRST_PERSON) + || (aType == IItemRenderer.ItemRenderType.INVENTORY) + || (aType == IItemRenderer.ItemRenderType.EQUIPPED) + || (aType == IItemRenderer.ItemRenderType.ENTITY); } @Override - public boolean shouldUseRenderHelper(IItemRenderer.ItemRenderType aType, ItemStack aStack, IItemRenderer.ItemRendererHelper aHelper) { + public boolean shouldUseRenderHelper( + IItemRenderer.ItemRenderType aType, ItemStack aStack, IItemRenderer.ItemRendererHelper aHelper) { if (GT_Utility.isStackInvalid(aStack)) { return false; } @@ -72,7 +76,15 @@ public class GT_MetaGenerated_Tool_Renderer implements IItemRenderer { if (aType.equals(IItemRenderer.ItemRenderType.INVENTORY)) { GT_RenderUtil.renderItemIcon(tIcon, 16.0D, 0.001D, 0.0F, 0.0F, -1.0F); } else { - ItemRenderer.renderItemIn2D(Tessellator.instance, tIcon.getMaxU(), tIcon.getMinV(), tIcon.getMinU(), tIcon.getMaxV(), tIcon.getIconWidth(), tIcon.getIconHeight(), 0.0625F); + ItemRenderer.renderItemIn2D( + Tessellator.instance, + tIcon.getMaxU(), + tIcon.getMinV(), + tIcon.getMinU(), + tIcon.getMaxV(), + tIcon.getIconWidth(), + tIcon.getIconHeight(), + 0.0625F); } GL11.glColor3f(1.0F, 1.0F, 1.0F); } @@ -82,7 +94,15 @@ public class GT_MetaGenerated_Tool_Renderer implements IItemRenderer { if (aType.equals(IItemRenderer.ItemRenderType.INVENTORY)) { GT_RenderUtil.renderItemIcon(tOverlay, 16.0D, 0.001D, 0.0F, 0.0F, -1.0F); } else { - ItemRenderer.renderItemIn2D(Tessellator.instance, tOverlay.getMaxU(), tOverlay.getMinV(), tOverlay.getMinU(), tOverlay.getMaxV(), tOverlay.getIconWidth(), tOverlay.getIconHeight(), 0.0625F); + ItemRenderer.renderItemIn2D( + Tessellator.instance, + tOverlay.getMaxU(), + tOverlay.getMinV(), + tOverlay.getMinU(), + tOverlay.getMaxV(), + tOverlay.getIconWidth(), + tOverlay.getIconHeight(), + 0.0625F); } } } @@ -98,7 +118,15 @@ public class GT_MetaGenerated_Tool_Renderer implements IItemRenderer { if (aType.equals(IItemRenderer.ItemRenderType.INVENTORY)) { GT_RenderUtil.renderItemIcon(tIcon, 16.0D, 0.001D, 0.0F, 0.0F, -1.0F); } else { - ItemRenderer.renderItemIn2D(Tessellator.instance, tIcon.getMaxU(), tIcon.getMinV(), tIcon.getMinU(), tIcon.getMaxV(), tIcon.getIconWidth(), tIcon.getIconHeight(), 0.0625F); + ItemRenderer.renderItemIn2D( + Tessellator.instance, + tIcon.getMaxU(), + tIcon.getMinV(), + tIcon.getMinU(), + tIcon.getMaxV(), + tIcon.getIconWidth(), + tIcon.getIconHeight(), + 0.0625F); } GL11.glColor3f(1.0F, 1.0F, 1.0F); } @@ -108,11 +136,20 @@ public class GT_MetaGenerated_Tool_Renderer implements IItemRenderer { if (aType.equals(IItemRenderer.ItemRenderType.INVENTORY)) { GT_RenderUtil.renderItemIcon(tOverlay, 16.0D, 0.001D, 0.0F, 0.0F, -1.0F); } else { - ItemRenderer.renderItemIn2D(Tessellator.instance, tOverlay.getMaxU(), tOverlay.getMinV(), tOverlay.getMinU(), tOverlay.getMaxV(), tOverlay.getIconWidth(), tOverlay.getIconHeight(), 0.0625F); + ItemRenderer.renderItemIn2D( + Tessellator.instance, + tOverlay.getMaxU(), + tOverlay.getMinV(), + tOverlay.getMinU(), + tOverlay.getMaxV(), + tOverlay.getIconWidth(), + tOverlay.getIconHeight(), + 0.0625F); } } } - if ((aType == IItemRenderer.ItemRenderType.INVENTORY) && (GT_MetaGenerated_Tool.getPrimaryMaterial(aStack) != Materials._NULL)) { + if ((aType == IItemRenderer.ItemRenderType.INVENTORY) + && (GT_MetaGenerated_Tool.getPrimaryMaterial(aStack) != Materials._NULL)) { long tDamage = GT_MetaGenerated_Tool.getToolDamage(aStack); long tMaxDamage = GT_MetaGenerated_Tool.getToolMaxDamage(aStack); if (tDamage <= 0L) { @@ -120,7 +157,9 @@ public class GT_MetaGenerated_Tool_Renderer implements IItemRenderer { } else if (tDamage >= tMaxDamage) { aIcon = gregtech.api.enums.Textures.ItemIcons.DURABILITY_BAR[0]; } else { - aIcon = gregtech.api.enums.Textures.ItemIcons.DURABILITY_BAR[((int) java.lang.Math.max(0L, java.lang.Math.min(7L, (tMaxDamage - tDamage) * 8L / tMaxDamage)))]; + aIcon = gregtech.api.enums.Textures.ItemIcons.DURABILITY_BAR[ + ((int) java.lang.Math.max( + 0L, java.lang.Math.min(7L, (tMaxDamage - tDamage) * 8L / tMaxDamage)))]; } if (aIcon != null) { IIcon tIcon = aIcon.getIcon(); @@ -131,7 +170,15 @@ public class GT_MetaGenerated_Tool_Renderer implements IItemRenderer { if (aType.equals(IItemRenderer.ItemRenderType.INVENTORY)) { GT_RenderUtil.renderItemIcon(tIcon, 16.0D, 0.001D, 0.0F, 0.0F, -1.0F); } else { - ItemRenderer.renderItemIn2D(Tessellator.instance, tIcon.getMaxU(), tIcon.getMinV(), tIcon.getMinU(), tIcon.getMaxV(), tIcon.getIconWidth(), tIcon.getIconHeight(), 0.0625F); + ItemRenderer.renderItemIn2D( + Tessellator.instance, + tIcon.getMaxU(), + tIcon.getMinV(), + tIcon.getMinU(), + tIcon.getMaxV(), + tIcon.getIconWidth(), + tIcon.getIconHeight(), + 0.0625F); } } if (tOverlay != null) { @@ -140,7 +187,15 @@ public class GT_MetaGenerated_Tool_Renderer implements IItemRenderer { if (aType.equals(IItemRenderer.ItemRenderType.INVENTORY)) { GT_RenderUtil.renderItemIcon(tOverlay, 16.0D, 0.001D, 0.0F, 0.0F, -1.0F); } else { - ItemRenderer.renderItemIn2D(Tessellator.instance, tOverlay.getMaxU(), tOverlay.getMinV(), tOverlay.getMinU(), tOverlay.getMaxV(), tOverlay.getIconWidth(), tOverlay.getIconHeight(), 0.0625F); + ItemRenderer.renderItemIn2D( + Tessellator.instance, + tOverlay.getMaxU(), + tOverlay.getMinV(), + tOverlay.getMinU(), + tOverlay.getMaxV(), + tOverlay.getIconWidth(), + tOverlay.getIconHeight(), + 0.0625F); } } } @@ -152,7 +207,10 @@ public class GT_MetaGenerated_Tool_Renderer implements IItemRenderer { } else if (tCharge >= tStats[0]) { aIcon = gregtech.api.enums.Textures.ItemIcons.ENERGY_BAR[8]; } else { - aIcon = gregtech.api.enums.Textures.ItemIcons.ENERGY_BAR[(7 - (int) java.lang.Math.max(0L, java.lang.Math.min(6L, (tStats[0] - tCharge) * 7L / tStats[0])))]; + aIcon = gregtech.api.enums.Textures.ItemIcons.ENERGY_BAR[ + (7 + - (int) java.lang.Math.max( + 0L, java.lang.Math.min(6L, (tStats[0] - tCharge) * 7L / tStats[0])))]; } } else { aIcon = null; @@ -166,7 +224,15 @@ public class GT_MetaGenerated_Tool_Renderer implements IItemRenderer { if (aType.equals(IItemRenderer.ItemRenderType.INVENTORY)) { GT_RenderUtil.renderItemIcon(tIcon, 16.0D, 0.001D, 0.0F, 0.0F, -1.0F); } else { - ItemRenderer.renderItemIn2D(Tessellator.instance, tIcon.getMaxU(), tIcon.getMinV(), tIcon.getMinU(), tIcon.getMaxV(), tIcon.getIconWidth(), tIcon.getIconHeight(), 0.0625F); + ItemRenderer.renderItemIn2D( + Tessellator.instance, + tIcon.getMaxU(), + tIcon.getMinV(), + tIcon.getMinU(), + tIcon.getMaxV(), + tIcon.getIconWidth(), + tIcon.getIconHeight(), + 0.0625F); } } if (tOverlay != null) { @@ -175,7 +241,15 @@ public class GT_MetaGenerated_Tool_Renderer implements IItemRenderer { if (aType.equals(IItemRenderer.ItemRenderType.INVENTORY)) { GT_RenderUtil.renderItemIcon(tOverlay, 16.0D, 0.001D, 0.0F, 0.0F, -1.0F); } else { - ItemRenderer.renderItemIn2D(Tessellator.instance, tOverlay.getMaxU(), tOverlay.getMinV(), tOverlay.getMinU(), tOverlay.getMaxV(), tOverlay.getIconWidth(), tOverlay.getIconHeight(), 0.0625F); + ItemRenderer.renderItemIn2D( + Tessellator.instance, + tOverlay.getMaxU(), + tOverlay.getMinV(), + tOverlay.getMinU(), + tOverlay.getMaxV(), + tOverlay.getIconWidth(), + tOverlay.getIconHeight(), + 0.0625F); } } } diff --git a/src/main/java/gregtech/common/render/GT_MultiTexture.java b/src/main/java/gregtech/common/render/GT_MultiTexture.java index 2d78b9b988..df5251f784 100644 --- a/src/main/java/gregtech/common/render/GT_MultiTexture.java +++ b/src/main/java/gregtech/common/render/GT_MultiTexture.java @@ -12,12 +12,10 @@ import net.minecraft.client.renderer.RenderBlocks; public class GT_MultiTexture extends GT_TextureBase implements ITexture { protected final ITexture[] mTextures; - public static GT_MultiTexture get(ITexture... aTextures) { return GT_Mod.instance.isClientSide() ? new GT_MultiTexture(aTextures) : null; } - protected GT_MultiTexture(ITexture... aTextures) { mTextures = aTextures; } diff --git a/src/main/java/gregtech/common/render/GT_PollutionRenderer.java b/src/main/java/gregtech/common/render/GT_PollutionRenderer.java index 5128af1c36..99689a535d 100644 --- a/src/main/java/gregtech/common/render/GT_PollutionRenderer.java +++ b/src/main/java/gregtech/common/render/GT_PollutionRenderer.java @@ -37,7 +37,7 @@ public class GT_PollutionRenderer { private static final int FOG_START_AT_POLLUTION = 400000; private static final int FOG_MAX_AT_POLLUTION = 7000000; - //jump from linear to exponential fog. x*FOG_MAX_AT_POLLUTION+FOG_START_AT_POLLUTION + // jump from linear to exponential fog. x*FOG_MAX_AT_POLLUTION+FOG_START_AT_POLLUTION private static final double FOG_START_EXP_RATIO = 0.02D; private static final float[] fogColor = {0.3f, 0.25f, 0.1f}; @@ -46,7 +46,7 @@ public class GT_PollutionRenderer { private static final short[] liquidColor = {160, 200, 10}; private static final short[] foliageColor = {160, 80, 15}; - //TODO need to soft update some blocks, grass and leaves does more often than liquid it looks like. + // TODO need to soft update some blocks, grass and leaves does more often than liquid it looks like. public GT_PollutionRenderer() { pollutionMap = new GT_ClientPollutionMap(); @@ -64,14 +64,12 @@ public class GT_PollutionRenderer { @SubscribeEvent(priority = EventPriority.HIGH) public void enteredWorld(WorldEvent.Load event) { EntityClientPlayerMP p = Minecraft.getMinecraft().thePlayer; - if (!event.world.isRemote || p == null) - return; + if (!event.world.isRemote || p == null) return; pollutionMap.reset(); } private static int color(int color, int pollution, int low, float high, short[] colors) { - if ( pollution < low) - return color; + if (pollution < low) return color; int r = (color >> 16) & 0xFF; int g = (color >> 8) & 0xFF; @@ -89,16 +87,19 @@ public class GT_PollutionRenderer { // Methods for hodgepodge to color grass / foliage blocks etc. public static int colorGrass(int oColor, int x, int z) { - return color(oColor, pollutionMap.getPollution(x, z)/1000, 350, 600, grassColor); + return color(oColor, pollutionMap.getPollution(x, z) / 1000, 350, 600, grassColor); } + public static int colorLeaves(int oColor, int x, int z) { - return color(oColor, pollutionMap.getPollution(x, z)/1000, 300, 500, leavesColor); + return color(oColor, pollutionMap.getPollution(x, z) / 1000, 300, 500, leavesColor); } + public static int colorLiquid(int oColor, int x, int z) { - return color(oColor, pollutionMap.getPollution(x, z)/1000, 300, 500, liquidColor); + return color(oColor, pollutionMap.getPollution(x, z) / 1000, 300, 500, liquidColor); } + public static int colorFoliage(int oColor, int x, int z) { - return color(oColor, pollutionMap.getPollution(x, z)/1000, 300, 500, foliageColor); + return color(oColor, pollutionMap.getPollution(x, z) / 1000, 300, 500, foliageColor); } public static int getKnownPollution(int x, int z) { @@ -107,19 +108,16 @@ public class GT_PollutionRenderer { @SubscribeEvent(priority = EventPriority.LOW) public void manipulateColor(EntityViewRenderEvent.FogColors event) { - if (!DEBUG && Minecraft.getMinecraft().thePlayer.capabilities.isCreativeMode) - return; + if (!DEBUG && Minecraft.getMinecraft().thePlayer.capabilities.isCreativeMode) return; - if (event.block.getMaterial() == Material.water || - event.block.getMaterial() == Material.lava) - return; + if (event.block.getMaterial() == Material.water || event.block.getMaterial() == Material.lava) return; float x = fogIntensityLastTick > 1 ? 1F : (float) fogIntensityLastTick; float xi = 1 - x; - event.red = xi*event.red + x*fogColor[0]; - event.green = xi*event.green + x*fogColor[1]; - event.blue = xi*event.blue + x*fogColor[2]; + event.red = xi * event.red + x * fogColor[0]; + event.green = xi * event.green + x * fogColor[1]; + event.blue = xi * event.blue + x * fogColor[2]; } private static final int END_MAX_DISTANCE = 192 - 1; @@ -129,74 +127,74 @@ public class GT_PollutionRenderer { public void renderGTPollutionFog(EntityViewRenderEvent.RenderFogEvent event) { if (!GT_Mod.gregtechproxy.mRenderPollutionFog) return; - if ((!DEBUG && Minecraft.getMinecraft().thePlayer.capabilities.isCreativeMode) || - (fogIntensityLastTick <= 0 && fogIntensityLastTick >= FOG_START_EXP_RATIO)) - return; + if ((!DEBUG && Minecraft.getMinecraft().thePlayer.capabilities.isCreativeMode) + || (fogIntensityLastTick <= 0 && fogIntensityLastTick >= FOG_START_EXP_RATIO)) return; if (event.fogMode == 0) { - double v = 1 - fogIntensityLastTick/FOG_START_EXP_RATIO; - //trying to smooth out jump from linear to exponential + double v = 1 - fogIntensityLastTick / FOG_START_EXP_RATIO; + // trying to smooth out jump from linear to exponential GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_LINEAR); - GL11.glFogf(GL11.GL_FOG_START, (float) ((END_MAX_DISTANCE-20) * 0.75F * v + 20)); + GL11.glFogf(GL11.GL_FOG_START, (float) ((END_MAX_DISTANCE - 20) * 0.75F * v + 20)); GL11.glFogf(GL11.GL_FOG_END, (float) (END_MAX_DISTANCE * (0.75F + v * 0.25F))); } - //else if ( event.fogMode < 0) { } + // else if ( event.fogMode < 0) { } } @SubscribeEvent(priority = EventPriority.LOWEST) public void renderGTPollutionFog(EntityViewRenderEvent.FogDensity event) { if (!GT_Mod.gregtechproxy.mRenderPollutionFog) return; - if (!DEBUG && Minecraft.getMinecraft().thePlayer.capabilities.isCreativeMode) - return; + if (!DEBUG && Minecraft.getMinecraft().thePlayer.capabilities.isCreativeMode) return; - if (event.entity.isPotionActive(Potion.blindness) || - (fogIntensityLastTick < FOG_START_EXP_RATIO) || - event.block.getMaterial() == Material.water || - event.block.getMaterial() == Material.lava - ) - return; + if (event.entity.isPotionActive(Potion.blindness) + || (fogIntensityLastTick < FOG_START_EXP_RATIO) + || event.block.getMaterial() == Material.water + || event.block.getMaterial() == Material.lava) return; GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_EXP2); - event.density = (float) Math.pow(fogIntensityLastTick - FOG_START_EXP_RATIO, .75F)/5 + 0.01F; + event.density = (float) Math.pow(fogIntensityLastTick - FOG_START_EXP_RATIO, .75F) / 5 + 0.01F; event.setCanceled(true); } private double lastUpdate = 0; + @SubscribeEvent(priority = EventPriority.HIGHEST) public void onRenderTick(TickEvent.RenderTickEvent event) { Minecraft mc = Minecraft.getMinecraft(); - if (mc == null) - return; + if (mc == null) return; EntityClientPlayerMP player = mc.thePlayer; - if (player == null) - return; + if (player == null) return; if (event.phase == TickEvent.Phase.START) { - if (event.renderTickTime < lastUpdate) - lastUpdate = lastUpdate - 1; + if (event.renderTickTime < lastUpdate) lastUpdate = lastUpdate - 1; float step = (float) ((event.renderTickTime - lastUpdate) / 50); lastUpdate = event.renderTickTime; - float fogIntensity = (playerPollution-FOG_START_AT_POLLUTION)/ (float) FOG_MAX_AT_POLLUTION; + float fogIntensity = (playerPollution - FOG_START_AT_POLLUTION) / (float) FOG_MAX_AT_POLLUTION; if (fogIntensity > 1) fogIntensity = 1; else if (fogIntensity < 0) fogIntensity = 0; - double e = fogIntensity-fogIntensityLastTick; + double e = fogIntensity - fogIntensityLastTick; if (e != 0) { if (e > 0.2) e = 0.2D; - else if (e < -0.5) e = - 0.5D; + else if (e < -0.5) e = -0.5D; - if (e > 0.001D || e < -0.001D) - fogIntensityLastTick += step *e; - else - fogIntensityLastTick = fogIntensity; + if (e > 0.001D || e < -0.001D) fogIntensityLastTick += step * e; + else fogIntensityLastTick = fogIntensity; } - } - else if (DEBUG) { + } else if (DEBUG) { drawPollution("Intensity: " + (fogIntensityLastTick * 10000), 0); - drawPollution("Pollution: " + pollutionMap.getPollution(Minecraft.getMinecraft().thePlayer.lastTickPosX, Minecraft.getMinecraft().thePlayer.lastTickPosZ), 20); - drawPollution("Density: " + ((float)(Math.pow(fogIntensityLastTick - FOG_START_EXP_RATIO, .75F)/5 + 0.01F)* 10000), 40); + drawPollution( + "Pollution: " + + pollutionMap.getPollution( + Minecraft.getMinecraft().thePlayer.lastTickPosX, + Minecraft.getMinecraft().thePlayer.lastTickPosZ), + 20); + drawPollution( + "Density: " + + ((float) (Math.pow(fogIntensityLastTick - FOG_START_EXP_RATIO, .75F) / 5 + 0.01F) + * 10000), + 40); } } @@ -205,22 +203,17 @@ public class GT_PollutionRenderer { public void onClientTick(TickEvent.ClientTickEvent event) { if (!GT_Mod.gregtechproxy.mRenderDirtParticles) return; Minecraft mc = Minecraft.getMinecraft(); - if (mc == null) - return; + if (mc == null) return; EntityClientPlayerMP player = mc.thePlayer; - if (player == null || (player.capabilities.isCreativeMode && !DEBUG)) - return; + if (player == null || (player.capabilities.isCreativeMode && !DEBUG)) return; World w = player.worldObj; playerPollution = pollutionMap.getPollution(player.lastTickPosX, player.lastTickPosZ); float intensity = ((float) playerPollution - PARTICLES_POLLUTION_START) / PARTICLES_POLLUTION_END; - if (intensity < 0) - return; - else if (intensity > 1) - intensity = 1; - else - intensity *= intensity; + if (intensity < 0) return; + else if (intensity > 1) intensity = 1; + else intensity *= intensity; int x = MathHelper.floor_double(player.posX); int y = MathHelper.floor_double(player.posY); @@ -235,13 +228,17 @@ public class GT_PollutionRenderer { Block block = w.getBlock(i1, j1, k1); if (block.getMaterial() == Material.air) { - EntityFX fx = new GT_EntityFXPollution(w, (float) i1 + w.rand.nextFloat(), (float) j1 + w.rand.nextFloat(), (float) k1 + w.rand.nextFloat()); + EntityFX fx = new GT_EntityFXPollution( + w, + (float) i1 + w.rand.nextFloat(), + (float) j1 + w.rand.nextFloat(), + (float) k1 + w.rand.nextFloat()); mc.effectRenderer.addEffect(fx); } } } - private void drawPollution(String text, int off){ + private void drawPollution(String text, int off) { GL11.glPushMatrix(); GL11.glEnable(GL11.GL_BLEND); OpenGlHelper.glBlendFunc(770, 771, 1, 0); diff --git a/src/main/java/gregtech/common/render/GT_RenderUtil.java b/src/main/java/gregtech/common/render/GT_RenderUtil.java index 1b674f440f..ef0cae11ff 100644 --- a/src/main/java/gregtech/common/render/GT_RenderUtil.java +++ b/src/main/java/gregtech/common/render/GT_RenderUtil.java @@ -8,7 +8,16 @@ public class GT_RenderUtil { renderItemIcon(icon, 0.0D, 0.0D, size, size, z, nx, ny, nz); } - public static void renderItemIcon(IIcon icon, double xStart, double yStart, double xEnd, double yEnd, double z, float nx, float ny, float nz) { + public static void renderItemIcon( + IIcon icon, + double xStart, + double yStart, + double xEnd, + double yEnd, + double z, + float nx, + float ny, + float nz) { if (icon == null) { return; } diff --git a/src/main/java/gregtech/common/render/GT_RenderedTexture.java b/src/main/java/gregtech/common/render/GT_RenderedTexture.java index 94b0e72419..3c12c9589d 100644 --- a/src/main/java/gregtech/common/render/GT_RenderedTexture.java +++ b/src/main/java/gregtech/common/render/GT_RenderedTexture.java @@ -1,5 +1,7 @@ package gregtech.common.render; +import static gregtech.api.util.LightingHelper.MAX_BRIGHTNESS; + import com.gtnewhorizon.structurelib.alignment.IAlignment; import com.gtnewhorizon.structurelib.alignment.IAlignmentProvider; import com.gtnewhorizon.structurelib.alignment.enumerable.ExtendedFacing; @@ -22,8 +24,6 @@ import net.minecraft.util.IIcon; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import static gregtech.api.util.LightingHelper.MAX_BRIGHTNESS; - public class GT_RenderedTexture extends GT_TextureBase implements ITexture, IColorModulationContainer { protected final IIconContainer mIconContainer; private final short[] mRGBa; @@ -31,7 +31,13 @@ public class GT_RenderedTexture extends GT_TextureBase implements ITexture, ICol private final boolean stdOrient; private final boolean useExtFacing; - protected GT_RenderedTexture(IIconContainer aIcon, short[] aRGBa, boolean allowAlpha, boolean glow, boolean stdOrient, boolean extFacing) { + protected GT_RenderedTexture( + IIconContainer aIcon, + short[] aRGBa, + boolean allowAlpha, + boolean glow, + boolean stdOrient, + boolean extFacing) { if (aRGBa.length != 4) throw new IllegalArgumentException("RGBa doesn't have 4 Values @ GT_RenderedTexture"); mIconContainer = aIcon; mRGBa = aRGBa; @@ -176,7 +182,7 @@ public class GT_RenderedTexture extends GT_TextureBase implements ITexture, ICol final boolean enableAO = aRenderer.enableAO; final LightingHelper lighting = new LightingHelper(aRenderer); if (glow) { - if (!GT_Mod.gregtechproxy.mRenderGlowTextures){ + if (!GT_Mod.gregtechproxy.mRenderGlowTextures) { draw(aRenderer); return; } @@ -208,7 +214,8 @@ public class GT_RenderedTexture extends GT_TextureBase implements ITexture, ICol /** * Renders the given texture to the bottom face of the block. Args: block, x, y, z, texture */ - protected void renderFaceYNeg(RenderBlocks aRenderer, double x, double y, double z, IIcon icon, ExtendedFacing extendedFacing) { + protected void renderFaceYNeg( + RenderBlocks aRenderer, double x, double y, double z, IIcon icon, ExtendedFacing extendedFacing) { switch (useExtFacing ? extendedFacing.getRotation() : Rotation.NORMAL) { case COUNTER_CLOCKWISE: @@ -226,14 +233,23 @@ public class GT_RenderedTexture extends GT_TextureBase implements ITexture, ICol } final Flip aFlip = extendedFacing.getFlip(); - aRenderer.renderFaceYNeg(Blocks.air, x, y, z, useExtFacing && GT_Mod.gregtechproxy.mRenderFlippedMachinesFlipped ? new GT_IconFlipped(icon, aFlip.isHorizontallyFlipped() ^ !stdOrient, aFlip.isVerticallyFliped()) : new GT_IconFlipped(icon, !stdOrient, false)); + aRenderer.renderFaceYNeg( + Blocks.air, + x, + y, + z, + useExtFacing && GT_Mod.gregtechproxy.mRenderFlippedMachinesFlipped + ? new GT_IconFlipped( + icon, aFlip.isHorizontallyFlipped() ^ !stdOrient, aFlip.isVerticallyFliped()) + : new GT_IconFlipped(icon, !stdOrient, false)); aRenderer.uvRotateBottom = 0; } /** * Renders the given texture to the top face of the block. Args: block, x, y, z, texture */ - protected void renderFaceYPos(RenderBlocks aRenderer, double x, double y, double z, IIcon icon, ExtendedFacing extendedFacing) { + protected void renderFaceYPos( + RenderBlocks aRenderer, double x, double y, double z, IIcon icon, ExtendedFacing extendedFacing) { switch (useExtFacing ? extendedFacing.getRotation() : Rotation.NORMAL) { case COUNTER_CLOCKWISE: @@ -251,14 +267,22 @@ public class GT_RenderedTexture extends GT_TextureBase implements ITexture, ICol } final Flip aFlip = extendedFacing.getFlip(); - aRenderer.renderFaceYPos(Blocks.air, x, y, z, useExtFacing && GT_Mod.gregtechproxy.mRenderFlippedMachinesFlipped ? new GT_IconFlipped(icon, aFlip.isHorizontallyFlipped(), aFlip.isVerticallyFliped()) : icon); + aRenderer.renderFaceYPos( + Blocks.air, + x, + y, + z, + useExtFacing && GT_Mod.gregtechproxy.mRenderFlippedMachinesFlipped + ? new GT_IconFlipped(icon, aFlip.isHorizontallyFlipped(), aFlip.isVerticallyFliped()) + : icon); aRenderer.uvRotateTop = 0; } /** * Renders the given texture to the north (z-negative) face of the block. Args: block, x, y, z, texture */ - protected void renderFaceZNeg(RenderBlocks aRenderer, double x, double y, double z, IIcon icon, ExtendedFacing extendedFacing) { + protected void renderFaceZNeg( + RenderBlocks aRenderer, double x, double y, double z, IIcon icon, ExtendedFacing extendedFacing) { aRenderer.field_152631_f = true; // **NOT A BUG**: aRenderer.uvRotateEast REALLY CONTROLS THE ROTATION OF THE NORTH SIDE switch (useExtFacing ? extendedFacing.getRotation() : Rotation.NORMAL) { @@ -277,7 +301,14 @@ public class GT_RenderedTexture extends GT_TextureBase implements ITexture, ICol } final Flip aFlip = extendedFacing.getFlip(); - aRenderer.renderFaceZNeg(Blocks.air, x, y, z, useExtFacing && GT_Mod.gregtechproxy.mRenderFlippedMachinesFlipped ? new GT_IconFlipped(icon, aFlip.isHorizontallyFlipped(), aFlip.isVerticallyFliped()) : icon); + aRenderer.renderFaceZNeg( + Blocks.air, + x, + y, + z, + useExtFacing && GT_Mod.gregtechproxy.mRenderFlippedMachinesFlipped + ? new GT_IconFlipped(icon, aFlip.isHorizontallyFlipped(), aFlip.isVerticallyFliped()) + : icon); aRenderer.uvRotateEast = 0; aRenderer.field_152631_f = false; } @@ -285,7 +316,8 @@ public class GT_RenderedTexture extends GT_TextureBase implements ITexture, ICol /** * Renders the given texture to the south (z-positive) face of the block. Args: block, x, y, z, texture */ - protected void renderFaceZPos(RenderBlocks aRenderer, double x, double y, double z, IIcon icon, ExtendedFacing extendedFacing) { + protected void renderFaceZPos( + RenderBlocks aRenderer, double x, double y, double z, IIcon icon, ExtendedFacing extendedFacing) { // **NOT A BUG**: aRenderer.uvRotateWest REALLY CONTROLS THE ROTATION OF THE SOUTH SIDE switch (useExtFacing ? extendedFacing.getRotation() : Rotation.NORMAL) { case COUNTER_CLOCKWISE: @@ -303,14 +335,22 @@ public class GT_RenderedTexture extends GT_TextureBase implements ITexture, ICol } final Flip aFlip = extendedFacing.getFlip(); - aRenderer.renderFaceZPos(Blocks.air, x, y, z, useExtFacing && GT_Mod.gregtechproxy.mRenderFlippedMachinesFlipped ? new GT_IconFlipped(icon, aFlip.isHorizontallyFlipped(), aFlip.isVerticallyFliped()) : icon); + aRenderer.renderFaceZPos( + Blocks.air, + x, + y, + z, + useExtFacing && GT_Mod.gregtechproxy.mRenderFlippedMachinesFlipped + ? new GT_IconFlipped(icon, aFlip.isHorizontallyFlipped(), aFlip.isVerticallyFliped()) + : icon); aRenderer.uvRotateWest = 0; } /** * Renders the given texture to the west (x-negative) face of the block. Args: block, x, y, z, texture */ - protected void renderFaceXNeg(RenderBlocks aRenderer, double x, double y, double z, IIcon icon, ExtendedFacing extendedFacing) { + protected void renderFaceXNeg( + RenderBlocks aRenderer, double x, double y, double z, IIcon icon, ExtendedFacing extendedFacing) { // **NOT A BUG**: aRenderer.uvRotateNorth REALLY CONTROLS THE ROTATION OF THE WEST SIDE switch (useExtFacing ? extendedFacing.getRotation() : Rotation.NORMAL) { case COUNTER_CLOCKWISE: @@ -328,14 +368,22 @@ public class GT_RenderedTexture extends GT_TextureBase implements ITexture, ICol } final Flip aFlip = extendedFacing.getFlip(); - aRenderer.renderFaceXNeg(Blocks.air, x, y, z, useExtFacing && GT_Mod.gregtechproxy.mRenderFlippedMachinesFlipped ? new GT_IconFlipped(icon, aFlip.isHorizontallyFlipped(), aFlip.isVerticallyFliped()) : icon); + aRenderer.renderFaceXNeg( + Blocks.air, + x, + y, + z, + useExtFacing && GT_Mod.gregtechproxy.mRenderFlippedMachinesFlipped + ? new GT_IconFlipped(icon, aFlip.isHorizontallyFlipped(), aFlip.isVerticallyFliped()) + : icon); aRenderer.uvRotateNorth = 0; } /** * Renders the given texture to the east (x-positive) face of the block. Args: block, x, y, z, texture */ - protected void renderFaceXPos(RenderBlocks aRenderer, double x, double y, double z, IIcon icon, ExtendedFacing extendedFacing) { + protected void renderFaceXPos( + RenderBlocks aRenderer, double x, double y, double z, IIcon icon, ExtendedFacing extendedFacing) { aRenderer.field_152631_f = true; // **NOT A BUG**: aRenderer.uvRotateSouth REALLY CONTROLS THE ROTATION OF THE EAST SIDE switch (useExtFacing ? extendedFacing.getRotation() : Rotation.NORMAL) { @@ -354,7 +402,14 @@ public class GT_RenderedTexture extends GT_TextureBase implements ITexture, ICol } final Flip aFlip = extendedFacing.getFlip(); - aRenderer.renderFaceXPos(Blocks.air, x, y, z, useExtFacing && GT_Mod.gregtechproxy.mRenderFlippedMachinesFlipped ? new GT_IconFlipped(icon, aFlip.isHorizontallyFlipped(), aFlip.isVerticallyFliped()) : icon); + aRenderer.renderFaceXPos( + Blocks.air, + x, + y, + z, + useExtFacing && GT_Mod.gregtechproxy.mRenderFlippedMachinesFlipped + ? new GT_IconFlipped(icon, aFlip.isHorizontallyFlipped(), aFlip.isVerticallyFliped()) + : icon); aRenderer.uvRotateSouth = 0; aRenderer.field_152631_f = false; } @@ -372,7 +427,8 @@ public class GT_RenderedTexture extends GT_TextureBase implements ITexture, ICol if (meta instanceof IAlignmentProvider) { alignment = ((IAlignmentProvider) meta).getAlignment(); } else if (meta != null) { - return ExtendedFacing.of(ForgeDirection.getOrientation(meta.getBaseMetaTileEntity().getFrontFacing())); + return ExtendedFacing.of(ForgeDirection.getOrientation( + meta.getBaseMetaTileEntity().getFrontFacing())); } } else if (te instanceof IAlignmentProvider) { alignment = ((IAlignmentProvider) te).getAlignment(); diff --git a/src/main/java/gregtech/common/render/GT_Renderer_Block.java b/src/main/java/gregtech/common/render/GT_Renderer_Block.java index ef8748064f..5831c76bf4 100644 --- a/src/main/java/gregtech/common/render/GT_Renderer_Block.java +++ b/src/main/java/gregtech/common/render/GT_Renderer_Block.java @@ -1,5 +1,26 @@ package gregtech.common.render; +import static gregtech.api.enums.GT_Values.ALL_VALID_SIDES; +import static gregtech.api.enums.GT_Values.OFFX; +import static gregtech.api.enums.GT_Values.OFFY; +import static gregtech.api.enums.GT_Values.OFFZ; +import static gregtech.api.interfaces.metatileentity.IConnectable.CONNECTED_DOWN; +import static gregtech.api.interfaces.metatileentity.IConnectable.CONNECTED_EAST; +import static gregtech.api.interfaces.metatileentity.IConnectable.CONNECTED_NORTH; +import static gregtech.api.interfaces.metatileentity.IConnectable.CONNECTED_SOUTH; +import static gregtech.api.interfaces.metatileentity.IConnectable.CONNECTED_UP; +import static gregtech.api.interfaces.metatileentity.IConnectable.CONNECTED_WEST; +import static gregtech.api.interfaces.metatileentity.IConnectable.HAS_FRESHFOAM; +import static gregtech.api.interfaces.metatileentity.IConnectable.HAS_HARDENEDFOAM; +import static gregtech.api.interfaces.metatileentity.IConnectable.NO_CONNECTION; +import static net.minecraftforge.common.util.ForgeDirection.DOWN; +import static net.minecraftforge.common.util.ForgeDirection.EAST; +import static net.minecraftforge.common.util.ForgeDirection.NORTH; +import static net.minecraftforge.common.util.ForgeDirection.SOUTH; +import static net.minecraftforge.common.util.ForgeDirection.UP; +import static net.minecraftforge.common.util.ForgeDirection.VALID_DIRECTIONS; +import static net.minecraftforge.common.util.ForgeDirection.WEST; + import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.relauncher.Side; @@ -25,33 +46,8 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; - import org.lwjgl.opengl.GL11; -import java.util.Arrays; -import java.util.Collections; - -import static gregtech.api.enums.GT_Values.ALL_VALID_SIDES; -import static gregtech.api.enums.GT_Values.OFFX; -import static gregtech.api.enums.GT_Values.OFFY; -import static gregtech.api.enums.GT_Values.OFFZ; -import static gregtech.api.interfaces.metatileentity.IConnectable.CONNECTED_DOWN; -import static gregtech.api.interfaces.metatileentity.IConnectable.CONNECTED_EAST; -import static gregtech.api.interfaces.metatileentity.IConnectable.CONNECTED_NORTH; -import static gregtech.api.interfaces.metatileentity.IConnectable.CONNECTED_SOUTH; -import static gregtech.api.interfaces.metatileentity.IConnectable.CONNECTED_UP; -import static gregtech.api.interfaces.metatileentity.IConnectable.CONNECTED_WEST; -import static gregtech.api.interfaces.metatileentity.IConnectable.HAS_FRESHFOAM; -import static gregtech.api.interfaces.metatileentity.IConnectable.HAS_HARDENEDFOAM; -import static gregtech.api.interfaces.metatileentity.IConnectable.NO_CONNECTION; -import static net.minecraftforge.common.util.ForgeDirection.DOWN; -import static net.minecraftforge.common.util.ForgeDirection.EAST; -import static net.minecraftforge.common.util.ForgeDirection.NORTH; -import static net.minecraftforge.common.util.ForgeDirection.SOUTH; -import static net.minecraftforge.common.util.ForgeDirection.UP; -import static net.minecraftforge.common.util.ForgeDirection.VALID_DIRECTIONS; -import static net.minecraftforge.common.util.ForgeDirection.WEST; - public class GT_Renderer_Block implements ISimpleBlockRenderingHandler { public static final float blockMin = 0.0F; public static final float blockMax = 1.0F; @@ -67,31 +63,34 @@ public class GT_Renderer_Block implements ISimpleBlockRenderingHandler { RenderingRegistry.registerBlockHandler(this); } - public static boolean renderStandardBlock(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, RenderBlocks aRenderer) { + public static boolean renderStandardBlock( + IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, RenderBlocks aRenderer) { final TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); if ((tTileEntity instanceof IPipeRenderedTileEntity)) { - return renderStandardBlock(aWorld, aX, aY, aZ, aBlock, aRenderer, new ITexture[][]{ - ((IPipeRenderedTileEntity) tTileEntity).getTextureCovered((byte) DOWN.ordinal()), - ((IPipeRenderedTileEntity) tTileEntity).getTextureCovered((byte) UP.ordinal()), - ((IPipeRenderedTileEntity) tTileEntity).getTextureCovered((byte) NORTH.ordinal()), - ((IPipeRenderedTileEntity) tTileEntity).getTextureCovered((byte) SOUTH.ordinal()), - ((IPipeRenderedTileEntity) tTileEntity).getTextureCovered((byte) WEST.ordinal()), - ((IPipeRenderedTileEntity) tTileEntity).getTextureCovered((byte) EAST.ordinal())}); + return renderStandardBlock(aWorld, aX, aY, aZ, aBlock, aRenderer, new ITexture[][] { + ((IPipeRenderedTileEntity) tTileEntity).getTextureCovered((byte) DOWN.ordinal()), + ((IPipeRenderedTileEntity) tTileEntity).getTextureCovered((byte) UP.ordinal()), + ((IPipeRenderedTileEntity) tTileEntity).getTextureCovered((byte) NORTH.ordinal()), + ((IPipeRenderedTileEntity) tTileEntity).getTextureCovered((byte) SOUTH.ordinal()), + ((IPipeRenderedTileEntity) tTileEntity).getTextureCovered((byte) WEST.ordinal()), + ((IPipeRenderedTileEntity) tTileEntity).getTextureCovered((byte) EAST.ordinal()) + }); } if ((tTileEntity instanceof ITexturedTileEntity)) { - return renderStandardBlock(aWorld, aX, aY, aZ, aBlock, aRenderer, new ITexture[][]{ - ((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) DOWN.ordinal()), - ((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) UP.ordinal()), - ((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) NORTH.ordinal()), - ((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) SOUTH.ordinal()), - ((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) WEST.ordinal()), - ((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) EAST.ordinal())} - ); + return renderStandardBlock(aWorld, aX, aY, aZ, aBlock, aRenderer, new ITexture[][] { + ((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) DOWN.ordinal()), + ((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) UP.ordinal()), + ((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) NORTH.ordinal()), + ((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) SOUTH.ordinal()), + ((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) WEST.ordinal()), + ((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) EAST.ordinal()) + }); } return false; } - public static boolean renderStandardBlock(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, RenderBlocks aRenderer, ITexture[][] aTextures) { + public static boolean renderStandardBlock( + IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, RenderBlocks aRenderer, ITexture[][] aTextures) { aBlock.setBlockBounds(blockMin, blockMin, blockMin, blockMax, blockMax, blockMax); aRenderer.setRenderBoundsFromBlock(aBlock); @@ -104,7 +103,14 @@ public class GT_Renderer_Block implements ISimpleBlockRenderingHandler { return true; } - public static boolean renderPipeBlock(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, IPipeRenderedTileEntity aTileEntity, RenderBlocks aRenderer) { + public static boolean renderPipeBlock( + IBlockAccess aWorld, + int aX, + int aY, + int aZ, + Block aBlock, + IPipeRenderedTileEntity aTileEntity, + RenderBlocks aRenderer) { final byte aConnections = aTileEntity.getConnections(); if ((aConnections & (HAS_FRESHFOAM | HAS_HARDENEDFOAM)) != 0) { return renderStandardBlock(aWorld, aX, aY, aZ, aBlock, aRenderer); @@ -465,7 +471,8 @@ public class GT_Renderer_Block implements ISimpleBlockRenderingHandler { } @SideOnly(Side.CLIENT) - public static void addHitEffects(EffectRenderer effectRenderer, Block block, World world, int x, int y, int z, int side) { + public static void addHitEffects( + EffectRenderer effectRenderer, Block block, World world, int x, int y, int z, int side) { double rX = x + XSTR.XSTR_INSTANCE.nextDouble() * 0.8 + 0.1; double rY = y + XSTR.XSTR_INSTANCE.nextDouble() * 0.8 + 0.1; double rZ = z + XSTR.XSTR_INSTANCE.nextDouble() * 0.8 + 0.1; @@ -482,7 +489,11 @@ public class GT_Renderer_Block implements ISimpleBlockRenderingHandler { } else if (side == 5) { rX = x + 1.1; } - effectRenderer.addEffect((new EntityDiggingFX(world, rX, rY, rZ, 0.0, 0.0, 0.0, block, block.getDamageValue(world, x, y, z), side)).applyColourMultiplier(x, y, z).multiplyVelocity(0.2F).multipleParticleScaleBy(0.6F)); + effectRenderer.addEffect((new EntityDiggingFX( + world, rX, rY, rZ, 0.0, 0.0, 0.0, block, block.getDamageValue(world, x, y, z), side)) + .applyColourMultiplier(x, y, z) + .multiplyVelocity(0.2F) + .multipleParticleScaleBy(0.6F)); } @SideOnly(Side.CLIENT) @@ -493,7 +504,17 @@ public class GT_Renderer_Block implements ISimpleBlockRenderingHandler { final double bX = x + (iX + 0.5) / 4.0; final double bY = y + (iY + 0.5) / 4.0; final double bZ = z + (iZ + 0.5) / 4.0; - effectRenderer.addEffect((new EntityDiggingFX(world, bX, bY, bZ, bX - x - 0.5, bY - y - 0.5, bZ - z - 0.5, block, block.getDamageValue(world, x, y, z))).applyColourMultiplier(x, y, z)); + effectRenderer.addEffect((new EntityDiggingFX( + world, + bX, + bY, + bZ, + bX - x - 0.5, + bY - y - 0.5, + bZ - z - 0.5, + block, + block.getDamageValue(world, x, y, z))) + .applyColourMultiplier(x, y, z)); } } } @@ -506,13 +527,12 @@ public class GT_Renderer_Block implements ISimpleBlockRenderingHandler { GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); GL11.glTranslatef(-0.5F, -0.5F, -0.5F); - if(aBlock instanceof IRenderedBlock) { + if (aBlock instanceof IRenderedBlock) { boolean tNeedsToSetBounds = true; final ItemStack aStack = new ItemStack(aBlock, 1, aMeta); - IRenderedBlock tRenderer = ((IRenderedBlock)aBlock).passRenderingToObject(aStack); + IRenderedBlock tRenderer = ((IRenderedBlock) aBlock).passRenderingToObject(aStack); if (tRenderer != null) tRenderer = tRenderer.passRenderingToObject(aStack); - if (tRenderer == null) - tRenderer = IRenderedBlock.ErrorRenderer.INSTANCE; + if (tRenderer == null) tRenderer = IRenderedBlock.ErrorRenderer.INSTANCE; for (int i = 0, j = tRenderer.getRenderPasses(aBlock); i < j; i++) { if (tRenderer.usesRenderPass(i)) { if (tRenderer.setBlockBounds(aBlock, i)) { @@ -524,12 +544,60 @@ public class GT_Renderer_Block implements ISimpleBlockRenderingHandler { tNeedsToSetBounds = false; } - renderNegativeYFacing(null, aRenderer, aBlock, 0, 0, 0, tRenderer.getTexture(aBlock, (byte) DOWN.ordinal(), true, i), !tNeedsToSetBounds); - renderPositiveYFacing(null, aRenderer, aBlock, 0, 0, 0, tRenderer.getTexture(aBlock, (byte) UP.ordinal(), true, i), !tNeedsToSetBounds); - renderNegativeZFacing(null, aRenderer, aBlock, 0, 0, 0, tRenderer.getTexture(aBlock, (byte) NORTH.ordinal(), true, i), !tNeedsToSetBounds); - renderPositiveZFacing(null, aRenderer, aBlock, 0, 0, 0, tRenderer.getTexture(aBlock, (byte) SOUTH.ordinal(), true, i), !tNeedsToSetBounds); - renderNegativeXFacing(null, aRenderer, aBlock, 0, 0, 0, tRenderer.getTexture(aBlock, (byte) WEST.ordinal(), true, i), !tNeedsToSetBounds); - renderPositiveXFacing(null, aRenderer, aBlock, 0, 0, 0, tRenderer.getTexture(aBlock, (byte) EAST.ordinal(), true, i), !tNeedsToSetBounds); + renderNegativeYFacing( + null, + aRenderer, + aBlock, + 0, + 0, + 0, + tRenderer.getTexture(aBlock, (byte) DOWN.ordinal(), true, i), + !tNeedsToSetBounds); + renderPositiveYFacing( + null, + aRenderer, + aBlock, + 0, + 0, + 0, + tRenderer.getTexture(aBlock, (byte) UP.ordinal(), true, i), + !tNeedsToSetBounds); + renderNegativeZFacing( + null, + aRenderer, + aBlock, + 0, + 0, + 0, + tRenderer.getTexture(aBlock, (byte) NORTH.ordinal(), true, i), + !tNeedsToSetBounds); + renderPositiveZFacing( + null, + aRenderer, + aBlock, + 0, + 0, + 0, + tRenderer.getTexture(aBlock, (byte) SOUTH.ordinal(), true, i), + !tNeedsToSetBounds); + renderNegativeXFacing( + null, + aRenderer, + aBlock, + 0, + 0, + 0, + tRenderer.getTexture(aBlock, (byte) WEST.ordinal(), true, i), + !tNeedsToSetBounds); + renderPositiveXFacing( + null, + aRenderer, + aBlock, + 0, + 0, + 0, + tRenderer.getTexture(aBlock, (byte) EAST.ordinal(), true, i), + !tNeedsToSetBounds); } } if (tNeedsToSetBounds) aBlock.setBlockBounds(0, 0, 0, 1, 1, 1); @@ -541,18 +609,23 @@ public class GT_Renderer_Block implements ISimpleBlockRenderingHandler { aBlock.setBlockBoundsForItemRender(); aRenderer.setRenderBoundsFromBlock(aBlock); - renderNegativeYFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) DOWN.ordinal()), true); - renderPositiveYFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) UP.ordinal()), true); - renderNegativeZFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) NORTH.ordinal()), true); - renderPositiveZFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) SOUTH.ordinal()), true); - renderNegativeXFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) WEST.ordinal()), true); - renderPositiveXFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) EAST.ordinal()), true); + renderNegativeYFacing( + null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) DOWN.ordinal()), true); + renderPositiveYFacing( + null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) UP.ordinal()), true); + renderNegativeZFacing( + null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) NORTH.ordinal()), true); + renderPositiveZFacing( + null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) SOUTH.ordinal()), true); + renderNegativeXFacing( + null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) WEST.ordinal()), true); + renderPositiveXFacing( + null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) EAST.ordinal()), true); } else if (aMeta > 0 - && (aMeta < GregTech_API.METATILEENTITIES.length) - && aBlock instanceof GT_Block_Machines - && (GregTech_API.METATILEENTITIES[aMeta] != null) - && (!GregTech_API.METATILEENTITIES[aMeta].renderInInventory(aBlock, aMeta, aRenderer))) - { + && (aMeta < GregTech_API.METATILEENTITIES.length) + && aBlock instanceof GT_Block_Machines + && (GregTech_API.METATILEENTITIES[aMeta] != null) + && (!GregTech_API.METATILEENTITIES[aMeta].renderInInventory(aBlock, aMeta, aRenderer))) { renderNormalInventoryMetaTileEntity(aBlock, aMeta, aRenderer); } aBlock.setBlockBounds(blockMin, blockMin, blockMin, blockMax, blockMax, blockMax); @@ -584,26 +657,173 @@ public class GT_Renderer_Block implements ISimpleBlockRenderingHandler { aBlock.setBlockBounds(blockMin, pipeMin, pipeMin, blockMax, pipeMax, pipeMax); aRenderer.setRenderBoundsFromBlock(aBlock); - renderNegativeYFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(iGregTechTileEntity, (byte) DOWN.ordinal(), (byte) (CONNECTED_WEST | CONNECTED_EAST), (byte) -1, false, false), true); - renderPositiveYFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(iGregTechTileEntity, (byte) UP.ordinal(), (byte) (CONNECTED_WEST | CONNECTED_EAST), (byte) -1, false, false), true); - renderNegativeZFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(iGregTechTileEntity, (byte) NORTH.ordinal(), (byte) (CONNECTED_WEST | CONNECTED_EAST), (byte) -1, false, false), true); - renderPositiveZFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(iGregTechTileEntity, (byte) SOUTH.ordinal(), (byte) (CONNECTED_WEST | CONNECTED_EAST), (byte) -1, false, false), true); - renderNegativeXFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(iGregTechTileEntity, (byte) WEST.ordinal(), (byte) (CONNECTED_WEST | CONNECTED_EAST), (byte) -1, true, false), true); - renderPositiveXFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(iGregTechTileEntity, (byte) EAST.ordinal(), (byte) (CONNECTED_WEST | CONNECTED_EAST), (byte) -1, true, false), true); + renderNegativeYFacing( + null, + aRenderer, + aBlock, + 0, + 0, + 0, + tMetaTileEntity.getTexture( + iGregTechTileEntity, + (byte) DOWN.ordinal(), + (byte) (CONNECTED_WEST | CONNECTED_EAST), + (byte) -1, + false, + false), + true); + renderPositiveYFacing( + null, + aRenderer, + aBlock, + 0, + 0, + 0, + tMetaTileEntity.getTexture( + iGregTechTileEntity, + (byte) UP.ordinal(), + (byte) (CONNECTED_WEST | CONNECTED_EAST), + (byte) -1, + false, + false), + true); + renderNegativeZFacing( + null, + aRenderer, + aBlock, + 0, + 0, + 0, + tMetaTileEntity.getTexture( + iGregTechTileEntity, + (byte) NORTH.ordinal(), + (byte) (CONNECTED_WEST | CONNECTED_EAST), + (byte) -1, + false, + false), + true); + renderPositiveZFacing( + null, + aRenderer, + aBlock, + 0, + 0, + 0, + tMetaTileEntity.getTexture( + iGregTechTileEntity, + (byte) SOUTH.ordinal(), + (byte) (CONNECTED_WEST | CONNECTED_EAST), + (byte) -1, + false, + false), + true); + renderNegativeXFacing( + null, + aRenderer, + aBlock, + 0, + 0, + 0, + tMetaTileEntity.getTexture( + iGregTechTileEntity, + (byte) WEST.ordinal(), + (byte) (CONNECTED_WEST | CONNECTED_EAST), + (byte) -1, + true, + false), + true); + renderPositiveXFacing( + null, + aRenderer, + aBlock, + 0, + 0, + 0, + tMetaTileEntity.getTexture( + iGregTechTileEntity, + (byte) EAST.ordinal(), + (byte) (CONNECTED_WEST | CONNECTED_EAST), + (byte) -1, + true, + false), + true); } else { - renderNegativeYFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(iGregTechTileEntity, (byte) DOWN.ordinal(), (byte) WEST.ordinal(), (byte) -1, true, false), true); - renderPositiveYFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(iGregTechTileEntity, (byte) UP.ordinal(), (byte) WEST.ordinal(), (byte) -1, true, false), true); - renderNegativeZFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(iGregTechTileEntity, (byte) NORTH.ordinal(), (byte) WEST.ordinal(), (byte) -1, true, false), true); - renderPositiveZFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(iGregTechTileEntity, (byte) SOUTH.ordinal(), (byte) WEST.ordinal(), (byte) -1, true, false), true); - renderNegativeXFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(iGregTechTileEntity, (byte) WEST.ordinal(), (byte) WEST.ordinal(), (byte) -1, true, false), true); - renderPositiveXFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(iGregTechTileEntity, (byte) EAST.ordinal(), (byte) WEST.ordinal(), (byte) -1, true, false), true); + renderNegativeYFacing( + null, + aRenderer, + aBlock, + 0, + 0, + 0, + tMetaTileEntity.getTexture( + iGregTechTileEntity, (byte) DOWN.ordinal(), (byte) WEST.ordinal(), (byte) -1, true, false), + true); + renderPositiveYFacing( + null, + aRenderer, + aBlock, + 0, + 0, + 0, + tMetaTileEntity.getTexture( + iGregTechTileEntity, (byte) UP.ordinal(), (byte) WEST.ordinal(), (byte) -1, true, false), + true); + renderNegativeZFacing( + null, + aRenderer, + aBlock, + 0, + 0, + 0, + tMetaTileEntity.getTexture( + iGregTechTileEntity, (byte) NORTH.ordinal(), (byte) WEST.ordinal(), (byte) -1, true, false), + true); + renderPositiveZFacing( + null, + aRenderer, + aBlock, + 0, + 0, + 0, + tMetaTileEntity.getTexture( + iGregTechTileEntity, (byte) SOUTH.ordinal(), (byte) WEST.ordinal(), (byte) -1, true, false), + true); + renderNegativeXFacing( + null, + aRenderer, + aBlock, + 0, + 0, + 0, + tMetaTileEntity.getTexture( + iGregTechTileEntity, (byte) WEST.ordinal(), (byte) WEST.ordinal(), (byte) -1, true, false), + true); + renderPositiveXFacing( + null, + aRenderer, + aBlock, + 0, + 0, + 0, + tMetaTileEntity.getTexture( + iGregTechTileEntity, (byte) EAST.ordinal(), (byte) WEST.ordinal(), (byte) -1, true, false), + true); } } - public static void renderNegativeYFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, ITexture[] aIcon, boolean aFullBlock) { + public static void renderNegativeYFacing( + IBlockAccess aWorld, + RenderBlocks aRenderer, + Block aBlock, + int aX, + int aY, + int aZ, + ITexture[] aIcon, + boolean aFullBlock) { if (aWorld != null) { if ((aFullBlock) && (!aBlock.shouldSideBeRendered(aWorld, aX, aY - 1, aZ, 0))) return; - Tessellator.instance.setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aX, aFullBlock ? aY - 1 : aY, aZ)); + Tessellator.instance.setBrightness( + aBlock.getMixedBrightnessForBlock(aWorld, aX, aFullBlock ? aY - 1 : aY, aZ)); } if (aIcon == null) return; for (ITexture iTexture : aIcon) { @@ -613,10 +833,19 @@ public class GT_Renderer_Block implements ISimpleBlockRenderingHandler { } } - public static void renderPositiveYFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, ITexture[] aIcon, boolean aFullBlock) { + public static void renderPositiveYFacing( + IBlockAccess aWorld, + RenderBlocks aRenderer, + Block aBlock, + int aX, + int aY, + int aZ, + ITexture[] aIcon, + boolean aFullBlock) { if (aWorld != null) { if ((aFullBlock) && (!aBlock.shouldSideBeRendered(aWorld, aX, aY + 1, aZ, 1))) return; - Tessellator.instance.setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aX, aFullBlock ? aY + 1 : aY, aZ)); + Tessellator.instance.setBrightness( + aBlock.getMixedBrightnessForBlock(aWorld, aX, aFullBlock ? aY + 1 : aY, aZ)); } if (aIcon == null) return; for (ITexture iTexture : aIcon) { @@ -626,10 +855,19 @@ public class GT_Renderer_Block implements ISimpleBlockRenderingHandler { } } - public static void renderNegativeZFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, ITexture[] aIcon, boolean aFullBlock) { + public static void renderNegativeZFacing( + IBlockAccess aWorld, + RenderBlocks aRenderer, + Block aBlock, + int aX, + int aY, + int aZ, + ITexture[] aIcon, + boolean aFullBlock) { if (aWorld != null) { if ((aFullBlock) && (!aBlock.shouldSideBeRendered(aWorld, aX, aY, aZ - 1, 2))) return; - Tessellator.instance.setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aX, aY, aFullBlock ? aZ - 1 : aZ)); + Tessellator.instance.setBrightness( + aBlock.getMixedBrightnessForBlock(aWorld, aX, aY, aFullBlock ? aZ - 1 : aZ)); } if (aIcon == null) return; for (ITexture iTexture : aIcon) { @@ -639,10 +877,19 @@ public class GT_Renderer_Block implements ISimpleBlockRenderingHandler { } } - public static void renderPositiveZFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, ITexture[] aIcon, boolean aFullBlock) { + public static void renderPositiveZFacing( + IBlockAccess aWorld, + RenderBlocks aRenderer, + Block aBlock, + int aX, + int aY, + int aZ, + ITexture[] aIcon, + boolean aFullBlock) { if (aWorld != null) { if ((aFullBlock) && (!aBlock.shouldSideBeRendered(aWorld, aX, aY, aZ + 1, 3))) return; - Tessellator.instance.setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aX, aY, aFullBlock ? aZ + 1 : aZ)); + Tessellator.instance.setBrightness( + aBlock.getMixedBrightnessForBlock(aWorld, aX, aY, aFullBlock ? aZ + 1 : aZ)); } if (aIcon == null) return; for (ITexture iTexture : aIcon) { @@ -652,10 +899,19 @@ public class GT_Renderer_Block implements ISimpleBlockRenderingHandler { } } - public static void renderNegativeXFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, ITexture[] aIcon, boolean aFullBlock) { + public static void renderNegativeXFacing( + IBlockAccess aWorld, + RenderBlocks aRenderer, + Block aBlock, + int aX, + int aY, + int aZ, + ITexture[] aIcon, + boolean aFullBlock) { if (aWorld != null) { if ((aFullBlock) && (!aBlock.shouldSideBeRendered(aWorld, aX - 1, aY, aZ, 4))) return; - Tessellator.instance.setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aFullBlock ? aX - 1 : aX, aY, aZ)); + Tessellator.instance.setBrightness( + aBlock.getMixedBrightnessForBlock(aWorld, aFullBlock ? aX - 1 : aX, aY, aZ)); } if (aIcon == null) return; for (ITexture iTexture : aIcon) { @@ -665,10 +921,19 @@ public class GT_Renderer_Block implements ISimpleBlockRenderingHandler { } } - public static void renderPositiveXFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, ITexture[] aIcon, boolean aFullBlock) { + public static void renderPositiveXFacing( + IBlockAccess aWorld, + RenderBlocks aRenderer, + Block aBlock, + int aX, + int aY, + int aZ, + ITexture[] aIcon, + boolean aFullBlock) { if (aWorld != null) { if ((aFullBlock) && (!aBlock.shouldSideBeRendered(aWorld, aX + 1, aY, aZ, 5))) return; - Tessellator.instance.setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aFullBlock ? aX + 1 : aX, aY, aZ)); + Tessellator.instance.setBrightness( + aBlock.getMixedBrightnessForBlock(aWorld, aFullBlock ? aX + 1 : aX, aY, aZ)); } if (aIcon == null) return; for (ITexture iTexture : aIcon) { @@ -679,11 +944,12 @@ public class GT_Renderer_Block implements ISimpleBlockRenderingHandler { } @Override - public boolean renderWorldBlock(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, int aModelID, RenderBlocks aRenderer) { + public boolean renderWorldBlock( + IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, int aModelID, RenderBlocks aRenderer) { aRenderer.enableAO = Minecraft.isAmbientOcclusionEnabled() && GT_Mod.gregtechproxy.mRenderTileAmbientOcclusion; aRenderer.useInventoryTint = false; if (aBlock instanceof IRenderedBlock) { - IRenderedBlock tRenderer = ((IRenderedBlock)aBlock).passRenderingToObject(aWorld, aX, aY, aZ); + IRenderedBlock tRenderer = ((IRenderedBlock) aBlock).passRenderingToObject(aWorld, aX, aY, aZ); if (tRenderer != null) tRenderer = tRenderer.passRenderingToObject(aWorld, aX, aY, aZ); if (tRenderer == null) tRenderer = IRenderedBlock.ErrorRenderer.INSTANCE; boolean tNeedsToSetBounds = true; @@ -693,9 +959,13 @@ public class GT_Renderer_Block implements ISimpleBlockRenderingHandler { } else { final boolean[] tSides = new boolean[6]; if (tRenderer instanceof IRenderedBlockSideCheck) { - for (byte tSide : ALL_VALID_SIDES) rReturn |= (tSides[tSide] = ((IRenderedBlockSideCheck)tRenderer).renderFullBlockSide(aBlock, aRenderer, tSide)); + for (byte tSide : ALL_VALID_SIDES) + rReturn |= (tSides[tSide] = + ((IRenderedBlockSideCheck) tRenderer).renderFullBlockSide(aBlock, aRenderer, tSide)); } else { - for (byte tSide : ALL_VALID_SIDES) rReturn |= (tSides[tSide] = aBlock.shouldSideBeRendered(aWorld, aX+OFFX[tSide], aY+OFFY[tSide], aZ+OFFZ[tSide], tSide)); + for (byte tSide : ALL_VALID_SIDES) + rReturn |= (tSides[tSide] = aBlock.shouldSideBeRendered( + aWorld, aX + OFFX[tSide], aY + OFFY[tSide], aZ + OFFZ[tSide], tSide)); } for (int i = 0, j = tRenderer.getRenderPasses(aBlock); i < j; i++) { if (tRenderer.usesRenderPass(i)) { @@ -707,12 +977,60 @@ public class GT_Renderer_Block implements ISimpleBlockRenderingHandler { aRenderer.setRenderBoundsFromBlock(aBlock); tNeedsToSetBounds = false; } - renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tRenderer.getTexture(aBlock, (byte) DOWN.ordinal(), i, tSides), tSides[DOWN.ordinal()]); - renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tRenderer.getTexture(aBlock, (byte) UP.ordinal(), i, tSides), tSides[UP.ordinal()]); - renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tRenderer.getTexture(aBlock, (byte) NORTH.ordinal(), i, tSides), tSides[NORTH.ordinal()]); - renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tRenderer.getTexture(aBlock, (byte) SOUTH.ordinal(), i, tSides), tSides[SOUTH.ordinal()]); - renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tRenderer.getTexture(aBlock, (byte) WEST.ordinal(), i, tSides), tSides[WEST.ordinal()]); - renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tRenderer.getTexture(aBlock, (byte) EAST.ordinal(), i, tSides), tSides[EAST.ordinal()]); + renderNegativeYFacing( + aWorld, + aRenderer, + aBlock, + aX, + aY, + aZ, + tRenderer.getTexture(aBlock, (byte) DOWN.ordinal(), i, tSides), + tSides[DOWN.ordinal()]); + renderPositiveYFacing( + aWorld, + aRenderer, + aBlock, + aX, + aY, + aZ, + tRenderer.getTexture(aBlock, (byte) UP.ordinal(), i, tSides), + tSides[UP.ordinal()]); + renderNegativeZFacing( + aWorld, + aRenderer, + aBlock, + aX, + aY, + aZ, + tRenderer.getTexture(aBlock, (byte) NORTH.ordinal(), i, tSides), + tSides[NORTH.ordinal()]); + renderPositiveZFacing( + aWorld, + aRenderer, + aBlock, + aX, + aY, + aZ, + tRenderer.getTexture(aBlock, (byte) SOUTH.ordinal(), i, tSides), + tSides[SOUTH.ordinal()]); + renderNegativeXFacing( + aWorld, + aRenderer, + aBlock, + aX, + aY, + aZ, + tRenderer.getTexture(aBlock, (byte) WEST.ordinal(), i, tSides), + tSides[WEST.ordinal()]); + renderPositiveXFacing( + aWorld, + aRenderer, + aBlock, + aX, + aY, + aZ, + tRenderer.getTexture(aBlock, (byte) EAST.ordinal(), i, tSides), + tSides[EAST.ordinal()]); } } if (tNeedsToSetBounds) aBlock.setBlockBounds(0, 0, 0, 1, 1, 1); @@ -725,12 +1043,14 @@ public class GT_Renderer_Block implements ISimpleBlockRenderingHandler { if (tileEntity == null) return false; if (tileEntity instanceof IGregTechTileEntity) { final IMetaTileEntity metaTileEntity; - if ((metaTileEntity = ((IGregTechTileEntity) tileEntity).getMetaTileEntity()) != null && metaTileEntity.renderInWorld(aWorld, aX, aY, aZ, aBlock, aRenderer)) { + if ((metaTileEntity = ((IGregTechTileEntity) tileEntity).getMetaTileEntity()) != null + && metaTileEntity.renderInWorld(aWorld, aX, aY, aZ, aBlock, aRenderer)) { aRenderer.enableAO = false; return true; } } - if (tileEntity instanceof IPipeRenderedTileEntity && renderPipeBlock(aWorld, aX, aY, aZ, aBlock, (IPipeRenderedTileEntity) tileEntity, aRenderer)) { + if (tileEntity instanceof IPipeRenderedTileEntity + && renderPipeBlock(aWorld, aX, aY, aZ, aBlock, (IPipeRenderedTileEntity) tileEntity, aRenderer)) { aRenderer.enableAO = false; return true; } diff --git a/src/main/java/gregtech/common/render/GT_SidedTexture.java b/src/main/java/gregtech/common/render/GT_SidedTexture.java index fbd5927467..4fbc28374a 100644 --- a/src/main/java/gregtech/common/render/GT_SidedTexture.java +++ b/src/main/java/gregtech/common/render/GT_SidedTexture.java @@ -17,9 +17,17 @@ public class GT_SidedTexture extends GT_TextureBase implements ITexture, IColorM */ private final short[] mRGBa; - protected GT_SidedTexture(IIconContainer aIcon0, IIconContainer aIcon1, IIconContainer aIcon2, IIconContainer aIcon3, IIconContainer aIcon4, IIconContainer aIcon5, short[] aRGBa, boolean aAllowAlpha) { + protected GT_SidedTexture( + IIconContainer aIcon0, + IIconContainer aIcon1, + IIconContainer aIcon2, + IIconContainer aIcon3, + IIconContainer aIcon4, + IIconContainer aIcon5, + short[] aRGBa, + boolean aAllowAlpha) { if (aRGBa.length != 4) throw new IllegalArgumentException("RGBa doesn't have 4 Values @ GT_RenderedTexture"); - mTextures = new ITexture[]{ + mTextures = new ITexture[] { TextureFactory.of(aIcon0, aRGBa, aAllowAlpha), TextureFactory.of(aIcon1, aRGBa, aAllowAlpha), TextureFactory.of(aIcon2, aRGBa, aAllowAlpha), @@ -34,35 +42,35 @@ public class GT_SidedTexture extends GT_TextureBase implements ITexture, IColorM public boolean isOldTexture() { return false; } - + @Override public void renderXPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { - mTextures[5].renderXPos(aRenderer, aBlock, aX ,aY, aZ); + mTextures[5].renderXPos(aRenderer, aBlock, aX, aY, aZ); } @Override public void renderXNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { - mTextures[4].renderXNeg(aRenderer, aBlock, aX ,aY, aZ); + mTextures[4].renderXNeg(aRenderer, aBlock, aX, aY, aZ); } @Override public void renderYPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { - mTextures[1].renderYPos(aRenderer, aBlock, aX ,aY, aZ); + mTextures[1].renderYPos(aRenderer, aBlock, aX, aY, aZ); } @Override public void renderYNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { - mTextures[0].renderYNeg(aRenderer, aBlock, aX ,aY, aZ); + mTextures[0].renderYNeg(aRenderer, aBlock, aX, aY, aZ); } @Override public void renderZPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { - mTextures[3].renderZPos(aRenderer, aBlock, aX ,aY, aZ); + mTextures[3].renderZPos(aRenderer, aBlock, aX, aY, aZ); } @Override public void renderZNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { - mTextures[2].renderZNeg(aRenderer, aBlock, aX ,aY, aZ); + mTextures[2].renderZNeg(aRenderer, aBlock, aX, aY, aZ); } @Override diff --git a/src/main/java/gregtech/common/render/GT_TextureBase.java b/src/main/java/gregtech/common/render/GT_TextureBase.java index b5b867810b..bb39410a8e 100644 --- a/src/main/java/gregtech/common/render/GT_TextureBase.java +++ b/src/main/java/gregtech/common/render/GT_TextureBase.java @@ -7,7 +7,7 @@ import net.minecraft.client.renderer.Tessellator; public abstract class GT_TextureBase implements ITexture { protected boolean isDrawing = false; - + @Override public void startDrawingQuads(RenderBlocks aRenderer, float aNormalX, float aNormalY, float aNormalZ) { if (aRenderer.useInventoryTint && (!isOldTexture() || !GT_UtilityClient.isDrawing(Tessellator.instance))) { diff --git a/src/main/java/gregtech/common/render/GT_TextureBuilder.java b/src/main/java/gregtech/common/render/GT_TextureBuilder.java index 708720ad40..f2ff07523c 100644 --- a/src/main/java/gregtech/common/render/GT_TextureBuilder.java +++ b/src/main/java/gregtech/common/render/GT_TextureBuilder.java @@ -6,12 +6,11 @@ import gregtech.api.enums.GT_Values; import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.ITextureBuilder; -import net.minecraft.block.Block; -import net.minecraftforge.common.util.ForgeDirection; - import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import net.minecraft.block.Block; +import net.minecraftforge.common.util.ForgeDirection; @SuppressWarnings("unused") public class GT_TextureBuilder implements ITextureBuilder { @@ -111,8 +110,7 @@ public class GT_TextureBuilder implements ITextureBuilder { if (fromBlock != null) { if (worldCoord == Boolean.TRUE || worldCoord == null && isCTMBlock(fromBlock, fromMeta)) return new GT_CopiedCTMBlockTexture(fromBlock, fromSide.ordinal(), fromMeta, rgba, allowAlpha); - else - return new GT_CopiedBlockTexture(fromBlock, fromSide.ordinal(), fromMeta, rgba, allowAlpha); + else return new GT_CopiedBlockTexture(fromBlock, fromSide.ordinal(), fromMeta, rgba, allowAlpha); } if (!textureLayers.isEmpty()) return new GT_MultiTexture(textureLayers.toArray(new ITexture[0])); switch (iconContainerList.size()) { @@ -126,14 +124,16 @@ public class GT_TextureBuilder implements ITextureBuilder { iconContainerList.get(ForgeDirection.SOUTH.ordinal()), iconContainerList.get(ForgeDirection.WEST.ordinal()), iconContainerList.get(ForgeDirection.EAST.ordinal()), - rgba, allowAlpha); + rgba, + allowAlpha); default: throw new IllegalStateException("Invalid sideIconContainer count"); } } private boolean isCTMBlock(Block fromBlock, int fromMeta) { - return GT_Mod.gregtechproxy.mCTMBlockCache.computeIfAbsent(fromBlock, (byte) fromMeta, GT_TextureBuilder::apply); + return GT_Mod.gregtechproxy.mCTMBlockCache.computeIfAbsent( + fromBlock, (byte) fromMeta, GT_TextureBuilder::apply); } private static Boolean apply(Block b, Byte m) { diff --git a/src/main/java/gregtech/common/render/IRenderedBlock.java b/src/main/java/gregtech/common/render/IRenderedBlock.java index 6d2ba999d5..a29ea6b6f9 100644 --- a/src/main/java/gregtech/common/render/IRenderedBlock.java +++ b/src/main/java/gregtech/common/render/IRenderedBlock.java @@ -31,11 +31,15 @@ public interface IRenderedBlock { /** returning true stops all the other Rendering from happening. */ @SideOnly(Side.CLIENT) - default boolean renderItem(Block aBlock, RenderBlocks aRenderer) { return false; } + default boolean renderItem(Block aBlock, RenderBlocks aRenderer) { + return false; + } /** returning true stops all the other Rendering from happening. */ @SideOnly(Side.CLIENT) - default boolean renderBlock(Block aBlock, RenderBlocks aRenderer, IBlockAccess aWorld, int aX, int aY, int aZ) { return false; } + default boolean renderBlock(Block aBlock, RenderBlocks aRenderer, IBlockAccess aWorld, int aX, int aY, int aZ) { + return false; + } /** if this Block lets the TileEntity or a similar Handler do all the Inventory Render work. */ @SideOnly(Side.CLIENT) @@ -48,14 +52,47 @@ public interface IRenderedBlock { class ErrorRenderer implements IRenderedBlockSideCheck, IRenderedBlock { public static final ErrorRenderer INSTANCE = new ErrorRenderer(); public ITexture[] mErrorTexture = Textures.BlockIcons.ERROR_RENDERING; - @Override public ITexture[] getTexture(Block aBlock, byte aSide, int aRenderPass, boolean[] aShouldSideBeRendered) {return mErrorTexture;} - @Override public ITexture[] getTexture(Block aBlock, byte aSide, boolean isActive, int aRenderPass) {return mErrorTexture;} - @Override public int getRenderPasses(Block aBlock) {return 1;} - @Override public boolean usesRenderPass(int aRenderPass) {return true;} - @Override public boolean setBlockBounds(Block aBlock, int aRenderPass) {aBlock.setBlockBounds(-0.25F, -0.25F, -0.25F, 1.25F, 1.25F, 1.25F); return true;} - @Override public boolean renderFullBlockSide(Block aBlock, RenderBlocks aRenderer, byte aSide) {return true;} - @Override public IRenderedBlock passRenderingToObject(ItemStack aStack) {return this;} - @Override public IRenderedBlock passRenderingToObject(IBlockAccess aWorld, int aX, int aY, int aZ) {return this;} + + @Override + public ITexture[] getTexture(Block aBlock, byte aSide, int aRenderPass, boolean[] aShouldSideBeRendered) { + return mErrorTexture; + } + + @Override + public ITexture[] getTexture(Block aBlock, byte aSide, boolean isActive, int aRenderPass) { + return mErrorTexture; + } + + @Override + public int getRenderPasses(Block aBlock) { + return 1; + } + + @Override + public boolean usesRenderPass(int aRenderPass) { + return true; + } + + @Override + public boolean setBlockBounds(Block aBlock, int aRenderPass) { + aBlock.setBlockBounds(-0.25F, -0.25F, -0.25F, 1.25F, 1.25F, 1.25F); + return true; + } + + @Override + public boolean renderFullBlockSide(Block aBlock, RenderBlocks aRenderer, byte aSide) { + return true; + } + + @Override + public IRenderedBlock passRenderingToObject(ItemStack aStack) { + return this; + } + + @Override + public IRenderedBlock passRenderingToObject(IBlockAccess aWorld, int aX, int aY, int aZ) { + return this; + } @Override public boolean renderBlock(Block aBlock, RenderBlocks aRenderer, IBlockAccess aWorld, int aX, int aY, int aZ) { diff --git a/src/main/java/gregtech/common/render/items/GT_GeneratedItem_Renderer.java b/src/main/java/gregtech/common/render/items/GT_GeneratedItem_Renderer.java index bd508a49a5..26115592f3 100644 --- a/src/main/java/gregtech/common/render/items/GT_GeneratedItem_Renderer.java +++ b/src/main/java/gregtech/common/render/items/GT_GeneratedItem_Renderer.java @@ -1,11 +1,15 @@ package gregtech.common.render.items; +import static gregtech.api.enums.ItemList.*; +import static gregtech.api.enums.ItemList.Large_Fluid_Cell_Chrome; + import gregtech.api.enums.ItemList; import gregtech.api.enums.Textures; import gregtech.api.items.GT_MetaGenerated_Item; import gregtech.api.util.GT_Utility; import gregtech.common.render.GT_RenderUtil; import gregtech.loaders.ExtraIcons; +import javax.annotation.Nullable; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.ItemRenderer; import net.minecraft.client.renderer.Tessellator; @@ -16,19 +20,14 @@ import net.minecraftforge.client.IItemRenderer; import net.minecraftforge.fluids.FluidStack; import org.lwjgl.opengl.GL11; -import javax.annotation.Nullable; - -import static gregtech.api.enums.ItemList.*; -import static gregtech.api.enums.ItemList.Large_Fluid_Cell_Chrome; - public class GT_GeneratedItem_Renderer implements IItemRenderer { @Override public boolean handleRenderType(ItemStack item, ItemRenderType type) { return type == ItemRenderType.EQUIPPED - || type == ItemRenderType.EQUIPPED_FIRST_PERSON - || type == ItemRenderType.INVENTORY - || type == ItemRenderType.ENTITY; + || type == ItemRenderType.EQUIPPED_FIRST_PERSON + || type == ItemRenderType.INVENTORY + || type == ItemRenderType.ENTITY; } @Override @@ -57,7 +56,8 @@ public class GT_GeneratedItem_Renderer implements IItemRenderer { if (tCharge >= tStats[0]) { tIcon = aItem.mIconList[(aMetaData - aItem.mOffset)][8]; } else { - tIcon = aItem.mIconList[(aMetaData - aItem.mOffset)][(7 - (int) Math.max(0L, Math.min(5L, (tStats[0] - tCharge) * 6L / tStats[0])))]; + tIcon = aItem.mIconList[(aMetaData - aItem.mOffset)][ + (7 - (int) Math.max(0L, Math.min(5L, (tStats[0] - tCharge) * 6L / tStats[0])))]; } } } else { @@ -67,8 +67,7 @@ public class GT_GeneratedItem_Renderer implements IItemRenderer { tIcon = aItem.mIconList[(aMetaData - aItem.mOffset)][0]; } - if (tIcon == null) - tIcon = Textures.ItemIcons.RENDERING_ERROR.getIcon(); + if (tIcon == null) tIcon = Textures.ItemIcons.RENDERING_ERROR.getIcon(); ItemList largeFluidCell = getLargeFluidCell(aStack); if (largeFluidCell != null) { @@ -80,7 +79,15 @@ public class GT_GeneratedItem_Renderer implements IItemRenderer { if (type.equals(IItemRenderer.ItemRenderType.INVENTORY)) { GT_RenderUtil.renderItemIcon(tIcon, 16.0D, 0.001D, 0.0F, 0.0F, -1.0F); } else { - ItemRenderer.renderItemIn2D(Tessellator.instance, tIcon.getMaxU(), tIcon.getMinV(), tIcon.getMinU(), tIcon.getMaxV(), tIcon.getIconWidth(), tIcon.getIconHeight(), 0.0625F); + ItemRenderer.renderItemIn2D( + Tessellator.instance, + tIcon.getMaxU(), + tIcon.getMinV(), + tIcon.getMinU(), + tIcon.getMaxV(), + tIcon.getIconWidth(), + tIcon.getIconHeight(), + 0.0625F); } GL11.glDisable(GL11.GL_BLEND); } @@ -100,7 +107,8 @@ public class GT_GeneratedItem_Renderer implements IItemRenderer { return null; } - private static void renderLargeFluidCellExtraParts(IItemRenderer.ItemRenderType type, ItemList item, ItemStack stack) { + private static void renderLargeFluidCellExtraParts( + IItemRenderer.ItemRenderType type, ItemList item, ItemStack stack) { IIcon inner; if (item == Large_Fluid_Cell_Steel) inner = ExtraIcons.steelLargeCellInner; @@ -118,7 +126,15 @@ public class GT_GeneratedItem_Renderer implements IItemRenderer { if (type.equals(ItemRenderType.INVENTORY)) { GT_RenderUtil.renderItemIcon(inner, 16.0D, -0.001D, 0.0F, 0.0F, -1.0F); } else { - ItemRenderer.renderItemIn2D(Tessellator.instance, inner.getMaxU(), inner.getMinV(), inner.getMinU(), inner.getMaxV(), inner.getIconWidth(), inner.getIconHeight(), 0.0625F); + ItemRenderer.renderItemIn2D( + Tessellator.instance, + inner.getMaxU(), + inner.getMinV(), + inner.getMinU(), + inner.getMaxV(), + inner.getIconWidth(), + inner.getIconHeight(), + 0.0625F); } FluidStack fluidStack = GT_Utility.getFluidForFilledItem(stack, true); @@ -134,7 +150,15 @@ public class GT_GeneratedItem_Renderer implements IItemRenderer { if (type.equals(ItemRenderType.INVENTORY)) { GT_RenderUtil.renderItemIcon(fluidIcon, 16.0D, -0.001D, 0.0F, 0.0F, -1.0F); } else { - ItemRenderer.renderItemIn2D(Tessellator.instance, fluidIcon.getMaxU(), fluidIcon.getMinV(), fluidIcon.getMinU(), fluidIcon.getMaxV(), fluidIcon.getIconWidth(), fluidIcon.getIconHeight(), 0.0625F); + ItemRenderer.renderItemIn2D( + Tessellator.instance, + fluidIcon.getMaxU(), + fluidIcon.getMinV(), + fluidIcon.getMinU(), + fluidIcon.getMaxV(), + fluidIcon.getIconWidth(), + fluidIcon.getIconHeight(), + 0.0625F); } GL11.glColor3ub((byte) -1, (byte) -1, (byte) -1); diff --git a/src/main/java/gregtech/common/render/items/GT_GeneratedMaterial_Renderer.java b/src/main/java/gregtech/common/render/items/GT_GeneratedMaterial_Renderer.java index 59eba76d03..6a2535559e 100644 --- a/src/main/java/gregtech/common/render/items/GT_GeneratedMaterial_Renderer.java +++ b/src/main/java/gregtech/common/render/items/GT_GeneratedMaterial_Renderer.java @@ -19,9 +19,9 @@ public class GT_GeneratedMaterial_Renderer implements IItemRenderer { @Override public boolean handleRenderType(ItemStack item, ItemRenderType type) { return type == ItemRenderType.EQUIPPED - || type == ItemRenderType.EQUIPPED_FIRST_PERSON - || type == ItemRenderType.INVENTORY - || type == ItemRenderType.ENTITY; + || type == ItemRenderType.EQUIPPED_FIRST_PERSON + || type == ItemRenderType.INVENTORY + || type == ItemRenderType.ENTITY; } @Override @@ -65,7 +65,15 @@ public class GT_GeneratedMaterial_Renderer implements IItemRenderer { if (type.equals(IItemRenderer.ItemRenderType.INVENTORY)) { GT_RenderUtil.renderItemIcon(tOverlay, 16.0D, 0.001D, 0.0F, 0.0F, -1.0F); } else { - ItemRenderer.renderItemIn2D(Tessellator.instance, tOverlay.getMaxU(), tOverlay.getMinV(), tOverlay.getMinU(), tOverlay.getMaxV(), tOverlay.getIconWidth(), tOverlay.getIconHeight(), 0.0625F); + ItemRenderer.renderItemIn2D( + Tessellator.instance, + tOverlay.getMaxU(), + tOverlay.getMinV(), + tOverlay.getMinU(), + tOverlay.getMaxV(), + tOverlay.getIconWidth(), + tOverlay.getIconHeight(), + 0.0625F); } } @@ -83,9 +91,16 @@ public class GT_GeneratedMaterial_Renderer implements IItemRenderer { if (type.equals(IItemRenderer.ItemRenderType.INVENTORY)) { GT_RenderUtil.renderItemIcon(icon, 16.0D, 0.001D, 0.0F, 0.0F, -1.0F); } else { - ItemRenderer.renderItemIn2D(Tessellator.instance, icon.getMaxU(), icon.getMinV(), icon.getMinU(), icon.getMaxV(), icon.getIconWidth(), icon.getIconHeight(), 0.0625F); + ItemRenderer.renderItemIn2D( + Tessellator.instance, + icon.getMaxU(), + icon.getMinV(), + icon.getMinU(), + icon.getMaxV(), + icon.getIconWidth(), + icon.getIconHeight(), + 0.0625F); } - } public void renderContainedFluid(ItemRenderType type, FluidStack aFluidStack, IIcon fluidIcon) { @@ -98,9 +113,16 @@ public class GT_GeneratedMaterial_Renderer implements IItemRenderer { if (type.equals(IItemRenderer.ItemRenderType.INVENTORY)) { GT_RenderUtil.renderItemIcon(fluidIcon, 16.0D, 0.001D, 0.0F, 0.0F, -1.0F); } else { - ItemRenderer.renderItemIn2D(Tessellator.instance, fluidIcon.getMaxU(), fluidIcon.getMinV(), fluidIcon.getMinU(), fluidIcon.getMaxV(), fluidIcon.getIconWidth(), fluidIcon.getIconHeight(), 0.0625F); + ItemRenderer.renderItemIn2D( + Tessellator.instance, + fluidIcon.getMaxU(), + fluidIcon.getMinV(), + fluidIcon.getMinU(), + fluidIcon.getMaxV(), + fluidIcon.getIconWidth(), + fluidIcon.getIconHeight(), + 0.0625F); } GL11.glDepthFunc(GL11.GL_LEQUAL); } - } diff --git a/src/main/java/gregtech/common/render/items/GT_MetaGenerated_Item_Renderer.java b/src/main/java/gregtech/common/render/items/GT_MetaGenerated_Item_Renderer.java index ebabb2167a..8e23a0005d 100644 --- a/src/main/java/gregtech/common/render/items/GT_MetaGenerated_Item_Renderer.java +++ b/src/main/java/gregtech/common/render/items/GT_MetaGenerated_Item_Renderer.java @@ -10,7 +10,8 @@ import org.lwjgl.opengl.GL11; public class GT_MetaGenerated_Item_Renderer implements IItemRenderer { - private final IItemRenderer mItemRenderer = new GT_GeneratedItem_Renderer();; + private final IItemRenderer mItemRenderer = new GT_GeneratedItem_Renderer(); + ; private final IItemRenderer mMaterialRenderer = new GT_GeneratedMaterial_Renderer(); public GT_MetaGenerated_Item_Renderer() { @@ -62,5 +63,4 @@ public class GT_MetaGenerated_Item_Renderer implements IItemRenderer { return mItemRenderer; } - } diff --git a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ChestBuffer.java b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ChestBuffer.java index 6fab5d92d6..f5fcda6d7b 100644 --- a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ChestBuffer.java +++ b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ChestBuffer.java @@ -1,5 +1,8 @@ package gregtech.common.tileentities.automation; +import static gregtech.api.enums.Textures.BlockIcons.AUTOMATION_CHESTBUFFER; +import static gregtech.api.enums.Textures.BlockIcons.AUTOMATION_CHESTBUFFER_GLOW; + import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -9,49 +12,54 @@ import gregtech.common.gui.GT_Container_ChestBuffer; import gregtech.common.gui.GT_GUIContainer_ChestBuffer; import net.minecraft.entity.player.InventoryPlayer; -import static gregtech.api.enums.Textures.BlockIcons.AUTOMATION_CHESTBUFFER; -import static gregtech.api.enums.Textures.BlockIcons.AUTOMATION_CHESTBUFFER_GLOW; - public class GT_MetaTileEntity_ChestBuffer extends GT_MetaTileEntity_Buffer { - private static final int[] tickRate = {400, 200, 100, 20, 4, 1, 1, 1, 1, 1, 1, 1, 1}; - private static final int[] maxStacks = { 1, 1, 1, 1, 1, 1, 2, 4, 8, 16, 32, 64, 128}; - + private static final int[] tickRate = {400, 200, 100, 20, 4, 1, 1, 1, 1, 1, 1, 1, 1}; + private static final int[] maxStacks = {1, 1, 1, 1, 1, 1, 2, 4, 8, 16, 32, 64, 128}; public GT_MetaTileEntity_ChestBuffer(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 28, new String[]{ - "Buffers up to 27 Item Stacks", - "Use Screwdriver to regulate output stack size", - "Does not consume energy to move Item", - getTickRateDesc(aTier)}); + super(aID, aName, aNameRegional, aTier, 28, new String[] { + "Buffers up to 27 Item Stacks", + "Use Screwdriver to regulate output stack size", + "Does not consume energy to move Item", + getTickRateDesc(aTier) + }); } - public GT_MetaTileEntity_ChestBuffer(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String aDescription) { + public GT_MetaTileEntity_ChestBuffer( + int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String aDescription) { super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription); } - public GT_MetaTileEntity_ChestBuffer(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String[] aDescription) { - super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription); + public GT_MetaTileEntity_ChestBuffer( + int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String[] aDescription) { + super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription); } - public GT_MetaTileEntity_ChestBuffer(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_ChestBuffer( + String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } - public GT_MetaTileEntity_ChestBuffer(String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_ChestBuffer( + String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_ChestBuffer(this.mName, this.mTier, this.mInventory.length, this.mDescriptionArray, this.mTextures); + return new GT_MetaTileEntity_ChestBuffer( + this.mName, this.mTier, this.mInventory.length, this.mDescriptionArray, this.mTextures); } @Override public ITexture getOverlayIcon() { return TextureFactory.of( TextureFactory.of(AUTOMATION_CHESTBUFFER), - TextureFactory.builder().addIcon(AUTOMATION_CHESTBUFFER_GLOW).glow().build()); + TextureFactory.builder() + .addIcon(AUTOMATION_CHESTBUFFER_GLOW) + .glow() + .build()); } @Override @@ -63,13 +71,14 @@ public class GT_MetaTileEntity_ChestBuffer extends GT_MetaTileEntity_Buffer { protected void moveItems(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) { if (aTimer % tickRate[mTier] > 0) return; - // mSuccess will be negative if the call is caused by the %200 aTimer, always try to push. Otherwise it will be positive. + // mSuccess will be negative if the call is caused by the %200 aTimer, always try to push. Otherwise it will be + // positive. // For the first 6 ticks after a successful move (49->44), push every tick. Then go to every 5 ticks. - if ( (mSuccess <= 0 ) || (mSuccess > 43) || ((mSuccess % 5) == 0 )){ + if ((mSuccess <= 0) || (mSuccess > 43) || ((mSuccess % 5) == 0)) { super.moveItems(aBaseMetaTileEntity, aTimer, Math.min(MAX, maxStacks[mTier])); } - if(mSuccess < 0) { + if (mSuccess < 0) { mSuccess = 0; } } @@ -84,7 +93,7 @@ public class GT_MetaTileEntity_ChestBuffer extends GT_MetaTileEntity_Buffer { return new GT_GUIContainer_ChestBuffer(aPlayerInventory, aBaseMetaTileEntity); } - protected static String getTickRateDesc(int tier){ + protected static String getTickRateDesc(int tier) { int tickRate = getTickRate(tier); String timeStr = ""; String numStr = ""; @@ -93,8 +102,7 @@ public class GT_MetaTileEntity_ChestBuffer extends GT_MetaTileEntity_Buffer { } else { numStr = "1 item"; } - if (tickRate < 20) - timeStr = "1/" + 20/tickRate + " "; + if (tickRate < 20) timeStr = "1/" + 20 / tickRate + " "; else if (tickRate > 20) { timeStr = (tickRate / 20) + "th "; } @@ -102,8 +110,7 @@ public class GT_MetaTileEntity_ChestBuffer extends GT_MetaTileEntity_Buffer { } protected static int getTickRate(int tier) { - if (tier > 9) - return 1; + if (tier > 9) return 1; return tickRate[tier]; } diff --git a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Filter.java b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Filter.java index 02eaf892ac..f3ab391109 100644 --- a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Filter.java +++ b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Filter.java @@ -1,5 +1,8 @@ package gregtech.common.tileentities.automation; +import static gregtech.api.enums.Textures.BlockIcons.AUTOMATION_FILTER; +import static gregtech.api.enums.Textures.BlockIcons.AUTOMATION_FILTER_GLOW; + import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -12,31 +15,32 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import static gregtech.api.enums.Textures.BlockIcons.AUTOMATION_FILTER; -import static gregtech.api.enums.Textures.BlockIcons.AUTOMATION_FILTER_GLOW; - public class GT_MetaTileEntity_Filter extends GT_MetaTileEntity_Buffer { public boolean bIgnoreNBT = false; public boolean bInvertFilter = false; public GT_MetaTileEntity_Filter(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 19, new String[]{ - "Filters up to 9 different Items", - "Use Screwdriver to regulate output stack size", - "Does not consume energy to move Item"}); + super(aID, aName, aNameRegional, aTier, 19, new String[] { + "Filters up to 9 different Items", + "Use Screwdriver to regulate output stack size", + "Does not consume energy to move Item" + }); } - public GT_MetaTileEntity_Filter(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_Filter( + String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } - - public GT_MetaTileEntity_Filter(String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) { + + public GT_MetaTileEntity_Filter( + String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Filter(this.mName, this.mTier, this.mInventory.length, this.mDescriptionArray, this.mTextures); + return new GT_MetaTileEntity_Filter( + this.mName, this.mTier, this.mInventory.length, this.mDescriptionArray, this.mTextures); } @Override @@ -96,16 +100,10 @@ public class GT_MetaTileEntity_Filter extends GT_MetaTileEntity_Buffer { if (bRedstoneIfFull) { int emptySlots = 0; for (int i = 0; i < 9; i++) { - if (mInventory[i] == null) - ++emptySlots; + if (mInventory[i] == null) ++emptySlots; } - if (!bInvert) - emptySlots = 9 - emptySlots; - for (byte b = 0; b < 6; b++) - aBaseMetaTileEntity.setInternalOutputRedstoneSignal(b, (byte) emptySlots); - } - else - for (byte b = 0; b < 6; b++) - aBaseMetaTileEntity.setInternalOutputRedstoneSignal(b, (byte) 0); + if (!bInvert) emptySlots = 9 - emptySlots; + for (byte b = 0; b < 6; b++) aBaseMetaTileEntity.setInternalOutputRedstoneSignal(b, (byte) emptySlots); + } else for (byte b = 0; b < 6; b++) aBaseMetaTileEntity.setInternalOutputRedstoneSignal(b, (byte) 0); } } diff --git a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ItemDistributor.java b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ItemDistributor.java index d27d8db04d..4241fa8d11 100644 --- a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ItemDistributor.java +++ b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ItemDistributor.java @@ -1,5 +1,8 @@ package gregtech.common.tileentities.automation; +import static gregtech.api.enums.Textures.BlockIcons.AUTOMATION_ITEMDISTRIBUTOR; +import static gregtech.api.enums.Textures.BlockIcons.AUTOMATION_ITEMDISTRIBUTOR_GLOW; + import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -15,38 +18,38 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import static gregtech.api.enums.Textures.BlockIcons.AUTOMATION_ITEMDISTRIBUTOR; -import static gregtech.api.enums.Textures.BlockIcons.AUTOMATION_ITEMDISTRIBUTOR_GLOW; - public class GT_MetaTileEntity_ItemDistributor extends GT_MetaTileEntity_Buffer { private byte[] itemsPerSide = new byte[6]; private byte currentSide = 0, currentSideItemCount = 0; public GT_MetaTileEntity_ItemDistributor(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 28, new String[]{ - "Distributes Items between different Machine Sides", - "Default Items per Machine Side: 0", - "Use Screwdriver to increase/decrease Items per Side", - "Does not consume energy to move Item"}); + super(aID, aName, aNameRegional, aTier, 28, new String[] { + "Distributes Items between different Machine Sides", + "Default Items per Machine Side: 0", + "Use Screwdriver to increase/decrease Items per Side", + "Does not consume energy to move Item" + }); } - public GT_MetaTileEntity_ItemDistributor(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, - String aDescription) { + public GT_MetaTileEntity_ItemDistributor( + int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String aDescription) { super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription); } - public GT_MetaTileEntity_ItemDistributor(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_ItemDistributor( + String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } - public GT_MetaTileEntity_ItemDistributor(String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_ItemDistributor( + String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_ItemDistributor(this.mName, this.mTier, this.mInventory.length, this.mDescriptionArray, - this.mTextures); + return new GT_MetaTileEntity_ItemDistributor( + this.mName, this.mTier, this.mInventory.length, this.mDescriptionArray, this.mTextures); } @Override @@ -58,7 +61,10 @@ public class GT_MetaTileEntity_ItemDistributor extends GT_MetaTileEntity_Buffer public ITexture getOverlayIcon() { return TextureFactory.of( TextureFactory.of(AUTOMATION_ITEMDISTRIBUTOR), - TextureFactory.builder().addIcon(AUTOMATION_ITEMDISTRIBUTOR_GLOW).glow().build()); + TextureFactory.builder() + .addIcon(AUTOMATION_ITEMDISTRIBUTOR_GLOW) + .glow() + .build()); } @Override @@ -72,7 +78,13 @@ public class GT_MetaTileEntity_ItemDistributor extends GT_MetaTileEntity_Buffer } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { if (aSide == aFacing) { return mTextures[0][aColorIndex + 1]; } else { @@ -85,8 +97,8 @@ public class GT_MetaTileEntity_ItemDistributor extends GT_MetaTileEntity_Buffer ITexture[][][] returnTextures = new ITexture[2][17][]; ITexture baseIcon = getOverlayIcon(), pipeIcon = TextureFactory.of(Textures.BlockIcons.OVERLAY_PIPE_OUT); for (int i = 0; i < 17; i++) { - returnTextures[0][i] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][i], baseIcon}; - returnTextures[1][i] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][i], pipeIcon, baseIcon}; + returnTextures[0][i] = new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][i], baseIcon}; + returnTextures[1][i] = new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][i], pipeIcon, baseIcon}; } return returnTextures; } @@ -132,9 +144,17 @@ public class GT_MetaTileEntity_ItemDistributor extends GT_MetaTileEntity_Buffer return; } } - movedItems = GT_Utility.moveOneItemStack(aBaseMetaTileEntity, adjacentTileEntity, currentSide, - GT_Utility.getOppositeSide(currentSide), null, false, (byte) 64, (byte) 1, - (byte) (itemsPerSide[currentSide] - currentSideItemCount), (byte) 1); + movedItems = GT_Utility.moveOneItemStack( + aBaseMetaTileEntity, + adjacentTileEntity, + currentSide, + GT_Utility.getOppositeSide(currentSide), + null, + false, + (byte) 64, + (byte) 1, + (byte) (itemsPerSide[currentSide] - currentSideItemCount), + (byte) 1); currentSideItemCount += movedItems; if (currentSideItemCount >= itemsPerSide[currentSide]) { currentSide = (byte) ((currentSide + 1) % 6); @@ -148,7 +168,7 @@ public class GT_MetaTileEntity_ItemDistributor extends GT_MetaTileEntity_Buffer @Override public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { - //Adjust items per side by 1 or -1, constrained to the cyclic interval [0, 127] + // Adjust items per side by 1 or -1, constrained to the cyclic interval [0, 127] itemsPerSide[aSide] += aPlayer.isSneaking() ? -1 : 1; itemsPerSide[aSide] = (byte) ((itemsPerSide[aSide] + 128) % 128); GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("211", "Items per side: ") + itemsPerSide[aSide]); diff --git a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_RecipeFilter.java b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_RecipeFilter.java index a2f86103f5..007fa79213 100644 --- a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_RecipeFilter.java +++ b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_RecipeFilter.java @@ -1,5 +1,8 @@ package gregtech.common.tileentities.automation; +import static gregtech.api.enums.Textures.BlockIcons.AUTOMATION_RECIPEFILTER; +import static gregtech.api.enums.Textures.BlockIcons.AUTOMATION_RECIPEFILTER_GLOW; + import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -13,24 +16,24 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import static gregtech.api.enums.Textures.BlockIcons.AUTOMATION_RECIPEFILTER; -import static gregtech.api.enums.Textures.BlockIcons.AUTOMATION_RECIPEFILTER_GLOW; - public class GT_MetaTileEntity_RecipeFilter extends GT_MetaTileEntity_SpecialFilter { public GT_Recipe.GT_Recipe_Map mRecipeMap; public GT_MetaTileEntity_RecipeFilter(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, new String[]{ - "Filters 1 Recipe Type", - "Use Screwdriver to regulate output stack size", - "Does not consume energy to move Item"}); + super(aID, aName, aNameRegional, aTier, new String[] { + "Filters 1 Recipe Type", + "Use Screwdriver to regulate output stack size", + "Does not consume energy to move Item" + }); } - public GT_MetaTileEntity_RecipeFilter(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_RecipeFilter( + String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } - public GT_MetaTileEntity_RecipeFilter(String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_RecipeFilter( + String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } @@ -59,21 +62,24 @@ public class GT_MetaTileEntity_RecipeFilter extends GT_MetaTileEntity_SpecialFil @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_RecipeFilter(this.mName, this.mTier, this.mInventory.length, this.mDescriptionArray, this.mTextures); + return new GT_MetaTileEntity_RecipeFilter( + this.mName, this.mTier, this.mInventory.length, this.mDescriptionArray, this.mTextures); } @Override public ITexture getOverlayIcon() { return TextureFactory.of( TextureFactory.of(AUTOMATION_RECIPEFILTER), - TextureFactory.builder().addIcon(AUTOMATION_RECIPEFILTER_GLOW).glow().build()); + TextureFactory.builder() + .addIcon(AUTOMATION_RECIPEFILTER_GLOW) + .glow() + .build()); } @Override public void saveNBTData(NBTTagCompound aNBT) { super.saveNBTData(aNBT); - if (mRecipeMap != null) - aNBT.setString("mRecipeMap", this.mRecipeMap.mUniqueIdentifier); + if (mRecipeMap != null) aNBT.setString("mRecipeMap", this.mRecipeMap.mUniqueIdentifier); } @Override diff --git a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Regulator.java b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Regulator.java index c20df68b32..edc8ef78e4 100644 --- a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Regulator.java +++ b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Regulator.java @@ -1,5 +1,8 @@ package gregtech.common.tileentities.automation; +import static gregtech.api.enums.Textures.BlockIcons.AUTOMATION_REGULATOR; +import static gregtech.api.enums.Textures.BlockIcons.AUTOMATION_REGULATOR_GLOW; + import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -8,47 +11,49 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Utility; import gregtech.common.gui.GT_Container_Regulator; import gregtech.common.gui.GT_GUIContainer_Regulator; +import java.util.Collections; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import java.util.Collections; - -import static gregtech.api.enums.Textures.BlockIcons.AUTOMATION_REGULATOR; -import static gregtech.api.enums.Textures.BlockIcons.AUTOMATION_REGULATOR_GLOW; - -public class GT_MetaTileEntity_Regulator - extends GT_MetaTileEntity_Buffer { +public class GT_MetaTileEntity_Regulator extends GT_MetaTileEntity_Buffer { public int[] mTargetSlots = {0, 0, 0, 0, 0, 0, 0, 0, 0}; private boolean charge = false, decharge = false; public GT_MetaTileEntity_Regulator(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 20, new String[]{ - "Filters up to 9 different Items", - "Allows Item-specific output stack size", - "Allows Item-specific output slot", - "Does not consume energy to move Item"}); + super(aID, aName, aNameRegional, aTier, 20, new String[] { + "Filters up to 9 different Items", + "Allows Item-specific output stack size", + "Allows Item-specific output slot", + "Does not consume energy to move Item" + }); } - public GT_MetaTileEntity_Regulator(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_Regulator( + String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } - - public GT_MetaTileEntity_Regulator(String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) { + + public GT_MetaTileEntity_Regulator( + String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Regulator(this.mName, this.mTier, this.mInventory.length, this.mDescriptionArray, this.mTextures); + return new GT_MetaTileEntity_Regulator( + this.mName, this.mTier, this.mInventory.length, this.mDescriptionArray, this.mTextures); } @Override public ITexture getOverlayIcon() { return TextureFactory.of( TextureFactory.of(AUTOMATION_REGULATOR), - TextureFactory.builder().addIcon(AUTOMATION_REGULATOR_GLOW).glow().build()); + TextureFactory.builder() + .addIcon(AUTOMATION_REGULATOR_GLOW) + .glow() + .build()); } @Override @@ -95,15 +100,28 @@ public class GT_MetaTileEntity_Regulator } @Override - public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { - //Regulation per Screwdriver is overridden by GUI regulation. + public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + // Regulation per Screwdriver is overridden by GUI regulation. } @Override public void moveItems(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) { for (int i = 0, tCosts; i < 9; i++) { if (this.mInventory[(i + 9)] != null) { - tCosts = GT_Utility.moveOneItemStackIntoSlot(getBaseMetaTileEntity(), getBaseMetaTileEntity().getTileEntityAtSide(getBaseMetaTileEntity().getBackFacing()), getBaseMetaTileEntity().getBackFacing(), this.mTargetSlots[i], Collections.singletonList(this.mInventory[(i + 9)]), false, (byte) this.mInventory[(i + 9)].stackSize, (byte) this.mInventory[(i + 9)].stackSize, (byte) 64, (byte) 1) * 3; + tCosts = GT_Utility.moveOneItemStackIntoSlot( + getBaseMetaTileEntity(), + getBaseMetaTileEntity() + .getTileEntityAtSide( + getBaseMetaTileEntity().getBackFacing()), + getBaseMetaTileEntity().getBackFacing(), + this.mTargetSlots[i], + Collections.singletonList(this.mInventory[(i + 9)]), + false, + (byte) this.mInventory[(i + 9)].stackSize, + (byte) this.mInventory[(i + 9)].stackSize, + (byte) 64, + (byte) 1) + * 3; if (tCosts > 0) { this.mSuccess = 50; break; @@ -114,7 +132,8 @@ public class GT_MetaTileEntity_Regulator @Override public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (GT_Utility.areStacksEqual(aStack, this.mInventory[(aIndex + 9)])); + return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) + && (GT_Utility.areStacksEqual(aStack, this.mInventory[(aIndex + 9)])); } @Override diff --git a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_SuperBuffer.java b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_SuperBuffer.java index 7065e70a3e..ffa33f426e 100644 --- a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_SuperBuffer.java +++ b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_SuperBuffer.java @@ -1,5 +1,8 @@ package gregtech.common.tileentities.automation; +import static gregtech.api.enums.Textures.BlockIcons.AUTOMATION_SUPERBUFFER; +import static gregtech.api.enums.Textures.BlockIcons.AUTOMATION_SUPERBUFFER_GLOW; + import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -7,44 +10,47 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Utility; import gregtech.common.gui.GT_Container_SuperBuffer; import gregtech.common.gui.GT_GUIContainer_SuperBuffer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.item.ItemStack; - import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; - -import static gregtech.api.enums.Textures.BlockIcons.AUTOMATION_SUPERBUFFER; -import static gregtech.api.enums.Textures.BlockIcons.AUTOMATION_SUPERBUFFER_GLOW; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; public class GT_MetaTileEntity_SuperBuffer extends GT_MetaTileEntity_ChestBuffer { public GT_MetaTileEntity_SuperBuffer(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 257, new String[]{ - "Buffers up to 256 Item Stacks", - "Use Screwdriver to regulate output stack size", - "Does not consume energy to move Item", - getTickRateDesc(aTier)}); + super(aID, aName, aNameRegional, aTier, 257, new String[] { + "Buffers up to 256 Item Stacks", + "Use Screwdriver to regulate output stack size", + "Does not consume energy to move Item", + getTickRateDesc(aTier) + }); } - public GT_MetaTileEntity_SuperBuffer(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_SuperBuffer( + String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } - public GT_MetaTileEntity_SuperBuffer(String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_SuperBuffer( + String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_SuperBuffer(this.mName, this.mTier, this.mInventory.length, this.mDescriptionArray, this.mTextures); + return new GT_MetaTileEntity_SuperBuffer( + this.mName, this.mTier, this.mInventory.length, this.mDescriptionArray, this.mTextures); } @Override public ITexture getOverlayIcon() { return TextureFactory.of( TextureFactory.of(AUTOMATION_SUPERBUFFER), - TextureFactory.builder().addIcon(AUTOMATION_SUPERBUFFER_GLOW).glow().build()); + TextureFactory.builder() + .addIcon(AUTOMATION_SUPERBUFFER_GLOW) + .glow() + .build()); } @Override @@ -53,23 +59,20 @@ public class GT_MetaTileEntity_SuperBuffer extends GT_MetaTileEntity_ChestBuffer HashMap<GT_Utility.ItemId, Integer> slots = new HashMap<>(mInventory.length); HashMap<GT_Utility.ItemId, ItemStack> stacks = new HashMap<>(mInventory.length); List<Integer> validSlots = new ArrayList<>(mInventory.length); - //List<String> order = new ArrayList<>(mInventory.length); + // List<String> order = new ArrayList<>(mInventory.length); for (int i = 0; i < mInventory.length - 1; i++) { - if (!isValidSlot(i)) - continue; + if (!isValidSlot(i)) continue; validSlots.add(i); ItemStack s = mInventory[i]; - if(s == null) - continue; + if (s == null) continue; GT_Utility.ItemId sID = GT_Utility.ItemId.createNoCopy(s); slots.merge(sID, s.stackSize, Integer::sum); - if(!stacks.containsKey(sID)) - stacks.put(sID, s); - //order.add(sID); + if (!stacks.containsKey(sID)) stacks.put(sID, s); + // order.add(sID); mInventory[i] = null; } int i = 0; - for(Map.Entry<GT_Utility.ItemId, Integer> entry : slots.entrySet()){ + for (Map.Entry<GT_Utility.ItemId, Integer> entry : slots.entrySet()) { do { int slot = validSlots.get(i); mInventory[slot] = stacks.get(entry.getKey()).copy(); @@ -77,8 +80,7 @@ public class GT_MetaTileEntity_SuperBuffer extends GT_MetaTileEntity_ChestBuffer mInventory[slot].stackSize = toSet; entry.setValue(entry.getValue() - toSet); i++; - } - while(entry.getValue() > 0); + } while (entry.getValue() > 0); } } diff --git a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_TypeFilter.java b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_TypeFilter.java index 95b11bcb54..da1ca6d42a 100644 --- a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_TypeFilter.java +++ b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_TypeFilter.java @@ -1,5 +1,9 @@ package gregtech.common.tileentities.automation; +import static gregtech.api.enums.GT_Values.W; +import static gregtech.api.enums.Textures.BlockIcons.AUTOMATION_TYPEFILTER; +import static gregtech.api.enums.Textures.BlockIcons.AUTOMATION_TYPEFILTER_GLOW; + import gregtech.api.enums.OrePrefixes; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -12,39 +16,42 @@ import gregtech.api.util.GT_Utility; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import static gregtech.api.enums.GT_Values.W; -import static gregtech.api.enums.Textures.BlockIcons.AUTOMATION_TYPEFILTER; -import static gregtech.api.enums.Textures.BlockIcons.AUTOMATION_TYPEFILTER_GLOW; - public class GT_MetaTileEntity_TypeFilter extends GT_MetaTileEntity_SpecialFilter { public int mRotationIndex = 0; public OrePrefixes mPrefix = OrePrefixes.ore; public GT_MetaTileEntity_TypeFilter(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, new String[]{ - "Filters 1 Item Type", - "Use Screwdriver to regulate output stack size", - "Does not consume energy to move Item"}); + super(aID, aName, aNameRegional, aTier, new String[] { + "Filters 1 Item Type", + "Use Screwdriver to regulate output stack size", + "Does not consume energy to move Item" + }); } - public GT_MetaTileEntity_TypeFilter(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_TypeFilter( + String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } - public GT_MetaTileEntity_TypeFilter(String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_TypeFilter( + String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_TypeFilter(this.mName, this.mTier, this.mInventory.length, this.mDescriptionArray, this.mTextures); + return new GT_MetaTileEntity_TypeFilter( + this.mName, this.mTier, this.mInventory.length, this.mDescriptionArray, this.mTextures); } @Override public ITexture getOverlayIcon() { return TextureFactory.of( TextureFactory.of(AUTOMATION_TYPEFILTER), - TextureFactory.builder().addIcon(AUTOMATION_TYPEFILTER_GLOW).glow().build()); + TextureFactory.builder() + .addIcon(AUTOMATION_TYPEFILTER_GLOW) + .glow() + .build()); } public void clickTypeIcon(boolean aRightClick, ItemStack aHandStack) { @@ -73,7 +80,8 @@ public class GT_MetaTileEntity_TypeFilter extends GT_MetaTileEntity_SpecialFilte } } while (OrePrefixes.values()[i].mPrefixedItems.isEmpty()); } - if (!OrePrefixes.values()[i].mPrefixedItems.isEmpty() && OrePrefixes.values()[i].mPrefixInto == OrePrefixes.values()[i]) + if (!OrePrefixes.values()[i].mPrefixedItems.isEmpty() + && OrePrefixes.values()[i].mPrefixInto == OrePrefixes.values()[i]) mPrefix = OrePrefixes.values()[i]; } } @@ -90,7 +98,10 @@ public class GT_MetaTileEntity_TypeFilter extends GT_MetaTileEntity_SpecialFilte this.mInventory[SPECIAL_SLOT_INDEX] = null; return; } - this.mInventory[SPECIAL_SLOT_INDEX] = GT_Utility.copyAmount(1L, this.mPrefix.mPrefixedItems.get(this.mRotationIndex = (this.mRotationIndex + 1) % this.mPrefix.mPrefixedItems.size())); + this.mInventory[SPECIAL_SLOT_INDEX] = GT_Utility.copyAmount( + 1L, + this.mPrefix.mPrefixedItems.get( + this.mRotationIndex = (this.mRotationIndex + 1) % this.mPrefix.mPrefixedItems.size())); if (this.mInventory[SPECIAL_SLOT_INDEX] == null) return; if (this.mInventory[SPECIAL_SLOT_INDEX].getItemDamage() == W) this.mInventory[9].setItemDamage(0); this.mInventory[SPECIAL_SLOT_INDEX].setStackDisplayName(this.mPrefix.toString()); @@ -115,19 +126,19 @@ public class GT_MetaTileEntity_TypeFilter extends GT_MetaTileEntity_SpecialFilte ItemData tData = GT_OreDictUnificator.getItemData(aStack); if (tData != null && tData.mPrefix != null) { OrePrefixes tFix = tData.mPrefix; - if (tFix == OrePrefixes.oreBlackgranite || - tFix == OrePrefixes.oreDense || - tFix == OrePrefixes.oreEnd || - tFix == OrePrefixes.oreEndstone || - tFix == OrePrefixes.oreNether || - tFix == OrePrefixes.oreNetherrack || - tFix == OrePrefixes.oreNormal || - tFix == OrePrefixes.orePoor || - tFix == OrePrefixes.oreRedgranite || - tFix == OrePrefixes.oreRich || - tFix == OrePrefixes.oreSmall || - tFix == OrePrefixes.oreBasalt || - tFix == OrePrefixes.oreMarble) tAllowPrefix = true; + if (tFix == OrePrefixes.oreBlackgranite + || tFix == OrePrefixes.oreDense + || tFix == OrePrefixes.oreEnd + || tFix == OrePrefixes.oreEndstone + || tFix == OrePrefixes.oreNether + || tFix == OrePrefixes.oreNetherrack + || tFix == OrePrefixes.oreNormal + || tFix == OrePrefixes.orePoor + || tFix == OrePrefixes.oreRedgranite + || tFix == OrePrefixes.oreRich + || tFix == OrePrefixes.oreSmall + || tFix == OrePrefixes.oreBasalt + || tFix == OrePrefixes.oreMarble) tAllowPrefix = true; } } return tAllowPrefix; diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler.java index 9eebaaabc4..9d832e134c 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler.java +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler.java @@ -1,10 +1,12 @@ package gregtech.common.tileentities.boilers; +import static gregtech.api.objects.XSTR.XSTR_INSTANCE; + import gregtech.GT_Mod; import gregtech.api.GregTech_API; -import gregtech.api.enums.ParticleFX; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; +import gregtech.api.enums.ParticleFX; import gregtech.api.enums.SoundResource; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -23,8 +25,6 @@ import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.IFluidHandler; -import static gregtech.api.objects.XSTR.XSTR_INSTANCE; - public abstract class GT_MetaTileEntity_Boiler extends GT_MetaTileEntity_BasicTank { public static final byte SOUND_EVENT_LET_OFF_EXCESS_STEAM = 1; public int mTemperature = 20; @@ -34,11 +34,13 @@ public abstract class GT_MetaTileEntity_Boiler extends GT_MetaTileEntity_BasicTa public boolean mHadNoWater = false; private int mExcessWater = 0; - public GT_MetaTileEntity_Boiler(int aID, String aName, String aNameRegional, String aDescription, ITexture... aTextures) { + public GT_MetaTileEntity_Boiler( + int aID, String aName, String aNameRegional, String aDescription, ITexture... aTextures) { super(aID, aName, aNameRegional, 0, 4, aDescription, aTextures); } - public GT_MetaTileEntity_Boiler(int aID, String aName, String aNameRegional, String[] aDescription, ITexture... aTextures) { + public GT_MetaTileEntity_Boiler( + int aID, String aName, String aNameRegional, String[] aDescription, ITexture... aTextures) { super(aID, aName, aNameRegional, 0, 4, aDescription, aTextures); } @@ -51,10 +53,17 @@ public abstract class GT_MetaTileEntity_Boiler extends GT_MetaTileEntity_BasicTa } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - ITexture[] tmp = mTextures[aSide >= 2 ? aSide != aFacing ? 2 : ((byte) (aActive ? 4 : 3)) : aSide][aColorIndex + 1]; + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { + ITexture[] tmp = + mTextures[aSide >= 2 ? aSide != aFacing ? 2 : ((byte) (aActive ? 4 : 3)) : aSide][aColorIndex + 1]; if (aSide != aFacing && tmp.length == 2) { - tmp = new ITexture[]{tmp[0]}; + tmp = new ITexture[] {tmp[0]}; } return tmp; } @@ -252,7 +261,9 @@ public abstract class GT_MetaTileEntity_Boiler extends GT_MetaTileEntity_BasicTa } private void calculateHeatUp(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - if ((this.mTemperature < getMaxTemperature()) && (this.mProcessingEnergy > 0) && (aTick % getHeatUpRate() == 0L)) { + if ((this.mTemperature < getMaxTemperature()) + && (this.mProcessingEnergy > 0) + && (aTick % getHeatUpRate() == 0L)) { this.mProcessingEnergy -= getEnergyConsumption(); this.mTemperature += getHeatUpAmount(); } @@ -300,11 +311,16 @@ public abstract class GT_MetaTileEntity_Boiler extends GT_MetaTileEntity_BasicTa protected final void pushSteamToSide(IGregTechTileEntity aBaseMetaTileEntity, int aSide) { IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide((byte) aSide); if (tTileEntity == null) return; - FluidStack tDrained = aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(aSide), Math.max(1, this.mSteam.amount / 2), false); + FluidStack tDrained = aBaseMetaTileEntity.drain( + ForgeDirection.getOrientation(aSide), Math.max(1, this.mSteam.amount / 2), false); if (tDrained == null) return; - int tFilledAmount = tTileEntity.fill(ForgeDirection.getOrientation(aSide).getOpposite(), tDrained, false); + int tFilledAmount = + tTileEntity.fill(ForgeDirection.getOrientation(aSide).getOpposite(), tDrained, false); if (tFilledAmount <= 0) return; - tTileEntity.fill(ForgeDirection.getOrientation(aSide).getOpposite(), aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(aSide), tFilledAmount, true), true); + tTileEntity.fill( + ForgeDirection.getOrientation(aSide).getOpposite(), + aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(aSide), tFilledAmount, true), + true); } protected void pushSteamToInventories(IGregTechTileEntity aBaseMetaTileEntity) { @@ -328,7 +344,6 @@ public abstract class GT_MetaTileEntity_Boiler extends GT_MetaTileEntity_BasicTa @Override public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { return GT_Mod.gregtechproxy.mAllowSmallBoilerAutomation; - } @Override @@ -341,7 +356,13 @@ public abstract class GT_MetaTileEntity_Boiler extends GT_MetaTileEntity_BasicTa if (aIndex == GT_MetaTileEntity_Boiler.SOUND_EVENT_LET_OFF_EXCESS_STEAM) { GT_Utility.doSoundAtClient(SoundResource.RANDOM_FIZZ, 2, 1.0F, aX, aY, aZ); - new ParticleEventBuilder().setIdentifier(ParticleFX.CLOUD).setWorld(getBaseMetaTileEntity().getWorld()).setMotion(0D, 0D, 0D).<ParticleEventBuilder>times(8, x -> x.setPosition(aX - 0.5D + XSTR_INSTANCE.nextFloat(), aY, aZ - 0.5D + XSTR_INSTANCE.nextFloat()).run()); + new ParticleEventBuilder() + .setIdentifier(ParticleFX.CLOUD) + .setWorld(getBaseMetaTileEntity().getWorld()) + .setMotion(0D, 0D, 0D) + .<ParticleEventBuilder>times(8, x -> x.setPosition( + aX - 0.5D + XSTR_INSTANCE.nextFloat(), aY, aZ - 0.5D + XSTR_INSTANCE.nextFloat()) + .run()); } } diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java index 4b4a0299c1..9d3c61fc82 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java @@ -1,11 +1,21 @@ package gregtech.common.tileentities.boilers; +import static gregtech.api.enums.Textures.BlockIcons.BOILER_FRONT; +import static gregtech.api.enums.Textures.BlockIcons.BOILER_FRONT_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.BOILER_FRONT_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.BOILER_FRONT_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPE; +import static gregtech.api.objects.XSTR.XSTR_INSTANCE; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.GT_Mod; -import gregtech.api.enums.ParticleFX; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.ParticleFX; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; @@ -22,22 +32,13 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.tileentity.TileEntityFurnace; import net.minecraftforge.common.util.ForgeDirection; -import static gregtech.api.enums.Textures.BlockIcons.BOILER_FRONT; -import static gregtech.api.enums.Textures.BlockIcons.BOILER_FRONT_ACTIVE; -import static gregtech.api.enums.Textures.BlockIcons.BOILER_FRONT_ACTIVE_GLOW; -import static gregtech.api.enums.Textures.BlockIcons.BOILER_FRONT_GLOW; -import static gregtech.api.enums.Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM; -import static gregtech.api.enums.Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE; -import static gregtech.api.enums.Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPE; -import static gregtech.api.objects.XSTR.XSTR_INSTANCE; - public class GT_MetaTileEntity_Boiler_Bronze extends GT_MetaTileEntity_Boiler { public GT_MetaTileEntity_Boiler_Bronze(int aID, String aName, String aNameRegional) { - super(aID, aName, aNameRegional, new String[]{ - "An early way to get Steam Power", - "Produces 120L of Steam per second", - "Causes " + GT_Mod.gregtechproxy.mPollutionSmallCoalBoilerPerSecond + " Pollution per second"}); + super(aID, aName, aNameRegional, new String[] { + "An early way to get Steam Power", + "Produces 120L of Steam per second", + "Causes " + GT_Mod.gregtechproxy.mPollutionSmallCoalBoilerPerSecond + " Pollution per second" + }); } public GT_MetaTileEntity_Boiler_Bronze(int aID, String aName, String aNameRegional, String[] aDescription) { @@ -55,17 +56,27 @@ public class GT_MetaTileEntity_Boiler_Bronze extends GT_MetaTileEntity_Boiler { @Override public ITexture[][][] getTextureSet(ITexture[] aTextures) { ITexture[][][] rTextures = new ITexture[5][17][]; - final ITexture[] - texBottom = {TextureFactory.of(MACHINE_BRONZEBRICKS_BOTTOM)}, + final ITexture[] texBottom = {TextureFactory.of(MACHINE_BRONZEBRICKS_BOTTOM)}, texTop = {TextureFactory.of(MACHINE_BRONZEBRICKS_TOP), TextureFactory.of(OVERLAY_PIPE)}, texSide = {TextureFactory.of(MACHINE_BRONZEBRICKS_SIDE), TextureFactory.of(OVERLAY_PIPE)}, - texFront = {TextureFactory.of(MACHINE_BRONZEBRICKS_SIDE), - TextureFactory.of(BOILER_FRONT), - TextureFactory.builder().addIcon(BOILER_FRONT_GLOW).glow().build()}, - texFrontActive = { - TextureFactory.of(MACHINE_BRONZEBRICKS_SIDE), - TextureFactory.of(BOILER_FRONT_ACTIVE), - TextureFactory.builder().addIcon(BOILER_FRONT_ACTIVE_GLOW).glow().build()}; + texFront = + { + TextureFactory.of(MACHINE_BRONZEBRICKS_SIDE), + TextureFactory.of(BOILER_FRONT), + TextureFactory.builder() + .addIcon(BOILER_FRONT_GLOW) + .glow() + .build() + }, + texFrontActive = + { + TextureFactory.of(MACHINE_BRONZEBRICKS_SIDE), + TextureFactory.of(BOILER_FRONT_ACTIVE), + TextureFactory.builder() + .addIcon(BOILER_FRONT_ACTIVE_GLOW) + .glow() + .build() + }; for (int i = 0; i < 17; i++) { rTextures[0][i] = texBottom; rTextures[1][i] = texTop; @@ -109,8 +120,8 @@ public class GT_MetaTileEntity_Boiler_Bronze extends GT_MetaTileEntity_Boiler { final byte frontFacing = aBaseMetaTileEntity.getFrontFacing(); if (frontFacing > 1 - && aBaseMetaTileEntity.getCoverIDAtSide(frontFacing) == 0 - && !aBaseMetaTileEntity.getOpacityAtSide(frontFacing)) { + && aBaseMetaTileEntity.getCoverIDAtSide(frontFacing) == 0 + && !aBaseMetaTileEntity.getOpacityAtSide(frontFacing)) { final double oX = aBaseMetaTileEntity.getOffsetX(frontFacing, 1) + 8D / 16D; final double oY = aBaseMetaTileEntity.getOffsetY(frontFacing, 1); @@ -137,8 +148,7 @@ public class GT_MetaTileEntity_Boiler_Bronze extends GT_MetaTileEntity_Boiler { z = oZ + offset; } - ParticleEventBuilder particleEventBuilder = - (new ParticleEventBuilder()) + ParticleEventBuilder particleEventBuilder = (new ParticleEventBuilder()) .setMotion(0D, 0D, 0D) .setPosition(x, y, z) .setWorld(getBaseMetaTileEntity().getWorld()); @@ -151,7 +161,10 @@ public class GT_MetaTileEntity_Boiler_Bronze extends GT_MetaTileEntity_Boiler { @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPostTick(aBaseMetaTileEntity, aTick); - if ((aBaseMetaTileEntity.isServerSide()) && (aTick > 20L) && this.mProcessingEnergy > 0 && (aTick % 20L == 0L)) { + if ((aBaseMetaTileEntity.isServerSide()) + && (aTick > 20L) + && this.mProcessingEnergy > 0 + && (aTick % 20L == 0L)) { GT_Pollution.addPollution(getBaseMetaTileEntity(), getPollution()); } } @@ -184,64 +197,125 @@ public class GT_MetaTileEntity_Boiler_Bronze extends GT_MetaTileEntity_Boiler { @Override protected void updateFuel(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (this.mInventory[2] == null) return; - if ( - (GT_Utility.isPartOfMaterials(this.mInventory[2],Materials.Coal) && !GT_Utility.isPartOfOrePrefix(this.mInventory[2],OrePrefixes.block)) || - (GT_Utility.isPartOfMaterials(this.mInventory[2],Materials.Charcoal) && !GT_Utility.isPartOfOrePrefix(this.mInventory[2],OrePrefixes.block)) || - (GT_Utility.isPartOfMaterials(this.mInventory[2],Materials.Lignite) && !GT_Utility.isPartOfOrePrefix(this.mInventory[2],OrePrefixes.block)) || - (GT_Utility.isPartOfMaterials(this.mInventory[2],Materials.Diamond) && !GT_Utility.isPartOfOrePrefix(this.mInventory[2],OrePrefixes.block)) || - GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelCoke") || - GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelCactusCharcoal") || - GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelCactusCoke") || - GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelSugarCharcoal") || - GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelSugarCoke") - ) { - if ((TileEntityFurnace.getItemBurnTime(this.mInventory[2])/10) > 0) { - this.mProcessingEnergy += (TileEntityFurnace.getItemBurnTime(this.mInventory[2])/10); + if ((GT_Utility.isPartOfMaterials(this.mInventory[2], Materials.Coal) + && !GT_Utility.isPartOfOrePrefix(this.mInventory[2], OrePrefixes.block)) + || (GT_Utility.isPartOfMaterials(this.mInventory[2], Materials.Charcoal) + && !GT_Utility.isPartOfOrePrefix(this.mInventory[2], OrePrefixes.block)) + || (GT_Utility.isPartOfMaterials(this.mInventory[2], Materials.Lignite) + && !GT_Utility.isPartOfOrePrefix(this.mInventory[2], OrePrefixes.block)) + || (GT_Utility.isPartOfMaterials(this.mInventory[2], Materials.Diamond) + && !GT_Utility.isPartOfOrePrefix(this.mInventory[2], OrePrefixes.block)) + || GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelCoke") + || GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelCactusCharcoal") + || GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelCactusCoke") + || GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelSugarCharcoal") + || GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelSugarCoke")) { + if ((TileEntityFurnace.getItemBurnTime(this.mInventory[2]) / 10) > 0) { + this.mProcessingEnergy += (TileEntityFurnace.getItemBurnTime(this.mInventory[2]) / 10); aBaseMetaTileEntity.decrStackSize(2, 1); - if (XSTR.XSTR_INSTANCE.nextInt(GT_Utility.isPartOfMaterials(this.mInventory[2],Materials.Coal) || GT_Utility.isPartOfMaterials(this.mInventory[2],Materials.Charcoal) ? 3 : GT_Utility.isPartOfMaterials(this.mInventory[2],Materials.Lignite) ? 8 : 2 ) == 0) { - aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, (GT_Utility.isPartOfMaterials(this.mInventory[2],Materials.Lignite) || GT_Utility.isPartOfMaterials(this.mInventory[2],Materials.Coal)) ? Materials.DarkAsh : Materials.Ash, 1L)); + if (XSTR.XSTR_INSTANCE.nextInt( + GT_Utility.isPartOfMaterials(this.mInventory[2], Materials.Coal) + || GT_Utility.isPartOfMaterials(this.mInventory[2], Materials.Charcoal) + ? 3 + : GT_Utility.isPartOfMaterials(this.mInventory[2], Materials.Lignite) ? 8 : 2) + == 0) { + aBaseMetaTileEntity.addStackToSlot( + 3, + GT_OreDictUnificator.get( + OrePrefixes.dustTiny, + (GT_Utility.isPartOfMaterials(this.mInventory[2], Materials.Lignite) + || GT_Utility.isPartOfMaterials(this.mInventory[2], Materials.Coal)) + ? Materials.DarkAsh + : Materials.Ash, + 1L)); } } - } - else if ( - //If its a block of the following materials - GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.block.get(Materials.Coal)) || - GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.block.get(Materials.Lignite)) || - GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.block.get(Materials.Charcoal))|| - GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.block.get(Materials.Diamond)) || - - //if its either a Railcraft Coke Block or a custom GTNH compressed Coal/charcoal/lignite/coke block - ( - Block.getBlockFromItem(this.mInventory[2].getItem()) != null && //check if the block exists - ( - Block.getBlockFromItem(this.mInventory[2].getItem()).getUnlocalizedName().toLowerCase().contains("tile") && //check if the block is a tile -> block - ( - //If the name of the block contains these names - Block.getBlockFromItem(this.mInventory[2].getItem()).getUnlocalizedName().toLowerCase().contains("charcoal") || - Block.getBlockFromItem(this.mInventory[2].getItem()).getUnlocalizedName().toLowerCase().contains("coal") || - Block.getBlockFromItem(this.mInventory[2].getItem()).getUnlocalizedName().toLowerCase().contains("diamond") || - Block.getBlockFromItem(this.mInventory[2].getItem()).getUnlocalizedName().toLowerCase().contains("coke") || - Block.getBlockFromItem(this.mInventory[2].getItem()).getUnlocalizedName().toLowerCase().contains("railcraft.cube") || - Block.getBlockFromItem(this.mInventory[2].getItem()).getUnlocalizedName().toLowerCase().contains("lignite") - ) - ) - ) - ){ - //try to add 10% of the burnvalue as Processing energy, no boost for coal coke here - if ((TileEntityFurnace.getItemBurnTime(this.mInventory[2])/10) > 0) { + } else if ( + // If its a block of the following materials + GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.block.get(Materials.Coal)) + || GT_OreDictUnificator.isItemStackInstanceOf( + this.mInventory[2], OrePrefixes.block.get(Materials.Lignite)) + || GT_OreDictUnificator.isItemStackInstanceOf( + this.mInventory[2], OrePrefixes.block.get(Materials.Charcoal)) + || GT_OreDictUnificator.isItemStackInstanceOf( + this.mInventory[2], OrePrefixes.block.get(Materials.Diamond)) + || + + // if its either a Railcraft Coke Block or a custom GTNH compressed Coal/charcoal/lignite/coke block + (Block.getBlockFromItem(this.mInventory[2].getItem()) != null + && // check if the block exists + (Block.getBlockFromItem(this.mInventory[2].getItem()) + .getUnlocalizedName() + .toLowerCase() + .contains("tile") + && // check if the block is a tile -> block + ( + // If the name of the block contains these names + Block.getBlockFromItem(this.mInventory[2].getItem()) + .getUnlocalizedName() + .toLowerCase() + .contains("charcoal") + || Block.getBlockFromItem(this.mInventory[2].getItem()) + .getUnlocalizedName() + .toLowerCase() + .contains("coal") + || Block.getBlockFromItem(this.mInventory[2].getItem()) + .getUnlocalizedName() + .toLowerCase() + .contains("diamond") + || Block.getBlockFromItem(this.mInventory[2].getItem()) + .getUnlocalizedName() + .toLowerCase() + .contains("coke") + || Block.getBlockFromItem(this.mInventory[2].getItem()) + .getUnlocalizedName() + .toLowerCase() + .contains("railcraft.cube") + || Block.getBlockFromItem(this.mInventory[2].getItem()) + .getUnlocalizedName() + .toLowerCase() + .contains("lignite"))))) { + // try to add 10% of the burnvalue as Processing energy, no boost for coal coke here + if ((TileEntityFurnace.getItemBurnTime(this.mInventory[2]) / 10) > 0) { this.mProcessingEnergy += (TileEntityFurnace.getItemBurnTime(this.mInventory[2]) / 10); aBaseMetaTileEntity.decrStackSize(2, 1); - aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dust, (GT_Utility.isPartOfMaterials(this.mInventory[2],Materials.Lignite) || GT_Utility.isPartOfMaterials(this.mInventory[2],Materials.Coal) || Block.getBlockFromItem(this.mInventory[2].getItem()).getUnlocalizedName().toLowerCase().contains("coal") || Block.getBlockFromItem(this.mInventory[2].getItem()).getUnlocalizedName().toLowerCase().contains("lignite") ) ? Materials.DarkAsh : Materials.Ash, 1L)); + aBaseMetaTileEntity.addStackToSlot( + 3, + GT_OreDictUnificator.get( + OrePrefixes.dust, + (GT_Utility.isPartOfMaterials(this.mInventory[2], Materials.Lignite) + || GT_Utility.isPartOfMaterials(this.mInventory[2], Materials.Coal) + || Block.getBlockFromItem(this.mInventory[2].getItem()) + .getUnlocalizedName() + .toLowerCase() + .contains("coal") + || Block.getBlockFromItem(this.mInventory[2].getItem()) + .getUnlocalizedName() + .toLowerCase() + .contains("lignite")) + ? Materials.DarkAsh + : Materials.Ash, + 1L)); } - //enables every other fuel with at least 2000 burntime as a fuel, i.e. peat, Magic/Solid Super Fuel, Coal Singularities, Nitor, while bucket of creosite should be blocked same goes for lava - }else if ((TileEntityFurnace.getItemBurnTime(this.mInventory[2])) >= 2000 && !(this.mInventory[2].getUnlocalizedName().toLowerCase().contains("bucket") || this.mInventory[2].getUnlocalizedName().toLowerCase().contains("cell"))){ + // enables every other fuel with at least 2000 burntime as a fuel, i.e. peat, Magic/Solid Super Fuel, Coal + // Singularities, Nitor, while bucket of creosite should be blocked same goes for lava + } else if ((TileEntityFurnace.getItemBurnTime(this.mInventory[2])) >= 2000 + && !(this.mInventory[2].getUnlocalizedName().toLowerCase().contains("bucket") + || this.mInventory[2].getUnlocalizedName().toLowerCase().contains("cell"))) { this.mProcessingEnergy += (TileEntityFurnace.getItemBurnTime(this.mInventory[2]) / 10); aBaseMetaTileEntity.decrStackSize(2, 1); - //adds tiny pile of ash for burntime under 10k, small pile for under 100k and pile for bigger values + // adds tiny pile of ash for burntime under 10k, small pile for under 100k and pile for bigger values if (XSTR.XSTR_INSTANCE.nextInt(2) == 0) - aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get( (TileEntityFurnace.getItemBurnTime(this.mInventory[2]) >= 10000 ? TileEntityFurnace.getItemBurnTime(this.mInventory[2]) >= 100000 ? OrePrefixes.dust : OrePrefixes.dustSmall : OrePrefixes.dustTiny), Materials.Ash, 1L)); + aBaseMetaTileEntity.addStackToSlot( + 3, + GT_OreDictUnificator.get( + (TileEntityFurnace.getItemBurnTime(this.mInventory[2]) >= 10000 + ? TileEntityFurnace.getItemBurnTime(this.mInventory[2]) >= 100000 + ? OrePrefixes.dust + : OrePrefixes.dustSmall + : OrePrefixes.dustTiny), + Materials.Ash, + 1L)); } - } - } diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Lava.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Lava.java index 18010c0886..38bef79f38 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Lava.java +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Lava.java @@ -1,5 +1,14 @@ package gregtech.common.tileentities.boilers; +import static gregtech.api.enums.Textures.BlockIcons.BOILER_LAVA_FRONT; +import static gregtech.api.enums.Textures.BlockIcons.BOILER_LAVA_FRONT_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.BOILER_LAVA_FRONT_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.BOILER_LAVA_FRONT_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_STEELBRICKS_BOTTOM; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_STEELBRICKS_TOP; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPE; + import gregtech.GT_Mod; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; @@ -14,15 +23,6 @@ import gregtech.common.gui.GT_GUIContainer_Boiler; import net.minecraft.entity.player.InventoryPlayer; import net.minecraftforge.fluids.FluidStack; -import static gregtech.api.enums.Textures.BlockIcons.BOILER_LAVA_FRONT; -import static gregtech.api.enums.Textures.BlockIcons.BOILER_LAVA_FRONT_ACTIVE; -import static gregtech.api.enums.Textures.BlockIcons.BOILER_LAVA_FRONT_ACTIVE_GLOW; -import static gregtech.api.enums.Textures.BlockIcons.BOILER_LAVA_FRONT_GLOW; -import static gregtech.api.enums.Textures.BlockIcons.MACHINE_STEELBRICKS_BOTTOM; -import static gregtech.api.enums.Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE; -import static gregtech.api.enums.Textures.BlockIcons.MACHINE_STEELBRICKS_TOP; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPE; - public class GT_MetaTileEntity_Boiler_Lava extends GT_MetaTileEntity_Boiler { public static final int COOLDOWN_INTERVAL = 20; @@ -31,11 +31,14 @@ public class GT_MetaTileEntity_Boiler_Lava extends GT_MetaTileEntity_Boiler { public static final int PRODUCTION_PER_SECOND = 600; public GT_MetaTileEntity_Boiler_Lava(int aID, String aName, String aNameRegional) { - super(aID, aName, aNameRegional, new String[]{ - "A Boiler running off Lava", - "Produces " + PRODUCTION_PER_SECOND + "L of Steam per second", - "Causes " + Integer.toString(GT_Mod.gregtechproxy.mPollutionHighPressureLavaBoilerPerSecond) + " Pollution per second", - "Consumes " + ((double) CONSUMPTION_PER_HEATUP / ENERGY_PER_LAVA) + "L of Lava every " + COOLDOWN_INTERVAL + " ticks when fully heat up"}); + super(aID, aName, aNameRegional, new String[] { + "A Boiler running off Lava", + "Produces " + PRODUCTION_PER_SECOND + "L of Steam per second", + "Causes " + Integer.toString(GT_Mod.gregtechproxy.mPollutionHighPressureLavaBoilerPerSecond) + + " Pollution per second", + "Consumes " + ((double) CONSUMPTION_PER_HEATUP / ENERGY_PER_LAVA) + "L of Lava every " + COOLDOWN_INTERVAL + + " ticks when fully heat up" + }); } public GT_MetaTileEntity_Boiler_Lava(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { @@ -49,18 +52,24 @@ public class GT_MetaTileEntity_Boiler_Lava extends GT_MetaTileEntity_Boiler { @Override public ITexture[][][] getTextureSet(ITexture[] aTextures) { ITexture[][][] rTextures = new ITexture[5][17][]; - final ITexture[] - texBottom = {TextureFactory.of(MACHINE_STEELBRICKS_BOTTOM)}, + final ITexture[] texBottom = {TextureFactory.of(MACHINE_STEELBRICKS_BOTTOM)}, texTop = {TextureFactory.of(MACHINE_STEELBRICKS_TOP), TextureFactory.of(OVERLAY_PIPE)}, texSide = {TextureFactory.of(MACHINE_STEELBRICKS_SIDE), TextureFactory.of(OVERLAY_PIPE)}, - texFront = { - TextureFactory.of(MACHINE_STEELBRICKS_SIDE), - TextureFactory.of(BOILER_LAVA_FRONT), - TextureFactory.of(BOILER_LAVA_FRONT_GLOW)}, - texFrontActive = { - TextureFactory.of(MACHINE_STEELBRICKS_SIDE), - TextureFactory.of(BOILER_LAVA_FRONT_ACTIVE), - TextureFactory.builder().addIcon(BOILER_LAVA_FRONT_ACTIVE_GLOW).glow().build()}; + texFront = + { + TextureFactory.of(MACHINE_STEELBRICKS_SIDE), + TextureFactory.of(BOILER_LAVA_FRONT), + TextureFactory.of(BOILER_LAVA_FRONT_GLOW) + }, + texFrontActive = + { + TextureFactory.of(MACHINE_STEELBRICKS_SIDE), + TextureFactory.of(BOILER_LAVA_FRONT_ACTIVE), + TextureFactory.builder() + .addIcon(BOILER_LAVA_FRONT_ACTIVE_GLOW) + .glow() + .build() + }; for (byte i = 0; i < 17; i++) { rTextures[0][i] = texBottom; rTextures[1][i] = texTop; @@ -127,7 +136,8 @@ public class GT_MetaTileEntity_Boiler_Lava extends GT_MetaTileEntity_Boiler { this.mProcessingEnergy += 1000 * ENERGY_PER_LAVA; aBaseMetaTileEntity.decrStackSize(2, 1); aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.bucket, Materials.Empty, 1L)); - } else if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.bucketClay.get(Materials.Lava))) { + } else if (GT_OreDictUnificator.isItemStackInstanceOf( + this.mInventory[2], OrePrefixes.bucketClay.get(Materials.Lava))) { this.mProcessingEnergy += 1000 * ENERGY_PER_LAVA; aBaseMetaTileEntity.decrStackSize(2, 1); // Clay lava buckets break, so you don't get it back. diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar.java index cd3bb00ee4..cccfb1b6b4 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar.java +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar.java @@ -1,5 +1,10 @@ package gregtech.common.tileentities.boilers; +import static gregtech.api.GregTech_API.sMachineFile; +import static gregtech.api.enums.ConfigCategories.machineconfig; +import static mcp.mobius.waila.api.SpecialChars.GOLD; +import static mcp.mobius.waila.api.SpecialChars.RESET; + import gregtech.api.enums.Dyes; import gregtech.api.enums.Textures.BlockIcons; import gregtech.api.interfaces.ITexture; @@ -11,6 +16,7 @@ import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Utility; import gregtech.common.gui.GT_Container_Boiler; import gregtech.common.gui.GT_GUIContainer_Boiler; +import java.util.List; import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaDataAccessor; import net.minecraft.entity.player.EntityPlayerMP; @@ -22,21 +28,13 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import java.util.List; - -import static gregtech.api.GregTech_API.sMachineFile; -import static gregtech.api.enums.ConfigCategories.machineconfig; -import static mcp.mobius.waila.api.SpecialChars.GOLD; -import static mcp.mobius.waila.api.SpecialChars.RESET; - public class GT_MetaTileEntity_Boiler_Solar extends GT_MetaTileEntity_Boiler { public static final String LPS_FMT = "%s L/s"; private static final String localizedDescFormat = GT_LanguageManager.addStringLocalization( "gt.blockmachines.boiler.solar.desc.format", - "Steam Power by the Sun%n" + - "Produces %sL of Steam per second%n" + - "Calcifies over time, reducing Steam output to %sL/s%n" + - "Break and replace to descale"); + "Steam Power by the Sun%n" + "Produces %sL of Steam per second%n" + + "Calcifies over time, reducing Steam output to %sL/s%n" + + "Break and replace to descale"); protected final Config mConfig; protected int basicTemperatureMod = 5; // Base Celsius gain or loss private int mRunTimeTicks = 0; @@ -56,13 +54,14 @@ public class GT_MetaTileEntity_Boiler_Solar extends GT_MetaTileEntity_Boiler { mConfig = createConfig(); } - protected GT_MetaTileEntity_Boiler_Solar(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, Config aConfig) { + protected GT_MetaTileEntity_Boiler_Solar( + String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, Config aConfig) { super(aName, aTier, aDescription, aTextures); mConfig = aConfig; } protected Config createConfig() { - return new Config(machineconfig + ".boiler.solar.bronze",1080000,40,120,45); + return new Config(machineconfig + ".boiler.solar.bronze", 1080000, 40, 120, 45); } /** @@ -92,9 +91,10 @@ public class GT_MetaTileEntity_Boiler_Solar extends GT_MetaTileEntity_Boiler { @Override public String[] getDescription() { - return String.format(localizedDescFormat, - GT_Utility.formatNumbers(getMaxOutputPerSecond()), - GT_Utility.formatNumbers(getMinOutputPerSecond())) + return String.format( + localizedDescFormat, + GT_Utility.formatNumbers(getMaxOutputPerSecond()), + GT_Utility.formatNumbers(getMinOutputPerSecond())) .split("\\R"); } @@ -108,16 +108,17 @@ public class GT_MetaTileEntity_Boiler_Solar extends GT_MetaTileEntity_Boiler { for (int color = -1; color < 16; color++) { int i = color + 1; short[] colorModulation = Dyes.getModulation(color, Dyes._NULL.mRGBa); - rTextures[0][i] = new ITexture[]{ - TextureFactory.of(BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM, colorModulation)}; - rTextures[1][i] = new ITexture[]{ - TextureFactory.of(BlockIcons.MACHINE_BRONZEBRICKS_TOP, colorModulation), - TextureFactory.of(BlockIcons.BOILER_SOLAR)}; - rTextures[2][i] = new ITexture[]{ - TextureFactory.of(BlockIcons.MACHINE_BRONZEBRICKS_SIDE, colorModulation)}; - rTextures[3][i] = new ITexture[]{ - TextureFactory.of(BlockIcons.MACHINE_BRONZEBRICKS_SIDE, colorModulation), - TextureFactory.of(BlockIcons.OVERLAY_PIPE)}; + rTextures[0][i] = + new ITexture[] {TextureFactory.of(BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM, colorModulation)}; + rTextures[1][i] = new ITexture[] { + TextureFactory.of(BlockIcons.MACHINE_BRONZEBRICKS_TOP, colorModulation), + TextureFactory.of(BlockIcons.BOILER_SOLAR) + }; + rTextures[2][i] = new ITexture[] {TextureFactory.of(BlockIcons.MACHINE_BRONZEBRICKS_SIDE, colorModulation)}; + rTextures[3][i] = new ITexture[] { + TextureFactory.of(BlockIcons.MACHINE_BRONZEBRICKS_SIDE, colorModulation), + TextureFactory.of(BlockIcons.OVERLAY_PIPE) + }; } return rTextures; } @@ -133,7 +134,13 @@ public class GT_MetaTileEntity_Boiler_Solar extends GT_MetaTileEntity_Boiler { } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { int i = aColorIndex + 1; if (aSide >= 2) { if (aSide != aFacing) return mTextures[2][i]; @@ -193,7 +200,9 @@ public class GT_MetaTileEntity_Boiler_Solar extends GT_MetaTileEntity_Boiler { * from the maximum output per second, and return this or the minimum output per second */ return mConfig.getMaxOutputPerSecond() - - mConfig.getMaxOutputPerSecond() * (mRunTimeTicks - mConfig.getCalcificationTicks()) / mConfig.getCalcificationTicks(); + - mConfig.getMaxOutputPerSecond() + * (mRunTimeTicks - mConfig.getCalcificationTicks()) + / mConfig.getCalcificationTicks(); } else { return mConfig.getMaxOutputPerSecond(); } @@ -251,16 +260,19 @@ public class GT_MetaTileEntity_Boiler_Solar extends GT_MetaTileEntity_Boiler { @Override public String[] getInfoData() { - return String.format("Heat Capacity: " + EnumChatFormatting.GREEN + "%s %%" + EnumChatFormatting.RESET + - " Hot time: " + EnumChatFormatting.RED + "%s s" + EnumChatFormatting.RESET + "%n" + - "Min output: " + EnumChatFormatting.RED + LPS_FMT + EnumChatFormatting.RESET + - " Max output: " + EnumChatFormatting.RED + LPS_FMT + EnumChatFormatting.RESET + "%n" + - "Current Output: " + EnumChatFormatting.YELLOW + LPS_FMT + EnumChatFormatting.RESET, - GT_Utility.formatNumbers(getHeatCapacityPercent()), - GT_Utility.formatNumbers(getHotTimeSeconds()), - GT_Utility.formatNumbers(getMinOutputPerSecond()), - GT_Utility.formatNumbers(getMaxOutputPerSecond()), - GT_Utility.formatNumbers(getProductionPerSecond())) + return String.format( + "Heat Capacity: " + EnumChatFormatting.GREEN + "%s %%" + EnumChatFormatting.RESET + + " Hot time: " + + EnumChatFormatting.RED + "%s s" + EnumChatFormatting.RESET + "%n" + "Min output: " + + EnumChatFormatting.RED + LPS_FMT + EnumChatFormatting.RESET + " Max output: " + + EnumChatFormatting.RED + LPS_FMT + EnumChatFormatting.RESET + "%n" + + "Current Output: " + + EnumChatFormatting.YELLOW + LPS_FMT + EnumChatFormatting.RESET, + GT_Utility.formatNumbers(getHeatCapacityPercent()), + GT_Utility.formatNumbers(getHotTimeSeconds()), + GT_Utility.formatNumbers(getMinOutputPerSecond()), + GT_Utility.formatNumbers(getMaxOutputPerSecond()), + GT_Utility.formatNumbers(getProductionPerSecond())) .split("\\R"); } @@ -278,15 +290,20 @@ public class GT_MetaTileEntity_Boiler_Solar extends GT_MetaTileEntity_Boiler { } @Override - public void getWailaBody(ItemStack itemStack, List<String> currentTip, IWailaDataAccessor accessor, IWailaConfigHandler config) { + public void getWailaBody( + ItemStack itemStack, List<String> currentTip, IWailaDataAccessor accessor, IWailaConfigHandler config) { final NBTTagCompound tag = accessor.getNBTData(); - currentTip.add(String.format((GOLD + "Solar Boiler Output: " + RESET + "%d/%d L/s"), tag.getInteger("calcificationOutput"), tag.getInteger("maxCalcificationOutput"))); + currentTip.add(String.format( + (GOLD + "Solar Boiler Output: " + RESET + "%d/%d L/s"), + tag.getInteger("calcificationOutput"), + tag.getInteger("maxCalcificationOutput"))); super.getWailaBody(itemStack, currentTip, accessor, config); } @Override - public void getWailaNBTData(EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y, int z) { + public void getWailaNBTData( + EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y, int z) { super.getWailaNBTData(player, tile, tag, world, x, y, z); tag.setInteger("calcificationOutput", (getProductionPerSecond())); tag.setInteger("maxCalcificationOutput", (getMaxOutputPerSecond())); @@ -299,27 +316,38 @@ public class GT_MetaTileEntity_Boiler_Solar extends GT_MetaTileEntity_Boiler { private final int coolDownTicks; private final int maxRuntimeTicks; - public Config(String aCategory, - int aDefaultCalcificationTicks, - int aDefaultMinOutputPerSecond, - int aDefaultMaxOutputPerSecond, - int aDefaultCoolDownTicks) { - calcificationTicks = get(aCategory,"CalcificationTicks", aDefaultCalcificationTicks, + public Config( + String aCategory, + int aDefaultCalcificationTicks, + int aDefaultMinOutputPerSecond, + int aDefaultMaxOutputPerSecond, + int aDefaultCoolDownTicks) { + calcificationTicks = get( + aCategory, + "CalcificationTicks", + aDefaultCalcificationTicks, "Number of run-time ticks before boiler starts calcification.", "100% calcification and minimal output will be reached at 2 times this."); - minOutputPerSecond = get(aCategory,"MinOutputPerSecond", aDefaultMinOutputPerSecond); - maxOutputPerSecond = get(aCategory,"MaxOutputPerSecond", aDefaultMaxOutputPerSecond); - coolDownTicks = get(aCategory,"CoolDownTicks", aDefaultCoolDownTicks, "Number of ticks it takes to lose 1°C."); + minOutputPerSecond = get(aCategory, "MinOutputPerSecond", aDefaultMinOutputPerSecond); + maxOutputPerSecond = get(aCategory, "MaxOutputPerSecond", aDefaultMaxOutputPerSecond); + coolDownTicks = + get(aCategory, "CoolDownTicks", aDefaultCoolDownTicks, "Number of ticks it takes to lose 1°C."); // After which min output is reached. - maxRuntimeTicks = (getMaxOutputPerSecond() - getMinOutputPerSecond()) * getCalcificationTicks() / getMaxOutputPerSecond() + getCalcificationTicks(); + maxRuntimeTicks = (getMaxOutputPerSecond() - getMinOutputPerSecond()) + * getCalcificationTicks() + / getMaxOutputPerSecond() + + getCalcificationTicks(); } - protected int get(final String aCategory, final String aKey, final int aDefaultValue, final String... aComments) { + protected int get( + final String aCategory, final String aKey, final int aDefaultValue, final String... aComments) { final StringBuilder tCommentBuilder = new StringBuilder(); - for (String tComment: aComments) - tCommentBuilder.append(tComment).append('\n'); + for (String tComment : aComments) tCommentBuilder.append(tComment).append('\n'); tCommentBuilder.append("Default: ").append(aDefaultValue); - return sMachineFile.mConfig.get(aCategory, aKey, aDefaultValue, tCommentBuilder.toString()).getInt(); + return sMachineFile + .mConfig + .get(aCategory, aKey, aDefaultValue, tCommentBuilder.toString()) + .getInt(); } public int getCalcificationTicks() { diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar_Steel.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar_Steel.java index e044b6fb9b..223c280ad4 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar_Steel.java +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar_Steel.java @@ -1,5 +1,7 @@ package gregtech.common.tileentities.boilers; +import static gregtech.api.enums.ConfigCategories.machineconfig; + import gregtech.api.enums.Dyes; import gregtech.api.enums.Textures.BlockIcons; import gregtech.api.interfaces.ITexture; @@ -9,22 +11,23 @@ import gregtech.api.render.TextureFactory; import gregtech.common.gui.GT_GUIContainer_Boiler; import net.minecraft.entity.player.InventoryPlayer; -import static gregtech.api.enums.ConfigCategories.machineconfig; - public class GT_MetaTileEntity_Boiler_Solar_Steel extends GT_MetaTileEntity_Boiler_Solar { public GT_MetaTileEntity_Boiler_Solar_Steel(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); } - public GT_MetaTileEntity_Boiler_Solar_Steel(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_Boiler_Solar_Steel( + String aName, int aTier, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } - public GT_MetaTileEntity_Boiler_Solar_Steel(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_Boiler_Solar_Steel( + String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } - public GT_MetaTileEntity_Boiler_Solar_Steel(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, Config aConfig) { + public GT_MetaTileEntity_Boiler_Solar_Steel( + String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, Config aConfig) { super(aName, aTier, aDescription, aTextures, aConfig); } @@ -40,16 +43,17 @@ public class GT_MetaTileEntity_Boiler_Solar_Steel extends GT_MetaTileEntity_Boil for (int color = -1; color < 16; color++) { int i = color + 1; short[] colorModulation = Dyes.getModulation(color, Dyes._NULL.mRGBa); - rTextures[0][i] = new ITexture[]{ - TextureFactory.of(BlockIcons.MACHINE_STEELBRICKS_BOTTOM, colorModulation)}; - rTextures[1][i] = new ITexture[]{ - TextureFactory.of(BlockIcons.MACHINE_STEELBRICKS_TOP, colorModulation), - TextureFactory.of(BlockIcons.BOILER_SOLAR)}; - rTextures[2][i] = new ITexture[]{ - TextureFactory.of(BlockIcons.MACHINE_STEELBRICKS_SIDE, colorModulation)}; - rTextures[3][i] = new ITexture[]{ - TextureFactory.of(BlockIcons.MACHINE_STEELBRICKS_SIDE, colorModulation), - TextureFactory.of(BlockIcons.OVERLAY_PIPE)}; + rTextures[0][i] = + new ITexture[] {TextureFactory.of(BlockIcons.MACHINE_STEELBRICKS_BOTTOM, colorModulation)}; + rTextures[1][i] = new ITexture[] { + TextureFactory.of(BlockIcons.MACHINE_STEELBRICKS_TOP, colorModulation), + TextureFactory.of(BlockIcons.BOILER_SOLAR) + }; + rTextures[2][i] = new ITexture[] {TextureFactory.of(BlockIcons.MACHINE_STEELBRICKS_SIDE, colorModulation)}; + rTextures[3][i] = new ITexture[] { + TextureFactory.of(BlockIcons.MACHINE_STEELBRICKS_SIDE, colorModulation), + TextureFactory.of(BlockIcons.OVERLAY_PIPE) + }; } return rTextures; } @@ -66,6 +70,7 @@ public class GT_MetaTileEntity_Boiler_Solar_Steel extends GT_MetaTileEntity_Boil @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Boiler_Solar_Steel(this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mConfig); + return new GT_MetaTileEntity_Boiler_Solar_Steel( + this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mConfig); } } diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Steel.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Steel.java index 98546ff09e..b417ece4d5 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Steel.java +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Steel.java @@ -1,14 +1,5 @@ package gregtech.common.tileentities.boilers; -import gregtech.GT_Mod; -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.MetaTileEntity; -import gregtech.api.render.TextureFactory; -import gregtech.common.gui.GT_Container_Boiler; -import gregtech.common.gui.GT_GUIContainer_Boiler; -import net.minecraft.entity.player.InventoryPlayer; - import static gregtech.api.enums.Textures.BlockIcons.BOILER_FRONT; import static gregtech.api.enums.Textures.BlockIcons.BOILER_FRONT_ACTIVE; import static gregtech.api.enums.Textures.BlockIcons.BOILER_FRONT_ACTIVE_GLOW; @@ -18,14 +9,24 @@ import static gregtech.api.enums.Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE; import static gregtech.api.enums.Textures.BlockIcons.MACHINE_STEELBRICKS_TOP; import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPE; -public class GT_MetaTileEntity_Boiler_Steel extends GT_MetaTileEntity_Boiler_Bronze { +import gregtech.GT_Mod; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.render.TextureFactory; +import gregtech.common.gui.GT_Container_Boiler; +import gregtech.common.gui.GT_GUIContainer_Boiler; +import net.minecraft.entity.player.InventoryPlayer; +public class GT_MetaTileEntity_Boiler_Steel extends GT_MetaTileEntity_Boiler_Bronze { public GT_MetaTileEntity_Boiler_Steel(int aID, String aName, String aNameRegional) { - super(aID, aName, aNameRegional, new String[]{ - "Faster than the Bronze Boiler", - "Produces 300L of Steam per second", - "Causes "+Integer.toString(GT_Mod.gregtechproxy.mPollutionHighPressureCoalBoilerPerSecond)+" Pollution per second"}); + super(aID, aName, aNameRegional, new String[] { + "Faster than the Bronze Boiler", + "Produces 300L of Steam per second", + "Causes " + Integer.toString(GT_Mod.gregtechproxy.mPollutionHighPressureCoalBoilerPerSecond) + + " Pollution per second" + }); } public GT_MetaTileEntity_Boiler_Steel(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { @@ -39,17 +40,27 @@ public class GT_MetaTileEntity_Boiler_Steel extends GT_MetaTileEntity_Boiler_Bro @Override public ITexture[][][] getTextureSet(ITexture[] aTextures) { ITexture[][][] rTextures = new ITexture[5][17][]; - final ITexture[] - texBottom = {TextureFactory.of(MACHINE_STEELBRICKS_BOTTOM)}, + final ITexture[] texBottom = {TextureFactory.of(MACHINE_STEELBRICKS_BOTTOM)}, texTop = {TextureFactory.of(MACHINE_STEELBRICKS_TOP), TextureFactory.of(OVERLAY_PIPE)}, texSide = {TextureFactory.of(MACHINE_STEELBRICKS_SIDE), TextureFactory.of(OVERLAY_PIPE)}, - texFront = {TextureFactory.of(MACHINE_STEELBRICKS_SIDE), - TextureFactory.of(BOILER_FRONT), - TextureFactory.builder().addIcon(BOILER_FRONT_GLOW).glow().build()}, - texFrontActive = { - TextureFactory.of(MACHINE_STEELBRICKS_SIDE), - TextureFactory.of(BOILER_FRONT_ACTIVE), - TextureFactory.builder().addIcon(BOILER_FRONT_ACTIVE_GLOW).glow().build()}; + texFront = + { + TextureFactory.of(MACHINE_STEELBRICKS_SIDE), + TextureFactory.of(BOILER_FRONT), + TextureFactory.builder() + .addIcon(BOILER_FRONT_GLOW) + .glow() + .build() + }, + texFrontActive = + { + TextureFactory.of(MACHINE_STEELBRICKS_SIDE), + TextureFactory.of(BOILER_FRONT_ACTIVE), + TextureFactory.builder() + .addIcon(BOILER_FRONT_ACTIVE_GLOW) + .glow() + .build() + }; for (int i = 0; i < 17; i++) { rTextures[0][i] = texBottom; rTextures[1][i] = texTop; diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java index 6a712b41f5..ca6e77225e 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java @@ -1,13 +1,16 @@ package gregtech.common.tileentities.generators; +import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.api.objects.XSTR.XSTR_INSTANCE; + import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.GT_Mod; import gregtech.api.GregTech_API; -import gregtech.api.enums.ParticleFX; import gregtech.api.enums.ConfigCategories; import gregtech.api.enums.ItemList; +import gregtech.api.enums.ParticleFX; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; @@ -22,19 +25,18 @@ import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; -import static gregtech.api.enums.Textures.BlockIcons.*; -import static gregtech.api.objects.XSTR.XSTR_INSTANCE; - public class GT_MetaTileEntity_DieselGenerator extends GT_MetaTileEntity_BasicGenerator { - - public int mEfficiency; public GT_MetaTileEntity_DieselGenerator(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, new String[]{ - "Requires liquid Fuel", - "Causes " + (int) (GT_Mod.gregtechproxy.mPollutionBaseDieselGeneratorPerSecond * GT_Mod.gregtechproxy.mPollutionDieselGeneratorReleasedByTier[aTier]) + " Pollution per second"}); + super(aID, aName, aNameRegional, aTier, new String[] { + "Requires liquid Fuel", + "Causes " + + (int) (GT_Mod.gregtechproxy.mPollutionBaseDieselGeneratorPerSecond + * GT_Mod.gregtechproxy.mPollutionDieselGeneratorReleasedByTier[aTier]) + + " Pollution per second" + }); onConfigLoad(); } @@ -69,7 +71,10 @@ public class GT_MetaTileEntity_DieselGenerator extends GT_MetaTileEntity_BasicGe } public void onConfigLoad() { - this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "DieselGenerator.efficiency.tier." + this.mTier, (100 - this.mTier * 5)); + this.mEfficiency = GregTech_API.sMachineFile.get( + ConfigCategories.machineconfig, + "DieselGenerator.efficiency.tier." + this.mTier, + (100 - this.mTier * 5)); } @Override @@ -93,7 +98,9 @@ public class GT_MetaTileEntity_DieselGenerator extends GT_MetaTileEntity_BasicGe @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (aTick % 100 == 0 && mFluid != null && mFluid.amount > this.getCapacity()) { - GT_Log.err.println("Dupe Abuse: " + aBaseMetaTileEntity.getOwnerName() + " Coords: " + aBaseMetaTileEntity.getXCoord() + " " + aBaseMetaTileEntity.getYCoord() + " " + aBaseMetaTileEntity.getZCoord()); + GT_Log.err.println( + "Dupe Abuse: " + aBaseMetaTileEntity.getOwnerName() + " Coords: " + aBaseMetaTileEntity.getXCoord() + + " " + aBaseMetaTileEntity.getYCoord() + " " + aBaseMetaTileEntity.getZCoord()); aBaseMetaTileEntity.setToFire(); } super.onPostTick(aBaseMetaTileEntity, aTick); @@ -112,97 +119,159 @@ public class GT_MetaTileEntity_DieselGenerator extends GT_MetaTileEntity_BasicGe final byte topFacing = (byte) ForgeDirection.UP.ordinal(); if (aBaseMetaTileEntity.getCoverIDAtSide(topFacing) == 0 - && !aBaseMetaTileEntity.getOpacityAtSide(topFacing)) { + && !aBaseMetaTileEntity.getOpacityAtSide(topFacing)) { - final double x = aBaseMetaTileEntity.getOffsetX(topFacing, 1) + 2D / 16D - + XSTR_INSTANCE.nextFloat() * 14D / 16D; + final double x = + aBaseMetaTileEntity.getOffsetX(topFacing, 1) + 2D / 16D + XSTR_INSTANCE.nextFloat() * 14D / 16D; final double y = aBaseMetaTileEntity.getOffsetY(topFacing, 1) + 1D / 32D; - final double z = aBaseMetaTileEntity.getOffsetZ(topFacing, 1) + 2D / 16D - + XSTR_INSTANCE.nextFloat() * 14D / 16D; + final double z = + aBaseMetaTileEntity.getOffsetZ(topFacing, 1) + 2D / 16D + XSTR_INSTANCE.nextFloat() * 14D / 16D; new ParticleEventBuilder() - .setMotion(0D, 0D, 0D) - .setPosition(x, y, z) - .setWorld(getBaseMetaTileEntity().getWorld()) - .setIdentifier(ParticleFX.SMOKE).run(); + .setMotion(0D, 0D, 0D) + .setPosition(x, y, z) + .setWorld(getBaseMetaTileEntity().getWorld()) + .setIdentifier(ParticleFX.SMOKE) + .run(); } } } @Override public ITexture[] getFront(byte aColor) { - return new ITexture[]{super.getFront(aColor)[0], TextureFactory.of( - TextureFactory.of(DIESEL_GENERATOR_FRONT), - TextureFactory.builder().addIcon(DIESEL_GENERATOR_FRONT_GLOW).glow().build()), - OVERLAYS_ENERGY_OUT[this.mTier]}; + return new ITexture[] { + super.getFront(aColor)[0], + TextureFactory.of( + TextureFactory.of(DIESEL_GENERATOR_FRONT), + TextureFactory.builder() + .addIcon(DIESEL_GENERATOR_FRONT_GLOW) + .glow() + .build()), + OVERLAYS_ENERGY_OUT[this.mTier] + }; } @Override public ITexture[] getBack(byte aColor) { - return new ITexture[]{super.getBack(aColor)[0], TextureFactory.of( - TextureFactory.of(DIESEL_GENERATOR_BACK), - TextureFactory.builder().addIcon(DIESEL_GENERATOR_BACK_GLOW).glow().build())}; + return new ITexture[] { + super.getBack(aColor)[0], + TextureFactory.of( + TextureFactory.of(DIESEL_GENERATOR_BACK), + TextureFactory.builder() + .addIcon(DIESEL_GENERATOR_BACK_GLOW) + .glow() + .build()) + }; } @Override public ITexture[] getBottom(byte aColor) { - return new ITexture[]{super.getBottom(aColor)[0], TextureFactory.of( - TextureFactory.of(DIESEL_GENERATOR_BOTTOM), - TextureFactory.builder().addIcon(DIESEL_GENERATOR_BOTTOM_GLOW).glow().build())}; + return new ITexture[] { + super.getBottom(aColor)[0], + TextureFactory.of( + TextureFactory.of(DIESEL_GENERATOR_BOTTOM), + TextureFactory.builder() + .addIcon(DIESEL_GENERATOR_BOTTOM_GLOW) + .glow() + .build()) + }; } @Override public ITexture[] getTop(byte aColor) { - return new ITexture[]{super.getTop(aColor)[0], TextureFactory.of( - TextureFactory.of(DIESEL_GENERATOR_TOP), - TextureFactory.builder().addIcon(DIESEL_GENERATOR_TOP_GLOW).glow().build())}; + return new ITexture[] { + super.getTop(aColor)[0], + TextureFactory.of( + TextureFactory.of(DIESEL_GENERATOR_TOP), + TextureFactory.builder() + .addIcon(DIESEL_GENERATOR_TOP_GLOW) + .glow() + .build()) + }; } @Override public ITexture[] getSides(byte aColor) { - return new ITexture[]{super.getSides(aColor)[0], TextureFactory.of( - TextureFactory.of(DIESEL_GENERATOR_SIDE), - TextureFactory.builder().addIcon(DIESEL_GENERATOR_SIDE_GLOW).glow().build())}; + return new ITexture[] { + super.getSides(aColor)[0], + TextureFactory.of( + TextureFactory.of(DIESEL_GENERATOR_SIDE), + TextureFactory.builder() + .addIcon(DIESEL_GENERATOR_SIDE_GLOW) + .glow() + .build()) + }; } @Override public ITexture[] getFrontActive(byte aColor) { - return new ITexture[]{super.getFrontActive(aColor)[0], TextureFactory.of( - TextureFactory.of(DIESEL_GENERATOR_FRONT_ACTIVE), - TextureFactory.builder().addIcon(DIESEL_GENERATOR_FRONT_ACTIVE_GLOW).glow().build()), - OVERLAYS_ENERGY_OUT[this.mTier]}; + return new ITexture[] { + super.getFrontActive(aColor)[0], + TextureFactory.of( + TextureFactory.of(DIESEL_GENERATOR_FRONT_ACTIVE), + TextureFactory.builder() + .addIcon(DIESEL_GENERATOR_FRONT_ACTIVE_GLOW) + .glow() + .build()), + OVERLAYS_ENERGY_OUT[this.mTier] + }; } @Override public ITexture[] getBackActive(byte aColor) { - return new ITexture[]{super.getBackActive(aColor)[0], TextureFactory.of( - TextureFactory.of(DIESEL_GENERATOR_BACK_ACTIVE), - TextureFactory.builder().addIcon(DIESEL_GENERATOR_BACK_ACTIVE_GLOW).glow().build())}; + return new ITexture[] { + super.getBackActive(aColor)[0], + TextureFactory.of( + TextureFactory.of(DIESEL_GENERATOR_BACK_ACTIVE), + TextureFactory.builder() + .addIcon(DIESEL_GENERATOR_BACK_ACTIVE_GLOW) + .glow() + .build()) + }; } @Override public ITexture[] getBottomActive(byte aColor) { - return new ITexture[]{super.getBottomActive(aColor)[0], TextureFactory.of( - TextureFactory.of(DIESEL_GENERATOR_BOTTOM_ACTIVE), - TextureFactory.builder().addIcon(DIESEL_GENERATOR_BOTTOM_ACTIVE_GLOW).glow().build())}; + return new ITexture[] { + super.getBottomActive(aColor)[0], + TextureFactory.of( + TextureFactory.of(DIESEL_GENERATOR_BOTTOM_ACTIVE), + TextureFactory.builder() + .addIcon(DIESEL_GENERATOR_BOTTOM_ACTIVE_GLOW) + .glow() + .build()) + }; } @Override public ITexture[] getTopActive(byte aColor) { - return new ITexture[]{super.getTopActive(aColor)[0], TextureFactory.of( - TextureFactory.of(DIESEL_GENERATOR_TOP_ACTIVE), - TextureFactory.builder().addIcon(DIESEL_GENERATOR_TOP_ACTIVE_GLOW).glow().build())}; + return new ITexture[] { + super.getTopActive(aColor)[0], + TextureFactory.of( + TextureFactory.of(DIESEL_GENERATOR_TOP_ACTIVE), + TextureFactory.builder() + .addIcon(DIESEL_GENERATOR_TOP_ACTIVE_GLOW) + .glow() + .build()) + }; } @Override public ITexture[] getSidesActive(byte aColor) { - return new ITexture[]{super.getSidesActive(aColor)[0], TextureFactory.of( - TextureFactory.of(DIESEL_GENERATOR_SIDE_ACTIVE), - TextureFactory.builder().addIcon(DIESEL_GENERATOR_SIDE_ACTIVE_GLOW).glow().build())}; + return new ITexture[] { + super.getSidesActive(aColor)[0], + TextureFactory.of( + TextureFactory.of(DIESEL_GENERATOR_SIDE_ACTIVE), + TextureFactory.builder() + .addIcon(DIESEL_GENERATOR_SIDE_ACTIVE_GLOW) + .glow() + .build()) + }; } @Override public int getPollution() { - return (int) (GT_Mod.gregtechproxy.mPollutionBaseDieselGeneratorPerSecond * GT_Mod.gregtechproxy.mPollutionDieselGeneratorReleasedByTier[mTier]); + return (int) (GT_Mod.gregtechproxy.mPollutionBaseDieselGeneratorPerSecond + * GT_Mod.gregtechproxy.mPollutionDieselGeneratorReleasedByTier[mTier]); } } diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java index a0f6aeee64..6a5ee85d99 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java @@ -1,5 +1,7 @@ package gregtech.common.tileentities.generators; +import static gregtech.api.enums.Textures.BlockIcons.*; + import gregtech.GT_Mod; import gregtech.api.GregTech_API; import gregtech.api.enums.ConfigCategories; @@ -10,17 +12,18 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenera import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Recipe; -import static gregtech.api.enums.Textures.BlockIcons.*; - public class GT_MetaTileEntity_GasTurbine extends GT_MetaTileEntity_BasicGenerator { - public int mEfficiency; public GT_MetaTileEntity_GasTurbine(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, new String[]{ - "Requires flammable Gasses", - "Causes " + (int) (GT_Mod.gregtechproxy.mPollutionBaseGasTurbinePerSecond * GT_Mod.gregtechproxy.mPollutionGasTurbineReleasedByTier[aTier]) + " Pollution per second"}); + super(aID, aName, aNameRegional, aTier, new String[] { + "Requires flammable Gasses", + "Causes " + + (int) (GT_Mod.gregtechproxy.mPollutionBaseGasTurbinePerSecond + * GT_Mod.gregtechproxy.mPollutionGasTurbineReleasedByTier[aTier]) + + " Pollution per second" + }); onConfigLoad(); } @@ -55,10 +58,10 @@ public class GT_MetaTileEntity_GasTurbine extends GT_MetaTileEntity_BasicGenerat } public void onConfigLoad() { - this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "GasTurbine.efficiency.tier." + this.mTier, (100 - this.mTier * 5)); + this.mEfficiency = GregTech_API.sMachineFile.get( + ConfigCategories.machineconfig, "GasTurbine.efficiency.tier." + this.mTier, (100 - this.mTier * 5)); } - @Override public int getEfficiency() { return this.mEfficiency; @@ -66,78 +69,139 @@ public class GT_MetaTileEntity_GasTurbine extends GT_MetaTileEntity_BasicGenerat @Override public ITexture[] getFront(byte aColor) { - return new ITexture[]{super.getFront(aColor)[0], TextureFactory.of( - TextureFactory.of(GAS_TURBINE_FRONT), - TextureFactory.builder().addIcon(GAS_TURBINE_FRONT_GLOW).glow().build()), - OVERLAYS_ENERGY_OUT[this.mTier]}; + return new ITexture[] { + super.getFront(aColor)[0], + TextureFactory.of( + TextureFactory.of(GAS_TURBINE_FRONT), + TextureFactory.builder() + .addIcon(GAS_TURBINE_FRONT_GLOW) + .glow() + .build()), + OVERLAYS_ENERGY_OUT[this.mTier] + }; } @Override public ITexture[] getBack(byte aColor) { - return new ITexture[]{super.getBack(aColor)[0], TextureFactory.of( - TextureFactory.of(GAS_TURBINE_BACK), - TextureFactory.builder().addIcon(GAS_TURBINE_BACK_GLOW).glow().build())}; + return new ITexture[] { + super.getBack(aColor)[0], + TextureFactory.of( + TextureFactory.of(GAS_TURBINE_BACK), + TextureFactory.builder() + .addIcon(GAS_TURBINE_BACK_GLOW) + .glow() + .build()) + }; } @Override public ITexture[] getBottom(byte aColor) { - return new ITexture[]{super.getBottom(aColor)[0], TextureFactory.of( - TextureFactory.of(GAS_TURBINE_BOTTOM), - TextureFactory.builder().addIcon(GAS_TURBINE_BOTTOM_GLOW).glow().build())}; + return new ITexture[] { + super.getBottom(aColor)[0], + TextureFactory.of( + TextureFactory.of(GAS_TURBINE_BOTTOM), + TextureFactory.builder() + .addIcon(GAS_TURBINE_BOTTOM_GLOW) + .glow() + .build()) + }; } @Override public ITexture[] getTop(byte aColor) { - return new ITexture[]{super.getTop(aColor)[0], TextureFactory.of( - TextureFactory.of(GAS_TURBINE_TOP), - TextureFactory.builder().addIcon(GAS_TURBINE_TOP_GLOW).glow().build())}; + return new ITexture[] { + super.getTop(aColor)[0], + TextureFactory.of( + TextureFactory.of(GAS_TURBINE_TOP), + TextureFactory.builder() + .addIcon(GAS_TURBINE_TOP_GLOW) + .glow() + .build()) + }; } @Override public ITexture[] getSides(byte aColor) { - return new ITexture[]{super.getSides(aColor)[0], TextureFactory.of( - TextureFactory.of(GAS_TURBINE_SIDE), - TextureFactory.builder().addIcon(GAS_TURBINE_SIDE_GLOW).glow().build())}; + return new ITexture[] { + super.getSides(aColor)[0], + TextureFactory.of( + TextureFactory.of(GAS_TURBINE_SIDE), + TextureFactory.builder() + .addIcon(GAS_TURBINE_SIDE_GLOW) + .glow() + .build()) + }; } @Override public ITexture[] getFrontActive(byte aColor) { - return new ITexture[]{super.getFrontActive(aColor)[0], TextureFactory.of( - TextureFactory.of(GAS_TURBINE_FRONT_ACTIVE), - TextureFactory.builder().addIcon(GAS_TURBINE_FRONT_ACTIVE_GLOW).glow().build()), - OVERLAYS_ENERGY_OUT[this.mTier]}; + return new ITexture[] { + super.getFrontActive(aColor)[0], + TextureFactory.of( + TextureFactory.of(GAS_TURBINE_FRONT_ACTIVE), + TextureFactory.builder() + .addIcon(GAS_TURBINE_FRONT_ACTIVE_GLOW) + .glow() + .build()), + OVERLAYS_ENERGY_OUT[this.mTier] + }; } @Override public ITexture[] getBackActive(byte aColor) { - return new ITexture[]{super.getBackActive(aColor)[0], TextureFactory.of( - TextureFactory.of(GAS_TURBINE_BACK_ACTIVE), - TextureFactory.builder().addIcon(GAS_TURBINE_BACK_ACTIVE_GLOW).glow().build())}; + return new ITexture[] { + super.getBackActive(aColor)[0], + TextureFactory.of( + TextureFactory.of(GAS_TURBINE_BACK_ACTIVE), + TextureFactory.builder() + .addIcon(GAS_TURBINE_BACK_ACTIVE_GLOW) + .glow() + .build()) + }; } @Override public ITexture[] getBottomActive(byte aColor) { - return new ITexture[]{super.getBottomActive(aColor)[0], TextureFactory.of( - TextureFactory.of(GAS_TURBINE_BOTTOM_ACTIVE), - TextureFactory.builder().addIcon(GAS_TURBINE_BOTTOM_ACTIVE_GLOW).glow().build())}; + return new ITexture[] { + super.getBottomActive(aColor)[0], + TextureFactory.of( + TextureFactory.of(GAS_TURBINE_BOTTOM_ACTIVE), + TextureFactory.builder() + .addIcon(GAS_TURBINE_BOTTOM_ACTIVE_GLOW) + .glow() + .build()) + }; } @Override public ITexture[] getTopActive(byte aColor) { - return new ITexture[]{super.getTopActive(aColor)[0], TextureFactory.of( - TextureFactory.of(GAS_TURBINE_TOP_ACTIVE), - TextureFactory.builder().addIcon(GAS_TURBINE_TOP_ACTIVE_GLOW).glow().build())}; + return new ITexture[] { + super.getTopActive(aColor)[0], + TextureFactory.of( + TextureFactory.of(GAS_TURBINE_TOP_ACTIVE), + TextureFactory.builder() + .addIcon(GAS_TURBINE_TOP_ACTIVE_GLOW) + .glow() + .build()) + }; } @Override public ITexture[] getSidesActive(byte aColor) { - return new ITexture[]{super.getSidesActive(aColor)[0], TextureFactory.of( - TextureFactory.of(GAS_TURBINE_SIDE_ACTIVE), - TextureFactory.builder().addIcon(GAS_TURBINE_SIDE_ACTIVE_GLOW).glow().build())}; + return new ITexture[] { + super.getSidesActive(aColor)[0], + TextureFactory.of( + TextureFactory.of(GAS_TURBINE_SIDE_ACTIVE), + TextureFactory.builder() + .addIcon(GAS_TURBINE_SIDE_ACTIVE_GLOW) + .glow() + .build()) + }; } @Override public int getPollution() { - return (int) (GT_Mod.gregtechproxy.mPollutionBaseGasTurbinePerSecond * GT_Mod.gregtechproxy.mPollutionGasTurbineReleasedByTier[mTier]); + return (int) (GT_Mod.gregtechproxy.mPollutionBaseGasTurbinePerSecond + * GT_Mod.gregtechproxy.mPollutionGasTurbineReleasedByTier[mTier]); } } diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_LightningRod.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_LightningRod.java index 88d49075e5..dbb8931848 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_LightningRod.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_LightningRod.java @@ -1,5 +1,7 @@ package gregtech.common.tileentities.generators; +import static gregtech.api.objects.XSTR.XSTR_INSTANCE; + import gregtech.api.enums.GT_Values; import gregtech.api.enums.Textures.BlockIcons; import gregtech.api.interfaces.ITexture; @@ -14,36 +16,46 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import static gregtech.api.objects.XSTR.XSTR_INSTANCE; - public class GT_MetaTileEntity_LightningRod extends GT_MetaTileEntity_TieredMachineBlock { public GT_MetaTileEntity_LightningRod(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, 0, "Generates EU From Lightning Bolts"); } - public GT_MetaTileEntity_LightningRod(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_LightningRod( + String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } - - public GT_MetaTileEntity_LightningRod(String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) { + + public GT_MetaTileEntity_LightningRod( + String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { if (aSide != ForgeDirection.UP.ordinal()) { - return new ITexture[]{ - BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], - BlockIcons.OVERLAYS_ENERGY_OUT_POWER[mTier]}; + return new ITexture[] { + BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], BlockIcons.OVERLAYS_ENERGY_OUT_POWER[mTier] + }; } - if (!aActive) return new ITexture[]{ + if (!aActive) + return new ITexture[] { BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], TextureFactory.of(BlockIcons.MACHINE_CASING_FUSION_GLASS) - }; - return new ITexture[]{ - BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], - TextureFactory.of(BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW), - TextureFactory.builder().addIcon(BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW).glow().build() + }; + return new ITexture[] { + BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], + TextureFactory.of(BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW), + TextureFactory.builder() + .addIcon(BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW) + .glow() + .build() }; } @@ -54,7 +66,8 @@ public class GT_MetaTileEntity_LightningRod extends GT_MetaTileEntity_TieredMach @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_LightningRod(this.mName, this.mTier, this.mInventory.length, this.mDescriptionArray, this.mTextures); + return new GT_MetaTileEntity_LightningRod( + this.mName, this.mTier, this.mInventory.length, this.mDescriptionArray, this.mTextures); } @Override @@ -76,7 +89,11 @@ public class GT_MetaTileEntity_LightningRod extends GT_MetaTileEntity_TieredMach int aZ = aBaseMetaTileEntity.getZCoord(); for (int i = aBaseMetaTileEntity.getYCoord() + 1; i < aWorld.getHeight() - 1; i++) { - if (isRodValid && aBaseMetaTileEntity.getBlock(aX, i, aZ).getUnlocalizedName().equals("blockFenceIron")) { + if (isRodValid + && aBaseMetaTileEntity + .getBlock(aX, i, aZ) + .getUnlocalizedName() + .equals("blockFenceIron")) { aRodValue++; } else { isRodValid = false; @@ -88,7 +105,8 @@ public class GT_MetaTileEntity_LightningRod extends GT_MetaTileEntity_TieredMach } if (!aWorld.isThundering() && ((aY + aRodValue) < 128)) aRodValue = 0; if (XSTR_INSTANCE.nextInt(4 * aWorld.getHeight()) < (aRodValue * (aY + aRodValue))) { - aBaseMetaTileEntity.increaseStoredEnergyUnits(maxEUStore() - aBaseMetaTileEntity.getStoredEU(), false); + aBaseMetaTileEntity.increaseStoredEnergyUnits( + maxEUStore() - aBaseMetaTileEntity.getStoredEU(), false); aWorld.addWeatherEffect(new EntityLightningBolt(aWorld, aX, aY + aRodValue, aZ)); } } @@ -112,7 +130,7 @@ public class GT_MetaTileEntity_LightningRod extends GT_MetaTileEntity_TieredMach @Override public boolean isFacingValid(byte aFacing) { - return aFacing==1; + return aFacing == 1; } @Override @@ -146,10 +164,8 @@ public class GT_MetaTileEntity_LightningRod extends GT_MetaTileEntity_TieredMach } @Override - public void saveNBTData(NBTTagCompound aNBT) { - } + public void saveNBTData(NBTTagCompound aNBT) {} @Override - public void loadNBTData(NBTTagCompound aNBT) { - } + public void loadNBTData(NBTTagCompound aNBT) {} } diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicEnergyConverter.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicEnergyConverter.java index aceab00a02..2e1bfd655f 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicEnergyConverter.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicEnergyConverter.java @@ -1,14 +1,5 @@ package gregtech.common.tileentities.generators; -import gregtech.api.GregTech_API; -import gregtech.api.enums.ConfigCategories; -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.MetaTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator; -import gregtech.api.render.TextureFactory; -import gregtech.api.util.GT_Recipe; - import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASING_MAGIC; import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE; import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE_GLOW; @@ -19,6 +10,15 @@ import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASING_MAGIC_FRONT_ import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASING_MAGIC_GLOW; import static gregtech.api.enums.Textures.BlockIcons.OVERLAYS_ENERGY_OUT; +import gregtech.api.GregTech_API; +import gregtech.api.enums.ConfigCategories; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator; +import gregtech.api.render.TextureFactory; +import gregtech.api.util.GT_Recipe; + public class GT_MetaTileEntity_MagicEnergyConverter extends GT_MetaTileEntity_BasicGenerator { public int mEfficiency; @@ -27,12 +27,14 @@ public class GT_MetaTileEntity_MagicEnergyConverter extends GT_MetaTileEntity_Ba onConfigLoad(); } - public GT_MetaTileEntity_MagicEnergyConverter(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_MagicEnergyConverter( + String aName, int aTier, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); onConfigLoad(); } - public GT_MetaTileEntity_MagicEnergyConverter(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_MagicEnergyConverter( + String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); onConfigLoad(); } @@ -44,7 +46,8 @@ public class GT_MetaTileEntity_MagicEnergyConverter extends GT_MetaTileEntity_Ba @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_MagicEnergyConverter(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); + return new GT_MetaTileEntity_MagicEnergyConverter( + this.mName, this.mTier, this.mDescriptionArray, this.mTextures); } @Override @@ -58,10 +61,12 @@ public class GT_MetaTileEntity_MagicEnergyConverter extends GT_MetaTileEntity_Ba } public void onConfigLoad() { - this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MagicEnergyConverter.efficiency.tier." + this.mTier, 100 - this.mTier * 5); + this.mEfficiency = GregTech_API.sMachineFile.get( + ConfigCategories.machineconfig, + "MagicEnergyConverter.efficiency.tier." + this.mTier, + 100 - this.mTier * 5); } - @Override public int getEfficiency() { return this.mEfficiency; @@ -69,88 +74,116 @@ public class GT_MetaTileEntity_MagicEnergyConverter extends GT_MetaTileEntity_Ba @Override public ITexture[] getFront(byte aColor) { - return new ITexture[]{ - super.getFront(aColor)[0], - TextureFactory.of(MACHINE_CASING_MAGIC), - TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_GLOW).glow().build(), - OVERLAYS_ENERGY_OUT[mTier]}; + return new ITexture[] { + super.getFront(aColor)[0], + TextureFactory.of(MACHINE_CASING_MAGIC), + TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_GLOW).glow().build(), + OVERLAYS_ENERGY_OUT[mTier] + }; } @Override public ITexture[] getBack(byte aColor) { - return new ITexture[]{ - super.getBack(aColor)[0], - TextureFactory.of(MACHINE_CASING_MAGIC_FRONT), - TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_FRONT_GLOW).glow().build()}; + return new ITexture[] { + super.getBack(aColor)[0], + TextureFactory.of(MACHINE_CASING_MAGIC_FRONT), + TextureFactory.builder() + .addIcon(MACHINE_CASING_MAGIC_FRONT_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getBottom(byte aColor) { - return new ITexture[]{ - super.getBottom(aColor)[0], - TextureFactory.of(MACHINE_CASING_MAGIC), - TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_GLOW).glow().build()}; + return new ITexture[] { + super.getBottom(aColor)[0], + TextureFactory.of(MACHINE_CASING_MAGIC), + TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_GLOW).glow().build() + }; } @Override public ITexture[] getTop(byte aColor) { - return new ITexture[]{ - super.getTop(aColor)[0], - TextureFactory.of(MACHINE_CASING_MAGIC), - TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_GLOW).glow().build()}; + return new ITexture[] { + super.getTop(aColor)[0], + TextureFactory.of(MACHINE_CASING_MAGIC), + TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_GLOW).glow().build() + }; } @Override public ITexture[] getSides(byte aColor) { - return new ITexture[]{ - super.getSides(aColor)[0], - TextureFactory.of(MACHINE_CASING_MAGIC), - TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_GLOW).glow().build()}; + return new ITexture[] { + super.getSides(aColor)[0], + TextureFactory.of(MACHINE_CASING_MAGIC), + TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_GLOW).glow().build() + }; } @Override public ITexture[] getFrontActive(byte aColor) { - return new ITexture[]{ - super.getFrontActive(aColor)[0], - TextureFactory.of(MACHINE_CASING_MAGIC_ACTIVE), - TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW).glow().build(), - OVERLAYS_ENERGY_OUT[mTier]}; + return new ITexture[] { + super.getFrontActive(aColor)[0], + TextureFactory.of(MACHINE_CASING_MAGIC_ACTIVE), + TextureFactory.builder() + .addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW) + .glow() + .build(), + OVERLAYS_ENERGY_OUT[mTier] + }; } @Override public ITexture[] getBackActive(byte aColor) { - return new ITexture[]{ - super.getBackActive(aColor)[0], - TextureFactory.of(MACHINE_CASING_MAGIC_FRONT_ACTIVE), - TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_FRONT_ACTIVE_GLOW).glow().build()}; + return new ITexture[] { + super.getBackActive(aColor)[0], + TextureFactory.of(MACHINE_CASING_MAGIC_FRONT_ACTIVE), + TextureFactory.builder() + .addIcon(MACHINE_CASING_MAGIC_FRONT_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getBottomActive(byte aColor) { - return new ITexture[]{ - super.getBottomActive(aColor)[0], - TextureFactory.of(MACHINE_CASING_MAGIC_ACTIVE), - TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW).glow().build()}; + return new ITexture[] { + super.getBottomActive(aColor)[0], + TextureFactory.of(MACHINE_CASING_MAGIC_ACTIVE), + TextureFactory.builder() + .addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getTopActive(byte aColor) { - return new ITexture[]{ - super.getTopActive(aColor)[0], - TextureFactory.of(MACHINE_CASING_MAGIC_ACTIVE), - TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW).glow().build()}; + return new ITexture[] { + super.getTopActive(aColor)[0], + TextureFactory.of(MACHINE_CASING_MAGIC_ACTIVE), + TextureFactory.builder() + .addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getSidesActive(byte aColor) { - return new ITexture[]{ - super.getSidesActive(aColor)[0], - TextureFactory.of(MACHINE_CASING_MAGIC_ACTIVE), - TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW).glow().build()}; + return new ITexture[] { + super.getSidesActive(aColor)[0], + TextureFactory.of(MACHINE_CASING_MAGIC_ACTIVE), + TextureFactory.builder() + .addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW) + .glow() + .build() + }; } - @Override - public int getPollution() { - return 0; - } + @Override + public int getPollution() { + return 0; + } } diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java index 4158a22b47..210483cbe8 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java @@ -1,5 +1,17 @@ package gregtech.common.tileentities.generators; +import static gregtech.api.enums.ConfigCategories.machineconfig; +import static gregtech.api.enums.GT_Values.MOD_ID_TC; +import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.api.objects.XSTR.XSTR_INSTANCE; +import static net.minecraft.util.EnumChatFormatting.GRAY; +import static net.minecraft.util.EnumChatFormatting.GREEN; +import static net.minecraft.util.EnumChatFormatting.LIGHT_PURPLE; +import static net.minecraft.util.EnumChatFormatting.RESET; +import static net.minecraft.util.EnumChatFormatting.UNDERLINE; +import static net.minecraft.util.EnumChatFormatting.YELLOW; + import com.google.common.base.Enums; import cpw.mods.fml.common.Loader; import cpw.mods.fml.relauncher.Side; @@ -18,6 +30,14 @@ import gregtech.api.util.GT_Log; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.api.util.WorldSpawnedEventBuilder.ParticleEventBuilder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Set; +import java.util.UUID; +import java.util.concurrent.ConcurrentHashMap; import net.minecraft.block.Block; import net.minecraft.block.BlockDragonEgg; import net.minecraft.enchantment.Enchantment; @@ -40,36 +60,18 @@ import thaumcraft.api.aspects.AspectSourceHelper; import thaumcraft.api.aspects.IAspectContainer; import thaumcraft.api.visnet.VisNetHandler; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Set; -import java.util.UUID; -import java.util.concurrent.ConcurrentHashMap; - -import static gregtech.api.enums.ConfigCategories.machineconfig; -import static gregtech.api.enums.GT_Values.MOD_ID_TC; -import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.enums.Textures.BlockIcons.*; -import static gregtech.api.objects.XSTR.XSTR_INSTANCE; -import static net.minecraft.util.EnumChatFormatting.GRAY; -import static net.minecraft.util.EnumChatFormatting.GREEN; -import static net.minecraft.util.EnumChatFormatting.LIGHT_PURPLE; -import static net.minecraft.util.EnumChatFormatting.RESET; -import static net.minecraft.util.EnumChatFormatting.UNDERLINE; -import static net.minecraft.util.EnumChatFormatting.YELLOW; - interface MagicalEnergyBBListener { void onMagicalEnergyBBUpdate(); } -public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_BasicGenerator implements MagicalEnergyBBListener { +public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_BasicGenerator + implements MagicalEnergyBBListener { private static final boolean THAUMCRAFT_LOADED = Loader.isModLoaded(MOD_ID_TC); - private static final ConcurrentHashMap<UUID, GT_MetaTileEntity_MagicalEnergyAbsorber> sSubscribedCrystals = new ConcurrentHashMap<>(4); - private static final List<Aspect> sPrimalAspects = (THAUMCRAFT_LOADED) ? Aspect.getPrimalAspects() : new ArrayList<>(); + private static final ConcurrentHashMap<UUID, GT_MetaTileEntity_MagicalEnergyAbsorber> sSubscribedCrystals = + new ConcurrentHashMap<>(4); + private static final List<Aspect> sPrimalAspects = + (THAUMCRAFT_LOADED) ? Aspect.getPrimalAspects() : new ArrayList<>(); private static final Map<Aspect, Integer> sAspectsEnergy = new HashMap<>(); private static boolean sAllowMultipleEggs = false; private static GT_MetaTileEntity_MagicalEnergyAbsorber sActiveSiphon = null; @@ -90,7 +92,8 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B onConfigLoad(GregTech_API.sMachineFile); } - private GT_MetaTileEntity_MagicalEnergyAbsorber(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + private GT_MetaTileEntity_MagicalEnergyAbsorber( + String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); onConfigLoad(GregTech_API.sMachineFile); } @@ -110,10 +113,12 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B sEnergyPerEssentia = aConfig.get(machineconfig, "MagicEnergyAbsorber.EnergyPerEssentia", 320); for (Aspect tAspect : Aspect.aspects.values()) { //noinspection UnstableApiUsage - sAspectsEnergy.put(tAspect, - Enums.getIfPresent(TC_Aspects.class, - tAspect.getTag().toUpperCase(Locale.ENGLISH)).or(TC_Aspects.AER).mValue - * sEnergyPerEssentia); + sAspectsEnergy.put( + tAspect, + Enums.getIfPresent(TC_Aspects.class, tAspect.getTag().toUpperCase(Locale.ENGLISH)) + .or(TC_Aspects.AER) + .mValue + * sEnergyPerEssentia); } } } @@ -126,7 +131,8 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B public void onConfigLoad(GT_Config aConfig) { sharedConfigLoad(aConfig); mEfficiency = aConfig.get(machineconfig, "MagicEnergyAbsorber.efficiency.tier." + mTier, 100 - mTier * 10); - mMaxVisPerDrain = (int) Math.round(Math.sqrt((double) (V[mTier] * 10000) / (sEnergyFromVis * (getEfficiency() != 0 ? getEfficiency() : 100)))); + mMaxVisPerDrain = (int) Math.round(Math.sqrt( + (double) (V[mTier] * 10000) / (sEnergyFromVis * (getEfficiency() != 0 ? getEfficiency() : 100)))); if (Math.pow(mMaxVisPerDrain, 2) * sEnergyFromVis * (getEfficiency() != 0 ? getEfficiency() : 100) < V[mTier]) { mMaxVisPerDrain += 1; } @@ -136,7 +142,14 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { if (aPlayer.isSneaking()) mMagicalEnergyBB.decreaseTier(); else mMagicalEnergyBB.increaseTier(); - GT_Utility.sendChatToPlayer(aPlayer, String.format(GT_LanguageManager.addStringLocalization("Interaction_DESCRIPTION_MagicalEnergyAbsorber_Screwdriver", "Absorption range: %s blocks"), mMagicalEnergyBB.getRange(), true)); + GT_Utility.sendChatToPlayer( + aPlayer, + String.format( + GT_LanguageManager.addStringLocalization( + "Interaction_DESCRIPTION_MagicalEnergyAbsorber_Screwdriver", + "Absorption range: %s blocks"), + mMagicalEnergyBB.getRange(), + true)); mMagicalEnergyBB.update(); } @@ -188,22 +201,27 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B final String LI = "-%%%"; final String EU_PER = "%%%EU per "; List<String> description = new ArrayList<>(); - description.add(UNDERLINE + "Feasts on " + LIGHT_PURPLE + UNDERLINE + "magic" + GRAY + UNDERLINE + " close to it:"); - description.add(LI + (sAllowMultipleEggs ? "A " : "An " + YELLOW + UNDERLINE + "EXCLUSIVE" + RESET) + GRAY + " " + LIGHT_PURPLE + "Dragon Egg" + GRAY + " atop"); + description.add( + UNDERLINE + "Feasts on " + LIGHT_PURPLE + UNDERLINE + "magic" + GRAY + UNDERLINE + " close to it:"); + description.add(LI + (sAllowMultipleEggs ? "A " : "An " + YELLOW + UNDERLINE + "EXCLUSIVE" + RESET) + GRAY + " " + + LIGHT_PURPLE + "Dragon Egg" + GRAY + " atop"); if (sEnergyPerEndercrystal > 0) { description.add(LI + sEnergyPerEndercrystal + EU_PER + LIGHT_PURPLE + "Ender Crystal" + GRAY + " in range"); } if (THAUMCRAFT_LOADED) { description.add(LI + mMaxVisPerDrain + "%%%CV/t from an " + LIGHT_PURPLE + "Energised Node" + GRAY); - description.add(LI + (sEnergyPerEssentia * getEfficiency()) / 100 + EU_PER + LIGHT_PURPLE + "Essentia" + GRAY + " Aspect-Value from containers in range"); + description.add(LI + (sEnergyPerEssentia * getEfficiency()) / 100 + EU_PER + LIGHT_PURPLE + "Essentia" + + GRAY + " Aspect-Value from containers in range"); } description.add(" "); description.add(UNDERLINE + "Lookup range (Use Screwdriver to change):"); description.add("Default:%%%" + GREEN + mMagicalEnergyBB.getDefaultRange()); description.add("Max:%%%" + GREEN + mMagicalEnergyBB.getMaxRange()); description.add(" "); - description.add(UNDERLINE + "Fuels on " + LIGHT_PURPLE + UNDERLINE + "enchantments" + GRAY + UNDERLINE + " input:"); - description.add("- Item:%%%" + (10000 * getEfficiency()) / 100 + EU_PER + LIGHT_PURPLE + "enchant" + GRAY + " weight × level / max"); + description.add( + UNDERLINE + "Fuels on " + LIGHT_PURPLE + UNDERLINE + "enchantments" + GRAY + UNDERLINE + " input:"); + description.add("- Item:%%%" + (10000 * getEfficiency()) / 100 + EU_PER + LIGHT_PURPLE + "enchant" + GRAY + + " weight × level / max"); description.add("- Book:%%%" + 10000 + EU_PER + LIGHT_PURPLE + "enchant" + GRAY + " weight × level / max"); description.add(" "); description.add("Efficiency:%%%" + GREEN + getEfficiency() + "%"); @@ -212,84 +230,108 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B @Override public ITexture[] getFront(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getFront(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC), TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_GLOW).glow().build(), - OVERLAYS_ENERGY_OUT[mTier]}; + OVERLAYS_ENERGY_OUT[mTier] + }; } @Override public ITexture[] getBack(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getBack(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC_FRONT), - TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_FRONT_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(MACHINE_CASING_MAGIC_FRONT_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getBottom(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getBottom(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC), - TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_GLOW).glow().build()}; + TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_GLOW).glow().build() + }; } @Override public ITexture[] getTop(byte aColor) { - return new ITexture[]{ - super.getTop(aColor)[0], - TextureFactory.of(MACHINE_CASING_DRAGONEGG)}; + return new ITexture[] {super.getTop(aColor)[0], TextureFactory.of(MACHINE_CASING_DRAGONEGG)}; } @Override public ITexture[] getSides(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getSides(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC), - TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_GLOW).glow().build()}; + TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_GLOW).glow().build() + }; } @Override public ITexture[] getFrontActive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getFrontActive(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC_ACTIVE), - TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW).glow().build(), - OVERLAYS_ENERGY_OUT[mTier]}; + TextureFactory.builder() + .addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW) + .glow() + .build(), + OVERLAYS_ENERGY_OUT[mTier] + }; } @Override public ITexture[] getBackActive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getBackActive(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC_FRONT_ACTIVE), - TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_FRONT_ACTIVE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(MACHINE_CASING_MAGIC_FRONT_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getBottomActive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getBottomActive(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC_ACTIVE), - TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getTopActive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getTopActive(aColor)[0], TextureFactory.of(MACHINE_CASING_DRAGONEGG), - TextureFactory.builder().addIcon(MACHINE_CASING_DRAGONEGG_GLOW).glow().build() + TextureFactory.builder() + .addIcon(MACHINE_CASING_DRAGONEGG_GLOW) + .glow() + .build() }; } @Override public ITexture[] getSidesActive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getSidesActive(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC_ACTIVE), - TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW) + .glow() + .build() + }; } @Override @@ -331,7 +373,8 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B mNextGenerateTickRate = 20; } aBaseMetaTileEntity.increaseStoredEnergyUnits(tGeneratedEU, true); - aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork() && aBaseMetaTileEntity.getUniversalEnergyStored() >= maxEUOutput() + getMinimumStoredEU()); + aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork() + && aBaseMetaTileEntity.getUniversalEnergyStored() >= maxEUOutput() + getMinimumStoredEU()); } } @@ -355,8 +398,8 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B final double oZ = aBaseMetaTileEntity.getZCoord() + 8D / 16D; final ParticleEventBuilder particleEventBuilder = new ParticleEventBuilder() - .setWorld(getBaseMetaTileEntity().getWorld()) - .setIdentifier(ParticleFX.PORTAL); + .setWorld(getBaseMetaTileEntity().getWorld()) + .setIdentifier(ParticleFX.PORTAL); for (int i = 0; i < 9; i++) { final double dX = (XSTR_INSTANCE.nextFloat() - 0.5D) / 2D; @@ -372,7 +415,10 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B final double mY = -(dXZ * dY) / 4D; final double mZ = dZ * 4D; - particleEventBuilder.setMotion(mX, mY, mZ).setPosition(x, y, z).run(); + particleEventBuilder + .setMotion(mX, mY, mZ) + .setPosition(x, y, z) + .run(); } } } @@ -452,8 +498,9 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B } // Only consume input when it can store EU and push output - if ((getBaseMetaTileEntity().getStoredEU() + tEU) < getBaseMetaTileEntity().getEUCapacity() - && getBaseMetaTileEntity().addStackToSlot(getOutputSlot(), tOutputStack)) { + if ((getBaseMetaTileEntity().getStoredEU() + tEU) + < getBaseMetaTileEntity().getEUCapacity() + && getBaseMetaTileEntity().addStackToSlot(getOutputSlot(), tOutputStack)) { decrStackSize(getInputSlot(), 1); } else { tEU = 0; @@ -470,11 +517,11 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B if (!hasEgg()) return 0; if (!sAllowMultipleEggs) { if (sActiveSiphon != null - && sActiveSiphon != this - && sActiveSiphon.getBaseMetaTileEntity() != null - && !sActiveSiphon.getBaseMetaTileEntity().isInvalidTileEntity() - && sActiveSiphon.isChunkLoaded() - && sActiveSiphon.hasEgg()) { + && sActiveSiphon != this + && sActiveSiphon.getBaseMetaTileEntity() != null + && !sActiveSiphon.getBaseMetaTileEntity().isInvalidTileEntity() + && sActiveSiphon.isChunkLoaded() + && sActiveSiphon.hasEgg()) { getBaseMetaTileEntity().doExplosion(Integer.MAX_VALUE); } else { setActiveSiphon(this); @@ -528,7 +575,8 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B long tEU = 0; - long tEUtoGen = getBaseMetaTileEntity().getEUCapacity() - getBaseMetaTileEntity().getUniversalEnergyStored(); + long tEUtoGen = getBaseMetaTileEntity().getEUCapacity() + - getBaseMetaTileEntity().getUniversalEnergyStored(); List<Aspect> mAvailableEssentiaAspects = mMagicalEnergyBB.getAvailableAspects(); // try to drain 1 of whatever aspect available in containers within RANGE @@ -536,7 +584,11 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B Aspect aspect = mAvailableEssentiaAspects.get(i); long tAspectEU = ((long) sAspectsEnergy.get(aspect) * getEfficiency()) / 100; if (tAspectEU <= tEUtoGen - && AspectSourceHelper.drainEssentia((TileEntity) getBaseMetaTileEntity(), aspect, ForgeDirection.UNKNOWN, mMagicalEnergyBB.getRange())) { + && AspectSourceHelper.drainEssentia( + (TileEntity) getBaseMetaTileEntity(), + aspect, + ForgeDirection.UNKNOWN, + mMagicalEnergyBB.getRange())) { tEUtoGen -= tAspectEU; tEU += tAspectEU; } @@ -657,15 +709,14 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B double tX = tBaseMetaTileEntity.getXCoord(); double tY = tBaseMetaTileEntity.getYCoord(); double tZ = tBaseMetaTileEntity.getZCoord(); - return AxisAlignedBB.getBoundingBox(tX - tRange, tY - tRange, tZ - tRange, - tX + tRange, tY + tRange, tZ + tRange); + return AxisAlignedBB.getBoundingBox( + tX - tRange, tY - tRange, tZ - tRange, tX + tRange, tY + tRange, tZ + tRange); } private void scanLivingCrystals() { World tWorld = mAbsorber.getBaseMetaTileEntity().getWorld(); mLivingCrystalIDs.clear(); - for (Object o : tWorld.getEntitiesWithinAABB(EntityEnderCrystal.class, - getAxisAlignedBB())) { + for (Object o : tWorld.getEntitiesWithinAABB(EntityEnderCrystal.class, getAxisAlignedBB())) { if (((EntityEnderCrystal) o).isEntityAlive()) { mLivingCrystalIDs.add(((EntityEnderCrystal) o).getPersistentID()); } @@ -678,10 +729,10 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B if (tBaseMetaTileEntity.isInvalidTileEntity()) return; int tRange = getRange(); int tY = tBaseMetaTileEntity.getYCoord(); - int tMaxY = tBaseMetaTileEntity.getWorld().getHeight()-1; + int tMaxY = tBaseMetaTileEntity.getWorld().getHeight() - 1; // Make sure relative Y range stays between 0 and world max Y int rYMin = (tY - tRange >= 0) ? -tRange : -(tY); - int rYMax = (((tY + tRange) <= tMaxY)? tRange : tMaxY - tY); + int rYMax = (((tY + tRange) <= tMaxY) ? tRange : tMaxY - tY); mAvailableAspects.clear(); for (int rX = -tRange; rX <= tRange; rX++) { for (int rZ = -tRange; rZ <= tRange; rZ++) { diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_NaquadahReactor.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_NaquadahReactor.java index 0a99a4af05..6ca6da874f 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_NaquadahReactor.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_NaquadahReactor.java @@ -1,5 +1,7 @@ package gregtech.common.tileentities.generators; +import static gregtech.api.enums.Textures.BlockIcons.*; + import gregtech.api.GregTech_API; import gregtech.api.enums.ConfigCategories; import gregtech.api.interfaces.ITexture; @@ -9,13 +11,12 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenera import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Recipe; -import static gregtech.api.enums.Textures.BlockIcons.*; - public class GT_MetaTileEntity_NaquadahReactor extends GT_MetaTileEntity_BasicGenerator { private int mEfficiency; - public GT_MetaTileEntity_NaquadahReactor(int aID, String aName, String[] aDescription, String aNameRegional, int aTier) { + public GT_MetaTileEntity_NaquadahReactor( + int aID, String aName, String[] aDescription, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, aDescription); if (aTier > 8 || aTier < 4) { new Exception("Tier without Recipe Map!").printStackTrace(); @@ -33,7 +34,9 @@ public class GT_MetaTileEntity_NaquadahReactor extends GT_MetaTileEntity_BasicGe @Override public boolean isOutputFacing(byte aSide) { - return (aSide > 1) && (aSide != getBaseMetaTileEntity().getFrontFacing()) && (aSide != getBaseMetaTileEntity().getBackFacing()); + return (aSide > 1) + && (aSide != getBaseMetaTileEntity().getFrontFacing()) + && (aSide != getBaseMetaTileEntity().getBackFacing()); } @Override @@ -69,7 +72,6 @@ public class GT_MetaTileEntity_NaquadahReactor extends GT_MetaTileEntity_BasicGe ret = null; break; } - } return ret; } @@ -89,82 +91,133 @@ public class GT_MetaTileEntity_NaquadahReactor extends GT_MetaTileEntity_BasicGe } public int onConfigLoad() { - return mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "SolidNaquadah.efficiency.tier." + mTier, getBaseEff()); + return mEfficiency = GregTech_API.sMachineFile.get( + ConfigCategories.machineconfig, "SolidNaquadah.efficiency.tier." + mTier, getBaseEff()); } @Override public ITexture[] getFront(byte aColor) { - return new ITexture[]{super.getFront(aColor)[0], TextureFactory.of( - TextureFactory.of(NAQUADAH_REACTOR_SOLID_FRONT), - TextureFactory.builder().addIcon(NAQUADAH_REACTOR_SOLID_FRONT_GLOW).glow().build())}; + return new ITexture[] { + super.getFront(aColor)[0], + TextureFactory.of( + TextureFactory.of(NAQUADAH_REACTOR_SOLID_FRONT), + TextureFactory.builder() + .addIcon(NAQUADAH_REACTOR_SOLID_FRONT_GLOW) + .glow() + .build()) + }; } @Override public ITexture[] getBack(byte aColor) { - return new ITexture[]{super.getBack(aColor)[0], TextureFactory.of( - TextureFactory.of(NAQUADAH_REACTOR_SOLID_BACK), - TextureFactory.builder().addIcon(NAQUADAH_REACTOR_SOLID_BACK_GLOW).glow().build())}; + return new ITexture[] { + super.getBack(aColor)[0], + TextureFactory.of( + TextureFactory.of(NAQUADAH_REACTOR_SOLID_BACK), + TextureFactory.builder() + .addIcon(NAQUADAH_REACTOR_SOLID_BACK_GLOW) + .glow() + .build()) + }; } @Override public ITexture[] getBottom(byte aColor) { - return new ITexture[]{super.getBottom(aColor)[0], TextureFactory.of( - TextureFactory.of(NAQUADAH_REACTOR_SOLID_BOTTOM), - TextureFactory.builder().addIcon(NAQUADAH_REACTOR_SOLID_BOTTOM_GLOW).glow().build())}; + return new ITexture[] { + super.getBottom(aColor)[0], + TextureFactory.of( + TextureFactory.of(NAQUADAH_REACTOR_SOLID_BOTTOM), + TextureFactory.builder() + .addIcon(NAQUADAH_REACTOR_SOLID_BOTTOM_GLOW) + .glow() + .build()) + }; } @Override public ITexture[] getTop(byte aColor) { - return new ITexture[]{super.getTop(aColor)[0], TextureFactory.of( - TextureFactory.of(NAQUADAH_REACTOR_SOLID_TOP), - TextureFactory.builder().addIcon(NAQUADAH_REACTOR_SOLID_TOP_GLOW).glow().build())}; + return new ITexture[] { + super.getTop(aColor)[0], + TextureFactory.of( + TextureFactory.of(NAQUADAH_REACTOR_SOLID_TOP), + TextureFactory.builder() + .addIcon(NAQUADAH_REACTOR_SOLID_TOP_GLOW) + .glow() + .build()) + }; } @Override public ITexture[] getSides(byte aColor) { - return new ITexture[]{super.getSides(aColor)[0], TextureFactory.of( - TextureFactory.of(NAQUADAH_REACTOR_SOLID_SIDE), - TextureFactory.builder().addIcon(NAQUADAH_REACTOR_SOLID_SIDE_GLOW).glow().build())}; + return new ITexture[] { + super.getSides(aColor)[0], + TextureFactory.of( + TextureFactory.of(NAQUADAH_REACTOR_SOLID_SIDE), + TextureFactory.builder() + .addIcon(NAQUADAH_REACTOR_SOLID_SIDE_GLOW) + .glow() + .build()) + }; } @Override public ITexture[] getFrontActive(byte aColor) { - return new ITexture[]{ - super.getFrontActive(aColor)[0], - TextureFactory.of(NAQUADAH_REACTOR_SOLID_FRONT_ACTIVE), - TextureFactory.builder().addIcon(NAQUADAH_REACTOR_SOLID_FRONT_ACTIVE_GLOW).glow().build()}; + return new ITexture[] { + super.getFrontActive(aColor)[0], + TextureFactory.of(NAQUADAH_REACTOR_SOLID_FRONT_ACTIVE), + TextureFactory.builder() + .addIcon(NAQUADAH_REACTOR_SOLID_FRONT_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getBackActive(byte aColor) { - return new ITexture[]{ - super.getBackActive(aColor)[0], - TextureFactory.of(NAQUADAH_REACTOR_SOLID_BACK_ACTIVE), - TextureFactory.builder().addIcon(NAQUADAH_REACTOR_SOLID_BACK_ACTIVE_GLOW).glow().build()}; + return new ITexture[] { + super.getBackActive(aColor)[0], + TextureFactory.of(NAQUADAH_REACTOR_SOLID_BACK_ACTIVE), + TextureFactory.builder() + .addIcon(NAQUADAH_REACTOR_SOLID_BACK_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getBottomActive(byte aColor) { - return new ITexture[]{ - super.getBottomActive(aColor)[0], - TextureFactory.of(NAQUADAH_REACTOR_SOLID_BOTTOM_ACTIVE), - TextureFactory.builder().addIcon(NAQUADAH_REACTOR_SOLID_BOTTOM_ACTIVE_GLOW).glow().build()}; + return new ITexture[] { + super.getBottomActive(aColor)[0], + TextureFactory.of(NAQUADAH_REACTOR_SOLID_BOTTOM_ACTIVE), + TextureFactory.builder() + .addIcon(NAQUADAH_REACTOR_SOLID_BOTTOM_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getTopActive(byte aColor) { - return new ITexture[]{ - super.getTopActive(aColor)[0], - TextureFactory.of(NAQUADAH_REACTOR_SOLID_TOP_ACTIVE), - TextureFactory.builder().addIcon(NAQUADAH_REACTOR_SOLID_TOP_ACTIVE_GLOW).glow().build()}; + return new ITexture[] { + super.getTopActive(aColor)[0], + TextureFactory.of(NAQUADAH_REACTOR_SOLID_TOP_ACTIVE), + TextureFactory.builder() + .addIcon(NAQUADAH_REACTOR_SOLID_TOP_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getSidesActive(byte aColor) { - return new ITexture[]{ - super.getSidesActive(aColor)[0], - TextureFactory.of(NAQUADAH_REACTOR_SOLID_SIDE_ACTIVE), - TextureFactory.builder().addIcon(NAQUADAH_REACTOR_SOLID_SIDE_ACTIVE_GLOW).glow().build()}; + return new ITexture[] { + super.getSidesActive(aColor)[0], + TextureFactory.of(NAQUADAH_REACTOR_SOLID_SIDE_ACTIVE), + TextureFactory.builder() + .addIcon(NAQUADAH_REACTOR_SOLID_SIDE_ACTIVE_GLOW) + .glow() + .build() + }; } @Override diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_PlasmaGenerator.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_PlasmaGenerator.java index 4ab048a0f7..4e0b428fa4 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_PlasmaGenerator.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_PlasmaGenerator.java @@ -1,5 +1,10 @@ package gregtech.common.tileentities.generators; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAYS_ENERGY_OUT; + import gregtech.api.GregTech_API; import gregtech.api.enums.ConfigCategories; import gregtech.api.interfaces.ITexture; @@ -9,11 +14,6 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenera import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Recipe; -import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS; -import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW; -import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAYS_ENERGY_OUT; - public class GT_MetaTileEntity_PlasmaGenerator extends GT_MetaTileEntity_BasicGenerator { public int mEfficiency; @@ -35,71 +35,90 @@ public class GT_MetaTileEntity_PlasmaGenerator extends GT_MetaTileEntity_BasicGe @Override public ITexture[] getFront(byte aColor) { - return new ITexture[]{ - super.getFront(aColor)[0], - TextureFactory.of(MACHINE_CASING_FUSION_GLASS), - OVERLAYS_ENERGY_OUT[mTier]}; + return new ITexture[] { + super.getFront(aColor)[0], TextureFactory.of(MACHINE_CASING_FUSION_GLASS), OVERLAYS_ENERGY_OUT[mTier] + }; } @Override public ITexture[] getBack(byte aColor) { - return new ITexture[]{super.getBack(aColor)[0], TextureFactory.of(MACHINE_CASING_FUSION_GLASS)}; + return new ITexture[] {super.getBack(aColor)[0], TextureFactory.of(MACHINE_CASING_FUSION_GLASS)}; } @Override public ITexture[] getBottom(byte aColor) { - return new ITexture[]{super.getBottom(aColor)[0], TextureFactory.of(MACHINE_CASING_FUSION_GLASS)}; + return new ITexture[] {super.getBottom(aColor)[0], TextureFactory.of(MACHINE_CASING_FUSION_GLASS)}; } @Override public ITexture[] getTop(byte aColor) { - return new ITexture[]{super.getTop(aColor)[0], TextureFactory.of(MACHINE_CASING_FUSION_GLASS)}; + return new ITexture[] {super.getTop(aColor)[0], TextureFactory.of(MACHINE_CASING_FUSION_GLASS)}; } @Override public ITexture[] getSides(byte aColor) { - return new ITexture[]{super.getSides(aColor)[0], TextureFactory.of(MACHINE_CASING_FUSION_GLASS)}; + return new ITexture[] {super.getSides(aColor)[0], TextureFactory.of(MACHINE_CASING_FUSION_GLASS)}; } @Override public ITexture[] getFrontActive(byte aColor) { - return new ITexture[]{ - super.getFrontActive(aColor)[0], - TextureFactory.of(MACHINE_CASING_FUSION_GLASS_YELLOW), - TextureFactory.builder().addIcon(MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW).glow().build(), - OVERLAYS_ENERGY_OUT[mTier]}; + return new ITexture[] { + super.getFrontActive(aColor)[0], + TextureFactory.of(MACHINE_CASING_FUSION_GLASS_YELLOW), + TextureFactory.builder() + .addIcon(MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW) + .glow() + .build(), + OVERLAYS_ENERGY_OUT[mTier] + }; } @Override public ITexture[] getBackActive(byte aColor) { - return new ITexture[]{ - super.getBackActive(aColor)[0], - TextureFactory.of(MACHINE_CASING_FUSION_GLASS_YELLOW), - TextureFactory.builder().addIcon(MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW).glow().build()}; + return new ITexture[] { + super.getBackActive(aColor)[0], + TextureFactory.of(MACHINE_CASING_FUSION_GLASS_YELLOW), + TextureFactory.builder() + .addIcon(MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getBottomActive(byte aColor) { - return new ITexture[]{ - super.getBottomActive(aColor)[0], - TextureFactory.of(MACHINE_CASING_FUSION_GLASS_YELLOW), - TextureFactory.builder().addIcon(MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW).glow().build()}; + return new ITexture[] { + super.getBottomActive(aColor)[0], + TextureFactory.of(MACHINE_CASING_FUSION_GLASS_YELLOW), + TextureFactory.builder() + .addIcon(MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getTopActive(byte aColor) { - return new ITexture[]{ - super.getTopActive(aColor)[0], - TextureFactory.of(MACHINE_CASING_FUSION_GLASS_YELLOW), - TextureFactory.builder().addIcon(MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW).glow().build()}; + return new ITexture[] { + super.getTopActive(aColor)[0], + TextureFactory.of(MACHINE_CASING_FUSION_GLASS_YELLOW), + TextureFactory.builder() + .addIcon(MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getSidesActive(byte aColor) { - return new ITexture[]{ - super.getSidesActive(aColor)[0], - TextureFactory.of(MACHINE_CASING_FUSION_GLASS_YELLOW), - TextureFactory.builder().addIcon(MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW).glow().build()}; + return new ITexture[] { + super.getSidesActive(aColor)[0], + TextureFactory.of(MACHINE_CASING_FUSION_GLASS_YELLOW), + TextureFactory.builder() + .addIcon(MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW) + .glow() + .build() + }; } @Override @@ -128,11 +147,14 @@ public class GT_MetaTileEntity_PlasmaGenerator extends GT_MetaTileEntity_BasicGe } public void onConfigLoad() { - this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "PlasmaGenerator.efficiency.tier." + this.mTier, Math.max(10, 10 + Math.min(90, this.mTier * 10))); + this.mEfficiency = GregTech_API.sMachineFile.get( + ConfigCategories.machineconfig, + "PlasmaGenerator.efficiency.tier." + this.mTier, + Math.max(10, 10 + Math.min(90, this.mTier * 10))); } @Override - public int getPollution() { - return 0; - } + public int getPollution() { + return 0; + } } diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SteamTurbine.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SteamTurbine.java index d7b3f03fde..bec1b90ad1 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SteamTurbine.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SteamTurbine.java @@ -1,5 +1,7 @@ package gregtech.common.tileentities.generators; +import static gregtech.api.enums.Textures.BlockIcons.*; + import gregtech.api.GregTech_API; import gregtech.api.enums.ConfigCategories; import gregtech.api.interfaces.ITexture; @@ -11,16 +13,13 @@ import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Recipe; import net.minecraftforge.fluids.FluidStack; -import static gregtech.api.enums.Textures.BlockIcons.*; - public class GT_MetaTileEntity_SteamTurbine extends GT_MetaTileEntity_BasicGenerator { public int mEfficiency; public GT_MetaTileEntity_SteamTurbine(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, new String[]{ - "Converts Steam into EU", - "Base rate: 2L of Steam -> 1 EU"}); + super(aID, aName, aNameRegional, aTier, new String[] {"Converts Steam into EU", "Base rate: 2L of Steam -> 1 EU" + }); onConfigLoad(); } @@ -54,7 +53,8 @@ public class GT_MetaTileEntity_SteamTurbine extends GT_MetaTileEntity_BasicGener String[] desc = new String[mDescriptionArray.length + 2]; System.arraycopy(mDescriptionArray, 0, desc, 0, mDescriptionArray.length); desc[mDescriptionArray.length] = "Fuel Efficiency: " + (600 / getEfficiency()) + "%"; - desc[mDescriptionArray.length + 1] = String.format("Consumes up to %sL of Steam per second", + desc[mDescriptionArray.length + 1] = String.format( + "Consumes up to %sL of Steam per second", (int) (4000 * (8 * Math.pow(4, mTier) + Math.pow(2, mTier)) / (600 / getEfficiency()))); return desc; } @@ -65,7 +65,8 @@ public class GT_MetaTileEntity_SteamTurbine extends GT_MetaTileEntity_BasicGener } public void onConfigLoad() { - this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "SteamTurbine.efficiency.tier." + this.mTier, 6 + this.mTier); + this.mEfficiency = GregTech_API.sMachineFile.get( + ConfigCategories.machineconfig, "SteamTurbine.efficiency.tier." + this.mTier, 6 + this.mTier); } @Override @@ -86,74 +87,134 @@ public class GT_MetaTileEntity_SteamTurbine extends GT_MetaTileEntity_BasicGener @Override public ITexture[] getFront(byte aColor) { - return new ITexture[]{super.getFront(aColor)[0], TextureFactory.of( - TextureFactory.of(STEAM_TURBINE_FRONT), - TextureFactory.builder().addIcon(STEAM_TURBINE_FRONT_GLOW).glow().build()), - OVERLAYS_ENERGY_OUT[this.mTier]}; + return new ITexture[] { + super.getFront(aColor)[0], + TextureFactory.of( + TextureFactory.of(STEAM_TURBINE_FRONT), + TextureFactory.builder() + .addIcon(STEAM_TURBINE_FRONT_GLOW) + .glow() + .build()), + OVERLAYS_ENERGY_OUT[this.mTier] + }; } @Override public ITexture[] getBack(byte aColor) { - return new ITexture[]{super.getBack(aColor)[0], TextureFactory.of( - TextureFactory.of(STEAM_TURBINE_BACK), - TextureFactory.builder().addIcon(STEAM_TURBINE_BACK_GLOW).glow().build())}; + return new ITexture[] { + super.getBack(aColor)[0], + TextureFactory.of( + TextureFactory.of(STEAM_TURBINE_BACK), + TextureFactory.builder() + .addIcon(STEAM_TURBINE_BACK_GLOW) + .glow() + .build()) + }; } @Override public ITexture[] getBottom(byte aColor) { - return new ITexture[]{super.getBottom(aColor)[0], TextureFactory.of( - TextureFactory.of(STEAM_TURBINE_BOTTOM), - TextureFactory.builder().addIcon(STEAM_TURBINE_BOTTOM_GLOW).glow().build())}; + return new ITexture[] { + super.getBottom(aColor)[0], + TextureFactory.of( + TextureFactory.of(STEAM_TURBINE_BOTTOM), + TextureFactory.builder() + .addIcon(STEAM_TURBINE_BOTTOM_GLOW) + .glow() + .build()) + }; } @Override public ITexture[] getTop(byte aColor) { - return new ITexture[]{super.getTop(aColor)[0], TextureFactory.of( - TextureFactory.of(STEAM_TURBINE_TOP), - TextureFactory.builder().addIcon(STEAM_TURBINE_TOP_GLOW).glow().build())}; + return new ITexture[] { + super.getTop(aColor)[0], + TextureFactory.of( + TextureFactory.of(STEAM_TURBINE_TOP), + TextureFactory.builder() + .addIcon(STEAM_TURBINE_TOP_GLOW) + .glow() + .build()) + }; } @Override public ITexture[] getSides(byte aColor) { - return new ITexture[]{super.getSides(aColor)[0], TextureFactory.of( - TextureFactory.of(STEAM_TURBINE_SIDE), - TextureFactory.builder().addIcon(STEAM_TURBINE_SIDE_GLOW).glow().build())}; + return new ITexture[] { + super.getSides(aColor)[0], + TextureFactory.of( + TextureFactory.of(STEAM_TURBINE_SIDE), + TextureFactory.builder() + .addIcon(STEAM_TURBINE_SIDE_GLOW) + .glow() + .build()) + }; } @Override public ITexture[] getFrontActive(byte aColor) { - return new ITexture[]{super.getFrontActive(aColor)[0], TextureFactory.of( - TextureFactory.of(STEAM_TURBINE_FRONT_ACTIVE), - TextureFactory.builder().addIcon(STEAM_TURBINE_FRONT_ACTIVE_GLOW).glow().build()), - OVERLAYS_ENERGY_OUT[this.mTier]}; + return new ITexture[] { + super.getFrontActive(aColor)[0], + TextureFactory.of( + TextureFactory.of(STEAM_TURBINE_FRONT_ACTIVE), + TextureFactory.builder() + .addIcon(STEAM_TURBINE_FRONT_ACTIVE_GLOW) + .glow() + .build()), + OVERLAYS_ENERGY_OUT[this.mTier] + }; } @Override public ITexture[] getBackActive(byte aColor) { - return new ITexture[]{super.getBackActive(aColor)[0], TextureFactory.of( - TextureFactory.of(STEAM_TURBINE_BACK_ACTIVE), - TextureFactory.builder().addIcon(STEAM_TURBINE_BACK_ACTIVE_GLOW).glow().build())}; + return new ITexture[] { + super.getBackActive(aColor)[0], + TextureFactory.of( + TextureFactory.of(STEAM_TURBINE_BACK_ACTIVE), + TextureFactory.builder() + .addIcon(STEAM_TURBINE_BACK_ACTIVE_GLOW) + .glow() + .build()) + }; } @Override public ITexture[] getBottomActive(byte aColor) { - return new ITexture[]{super.getBottomActive(aColor)[0], TextureFactory.of( - TextureFactory.of(STEAM_TURBINE_BOTTOM_ACTIVE), - TextureFactory.builder().addIcon(STEAM_TURBINE_BOTTOM_ACTIVE_GLOW).glow().build())}; + return new ITexture[] { + super.getBottomActive(aColor)[0], + TextureFactory.of( + TextureFactory.of(STEAM_TURBINE_BOTTOM_ACTIVE), + TextureFactory.builder() + .addIcon(STEAM_TURBINE_BOTTOM_ACTIVE_GLOW) + .glow() + .build()) + }; } @Override public ITexture[] getTopActive(byte aColor) { - return new ITexture[]{super.getTopActive(aColor)[0], TextureFactory.of( - TextureFactory.of(STEAM_TURBINE_TOP_ACTIVE), - TextureFactory.builder().addIcon(STEAM_TURBINE_TOP_ACTIVE_GLOW).glow().build())}; + return new ITexture[] { + super.getTopActive(aColor)[0], + TextureFactory.of( + TextureFactory.of(STEAM_TURBINE_TOP_ACTIVE), + TextureFactory.builder() + .addIcon(STEAM_TURBINE_TOP_ACTIVE_GLOW) + .glow() + .build()) + }; } @Override public ITexture[] getSidesActive(byte aColor) { - return new ITexture[]{super.getSidesActive(aColor)[0], TextureFactory.of( - TextureFactory.of(STEAM_TURBINE_SIDE_ACTIVE), - TextureFactory.builder().addIcon(STEAM_TURBINE_SIDE_ACTIVE_GLOW).glow().build())}; + return new ITexture[] { + super.getSidesActive(aColor)[0], + TextureFactory.of( + TextureFactory.of(STEAM_TURBINE_SIDE_ACTIVE), + TextureFactory.builder() + .addIcon(STEAM_TURBINE_SIDE_ACTIVE_GLOW) + .glow() + .build()) + }; } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Bronze.java index c62145be13..b3da47ae89 100644 --- a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Bronze.java +++ b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Bronze.java @@ -9,7 +9,8 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicHull_N import gregtech.api.render.TextureFactory; public class GT_MetaTileEntity_BasicHull_Bronze extends GT_MetaTileEntity_BasicHull_NonElectric { - public GT_MetaTileEntity_BasicHull_Bronze(int aID, String aName, String aNameRegional, int aTier, String aDescription) { + public GT_MetaTileEntity_BasicHull_Bronze( + int aID, String aName, String aNameRegional, int aTier, String aDescription) { super(aID, aName, aNameRegional, aTier, aDescription); } @@ -17,7 +18,8 @@ public class GT_MetaTileEntity_BasicHull_Bronze extends GT_MetaTileEntity_BasicH super(aName, aTier, aDescription, aTextures); } - public GT_MetaTileEntity_BasicHull_Bronze(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_BasicHull_Bronze( + String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } @@ -30,9 +32,15 @@ public class GT_MetaTileEntity_BasicHull_Bronze extends GT_MetaTileEntity_BasicH public ITexture[][][] getTextureSet(ITexture[] aTextures) { ITexture[][][] rTextures = new ITexture[3][17][]; for (byte i = -1; i < 16; i = (byte) (i + 1)) { - rTextures[0][(i + 1)] = new ITexture[]{TextureFactory.of(Textures.BlockIcons.MACHINE_BRONZE_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa))}; - rTextures[1][(i + 1)] = new ITexture[]{TextureFactory.of(Textures.BlockIcons.MACHINE_BRONZE_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa))}; - rTextures[2][(i + 1)] = new ITexture[]{TextureFactory.of(Textures.BlockIcons.MACHINE_BRONZE_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa))}; + rTextures[0][(i + 1)] = new ITexture[] { + TextureFactory.of(Textures.BlockIcons.MACHINE_BRONZE_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa)) + }; + rTextures[1][(i + 1)] = new ITexture[] { + TextureFactory.of(Textures.BlockIcons.MACHINE_BRONZE_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa)) + }; + rTextures[2][(i + 1)] = new ITexture[] { + TextureFactory.of(Textures.BlockIcons.MACHINE_BRONZE_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)) + }; } return rTextures; } diff --git a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_BronzeBricks.java b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_BronzeBricks.java index 90ec54b1fa..0589f8f236 100644 --- a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_BronzeBricks.java +++ b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_BronzeBricks.java @@ -9,32 +9,44 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicHull_N import gregtech.api.render.TextureFactory; public class GT_MetaTileEntity_BasicHull_BronzeBricks extends GT_MetaTileEntity_BasicHull_NonElectric { - public GT_MetaTileEntity_BasicHull_BronzeBricks(int aID, String aName, String aNameRegional, int aTier, String aDescription) { + public GT_MetaTileEntity_BasicHull_BronzeBricks( + int aID, String aName, String aNameRegional, int aTier, String aDescription) { super(aID, aName, aNameRegional, aTier, aDescription); } - public GT_MetaTileEntity_BasicHull_BronzeBricks(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_BasicHull_BronzeBricks( + String aName, int aTier, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } - public GT_MetaTileEntity_BasicHull_BronzeBricks(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_BasicHull_BronzeBricks( + String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_BasicHull_BronzeBricks(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); + return new GT_MetaTileEntity_BasicHull_BronzeBricks( + this.mName, this.mTier, this.mDescriptionArray, this.mTextures); } @Override public ITexture[][][] getTextureSet(ITexture[] aTextures) { ITexture[][][] rTextures = new ITexture[3][17][]; for (byte i = -1; i < 16; i = (byte) (i + 1)) { - ITexture[] tmp0 = {TextureFactory.of(Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa))}; + ITexture[] tmp0 = { + TextureFactory.of( + Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa)) + }; rTextures[0][(i + 1)] = tmp0; - ITexture[] tmp1 = {TextureFactory.of(Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa))}; + ITexture[] tmp1 = { + TextureFactory.of(Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa)) + }; rTextures[1][(i + 1)] = tmp1; - ITexture[] tmp2 = {TextureFactory.of(Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa))}; + ITexture[] tmp2 = { + TextureFactory.of( + Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)) + }; rTextures[2][(i + 1)] = tmp2; } return rTextures; diff --git a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Steel.java b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Steel.java index 24c3f589e8..d8d8cfed63 100644 --- a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Steel.java +++ b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Steel.java @@ -8,7 +8,9 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicHull_NonElectric; import gregtech.api.render.TextureFactory; -public class GT_MetaTileEntity_BasicHull_Steel extends GT_MetaTileEntity_BasicHull_NonElectric { public GT_MetaTileEntity_BasicHull_Steel(int aID, String aName, String aNameRegional, int aTier, String aDescription) { +public class GT_MetaTileEntity_BasicHull_Steel extends GT_MetaTileEntity_BasicHull_NonElectric { + public GT_MetaTileEntity_BasicHull_Steel( + int aID, String aName, String aNameRegional, int aTier, String aDescription) { super(aID, aName, aNameRegional, aTier, aDescription); } @@ -29,11 +31,17 @@ public class GT_MetaTileEntity_BasicHull_Steel extends GT_MetaTileEntity_BasicHu public ITexture[][][] getTextureSet(ITexture[] aTextures) { ITexture[][][] rTextures = new ITexture[3][17][]; for (byte i = -1; i < 16; i = (byte) (i + 1)) { - ITexture[] tmp0 = {TextureFactory.of(Textures.BlockIcons.MACHINE_STEEL_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa))}; + ITexture[] tmp0 = { + TextureFactory.of(Textures.BlockIcons.MACHINE_STEEL_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa)) + }; rTextures[0][(i + 1)] = tmp0; - ITexture[] tmp1 = {TextureFactory.of(Textures.BlockIcons.MACHINE_STEEL_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa))}; + ITexture[] tmp1 = { + TextureFactory.of(Textures.BlockIcons.MACHINE_STEEL_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa)) + }; rTextures[1][(i + 1)] = tmp1; - ITexture[] tmp2 = {TextureFactory.of(Textures.BlockIcons.MACHINE_STEEL_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa))}; + ITexture[] tmp2 = { + TextureFactory.of(Textures.BlockIcons.MACHINE_STEEL_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)) + }; rTextures[2][(i + 1)] = tmp2; } return rTextures; diff --git a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_SteelBricks.java b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_SteelBricks.java index 57ef19478e..2a0827e278 100644 --- a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_SteelBricks.java +++ b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_SteelBricks.java @@ -9,32 +9,43 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicHull_N import gregtech.api.render.TextureFactory; public class GT_MetaTileEntity_BasicHull_SteelBricks extends GT_MetaTileEntity_BasicHull_NonElectric { - public GT_MetaTileEntity_BasicHull_SteelBricks(int aID, String aName, String aNameRegional, int aTier, String aDescription) { + public GT_MetaTileEntity_BasicHull_SteelBricks( + int aID, String aName, String aNameRegional, int aTier, String aDescription) { super(aID, aName, aNameRegional, aTier, aDescription); } - public GT_MetaTileEntity_BasicHull_SteelBricks(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_BasicHull_SteelBricks( + String aName, int aTier, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } - public GT_MetaTileEntity_BasicHull_SteelBricks(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_BasicHull_SteelBricks( + String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_BasicHull_SteelBricks(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); + return new GT_MetaTileEntity_BasicHull_SteelBricks( + this.mName, this.mTier, this.mDescriptionArray, this.mTextures); } @Override public ITexture[][][] getTextureSet(ITexture[] aTextures) { ITexture[][][] rTextures = new ITexture[3][17][]; for (byte i = -1; i < 16; i = (byte) (i + 1)) { - ITexture[] tmp0 = {TextureFactory.of(Textures.BlockIcons.MACHINE_STEELBRICKS_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa))}; + ITexture[] tmp0 = { + TextureFactory.of( + Textures.BlockIcons.MACHINE_STEELBRICKS_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa)) + }; rTextures[0][(i + 1)] = tmp0; - ITexture[] tmp1 = {TextureFactory.of(Textures.BlockIcons.MACHINE_STEELBRICKS_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa))}; + ITexture[] tmp1 = { + TextureFactory.of(Textures.BlockIcons.MACHINE_STEELBRICKS_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa)) + }; rTextures[1][(i + 1)] = tmp1; - ITexture[] tmp2 = {TextureFactory.of(Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa))}; + ITexture[] tmp2 = { + TextureFactory.of(Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)) + }; rTextures[2][(i + 1)] = tmp2; } return rTextures; diff --git a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_InputBus_ME.java b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_InputBus_ME.java index ec747a79f3..1ae3381662 100644 --- a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_InputBus_ME.java +++ b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_InputBus_ME.java @@ -1,11 +1,7 @@ package gregtech.common.tileentities.machines; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.EnumChatFormatting; -import net.minecraftforge.common.util.ForgeDirection; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_ME_INPUT_HATCH; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_ME_INPUT_HATCH_ACTIVE; import appeng.api.config.Actionable; import appeng.api.config.PowerMultiplier; @@ -31,27 +27,31 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input import gregtech.api.render.TextureFactory; import gregtech.common.gui.GT_Container_InputBus_ME; import gregtech.common.gui.GT_GUIContainer_InputBus_ME; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; +import net.minecraftforge.common.util.ForgeDirection; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_ME_INPUT_HATCH; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_ME_INPUT_HATCH_ACTIVE; - -public class GT_MetaTileEntity_Hatch_InputBus_ME extends GT_MetaTileEntity_Hatch_InputBus implements IConfigurationCircuitSupport { +public class GT_MetaTileEntity_Hatch_InputBus_ME extends GT_MetaTileEntity_Hatch_InputBus + implements IConfigurationCircuitSupport { private static final int SLOT_COUNT = 16; private BaseActionSource requestSource = null; private AENetworkProxy gridProxy = null; private final ItemStack[] shadowInventory = new ItemStack[SLOT_COUNT]; private final int[] savedStackSizes = new int[SLOT_COUNT]; private boolean processingRecipe = false; + public GT_MetaTileEntity_Hatch_InputBus_ME(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, 1, SLOT_COUNT * 2 + 1, new String[] { - "Advanced item input for Multiblocks", - "Retrieves directly from ME", - "Keeps 16 item types in stock" + "Advanced item input for Multiblocks", "Retrieves directly from ME", "Keeps 16 item types in stock" }); disableSort = true; } - public GT_MetaTileEntity_Hatch_InputBus_ME(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_Hatch_InputBus_ME( + String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, SLOT_COUNT * 2 + 1, aDescription, aTextures); disableSort = true; } @@ -93,16 +93,18 @@ public class GT_MetaTileEntity_Hatch_InputBus_ME extends GT_MetaTileEntity_Hatch return isOutputFacing((byte) forgeDirection.ordinal()) ? AECableType.SMART : AECableType.NONE; } - @Override @Optional.Method(modid = "appliedenergistics2") public AENetworkProxy getProxy() { if (gridProxy == null) { if (getBaseMetaTileEntity() instanceof IGridProxyable) { - gridProxy = new AENetworkProxy((IGridProxyable) getBaseMetaTileEntity(), "proxy", ItemList.Hatch_Output_Bus_ME.get(1), true); + gridProxy = new AENetworkProxy( + (IGridProxyable) getBaseMetaTileEntity(), "proxy", ItemList.Hatch_Output_Bus_ME.get(1), true); gridProxy.setFlags(GridFlags.REQUIRE_CHANNEL); if (getBaseMetaTileEntity().getWorld() != null) - gridProxy.setOwner(getBaseMetaTileEntity().getWorld().getPlayerEntityByName(getBaseMetaTileEntity().getOwnerName())); + gridProxy.setOwner(getBaseMetaTileEntity() + .getWorld() + .getPlayerEntityByName(getBaseMetaTileEntity().getOwnerName())); } } return this.gridProxy; @@ -110,16 +112,13 @@ public class GT_MetaTileEntity_Hatch_InputBus_ME extends GT_MetaTileEntity_Hatch @Override @Optional.Method(modid = "appliedenergistics2") - public void gridChanged() { - } + public void gridChanged() {} @Override - public void saveNBTData(NBTTagCompound aNBT) - { + public void saveNBTData(NBTTagCompound aNBT) { super.saveNBTData(aNBT); int[] sizes = new int[16]; - for (int i = 0; i < 16; ++i) - sizes[i] = mInventory[i + 16] == null ? 0 : mInventory[i + 16].stackSize; + for (int i = 0; i < 16; ++i) sizes[i] = mInventory[i + 16] == null ? 0 : mInventory[i + 16].stackSize; aNBT.setIntArray("sizes", sizes); if (GregTech_API.mAE2) { gridProxy.writeToNBT(aNBT); @@ -155,14 +154,15 @@ public class GT_MetaTileEntity_Hatch_InputBus_ME extends GT_MetaTileEntity_Hatch public String[] getInfoData() { if (GregTech_API.mAE2) { return new String[] { - "The bus is " + ((getProxy() != null && getProxy().isActive()) ? - EnumChatFormatting.GREEN + "online" : EnumChatFormatting.RED + "offline" + getAEDiagnostics()) - + EnumChatFormatting.RESET}; - } - else - return new String[] {}; + "The bus is " + + ((getProxy() != null && getProxy().isActive()) + ? EnumChatFormatting.GREEN + "online" + : EnumChatFormatting.RED + "offline" + getAEDiagnostics()) + + EnumChatFormatting.RESET + }; + } else return new String[] {}; } - + @Override public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { return false; @@ -174,15 +174,15 @@ public class GT_MetaTileEntity_Hatch_InputBus_ME extends GT_MetaTileEntity_Hatch } @Override - public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { - } + public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {} @Override - public void updateSlots() { - } + public void updateSlots() {} @Override - public int getCircuitSlot() { return SLOT_COUNT * 2; } + public int getCircuitSlot() { + return SLOT_COUNT * 2; + } @Override public int getCircuitSlotX() { @@ -196,15 +196,12 @@ public class GT_MetaTileEntity_Hatch_InputBus_ME extends GT_MetaTileEntity_Hatch @Override public ItemStack getStackInSlot(int aIndex) { - if (!processingRecipe) - return super.getStackInSlot(aIndex); - if (aIndex < 0 || aIndex > mInventory.length) - return null; + if (!processingRecipe) return super.getStackInSlot(aIndex); + if (aIndex < 0 || aIndex > mInventory.length) return null; if (aIndex >= SLOT_COUNT && aIndex < SLOT_COUNT * 2) - //Display slots + // Display slots return null; - if (aIndex == getCircuitSlot()) - return mInventory[aIndex]; + if (aIndex == getCircuitSlot()) return mInventory[aIndex]; if (GregTech_API.mAE2 && mInventory[aIndex] != null) { AENetworkProxy proxy = getProxy(); if (proxy == null) { @@ -221,17 +218,15 @@ public class GT_MetaTileEntity_Hatch_InputBus_ME extends GT_MetaTileEntity_Hatch this.setInventorySlotContents(aIndex + SLOT_COUNT, this.shadowInventory[aIndex]); return this.shadowInventory[aIndex]; } else { - //Request failed + // Request failed this.setInventorySlotContents(aIndex + SLOT_COUNT, null); return null; } - } - catch( final GridAccessException ignored ) - { + } catch (final GridAccessException ignored) { } return null; } else { - //AE available but no items requested + // AE available but no items requested this.setInventorySlotContents(aIndex + SLOT_COUNT, null); } return mInventory[aIndex]; @@ -239,8 +234,7 @@ public class GT_MetaTileEntity_Hatch_InputBus_ME extends GT_MetaTileEntity_Hatch @Optional.Method(modid = "appliedenergistics2") private BaseActionSource getRequestSource() { - if (requestSource == null) - requestSource = new MachineSource((IActionHost)getBaseMetaTileEntity()); + if (requestSource == null) requestSource = new MachineSource((IActionHost) getBaseMetaTileEntity()); return requestSource; } @@ -267,10 +261,11 @@ public class GT_MetaTileEntity_Hatch_InputBus_ME extends GT_MetaTileEntity_Hatch IAEItemStack request = AEItemStack.create(mInventory[i]); request.setStackSize(savedStackSizes[i] - (oldStack == null ? 0 : oldStack.stackSize)); sg.extractItems(request, Actionable.MODULATE, getRequestSource()); - proxy.getEnergy().extractAEPower(request.getStackSize(), Actionable.MODULATE, PowerMultiplier.CONFIG); + proxy.getEnergy() + .extractAEPower( + request.getStackSize(), Actionable.MODULATE, PowerMultiplier.CONFIG); setInventorySlotContents(i + SLOT_COUNT, oldStack); - } - catch (final GridAccessException ignored) { + } catch (final GridAccessException ignored) { } } savedStackSizes[i] = 0; @@ -285,8 +280,7 @@ public class GT_MetaTileEntity_Hatch_InputBus_ME extends GT_MetaTileEntity_Hatch if (GregTech_API.mAE2 && aIndex >= 0 && aIndex < SLOT_COUNT) { if (aStack == null) { super.setInventorySlotContents(aIndex + SLOT_COUNT, null); - } - else { + } else { AENetworkProxy proxy = getProxy(); if (!proxy.isActive()) { super.setInventorySlotContents(aIndex + SLOT_COUNT, null); @@ -300,8 +294,7 @@ public class GT_MetaTileEntity_Hatch_InputBus_ME extends GT_MetaTileEntity_Hatch ItemStack s = (result != null) ? result.getItemStack() : null; setInventorySlotContents(aIndex + SLOT_COUNT, s); return s; - } - catch (final GridAccessException ignored) { + } catch (final GridAccessException ignored) { } } } diff --git a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_OutputBus_ME.java b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_OutputBus_ME.java index 4389156191..21b4aabe3a 100644 --- a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_OutputBus_ME.java +++ b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_OutputBus_ME.java @@ -1,7 +1,7 @@ package gregtech.common.tileentities.machines; -import java.util.ArrayList; -import java.util.List; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_ME_HATCH; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_ME_HATCH_ACTIVE; import appeng.api.AEApi; import appeng.api.networking.GridFlags; @@ -28,6 +28,8 @@ import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBus; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Utility; +import java.util.ArrayList; +import java.util.List; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTBase; @@ -37,27 +39,32 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_ME_HATCH; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_ME_HATCH_ACTIVE; - public class GT_MetaTileEntity_Hatch_OutputBus_ME extends GT_MetaTileEntity_Hatch_OutputBus { private BaseActionSource requestSource = null; private AENetworkProxy gridProxy = null; - IItemList<IAEItemStack> itemCache = GregTech_API.mAE2 ? AEApi.instance().storage().createItemList() : null; + IItemList<IAEItemStack> itemCache = + GregTech_API.mAE2 ? AEApi.instance().storage().createItemList() : null; long lastOutputTick = 0; long tickCounter = 0; boolean lastOutputFailed = false; boolean infiniteCache = true; public GT_MetaTileEntity_Hatch_OutputBus_ME(int aID, String aName, String aNameRegional) { - super(aID, aName, aNameRegional, 1, new String[]{ - "Item Output for Multiblocks", "Stores directly into ME", - "To use in GT++ multiblocks", " turn off overflow control", - " with a soldering iron." - }, 0); + super( + aID, + aName, + aNameRegional, + 1, + new String[] { + "Item Output for Multiblocks", "Stores directly into ME", + "To use in GT++ multiblocks", " turn off overflow control", + " with a soldering iron." + }, + 0); } - public GT_MetaTileEntity_Hatch_OutputBus_ME(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_Hatch_OutputBus_ME( + String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, 0, aDescription, aTextures); } @@ -68,12 +75,12 @@ public class GT_MetaTileEntity_Hatch_OutputBus_ME extends GT_MetaTileEntity_Hatc @Override public ITexture[] getTexturesActive(ITexture aBaseTexture) { - return new ITexture[]{aBaseTexture, TextureFactory.of(OVERLAY_ME_HATCH_ACTIVE)}; + return new ITexture[] {aBaseTexture, TextureFactory.of(OVERLAY_ME_HATCH_ACTIVE)}; } @Override public ITexture[] getTexturesInactive(ITexture aBaseTexture) { - return new ITexture[]{aBaseTexture, TextureFactory.of(OVERLAY_ME_HATCH)}; + return new ITexture[] {aBaseTexture, TextureFactory.of(OVERLAY_ME_HATCH)}; } @Override @@ -84,8 +91,7 @@ public class GT_MetaTileEntity_Hatch_OutputBus_ME extends GT_MetaTileEntity_Hatc @Override public boolean storeAll(ItemStack aStack) { - if (!GregTech_API.mAE2) - return false; + if (!GregTech_API.mAE2) return false; aStack.stackSize = store(aStack); return aStack.stackSize == 0; } @@ -98,23 +104,21 @@ public class GT_MetaTileEntity_Hatch_OutputBus_ME extends GT_MetaTileEntity_Hatc */ @Optional.Method(modid = "appliedenergistics2") public int store(final ItemStack stack) { - if (!infiniteCache && lastOutputFailed) - return stack.stackSize; + if (!infiniteCache && lastOutputFailed) return stack.stackSize; itemCache.add(AEApi.instance().storage().createItemStack(stack)); return 0; } @Optional.Method(modid = "appliedenergistics2") private BaseActionSource getRequest() { - if (requestSource == null) - requestSource = new MachineSource((IActionHost)getBaseMetaTileEntity()); + if (requestSource == null) requestSource = new MachineSource((IActionHost) getBaseMetaTileEntity()); return requestSource; } @Override @Optional.Method(modid = "appliedenergistics2") public AECableType getCableConnectionType(ForgeDirection forgeDirection) { - return isOutputFacing((byte)forgeDirection.ordinal()) ? AECableType.SMART : AECableType.NONE; + return isOutputFacing((byte) forgeDirection.ordinal()) ? AECableType.SMART : AECableType.NONE; } @Override @@ -124,10 +128,16 @@ public class GT_MetaTileEntity_Hatch_OutputBus_ME extends GT_MetaTileEntity_Hatc @Override public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { - if (!getBaseMetaTileEntity().getCoverBehaviorAtSideNew(aSide).isGUIClickable(aSide, getBaseMetaTileEntity().getCoverIDAtSide(aSide), getBaseMetaTileEntity().getComplexCoverDataAtSide(aSide), getBaseMetaTileEntity())) - return; + if (!getBaseMetaTileEntity() + .getCoverBehaviorAtSideNew(aSide) + .isGUIClickable( + aSide, + getBaseMetaTileEntity().getCoverIDAtSide(aSide), + getBaseMetaTileEntity().getComplexCoverDataAtSide(aSide), + getBaseMetaTileEntity())) return; infiniteCache = !infiniteCache; - GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("GT5U.hatch.infiniteCache." + infiniteCache)); + GT_Utility.sendChatToPlayer( + aPlayer, StatCollector.translateToLocal("GT5U.hatch.infiniteCache." + infiniteCache)); } @Override @@ -135,24 +145,24 @@ public class GT_MetaTileEntity_Hatch_OutputBus_ME extends GT_MetaTileEntity_Hatc public AENetworkProxy getProxy() { if (gridProxy == null) { if (getBaseMetaTileEntity() instanceof IGridProxyable) { - gridProxy = new AENetworkProxy((IGridProxyable)getBaseMetaTileEntity(), "proxy", ItemList.Hatch_Output_Bus_ME.get(1), true); + gridProxy = new AENetworkProxy( + (IGridProxyable) getBaseMetaTileEntity(), "proxy", ItemList.Hatch_Output_Bus_ME.get(1), true); gridProxy.setFlags(GridFlags.REQUIRE_CHANNEL); if (getBaseMetaTileEntity().getWorld() != null) - gridProxy.setOwner(getBaseMetaTileEntity().getWorld().getPlayerEntityByName(getBaseMetaTileEntity().getOwnerName())); + gridProxy.setOwner(getBaseMetaTileEntity() + .getWorld() + .getPlayerEntityByName(getBaseMetaTileEntity().getOwnerName())); } - } return this.gridProxy; } @Override @Optional.Method(modid = "appliedenergistics2") - public void gridChanged() { - } + public void gridChanged() {} @Optional.Method(modid = "appliedenergistics2") - private void flushCachedStack() - { + private void flushCachedStack() { lastOutputFailed = false; AENetworkProxy proxy = getProxy(); if (proxy == null) { @@ -161,9 +171,8 @@ public class GT_MetaTileEntity_Hatch_OutputBus_ME extends GT_MetaTileEntity_Hatc } try { IMEMonitor<IAEItemStack> sg = proxy.getStorage().getItemInventory(); - for (IAEItemStack s: itemCache) { - if (s.getStackSize() == 0) - continue; + for (IAEItemStack s : itemCache) { + if (s.getStackSize() == 0) continue; IAEItemStack rest = Platform.poweredInsert(proxy.getEnergy(), sg, s, getRequest()); if (rest != null && rest.getStackSize() > 0) { lastOutputFailed = true; @@ -172,9 +181,7 @@ public class GT_MetaTileEntity_Hatch_OutputBus_ME extends GT_MetaTileEntity_Hatc } s.setStackSize(0); } - } - catch( final GridAccessException ignored ) - { + } catch (final GridAccessException ignored) { lastOutputFailed = true; } lastOutputTick = tickCounter; @@ -184,22 +191,19 @@ public class GT_MetaTileEntity_Hatch_OutputBus_ME extends GT_MetaTileEntity_Hatc public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (GT_Values.GT.isServerSide()) { tickCounter = aTick; - if (tickCounter > (lastOutputTick + 40)) - flushCachedStack(); + if (tickCounter > (lastOutputTick + 40)) flushCachedStack(); } super.onPostTick(aBaseMetaTileEntity, aTick); } @Override - public void saveNBTData(NBTTagCompound aNBT) - { + public void saveNBTData(NBTTagCompound aNBT) { super.saveNBTData(aNBT); if (GregTech_API.mAE2) { NBTTagList items = new NBTTagList(); - for (IAEItemStack s: itemCache) { - if (s.getStackSize() == 0) - continue; + for (IAEItemStack s : itemCache) { + if (s.getStackSize() == 0) continue; NBTTagCompound tag = new NBTTagCompound(); NBTTagCompound tagItemStack = new NBTTagCompound(); s.getItemStack().writeToNBT(tagItemStack); @@ -222,15 +226,17 @@ public class GT_MetaTileEntity_Hatch_OutputBus_ME extends GT_MetaTileEntity_Hatc itemCache.add(AEApi.instance().storage().createItemStack(GT_Utility.loadItem((NBTTagCompound) t))); t = aNBT.getTag("cachedItems"); if (t instanceof NBTTagList) { - NBTTagList l = (NBTTagList)t; + NBTTagList l = (NBTTagList) t; for (int i = 0; i < l.tagCount(); ++i) { NBTTagCompound tag = l.getCompoundTagAt(i); if (!tag.hasKey("itemStack")) { // legacy #868 - itemCache.add(AEApi.instance().storage().createItemStack(GT_Utility.loadItem(l.getCompoundTagAt(i)))); + itemCache.add( + AEApi.instance().storage().createItemStack(GT_Utility.loadItem(l.getCompoundTagAt(i)))); continue; } NBTTagCompound tagItemStack = tag.getCompoundTag("itemStack"); - final IAEItemStack s = AEApi.instance().storage().createItemStack(GT_Utility.loadItem(tagItemStack)); + final IAEItemStack s = + AEApi.instance().storage().createItemStack(GT_Utility.loadItem(tagItemStack)); s.setStackSize(tag.getLong("size")); itemCache.add(s); } @@ -250,22 +256,22 @@ public class GT_MetaTileEntity_Hatch_OutputBus_ME extends GT_MetaTileEntity_Hatc @Override public String[] getInfoData() { - if (!GregTech_API.mAE2) - return new String[]{}; + if (!GregTech_API.mAE2) return new String[] {}; List<String> ss = new ArrayList<>(); - ss.add("The bus is " + ((getProxy() != null && getProxy().isActive())? - EnumChatFormatting.GREEN + "online" : EnumChatFormatting.RED + "offline" - + getAEDiagnostics() ) + EnumChatFormatting.RESET); + ss.add("The bus is " + + ((getProxy() != null && getProxy().isActive()) + ? EnumChatFormatting.GREEN + "online" + : EnumChatFormatting.RED + "offline" + getAEDiagnostics()) + + EnumChatFormatting.RESET); if (itemCache.isEmpty()) { ss.add("The bus has no cached items"); - } - else { + } else { IWideReadableNumberConverter nc = ReadableNumberConverter.INSTANCE; ss.add(String.format("The bus contains %d cached stacks: ", itemCache.size())); int counter = 0; for (IAEItemStack s : itemCache) { - ss.add(s.getItem().getItemStackDisplayName(s.getItemStack()) + ": " + - EnumChatFormatting.GOLD + nc.toWideReadableForm(s.getStackSize()) + EnumChatFormatting.RESET); + ss.add(s.getItem().getItemStackDisplayName(s.getItemStack()) + ": " + EnumChatFormatting.GOLD + + nc.toWideReadableForm(s.getStackSize()) + EnumChatFormatting.RESET); if (++counter > 100) break; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_AdvSeismicProspector.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_AdvSeismicProspector.java index 10bfd92f37..ee2ddcdfed 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_AdvSeismicProspector.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_AdvSeismicProspector.java @@ -1,5 +1,8 @@ package gregtech.common.tileentities.machines.basic; +import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.common.GT_UndergroundOil.undergroundOilReadInformation; + import gregtech.api.GregTech_API; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; @@ -14,6 +17,10 @@ import gregtech.api.util.GT_Utility; import gregtech.common.blocks.GT_Block_Ores_Abstract; import gregtech.common.blocks.GT_TileEntity_Ores; import ic2.core.Ic2Items; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; @@ -24,15 +31,6 @@ import net.minecraft.world.ChunkCoordIntPair; import net.minecraft.world.chunk.Chunk; import net.minecraftforge.fluids.FluidStack; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.Map; - -import static gregtech.api.enums.Textures.BlockIcons.*; -import static gregtech.common.GT_UndergroundOil.undergroundOilReadInformation; - - public class GT_MetaTileEntity_AdvSeismicProspector extends GT_MetaTileEntity_BasicMachine { boolean ready = false; int radius; @@ -40,60 +38,91 @@ public class GT_MetaTileEntity_AdvSeismicProspector extends GT_MetaTileEntity_Ba int cX; int cZ; - public GT_MetaTileEntity_AdvSeismicProspector(int aID, String aName, String aNameRegional, int aTier, int aRadius, int aStep) { - super(aID, aName, aNameRegional, aTier, 1, // amperage + public GT_MetaTileEntity_AdvSeismicProspector( + int aID, String aName, String aNameRegional, int aTier, int aRadius, int aStep) { + super( + aID, + aName, + aNameRegional, + aTier, + 1, // amperage "", 1, // input slot count 1, // output slot count "Default.png", // GUI name "", // NEI name - TextureFactory.of( - TextureFactory.of(OVERLAY_SIDE_ROCK_BREAKER_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_SIDE_ROCK_BREAKER_ACTIVE_GLOW).glow().build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_SIDE_ROCK_BREAKER), - TextureFactory.builder().addIcon(OVERLAY_SIDE_ROCK_BREAKER_GLOW).glow().build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_TOP_ROCK_BREAKER_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_TOP_ROCK_BREAKER_ACTIVE_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_SIDE_ROCK_BREAKER_ACTIVE), + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_ROCK_BREAKER_ACTIVE_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_SIDE_ROCK_BREAKER), + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_ROCK_BREAKER_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_TOP_ROCK_BREAKER_ACTIVE), + TextureFactory.builder() + .addIcon(OVERLAY_TOP_ROCK_BREAKER_ACTIVE_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_TOP_ROCK_BREAKER), - TextureFactory.builder().addIcon(OVERLAY_TOP_ROCK_BREAKER_GLOW).glow().build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_FRONT_ROCK_BREAKER_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_FRONT_ROCK_BREAKER_ACTIVE_GLOW).glow().build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_FRONT_ROCK_BREAKER), - TextureFactory.builder().addIcon(OVERLAY_FRONT_ROCK_BREAKER_GLOW).glow().build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE_GLOW).glow().build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_BOTTOM_ROCK_BREAKER), - TextureFactory.builder().addIcon(OVERLAY_BOTTOM_ROCK_BREAKER_GLOW).glow().build())); + TextureFactory.builder() + .addIcon(OVERLAY_TOP_ROCK_BREAKER_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_FRONT_ROCK_BREAKER_ACTIVE), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ROCK_BREAKER_ACTIVE_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_FRONT_ROCK_BREAKER), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ROCK_BREAKER_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE), + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_BOTTOM_ROCK_BREAKER), + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_ROCK_BREAKER_GLOW) + .glow() + .build())); radius = aRadius; step = aStep; } @Override public String[] getDescription() { - return new String[]{ - "Place, activate with explosives", - "2 Powderbarrels, " - + "4 Glyceryl Trinitrate, " - + "16 TNT, or " - + "8 ITNT", - "Use Data Stick, Scan Data Stick, Print Data Stick, Bind Pages into Book", - "Ore prospecting area = " - + radius*2 - + "x" - + radius*2 - + " ONLY blocks below prospector", - "Oil prospecting area 3x3 oilfields, each is 8x8 chunks"}; + return new String[] { + "Place, activate with explosives", + "2 Powderbarrels, " + "4 Glyceryl Trinitrate, " + "16 TNT, or " + "8 ITNT", + "Use Data Stick, Scan Data Stick, Print Data Stick, Bind Pages into Book", + "Ore prospecting area = " + radius * 2 + "x" + radius * 2 + " ONLY blocks below prospector", + "Oil prospecting area 3x3 oilfields, each is 8x8 chunks" + }; } - protected GT_MetaTileEntity_AdvSeismicProspector(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, - String aGUIName, String aNEIName, int aRadius, int aStep) { + protected GT_MetaTileEntity_AdvSeismicProspector( + String aName, + int aTier, + String[] aDescription, + ITexture[][][] aTextures, + String aGUIName, + String aNEIName, + int aRadius, + int aStep) { super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); radius = aRadius; step = aStep; @@ -101,8 +130,15 @@ public class GT_MetaTileEntity_AdvSeismicProspector extends GT_MetaTileEntity_Ba @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_AdvSeismicProspector(this.mName, this.mTier, this.mDescriptionArray, this.mTextures, - this.mGUIName, this.mNEIName, this.radius, this.step); + return new GT_MetaTileEntity_AdvSeismicProspector( + this.mName, + this.mTier, + this.mDescriptionArray, + this.mTextures, + this.mGUIName, + this.mNEIName, + this.radius, + this.step); } @Override @@ -110,16 +146,19 @@ public class GT_MetaTileEntity_AdvSeismicProspector extends GT_MetaTileEntity_Ba if (aBaseMetaTileEntity.isServerSide()) { ItemStack aStack = aPlayer.getCurrentEquippedItem(); - if (!ready && (GT_Utility.consumeItems(aPlayer, aStack, Item.getItemFromBlock(Blocks.tnt), 16) - || GT_Utility.consumeItems(aPlayer, aStack, Ic2Items.industrialTnt.getItem(), 8) - || GT_Utility.consumeItems(aPlayer, aStack, Materials.Glyceryl, 4) - || GT_Utility.consumeItems(aPlayer, aStack, ItemList.Block_Powderbarrel.getItem(), 2) )) { + if (!ready + && (GT_Utility.consumeItems(aPlayer, aStack, Item.getItemFromBlock(Blocks.tnt), 16) + || GT_Utility.consumeItems(aPlayer, aStack, Ic2Items.industrialTnt.getItem(), 8) + || GT_Utility.consumeItems(aPlayer, aStack, Materials.Glyceryl, 4) + || GT_Utility.consumeItems(aPlayer, aStack, ItemList.Block_Powderbarrel.getItem(), 2))) { this.ready = true; this.mMaxProgresstime = (aPlayer.capabilities.isCreativeMode ? 20 : 800); - } else if (ready && mMaxProgresstime == 0 - && aStack != null && aStack.stackSize == 1 + } else if (ready + && mMaxProgresstime == 0 + && aStack != null + && aStack.stackSize == 1 && aStack.getItem() == ItemList.Tool_DataStick.getItem()) { this.ready = false; @@ -132,15 +171,16 @@ public class GT_MetaTileEntity_AdvSeismicProspector extends GT_MetaTileEntity_Ba ArrayList<String> tOils = new ArrayList<>(); prospectOils(tOils); - GT_Utility.ItemNBT.setAdvancedProspectionData(mTier, - aStack, - this.getBaseMetaTileEntity().getXCoord(), - this.getBaseMetaTileEntity().getYCoord(), - this.getBaseMetaTileEntity().getZCoord(), - this.getBaseMetaTileEntity().getWorld().provider.dimensionId, - tOils, - GT_Utility.sortByValueToList(tOres), - radius); + GT_Utility.ItemNBT.setAdvancedProspectionData( + mTier, + aStack, + this.getBaseMetaTileEntity().getXCoord(), + this.getBaseMetaTileEntity().getYCoord(), + this.getBaseMetaTileEntity().getZCoord(), + this.getBaseMetaTileEntity().getWorld().provider.dimensionId, + tOils, + GT_Utility.sortByValueToList(tOres), + radius); } } @@ -165,15 +205,14 @@ public class GT_MetaTileEntity_AdvSeismicProspector extends GT_MetaTileEntity_Ba for (int i = 0; i < oilfieldSize; i++) { for (int j = 0; j < oilfieldSize; j++) { - Chunk tChunk = getBaseMetaTileEntity().getWorld().getChunkFromChunkCoords( - xChunk + i + x * oilfieldSize, - zChunk + j + z * oilfieldSize); + Chunk tChunk = getBaseMetaTileEntity() + .getWorld() + .getChunkFromChunkCoords( + xChunk + i + x * oilfieldSize, zChunk + j + z * oilfieldSize); FluidStack tFluid = undergroundOilReadInformation(tChunk); if (tFluid != null) { - if (tFluid.amount > max) - max = tFluid.amount; - if (tFluid.amount < min) - min = tFluid.amount; + if (tFluid.amount > max) max = tFluid.amount; + if (tFluid.amount < min) min = tFluid.amount; if (!tFluids.containsKey(cInts)) { tFluids.put(cInts, tFluid); } @@ -181,33 +220,32 @@ public class GT_MetaTileEntity_AdvSeismicProspector extends GT_MetaTileEntity_Ba } } - aOils.add(++oilFieldCount + "," + min + "-" + max + "," + tFluids.get(cInts).getLocalizedName()); + aOils.add(++oilFieldCount + "," + min + "-" + max + "," + + tFluids.get(cInts).getLocalizedName()); } } - } catch (Exception ignored) {} + } catch (Exception ignored) { + } } private void prospectOres(Map<String, Integer> aOres) { int tLeftXBound = this.getBaseMetaTileEntity().getXCoord() - radius; - int tRightXBound = tLeftXBound + 2*radius; + int tRightXBound = tLeftXBound + 2 * radius; int tLeftZBound = this.getBaseMetaTileEntity().getZCoord() - radius; - int tRightZBound = tLeftZBound + 2*radius; + int tRightZBound = tLeftZBound + 2 * radius; for (int i = tLeftXBound; i <= tRightXBound; i += step) { - if (Math.abs(i >> 4) % 3 != 1) - continue; + if (Math.abs(i >> 4) % 3 != 1) continue; for (int k = tLeftZBound; k <= tRightZBound; k += step) { - if (Math.abs(k >> 4) % 3 != 1) - continue; + if (Math.abs(k >> 4) % 3 != 1) continue; cX = (i >> 4) << 4; cZ = (k >> 4) << 4; - String separator = (cX +8)+ "," + (cZ + 8) + " --------"; + String separator = (cX + 8) + "," + (cZ + 8) + " --------"; aOres.put(separator, 1); prospectHole(i, k, aOres); - } } } @@ -216,8 +254,7 @@ public class GT_MetaTileEntity_AdvSeismicProspector extends GT_MetaTileEntity_Ba String tFoundOre; for (int j = this.getBaseMetaTileEntity().getYCoord(); j > 0; j--) { tFoundOre = checkForOre(i, j, k); - if (tFoundOre != null) - countOre(aOres, tFoundOre, cX, cZ); + if (tFoundOre != null) countOre(aOres, tFoundOre, cX, cZ); } } @@ -228,12 +265,11 @@ public class GT_MetaTileEntity_AdvSeismicProspector extends GT_MetaTileEntity_Ba TileEntity tTileEntity = getBaseMetaTileEntity().getWorld().getTileEntity(x, y, z); if ((tTileEntity instanceof GT_TileEntity_Ores) - && (((GT_TileEntity_Ores) tTileEntity).mMetaData < 16000)) { // Filtering small ores - Materials tMaterial - = GregTech_API.sGeneratedMaterials[((GT_TileEntity_Ores) tTileEntity).mMetaData % 1000]; + && (((GT_TileEntity_Ores) tTileEntity).mMetaData < 16000)) { // Filtering small ores + Materials tMaterial = + GregTech_API.sGeneratedMaterials[((GT_TileEntity_Ores) tTileEntity).mMetaData % 1000]; - if ((tMaterial != null) && (tMaterial != Materials._NULL)) - return tMaterial.mDefaultLocalName; + if ((tMaterial != null) && (tMaterial != Materials._NULL)) return tMaterial.mDefaultLocalName; } } else { int tMetaID = getBaseMetaTileEntity().getWorld().getBlockMetadata(x, y, z); @@ -241,14 +277,13 @@ public class GT_MetaTileEntity_AdvSeismicProspector extends GT_MetaTileEntity_Ba ItemData association = GT_OreDictUnificator.getAssociation(is); if ((association != null) && (association.mPrefix.toString().startsWith("ore"))) return association.mMaterial.mMaterial.mDefaultLocalName; - else if (GT_Utility.isOre(tBlock, tMetaID)) - return tBlock.getLocalizedName(); + else if (GT_Utility.isOre(tBlock, tMetaID)) return tBlock.getLocalizedName(); } return null; } private static void countOre(Map<String, Integer> map, String ore, int cCX, int cCZ) { - ore = (cCX +8)+ "," + (cCZ + 8) + " has " + ore; + ore = (cCX + 8) + "," + (cCZ + 8) + " has " + ore; Integer oldCount = map.get(ore); oldCount = (oldCount == null) ? 0 : oldCount; diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java index c0d4616bf9..49b6e4d473 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java @@ -1,5 +1,7 @@ package gregtech.common.tileentities.machines.basic; +import static gregtech.api.enums.Textures.BlockIcons.*; + import gregtech.api.enums.ItemList; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -11,52 +13,92 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.item.ItemStack; -import static gregtech.api.enums.Textures.BlockIcons.*; - public class GT_MetaTileEntity_Boxinator extends GT_MetaTileEntity_BasicMachine { ItemStack aInputCache; ItemStack aOutputCache; int aTypeCache = 0; public GT_MetaTileEntity_Boxinator(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 1, "Puts things into Boxes", 2, 1, "Packager.png", "", + super( + aID, + aName, + aNameRegional, + aTier, + 1, + "Puts things into Boxes", + 2, + 1, + "Packager.png", + "", TextureFactory.of( TextureFactory.of(OVERLAY_SIDE_BOXINATOR_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_SIDE_BOXINATOR_ACTIVE_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_BOXINATOR_ACTIVE_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_SIDE_BOXINATOR), - TextureFactory.builder().addIcon(OVERLAY_SIDE_BOXINATOR_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_BOXINATOR_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_FRONT_BOXINATOR_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_FRONT_BOXINATOR_ACTIVE_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_BOXINATOR_ACTIVE_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_FRONT_BOXINATOR), - TextureFactory.builder().addIcon(OVERLAY_FRONT_BOXINATOR_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_BOXINATOR_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_TOP_BOXINATOR_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_TOP_BOXINATOR_ACTIVE_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_TOP_BOXINATOR_ACTIVE_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_TOP_BOXINATOR), - TextureFactory.builder().addIcon(OVERLAY_TOP_BOXINATOR_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_TOP_BOXINATOR_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_BOTTOM_BOXINATOR_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_BOTTOM_BOXINATOR_ACTIVE_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_BOXINATOR_ACTIVE_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_BOTTOM_BOXINATOR), - TextureFactory.builder().addIcon(OVERLAY_BOTTOM_BOXINATOR_GLOW).glow().build())); + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_BOXINATOR_GLOW) + .glow() + .build())); } - public GT_MetaTileEntity_Boxinator(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { + public GT_MetaTileEntity_Boxinator( + String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 2, 1, aGUIName, aNEIName); } - public GT_MetaTileEntity_Boxinator(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { + public GT_MetaTileEntity_Boxinator( + String aName, + int aTier, + String[] aDescription, + ITexture[][][] aTextures, + String aGUIName, + String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 2, 1, aGUIName, aNEIName); } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Boxinator(this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName); + return new GT_MetaTileEntity_Boxinator( + this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName); } @Override @@ -64,13 +106,12 @@ public class GT_MetaTileEntity_Boxinator extends GT_MetaTileEntity_BasicMachine return GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes; } - private boolean hasValidCache(ItemStack mItem,int mType,boolean mClearOnFailure) { + private boolean hasValidCache(ItemStack mItem, int mType, boolean mClearOnFailure) { if (aInputCache != null && aOutputCache != null && aTypeCache == mType && aInputCache.isItemEqual(mItem) - && ItemStack.areItemStackTagsEqual(mItem,aInputCache)) - return true; + && ItemStack.areItemStackTagsEqual(mItem, aInputCache)) return true; // clear cache if it was invalid if (mClearOnFailure) { aInputCache = null; @@ -80,7 +121,7 @@ public class GT_MetaTileEntity_Boxinator extends GT_MetaTileEntity_BasicMachine return false; } - private void cacheItem(ItemStack mInputItem,ItemStack mOutputItem,int mType) { + private void cacheItem(ItemStack mInputItem, ItemStack mOutputItem, int mType) { aTypeCache = mType; aOutputCache = mOutputItem.copy(); aInputCache = mInputItem.copy(); @@ -94,53 +135,57 @@ public class GT_MetaTileEntity_Boxinator extends GT_MetaTileEntity_BasicMachine } ItemStack tSlot0 = getInputAt(0); ItemStack tSlot1 = getInputAt(1); - if ((GT_Utility.isStackValid(tSlot0)) && (GT_Utility.isStackValid(tSlot1)) && (GT_Utility.getContainerItem(tSlot0, true) == null)) { + if ((GT_Utility.isStackValid(tSlot0)) + && (GT_Utility.isStackValid(tSlot1)) + && (GT_Utility.getContainerItem(tSlot0, true) == null)) { if ((ItemList.Schematic_1by1.isStackEqual(tSlot1)) && (tSlot0.stackSize >= 1)) { - boolean tIsCached = hasValidCache(tSlot0,1,true); + boolean tIsCached = hasValidCache(tSlot0, 1, true); this.mOutputItems[0] = tIsCached ? aOutputCache.copy() : GT_ModHandler.getRecipeOutput(tSlot0); if (this.mOutputItems[0] != null) { if (canOutput(this.mOutputItems[0])) { tSlot0.stackSize -= 1; - calculateOverclockedNess(32,16); - //In case recipe is too OP for that machine + calculateOverclockedNess(32, 16); + // In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; - if (!tIsCached) - cacheItem(tSlot0,this.mOutputItems[0],1); + if (!tIsCached) cacheItem(tSlot0, this.mOutputItems[0], 1); return FOUND_AND_SUCCESSFULLY_USED_RECIPE; } } return DID_NOT_FIND_RECIPE; } if ((ItemList.Schematic_2by2.isStackEqual(tSlot1)) && (getInputAt(0).stackSize >= 4)) { - boolean tIsCached = hasValidCache(tSlot0,2,true); - this.mOutputItems[0] = tIsCached ? aOutputCache.copy() : GT_ModHandler.getRecipeOutput(tSlot0, tSlot0, null, tSlot0, tSlot0); + boolean tIsCached = hasValidCache(tSlot0, 2, true); + this.mOutputItems[0] = tIsCached + ? aOutputCache.copy() + : GT_ModHandler.getRecipeOutput(tSlot0, tSlot0, null, tSlot0, tSlot0); if (this.mOutputItems[0] != null) { if (canOutput(this.mOutputItems[0])) { getInputAt(0).stackSize -= 4; - calculateOverclockedNess(32,32); - //In case recipe is too OP for that machine + calculateOverclockedNess(32, 32); + // In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; - if (!tIsCached) - cacheItem(tSlot0,this.mOutputItems[0],2); + if (!tIsCached) cacheItem(tSlot0, this.mOutputItems[0], 2); return FOUND_AND_SUCCESSFULLY_USED_RECIPE; } } return DID_NOT_FIND_RECIPE; } if ((ItemList.Schematic_3by3.isStackEqual(tSlot1)) && (getInputAt(0).stackSize >= 9)) { - boolean tIsCached = hasValidCache(tSlot0,3,true); - this.mOutputItems[0] = tIsCached ? aOutputCache.copy() : GT_ModHandler.getRecipeOutput(tSlot0, tSlot0, tSlot0, tSlot0, tSlot0, tSlot0, tSlot0, tSlot0, tSlot0); + boolean tIsCached = hasValidCache(tSlot0, 3, true); + this.mOutputItems[0] = tIsCached + ? aOutputCache.copy() + : GT_ModHandler.getRecipeOutput( + tSlot0, tSlot0, tSlot0, tSlot0, tSlot0, tSlot0, tSlot0, tSlot0, tSlot0); if (this.mOutputItems[0] != null) { if (canOutput(this.mOutputItems[0])) { getInputAt(0).stackSize -= 9; - calculateOverclockedNess(32,64); - //In case recipe is too OP for that machine + calculateOverclockedNess(32, 64); + // In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; - if (!tIsCached) - cacheItem(tSlot0,this.mOutputItems[0],3); + if (!tIsCached) cacheItem(tSlot0, this.mOutputItems[0], 3); return FOUND_AND_SUCCESSFULLY_USED_RECIPE; } } @@ -151,23 +196,36 @@ public class GT_MetaTileEntity_Boxinator extends GT_MetaTileEntity_BasicMachine } @Override - protected boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + protected boolean allowPutStackValidated( + IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { if (!super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack)) { return false; } ItemStack tInput1 = getInputAt(1); - if ((ItemList.Schematic_1by1.isStackEqual(tInput1)) || (ItemList.Schematic_2by2.isStackEqual(tInput1)) || (ItemList.Schematic_3by3.isStackEqual(tInput1))) { - if (hasValidCache(aStack,aTypeCache,false)) - return true; - if (GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes.findRecipe(getBaseMetaTileEntity(), true, gregtech.api.enums.GT_Values.V[mTier], null, GT_Utility.copyAmount(64L, aStack), tInput1) != null) { + if ((ItemList.Schematic_1by1.isStackEqual(tInput1)) + || (ItemList.Schematic_2by2.isStackEqual(tInput1)) + || (ItemList.Schematic_3by3.isStackEqual(tInput1))) { + if (hasValidCache(aStack, aTypeCache, false)) return true; + if (GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes.findRecipe( + getBaseMetaTileEntity(), + true, + gregtech.api.enums.GT_Values.V[mTier], + null, + GT_Utility.copyAmount(64L, aStack), + tInput1) + != null) { return true; } if (ItemList.Schematic_1by1.isStackEqual(getInputAt(1)) && GT_ModHandler.getRecipeOutput(aStack) != null) return true; - if (ItemList.Schematic_2by2.isStackEqual(getInputAt(1)) && GT_ModHandler.getRecipeOutput(aStack, aStack, null, aStack, aStack) != null) { + if (ItemList.Schematic_2by2.isStackEqual(getInputAt(1)) + && GT_ModHandler.getRecipeOutput(aStack, aStack, null, aStack, aStack) != null) { return true; } - return ItemList.Schematic_3by3.isStackEqual(getInputAt(1)) && (GT_ModHandler.getRecipeOutput(aStack, aStack, aStack, aStack, aStack, aStack, aStack, aStack, aStack) != null); + return ItemList.Schematic_3by3.isStackEqual(getInputAt(1)) + && (GT_ModHandler.getRecipeOutput( + aStack, aStack, aStack, aStack, aStack, aStack, aStack, aStack, aStack) + != null); } else { return GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes.containsInput(aStack); } diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Charger.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Charger.java index b614bc598e..f6223a4a0d 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Charger.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Charger.java @@ -1,5 +1,7 @@ package gregtech.common.tileentities.machines.basic; +import static gregtech.api.enums.GT_Values.V; + import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -9,19 +11,20 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicBatter import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Utility; -import static gregtech.api.enums.GT_Values.V; - public class GT_MetaTileEntity_Charger extends GT_MetaTileEntity_BasicBatteryBuffer { - public GT_MetaTileEntity_Charger(int aID, String aName, String aNameRegional, int aTier, String aDescription, int aSlotCount) { + public GT_MetaTileEntity_Charger( + int aID, String aName, String aNameRegional, int aTier, String aDescription, int aSlotCount) { super(aID, aName, aNameRegional, aTier, aDescription, aSlotCount); } - public GT_MetaTileEntity_Charger(String aName, int aTier, String aDescription, ITexture[][][] aTextures, int aSlotCount) { + public GT_MetaTileEntity_Charger( + String aName, int aTier, String aDescription, ITexture[][][] aTextures, int aSlotCount) { super(aName, aTier, aDescription, aTextures, aSlotCount); } - public GT_MetaTileEntity_Charger(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, int aSlotCount) { + public GT_MetaTileEntity_Charger( + String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, int aSlotCount) { super(aName, aTier, aDescription, aTextures, aSlotCount); } @@ -36,16 +39,18 @@ public class GT_MetaTileEntity_Charger extends GT_MetaTileEntity_BasicBatteryBuf } @Override - public long maxEUStore() { return V[mTier] * 256L * mInventory.length;} + public long maxEUStore() { + return V[mTier] * 256L * mInventory.length; + } @Override public long maxAmperesIn() { - return Math.max(mChargeableCount * 8L,4L); + return Math.max(mChargeableCount * 8L, 4L); } @Override public long maxAmperesOut() { - return Math.max(mBatteryCount * 4L,2L); + return Math.max(mBatteryCount * 4L, 2L); } @Override @@ -56,25 +61,50 @@ public class GT_MetaTileEntity_Charger extends GT_MetaTileEntity_BasicBatteryBuf BaseMetaTileEntity mBaseMetaTileEntity = (BaseMetaTileEntity) getBaseMetaTileEntity(); if (mBaseMetaTileEntity.getMetaTileEntity() instanceof MetaTileEntity) { MetaTileEntity mMetaTileEntity = (MetaTileEntity) mBaseMetaTileEntity.getMetaTileEntity(); - //for (int t = 0; t < 6; t++) { - if (mMetaTileEntity.dechargerSlotCount() > 0 && mBaseMetaTileEntity.getStoredEU() < mBaseMetaTileEntity.getEUCapacity()) { - for (int i = mMetaTileEntity.dechargerSlotStartIndex(), k = mMetaTileEntity.dechargerSlotCount() + i; i < k; i++) { - if (mMetaTileEntity.mInventory[i] != null && mBaseMetaTileEntity.getStoredEU() < mBaseMetaTileEntity.getEUCapacity()) { - mBaseMetaTileEntity.increaseStoredEnergyUnits(GT_ModHandler.dischargeElectricItem(mMetaTileEntity.mInventory[i], GT_Utility.safeInt(Math.min(V[mTier] * 15, mBaseMetaTileEntity.getEUCapacity() - mBaseMetaTileEntity.getStoredEU())), (int) Math.min(Integer.MAX_VALUE, mMetaTileEntity.getInputTier()), true, false, false), true); - if (mMetaTileEntity.mInventory[i].stackSize <= 0) - mMetaTileEntity.mInventory[i] = null; + // for (int t = 0; t < 6; t++) { + if (mMetaTileEntity.dechargerSlotCount() > 0 + && mBaseMetaTileEntity.getStoredEU() < mBaseMetaTileEntity.getEUCapacity()) { + for (int i = mMetaTileEntity.dechargerSlotStartIndex(), + k = mMetaTileEntity.dechargerSlotCount() + i; + i < k; + i++) { + if (mMetaTileEntity.mInventory[i] != null + && mBaseMetaTileEntity.getStoredEU() < mBaseMetaTileEntity.getEUCapacity()) { + mBaseMetaTileEntity.increaseStoredEnergyUnits( + GT_ModHandler.dischargeElectricItem( + mMetaTileEntity.mInventory[i], + GT_Utility.safeInt(Math.min( + V[mTier] * 15, + mBaseMetaTileEntity.getEUCapacity() + - mBaseMetaTileEntity.getStoredEU())), + (int) Math.min(Integer.MAX_VALUE, mMetaTileEntity.getInputTier()), + true, + false, + false), + true); + if (mMetaTileEntity.mInventory[i].stackSize <= 0) mMetaTileEntity.mInventory[i] = null; } } } if (mMetaTileEntity.rechargerSlotCount() > 0 && mBaseMetaTileEntity.getStoredEU() > 0) { - for (int i = mMetaTileEntity.rechargerSlotStartIndex(), k = mMetaTileEntity.rechargerSlotCount() + i; i < k; i++) { + for (int i = mMetaTileEntity.rechargerSlotStartIndex(), + k = mMetaTileEntity.rechargerSlotCount() + i; + i < k; + i++) { if (mBaseMetaTileEntity.getStoredEU() > 0 && mMetaTileEntity.mInventory[i] != null) { - mBaseMetaTileEntity.decreaseStoredEU(GT_ModHandler.chargeElectricItem(mMetaTileEntity.mInventory[i], GT_Utility.safeInt(Math.min(V[mTier] * 15, mBaseMetaTileEntity.getStoredEU())), (int) Math.min(Integer.MAX_VALUE, mMetaTileEntity.getOutputTier()), true, false), true); - if (mMetaTileEntity.mInventory[i].stackSize <= 0) - mMetaTileEntity.mInventory[i] = null; + mBaseMetaTileEntity.decreaseStoredEU( + GT_ModHandler.chargeElectricItem( + mMetaTileEntity.mInventory[i], + GT_Utility.safeInt( + Math.min(V[mTier] * 15, mBaseMetaTileEntity.getStoredEU())), + (int) Math.min(Integer.MAX_VALUE, mMetaTileEntity.getOutputTier()), + true, + false), + true); + if (mMetaTileEntity.mInventory[i].stackSize <= 0) mMetaTileEntity.mInventory[i] = null; } } - //} + // } } } } diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CuringOven.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CuringOven.java index d249cae2a1..dc5c976eac 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CuringOven.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CuringOven.java @@ -1,6 +1,5 @@ package gregtech.common.tileentities.machines.basic; - import gregtech.api.enums.ItemList; import gregtech.api.enums.Textures; import gregtech.api.gui.GT_Container_1by1; @@ -19,32 +18,63 @@ import net.minecraftforge.fluids.FluidStack; public class GT_MetaTileEntity_CuringOven extends GT_MetaTileEntity_BasicMachine { public GT_MetaTileEntity_CuringOven(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 1, "Heats tools for hardening", 1, 1, "E_Oven.png", "", TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_SIDE_ACTIVE")), TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_SIDE")), TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_FRONT_ACTIVE")), TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_FRONT")), TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_TOP_ACTIVE")), TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_TOP")), TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_BOTTOM_ACTIVE")), TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_BOTTOM"))); + super( + aID, + aName, + aNameRegional, + aTier, + 1, + "Heats tools for hardening", + 1, + 1, + "E_Oven.png", + "", + TextureFactory.of( + new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_SIDE_ACTIVE")), + TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_SIDE")), + TextureFactory.of( + new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_FRONT_ACTIVE")), + TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_FRONT")), + TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_TOP_ACTIVE")), + TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_TOP")), + TextureFactory.of( + new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_BOTTOM_ACTIVE")), + TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_BOTTOM"))); } - public GT_MetaTileEntity_CuringOven(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { + public GT_MetaTileEntity_CuringOven( + String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); } - public GT_MetaTileEntity_CuringOven(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { + public GT_MetaTileEntity_CuringOven( + String aName, + int aTier, + String[] aDescription, + ITexture[][][] aTextures, + String aGUIName, + String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_CuringOven(this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName); + return new GT_MetaTileEntity_CuringOven( + this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName); } @Override - protected boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - return (super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack)) && ItemList.Cell_Empty.isStackEqual(aStack); + protected boolean allowPutStackValidated( + IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return (super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack)) + && ItemList.Cell_Empty.isStackEqual(aStack); } @Override public boolean isFluidInputAllowed(FluidStack aFluid) { return false; } - + @Override public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_Container_1by1(aPlayerInventory, aBaseMetaTileEntity); @@ -59,30 +89,34 @@ public class GT_MetaTileEntity_CuringOven extends GT_MetaTileEntity_BasicMachine public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (aBaseMetaTileEntity.isServerSide()) { for (ItemStack tStack : mInventory) - if (tStack!=null&&tStack.getItem() instanceof GT_MetaGenerated_Tool &&getBaseMetaTileEntity().getStoredEU()>0) { - getBaseMetaTileEntity().decreaseStoredEnergyUnits(24, true); + if (tStack != null + && tStack.getItem() instanceof GT_MetaGenerated_Tool + && getBaseMetaTileEntity().getStoredEU() > 0) { + getBaseMetaTileEntity().decreaseStoredEnergyUnits(24, true); NBTTagCompound aNBT = tStack.getTagCompound(); if (aNBT != null) { - int tHeat = 300; - long tWorldTime = getBaseMetaTileEntity().getWorld().getTotalWorldTime(); + int tHeat = 300; + long tWorldTime = getBaseMetaTileEntity().getWorld().getTotalWorldTime(); aNBT = aNBT.getCompoundTag("GT.ToolStats"); - if (aNBT != null&&aNBT.hasKey("Heat")) { - tHeat = aNBT.getInteger("Heat"); - if(aNBT.hasKey("HeatTime")){ - long tHeatTime = aNBT.getLong("HeatTime"); - if(tWorldTime>(tHeatTime+10)){ - tHeat = (int) (tHeat - ((tWorldTime-tHeatTime)/10)); - if(tHeat<300)tHeat=300; - } - } + if (aNBT != null && aNBT.hasKey("Heat")) { + tHeat = aNBT.getInteger("Heat"); + if (aNBT.hasKey("HeatTime")) { + long tHeatTime = aNBT.getLong("HeatTime"); + if (tWorldTime > (tHeatTime + 10)) { + tHeat = (int) (tHeat - ((tWorldTime - tHeatTime) / 10)); + if (tHeat < 300) tHeat = 300; + } + } } tHeat++; - if(aNBT!=null){ - aNBT.setInteger("Heat", tHeat); - aNBT.setLong("HeatTime", tWorldTime);} - if(tHeat>GT_MetaGenerated_Tool.getPrimaryMaterial(tStack).mMeltingPoint){mInventory[0]=null;} + if (aNBT != null) { + aNBT.setInteger("Heat", tHeat); + aNBT.setLong("HeatTime", tWorldTime); + } + if (tHeat > GT_MetaGenerated_Tool.getPrimaryMaterial(tStack).mMeltingPoint) { + mInventory[0] = null; + } } - } } } diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Disassembler.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Disassembler.java index 318acbea51..1f9b93a8d2 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Disassembler.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Disassembler.java @@ -1,5 +1,8 @@ package gregtech.common.tileentities.machines.basic; +import static gregtech.api.enums.GT_Values.MOD_ID_RC; +import static gregtech.api.enums.Textures.BlockIcons.*; + import com.google.common.collect.ArrayListMultimap; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; @@ -22,19 +25,15 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.api.util.extensions.ArrayExt; import ic2.api.item.IC2Items; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; - import java.util.*; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; import java.util.stream.IntStream; - -import static gregtech.api.enums.GT_Values.MOD_ID_RC; -import static gregtech.api.enums.Textures.BlockIcons.*; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; public class GT_MetaTileEntity_Disassembler extends GT_MetaTileEntity_BasicMachine { @@ -45,7 +44,7 @@ public class GT_MetaTileEntity_Disassembler extends GT_MetaTileEntity_BasicMachi aNameRegional, aTier, 1, - new String[]{ + new String[] { "Disassembles Machines up to " + GT_Values.TIER_COLORS[aTier] + GT_Values.VOLTAGE_NAMES[aTier], "Can also disassemble most assembler recipes!" }, @@ -54,77 +53,103 @@ public class GT_MetaTileEntity_Disassembler extends GT_MetaTileEntity_BasicMachi "Disassembler.png", "", - //Textures + // Textures TextureFactory.of( TextureFactory.of(OVERLAY_SIDE_DISASSEMBLER_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_SIDE_DISASSEMBLER_ACTIVE_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_DISASSEMBLER_ACTIVE_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_SIDE_DISASSEMBLER), - TextureFactory.builder().addIcon(OVERLAY_SIDE_DISASSEMBLER_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_DISASSEMBLER_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_FRONT_DISASSEMBLER_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_FRONT_DISASSEMBLER_ACTIVE_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_DISASSEMBLER_ACTIVE_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_FRONT_DISASSEMBLER), - TextureFactory.builder().addIcon(OVERLAY_FRONT_DISASSEMBLER_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_DISASSEMBLER_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_TOP_DISASSEMBLER_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_TOP_DISASSEMBLER_ACTIVE_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_TOP_DISASSEMBLER_ACTIVE_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_TOP_DISASSEMBLER), - TextureFactory.builder().addIcon(OVERLAY_TOP_DISASSEMBLER_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_TOP_DISASSEMBLER_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_BOTTOM_DISASSEMBLER_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_BOTTOM_DISASSEMBLER_ACTIVE_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_DISASSEMBLER_ACTIVE_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_BOTTOM_DISASSEMBLER), - TextureFactory.builder().addIcon(OVERLAY_BOTTOM_DISASSEMBLER_GLOW).glow().build()) - ); + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_DISASSEMBLER_GLOW) + .glow() + .build())); } - public GT_MetaTileEntity_Disassembler(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { + public GT_MetaTileEntity_Disassembler( + String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 1, 9, aGUIName, aNEIName); } - public GT_MetaTileEntity_Disassembler(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { + public GT_MetaTileEntity_Disassembler( + String aName, + int aTier, + String[] aDescription, + ITexture[][][] aTextures, + String aGUIName, + String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 1, 9, aGUIName, aNEIName); } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Disassembler(this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName); + return new GT_MetaTileEntity_Disassembler( + this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName); } private static final ItemStack[][] alwaysReplace = { - { - //ItemStack to look for - new ItemStack(Blocks.trapped_chest, 1, OreDictionary.WILDCARD_VALUE) - }, - { - //ItemStack to replace - new ItemStack(Blocks.chest) - } + { + // ItemStack to look for + new ItemStack(Blocks.trapped_chest, 1, OreDictionary.WILDCARD_VALUE) + }, + { + // ItemStack to replace + new ItemStack(Blocks.chest) + } }; private static final Object[][] OreDictionaryOverride = { - { - //String to look for - "plankWood", - "stoneCobble", - "gemDiamond", - "logWood", - "stickWood", - "treeSapling" - }, - { - //ItemStack to replace - new ItemStack(Blocks.planks), - new ItemStack(Blocks.cobblestone), - new ItemStack(Items.diamond), - new ItemStack(Blocks.log), - new ItemStack(Items.stick), - new ItemStack(Blocks.sapling) - } + { + // String to look for + "plankWood", "stoneCobble", "gemDiamond", "logWood", "stickWood", "treeSapling" + }, + { + // ItemStack to replace + new ItemStack(Blocks.planks), + new ItemStack(Blocks.cobblestone), + new ItemStack(Items.diamond), + new ItemStack(Blocks.log), + new ItemStack(Items.stick), + new ItemStack(Blocks.sapling) + } }; public static ArrayListMultimap<GT_ItemStack, ItemStack> getOutputHardOverrides() { @@ -141,7 +166,7 @@ public class GT_MetaTileEntity_Disassembler extends GT_MetaTileEntity_BasicMachi static { outputHardOverrides = ArrayListMultimap.create(); - outputHardOverrides.put(new GT_ItemStack(new ItemStack(Blocks.torch,6)), new ItemStack(Items.stick)); + outputHardOverrides.put(new GT_ItemStack(new ItemStack(Blocks.torch, 6)), new ItemStack(Items.stick)); addBlacklist(ItemList.Casing_Coil_Superconductor.get(1L)); addBlacklist(Materials.Graphene.getDust(1)); addBlacklist(ItemList.Circuit_Parts_Vacuum_Tube.get(1L)); @@ -179,34 +204,24 @@ public class GT_MetaTileEntity_Disassembler extends GT_MetaTileEntity_BasicMachi return false; } - private boolean compareToUnpacker(ItemStack is){ - return null != GT_Recipe.GT_Recipe_Map.sUnboxinatorRecipes.findRecipe( - null, - true, - true, - Long.MAX_VALUE, - null, - is); + private boolean compareToUnpacker(ItemStack is) { + return null + != GT_Recipe.GT_Recipe_Map.sUnboxinatorRecipes.findRecipe(null, true, true, Long.MAX_VALUE, null, is); } @Override public int checkRecipe() { ItemStack is = getInputAt(0); - if (GT_Utility.isStackInvalid(is)) - return DID_NOT_FIND_RECIPE; + if (GT_Utility.isStackInvalid(is)) return DID_NOT_FIND_RECIPE; - if ( - is.getItem() instanceof GT_MetaGenerated_Tool + if (is.getItem() instanceof GT_MetaGenerated_Tool || isCircuit(is) || blackList.stream().anyMatch(t -> GT_Utility.areStacksEqual(t.toStack(), is, true)) - || compareToUnpacker(is) - ) - return DID_NOT_FIND_RECIPE; + || compareToUnpacker(is)) return DID_NOT_FIND_RECIPE; Integer handleHardOverride = handleHardOverride(is); - if (handleHardOverride != null) - return handleHardOverride; + if (handleHardOverride != null) return handleHardOverride; return process(); } @@ -230,24 +245,22 @@ public class GT_MetaTileEntity_Disassembler extends GT_MetaTileEntity_BasicMachi if (is.getItem() == comp.getItem()) { IMetaTileEntity iMetaTileEntity = GregTech_API.METATILEENTITIES[is.getItemDamage()]; - return iMetaTileEntity instanceof GT_MetaTileEntity_TieredMachineBlock && - ((GT_MetaTileEntity_TieredMachineBlock) iMetaTileEntity).mTier > this.mTier; + return iMetaTileEntity instanceof GT_MetaTileEntity_TieredMachineBlock + && ((GT_MetaTileEntity_TieredMachineBlock) iMetaTileEntity).mTier > this.mTier; } return false; } - private int process(){ + private int process() { int statusCode = onTheFlyGeneration(); - if (statusCode != DID_NOT_FIND_RECIPE) - return statusCode; + if (statusCode != DID_NOT_FIND_RECIPE) return statusCode; return checkRecipeMap(); } private int onTheFlyGeneration() { Collection<DissassembleReference> recipes = this.findRecipeFromMachine(); - if (recipes.isEmpty()) - return DID_NOT_FIND_RECIPE; + if (recipes.isEmpty()) return DID_NOT_FIND_RECIPE; DissassembleReference recipe = ensureDowncasting(recipes); @@ -264,16 +277,15 @@ public class GT_MetaTileEntity_Disassembler extends GT_MetaTileEntity_BasicMachi private void removeInvalidStacks(DissassembleReference recipe) { for (int i = 0; i < recipe.inputs.length; i++) - if (GT_Utility.isStackInvalid(recipe.inputs[i]) || recipe.inputs[i].stackSize < 1) - recipe.inputs[i] = null; + if (GT_Utility.isStackInvalid(recipe.inputs[i]) || recipe.inputs[i].stackSize < 1) recipe.inputs[i] = null; recipe.inputs = ArrayExt.withoutNulls(recipe.inputs, ItemStack[]::new); } private int checkRecipeMap() { - GT_Recipe gt_recipe = GT_Recipe.GT_Recipe_Map.sDisassemblerRecipes.findRecipe(this.getBaseMetaTileEntity(), true, this.maxEUInput(), null, this.getAllInputs()); - if (gt_recipe == null) - return DID_NOT_FIND_RECIPE; + GT_Recipe gt_recipe = GT_Recipe.GT_Recipe_Map.sDisassemblerRecipes.findRecipe( + this.getBaseMetaTileEntity(), true, this.maxEUInput(), null, this.getAllInputs()); + if (gt_recipe == null) return DID_NOT_FIND_RECIPE; if (gt_recipe.isRecipeInputEqual(false, null, this.getAllInputs())) { if (gt_recipe.mSpecialValue == -100) { // Bypass standard disassembler restrictions. @@ -292,52 +304,43 @@ public class GT_MetaTileEntity_Disassembler extends GT_MetaTileEntity_BasicMachi return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; } - private boolean setOutputsAndTime(ItemStack[] inputs, int stackSize){ + private boolean setOutputsAndTime(ItemStack[] inputs, int stackSize) { ItemStack machineInput = this.getInputAt(0); - if (checkTier(machineInput)) - return false; + if (checkTier(machineInput)) return false; - if (machineInput.stackSize >= stackSize) - machineInput.stackSize -= stackSize; - else - return false; + if (machineInput.stackSize >= stackSize) machineInput.stackSize -= stackSize; + else return false; System.arraycopy(inputs, 0, this.mOutputItems, 0, inputs.length); - this.calculateOverclockedNess(30,600); + this.calculateOverclockedNess(30, 600); return true; } private static DissassembleReference ensureDowncasting(Collection<? extends DissassembleReference> recipes) { - ItemStack[] inputs = recipes.stream() - .findFirst() - .orElseThrow(NullPointerException::new) - .inputs; - int EUt = recipes.stream() - .findFirst() - .orElseThrow(NullPointerException::new) - .EUt; + ItemStack[] inputs = recipes.stream().findFirst().orElseThrow(NullPointerException::new).inputs; + int EUt = recipes.stream().findFirst().orElseThrow(NullPointerException::new).EUt; ItemStack[] output = new ItemStack[inputs.length]; List<GT_Recipe> recipesColl = null; if (recipes.size() > 1) - recipesColl = recipes.stream() - .skip(1) - .map(x -> x.recipe) - .collect(Collectors.toList()); + recipesColl = recipes.stream().skip(1).map(x -> x.recipe).collect(Collectors.toList()); handleRecipeTransformation(inputs, output, recipesColl); - return new DissassembleReference(recipes.stream().mapToInt(x -> x.stackSize).min().orElseThrow(NumberFormatException::new), output, null, EUt); + return new DissassembleReference( + recipes.stream().mapToInt(x -> x.stackSize).min().orElseThrow(NumberFormatException::new), + output, + null, + EUt); } - private static void handleRecipeTransformation(ItemStack[] inputs, ItemStack[] output, List<? extends GT_Recipe> recipesColl) { + private static void handleRecipeTransformation( + ItemStack[] inputs, ItemStack[] output, List<? extends GT_Recipe> recipesColl) { for (int i = 0, inputsLength = inputs.length; i < inputsLength; i++) { Set<ItemStack[]> inputsStacks = null; if (recipesColl != null) - inputsStacks = recipesColl.stream() - .map(x -> x.mInputs) - .collect(Collectors.toSet()); + inputsStacks = recipesColl.stream().map(x -> x.mInputs).collect(Collectors.toSet()); handleRecipeTransformationInternal(inputs, output, inputsStacks, i); } addOthersAndHandleAlwaysReplace(inputs, output); @@ -346,13 +349,15 @@ public class GT_MetaTileEntity_Disassembler extends GT_MetaTileEntity_BasicMachi /** * Public Interface for ReverseRecipes, do not call inside of this class. */ - public static void handleRecipeTransformation(ItemStack[] inputs, ItemStack[] output, Set<ItemStack[]> inputsStacks) { + public static void handleRecipeTransformation( + ItemStack[] inputs, ItemStack[] output, Set<ItemStack[]> inputsStacks) { for (int i = 0, inputsLength = inputs.length; i < inputsLength; i++) handleRecipeTransformationInternal(inputs, output, inputsStacks, i); addOthersAndHandleAlwaysReplace(inputs, output); } - private static void handleRecipeTransformationInternal(ItemStack[] inputs, ItemStack[] output, Set<ItemStack[]> inputsStacks, int i) { + private static void handleRecipeTransformationInternal( + ItemStack[] inputs, ItemStack[] output, Set<ItemStack[]> inputsStacks, int i) { ItemStack input = inputs[i]; ItemData data = GT_OreDictUnificator.getItemData(input); if (data == null || data.mMaterial == null || data.mMaterial.mMaterial == null || data.mPrefix == null) { @@ -362,17 +367,16 @@ public class GT_MetaTileEntity_Disassembler extends GT_MetaTileEntity_BasicMachi handleReplacement(inputsStacks, data, output, input, i); } - private static void addOthersAndHandleAlwaysReplace(ItemStack[] inputs, ItemStack[] output){ + private static void addOthersAndHandleAlwaysReplace(ItemStack[] inputs, ItemStack[] output) { for (int i = 0; i < inputs.length; i++) { - //Adds rest of Items - if (output[i] == null) - output[i] = inputs[i]; + // Adds rest of Items + if (output[i] == null) output[i] = inputs[i]; - //Math.min the recipe output if Items are the same + // Math.min the recipe output if Items are the same if (GT_Utility.areStacksEqual(output[i], inputs[i])) output[i].stackSize = Math.min(output[i].stackSize, inputs[i].stackSize); - //Handles replacement Overrides + // Handles replacement Overrides ItemStack[] itemStacks = alwaysReplace[0]; for (int j = 0; j < itemStacks.length; j++) { ItemStack x = itemStacks[j]; @@ -382,9 +386,9 @@ public class GT_MetaTileEntity_Disassembler extends GT_MetaTileEntity_BasicMachi } } - //Unification + // Unification output[i] = handleUnification(output[i]); - //Wildcard + // Wildcard output[i] = handleWildcard(output[i]); } } @@ -392,7 +396,7 @@ public class GT_MetaTileEntity_Disassembler extends GT_MetaTileEntity_BasicMachi private static ItemStack handleUnification(ItemStack stack) { for (int oreID : OreDictionary.getOreIDs(stack)) { for (int i = 0; i < OreDictionaryOverride[0].length; i++) - if (OreDictionary.getOreName(oreID).equals(OreDictionaryOverride[0][i])){ + if (OreDictionary.getOreName(oreID).equals(OreDictionaryOverride[0][i])) { ItemStack ret = ((ItemStack) OreDictionaryOverride[1][i]).copy(); ret.stackSize = stack.stackSize; return ret; @@ -402,20 +406,22 @@ public class GT_MetaTileEntity_Disassembler extends GT_MetaTileEntity_BasicMachi } private static ItemStack handleWildcard(ItemStack stack) { - if (stack.getItemDamage() == OreDictionary.WILDCARD_VALUE && !stack.getItem().isDamageable()) { + if (stack.getItemDamage() == OreDictionary.WILDCARD_VALUE + && !stack.getItem().isDamageable()) { stack.setItemDamage(0); } return stack; } - private static void handleReplacement(Set<ItemStack[]> inputsStacks, ItemData data, ItemStack[] output, ItemStack input, int i){ + private static void handleReplacement( + Set<ItemStack[]> inputsStacks, ItemData data, ItemStack[] output, ItemStack input, int i) { AtomicReference<Materials> toRpl = new AtomicReference<>(); Materials first = data.mMaterial.mMaterial; if (inputsStacks != null) { handleInputStacks(inputsStacks, toRpl, data, first, i); } if (toRpl.get() == null) { - //Remove Magnetic and Annealed Modifiers + // Remove Magnetic and Annealed Modifiers handleBetterMaterialsVersions(data, toRpl); } if (toRpl.get() != null) { @@ -427,27 +433,29 @@ public class GT_MetaTileEntity_Disassembler extends GT_MetaTileEntity_BasicMachi } } - private static void handleInputStacks(Set<ItemStack[]> inputsStacks, AtomicReference<? super Materials> toRpl, ItemData data, Materials first, int i){ + private static void handleInputStacks( + Set<ItemStack[]> inputsStacks, + AtomicReference<? super Materials> toRpl, + ItemData data, + Materials first, + int i) { final int finalIndex = i; inputsStacks.forEach(stackArray -> { ItemData dataAgainst = GT_OreDictUnificator.getItemData(stackArray[finalIndex]); - if ( - dataAgainst == null || - dataAgainst.mMaterial == null || - dataAgainst.mMaterial.mMaterial == null || - dataAgainst.mPrefix == null || - dataAgainst.mPrefix != data.mPrefix - ) { + if (dataAgainst == null + || dataAgainst.mMaterial == null + || dataAgainst.mMaterial.mMaterial == null + || dataAgainst.mPrefix == null + || dataAgainst.mPrefix != data.mPrefix) { return; } handleDifferentMaterialsOnRecipes(first, dataAgainst.mMaterial.mMaterial, toRpl); - handleAnyMaterials(first,toRpl); + handleAnyMaterials(first, toRpl); }); } - private static void handleAnyMaterials(Materials first, AtomicReference<? super Materials> toRpl){ - if (first.mOreReRegistrations.stream().anyMatch(y -> y.equals(Materials.AnyIron))) - toRpl.set(Materials.Iron); + private static void handleAnyMaterials(Materials first, AtomicReference<? super Materials> toRpl) { + if (first.mOreReRegistrations.stream().anyMatch(y -> y.equals(Materials.AnyIron))) toRpl.set(Materials.Iron); else if (first.mOreReRegistrations.stream().anyMatch(y -> y.equals(Materials.AnyCopper))) toRpl.set(Materials.Copper); else if (first.mOreReRegistrations.stream().anyMatch(y -> y.equals(Materials.AnyRubber))) @@ -458,35 +466,27 @@ public class GT_MetaTileEntity_Disassembler extends GT_MetaTileEntity_BasicMachi toRpl.set(Materials.Rubber); } - private static void handleDifferentMaterialsOnRecipes(Materials first, Materials second, AtomicReference<? super Materials> toRpl){ + private static void handleDifferentMaterialsOnRecipes( + Materials first, Materials second, AtomicReference<? super Materials> toRpl) { if (!first.equals(second)) - if (first.equals(Materials.Aluminium) && second.equals(Materials.Iron)) - toRpl.set(second); - else if (first.equals(Materials.Steel) && second.equals(Materials.Iron)) - toRpl.set(second); - else if (first.equals(Materials.WroughtIron) && second.equals(Materials.Iron)) - toRpl.set(second); + if (first.equals(Materials.Aluminium) && second.equals(Materials.Iron)) toRpl.set(second); + else if (first.equals(Materials.Steel) && second.equals(Materials.Iron)) toRpl.set(second); + else if (first.equals(Materials.WroughtIron) && second.equals(Materials.Iron)) toRpl.set(second); else if (first.equals(Materials.Aluminium) && second.equals(Materials.WroughtIron)) toRpl.set(Materials.Iron); - else if (first.equals(Materials.Aluminium) && second.equals(Materials.Steel)) - toRpl.set(second); + else if (first.equals(Materials.Aluminium) && second.equals(Materials.Steel)) toRpl.set(second); else if (first.equals(Materials.Polytetrafluoroethylene) && second.equals(Materials.Plastic)) toRpl.set(second); - else if (first.equals(Materials.Polybenzimidazole) && second.equals(Materials.Plastic)) - toRpl.set(second); - else if (first.equals(Materials.Polystyrene) && second.equals(Materials.Plastic)) - toRpl.set(second); - else if (first.equals(Materials.Silicone) && second.equals(Materials.Plastic)) - toRpl.set(second); - else if (first.equals(Materials.NetherQuartz) || first.equals(Materials.CertusQuartz) && second.equals(Materials.Quartzite)) - toRpl.set(second); - else if (first.equals(Materials.Plastic) && second.equals(Materials.Wood)) - toRpl.set(second); - else if (first.equals(Materials.Diamond) && second.equals(Materials.Glass)) - toRpl.set(second); + else if (first.equals(Materials.Polybenzimidazole) && second.equals(Materials.Plastic)) toRpl.set(second); + else if (first.equals(Materials.Polystyrene) && second.equals(Materials.Plastic)) toRpl.set(second); + else if (first.equals(Materials.Silicone) && second.equals(Materials.Plastic)) toRpl.set(second); + else if (first.equals(Materials.NetherQuartz) + || first.equals(Materials.CertusQuartz) && second.equals(Materials.Quartzite)) toRpl.set(second); + else if (first.equals(Materials.Plastic) && second.equals(Materials.Wood)) toRpl.set(second); + else if (first.equals(Materials.Diamond) && second.equals(Materials.Glass)) toRpl.set(second); } - private static void handleBetterMaterialsVersions(ItemData data, AtomicReference<? super Materials> toRpl){ + private static void handleBetterMaterialsVersions(ItemData data, AtomicReference<? super Materials> toRpl) { if (Materials.SteelMagnetic.equals(data.mMaterial.mMaterial)) { toRpl.set(Materials.Steel); } else if (Materials.IronMagnetic.equals(data.mMaterial.mMaterial)) { @@ -501,27 +501,18 @@ public class GT_MetaTileEntity_Disassembler extends GT_MetaTileEntity_BasicMachi } @SuppressWarnings("deprecation") - private static void handleCircuits(Materials first, ItemStack[] output, ItemStack input, int i){ - if (first.equals(Materials.Primitive)) - output[i] = ItemList.NandChip.get(input.stackSize); - else if (first.equals(Materials.Basic)) - output[i] = ItemList.Circuit_Microprocessor.get(input.stackSize); - else if (first.equals(Materials.Good)) - output[i] = ItemList.Circuit_Good.get(input.stackSize); - else if (first.equals(Materials.Advanced)) - output[i] = ItemList.Circuit_Advanced.get(input.stackSize); - else if (first.equals(Materials.Data)) - output[i] = ItemList.Circuit_Data.get(input.stackSize); - else if (first.equals(Materials.Master)) - output[i] = ItemList.Circuit_Master.get(input.stackSize); - else if (first.equals(Materials.Ultimate)) - output[i] = ItemList.Circuit_Quantummainframe.get(input.stackSize); + private static void handleCircuits(Materials first, ItemStack[] output, ItemStack input, int i) { + if (first.equals(Materials.Primitive)) output[i] = ItemList.NandChip.get(input.stackSize); + else if (first.equals(Materials.Basic)) output[i] = ItemList.Circuit_Microprocessor.get(input.stackSize); + else if (first.equals(Materials.Good)) output[i] = ItemList.Circuit_Good.get(input.stackSize); + else if (first.equals(Materials.Advanced)) output[i] = ItemList.Circuit_Advanced.get(input.stackSize); + else if (first.equals(Materials.Data)) output[i] = ItemList.Circuit_Data.get(input.stackSize); + else if (first.equals(Materials.Master)) output[i] = ItemList.Circuit_Master.get(input.stackSize); + else if (first.equals(Materials.Ultimate)) output[i] = ItemList.Circuit_Quantummainframe.get(input.stackSize); else if (first.equals(Materials.Superconductor)) output[i] = ItemList.Circuit_Crystalmainframe.get(input.stackSize); - else if (first.equals(Materials.Infinite)) - output[i] = ItemList.Circuit_Wetwaremainframe.get(input.stackSize); - else if (first.equals(Materials.Bio)) - output[i] = ItemList.Circuit_Biomainframe.get(input.stackSize); + else if (first.equals(Materials.Infinite)) output[i] = ItemList.Circuit_Wetwaremainframe.get(input.stackSize); + else if (first.equals(Materials.Bio)) output[i] = ItemList.Circuit_Biomainframe.get(input.stackSize); } static class DissassembleReference { @@ -551,47 +542,48 @@ public class GT_MetaTileEntity_Disassembler extends GT_MetaTileEntity_BasicMachi private Collection<DissassembleReference> findRecipeFromMachine() { ItemStack is = getInputAt(0); - if (GT_Utility.isStackInvalid(is)) - return Collections.emptySet(); + if (GT_Utility.isStackInvalid(is)) return Collections.emptySet(); AtomicInteger stacksize = new AtomicInteger(); - //Check Recipe Maps for creation of Item + // Check Recipe Maps for creation of Item List<DissassembleReference> possibleRecipes = GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.mRecipeList.stream() - .filter(x -> Arrays.stream(x.mOutputs) - .anyMatch(y -> - { - ItemStack out = is.copy(); - out.stackSize = y.stackSize; - boolean isDone = GT_Utility.areStacksEqual(y, out, true) && y.stackSize <= is.stackSize; - if (isDone) - stacksize.set(y.stackSize); - return isDone; - }) - ) + .filter(x -> Arrays.stream(x.mOutputs).anyMatch(y -> { + ItemStack out = is.copy(); + out.stackSize = y.stackSize; + boolean isDone = GT_Utility.areStacksEqual(y, out, true) && y.stackSize <= is.stackSize; + if (isDone) stacksize.set(y.stackSize); + return isDone; + })) .map(x -> new DissassembleReference(stacksize.get(), x.mInputs, x)) .collect(Collectors.toList()); - //Is there only one way to create it? - if (possibleRecipes.size() == 1) - return possibleRecipes; + // Is there only one way to create it? + if (possibleRecipes.size() == 1) return possibleRecipes; - //There are Multiple Ways -> Get recipe with cheapest inputs - //More Inputs should mean cheaper Materials - return possibleRecipes - .stream() + // There are Multiple Ways -> Get recipe with cheapest inputs + // More Inputs should mean cheaper Materials + return possibleRecipes.stream() .sorted(Comparator.comparingDouble(GT_MetaTileEntity_Disassembler::getCheaperInputs)) .collect(Collectors.toList()); } - private static double getCheaperInputs(GT_MetaTileEntity_Disassembler.DissassembleReference x){ - double fluidInputValueRaw = Arrays.stream(x.recipe.mFluidInputs).flatMapToInt(f -> IntStream.of(f.amount)).sum(); + private static double getCheaperInputs(GT_MetaTileEntity_Disassembler.DissassembleReference x) { + double fluidInputValueRaw = Arrays.stream(x.recipe.mFluidInputs) + .flatMapToInt(f -> IntStream.of(f.amount)) + .sum(); fluidInputValueRaw = fluidInputValueRaw > 0 ? fluidInputValueRaw : 144D; - double inputValue = Arrays.stream(x.inputs).flatMapToInt(f -> IntStream.of(f.stackSize)).sum() + - (fluidInputValueRaw / 144D); - double fluidOutputValueRaw = Arrays.stream(x.recipe.mFluidOutputs).flatMapToInt(f -> IntStream.of(f.amount)).sum(); + double inputValue = Arrays.stream(x.inputs) + .flatMapToInt(f -> IntStream.of(f.stackSize)) + .sum() + + (fluidInputValueRaw / 144D); + double fluidOutputValueRaw = Arrays.stream(x.recipe.mFluidOutputs) + .flatMapToInt(f -> IntStream.of(f.amount)) + .sum(); fluidOutputValueRaw = fluidOutputValueRaw > 0 ? fluidOutputValueRaw : 144D; - double outputValue = Arrays.stream(x.recipe.mOutputs).flatMapToInt(f -> IntStream.of(f.stackSize)).sum() + - (fluidOutputValueRaw / 144D); + double outputValue = Arrays.stream(x.recipe.mOutputs) + .flatMapToInt(f -> IntStream.of(f.stackSize)) + .sum() + + (fluidOutputValueRaw / 144D); return outputValue / inputValue; } @@ -600,7 +592,10 @@ public class GT_MetaTileEntity_Disassembler extends GT_MetaTileEntity_BasicMachi } @Override - protected boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - return super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack) && aStack.getTagCompound() != null && aStack.getTagCompound().getCompoundTag("GT.CraftingComponents") != null; + protected boolean allowPutStackValidated( + IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack) + && aStack.getTagCompound() != null + && aStack.getTagCompound().getCompoundTag("GT.CraftingComponents") != null; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_IndustrialApiary.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_IndustrialApiary.java index faa1df8ebe..09ad7ddbf3 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_IndustrialApiary.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_IndustrialApiary.java @@ -1,5 +1,9 @@ package gregtech.common.tileentities.machines.basic; +import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.api.util.GT_Utility.moveMultipleItemStacks; + import com.google.common.collect.ImmutableSet; import com.mojang.authlib.GameProfile; import cpw.mods.fml.relauncher.Side; @@ -22,6 +26,10 @@ import gregtech.api.util.GT_Utility; import gregtech.common.GT_Client; import gregtech.common.gui.GT_Container_IndustrialApiary; import gregtech.common.gui.GT_GUIContainer_IndustrialApiary; +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import java.util.*; import net.bdew.gendustry.api.ApiaryModifiers; import net.bdew.gendustry.api.items.IApiaryUpgrade; import net.minecraft.block.Block; @@ -36,22 +44,13 @@ import net.minecraft.util.Vec3; import net.minecraft.world.World; import net.minecraft.world.biome.BiomeGenBase; -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; -import java.util.*; - -import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.enums.Textures.BlockIcons.*; -import static gregtech.api.util.GT_Utility.moveMultipleItemStacks; - -public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicMachine implements IBeeHousing, IBeeHousingInventory, IErrorLogic, IBeeModifier, IBeeListener { +public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicMachine + implements IBeeHousing, IBeeHousingInventory, IErrorLogic, IBeeModifier, IBeeListener { public static final int baseEUtUsage = 37; static final int queen = 5; static final int drone = 6; - IBeeRoot beeRoot = (IBeeRoot) AlleleManager.alleleRegistry.getSpeciesRoot("rootBees"); public int mSpeed = 0; @@ -62,47 +61,90 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM private IEffectData[] effectData = new IEffectData[2]; public GT_MetaTileEntity_IndustrialApiary(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 4, new String[] { "BEES GOES BRRRR", EnumChatFormatting.GRAY + "Added by " + EnumChatFormatting.GOLD + "kuba6000" }, 6, 9, "IndustrialApiary.png", "", + super( + aID, + aName, + aNameRegional, + aTier, + 4, + new String[] { + "BEES GOES BRRRR", EnumChatFormatting.GRAY + "Added by " + EnumChatFormatting.GOLD + "kuba6000" + }, + 6, + 9, + "IndustrialApiary.png", + "", TextureFactory.of( TextureFactory.of(OVERLAY_SIDE_INDUSTRIAL_APIARY_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_SIDE_INDUSTRIAL_APIARY_ACTIVE_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_INDUSTRIAL_APIARY_ACTIVE_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_SIDE_INDUSTRIAL_APIARY), - TextureFactory.builder().addIcon(OVERLAY_SIDE_INDUSTRIAL_APIARY_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_INDUSTRIAL_APIARY_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_FRONT_INDUSTRIAL_APIARY_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_FRONT_INDUSTRIAL_APIARY_ACTIVE_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_INDUSTRIAL_APIARY_ACTIVE_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_FRONT_INDUSTRIAL_APIARY), - TextureFactory.builder().addIcon(OVERLAY_FRONT_INDUSTRIAL_APIARY_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_INDUSTRIAL_APIARY_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_TOP_INDUSTRIAL_APIARY_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_TOP_INDUSTRIAL_APIARY_ACTIVE_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_TOP_INDUSTRIAL_APIARY_ACTIVE_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_TOP_INDUSTRIAL_APIARY), - TextureFactory.builder().addIcon(OVERLAY_TOP_INDUSTRIAL_APIARY_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_TOP_INDUSTRIAL_APIARY_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_BOTTOM_INDUSTRIAL_APIARY_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_BOTTOM_INDUSTRIAL_APIARY_ACTIVE_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_INDUSTRIAL_APIARY_ACTIVE_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_BOTTOM_INDUSTRIAL_APIARY), - TextureFactory.builder().addIcon(OVERLAY_BOTTOM_INDUSTRIAL_APIARY_GLOW).glow().build())); + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_INDUSTRIAL_APIARY_GLOW) + .glow() + .build())); } - public GT_MetaTileEntity_IndustrialApiary(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { + public GT_MetaTileEntity_IndustrialApiary( + String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { super(aName, aTier, 4, aDescription, aTextures, 6, 9, aGUIName, aNEIName); } - public GT_MetaTileEntity_IndustrialApiary(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { + public GT_MetaTileEntity_IndustrialApiary( + String aName, + int aTier, + String[] aDescription, + ITexture[][][] aTextures, + String aGUIName, + String aNEIName) { super(aName, aTier, 4, aDescription, aTextures, 6, 9, aGUIName, aNEIName); } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_IndustrialApiary(this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName); + return new GT_MetaTileEntity_IndustrialApiary( + this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName); } - @Override public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_Container_IndustrialApiary(aPlayerInventory, aBaseMetaTileEntity); @@ -118,8 +160,7 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM super.saveNBTData(aNBT); aNBT.setInteger("mSpeed", mSpeed); aNBT.setBoolean("mLockedSpeed", mLockedSpeed); - if(usedQueen != null) - aNBT.setTag("usedQueen", usedQueen.writeToNBT(new NBTTagCompound())); + if (usedQueen != null) aNBT.setTag("usedQueen", usedQueen.writeToNBT(new NBTTagCompound())); aNBT.setBoolean("retrievingPollenInThisOperation", retrievingPollenInThisOperation); aNBT.setInteger("pollinationDelay", pollinationDelay); } @@ -129,9 +170,8 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM super.loadNBTData(aNBT); mSpeed = aNBT.getInteger("mSpeed"); mLockedSpeed = aNBT.getBoolean("mLockedSpeed"); - if(aNBT.hasKey("usedQueen")) - usedQueen = ItemStack.loadItemStackFromNBT(aNBT.getCompoundTag("usedQueen")); - retrievingPollenInThisOperation = aNBT.getBoolean("retrievingPollenInThisOperation"); + if (aNBT.hasKey("usedQueen")) usedQueen = ItemStack.loadItemStackFromNBT(aNBT.getCompoundTag("usedQueen")); + retrievingPollenInThisOperation = aNBT.getBoolean("retrievingPollenInThisOperation"); pollinationDelay = aNBT.getInteger("pollinationDelay"); } @@ -142,12 +182,11 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM @Override public int checkRecipe() { updateModifiers(); - if(canWork()) { + if (canWork()) { ItemStack queen = getQueen(); usedQueen = queen.copy(); - if(beeRoot.getType(queen) == EnumBeeType.QUEEN) - { + if (beeRoot.getType(queen) == EnumBeeType.QUEEN) { IBee bee = beeRoot.getMember(queen); usedQueenBee = bee; @@ -159,23 +198,27 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM mod *= beemodifier.getLifespanModifier(null, null, 1.f); int h = bee.getHealth(); mod = 1.f / mod; - float cycles = h/mod; - + float cycles = h / mod; // PRODUCTS HashMap<GT_Utility.ItemId, ItemStack> pollen = new HashMap<>(); - if(isRetrievingPollen && floweringMod > 0f) { - int icycles = (int)cycles + (getWorld().rand.nextFloat() < (cycles - (float)((int)cycles)) ? 1 : 0); - for(int z = 0; z < icycles; z++) { + if (isRetrievingPollen && floweringMod > 0f) { + int icycles = + (int) cycles + (getWorld().rand.nextFloat() < (cycles - (float) ((int) cycles)) ? 1 : 0); + for (int z = 0; z < icycles; z++) { IIndividual p = bee.retrievePollen(this); - if(p != null) - { - ItemStack s = p.getGenome().getSpeciesRoot().getMemberStack(p, EnumGermlingType.POLLEN.ordinal()); - if(s != null) { + if (p != null) { + ItemStack s = + p.getGenome().getSpeciesRoot().getMemberStack(p, EnumGermlingType.POLLEN.ordinal()); + if (s != null) { GT_Utility.ItemId id = GT_Utility.ItemId.createNoCopy(s); - pollen.computeIfAbsent(id, k -> { ItemStack ns = s.copy(); ns.stackSize = 0; return ns; }); + pollen.computeIfAbsent(id, k -> { + ItemStack ns = s.copy(); + ns.stackSize = 0; + return ns; + }); pollen.get(id).stackSize += s.stackSize; } } @@ -185,29 +228,45 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM retrievedpollen = null; retrievingPollenInThisOperation = isRetrievingPollen; - IBeeGenome genome = bee.getGenome(); + IBeeGenome genome = bee.getGenome(); IAlleleBeeSpecies primary = genome.getPrimary(); IAlleleBeeSpecies secondary = genome.getSecondary(); - float speed = genome.getSpeed() * getProductionModifier(null, 1f) * beemodifier.getProductionModifier(null, 1.f); + float speed = genome.getSpeed() + * getProductionModifier(null, 1f) + * beemodifier.getProductionModifier(null, 1.f); HashMap<GT_Utility.ItemId, Float> drops = new HashMap<>(); HashMap<GT_Utility.ItemId, ItemStack> dropstacks = new HashMap<>(); - for(Map.Entry<ItemStack, Float> entry : primary.getProductChances().entrySet()) { + for (Map.Entry<ItemStack, Float> entry : + primary.getProductChances().entrySet()) { GT_Utility.ItemId id = GT_Utility.ItemId.createNoCopy(entry.getKey()); - drops.merge(id, Math.min(1f, entry.getValue() * speed) * (float) entry.getKey().stackSize * cycles, Float::sum); + drops.merge( + id, + Math.min(1f, entry.getValue() * speed) * (float) entry.getKey().stackSize * cycles, + Float::sum); dropstacks.computeIfAbsent(id, k -> entry.getKey()); } - for(Map.Entry<ItemStack, Float> entry : secondary.getProductChances().entrySet()) { + for (Map.Entry<ItemStack, Float> entry : + secondary.getProductChances().entrySet()) { GT_Utility.ItemId id = GT_Utility.ItemId.createNoCopy(entry.getKey()); - drops.merge(id, Math.min(1f, (float) Math.round(entry.getValue() / 2.0F) * speed) * (float) entry.getKey().stackSize * cycles, Float::sum); + drops.merge( + id, + Math.min(1f, (float) Math.round(entry.getValue() / 2.0F) * speed) + * (float) entry.getKey().stackSize + * cycles, + Float::sum); dropstacks.computeIfAbsent(id, k -> entry.getKey()); } - if(primary.isJubilant(genome, this) && secondary.isJubilant(genome, this)) - for(Map.Entry<ItemStack, Float> entry : primary.getSpecialtyChances().entrySet()) { + if (primary.isJubilant(genome, this) && secondary.isJubilant(genome, this)) + for (Map.Entry<ItemStack, Float> entry : + primary.getSpecialtyChances().entrySet()) { GT_Utility.ItemId id = GT_Utility.ItemId.createNoCopy(entry.getKey()); - drops.merge(id, Math.min(1f, entry.getValue() * speed) * (float) entry.getKey().stackSize * cycles, Float::sum); + drops.merge( + id, + Math.min(1f, entry.getValue() * speed) * (float) entry.getKey().stackSize * cycles, + Float::sum); dropstacks.computeIfAbsent(id, k -> entry.getKey()); } @@ -216,28 +275,27 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM IApiaristTracker breedingTracker = beeRoot.getBreedingTracker(getWorld(), getOwner()); - if(!bee.canSpawn()) { + if (!bee.canSpawn()) { ItemStack convert = new ItemStack(PluginApiculture.items.beePrincessGE); NBTTagCompound nbttagcompound = new NBTTagCompound(); queen.writeToNBT(nbttagcompound); convert.setTagCompound(nbttagcompound); this.mOutputItems[i++] = convert; - } - else { + } else { IBee b = bee.spawnPrincess(this); - if(b != null){ + if (b != null) { ItemStack princess = beeRoot.getMemberStack(b, EnumBeeType.PRINCESS.ordinal()); breedingTracker.registerPrincess(b); this.mOutputItems[i++] = princess; } IBee[] d = bee.spawnDrones(this); - if(d != null && d.length > 0) { + if (d != null && d.length > 0) { HashMap<GT_Utility.ItemId, ItemStack> drones = new HashMap<>(d.length); - for(IBee dr : d) { + for (IBee dr : d) { ItemStack drone = beeRoot.getMemberStack(dr, EnumBeeType.DRONE.ordinal()); breedingTracker.registerDrone(dr); GT_Utility.ItemId drid = GT_Utility.ItemId.createNoCopy(drone); - if(drones.containsKey(drid)) drones.get(drid).stackSize += drone.stackSize; + if (drones.containsKey(drid)) drones.get(drid).stackSize += drone.stackSize; else { this.mOutputItems[i++] = drone; drones.put(drid, drone); @@ -250,50 +308,45 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM setQueen(null); - for(Map.Entry<GT_Utility.ItemId, Float> entry : drops.entrySet()) - { + for (Map.Entry<GT_Utility.ItemId, Float> entry : drops.entrySet()) { ItemStack s = dropstacks.get(entry.getKey()).copy(); - s.stackSize = entry.getValue().intValue() + (getWorld().rand.nextFloat() < (entry.getValue() - (float) entry.getValue().intValue()) ? 1 : 0); - if(s.stackSize > 0 && i < imax) - while(true) { + s.stackSize = entry.getValue().intValue() + + (getWorld().rand.nextFloat() + < (entry.getValue() + - (float) entry.getValue().intValue()) + ? 1 + : 0); + if (s.stackSize > 0 && i < imax) + while (true) { if (s.stackSize <= s.getMaxStackSize()) { this.mOutputItems[i++] = s; break; - } else - this.mOutputItems[i++] = s.splitStack(s.getMaxStackSize()); - if(i >= imax) - break; + } else this.mOutputItems[i++] = s.splitStack(s.getMaxStackSize()); + if (i >= imax) break; } } - for(ItemStack s : pollen.values()) - if(i < imax) - this.mOutputItems[i++] = s; - else - break; + for (ItemStack s : pollen.values()) + if (i < imax) this.mOutputItems[i++] = s; + else break; // Overclock - - this.mMaxProgresstime = (int)(cycles * 550.f); + this.mMaxProgresstime = (int) (cycles * 550.f); int timemaxdivider = this.mMaxProgresstime / 100; int useddivider = 1 << this.mSpeed; int actualdivider = useddivider; this.mMaxProgresstime /= Math.min(actualdivider, timemaxdivider); actualdivider /= Math.min(actualdivider, timemaxdivider); - for(i--; i >= imin; i--) - this.mOutputItems[i].stackSize *= actualdivider; + for (i--; i >= imin; i--) this.mOutputItems[i].stackSize *= actualdivider; - pollinationDelay = Math.max((int)(this.mMaxProgresstime / cycles), 20); // don't run too often + pollinationDelay = Math.max((int) (this.mMaxProgresstime / cycles), 20); // don't run too often this.mProgresstime = 0; - this.mEUt = (int)((float)baseEUtUsage * this.energyMod * useddivider); - if(useddivider == 2) - this.mEUt += 32; - else if(useddivider > 2) - this.mEUt += (32 * (useddivider << (this.mSpeed - 2))); - } - else { + this.mEUt = (int) ((float) baseEUtUsage * this.energyMod * useddivider); + if (useddivider == 2) this.mEUt += 32; + else if (useddivider > 2) this.mEUt += (32 * (useddivider << (this.mSpeed - 2))); + } else { // Breeding time retrievingPollenInThisOperation = true; // Don't pollinate when breeding @@ -302,11 +355,9 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM this.mProgresstime = 0; int useddivider = Math.min(100, 1 << this.mSpeed); this.mMaxProgresstime /= useddivider; - this.mEUt = (int)((float)baseEUtUsage * this.energyMod * useddivider); - if(useddivider == 2) - this.mEUt += 32; - else if(useddivider > 2) - this.mEUt += (32 * (useddivider << (this.mSpeed - 2))); + this.mEUt = (int) ((float) baseEUtUsage * this.energyMod * useddivider); + if (useddivider == 2) this.mEUt += 32; + else if (useddivider > 2) this.mEUt += (32 * (useddivider << (this.mSpeed - 2))); IBee princess = beeRoot.getMember(getQueen()); usedQueenBee = princess; @@ -320,12 +371,9 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM setQueen(null); getDrone().stackSize -= 1; - if(getDrone().stackSize == 0) - setDrone(null); - + if (getDrone().stackSize == 0) setDrone(null); } - return FOUND_AND_SUCCESSFULLY_USED_RECIPE; } @@ -345,15 +393,15 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (aBaseMetaTileEntity.isClientSide()) { - if(GT_Client.changeDetected == 4) { + if (GT_Client.changeDetected == 4) { /* Client tick counter that is set to 5 on hiding pipes and covers. * It triggers a texture update next client tick when reaching 4, with provision for 3 more update tasks, * spreading client change detection related work and network traffic on different ticks, until it reaches 0. */ aBaseMetaTileEntity.issueTextureUpdate(); } - if(aBaseMetaTileEntity.isActive()){ - if(usedQueen != null) { + if (aBaseMetaTileEntity.isActive()) { + if (usedQueen != null) { if (aTick % 2 == 0) { // FX on client, effect on server IBee bee = beeRoot.getMember(usedQueen); @@ -362,98 +410,84 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM } } } - if(aBaseMetaTileEntity.isServerSide()){ + if (aBaseMetaTileEntity.isServerSide()) { mCharge = aBaseMetaTileEntity.getStoredEU() / 2 > aBaseMetaTileEntity.getEUCapacity() / 3; mDecharge = aBaseMetaTileEntity.getStoredEU() < aBaseMetaTileEntity.getEUCapacity() / 3; doDisplayThings(); - if(!aBaseMetaTileEntity.isActive()) - { - if(aBaseMetaTileEntity.isAllowedToWork() && (aBaseMetaTileEntity.hasInventoryBeenModified() || aTick % 600 == 0 || aBaseMetaTileEntity.hasWorkJustBeenEnabled()) && hasEnoughEnergyToCheckRecipe()) - { + if (!aBaseMetaTileEntity.isActive()) { + if (aBaseMetaTileEntity.isAllowedToWork() + && (aBaseMetaTileEntity.hasInventoryBeenModified() + || aTick % 600 == 0 + || aBaseMetaTileEntity.hasWorkJustBeenEnabled()) + && hasEnoughEnergyToCheckRecipe()) { int check = checkRecipe(); - if(check == FOUND_AND_SUCCESSFULLY_USED_RECIPE) { + if (check == FOUND_AND_SUCCESSFULLY_USED_RECIPE) { aBaseMetaTileEntity.setActive(true); } } - } - else{ + } else { - if(this.mProgresstime < 0) - { + if (this.mProgresstime < 0) { this.mProgresstime++; return; } - if(this.mStuttering) - { - if(!aBaseMetaTileEntity.isAllowedToWork()) - return; - if(aTick % 100 == 0) - this.mStuttering = false; + if (this.mStuttering) { + if (!aBaseMetaTileEntity.isAllowedToWork()) return; + if (aTick % 100 == 0) this.mStuttering = false; return; } - if(this.hasErrors()) - { - if(!aBaseMetaTileEntity.isAllowedToWork()) - return; - if(aTick % 100 == 0) - if(!canWork(usedQueen)) - this.stutterProcess(); + if (this.hasErrors()) { + if (!aBaseMetaTileEntity.isAllowedToWork()) return; + if (aTick % 100 == 0) if (!canWork(usedQueen)) this.stutterProcess(); return; } - if(!drainEnergyForProcess(this.mEUt)) - { + if (!drainEnergyForProcess(this.mEUt)) { this.mStuttering = true; this.stutterProcess(); return; } this.mProgresstime++; - if(usedQueen != null) { - if(usedQueenBee == null) - usedQueenBee = beeRoot.getMember(usedQueen); + if (usedQueen != null) { + if (usedQueenBee == null) usedQueenBee = beeRoot.getMember(usedQueen); effectData = usedQueenBee.doEffect(effectData, this); - if(!retrievingPollenInThisOperation && floweringMod > 0f && this.mProgresstime % pollinationDelay == 0) - { - if(retrievedpollen == null) - retrievedpollen = usedQueenBee.retrievePollen(this); - if(retrievedpollen != null && (usedQueenBee.pollinateRandom(this, retrievedpollen) || this.mProgresstime % (pollinationDelay * 5) == 0)) - retrievedpollen = null; + if (!retrievingPollenInThisOperation + && floweringMod > 0f + && this.mProgresstime % pollinationDelay == 0) { + if (retrievedpollen == null) retrievedpollen = usedQueenBee.retrievePollen(this); + if (retrievedpollen != null + && (usedQueenBee.pollinateRandom(this, retrievedpollen) + || this.mProgresstime % (pollinationDelay * 5) == 0)) retrievedpollen = null; } } - if(this.mProgresstime % 100 == 0) - { - if(!canWork(usedQueen)) - { + if (this.mProgresstime % 100 == 0) { + if (!canWork(usedQueen)) { this.stutterProcess(); return; } } - if(this.mProgresstime >= this.mMaxProgresstime) - { + if (this.mProgresstime >= this.mMaxProgresstime) { updateModifiers(); for (int i = 0; i < mOutputItems.length; i++) - if(mOutputItems[i] != null) + if (mOutputItems[i] != null) for (int j = 0; j < mOutputItems.length; j++) { - if(j == 0 && isAutomated) - { - if(beeRoot.isMember(mOutputItems[i], EnumBeeType.QUEEN.ordinal()) || beeRoot.isMember(mOutputItems[i], EnumBeeType.PRINCESS.ordinal())) { - if(aBaseMetaTileEntity.addStackToSlot(queen, mOutputItems[i])) - break; - } - else if(beeRoot.isMember(mOutputItems[i], EnumBeeType.DRONE.ordinal())) - if(aBaseMetaTileEntity.addStackToSlot(drone, mOutputItems[i])) - break; - } - else if(i == 0 && j == 0 && beeRoot.isMember(mOutputItems[0], EnumBeeType.QUEEN.ordinal())) - if(aBaseMetaTileEntity.addStackToSlot(queen, mOutputItems[0])) - break; - if (aBaseMetaTileEntity.addStackToSlot(getOutputSlot() + ((j + i) % mOutputItems.length), mOutputItems[i])) - break; + if (j == 0 && isAutomated) { + if (beeRoot.isMember(mOutputItems[i], EnumBeeType.QUEEN.ordinal()) + || beeRoot.isMember(mOutputItems[i], EnumBeeType.PRINCESS.ordinal())) { + if (aBaseMetaTileEntity.addStackToSlot(queen, mOutputItems[i])) break; + } else if (beeRoot.isMember(mOutputItems[i], EnumBeeType.DRONE.ordinal())) + if (aBaseMetaTileEntity.addStackToSlot(drone, mOutputItems[i])) break; + } else if (i == 0 + && j == 0 + && beeRoot.isMember(mOutputItems[0], EnumBeeType.QUEEN.ordinal())) + if (aBaseMetaTileEntity.addStackToSlot(queen, mOutputItems[0])) break; + if (aBaseMetaTileEntity.addStackToSlot( + getOutputSlot() + ((j + i) % mOutputItems.length), mOutputItems[i])) break; } Arrays.fill(mOutputItems, null); mEUt = 0; @@ -463,25 +497,38 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM aBaseMetaTileEntity.setActive(false); if (doesAutoOutput() && !isOutputEmpty() && aBaseMetaTileEntity.getFrontFacing() != mMainFacing) { - TileEntity tTileEntity2 = aBaseMetaTileEntity.getTileEntityAtSide(aBaseMetaTileEntity.getFrontFacing()); + TileEntity tTileEntity2 = + aBaseMetaTileEntity.getTileEntityAtSide(aBaseMetaTileEntity.getFrontFacing()); long tStoredEnergy = aBaseMetaTileEntity.getUniversalEnergyStored(); - int tMaxStacks = (int)(tStoredEnergy/64L); - if (tMaxStacks > mOutputItems.length) - tMaxStacks = mOutputItems.length; - - moveMultipleItemStacks(aBaseMetaTileEntity, tTileEntity2, aBaseMetaTileEntity.getFrontFacing(), aBaseMetaTileEntity.getBackFacing(), null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1,tMaxStacks); + int tMaxStacks = (int) (tStoredEnergy / 64L); + if (tMaxStacks > mOutputItems.length) tMaxStacks = mOutputItems.length; + + moveMultipleItemStacks( + aBaseMetaTileEntity, + tTileEntity2, + aBaseMetaTileEntity.getFrontFacing(), + aBaseMetaTileEntity.getBackFacing(), + null, + false, + (byte) 64, + (byte) 1, + (byte) 64, + (byte) 1, + tMaxStacks); } - if(aBaseMetaTileEntity.isAllowedToWork() && checkRecipe() == FOUND_AND_SUCCESSFULLY_USED_RECIPE) + if (aBaseMetaTileEntity.isAllowedToWork() && checkRecipe() == FOUND_AND_SUCCESSFULLY_USED_RECIPE) aBaseMetaTileEntity.setActive(true); } } } } - public void cancelProcess(){ - if(this.getBaseMetaTileEntity().isActive() && this.getBaseMetaTileEntity().isServerSide() && usedQueen != null && beeRoot.isMember(usedQueen, EnumBeeType.QUEEN.ordinal())) - { + public void cancelProcess() { + if (this.getBaseMetaTileEntity().isActive() + && this.getBaseMetaTileEntity().isServerSide() + && usedQueen != null + && beeRoot.isMember(usedQueen, EnumBeeType.QUEEN.ordinal())) { Arrays.fill(mOutputItems, null); mEUt = 0; mProgresstime = 0; @@ -495,59 +542,46 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM @Override public boolean isItemValidForSlot(int aIndex, ItemStack aStack) { - if(aStack == null) return false; - if(aIndex < getInputSlot()) - return true; - if(aIndex == queen) return beeRoot.isMember(aStack, EnumBeeType.QUEEN.ordinal()) || beeRoot.isMember(aStack, EnumBeeType.PRINCESS.ordinal()); - else if(aIndex == drone) return beeRoot.isMember(aStack, EnumBeeType.DRONE.ordinal()); - else if(aIndex < getOutputSlot()) { - if(!(aStack.getItem() instanceof IApiaryUpgrade) && !GT_ApiaryUpgrade.isUpgrade(aStack)) - return false; - for(int i = drone+1; i < drone+1+4; i++) - { - if(aIndex == i) - continue; + if (aStack == null) return false; + if (aIndex < getInputSlot()) return true; + if (aIndex == queen) + return beeRoot.isMember(aStack, EnumBeeType.QUEEN.ordinal()) + || beeRoot.isMember(aStack, EnumBeeType.PRINCESS.ordinal()); + else if (aIndex == drone) return beeRoot.isMember(aStack, EnumBeeType.DRONE.ordinal()); + else if (aIndex < getOutputSlot()) { + if (!(aStack.getItem() instanceof IApiaryUpgrade) && !GT_ApiaryUpgrade.isUpgrade(aStack)) return false; + for (int i = drone + 1; i < drone + 1 + 4; i++) { + if (aIndex == i) continue; ItemStack s = getStackInSlot(i); - if(s == null) - continue; - if(GT_Utility.areStacksEqual(getStackInSlot(i), aStack)) - return false; - if(GT_ApiaryUpgrade.isUpgrade(aStack)) - { - if(!GT_ApiaryUpgrade.getUpgrade(aStack).isAllowedToWorkWith(getStackInSlot(i))) - return false; - } - else if(GT_ApiaryUpgrade.isUpgrade(s)) - { - if(!GT_ApiaryUpgrade.getUpgrade(s).isAllowedToWorkWith(aStack)) - return false; + if (s == null) continue; + if (GT_Utility.areStacksEqual(getStackInSlot(i), aStack)) return false; + if (GT_ApiaryUpgrade.isUpgrade(aStack)) { + if (!GT_ApiaryUpgrade.getUpgrade(aStack).isAllowedToWorkWith(getStackInSlot(i))) return false; + } else if (GT_ApiaryUpgrade.isUpgrade(s)) { + if (!GT_ApiaryUpgrade.getUpgrade(s).isAllowedToWorkWith(aStack)) return false; } } return true; - } - else return false; - + } else return false; } @Override public void setInventorySlotContents(int aIndex, ItemStack aStack) { - if(aIndex == queen && aStack != null && getBaseMetaTileEntity().isClientSide()) - usedQueen = aStack.copy(); + if (aIndex == queen && aStack != null && getBaseMetaTileEntity().isClientSide()) usedQueen = aStack.copy(); super.setInventorySlotContents(aIndex, aStack); } // Gets called on slot click // - public void onInventoryUpdate(int aIndex){ - if(aIndex > drone && aIndex < getOutputSlot()) - updateModifiers(); + public void onInventoryUpdate(int aIndex) { + if (aIndex > drone && aIndex < getOutputSlot()) updateModifiers(); } @SideOnly(Side.CLIENT) - public ItemStack getUsedQueen(){ + public ItemStack getUsedQueen() { return usedQueen; } - //region IBeeHousing + // region IBeeHousing @Override public Iterable<IBeeModifier> getBeeModifiers() { @@ -576,7 +610,7 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM @Override public boolean canBlockSeeTheSky() { - return this.getBaseMetaTileEntity().getSkyAtSide((byte)1); + return this.getBaseMetaTileEntity().getSkyAtSide((byte) 1); } @Override @@ -588,29 +622,31 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM @Override public GameProfile getOwner() { - if(owner == null) - owner = new GameProfile(this.getBaseMetaTileEntity().getOwnerUuid(), this.getBaseMetaTileEntity().getOwnerName()); + if (owner == null) + owner = new GameProfile( + this.getBaseMetaTileEntity().getOwnerUuid(), + this.getBaseMetaTileEntity().getOwnerName()); return owner; } @Override public Vec3 getBeeFXCoordinates() { - return Vec3.createVectorHelper(getBaseMetaTileEntity().getXCoord() + 0.5, getBaseMetaTileEntity().getYCoord() + 0.5, getBaseMetaTileEntity().getZCoord() + 0.5); + return Vec3.createVectorHelper( + getBaseMetaTileEntity().getXCoord() + 0.5, + getBaseMetaTileEntity().getYCoord() + 0.5, + getBaseMetaTileEntity().getZCoord() + 0.5); } @Override public BiomeGenBase getBiome() { - if(biomeOverride == null) - return this.getBaseMetaTileEntity().getBiome(); + if (biomeOverride == null) return this.getBaseMetaTileEntity().getBiome(); return biomeOverride; } @Override public EnumTemperature getTemperature() { - if(BiomeHelper.isBiomeHellish(getBiome())) - return EnumTemperature.HELLISH; - return - EnumTemperature.getFromValue(getBiome().temperature + temperatureMod); + if (BiomeHelper.isBiomeHellish(getBiome())) return EnumTemperature.HELLISH; + return EnumTemperature.getFromValue(getBiome().temperature + temperatureMod); } @Override @@ -628,9 +664,9 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM return this.getBaseMetaTileEntity().getCoords(); } - //endregion + // endregion -//region IBeeHousingInventory + // region IBeeHousingInventory @Override public ItemStack getQueen() { return getStackInSlot(queen); @@ -655,18 +691,16 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM public boolean addProduct(ItemStack itemStack, boolean b) { throw new RuntimeException("Should not happen :F"); } -//endregion + // endregion -//region IErrorLogic + // region IErrorLogic public HashSet<IErrorState> mErrorStates = new HashSet<>(); @Override public boolean setCondition(boolean b, IErrorState iErrorState) { - if(b) - mErrorStates.add(iErrorState); - else - mErrorStates.remove(iErrorState); + if (b) mErrorStates.add(iErrorState); + else mErrorStates.remove(iErrorState); return b; } @@ -688,13 +722,12 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM @Override public void writeData(DataOutputStream dataOutputStream) throws IOException { dataOutputStream.write(mErrorStates.size()); - for(IErrorState s : mErrorStates) - dataOutputStream.writeUTF(s.getUniqueName()); + for (IErrorState s : mErrorStates) dataOutputStream.writeUTF(s.getUniqueName()); } @Override public void readData(DataInputStream dataInputStream) throws IOException { - for(int i = dataInputStream.readInt(); i > 0; i--) + for (int i = dataInputStream.readInt(); i > 0; i--) mErrorStates.add(ForestryAPI.errorStateRegistry.getErrorState(dataInputStream.readUTF())); } @@ -708,26 +741,25 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM private Block flowerBlock; private int flowerBlockMeta; - - private boolean checkFlower(IBee bee){ + private boolean checkFlower(IBee bee) { String flowerType = bee.getGenome().getFlowerProvider().getFlowerType(); - if(!this.flowerType.equals(flowerType)) - flowercoords = null; - if(flowercoords != null) { - if( getWorld().getBlock(flowercoords.posX, flowercoords.posY, flowercoords.posZ) != flowerBlock - || getWorld().getBlockMetadata(flowercoords.posX, flowercoords.posY, flowercoords.posZ) != flowerBlockMeta) - if (!FlowerManager.flowerRegistry.isAcceptedFlower(flowerType, getWorld(), flowercoords.posX, flowercoords.posY, flowercoords.posZ)) + if (!this.flowerType.equals(flowerType)) flowercoords = null; + if (flowercoords != null) { + if (getWorld().getBlock(flowercoords.posX, flowercoords.posY, flowercoords.posZ) != flowerBlock + || getWorld().getBlockMetadata(flowercoords.posX, flowercoords.posY, flowercoords.posZ) + != flowerBlockMeta) + if (!FlowerManager.flowerRegistry.isAcceptedFlower( + flowerType, getWorld(), flowercoords.posX, flowercoords.posY, flowercoords.posZ)) flowercoords = null; - else - { + else { flowerBlock = getWorld().getBlock(flowercoords.posX, flowercoords.posY, flowercoords.posZ); - flowerBlockMeta = getWorld().getBlockMetadata(flowercoords.posX, flowercoords.posY, flowercoords.posZ); + flowerBlockMeta = + getWorld().getBlockMetadata(flowercoords.posX, flowercoords.posY, flowercoords.posZ); } } - if(flowercoords == null) { + if (flowercoords == null) { flowercoords = FlowerManager.flowerRegistry.getAcceptedFlowerCoordinates(this, bee, flowerType); - if(flowercoords != null) - { + if (flowercoords != null) { flowerBlock = getWorld().getBlock(flowercoords.posX, flowercoords.posY, flowercoords.posZ); flowerBlockMeta = getWorld().getBlockMetadata(flowercoords.posX, flowercoords.posY, flowercoords.posZ); this.flowerType = flowerType; @@ -736,46 +768,37 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM return flowercoords != null; } - private boolean canWork(ItemStack queen){ + private boolean canWork(ItemStack queen) { clearErrors(); - if(queen == null) - return true; // Reloaded the chunk ? - if(beeRoot.isMember(queen, EnumBeeType.PRINCESS.ordinal())) - return true; + if (queen == null) return true; // Reloaded the chunk ? + if (beeRoot.isMember(queen, EnumBeeType.PRINCESS.ordinal())) return true; IBee bee = beeRoot.getMember(queen); - for(IErrorState err : bee.getCanWork(this)) - setCondition(true, err); + for (IErrorState err : bee.getCanWork(this)) setCondition(true, err); setCondition(!checkFlower(bee), EnumErrorCode.NO_FLOWER); return !hasErrors(); } - private boolean canWork(){ + private boolean canWork() { clearErrors(); EnumBeeType beeType = beeRoot.getType(getQueen()); - if(beeType == EnumBeeType.PRINCESS) - { + if (beeType == EnumBeeType.PRINCESS) { setCondition(!beeRoot.isDrone(getDrone()), EnumErrorCode.NO_DRONE); return !hasErrors(); } - if(beeType == EnumBeeType.QUEEN) - { + if (beeType == EnumBeeType.QUEEN) { IBee bee = beeRoot.getMember(getQueen()); - for(IErrorState err : bee.getCanWork(this)) - setCondition(true, err); + for (IErrorState err : bee.getCanWork(this)) setCondition(true, err); setCondition(!checkFlower(bee), EnumErrorCode.NO_FLOWER); return !hasErrors(); - } - else - { + } else { setCondition(true, EnumErrorCode.NO_QUEEN); return false; } } + // endregion -//endregion - - //region IBeeModifier + // region IBeeModifier private float terrorityMod = 1f; private float mutationMod = 1f; @@ -795,31 +818,24 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM private int maxspeed = 0; - public void updateModifiers(){ + public void updateModifiers() { maxspeed = 0; ApiaryModifiers mods = new ApiaryModifiers(); - for(int i = 2; i < 2+4; i++) - { + for (int i = 2; i < 2 + 4; i++) { ItemStack s = getInputAt(i); - if(s == null) - continue; - if(s.getItem() instanceof IApiaryUpgrade) { + if (s == null) continue; + if (s.getItem() instanceof IApiaryUpgrade) { IApiaryUpgrade up = (IApiaryUpgrade) s.getItem(); up.applyModifiers(mods, s); - } - else if(GT_ApiaryUpgrade.isUpgrade(s)) - { + } else if (GT_ApiaryUpgrade.isUpgrade(s)) { GT_ApiaryUpgrade upgrade = GT_ApiaryUpgrade.getUpgrade(s); - if(upgrade != null) - { + if (upgrade != null) { maxspeed = upgrade.applyMaxSpeedModifier(maxspeed); upgrade.applyModifiers(mods, s); } } } - - terrorityMod = mods.territory; mutationMod = mods.mutation; lifespanMod = mods.lifespan; @@ -836,10 +852,8 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM isAutomated = mods.isAutomated; isRetrievingPollen = mods.isCollectingPollen; - if(mLockedSpeed) - mSpeed = maxspeed; - else - mSpeed = Math.min(mSpeed, maxspeed); + if (mLockedSpeed) mSpeed = maxspeed; + else mSpeed = Math.min(mSpeed, maxspeed); } @Override @@ -891,37 +905,31 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM return sunlightSimulatedMod; } - @Override public boolean isHellish() { return getBiome() == BiomeGenBase.hell; } - public int getMaxSpeed(){ + public int getMaxSpeed() { return maxspeed; } - //endregion + // endregion - //region IBeeListener + // region IBeeListener @Override - public void wearOutEquipment(int i) { - - } + public void wearOutEquipment(int i) {} @Override - public void onQueenDeath() { - - } + public void onQueenDeath() {} @Override public boolean onPollenRetrieved(IIndividual iIndividual) { return false; } - - //endregion + // endregion static final IBeekeepingLogic dummylogic = new IBeekeepingLogic() { @Override @@ -930,19 +938,13 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM } @Override - public void doWork() { - - } + public void doWork() {} @Override - public void syncToClient() { - - } + public void syncToClient() {} @Override - public void syncToClient(EntityPlayerMP entityPlayerMP) { - - } + public void syncToClient(EntityPlayerMP entityPlayerMP) {} @Override public int getBeeProgressPercent() { @@ -955,20 +957,12 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM } @Override - public void doBeeFX() { - - } + public void doBeeFX() {} @Override - public void readFromNBT(NBTTagCompound nbtTagCompound) { - - } + public void readFromNBT(NBTTagCompound nbtTagCompound) {} @Override - public void writeToNBT(NBTTagCompound nbtTagCompound) { - - } + public void writeToNBT(NBTTagCompound nbtTagCompound) {} }; - - } diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Massfabricator.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Massfabricator.java index 5de1537d9e..b68d3bc436 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Massfabricator.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Massfabricator.java @@ -1,5 +1,8 @@ package gregtech.common.tileentities.machines.basic; +import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.Textures.BlockIcons.*; + import gregtech.api.enums.ConfigCategories; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; @@ -14,12 +17,8 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.power.BasicMachineEUPower; import gregtech.common.power.Power; -import net.minecraftforge.fluids.FluidStack; - import java.util.Arrays; - -import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.enums.Textures.BlockIcons.*; +import net.minecraftforge.fluids.FluidStack; public class GT_MetaTileEntity_Massfabricator extends GT_MetaTileEntity_BasicMachine { public static int sUUAperUUM = 1; @@ -29,47 +28,89 @@ public class GT_MetaTileEntity_Massfabricator extends GT_MetaTileEntity_BasicMac protected final long EUt; public GT_MetaTileEntity_Massfabricator(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 1, "UUM = Matter * Fabrication Squared", 1, 1, "Massfabricator.png", "", + super( + aID, + aName, + aNameRegional, + aTier, + 1, + "UUM = Matter * Fabrication Squared", + 1, + 1, + "Massfabricator.png", + "", TextureFactory.of( TextureFactory.of(OVERLAY_SIDE_MASSFAB_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_SIDE_MASSFAB_ACTIVE_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_MASSFAB_ACTIVE_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_SIDE_MASSFAB), - TextureFactory.builder().addIcon(OVERLAY_SIDE_MASSFAB_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_MASSFAB_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_FRONT_MASSFAB_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_FRONT_MASSFAB_ACTIVE_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_MASSFAB_ACTIVE_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_FRONT_MASSFAB), - TextureFactory.builder().addIcon(OVERLAY_FRONT_MASSFAB_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_MASSFAB_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_TOP_MASSFAB_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_TOP_MASSFAB_ACTIVE_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_TOP_MASSFAB_ACTIVE_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_TOP_MASSFAB), - TextureFactory.builder().addIcon(OVERLAY_TOP_MASSFAB_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_TOP_MASSFAB_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_BOTTOM_MASSFAB_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_BOTTOM_MASSFAB_ACTIVE_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_MASSFAB_ACTIVE_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_BOTTOM_MASSFAB), - TextureFactory.builder().addIcon(OVERLAY_BOTTOM_MASSFAB_GLOW).glow().build())); + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_MASSFAB_GLOW) + .glow() + .build())); EUt = V[1] * (long) Math.pow(2, mTier + 2); } - public GT_MetaTileEntity_Massfabricator(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { + public GT_MetaTileEntity_Massfabricator( + String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); EUt = V[1] * (long) Math.pow(2, mTier + 2); } - public GT_MetaTileEntity_Massfabricator(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { + public GT_MetaTileEntity_Massfabricator( + String aName, + int aTier, + String[] aDescription, + ITexture[][][] aTextures, + String aGUIName, + String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); EUt = V[1] * (long) Math.pow(2, mTier + 2); } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Massfabricator(this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName); + return new GT_MetaTileEntity_Massfabricator( + this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName); } @Override @@ -85,7 +126,8 @@ public class GT_MetaTileEntity_Massfabricator extends GT_MetaTileEntity_BasicMac @Override public void onConfigLoad(GT_Config aConfig) { super.onConfigLoad(aConfig); - sDurationMultiplier = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUM_Duration_Multiplier", sDurationMultiplier); + sDurationMultiplier = aConfig.get( + ConfigCategories.machineconfig, "Massfabricator.UUM_Duration_Multiplier", sDurationMultiplier); sUUAperUUM = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUA_per_UUM", sUUAperUUM); sUUASpeedBonus = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUA_Speed_Bonus", sUUASpeedBonus); sRequiresUUA = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUA_Requirement", sRequiresUUA); @@ -107,15 +149,21 @@ public class GT_MetaTileEntity_Massfabricator extends GT_MetaTileEntity_BasicMac FluidStack tFluid = getDrainableStack(); if ((tFluid == null) || (tFluid.amount < getCapacity())) { this.mOutputFluid = Materials.UUMatter.getFluid(1L); - calculateOverclockedNess((int) EUt, containsUUA(getFillableStack()) ? sDurationMultiplier / sUUASpeedBonus : sDurationMultiplier); - //In case recipe is too OP for that machine + calculateOverclockedNess( + (int) EUt, + containsUUA(getFillableStack()) ? sDurationMultiplier / sUUASpeedBonus : sDurationMultiplier); + // In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; if (containsUUA(tFluid = getFillableStack())) { tFluid.amount -= sUUAperUUM; return FOUND_AND_SUCCESSFULLY_USED_RECIPE; } - return sRequiresUUA || Arrays.stream(getAllInputs()).anyMatch(s -> ItemList.Circuit_Integrated.isStackEqual(s, true, true)) ? FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS : FOUND_AND_SUCCESSFULLY_USED_RECIPE; + return sRequiresUUA + || Arrays.stream(getAllInputs()) + .anyMatch(s -> ItemList.Circuit_Integrated.isStackEqual(s, true, true)) + ? FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS + : FOUND_AND_SUCCESSFULLY_USED_RECIPE; } return DID_NOT_FIND_RECIPE; } @@ -136,9 +184,7 @@ public class GT_MetaTileEntity_Massfabricator extends GT_MetaTileEntity_BasicMac } private boolean containsUUA(FluidStack aFluid) { - return aFluid != null - && aFluid.amount >= sUUAperUUM - && aFluid.isFluidEqual(Materials.UUAmplifier.getFluid(1L)); + return aFluid != null && aFluid.amount >= sUUAperUUM && aFluid.isFluidEqual(Materials.UUAmplifier.getFluid(1L)); } protected class MassfabricatorPower extends BasicMachineEUPower { @@ -151,18 +197,18 @@ public class GT_MetaTileEntity_Massfabricator extends GT_MetaTileEntity_BasicMac originalVoltage = computeVoltageForEuRate(euPerTick); if (mTier == 0) { - //Long time calculation + // Long time calculation long xMaxProgresstime = ((long) duration) << 1; if (xMaxProgresstime > Integer.MAX_VALUE - 1) { - //make impossible if too long + // make impossible if too long recipeEuPerTick = Integer.MAX_VALUE - 1; recipeDuration = Integer.MAX_VALUE - 1; } else { - recipeEuPerTick = (int) (V[1] << 2);//2^2=4 so shift <<2 + recipeEuPerTick = (int) (V[1] << 2); // 2^2=4 so shift <<2 recipeDuration = (int) xMaxProgresstime; } } else { - //Long EUt calculation + // Long EUt calculation long xEUt = EUt; long tempEUt = V[1]; @@ -170,20 +216,19 @@ public class GT_MetaTileEntity_Massfabricator extends GT_MetaTileEntity_BasicMac recipeDuration = duration; while (tempEUt <= V[mTier - 1]) { - tempEUt <<= 2;//this actually controls overclocking - recipeDuration >>= 1;//this is effect of overclocking + tempEUt <<= 2; // this actually controls overclocking + recipeDuration >>= 1; // this is effect of overclocking if (recipeDuration == 0) - xEUt = (long) (xEUt / 1.1D);//U know, if the time is less than 1 tick make the machine use less power + xEUt = (long) (xEUt + / 1.1D); // U know, if the time is less than 1 tick make the machine use less power } if (xEUt > Integer.MAX_VALUE - 1) { recipeEuPerTick = Integer.MAX_VALUE - 1; recipeDuration = Integer.MAX_VALUE - 1; } else { recipeEuPerTick = (int) xEUt; - if (recipeEuPerTick == 0) - recipeEuPerTick = 1; - if (recipeDuration == 0) - recipeDuration = 1;//set time to 1 tick + if (recipeEuPerTick == 0) recipeEuPerTick = 1; + if (recipeDuration == 0) recipeDuration = 1; // set time to 1 tick } } wasOverclocked = checkIfOverclocked(); diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_MicrowaveEnergyTransmitter.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_MicrowaveEnergyTransmitter.java index 803bc7e163..8616b98fae 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_MicrowaveEnergyTransmitter.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_MicrowaveEnergyTransmitter.java @@ -1,5 +1,12 @@ package gregtech.common.tileentities.machines.basic; +import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TELEPORTER; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TELEPORTER_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TELEPORTER_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TELEPORTER_GLOW; + import gregtech.api.GregTech_API; import gregtech.api.enums.ConfigCategories; import gregtech.api.enums.Materials; @@ -23,13 +30,6 @@ import net.minecraft.world.World; import net.minecraftforge.common.DimensionManager; import net.minecraftforge.fluids.FluidStack; -import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TELEPORTER; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TELEPORTER_ACTIVE; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TELEPORTER_ACTIVE_GLOW; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TELEPORTER_GLOW; - public class GT_MetaTileEntity_MicrowaveEnergyTransmitter extends GT_MetaTileEntity_BasicTank { private static boolean sInterDimensionalTeleportAllowed = true; @@ -49,14 +49,21 @@ public class GT_MetaTileEntity_MicrowaveEnergyTransmitter extends GT_MetaTileEnt public TileEntity tTile = null; public GT_MetaTileEntity_MicrowaveEnergyTransmitter(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 3, new String[]{"Transmits Energy Wirelessly", "Use Nitrogen Plasma", "for Inter-dimensional transmission", "0.004EU Loss per 100 Blocks"}); + super(aID, aName, aNameRegional, aTier, 3, new String[] { + "Transmits Energy Wirelessly", + "Use Nitrogen Plasma", + "for Inter-dimensional transmission", + "0.004EU Loss per 100 Blocks" + }); } - public GT_MetaTileEntity_MicrowaveEnergyTransmitter(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_MicrowaveEnergyTransmitter( + String aName, int aTier, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, 3, aDescription, aTextures); } - public GT_MetaTileEntity_MicrowaveEnergyTransmitter(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_MicrowaveEnergyTransmitter( + String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, 3, aDescription, aTextures); } @@ -80,33 +87,52 @@ public class GT_MetaTileEntity_MicrowaveEnergyTransmitter extends GT_MetaTileEnt @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_MicrowaveEnergyTransmitter(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); + return new GT_MetaTileEntity_MicrowaveEnergyTransmitter( + this.mName, this.mTier, this.mDescriptionArray, this.mTextures); } @Override public String[] getInfoData() { - return new String[]{ - "Coordinates:", - "X: " + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(this.mTargetX) + EnumChatFormatting.RESET, - "Y: " + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(this.mTargetY) + EnumChatFormatting.RESET, - "Z: " + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(this.mTargetZ) + EnumChatFormatting.RESET, - "Dimension: " + EnumChatFormatting.GREEN+this.mTargetD+EnumChatFormatting.RESET, - "Dimension Valid: " + (GT_Utility.isRealDimension(this.mTargetD) ? EnumChatFormatting.GREEN+"Yes"+EnumChatFormatting.RESET : EnumChatFormatting.RED+"No"+EnumChatFormatting.RESET), - "Dimension Registered: " + (DimensionManager.isDimensionRegistered(this.mTargetD) ? EnumChatFormatting.GREEN+"Yes"+EnumChatFormatting.RESET : EnumChatFormatting.RED+"No"+EnumChatFormatting.RESET) + return new String[] { + "Coordinates:", + "X: " + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(this.mTargetX) + EnumChatFormatting.RESET, + "Y: " + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(this.mTargetY) + EnumChatFormatting.RESET, + "Z: " + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(this.mTargetZ) + EnumChatFormatting.RESET, + "Dimension: " + EnumChatFormatting.GREEN + this.mTargetD + EnumChatFormatting.RESET, + "Dimension Valid: " + + (GT_Utility.isRealDimension(this.mTargetD) + ? EnumChatFormatting.GREEN + "Yes" + EnumChatFormatting.RESET + : EnumChatFormatting.RED + "No" + EnumChatFormatting.RESET), + "Dimension Registered: " + + (DimensionManager.isDimensionRegistered(this.mTargetD) + ? EnumChatFormatting.GREEN + "Yes" + EnumChatFormatting.RESET + : EnumChatFormatting.RED + "No" + EnumChatFormatting.RESET) }; } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - if (aSide == 0) return new ITexture[]{MACHINE_CASINGS[mTier][aColorIndex + 1]}; - if (aActive) return new ITexture[]{ + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { + if (aSide == 0) return new ITexture[] {MACHINE_CASINGS[mTier][aColorIndex + 1]}; + if (aActive) + return new ITexture[] { MACHINE_CASINGS[mTier][aColorIndex + 1], TextureFactory.of(OVERLAY_TELEPORTER_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_TELEPORTER_ACTIVE_GLOW).glow().build()}; - return new ITexture[]{ - MACHINE_CASINGS[mTier][aColorIndex + 1], - TextureFactory.of(OVERLAY_TELEPORTER), - TextureFactory.builder().addIcon(OVERLAY_TELEPORTER_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_TELEPORTER_ACTIVE_GLOW) + .glow() + .build() + }; + return new ITexture[] { + MACHINE_CASINGS[mTier][aColorIndex + 1], + TextureFactory.of(OVERLAY_TELEPORTER), + TextureFactory.builder().addIcon(OVERLAY_TELEPORTER_GLOW).glow().build() + }; } @Override @@ -131,7 +157,8 @@ public class GT_MetaTileEntity_MicrowaveEnergyTransmitter extends GT_MetaTileEnt @Override public void onConfigLoad(GT_Config aConfig) { - sInterDimensionalTeleportAllowed = aConfig.get(ConfigCategories.machineconfig, "Teleporter.Interdimensional", true); + sInterDimensionalTeleportAllowed = + aConfig.get(ConfigCategories.machineconfig, "Teleporter.Interdimensional", true); mMaxLoss = Math.max(aConfig.get(ConfigCategories.machineconfig, "MicrowaveTransmitter.MaxLoss", 50), 11); mMaxLossDistance = aConfig.get(ConfigCategories.machineconfig, "MicrowaveTransmitter.MaxLossDistance", 10000); mPassiveEnergyUse = aConfig.get(ConfigCategories.machineconfig, "MicrowaveTransmitter.PassiveEnergy", true); @@ -154,7 +181,8 @@ public class GT_MetaTileEntity_MicrowaveEnergyTransmitter extends GT_MetaTileEnt for (byte i = -5; i <= 5; i = (byte) (i + 1)) { for (byte j = -5; j <= 5; j = (byte) (j + 1)) { for (byte k = -5; k <= 5; k = (byte) (k + 1)) { - if (getBaseMetaTileEntity().getBlockOffset(i, j, k) == GregTech_API.sBlockMetal5 && getBaseMetaTileEntity().getMetaIDOffset(i, j, k) == 8) {//require osmiridium block + if (getBaseMetaTileEntity().getBlockOffset(i, j, k) == GregTech_API.sBlockMetal5 + && getBaseMetaTileEntity().getMetaIDOffset(i, j, k) == 8) { // require osmiridium block return true; } } @@ -164,20 +192,19 @@ public class GT_MetaTileEntity_MicrowaveEnergyTransmitter extends GT_MetaTileEnt } public boolean hasDimensionalTeleportCapability() { - return this.mDebug || - ( - sInterDimensionalTeleportAllowed && - ( - this.hasBlock || - mFluid != null && mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1)) && mFluid.amount >= 1000 - - ) - ) - ; + return this.mDebug + || (sInterDimensionalTeleportAllowed + && (this.hasBlock + || mFluid != null + && mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1)) + && mFluid.amount >= 1000)); } public boolean isDimensionalTeleportAvailable() { - return this.mDebug || (hasDimensionalTeleportCapability() && GT_Utility.isRealDimension(this.mTargetD) && GT_Utility.isRealDimension(getBaseMetaTileEntity().getWorld().provider.dimensionId)); + return this.mDebug + || (hasDimensionalTeleportCapability() + && GT_Utility.isRealDimension(this.mTargetD) + && GT_Utility.isRealDimension(getBaseMetaTileEntity().getWorld().provider.dimensionId)); } @Override @@ -190,12 +217,15 @@ public class GT_MetaTileEntity_MicrowaveEnergyTransmitter extends GT_MetaTileEnt if (getBaseMetaTileEntity().getTimer() % 100L == 50L) { this.hasBlock = checkForBlock(); } - if ((getBaseMetaTileEntity().isAllowedToWork()) && (getBaseMetaTileEntity().getRedstone())) { + if ((getBaseMetaTileEntity().isAllowedToWork()) + && (getBaseMetaTileEntity().getRedstone())) { if (getBaseMetaTileEntity().getStoredEU() > (V[mTier] * 16)) { if (mPassiveEnergyUse) { - getBaseMetaTileEntity().decreaseStoredEnergyUnits(2L<<(mTier-1), false); + getBaseMetaTileEntity().decreaseStoredEnergyUnits(2L << (mTier - 1), false); } - if (hasDimensionalTeleportCapability() && this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId && mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1))) { + if (hasDimensionalTeleportCapability() + && this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId + && mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1))) { mFluid.amount--; if (mFluid.amount < 1) { mFluid = null; @@ -216,20 +246,21 @@ public class GT_MetaTileEntity_MicrowaveEnergyTransmitter extends GT_MetaTileEnt } } int tDistance = distanceCalculation(); - if(tTile!=null) { + if (tTile != null) { if (tTile instanceof IEnergyConnected) { - long packetSize=V[mTier]; - if(tTile instanceof IGregTechTileEntity){ - IMetaTileEntity mte=((IGregTechTileEntity) tTile).getMetaTileEntity(); - if(mte instanceof BaseMetaTileEntity) { - packetSize=((BaseMetaTileEntity) mte).getMaxSafeInput(); + long packetSize = V[mTier]; + if (tTile instanceof IGregTechTileEntity) { + IMetaTileEntity mte = ((IGregTechTileEntity) tTile).getMetaTileEntity(); + if (mte instanceof BaseMetaTileEntity) { + packetSize = ((BaseMetaTileEntity) mte).getMaxSafeInput(); } } long energyUse = 10; if (mMaxLossDistance != 0) { - energyUse = GT_Utility.safeInt(10L + (tDistance * Math.max(mMaxLoss - 10L, 0) / mMaxLossDistance)); + energyUse = GT_Utility.safeInt( + 10L + (tDistance * Math.max(mMaxLoss - 10L, 0) / mMaxLossDistance)); } - energyUse=packetSize + ((V[mTier] * energyUse) / 100); + energyUse = packetSize + ((V[mTier] * energyUse) / 100); if (getBaseMetaTileEntity().isUniversalEnergyStored(energyUse)) { if (((IEnergyConnected) tTile).injectEnergyUnits((byte) 6, packetSize, 1) > 0) { getBaseMetaTileEntity().decreaseStoredEnergyUnits(energyUse, false); @@ -246,7 +277,13 @@ public class GT_MetaTileEntity_MicrowaveEnergyTransmitter extends GT_MetaTileEnt } private int distanceCalculation() { - return Math.abs(((this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId) && (isDimensionalTeleportAvailable()) ? 100 : 1) * (int) Math.sqrt(Math.pow(getBaseMetaTileEntity().getXCoord() - this.mTargetX, 2.0D) + Math.pow(getBaseMetaTileEntity().getYCoord() - this.mTargetY, 2.0D) + Math.pow(getBaseMetaTileEntity().getZCoord() - this.mTargetZ, 2.0D))); + return Math.abs(((this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId) + && (isDimensionalTeleportAvailable()) + ? 100 + : 1) + * (int) Math.sqrt(Math.pow(getBaseMetaTileEntity().getXCoord() - this.mTargetX, 2.0D) + + Math.pow(getBaseMetaTileEntity().getYCoord() - this.mTargetY, 2.0D) + + Math.pow(getBaseMetaTileEntity().getZCoord() - this.mTargetZ, 2.0D))); } @Override @@ -378,5 +415,4 @@ public class GT_MetaTileEntity_MicrowaveEnergyTransmitter extends GT_MetaTileEnt public ITexture[][][] getTextureSet(ITexture[] aTextures) { return null; } - } diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Miner.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Miner.java index 86ee28b873..67ad6c3a5c 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Miner.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Miner.java @@ -1,6 +1,7 @@ package gregtech.common.tileentities.machines.basic; -import java.util.ArrayList; +import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.GT_Values.debugBlockMiner; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; @@ -12,8 +13,9 @@ import gregtech.api.util.GT_Log; import gregtech.api.util.GT_Utility; import gregtech.common.blocks.GT_Block_Ores_Abstract; import gregtech.common.blocks.GT_TileEntity_Ores; -import gregtech.common.misc.GT_IDrillingLogicDelegateOwner; import gregtech.common.misc.GT_DrillingLogicDelegate; +import gregtech.common.misc.GT_IDrillingLogicDelegateOwner; +import java.util.ArrayList; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; @@ -24,14 +26,12 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; import net.minecraft.world.ChunkPosition; import net.minecraftforge.common.util.FakePlayer; -import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.enums.GT_Values.debugBlockMiner; @SuppressWarnings("ObjectEquality") public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine implements GT_IDrillingLogicDelegateOwner { - static final int[] RADIUS = {8, 8, 16, 24, 32}; //Miner radius per tier - static final int[] SPEED = {160, 160, 80, 40, 20}; //Miner cycle time per tier - static final int[] ENERGY = {8, 8, 32, 128, 512}; //Miner energy consumption per tier + static final int[] RADIUS = {8, 8, 16, 24, 32}; // Miner radius per tier + static final int[] SPEED = {160, 160, 80, 40, 20}; // Miner cycle time per tier + static final int[] ENERGY = {8, 8, 32, 128, 512}; // Miner energy consumption per tier /** Miner configured radius */ private int radiusConfig; @@ -40,66 +40,101 @@ public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine impl /** General pipe accessor */ private final GT_DrillingLogicDelegate pipe = new GT_DrillingLogicDelegate(this); + private final int mSpeed; public GT_MetaTileEntity_Miner(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 1, - new String[]{ - "Digging ore instead of you", - "Use Screwdriver to regulate work area", - "Use Soft Mallet to disable and retract the pipe", - String.format("%d EU/t, %d sec per block, no stuttering", ENERGY[aTier], SPEED[aTier] / 20), - String.format("Maximum work area %dx%d", (RADIUS[aTier] * 2 + 1), (RADIUS[aTier] * 2 + 1)), - String.format("Fortune bonus of %d", aTier) - }, - 2, - 2, - "Miner.png", - "", - TextureFactory.of( - TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_SIDE_ACTIVE")), - TextureFactory.builder().addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_SIDE_ACTIVE_GLOW")).glow().build() - ), - TextureFactory.of( - TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_SIDE")), - TextureFactory.builder().addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_SIDE_GLOW")).glow().build() - ), - TextureFactory.of( - TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_FRONT_ACTIVE")), - TextureFactory.builder().addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_FRONT_ACTIVE_GLOW")).glow().build() - ), - TextureFactory.of( - TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_FRONT")), - TextureFactory.builder().addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_FRONT_GLOW")).glow().build() - ), - TextureFactory.of( - TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_TOP_ACTIVE")), - TextureFactory.builder().addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_TOP_ACTIVE_GLOW")).glow().build() - ), - TextureFactory.of( - TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_TOP")), - TextureFactory.builder().addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_TOP_GLOW")).glow().build() - ), - TextureFactory.of( - TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_BOTTOM_ACTIVE")), - TextureFactory.builder().addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_BOTTOM_ACTIVE_GLOW")).glow().build() - ), - TextureFactory.of( - TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_BOTTOM")), - TextureFactory.builder().addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_BOTTOM_GLOW")).glow().build() - ) - ); + super( + aID, + aName, + aNameRegional, + aTier, + 1, + new String[] { + "Digging ore instead of you", + "Use Screwdriver to regulate work area", + "Use Soft Mallet to disable and retract the pipe", + String.format("%d EU/t, %d sec per block, no stuttering", ENERGY[aTier], SPEED[aTier] / 20), + String.format("Maximum work area %dx%d", (RADIUS[aTier] * 2 + 1), (RADIUS[aTier] * 2 + 1)), + String.format("Fortune bonus of %d", aTier) + }, + 2, + 2, + "Miner.png", + "", + TextureFactory.of( + TextureFactory.of( + new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_SIDE_ACTIVE")), + TextureFactory.builder() + .addIcon(new Textures.BlockIcons.CustomIcon( + "basicmachines/miner/OVERLAY_SIDE_ACTIVE_GLOW")) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_SIDE")), + TextureFactory.builder() + .addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_SIDE_GLOW")) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of( + new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_FRONT_ACTIVE")), + TextureFactory.builder() + .addIcon(new Textures.BlockIcons.CustomIcon( + "basicmachines/miner/OVERLAY_FRONT_ACTIVE_GLOW")) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_FRONT")), + TextureFactory.builder() + .addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_FRONT_GLOW")) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_TOP_ACTIVE")), + TextureFactory.builder() + .addIcon(new Textures.BlockIcons.CustomIcon( + "basicmachines/miner/OVERLAY_TOP_ACTIVE_GLOW")) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_TOP")), + TextureFactory.builder() + .addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_TOP_GLOW")) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of( + new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_BOTTOM_ACTIVE")), + TextureFactory.builder() + .addIcon(new Textures.BlockIcons.CustomIcon( + "basicmachines/miner/OVERLAY_BOTTOM_ACTIVE_GLOW")) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_BOTTOM")), + TextureFactory.builder() + .addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_BOTTOM_GLOW")) + .glow() + .build())); mSpeed = SPEED[aTier]; radiusConfig = RADIUS[mTier]; } - public GT_MetaTileEntity_Miner(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { + public GT_MetaTileEntity_Miner( + String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); mSpeed = SPEED[aTier]; radiusConfig = RADIUS[mTier]; } - public GT_MetaTileEntity_Miner(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { + public GT_MetaTileEntity_Miner( + String aName, + int aTier, + String[] aDescription, + ITexture[][][] aTextures, + String aGUIName, + String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 2, 2, aGUIName, aNEIName); mSpeed = SPEED[aTier]; radiusConfig = RADIUS[mTier]; @@ -117,9 +152,10 @@ public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine impl } @Override - protected boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + protected boolean allowPutStackValidated( + IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { return super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack) // - && aStack.getItem() == GT_DrillingLogicDelegate.MINING_PIPE_STACK.getItem(); + && aStack.getItem() == GT_DrillingLogicDelegate.MINING_PIPE_STACK.getItem(); } /** Both output slots must be free to work */ @@ -143,8 +179,7 @@ public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine impl if (radiusConfig < 0) { radiusConfig = RADIUS[mTier]; } - } - else { + } else { if (radiusConfig <= RADIUS[mTier]) { radiusConfig++; } @@ -154,9 +189,12 @@ public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine impl } GT_Utility.sendChatToPlayer( - aPlayer, - String.format("%s %dx%d", StatCollector.translateToLocal("GT5U.machines.workareaset"), (radiusConfig * 2 + 1), (radiusConfig * 2 + 1)) - ); + aPlayer, + String.format( + "%s %dx%d", + StatCollector.translateToLocal("GT5U.machines.workareaset"), + (radiusConfig * 2 + 1), + (radiusConfig * 2 + 1))); // Rebuild ore cache after change config fillOreList(getBaseMetaTileEntity()); @@ -190,10 +228,11 @@ public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine impl return; } - if (!aBaseMetaTileEntity.isUniversalEnergyStored((long)ENERGY[mTier] * (mSpeed - mProgresstime))) { + if (!aBaseMetaTileEntity.isUniversalEnergyStored((long) ENERGY[mTier] * (mSpeed - mProgresstime))) { mMaxProgresstime = 0; if (debugBlockMiner) { - GT_Log.out.println("MINER: Not enough energy yet, want " + (ENERGY[mTier] * mSpeed) + " have " + aBaseMetaTileEntity.getUniversalEnergyStored()); + GT_Log.out.println("MINER: Not enough energy yet, want " + (ENERGY[mTier] * mSpeed) + " have " + + aBaseMetaTileEntity.getUniversalEnergyStored()); } return; } @@ -215,8 +254,7 @@ public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine impl if (descends) { fillOreList(aBaseMetaTileEntity); } - } - else { + } else { int x; int y; int z; @@ -224,11 +262,13 @@ public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine impl boolean isOre; do { ChunkPosition oreBlockPos = oreBlockPositions.remove(0); - oreBlock = aBaseMetaTileEntity.getBlockOffset(oreBlockPos.chunkPosX, oreBlockPos.chunkPosY, oreBlockPos.chunkPosZ); + oreBlock = aBaseMetaTileEntity.getBlockOffset( + oreBlockPos.chunkPosX, oreBlockPos.chunkPosY, oreBlockPos.chunkPosZ); x = aBaseMetaTileEntity.getXCoord() + oreBlockPos.chunkPosX; y = aBaseMetaTileEntity.getYCoord() + oreBlockPos.chunkPosY; z = aBaseMetaTileEntity.getZCoord() + oreBlockPos.chunkPosZ; - isOre = GT_Utility.isOre(oreBlock, aBaseMetaTileEntity.getWorld().getBlockMetadata(x, y, z)); + isOre = GT_Utility.isOre( + oreBlock, aBaseMetaTileEntity.getWorld().getBlockMetadata(x, y, z)); } // someone else might have removed the block while (!isOre && !oreBlockPositions.isEmpty()); @@ -253,11 +293,10 @@ public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine impl // todo some weird checks. refactorings needed if (block instanceof GT_Block_Ores_Abstract) { TileEntity oreEntity = aBaseMetaTileEntity.getTileEntityOffset(x, pipe.getTipDepth(), z); - if (oreEntity instanceof GT_TileEntity_Ores && ((GT_TileEntity_Ores)oreEntity).mNatural) { + if (oreEntity instanceof GT_TileEntity_Ores && ((GT_TileEntity_Ores) oreEntity).mNatural) { oreBlockPositions.add(new ChunkPosition(x, pipe.getTipDepth(), z)); } - } - else if (GT_Utility.isOre(block, blockMeta)) { + } else if (GT_Utility.isOre(block, blockMeta)) { oreBlockPositions.add(new ChunkPosition(x, pipe.getTipDepth(), z)); } } @@ -286,8 +325,8 @@ public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine impl /** Pushes (or check can push) item to output slots. */ @Override public boolean pushOutputs(ItemStack stack, int count, boolean simulate, boolean allowInputSlots) { - return allowInputSlots && pushOutput(getInputSlot(), getInputSlot() + mInputSlotCount, stack, count, simulate) || - pushOutput(getOutputSlot(), getOutputSlot() + mOutputItems.length, stack, count, simulate); + return allowInputSlots && pushOutput(getInputSlot(), getInputSlot() + mInputSlotCount, stack, count, simulate) + || pushOutput(getOutputSlot(), getOutputSlot() + mOutputItems.length, stack, count, simulate); } private boolean pushOutput(int startIndex, int endIndex, ItemStack stack, int count, boolean simulate) { @@ -300,8 +339,7 @@ public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine impl mInventory[i] = copy; } return true; - } - else if (GT_Utility.areStacksEqual(slot, stack) && slot.stackSize <= slot.getMaxStackSize() - count) { + } else if (GT_Utility.areStacksEqual(slot, stack) && slot.stackSize <= slot.getMaxStackSize() - count) { if (!simulate) { slot.stackSize += count; } @@ -341,15 +379,19 @@ public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine impl @Override public String[] getInfoData() { - return new String[]{ - String.format("%s%s%s", EnumChatFormatting.BLUE, StatCollector.translateToLocal("GT5U.machines.miner"), EnumChatFormatting.RESET), - String.format("%s: %s%d%s %s", - StatCollector.translateToLocal("GT5U.machines.workarea"), - EnumChatFormatting.GREEN, - (radiusConfig * 2 + 1), - EnumChatFormatting.RESET, - StatCollector.translateToLocal("GT5U.machines.blocks") - ) + return new String[] { + String.format( + "%s%s%s", + EnumChatFormatting.BLUE, + StatCollector.translateToLocal("GT5U.machines.miner"), + EnumChatFormatting.RESET), + String.format( + "%s: %s%d%s %s", + StatCollector.translateToLocal("GT5U.machines.workarea"), + EnumChatFormatting.GREEN, + (radiusConfig * 2 + 1), + EnumChatFormatting.RESET, + StatCollector.translateToLocal("GT5U.machines.blocks")) }; } diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_MonsterRepellent.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_MonsterRepellent.java index 1e1beaf528..e97be4e34a 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_MonsterRepellent.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_MonsterRepellent.java @@ -1,66 +1,93 @@ package gregtech.common.tileentities.machines.basic; +import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TELEPORTER; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TELEPORTER_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TELEPORTER_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TELEPORTER_GLOW; + import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_SpawnEventHandler; +import java.util.Arrays; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.common.util.ForgeDirection; -import java.util.Arrays; - -import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TELEPORTER; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TELEPORTER_ACTIVE; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TELEPORTER_ACTIVE_GLOW; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TELEPORTER_GLOW; - public class GT_MetaTileEntity_MonsterRepellent extends GT_MetaTileEntity_TieredMachineBlock { public int mRange = 16; public GT_MetaTileEntity_MonsterRepellent(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 0, "Repels nasty Creatures. Range: " + (4 + (12 * aTier)) + " unpowered / " + (16 + (48 * aTier)) + " powered. Costs " + (1L << (aTier * 2))+ " EU/t" ); - } - - public GT_MetaTileEntity_MonsterRepellent(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) { + super( + aID, + aName, + aNameRegional, + aTier, + 0, + "Repels nasty Creatures. Range: " + (4 + (12 * aTier)) + " unpowered / " + (16 + (48 * aTier)) + + " powered. Costs " + (1L << (aTier * 2)) + " EU/t"); + } + + public GT_MetaTileEntity_MonsterRepellent( + String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } - public GT_MetaTileEntity_MonsterRepellent(String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_MonsterRepellent( + String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_MonsterRepellent(this.mName, this.mTier, this.mInventory.length, this.mDescriptionArray, this.mTextures); + return new GT_MetaTileEntity_MonsterRepellent( + this.mName, this.mTier, this.mInventory.length, this.mDescriptionArray, this.mTextures); } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - if (aSide != ForgeDirection.UP.ordinal()) return new ITexture[]{MACHINE_CASINGS[mTier][aColorIndex + 1]}; - if (aActive) return new ITexture[]{ + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { + if (aSide != ForgeDirection.UP.ordinal()) return new ITexture[] {MACHINE_CASINGS[mTier][aColorIndex + 1]}; + if (aActive) + return new ITexture[] { MACHINE_CASINGS[mTier][aColorIndex + 1], TextureFactory.of(OVERLAY_TELEPORTER_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_TELEPORTER_ACTIVE_GLOW).glow().build()}; - return new ITexture[]{ - MACHINE_CASINGS[mTier][aColorIndex + 1], - TextureFactory.of(OVERLAY_TELEPORTER), - TextureFactory.builder().addIcon(OVERLAY_TELEPORTER_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_TELEPORTER_ACTIVE_GLOW) + .glow() + .build() + }; + return new ITexture[] { + MACHINE_CASINGS[mTier][aColorIndex + 1], + TextureFactory.of(OVERLAY_TELEPORTER), + TextureFactory.builder().addIcon(OVERLAY_TELEPORTER_GLOW).glow().build() + }; } @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) { if (aBaseMetaTileEntity.isAllowedToWork() && aBaseMetaTileEntity.isServerSide()) { - int[] tCoords = {aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord(), aBaseMetaTileEntity.getWorld().provider.dimensionId}; + int[] tCoords = { + aBaseMetaTileEntity.getXCoord(), + aBaseMetaTileEntity.getYCoord(), + aBaseMetaTileEntity.getZCoord(), + aBaseMetaTileEntity.getWorld().provider.dimensionId + }; if ((aTimer % 600 == 0) && !GT_SpawnEventHandler.mobReps.contains(tCoords)) { GT_SpawnEventHandler.mobReps.add(tCoords); } - if (aBaseMetaTileEntity.isUniversalEnergyStored(getMinimumStoredEU()) && aBaseMetaTileEntity.decreaseStoredEnergyUnits(1L << (this.mTier * 2), false)) { + if (aBaseMetaTileEntity.isUniversalEnergyStored(getMinimumStoredEU()) + && aBaseMetaTileEntity.decreaseStoredEnergyUnits(1L << (this.mTier * 2), false)) { mRange = 16 + (48 * mTier); } else { mRange = 4 + (12 * mTier); @@ -70,13 +97,23 @@ public class GT_MetaTileEntity_MonsterRepellent extends GT_MetaTileEntity_Tiered @Override public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { - int[] tCoords = {aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord(), aBaseMetaTileEntity.getWorld().provider.dimensionId}; + int[] tCoords = { + aBaseMetaTileEntity.getXCoord(), + aBaseMetaTileEntity.getYCoord(), + aBaseMetaTileEntity.getZCoord(), + aBaseMetaTileEntity.getWorld().provider.dimensionId + }; GT_SpawnEventHandler.mobReps.add(tCoords); } @Override public void onRemoval() { - int[] tCoords = {this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord(), this.getBaseMetaTileEntity().getWorld().provider.dimensionId}; + int[] tCoords = { + this.getBaseMetaTileEntity().getXCoord(), + this.getBaseMetaTileEntity().getYCoord(), + this.getBaseMetaTileEntity().getZCoord(), + this.getBaseMetaTileEntity().getWorld().provider.dimensionId + }; GT_SpawnEventHandler.mobReps.removeIf(coords -> Arrays.equals(coords, tCoords)); } @@ -141,10 +178,8 @@ public class GT_MetaTileEntity_MonsterRepellent extends GT_MetaTileEntity_Tiered } @Override - public void saveNBTData(NBTTagCompound aNBT) { - } + public void saveNBTData(NBTTagCompound aNBT) {} @Override - public void loadNBTData(NBTTagCompound aNBT) { - } + public void loadNBTData(NBTTagCompound aNBT) {} } diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_PotionBrewer.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_PotionBrewer.java index 79b363fac3..2a7e28f10b 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_PotionBrewer.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_PotionBrewer.java @@ -1,5 +1,7 @@ package gregtech.common.tileentities.machines.basic; +import static gregtech.api.enums.Textures.BlockIcons.*; + import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.interfaces.ITexture; @@ -15,49 +17,88 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; -import static gregtech.api.enums.Textures.BlockIcons.*; - public class GT_MetaTileEntity_PotionBrewer extends GT_MetaTileEntity_BasicMachine { public GT_MetaTileEntity_PotionBrewer(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 1, "Brewing your Drinks", 1, 0, "PotionBrewer.png", "", + super( + aID, + aName, + aNameRegional, + aTier, + 1, + "Brewing your Drinks", + 1, + 0, + "PotionBrewer.png", + "", TextureFactory.of( TextureFactory.of(OVERLAY_SIDE_POTIONBREWER_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_SIDE_POTIONBREWER_ACTIVE_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_POTIONBREWER_ACTIVE_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_SIDE_POTIONBREWER), - TextureFactory.builder().addIcon(OVERLAY_SIDE_POTIONBREWER_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_POTIONBREWER_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_FRONT_POTIONBREWER_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_FRONT_POTIONBREWER_ACTIVE_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_POTIONBREWER_ACTIVE_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_FRONT_POTIONBREWER), - TextureFactory.builder().addIcon(OVERLAY_FRONT_POTIONBREWER_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_POTIONBREWER_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_TOP_POTIONBREWER_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_TOP_POTIONBREWER_ACTIVE_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_TOP_POTIONBREWER_ACTIVE_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_TOP_POTIONBREWER), - TextureFactory.builder().addIcon(OVERLAY_TOP_POTIONBREWER_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_TOP_POTIONBREWER_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_BOTTOM_POTIONBREWER_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_BOTTOM_POTIONBREWER_ACTIVE_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_POTIONBREWER_ACTIVE_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_BOTTOM_POTIONBREWER), - TextureFactory.builder().addIcon(OVERLAY_BOTTOM_POTIONBREWER_GLOW).glow().build()) - ); + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_POTIONBREWER_GLOW) + .glow() + .build())); } - public GT_MetaTileEntity_PotionBrewer(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { + public GT_MetaTileEntity_PotionBrewer( + String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 1, 0, aGUIName, aNEIName); } - public GT_MetaTileEntity_PotionBrewer(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { + public GT_MetaTileEntity_PotionBrewer( + String aName, + int aTier, + String[] aDescription, + ITexture[][][] aTextures, + String aGUIName, + String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 1, 0, aGUIName, aNEIName); } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_PotionBrewer(this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName); + return new GT_MetaTileEntity_PotionBrewer( + this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName); } @Override @@ -72,8 +113,8 @@ public class GT_MetaTileEntity_PotionBrewer extends GT_MetaTileEntity_BasicMachi return tCheck; } - calculateOverclockedNess(4,128); - //In case recipe is too OP for that machine + calculateOverclockedNess(4, 128); + // In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; @@ -114,25 +155,30 @@ public class GT_MetaTileEntity_PotionBrewer extends GT_MetaTileEntity_BasicMachi } return setOutput("potion.weakness"); } - if (GT_Utility.areStacksEqual(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Glowstone, 1L), getInputAt(0))) { + if (GT_Utility.areStacksEqual( + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Glowstone, 1L), getInputAt(0))) { if (!tModifier.startsWith("strong")) { - return setOutput("potion." + tInputName + ".strong" + (tModifier.isEmpty() ? "" : "." + tModifier)); + return setOutput( + "potion." + tInputName + ".strong" + (tModifier.isEmpty() ? "" : "." + tModifier)); } if (tModifier.startsWith("long")) { return setOutput("potion." + tInputName + tModifier.replaceFirst("long", "")); } return setOutput("potion.thick"); } - if (GT_Utility.areStacksEqual(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Redstone, 1L), getInputAt(0))) { + if (GT_Utility.areStacksEqual( + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Redstone, 1L), getInputAt(0))) { if (!tModifier.startsWith("long")) { - return setOutput("potion." + tInputName + ".long" + (tModifier.isEmpty() ? "" : "." + tModifier)); + return setOutput( + "potion." + tInputName + ".long" + (tModifier.isEmpty() ? "" : "." + tModifier)); } if (tModifier.startsWith("strong")) { return setOutput("potion." + tInputName + tModifier.replaceFirst("strong", "")); } return setOutput("potion.mundane"); } - if (GT_Utility.areStacksEqual(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Gunpowder, 1L), getInputAt(0))) { + if (GT_Utility.areStacksEqual( + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Gunpowder, 1L), getInputAt(0))) { if (!tInputName.endsWith(".splash")) { return setOutput("potion." + tInputName + ".splash"); } @@ -152,15 +198,17 @@ public class GT_MetaTileEntity_PotionBrewer extends GT_MetaTileEntity_BasicMachi if (this.mOutputFluid == null) { this.mOutputFluid = FluidRegistry.getFluidStack("potion.mundane", getFillableStack().amount); } - + getInputAt(0).stackSize -= 1; getFillableStack().amount -= 750; return 2; } @Override - public boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - return super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack) && getRecipeList().containsInput(aStack); + public boolean allowPutStackValidated( + IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack) + && getRecipeList().containsInput(aStack); } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Printer.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Printer.java index 87105620ea..6771ba0fcc 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Printer.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Printer.java @@ -8,16 +8,26 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachin import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import net.minecraft.item.ItemStack; - import java.util.ArrayList; +import net.minecraft.item.ItemStack; public class GT_MetaTileEntity_Printer extends GT_MetaTileEntity_BasicMachine { public GT_MetaTileEntity_Printer(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 1, "It can copy Books and paint Stuff", 1, 1, "Printer.png", GT_Recipe.GT_Recipe_Map.sPrinterRecipes.mNEIName); + super( + aID, + aName, + aNameRegional, + aTier, + 1, + "It can copy Books and paint Stuff", + 1, + 1, + "Printer.png", + GT_Recipe.GT_Recipe_Map.sPrinterRecipes.mNEIName); } - public GT_MetaTileEntity_Printer(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { + public GT_MetaTileEntity_Printer( + String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 2, 2, aGUIName, aNEIName); } @@ -25,18 +35,20 @@ public class GT_MetaTileEntity_Printer extends GT_MetaTileEntity_BasicMachine { public int checkRecipe() { if (getOutputAt(0) != null) { this.mOutputBlocked += 1; - } else if ((GT_Utility.isStackValid(getInputAt(0))) && (getInputAt(0).stackSize > 0) && - (GT_Utility.isStackInvalid(getSpecialSlot())) && - (OrePrefixes.block.contains(getInputAt(0)))) { - ArrayList<ItemStack> tList = GT_OreDictUnificator.getOres(GT_OreDictUnificator.getAssociation(getInputAt(0))); + } else if ((GT_Utility.isStackValid(getInputAt(0))) + && (getInputAt(0).stackSize > 0) + && (GT_Utility.isStackInvalid(getSpecialSlot())) + && (OrePrefixes.block.contains(getInputAt(0)))) { + ArrayList<ItemStack> tList = + GT_OreDictUnificator.getOres(GT_OreDictUnificator.getAssociation(getInputAt(0))); if (tList.size() > 1) { tList.add(tList.get(0)); int i = 0; for (int j = tList.size() - 1; i < j; i++) { if (GT_Utility.areStacksEqual(getInputAt(0), (ItemStack) tList.get(i))) { this.mOutputItems[0] = GT_Utility.copyAmount(1L, tList.get(i + 1)); - calculateOverclockedNess(1,32); - //In case recipe is too OP for that machine + calculateOverclockedNess(1, 32); + // In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; getInputAt(0).stackSize -= 1; diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Pump.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Pump.java index 2027516dcc..5c06ab5bd1 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Pump.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Pump.java @@ -1,5 +1,8 @@ package gregtech.common.tileentities.machines.basic; +import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.GT_Values.debugBlockPump; + import gregtech.api.enums.Textures; import gregtech.api.gui.GT_Container_BasicTank; import gregtech.api.gui.GT_GUIContainer_BasicTank; @@ -12,6 +15,11 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Log; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Utility; +import java.util.ArrayDeque; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; @@ -27,19 +35,11 @@ import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.IFluidBlock; import net.minecraftforge.fluids.IFluidHandler; -import java.util.ArrayDeque; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Set; - -import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.enums.GT_Values.debugBlockPump; - public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { private static final ItemStack MINING_PIPE = GT_ModHandler.getIC2Item("miningPipe", 0); private static final Block MINING_PIPE_BLOCK = GT_Utility.getBlockFromStack(MINING_PIPE); - private static final Block MINING_PIPE_TIP_BLOCK = GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 0)); + private static final Block MINING_PIPE_TIP_BLOCK = + GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 0)); public static int getMaxDistanceForTier(int aTier) { return (10 * ((int) Math.pow(1.6D, aTier))); @@ -56,18 +56,21 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { public Block mPrimaryPumpedBlock = null; public Block mSecondaryPumpedBlock = null; - private int radiusConfig; //Pump configured radius + private int radiusConfig; // Pump configured radius private boolean mRetractDone = false; public GT_MetaTileEntity_Pump(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 3, - new String[]{"The best way to empty Oceans! Outputs on top", - getEuUsagePerTier(aTier) + " EU/operation, " + GT_Utility.safeInt(160 / 20 / (long)Math.pow(2, aTier) ) + " sec per bucket, no stuttering", - "Maximum pumping area: " + (getMaxDistanceForTier( aTier) * 2 + 1) + "x" + (getMaxDistanceForTier( aTier) * 2 + 1), - "Use Screwdriver to regulate pumping area", - "Use Soft Mallet to disable and retract the pipe", - "Disable itself upon hitting rocks", - "Disable the bottom pump to retract the pipe!"}); + super(aID, aName, aNameRegional, aTier, 3, new String[] { + "The best way to empty Oceans! Outputs on top", + getEuUsagePerTier(aTier) + " EU/operation, " + GT_Utility.safeInt(160 / 20 / (long) Math.pow(2, aTier)) + + " sec per bucket, no stuttering", + "Maximum pumping area: " + (getMaxDistanceForTier(aTier) * 2 + 1) + "x" + + (getMaxDistanceForTier(aTier) * 2 + 1), + "Use Screwdriver to regulate pumping area", + "Use Soft Mallet to disable and retract the pipe", + "Disable itself upon hitting rocks", + "Disable the bottom pump to retract the pipe!" + }); radiusConfig = getMaxDistanceForTier(mTier); } @@ -90,11 +93,18 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { public void saveNBTData(NBTTagCompound aNBT) { boolean wasPumping = this.wasPumping || !this.mPumpList.isEmpty(); if (debugBlockPump) { - GT_Log.out.println("PUMP: NBT:Save - WasPumping - " + wasPumping + " blocks (" + this.mPrimaryPumpedBlock + ", " + this.mSecondaryPumpedBlock + ")"); + GT_Log.out.println("PUMP: NBT:Save - WasPumping - " + wasPumping + " blocks (" + this.mPrimaryPumpedBlock + + ", " + this.mSecondaryPumpedBlock + ")"); } super.saveNBTData(aNBT); - aNBT.setString("mPumpedBlock1", this.mPrimaryPumpedBlock == null ? "" : Block.blockRegistry.getNameForObject(this.mPrimaryPumpedBlock)); - aNBT.setString("mPumpedBlock2", this.mSecondaryPumpedBlock == null ? "" : Block.blockRegistry.getNameForObject(this.mSecondaryPumpedBlock)); + aNBT.setString( + "mPumpedBlock1", + this.mPrimaryPumpedBlock == null ? "" : Block.blockRegistry.getNameForObject(this.mPrimaryPumpedBlock)); + aNBT.setString( + "mPumpedBlock2", + this.mSecondaryPumpedBlock == null + ? "" + : Block.blockRegistry.getNameForObject(this.mSecondaryPumpedBlock)); aNBT.setBoolean("wasPumping", wasPumping); aNBT.setInteger("radiusConfig", radiusConfig); } @@ -103,13 +113,13 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { public void loadNBTData(NBTTagCompound aNBT) { super.loadNBTData(aNBT); this.wasPumping = aNBT.getBoolean("wasPumping"); - if (aNBT.hasKey("radiusConfig")) - this.radiusConfig = aNBT.getInteger("radiusConfig"); + if (aNBT.hasKey("radiusConfig")) this.radiusConfig = aNBT.getInteger("radiusConfig"); this.mPrimaryPumpedBlock = Block.getBlockFromName(aNBT.getString("mPumpedBlock1")); this.mSecondaryPumpedBlock = Block.getBlockFromName(aNBT.getString("mPumpedBlock2")); if (debugBlockPump) { - GT_Log.out.println("PUMP: NBT:Load - WasPumping - " + this.wasPumping + "(" + aNBT.getString("mPumpedBlock1") + ") " + this.mPrimaryPumpedBlock); + GT_Log.out.println("PUMP: NBT:Load - WasPumping - " + this.wasPumping + "(" + + aNBT.getString("mPumpedBlock1") + ") " + this.mPrimaryPumpedBlock); } } @@ -127,19 +137,19 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { if (radiusConfig >= 0) { radiusConfig--; } - if (radiusConfig < 0) - radiusConfig = max; + if (radiusConfig < 0) radiusConfig = max; } else { if (radiusConfig <= max) { radiusConfig++; } - if (radiusConfig > max) - radiusConfig = 0; + if (radiusConfig > max) radiusConfig = 0; } - GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("GT5U.machines.workareaset") + " " + (radiusConfig * 2 + 1) + "x" + (radiusConfig * 2 + 1));//TODO Add translation support - - clearQueue(false); + GT_Utility.sendChatToPlayer( + aPlayer, + StatCollector.translateToLocal("GT5U.machines.workareaset") + " " + (radiusConfig * 2 + 1) + "x" + + (radiusConfig * 2 + 1)); // TODO Add translation support + clearQueue(false); } @Override @@ -199,10 +209,13 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { this.mPumpCountBelow = 0; IGregTechTileEntity tTileEntity; - for (int i = 1 ; - (i < 21) && ((tTileEntity = getBaseMetaTileEntity().getIGregTechTileEntityAtSideAndDistance((byte) 0, i)) != null) - && ((tTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Pump)) ; i++) - { + for (int i = 1; + (i < 21) + && ((tTileEntity = getBaseMetaTileEntity() + .getIGregTechTileEntityAtSideAndDistance((byte) 0, i)) + != null) + && ((tTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Pump)); + i++) { // Apparently someone might stack 21 pumps on top of each other, so let's check for that getBaseMetaTileEntity().setActive(tTileEntity.isActive()); this.mPumpCountBelow += 1; @@ -216,13 +229,18 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { // Only the bottom most pump does anything if (getBaseMetaTileEntity().isAllowedToWork()) { mRetractDone = false; - if ((getBaseMetaTileEntity().isUniversalEnergyStored(this.getEuUsagePerAction())) && ((this.mFluid == null) || (this.mFluid.amount + 1000 <= getCapacity()))) { + if ((getBaseMetaTileEntity().isUniversalEnergyStored(this.getEuUsagePerAction())) + && ((this.mFluid == null) || (this.mFluid.amount + 1000 <= getCapacity()))) { boolean tMovedOneDown = false; - if ((this.mPumpList.isEmpty()) && (getBaseMetaTileEntity().getTimer() % 100L == 0L)) { + if ((this.mPumpList.isEmpty()) + && (getBaseMetaTileEntity().getTimer() % 100L == 0L)) { if (!this.wasPumping) { tMovedOneDown = moveOneDown(); if (!tMovedOneDown) { - if (canMoveDown(getBaseMetaTileEntity().getXCoord(), Math.max(getYOfPumpHead() - 1, 1), getBaseMetaTileEntity().getZCoord())) { + if (canMoveDown( + getBaseMetaTileEntity().getXCoord(), + Math.max(getYOfPumpHead() - 1, 1), + getBaseMetaTileEntity().getZCoord())) { if (debugBlockPump) { GT_Log.out.println("PUMP: No pipe left. Idle for a little longer."); } @@ -240,15 +258,17 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { GT_Log.out.println("PUMP: Was pumping, didn't move down"); } } - int x = getBaseMetaTileEntity().getXCoord(), z = getBaseMetaTileEntity().getZCoord(); + int x = getBaseMetaTileEntity().getXCoord(), + z = getBaseMetaTileEntity().getZCoord(); if (!this.hasValidFluid()) { // We don't have a valid block, let's try to find one int y = getYOfPumpHead(); if (debugBlockPump && this.mPrimaryPumpedBlock != null) { - GT_Log.out.println("PUMP: Had an invalid pump block. Trying to find a fluid at Y: " + y + - " Previous blocks 1: " + this.mPrimaryPumpedBlock + " 2: " + this.mSecondaryPumpedBlock); + GT_Log.out.println("PUMP: Had an invalid pump block. Trying to find a fluid at Y: " + y + + " Previous blocks 1: " + this.mPrimaryPumpedBlock + " 2: " + + this.mSecondaryPumpedBlock); } // First look down checkForFluidToPump(x, y - 1, z); @@ -267,18 +287,20 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { } else if (getYOfPumpHead() < getBaseMetaTileEntity().getYCoord()) { // We didn't just look for a block, and the pump head is below the pump - if ((tMovedOneDown) || this.wasPumping || - ((this.mPumpList.isEmpty()) && (getBaseMetaTileEntity().getTimer() % 200L == 100L)) || - (getBaseMetaTileEntity().getTimer() % 72000L == 100L)) - { + if ((tMovedOneDown) + || this.wasPumping + || ((this.mPumpList.isEmpty()) + && (getBaseMetaTileEntity().getTimer() % 200L == 100L)) + || (getBaseMetaTileEntity().getTimer() % 72000L == 100L)) { // Rebuild the list to pump if any of the following conditions are true: // 1) We just moved down // 2) We were previously pumping (and possibly just reloaded) // 3) We have an empty queue and enough time has passed // 4) A long while has has passed if (debugBlockPump) { - GT_Log.out.println("PUMP: Rebuilding pump list - Size " + - this.mPumpList.size() + " WasPumping: " + this.wasPumping + " Timer " + getBaseMetaTileEntity().getTimer()); + GT_Log.out.println("PUMP: Rebuilding pump list - Size " + this.mPumpList.size() + + " WasPumping: " + this.wasPumping + " Timer " + + getBaseMetaTileEntity().getTimer()); } int yPump = getBaseMetaTileEntity().getYCoord() - 1, yHead = getYOfPumpHead(); @@ -287,7 +309,6 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { if (debugBlockPump) { GT_Log.out.println("PUMP: Rebuilt pump list - Size " + this.mPumpList.size()); } - } if ((!tMovedOneDown) && (this.mPumpTimer <= 0)) { while ((!this.mPumpList.isEmpty())) { @@ -301,7 +322,8 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { this.mPumpTimer = mPumpTimer == 0 ? 1 : mPumpTimer; } } else { - // We somehow have a valid fluid, but the head of the pump isn't below the pump. Perhaps someone broke some pipes + // We somehow have a valid fluid, but the head of the pump isn't below the pump. Perhaps + // someone broke some pipes // -- Clear the queue and we should try to move down until we can find a valid fluid this.clearQueue(false); } @@ -309,7 +331,13 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { GT_Log.out.println("PUMP: Not enough energy? Free space?"); } } else { - if (!mRetractDone && ((aTick % 5) == 0) && ((this.mInventory[0] == null) || this.mInventory[0].stackSize == 0 || (GT_Utility.areStacksEqual(this.mInventory[0], MINING_PIPE) && (this.mInventory[0].stackSize < this.mInventory[0].getMaxStackSize())))) { + if (!mRetractDone + && ((aTick % 5) == 0) + && ((this.mInventory[0] == null) + || this.mInventory[0].stackSize == 0 + || (GT_Utility.areStacksEqual(this.mInventory[0], MINING_PIPE) + && (this.mInventory[0].stackSize + < this.mInventory[0].getMaxStackSize())))) { // try retract if all of these conditions are met // 1. not retracted yet // 2. once per 5 tick @@ -320,7 +348,9 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { final int tZCoord = this.getBaseMetaTileEntity().getZCoord(); this.getBaseMetaTileEntity().getWorld().setBlockToAir(tXCoord, tHeadY, tZCoord); if (tHeadY < this.getBaseMetaTileEntity().getYCoord() - 1) { - getBaseMetaTileEntity().getWorld().setBlock(tXCoord, tHeadY + 1, tZCoord, MINING_PIPE_TIP_BLOCK); + getBaseMetaTileEntity() + .getWorld() + .setBlock(tXCoord, tHeadY + 1, tZCoord, MINING_PIPE_TIP_BLOCK); } if (this.mInventory[0] == null) { final ItemStack copy = MINING_PIPE.copy(); @@ -345,13 +375,12 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { if (this.mFluid != null && (aTick % 20 == 0)) { // auto outputs on top every second or so - IFluidHandler tTank = aBaseMetaTileEntity.getITankContainerAtSide((byte)1); //1 is up. + IFluidHandler tTank = aBaseMetaTileEntity.getITankContainerAtSide((byte) 1); // 1 is up. if (tTank != null) { FluidStack tDrained = drain(1000, false); if (tDrained != null) { int tFilledAmount = tTank.fill(ForgeDirection.DOWN, tDrained, false); - if (tFilledAmount > 0) - tTank.fill(ForgeDirection.DOWN, drain(tFilledAmount, true), true); + if (tFilledAmount > 0) tTank.fill(ForgeDirection.DOWN, drain(tFilledAmount, true), true); } } } @@ -371,7 +400,9 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { } private boolean moveOneDown() { - if ((this.mInventory[0] == null) || (this.mInventory[0].stackSize < 1) || (!GT_Utility.areStacksEqual(this.mInventory[0], MINING_PIPE))) { + if ((this.mInventory[0] == null) + || (this.mInventory[0].stackSize < 1) + || (!GT_Utility.areStacksEqual(this.mInventory[0], MINING_PIPE))) { // No mining pipes if (debugBlockPump) { GT_Log.out.println("PUMP: No mining pipes"); @@ -390,15 +421,19 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { int x = getBaseMetaTileEntity().getXCoord(), z = getBaseMetaTileEntity().getZCoord(); - if ((!consumeFluid(x, yHead - 1, z)) && (!getBaseMetaTileEntity().getBlock(x, yHead - 1, z).isAir(getBaseMetaTileEntity().getWorld(), x, yHead - 1, z))) { + if ((!consumeFluid(x, yHead - 1, z)) + && (!getBaseMetaTileEntity() + .getBlock(x, yHead - 1, z) + .isAir(getBaseMetaTileEntity().getWorld(), x, yHead - 1, z))) { // Either we didn't consume a fluid, or it's a non Air block if (debugBlockPump) { GT_Log.out.println("PUMP: Did not consume fluid, or non-airblock found"); } return false; } - // Try to set the block below us to a a tip - if (!GT_Utility.setBlockByFakePlayer(getFakePlayer(getBaseMetaTileEntity()), x, yHead - 1, z, MINING_PIPE_TIP_BLOCK, 0, false)) { + // Try to set the block below us to a a tip + if (!GT_Utility.setBlockByFakePlayer( + getFakePlayer(getBaseMetaTileEntity()), x, yHead - 1, z, MINING_PIPE_TIP_BLOCK, 0, false)) { if (debugBlockPump) { GT_Log.out.println("PUMP: Could not set block below to new tip"); } @@ -419,14 +454,16 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { // Let's play find the pump head! // TODO: Handle pipe|pipe|head|pipe|pipe - int y = getBaseMetaTileEntity().getYCoord() - 1, x = getBaseMetaTileEntity().getXCoord(), z = getBaseMetaTileEntity().getZCoord(); + int y = getBaseMetaTileEntity().getYCoord() - 1, + x = getBaseMetaTileEntity().getXCoord(), + z = getBaseMetaTileEntity().getZCoord(); - while(y > 0) { + while (y > 0) { Block curBlock = getBaseMetaTileEntity().getBlock(x, y, z); - if(curBlock == MINING_PIPE_BLOCK) { + if (curBlock == MINING_PIPE_BLOCK) { y--; } else if (curBlock == MINING_PIPE_TIP_BLOCK) { - Block nextBlock = getBaseMetaTileEntity().getBlock(x, y - 1 , z); + Block nextBlock = getBaseMetaTileEntity().getBlock(x, y - 1, z); if (nextBlock == MINING_PIPE_BLOCK || nextBlock == MINING_PIPE_TIP_BLOCK) { // We're running into an existing set of pipes -- Turn this block into a pipe and keep going this.clearQueue(true); @@ -443,8 +480,10 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { } if (getBaseMetaTileEntity().getBlock(x, y, z) != MINING_PIPE_TIP_BLOCK) { - if (y != getBaseMetaTileEntity().getYCoord() - 1 && getBaseMetaTileEntity().getBlock(x, y + 1, z) == MINING_PIPE_BLOCK) { - // We're below the pump at the bottom of the pipes, we haven't found a tip; make the previous pipe a tip! + if (y != getBaseMetaTileEntity().getYCoord() - 1 + && getBaseMetaTileEntity().getBlock(x, y + 1, z) == MINING_PIPE_BLOCK) { + // We're below the pump at the bottom of the pipes, we haven't found a tip; make the previous pipe a + // tip! this.clearQueue(true); getBaseMetaTileEntity().getWorld().setBlock(x, y + 1, z, MINING_PIPE_TIP_BLOCK); if (debugBlockPump) { @@ -457,7 +496,7 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { } private void clearQueue(boolean checkPumping) { - if(checkPumping) { + if (checkPumping) { this.wasPumping = !this.mPumpList.isEmpty(); } else { this.wasPumping = false; @@ -473,8 +512,9 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { Set<ChunkPosition> checked = new HashSet<>(); this.clearQueue(false); - for (int aY = yStart ; this.mPumpList.isEmpty() && aY >= yEnd ; aY--) { - // Start at the top (presumably the block below the pump), and work our way down to the end (presumably the location of the pump Head) + for (int aY = yStart; this.mPumpList.isEmpty() && aY >= yEnd; aY--) { + // Start at the top (presumably the block below the pump), and work our way down to the end (presumably the + // location of the pump Head) // and build up a queue of fluids to pump fluidsToSearch.add(new ChunkPosition(aX, aY, aZ)); @@ -503,8 +543,10 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { } } - private boolean queueFluid(int aX, int aY, int aZ, ArrayDeque<ChunkPosition> fluidsFound, Set<ChunkPosition> checked) { - // If we haven't already looked at this coordinate set, and it's not already in the list of fluids found, see if there is + private boolean queueFluid( + int aX, int aY, int aZ, ArrayDeque<ChunkPosition> fluidsFound, Set<ChunkPosition> checked) { + // If we haven't already looked at this coordinate set, and it's not already in the list of fluids found, see if + // there is // a valid fluid and add it to the fluids found ChunkPosition tCoordinate = new ChunkPosition(aX, aY, aZ); if (checked.add(tCoordinate) && !fluidsFound.contains(tCoordinate)) { @@ -519,8 +561,7 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { private void checkForFluidToPump(int aX, int aY, int aZ) { // If we don't currently have a valid fluid to pump, try pumping the fluid at the given coordinates - if(this.hasValidFluid()) - return; + if (this.hasValidFluid()) return; Block aBlock = getBaseMetaTileEntity().getBlock(aX, aY, aZ); if (aBlock != null) { @@ -550,13 +591,13 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { Block aBlock = getBaseMetaTileEntity().getBlock(aX, aY, aZ); - return aBlock != null && - (aBlock == Blocks.water || - aBlock == Blocks.flowing_water || - aBlock == Blocks.lava || - aBlock == Blocks.flowing_lava || - aBlock instanceof IFluidBlock || - aBlock.isAir(getBaseMetaTileEntity().getWorld(), aX, aY, aZ)); + return aBlock != null + && (aBlock == Blocks.water + || aBlock == Blocks.flowing_water + || aBlock == Blocks.lava + || aBlock == Blocks.flowing_lava + || aBlock instanceof IFluidBlock + || aBlock.isAir(getBaseMetaTileEntity().getWorld(), aX, aY, aZ)); } private boolean consumeFluid(int aX, int aY, int aZ) { @@ -567,26 +608,28 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { Block aBlock = getBaseMetaTileEntity().getBlock(aX, aY, aZ); if (aBlock != null && ((this.mPrimaryPumpedBlock == aBlock) || (this.mSecondaryPumpedBlock == aBlock))) { - boolean isWaterOrLava = ((this.mPrimaryPumpedBlock == Blocks.water || this.mPrimaryPumpedBlock == Blocks.lava)); + boolean isWaterOrLava = + ((this.mPrimaryPumpedBlock == Blocks.water || this.mPrimaryPumpedBlock == Blocks.lava)); if (isWaterOrLava && getBaseMetaTileEntity().getMetaID(aX, aY, aZ) != 0) { - // Water/Lava that isn't a source block - do nothing here, but set the block to air and consume energy below + // Water/Lava that isn't a source block - do nothing here, but set the block to air and consume energy + // below if (debugBlockPump) { GT_Log.out.println("PUMP: Water/Lava - Not a source block"); } } else if (this.mFluid == null) { // The pump has no internal fluid - if (this.mPrimaryPumpedBlock == Blocks.water) - this.mFluid = GT_ModHandler.getWater(1000L); - else if (this.mPrimaryPumpedBlock == Blocks.lava) - this.mFluid = GT_ModHandler.getLava(1000L); + if (this.mPrimaryPumpedBlock == Blocks.water) this.mFluid = GT_ModHandler.getWater(1000L); + else if (this.mPrimaryPumpedBlock == Blocks.lava) this.mFluid = GT_ModHandler.getLava(1000L); else { // Not water or lava; try to drain and set to air - this.mFluid = ((IFluidBlock) aBlock).drain(getBaseMetaTileEntity().getWorld(), aX, aY, aZ, true); + this.mFluid = + ((IFluidBlock) aBlock).drain(getBaseMetaTileEntity().getWorld(), aX, aY, aZ, true); } - } else if (GT_ModHandler.isWater(this.mFluid) || GT_ModHandler.isLava(this.mFluid) || - this.mFluid.isFluidEqual(((IFluidBlock) aBlock).drain(getBaseMetaTileEntity().getWorld(), aX, aY, aZ, false))) - { + } else if (GT_ModHandler.isWater(this.mFluid) + || GT_ModHandler.isLava(this.mFluid) + || this.mFluid.isFluidEqual( + ((IFluidBlock) aBlock).drain(getBaseMetaTileEntity().getWorld(), aX, aY, aZ, false))) { if (!isWaterOrLava) { // Only set Block to Air for non lava/water fluids this.getBaseMetaTileEntity().getWorld().setBlockToAir(aX, aY, aZ); @@ -616,22 +659,27 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { } @Override - public ArrayList<String> getSpecialDebugInfo(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, int aLogLevel, ArrayList<String> aList) { - aList.addAll(Arrays.asList( EnumChatFormatting.BLUE+StatCollector.translateToLocal("GT5U.machines.pump")+EnumChatFormatting.RESET, - StatCollector.translateToLocal("GT5U.machines.workarea")+": " + EnumChatFormatting.GREEN + (radiusConfig * 2 + 1)+ - EnumChatFormatting.RESET+" " + StatCollector.translateToLocal("GT5U.machines.blocks"), - "Primary pumping fluid: " + (this.mPrimaryPumpedBlock != null ? this.mPrimaryPumpedBlock.getLocalizedName() : "None"), - "Secondary pumping fluid: " + (this.mSecondaryPumpedBlock != null ? this.mSecondaryPumpedBlock.getLocalizedName() : "None"), - "Pumps below: " + mPumpCountBelow, - "Queue size: " + mPumpList.size(), - "Pump head at Y: " + getYOfPumpHead(), - "Pump timer: " + mPumpTimer, - "Meta Entity Timer: " + getBaseMetaTileEntity().getTimer())); + public ArrayList<String> getSpecialDebugInfo( + IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, int aLogLevel, ArrayList<String> aList) { + aList.addAll(Arrays.asList( + EnumChatFormatting.BLUE + + StatCollector.translateToLocal("GT5U.machines.pump") + + EnumChatFormatting.RESET, + StatCollector.translateToLocal("GT5U.machines.workarea") + ": " + EnumChatFormatting.GREEN + + (radiusConfig * 2 + 1) + EnumChatFormatting.RESET + " " + + StatCollector.translateToLocal("GT5U.machines.blocks"), + "Primary pumping fluid: " + + (this.mPrimaryPumpedBlock != null ? this.mPrimaryPumpedBlock.getLocalizedName() : "None"), + "Secondary pumping fluid: " + + (this.mSecondaryPumpedBlock != null ? this.mSecondaryPumpedBlock.getLocalizedName() : "None"), + "Pumps below: " + mPumpCountBelow, + "Queue size: " + mPumpList.size(), + "Pump head at Y: " + getYOfPumpHead(), + "Pump timer: " + mPumpTimer, + "Meta Entity Timer: " + getBaseMetaTileEntity().getTimer())); return aList; - } - @Override public boolean isSimpleMachine() { return false; @@ -712,7 +760,6 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { return true; } - @Override public int getCapacity() { return 16000 * this.mTier; @@ -724,8 +771,19 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], (aSide == 0 || aSide == 1) ? TextureFactory.of(Textures.BlockIcons.OVERLAY_PIPE_OUT) : TextureFactory.of(Textures.BlockIcons.OVERLAY_ADV_PUMP)}; + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { + return new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], + (aSide == 0 || aSide == 1) + ? TextureFactory.of(Textures.BlockIcons.OVERLAY_PIPE_OUT) + : TextureFactory.of(Textures.BlockIcons.OVERLAY_ADV_PUMP) + }; } @Override @@ -735,10 +793,14 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { @Override public ITexture[] getTexturesInactive(ITexture aBaseTexture) { - return new ITexture[]{ - TextureFactory.of(Textures.BlockIcons.OVERLAY_ADV_PUMP), TextureFactory.of(Textures.BlockIcons.OVERLAY_ADV_PUMP), - TextureFactory.of(Textures.BlockIcons.OVERLAY_ADV_PUMP), TextureFactory.of(Textures.BlockIcons.OVERLAY_ADV_PUMP),}; + return new ITexture[] { + TextureFactory.of(Textures.BlockIcons.OVERLAY_ADV_PUMP), + TextureFactory.of(Textures.BlockIcons.OVERLAY_ADV_PUMP), + TextureFactory.of(Textures.BlockIcons.OVERLAY_ADV_PUMP), + TextureFactory.of(Textures.BlockIcons.OVERLAY_ADV_PUMP), + }; } + private FakePlayer mFakePlayer = null; protected FakePlayer getFakePlayer(IGregTechTileEntity aBaseTile) { @@ -750,10 +812,11 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { @Override public String[] getInfoData() { - return new String[]{ - EnumChatFormatting.BLUE+StatCollector.translateToLocal("GT5U.machines.pump")+EnumChatFormatting.RESET, - StatCollector.translateToLocal("GT5U.machines.workarea")+": " + EnumChatFormatting.GREEN + (radiusConfig * 2 + 1)+ - EnumChatFormatting.RESET+" " + StatCollector.translateToLocal("GT5U.machines.blocks") + return new String[] { + EnumChatFormatting.BLUE + StatCollector.translateToLocal("GT5U.machines.pump") + EnumChatFormatting.RESET, + StatCollector.translateToLocal("GT5U.machines.workarea") + ": " + EnumChatFormatting.GREEN + + (radiusConfig * 2 + 1) + EnumChatFormatting.RESET + " " + + StatCollector.translateToLocal("GT5U.machines.blocks") }; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Replicator.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Replicator.java index d6879d31b5..24f49ada10 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Replicator.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Replicator.java @@ -1,5 +1,7 @@ package gregtech.common.tileentities.machines.basic; +import static gregtech.api.enums.Textures.BlockIcons.*; + import gregtech.api.GregTech_API; import gregtech.api.enums.Element; import gregtech.api.enums.ItemList; @@ -14,68 +16,106 @@ import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.items.behaviors.Behaviour_DataOrb; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; - import java.util.HashMap; import java.util.NoSuchElementException; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; -import static gregtech.api.enums.Textures.BlockIcons.*; - -public class GT_MetaTileEntity_Replicator - extends GT_MetaTileEntity_BasicMachine { +public class GT_MetaTileEntity_Replicator extends GT_MetaTileEntity_BasicMachine { public static final HashMap<Materials, Long> MASS_OVERRIDES = new HashMap<>(); public static final double EXPONENT = GregTech_API.sOPStuff.get("Replicator", "Nerf Exponent", 1.2D); private static int sHeaviestElementMass = 0; static { - //put overrides here - //ex. - //MASS_OVERRIDES.put(Materials.get("cake"),Materials.get("cake").getMass()); - //MASS_OVERRIDES.put(Materials.get("otherCake"),1235234L); - //MASS_OVERRIDES.put(Materials.Kalendrite,1235234L); - //MASS_OVERRIDES.put(Materials.Kalendrite,Materials.Kalendrite.getMass()*2); + // put overrides here + // ex. + // MASS_OVERRIDES.put(Materials.get("cake"),Materials.get("cake").getMass()); + // MASS_OVERRIDES.put(Materials.get("otherCake"),1235234L); + // MASS_OVERRIDES.put(Materials.Kalendrite,1235234L); + // MASS_OVERRIDES.put(Materials.Kalendrite,Materials.Kalendrite.getMass()*2); } public GT_MetaTileEntity_Replicator(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 1, "Producing Elemental Matter", 1, 1, "Replicator.png", "", + super( + aID, + aName, + aNameRegional, + aTier, + 1, + "Producing Elemental Matter", + 1, + 1, + "Replicator.png", + "", TextureFactory.of( TextureFactory.of(OVERLAY_SIDE_REPLICATOR_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_SIDE_REPLICATOR_ACTIVE_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_REPLICATOR_ACTIVE_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_SIDE_REPLICATOR), - TextureFactory.builder().addIcon(OVERLAY_SIDE_REPLICATOR_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_REPLICATOR_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_FRONT_REPLICATOR_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_FRONT_REPLICATOR_ACTIVE_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_REPLICATOR_ACTIVE_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_FRONT_REPLICATOR), - TextureFactory.builder().addIcon(OVERLAY_FRONT_REPLICATOR_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_REPLICATOR_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_TOP_REPLICATOR_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_TOP_REPLICATOR_ACTIVE_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_TOP_REPLICATOR_ACTIVE_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_TOP_REPLICATOR), - TextureFactory.builder().addIcon(OVERLAY_TOP_REPLICATOR_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_TOP_REPLICATOR_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_BOTTOM_REPLICATOR_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_BOTTOM_REPLICATOR_ACTIVE_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_REPLICATOR_ACTIVE_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_BOTTOM_REPLICATOR), - TextureFactory.builder().addIcon(OVERLAY_BOTTOM_REPLICATOR_GLOW).glow().build())); + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_REPLICATOR_GLOW) + .glow() + .build())); } - public GT_MetaTileEntity_Replicator(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { + public GT_MetaTileEntity_Replicator( + String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); } - public GT_MetaTileEntity_Replicator(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { + public GT_MetaTileEntity_Replicator( + String aName, + int aTier, + String[] aDescription, + ITexture[][][] aTextures, + String aGUIName, + String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Replicator(this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName); + return new GT_MetaTileEntity_Replicator( + this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName); } public static long cubicFluidMultiplier(long amount) { @@ -87,8 +127,11 @@ public class GT_MetaTileEntity_Replicator FluidStack tFluid = getFillableStack(); if ((tFluid != null) && (tFluid.isFluidEqual(Materials.UUMatter.getFluid(1L)))) { ItemStack tDataOrb = getSpecialSlot(); - if ((ItemList.Tool_DataOrb.isStackEqual(tDataOrb, false, true)) && (Behaviour_DataOrb.getDataTitle(tDataOrb).equals("Elemental-Scan"))) { - Materials tMaterial = Element.get(Behaviour_DataOrb.getDataName(tDataOrb)).mLinkedMaterials.get(0); + if ((ItemList.Tool_DataOrb.isStackEqual(tDataOrb, false, true)) + && (Behaviour_DataOrb.getDataTitle(tDataOrb).equals("Elemental-Scan"))) { + Materials tMaterial = Element.get(Behaviour_DataOrb.getDataName(tDataOrb)) + .mLinkedMaterials + .get(0); long tMass = cubicFluidMultiplier(MASS_OVERRIDES.getOrDefault(tMaterial, tMaterial.getMass())); if ((tFluid.amount >= tMass) && (tMass > 0L)) { @@ -97,10 +140,11 @@ public class GT_MetaTileEntity_Replicator if (mMaxProgresstime == Integer.MAX_VALUE - 1 || mEUt == Integer.MAX_VALUE - 1) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; - if ((this.mOutputItems[0] = GT_OreDictUnificator.get(OrePrefixes.dust, tMaterial, 1L)) == null) { - if ((this.mOutputItems[0] = GT_OreDictUnificator.get(OrePrefixes.cell, tMaterial, 1L)) != null) { - if ((this.mOutputFluid = GT_Utility.getFluidForFilledItem(this.mOutputItems[0], true)) == null) { + if ((this.mOutputItems[0] = GT_OreDictUnificator.get(OrePrefixes.cell, tMaterial, 1L)) + != null) { + if ((this.mOutputFluid = GT_Utility.getFluidForFilledItem(this.mOutputItems[0], true)) + == null) { if (ItemList.Cell_Empty.isStackEqual(getInputAt(0))) { if (canOutput(this.mOutputItems[0])) { getInputAt(0).stackSize -= 1; @@ -110,7 +154,9 @@ public class GT_MetaTileEntity_Replicator } } else { this.mOutputItems[0] = null; - if ((getDrainableStack() == null) || ((getDrainableStack().isFluidEqual(this.mOutputFluid)) && (getDrainableStack().amount < 16000))) { + if ((getDrainableStack() == null) + || ((getDrainableStack().isFluidEqual(this.mOutputFluid)) + && (getDrainableStack().amount < 16000))) { tFluid.amount = ((int) (tFluid.amount - tMass)); return 2; } @@ -132,8 +178,10 @@ public class GT_MetaTileEntity_Replicator } @Override - protected boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - return super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack) && ItemList.Cell_Empty.isStackEqual(aStack); + protected boolean allowPutStackValidated( + IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack) + && ItemList.Cell_Empty.isStackEqual(aStack); } @Override @@ -144,8 +192,11 @@ public class GT_MetaTileEntity_Replicator @Override public int getCapacity() { if ((sHeaviestElementMass == 0) && (GregTech_API.sPostloadFinished)) { - sHeaviestElementMass = Materials.getMaterialsMap().values().stream().mapToInt(material -> (int) cubicFluidMultiplier((int) material.getMass())).max().orElseThrow(NoSuchElementException::new); - //Make the Number nicer =) + sHeaviestElementMass = Materials.getMaterialsMap().values().stream() + .mapToInt(material -> (int) cubicFluidMultiplier((int) material.getMass())) + .max() + .orElseThrow(NoSuchElementException::new); + // Make the Number nicer =) sHeaviestElementMass = 1000 * (sHeaviestElementMass / 1000 + 1); } return sHeaviestElementMass; diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_RockBreaker.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_RockBreaker.java index 09e1c6e107..889d8eb11f 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_RockBreaker.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_RockBreaker.java @@ -1,5 +1,7 @@ package gregtech.common.tileentities.machines.basic; +import static gregtech.api.enums.Textures.BlockIcons.*; + import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.interfaces.ITexture; @@ -13,48 +15,88 @@ import gregtech.api.util.GT_Utility; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; -import static gregtech.api.enums.Textures.BlockIcons.*; - public class GT_MetaTileEntity_RockBreaker extends GT_MetaTileEntity_BasicMachine { public GT_MetaTileEntity_RockBreaker(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 1, "Put Lava and Water adjacent", 1, 1, "RockBreaker.png", "", + super( + aID, + aName, + aNameRegional, + aTier, + 1, + "Put Lava and Water adjacent", + 1, + 1, + "RockBreaker.png", + "", TextureFactory.of( TextureFactory.of(OVERLAY_SIDE_ROCK_BREAKER_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_SIDE_ROCK_BREAKER_ACTIVE_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_ROCK_BREAKER_ACTIVE_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_SIDE_ROCK_BREAKER), - TextureFactory.builder().addIcon(OVERLAY_SIDE_ROCK_BREAKER_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_ROCK_BREAKER_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_FRONT_ROCK_BREAKER_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_FRONT_ROCK_BREAKER_ACTIVE_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ROCK_BREAKER_ACTIVE_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_FRONT_ROCK_BREAKER), - TextureFactory.builder().addIcon(OVERLAY_FRONT_ROCK_BREAKER_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ROCK_BREAKER_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_TOP_ROCK_BREAKER_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_TOP_ROCK_BREAKER_ACTIVE_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_TOP_ROCK_BREAKER_ACTIVE_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_TOP_ROCK_BREAKER), - TextureFactory.builder().addIcon(OVERLAY_TOP_ROCK_BREAKER_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_TOP_ROCK_BREAKER_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_BOTTOM_ROCK_BREAKER), - TextureFactory.builder().addIcon(OVERLAY_BOTTOM_ROCK_BREAKER_GLOW).glow().build())); + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_ROCK_BREAKER_GLOW) + .glow() + .build())); } - public GT_MetaTileEntity_RockBreaker(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { + public GT_MetaTileEntity_RockBreaker( + String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); } - public GT_MetaTileEntity_RockBreaker(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { + public GT_MetaTileEntity_RockBreaker( + String aName, + int aTier, + String[] aDescription, + ITexture[][][] aTextures, + String aGUIName, + String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_RockBreaker(this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName); + return new GT_MetaTileEntity_RockBreaker( + this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName); } @Override @@ -63,8 +105,10 @@ public class GT_MetaTileEntity_RockBreaker extends GT_MetaTileEntity_BasicMachin } @Override - protected boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - return super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack) && getRecipeList().containsInput(aStack); + protected boolean allowPutStackValidated( + IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack) + && getRecipeList().containsInput(aStack); } @Override @@ -75,21 +119,28 @@ public class GT_MetaTileEntity_RockBreaker extends GT_MetaTileEntity_BasicMachin @Override public int checkRecipe() { IGregTechTileEntity aBaseMetaTileEntity = getBaseMetaTileEntity(); - if ((aBaseMetaTileEntity.getBlockOffset(0, 0, 1) == Blocks.water) || (aBaseMetaTileEntity.getBlockOffset(0, 0, -1) == Blocks.water) || (aBaseMetaTileEntity.getBlockOffset(-1, 0, 0) == Blocks.water) || (aBaseMetaTileEntity.getBlockOffset(1, 0, 0) == Blocks.water)) { + if ((aBaseMetaTileEntity.getBlockOffset(0, 0, 1) == Blocks.water) + || (aBaseMetaTileEntity.getBlockOffset(0, 0, -1) == Blocks.water) + || (aBaseMetaTileEntity.getBlockOffset(-1, 0, 0) == Blocks.water) + || (aBaseMetaTileEntity.getBlockOffset(1, 0, 0) == Blocks.water)) { ItemStack tOutput = null; if (aBaseMetaTileEntity.getBlockOffset(0, 1, 0) == Blocks.lava) { tOutput = new ItemStack(Blocks.stone, 1); - } else if ((aBaseMetaTileEntity.getBlockOffset(0, 0, 1) == Blocks.lava) || (aBaseMetaTileEntity.getBlockOffset(0, 0, -1) == Blocks.lava) || (aBaseMetaTileEntity.getBlockOffset(-1, 0, 0) == Blocks.lava) || (aBaseMetaTileEntity.getBlockOffset(1, 0, 0) == Blocks.lava)) { + } else if ((aBaseMetaTileEntity.getBlockOffset(0, 0, 1) == Blocks.lava) + || (aBaseMetaTileEntity.getBlockOffset(0, 0, -1) == Blocks.lava) + || (aBaseMetaTileEntity.getBlockOffset(-1, 0, 0) == Blocks.lava) + || (aBaseMetaTileEntity.getBlockOffset(1, 0, 0) == Blocks.lava)) { tOutput = new ItemStack(Blocks.cobblestone, 1); } if (tOutput != null) { - if(GT_Utility.areStacksEqual(getStackInSlot(getCircuitSlot()), GT_Utility.getIntegratedCircuit(1))){ - if (GT_Utility.areStacksEqual(getInputAt(0), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Redstone, 1L))) { + if (GT_Utility.areStacksEqual(getStackInSlot(getCircuitSlot()), GT_Utility.getIntegratedCircuit(1))) { + if (GT_Utility.areStacksEqual( + getInputAt(0), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Redstone, 1L))) { tOutput = new ItemStack(Blocks.obsidian, 1); if (canOutput(tOutput)) { getInputAt(0).stackSize -= 1; calculateOverclockedNess(32, 128); - //In case recipe is too OP for that machine + // In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; this.mOutputItems[0] = tOutput; @@ -97,8 +148,8 @@ public class GT_MetaTileEntity_RockBreaker extends GT_MetaTileEntity_BasicMachin } } } else if (canOutput(tOutput)) { - calculateOverclockedNess(32,16); - //In case recipe is too OP for that machine + calculateOverclockedNess(32, 16); + // In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; this.mOutputItems[0] = tOutput; diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java index 4bc9a56e2f..7780e56eee 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java @@ -1,5 +1,9 @@ package gregtech.common.tileentities.machines.basic; +import static gregtech.api.enums.GT_Values.*; +import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes; + import forestry.api.genetics.AlleleManager; import forestry.api.genetics.IIndividual; import gregtech.GT_Mod; @@ -20,58 +24,95 @@ import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.items.behaviors.Behaviour_DataOrb; +import java.util.Objects; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import java.util.Objects; - -import static gregtech.api.enums.GT_Values.*; -import static gregtech.api.enums.Textures.BlockIcons.*; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes; - public class GT_MetaTileEntity_Scanner extends GT_MetaTileEntity_BasicMachine { public GT_MetaTileEntity_Scanner(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 1, "Scans Crops and other things.", 1, 1, "Scanner.png", "", - TextureFactory.of( - TextureFactory.of(OVERLAY_SIDE_SCANNER_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_SIDE_SCANNER_ACTIVE_GLOW).glow().build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_SIDE_SCANNER), - TextureFactory.builder().addIcon(OVERLAY_SIDE_SCANNER_GLOW).glow().build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_FRONT_SCANNER_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_FRONT_SCANNER_ACTIVE_GLOW).glow().build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_FRONT_SCANNER), - TextureFactory.builder().addIcon(OVERLAY_FRONT_SCANNER_GLOW).glow().build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_TOP_SCANNER_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_TOP_SCANNER_ACTIVE_GLOW).glow().build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_TOP_SCANNER), - TextureFactory.builder().addIcon(OVERLAY_TOP_SCANNER_GLOW).glow().build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_BOTTOM_SCANNER_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_BOTTOM_SCANNER_ACTIVE_GLOW).glow().build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_BOTTOM_SCANNER), - TextureFactory.builder().addIcon(OVERLAY_BOTTOM_SCANNER_GLOW).glow().build())); + super( + aID, + aName, + aNameRegional, + aTier, + 1, + "Scans Crops and other things.", + 1, + 1, + "Scanner.png", + "", + TextureFactory.of( + TextureFactory.of(OVERLAY_SIDE_SCANNER_ACTIVE), + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_SCANNER_ACTIVE_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_SIDE_SCANNER), + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_SCANNER_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_FRONT_SCANNER_ACTIVE), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_SCANNER_ACTIVE_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_FRONT_SCANNER), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_SCANNER_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_TOP_SCANNER_ACTIVE), + TextureFactory.builder() + .addIcon(OVERLAY_TOP_SCANNER_ACTIVE_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_TOP_SCANNER), + TextureFactory.builder() + .addIcon(OVERLAY_TOP_SCANNER_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_BOTTOM_SCANNER_ACTIVE), + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_SCANNER_ACTIVE_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_BOTTOM_SCANNER), + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_SCANNER_GLOW) + .glow() + .build())); } - public GT_MetaTileEntity_Scanner(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { + public GT_MetaTileEntity_Scanner( + String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); } - public GT_MetaTileEntity_Scanner(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { + public GT_MetaTileEntity_Scanner( + String aName, + int aTier, + String[] aDescription, + ITexture[][][] aTextures, + String aGUIName, + String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Scanner(this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName); + return new GT_MetaTileEntity_Scanner( + this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName); } @Override @@ -92,7 +133,7 @@ public class GT_MetaTileEntity_Scanner extends GT_MetaTileEntity_BasicMachine { tIndividual.writeToNBT(tNBT); this.mOutputItems[0].setTagCompound(tNBT); calculateOverclockedNess(2, 500); - //In case recipe is too OP for that machine + // In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; return 2; @@ -117,7 +158,7 @@ public class GT_MetaTileEntity_Scanner extends GT_MetaTileEntity_BasicMachine { if (tNBT.getByte("scan") < 4) { tNBT.setByte("scan", (byte) 4); calculateOverclockedNess(8, 160); - //In case recipe is too OP for that machine + // In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; } else { @@ -135,13 +176,18 @@ public class GT_MetaTileEntity_Scanner extends GT_MetaTileEntity_BasicMachine { aStack.stackSize -= 1; this.mOutputItems[0] = GT_Utility.copyAmount(1L, getSpecialSlot()); calculateOverclockedNess(30, 512); - //In case recipe is too OP for that machine + // In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; return 2; } ItemData tData = GT_OreDictUnificator.getAssociation(aStack); - if ((tData != null) && ((tData.mPrefix == OrePrefixes.dust) || (tData.mPrefix == OrePrefixes.cell)) && (tData.mMaterial.mMaterial.mElement != null) && (!tData.mMaterial.mMaterial.mElement.mIsIsotope) && (tData.mMaterial.mMaterial != Materials.Magic) && (tData.mMaterial.mMaterial.getMass() > 0L)) { + if ((tData != null) + && ((tData.mPrefix == OrePrefixes.dust) || (tData.mPrefix == OrePrefixes.cell)) + && (tData.mMaterial.mMaterial.mElement != null) + && (!tData.mMaterial.mMaterial.mElement.mIsIsotope) + && (tData.mMaterial.mMaterial != Materials.Magic) + && (tData.mMaterial.mMaterial.getMass() > 0L)) { getSpecialSlot().stackSize -= 1; aStack.stackSize -= 1; @@ -149,7 +195,7 @@ public class GT_MetaTileEntity_Scanner extends GT_MetaTileEntity_BasicMachine { Behaviour_DataOrb.setDataTitle(this.mOutputItems[0], "Elemental-Scan"); Behaviour_DataOrb.setDataName(this.mOutputItems[0], tData.mMaterial.mMaterial.mElement.name()); calculateOverclockedNess(30, GT_Utility.safeInt(tData.mMaterial.mMaterial.getMass() * 8192L)); - //In case recipe is too OP for that machine + // In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; return 2; @@ -160,7 +206,7 @@ public class GT_MetaTileEntity_Scanner extends GT_MetaTileEntity_BasicMachine { aStack.stackSize -= 1; this.mOutputItems[0] = GT_Utility.copyAmount(1L, getSpecialSlot()); calculateOverclockedNess(30, 128); - //In case recipe is too OP for that machine + // In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; return 2; @@ -173,7 +219,7 @@ public class GT_MetaTileEntity_Scanner extends GT_MetaTileEntity_BasicMachine { assert this.mOutputItems[0] != null; this.mOutputItems[0].setTagCompound(aStack.getTagCompound()); calculateOverclockedNess(30, 128); - //In case recipe is too OP for that machine + // In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; return 2; @@ -184,38 +230,67 @@ public class GT_MetaTileEntity_Scanner extends GT_MetaTileEntity_BasicMachine { this.mOutputItems[0] = GT_Utility.copyAmount(1L, getSpecialSlot()); assert this.mOutputItems[0] != null; - this.mOutputItems[0].setTagCompound(GT_Utility.getNBTContainingShort(new NBTTagCompound(), "map_id", (short) aStack.getItemDamage())); + this.mOutputItems[0].setTagCompound(GT_Utility.getNBTContainingShort( + new NBTTagCompound(), "map_id", (short) aStack.getItemDamage())); calculateOverclockedNess(30, 128); - //In case recipe is too OP for that machine + // In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; return 2; } - if ((aStack.getItem().getUnlocalizedName().contains("Schematic") || aStack.getItem().getUnlocalizedName().contains("schematic")) && !aStack.getItem().getUnlocalizedName().contains("Schematics")) { - if (mTier < 3) - return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + if ((aStack.getItem().getUnlocalizedName().contains("Schematic") + || aStack.getItem().getUnlocalizedName().contains("schematic")) + && !aStack.getItem().getUnlocalizedName().contains("Schematics")) { + if (mTier < 3) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; String sTier = ""; int stackItemID = Item.getIdFromItem(aStack.getItem()); int stackItemDamage = aStack.getItemDamage(); - if (stackItemID == Item.getIdFromItem(Objects.requireNonNull(GT_ModHandler.getModItem(MOD_ID_GC_CORE, "item.schematic", 1L, 0)).getItem())) { - if (stackItemDamage == 0 && aStack.toString().equals(Objects.requireNonNull(GT_ModHandler.getModItem(MOD_ID_GC_CORE, "item.schematic", 1L, 0)).copy().toString())) - sTier = "100"; - else if (stackItemDamage == 1 && aStack.toString().equals(Objects.requireNonNull(GT_ModHandler.getModItem(MOD_ID_GC_CORE, "item.schematic", 1L, 1)).copy().toString())) - sTier = "2"; + if (stackItemID + == Item.getIdFromItem(Objects.requireNonNull( + GT_ModHandler.getModItem(MOD_ID_GC_CORE, "item.schematic", 1L, 0)) + .getItem())) { + if (stackItemDamage == 0 + && aStack.toString() + .equals(Objects.requireNonNull(GT_ModHandler.getModItem( + MOD_ID_GC_CORE, "item.schematic", 1L, 0)) + .copy() + .toString())) sTier = "100"; + else if (stackItemDamage == 1 + && aStack.toString() + .equals(Objects.requireNonNull(GT_ModHandler.getModItem( + MOD_ID_GC_CORE, "item.schematic", 1L, 1)) + .copy() + .toString())) sTier = "2"; } else { - if (stackItemID == Item.getIdFromItem(Objects.requireNonNull(GT_ModHandler.getModItem(MOD_ID_GC_MARS, "item.schematic", 1L, 0)).getItem())) { - if (stackItemDamage == 0 && aStack.toString().equals(Objects.requireNonNull(GT_ModHandler.getModItem(MOD_ID_GC_MARS, "item.schematic", 1L, 0)).copy().toString())) - sTier = "3"; - else if (stackItemDamage == 1 && aStack.toString().equals(Objects.requireNonNull(GT_ModHandler.getModItem(MOD_ID_GC_MARS, "item.schematic", 1L, 1)).copy().toString())) - sTier = "101"; - else if (stackItemDamage == 2 && aStack.toString().equals(Objects.requireNonNull(GT_ModHandler.getModItem(MOD_ID_GC_MARS, "item.schematic", 1L, 2)).copy().toString())) - sTier = "102"; + if (stackItemID + == Item.getIdFromItem(Objects.requireNonNull( + GT_ModHandler.getModItem(MOD_ID_GC_MARS, "item.schematic", 1L, 0)) + .getItem())) { + if (stackItemDamage == 0 + && aStack.toString() + .equals(Objects.requireNonNull(GT_ModHandler.getModItem( + MOD_ID_GC_MARS, "item.schematic", 1L, 0)) + .copy() + .toString())) sTier = "3"; + else if (stackItemDamage == 1 + && aStack.toString() + .equals(Objects.requireNonNull(GT_ModHandler.getModItem( + MOD_ID_GC_MARS, "item.schematic", 1L, 1)) + .copy() + .toString())) sTier = "101"; + else if (stackItemDamage == 2 + && aStack.toString() + .equals(Objects.requireNonNull(GT_ModHandler.getModItem( + MOD_ID_GC_MARS, "item.schematic", 1L, 2)) + .copy() + .toString())) sTier = "102"; } else if (aStack.getUnlocalizedName().matches(".*\\d+.*")) - sTier = aStack.getUnlocalizedName().split("(?<=\\D)(?=\\d)")[1].substring(0, 1); - else - sTier = "1"; + sTier = aStack.getUnlocalizedName() + .split("(?<=\\D)(?=\\d)")[1] + .substring(0, 1); + else sTier = "1"; } getSpecialSlot().stackSize -= 1; @@ -223,15 +298,15 @@ public class GT_MetaTileEntity_Scanner extends GT_MetaTileEntity_BasicMachine { this.mOutputItems[0] = GT_Utility.copyAmount(1L, getSpecialSlot()); assert this.mOutputItems[0] != null; - this.mOutputItems[0].setTagCompound(GT_Utility.getNBTContainingShort(new NBTTagCompound(), "rocket_tier", Short.parseShort(sTier))); + this.mOutputItems[0].setTagCompound(GT_Utility.getNBTContainingShort( + new NBTTagCompound(), "rocket_tier", Short.parseShort(sTier))); calculateOverclockedNess(480, 36000); - //In case recipe is too OP for that machine + // In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; return 2; } - } if (getSpecialSlot() == null && ItemList.Tool_DataStick.isStackEqual(aStack, false, true)) { if (GT_Utility.ItemNBT.getBookTitle(aStack).equals("Raw Prospection Data")) { @@ -241,11 +316,10 @@ public class GT_MetaTileEntity_Scanner extends GT_MetaTileEntity_BasicMachine { this.mOutputItems[0] = GT_Utility.copyAmount(1L, aStack); calculateOverclockedNess(30, 1000); - //In case recipe is too OP for that machine + // In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; return 2; - } } if (ItemList.Tool_DataStick.isStackEqual(getSpecialSlot(), false, true)) { @@ -268,17 +342,15 @@ public class GT_MetaTileEntity_Scanner extends GT_MetaTileEntity_BasicMachine { if (GT_AssemblyLineUtils.setAssemblyLineRecipeOnDataStick(this.mOutputItems[0], tRecipe)) { aStack.stackSize -= 1; calculateOverclockedNess(30, tRecipe.mResearchTime); - //In case recipe is too OP for that machine + // In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; getSpecialSlot().stackSize -= 1; return 2; } - } } } - } return 0; } @@ -286,14 +358,16 @@ public class GT_MetaTileEntity_Scanner extends GT_MetaTileEntity_BasicMachine { @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (mProgresstime >= (mMaxProgresstime - 1)) { - if ((this.mOutputItems[0] != null) && (this.mOutputItems[0].getUnlocalizedName().equals("gt.metaitem.01.32707"))) { - GT_Mod.achievements.issueAchievement(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), "scanning"); + if ((this.mOutputItems[0] != null) + && (this.mOutputItems[0].getUnlocalizedName().equals("gt.metaitem.01.32707"))) { + GT_Mod.achievements.issueAchievement( + aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), + "scanning"); } } super.onPostTick(aBaseMetaTileEntity, aTick); } - @Override public GT_Recipe.GT_Recipe_Map getRecipeList() { return sScannerFakeRecipes; @@ -305,8 +379,10 @@ public class GT_MetaTileEntity_Scanner extends GT_MetaTileEntity_BasicMachine { } @Override - protected boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - return super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack) && getRecipeList().containsInput(aStack); + protected boolean allowPutStackValidated( + IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack) + && getRecipeList().containsInput(aStack); } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_SeismicProspector.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_SeismicProspector.java index b6ff782cfb..ff54291188 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_SeismicProspector.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_SeismicProspector.java @@ -1,5 +1,7 @@ package gregtech.common.tileentities.machines.basic; +import static gregtech.api.enums.Textures.BlockIcons.*; + import gregtech.api.GregTech_API; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; @@ -15,6 +17,8 @@ import gregtech.common.GT_UndergroundOil; import gregtech.common.blocks.GT_Block_Ores_Abstract; import gregtech.common.blocks.GT_TileEntity_Ores; import ic2.core.Ic2Items; +import java.util.ArrayList; +import java.util.List; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; @@ -23,115 +27,175 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.fluids.FluidStack; -import java.util.ArrayList; -import java.util.List; - -import static gregtech.api.enums.Textures.BlockIcons.*; - public class GT_MetaTileEntity_SeismicProspector extends GT_MetaTileEntity_BasicMachine { boolean ready = false; public GT_MetaTileEntity_SeismicProspector(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 1, - "(DEPRECATED, DO NOT USE! SWAP TO ADVANCED VERSION USING SHAPELESS RECIPE!)", 1, 1, - "Default.png", "", + super( + aID, + aName, + aNameRegional, + aTier, + 1, + "(DEPRECATED, DO NOT USE! SWAP TO ADVANCED VERSION USING SHAPELESS RECIPE!)", + 1, + 1, + "Default.png", + "", TextureFactory.of( TextureFactory.of(OVERLAY_SIDE_ROCK_BREAKER_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_SIDE_ROCK_BREAKER_ACTIVE_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_ROCK_BREAKER_ACTIVE_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_SIDE_ROCK_BREAKER), - TextureFactory.builder().addIcon(OVERLAY_SIDE_ROCK_BREAKER_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_ROCK_BREAKER_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_TOP_ROCK_BREAKER_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_TOP_ROCK_BREAKER_ACTIVE_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_TOP_ROCK_BREAKER_ACTIVE_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_TOP_ROCK_BREAKER), - TextureFactory.builder().addIcon(OVERLAY_TOP_ROCK_BREAKER_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_TOP_ROCK_BREAKER_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_FRONT_ROCK_BREAKER_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_FRONT_ROCK_BREAKER_ACTIVE_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ROCK_BREAKER_ACTIVE_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_FRONT_ROCK_BREAKER), - TextureFactory.builder().addIcon(OVERLAY_FRONT_ROCK_BREAKER_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ROCK_BREAKER_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE_GLOW).glow().build()), + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE_GLOW) + .glow() + .build()), TextureFactory.of( TextureFactory.of(OVERLAY_BOTTOM_ROCK_BREAKER), - TextureFactory.builder().addIcon(OVERLAY_BOTTOM_ROCK_BREAKER_GLOW).glow().build())); + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_ROCK_BREAKER_GLOW) + .glow() + .build())); } - public GT_MetaTileEntity_SeismicProspector(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { + public GT_MetaTileEntity_SeismicProspector( + String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); } - public GT_MetaTileEntity_SeismicProspector(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { + public GT_MetaTileEntity_SeismicProspector( + String aName, + int aTier, + String[] aDescription, + ITexture[][][] aTextures, + String aGUIName, + String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_SeismicProspector(this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName); + return new GT_MetaTileEntity_SeismicProspector( + this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName); } @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { if (aBaseMetaTileEntity.isServerSide()) { ItemStack aStack = aPlayer.getCurrentEquippedItem(); - ItemData stackData= GT_OreDictUnificator.getItemData(aStack); - if (!ready && (aStack != null) && ( - (aStack.getItem() == Item.getItemFromBlock(Blocks.tnt) && aStack.stackSize >= 2 ) || - (aStack.getItem() == Ic2Items.industrialTnt.getItem() && aStack.stackSize >= 1 ) || - (aStack.getItem() == Ic2Items.dynamite.getItem() && aStack.stackSize >= 4 ) || - (stackData!=null && stackData.mMaterial.mMaterial == Materials.Glyceryl && aStack.stackSize >= 1 ) || - (aStack.getItem() == ItemList.Block_Powderbarrel.getItem() && aStack.getItemDamage()==ItemList.Block_Powderbarrel.get(1).getItemDamage() && aStack.stackSize >= 8 ) - ) ) { + ItemData stackData = GT_OreDictUnificator.getItemData(aStack); + if (!ready + && (aStack != null) + && ((aStack.getItem() == Item.getItemFromBlock(Blocks.tnt) && aStack.stackSize >= 2) + || (aStack.getItem() == Ic2Items.industrialTnt.getItem() && aStack.stackSize >= 1) + || (aStack.getItem() == Ic2Items.dynamite.getItem() && aStack.stackSize >= 4) + || (stackData != null + && stackData.mMaterial.mMaterial == Materials.Glyceryl + && aStack.stackSize >= 1) + || (aStack.getItem() == ItemList.Block_Powderbarrel.getItem() + && aStack.getItemDamage() + == ItemList.Block_Powderbarrel.get(1) + .getItemDamage() + && aStack.stackSize >= 8))) { if ((!aPlayer.capabilities.isCreativeMode) && (aStack.stackSize != 111)) { - if(aStack.getItem() == Item.getItemFromBlock(Blocks.tnt)){ - aStack.stackSize -= 2; - }else if(aStack.getItem() == Ic2Items.industrialTnt.getItem()){ - aStack.stackSize -= 1; - }else if(aStack.getItem() == Ic2Items.dynamite.getItem()){ - aStack.stackSize -= 4; - }else if(aStack.getItem() == ItemList.Block_Powderbarrel.getItem() && aStack.getItemDamage()==ItemList.Block_Powderbarrel.get(1).getItemDamage()){ - aStack.stackSize -= 8; - }else{ - aStack.stackSize -= 1; + if (aStack.getItem() == Item.getItemFromBlock(Blocks.tnt)) { + aStack.stackSize -= 2; + } else if (aStack.getItem() == Ic2Items.industrialTnt.getItem()) { + aStack.stackSize -= 1; + } else if (aStack.getItem() == Ic2Items.dynamite.getItem()) { + aStack.stackSize -= 4; + } else if (aStack.getItem() == ItemList.Block_Powderbarrel.getItem() + && aStack.getItemDamage() + == ItemList.Block_Powderbarrel.get(1).getItemDamage()) { + aStack.stackSize -= 8; + } else { + aStack.stackSize -= 1; } } this.ready = true; this.mMaxProgresstime = 200; - } else if (ready && mMaxProgresstime == 0 && aStack != null && aStack.stackSize == 1 && aStack.getItem() == ItemList.Tool_DataStick.getItem()) { + } else if (ready + && mMaxProgresstime == 0 + && aStack != null + && aStack.stackSize == 1 + && aStack.getItem() == ItemList.Tool_DataStick.getItem()) { this.ready = false; GT_Utility.ItemNBT.setBookTitle(aPlayer.getCurrentEquippedItem(), "Raw Prospection Data"); List<String> tStringList = new ArrayList<String>(); - //range by tier - int min=-range(); - int max=range(); - int step=step(); + // range by tier + int min = -range(); + int max = range(); + int step = step(); for (int i = this.getBaseMetaTileEntity().getYCoord(); i > 0; i--) { - for (int f = min; f <= max; f+=step) { - for (int g = min; g <= max; g+=step) { + for (int f = min; f <= max; f += step) { + for (int g = min; g <= max; g += step) { Block tBlock = this.getBaseMetaTileEntity().getBlockOffset(f, -i, g); if ((tBlock instanceof GT_Block_Ores_Abstract)) { - TileEntity tTileEntity = getBaseMetaTileEntity().getWorld().getTileEntity(getBaseMetaTileEntity().getXCoord() + f, getBaseMetaTileEntity().getYCoord() + (-i), getBaseMetaTileEntity().getZCoord() + g); + TileEntity tTileEntity = getBaseMetaTileEntity() + .getWorld() + .getTileEntity( + getBaseMetaTileEntity().getXCoord() + f, + getBaseMetaTileEntity().getYCoord() + (-i), + getBaseMetaTileEntity().getZCoord() + g); if ((tTileEntity instanceof GT_TileEntity_Ores)) { - if(((GT_TileEntity_Ores) tTileEntity).mMetaData < 16000){ - Materials tMaterial = GregTech_API.sGeneratedMaterials[(((GT_TileEntity_Ores) tTileEntity).mMetaData % 1000)]; - if ((tMaterial != null) && (tMaterial != Materials._NULL)) { - if (!tStringList.contains(tMaterial.mDefaultLocalName)) { - tStringList.add(tMaterial.mDefaultLocalName); + if (((GT_TileEntity_Ores) tTileEntity).mMetaData < 16000) { + Materials tMaterial = GregTech_API.sGeneratedMaterials[ + (((GT_TileEntity_Ores) tTileEntity).mMetaData % 1000)]; + if ((tMaterial != null) && (tMaterial != Materials._NULL)) { + if (!tStringList.contains(tMaterial.mDefaultLocalName)) { + tStringList.add(tMaterial.mDefaultLocalName); + } } } - } } } else { - int tMetaID = getBaseMetaTileEntity().getWorld().getBlockMetadata(getBaseMetaTileEntity().getXCoord() + f, getBaseMetaTileEntity().getYCoord() + (-i), getBaseMetaTileEntity().getZCoord() + g); - ItemData tAssotiation = GT_OreDictUnificator.getAssociation(new ItemStack(tBlock, 1, tMetaID)); - if ((tAssotiation != null) && (tAssotiation.mPrefix.toString().startsWith("ore"))) { + int tMetaID = getBaseMetaTileEntity() + .getWorld() + .getBlockMetadata( + getBaseMetaTileEntity().getXCoord() + f, + getBaseMetaTileEntity().getYCoord() + (-i), + getBaseMetaTileEntity().getZCoord() + g); + ItemData tAssotiation = + GT_OreDictUnificator.getAssociation(new ItemStack(tBlock, 1, tMetaID)); + if ((tAssotiation != null) + && (tAssotiation.mPrefix.toString().startsWith("ore"))) { if (!tStringList.contains(tAssotiation.mMaterial.mMaterial.mDefaultLocalName)) { tStringList.add(tAssotiation.mMaterial.mMaterial.mDefaultLocalName); } @@ -140,7 +204,9 @@ public class GT_MetaTileEntity_SeismicProspector extends GT_MetaTileEntity_Basic } } } - if(tStringList.size()<1){tStringList.add("No Ores found.");} + if (tStringList.size() < 1) { + tStringList.add("No Ores found."); + } FluidStack tFluid = GT_UndergroundOil.undergroundOilReadInformation(getBaseMetaTileEntity()); String[] tStringArray = new String[tStringList.size()]; { @@ -148,7 +214,14 @@ public class GT_MetaTileEntity_SeismicProspector extends GT_MetaTileEntity_Basic tStringArray[i] = tStringList.get(i); } } - GT_Utility.ItemNBT.setProspectionData(aPlayer.getCurrentEquippedItem(), this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord(), this.getBaseMetaTileEntity().getWorld().provider.dimensionId, tFluid, tStringArray); + GT_Utility.ItemNBT.setProspectionData( + aPlayer.getCurrentEquippedItem(), + this.getBaseMetaTileEntity().getXCoord(), + this.getBaseMetaTileEntity().getYCoord(), + this.getBaseMetaTileEntity().getZCoord(), + this.getBaseMetaTileEntity().getWorld().provider.dimensionId, + tFluid, + tStringArray); } } @@ -157,18 +230,24 @@ public class GT_MetaTileEntity_SeismicProspector extends GT_MetaTileEntity_Basic private int range() { switch (mTier) { - case 1: return 16; - case 2: return 32; - case 3: return 48; + case 1: + return 16; + case 2: + return 32; + case 3: + return 48; } return 0; } - private int step(){ - switch (mTier){ - case 1: return 1; - case 2: return 3; - case 3: return 4; + private int step() { + switch (mTier) { + case 1: + return 1; + case 2: + return 3; + case 3: + return 4; } return 1; } diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java index eb59f1f7e5..9dc00109cf 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java @@ -1,5 +1,14 @@ package gregtech.common.tileentities.machines.basic; +import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TELEPORTER; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TELEPORTER_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TELEPORTER_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TELEPORTER_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TELEPORTER_SIDES; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TELEPORTER_SIDES_GLOW; + import gregtech.api.enums.ConfigCategories; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -10,6 +19,7 @@ import gregtech.api.util.GT_Config; import gregtech.api.util.GT_Utility; import gregtech.common.gui.GT_Container_Teleporter; import gregtech.common.gui.GT_GUIContainer_Teleporter; +import java.util.List; import net.minecraft.client.particle.EntityFX; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityHanging; @@ -40,17 +50,6 @@ import net.minecraft.world.World; import net.minecraftforge.common.DimensionManager; import net.minecraftforge.fluids.FluidStack; -import java.util.List; - -import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TELEPORTER; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TELEPORTER_ACTIVE; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TELEPORTER_ACTIVE_GLOW; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TELEPORTER_GLOW; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TELEPORTER_SIDES; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TELEPORTER_SIDES_GLOW; - public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank { private static boolean sInterDimensionalTeleportAllowed = true; @@ -60,12 +59,16 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank { public int mTargetX = 0; public int mTargetY = 0; public int mTargetZ = 0; - public int mTargetD = Integer.MIN_VALUE;//0 + public int mTargetD = Integer.MIN_VALUE; // 0 public boolean mDebug = false; - //public boolean hasEgg = false; + // public boolean hasEgg = false; public GT_MetaTileEntity_Teleporter(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 3, new String[]{"Teleport long distances with this little device.", "Use a Dragon Egg or Nitrogen Plasma", "for Inter-dimensional transmission"}); + super(aID, aName, aNameRegional, aTier, 3, new String[] { + "Teleport long distances with this little device.", + "Use a Dragon Egg or Nitrogen Plasma", + "for Inter-dimensional transmission" + }); } public GT_MetaTileEntity_Teleporter(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { @@ -97,7 +100,9 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank { int tCount = 64; for (int i = 0; i < 36; i++) { if (tPlayer.inventory.getStackInSlot(i) != null) { - tCount += (tPlayer.inventory.getStackInSlot(i).getMaxStackSize() > 1 ? tPlayer.inventory.getStackInSlot(i).stackSize : 64); + tCount += (tPlayer.inventory.getStackInSlot(i).getMaxStackSize() > 1 + ? tPlayer.inventory.getStackInSlot(i).stackSize + : 64); } } for (int i = 0; i < 4; i++) { @@ -158,7 +163,7 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank { @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { if (aBaseMetaTileEntity.isClientSide()) return true; - //this.hasEgg = checkForEgg(); + // this.hasEgg = checkForEgg(); aBaseMetaTileEntity.openGUI(aPlayer); return true; } @@ -182,35 +187,57 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank { public boolean isGivingInformation() { return true; } - @Override public String[] getInfoData() { - return new String[]{ - "Coordinates:", - "X: " + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(this.mTargetX) + EnumChatFormatting.RESET, - "Y: " + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(this.mTargetY) + EnumChatFormatting.RESET, - "Z: " + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(this.mTargetZ) + EnumChatFormatting.RESET, - "Dimension: " + EnumChatFormatting.GREEN+this.mTargetD+EnumChatFormatting.RESET, - "Dimension Valid: " + (GT_Utility.isRealDimension(this.mTargetD) ? EnumChatFormatting.GREEN+"Yes"+EnumChatFormatting.RESET : EnumChatFormatting.RED+"No"+EnumChatFormatting.RESET), - "Dimension Registered: " + (DimensionManager.isDimensionRegistered(this.mTargetD) ? EnumChatFormatting.GREEN+"Yes"+EnumChatFormatting.RESET : EnumChatFormatting.RED+"No"+EnumChatFormatting.RESET) + return new String[] { + "Coordinates:", + "X: " + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(this.mTargetX) + EnumChatFormatting.RESET, + "Y: " + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(this.mTargetY) + EnumChatFormatting.RESET, + "Z: " + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(this.mTargetZ) + EnumChatFormatting.RESET, + "Dimension: " + EnumChatFormatting.GREEN + this.mTargetD + EnumChatFormatting.RESET, + "Dimension Valid: " + + (GT_Utility.isRealDimension(this.mTargetD) + ? EnumChatFormatting.GREEN + "Yes" + EnumChatFormatting.RESET + : EnumChatFormatting.RED + "No" + EnumChatFormatting.RESET), + "Dimension Registered: " + + (DimensionManager.isDimensionRegistered(this.mTargetD) + ? EnumChatFormatting.GREEN + "Yes" + EnumChatFormatting.RESET + : EnumChatFormatting.RED + "No" + EnumChatFormatting.RESET) }; } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - if (aSide != this.getBaseMetaTileEntity().getFrontFacing()) return new ITexture[]{ + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { + if (aSide != this.getBaseMetaTileEntity().getFrontFacing()) + return new ITexture[] { MACHINE_CASINGS[mTier][aColorIndex + 1], TextureFactory.of(OVERLAY_TELEPORTER_SIDES), - TextureFactory.builder().addIcon(OVERLAY_TELEPORTER_SIDES_GLOW).glow().build()}; - if (aActive) return new ITexture[]{ - MACHINE_CASINGS[mTier][aColorIndex + 1], - TextureFactory.of(OVERLAY_TELEPORTER_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_TELEPORTER_ACTIVE_GLOW).glow().build()}; - return new ITexture[]{ + TextureFactory.builder() + .addIcon(OVERLAY_TELEPORTER_SIDES_GLOW) + .glow() + .build() + }; + if (aActive) + return new ITexture[] { MACHINE_CASINGS[mTier][aColorIndex + 1], - TextureFactory.of(OVERLAY_TELEPORTER), - TextureFactory.builder().addIcon(OVERLAY_TELEPORTER_GLOW).glow().build()}; + TextureFactory.of(OVERLAY_TELEPORTER_ACTIVE), + TextureFactory.builder() + .addIcon(OVERLAY_TELEPORTER_ACTIVE_GLOW) + .glow() + .build() + }; + return new ITexture[] { + MACHINE_CASINGS[mTier][aColorIndex + 1], + TextureFactory.of(OVERLAY_TELEPORTER), + TextureFactory.builder().addIcon(OVERLAY_TELEPORTER_GLOW).glow().build() + }; } @Override @@ -235,26 +262,31 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank { @Override public void onConfigLoad(GT_Config aConfig) { - sInterDimensionalTeleportAllowed = aConfig.get(ConfigCategories.machineconfig, "Teleporter.Interdimensional", true); - sPassiveEnergyDrain = aConfig.get(ConfigCategories.machineconfig, "Teleporter.PassiveDrain", sPassiveEnergyDrain); + sInterDimensionalTeleportAllowed = + aConfig.get(ConfigCategories.machineconfig, "Teleporter.Interdimensional", true); + sPassiveEnergyDrain = + aConfig.get(ConfigCategories.machineconfig, "Teleporter.PassiveDrain", sPassiveEnergyDrain); sPowerMultiplyer = aConfig.get(ConfigCategories.machineconfig, "Teleporter.PowerMultipler", sPowerMultiplyer); - sFPowerMultiplyer = sPowerMultiplyer / 100.0; + sFPowerMultiplyer = sPowerMultiplyer / 100.0; } @Override public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { if (getBaseMetaTileEntity().isServerSide()) { - if ((this.mTargetX == 0) && (this.mTargetY == 0) && (this.mTargetZ == 0) && (this.mTargetD == Integer.MIN_VALUE)) { + if ((this.mTargetX == 0) + && (this.mTargetY == 0) + && (this.mTargetZ == 0) + && (this.mTargetD == Integer.MIN_VALUE)) { this.mTargetX = aBaseMetaTileEntity.getXCoord(); this.mTargetY = aBaseMetaTileEntity.getYCoord(); this.mTargetZ = aBaseMetaTileEntity.getZCoord(); this.mTargetD = aBaseMetaTileEntity.getWorld().provider.dimensionId; } - //this.hasEgg = checkForEgg(); + // this.hasEgg = checkForEgg(); } } - - //public boolean checkForEgg() { + + // public boolean checkForEgg() { // for (byte i = -5; i <= 5; i = (byte) (i + 1)) { // for (byte j = -5; j <= 5; j = (byte) (j + 1)) { // for (byte k = -5; k <= 5; k = (byte) (k + 1)) { @@ -265,45 +297,50 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank { // } // } // return false; - //} - - + // } public boolean hasDimensionalTeleportCapability() { - return this.mDebug || - //( - sInterDimensionalTeleportAllowed //&& - // ( - // this.hasEgg || - // mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1)) && mFluid.amount >= 1000 - // ) - //) + return this.mDebug + || + // ( + sInterDimensionalTeleportAllowed // && + // ( + // this.hasEgg || + // mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1)) && mFluid.amount >= 1000 + // ) + // ) ; } public boolean isDimensionalTeleportAvailable() { - return this.mDebug || (hasDimensionalTeleportCapability() && GT_Utility.isRealDimension(this.mTargetD) && GT_Utility.isRealDimension(getBaseMetaTileEntity().getWorld().provider.dimensionId)); + return this.mDebug + || (hasDimensionalTeleportCapability() + && GT_Utility.isRealDimension(this.mTargetD) + && GT_Utility.isRealDimension(getBaseMetaTileEntity().getWorld().provider.dimensionId)); } @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - if (mFluid != null) {//Was if null -> Materials.Nitrogen.getPlasma(0); + if (mFluid != null) { // Was if null -> Materials.Nitrogen.getPlasma(0); mFluid = null; } super.onPostTick(aBaseMetaTileEntity, aTick); if (getBaseMetaTileEntity().isServerSide()) { - //if (getBaseMetaTileEntity().getTimer() % 100L == 50L) { + // if (getBaseMetaTileEntity().getTimer() % 100L == 50L) { // this.hasEgg = checkForEgg(); - //} - if ((getBaseMetaTileEntity().isAllowedToWork()) && (getBaseMetaTileEntity().getRedstone())) { + // } + if ((getBaseMetaTileEntity().isAllowedToWork()) + && (getBaseMetaTileEntity().getRedstone())) { if (getBaseMetaTileEntity().decreaseStoredEnergyUnits(sPassiveEnergyDrain, false)) { - //if (hasDimensionalTeleportCapability() && this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId && (hasEgg || mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1)))&& new XSTR().nextInt(10)==0) { + // if (hasDimensionalTeleportCapability() && this.mTargetD != + // getBaseMetaTileEntity().getWorld().provider.dimensionId && (hasEgg || + // mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1)))&& new XSTR().nextInt(10)==0) { // mFluid.amount--; // if (mFluid.amount < 1) { // mFluid = null; // } - //} + // } int tDistance = distanceCalculation(); if (mInventory[0] != null) { TileEntity tTile = null; @@ -317,45 +354,105 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank { } if (tTile instanceof IInventory) { int tStacksize = mInventory[0].stackSize; - GT_Utility.moveOneItemStack(this, tTile, (byte) 0, (byte) 0, null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1); + GT_Utility.moveOneItemStack( + this, tTile, (byte) 0, (byte) 0, null, false, (byte) 64, (byte) 1, (byte) 64, + (byte) 1); if (mInventory[0] == null || mInventory[0].stackSize < tStacksize) { - getBaseMetaTileEntity().decreaseStoredEnergyUnits((long) (Math.pow(tDistance, 1.5) * tDistance * (tStacksize - (mInventory[0] == null ? 0 : mInventory[0].stackSize)) * sFPowerMultiplyer), false); + getBaseMetaTileEntity() + .decreaseStoredEnergyUnits( + (long) (Math.pow(tDistance, 1.5) + * tDistance + * (tStacksize + - (mInventory[0] == null ? 0 : mInventory[0].stackSize)) + * sFPowerMultiplyer), + false); } } - } - List entities_in_box = getBaseMetaTileEntity().getWorld().getEntitiesWithinAABB( - Entity.class,AxisAlignedBB.getBoundingBox( - getBaseMetaTileEntity().getOffsetX(getBaseMetaTileEntity().getFrontFacing(),2) - 1, - getBaseMetaTileEntity().getOffsetY(getBaseMetaTileEntity().getFrontFacing(), 2) - 1, - getBaseMetaTileEntity().getOffsetZ(getBaseMetaTileEntity().getFrontFacing(), 2) - 1, - getBaseMetaTileEntity().getOffsetX(getBaseMetaTileEntity().getFrontFacing(), 2) + 2, - getBaseMetaTileEntity().getOffsetY(getBaseMetaTileEntity().getFrontFacing(), 2) + 2, - getBaseMetaTileEntity().getOffsetZ(getBaseMetaTileEntity().getFrontFacing(), 2) + 2) - ); + List entities_in_box = getBaseMetaTileEntity() + .getWorld() + .getEntitiesWithinAABB( + Entity.class, + AxisAlignedBB.getBoundingBox( + getBaseMetaTileEntity() + .getOffsetX( + getBaseMetaTileEntity() + .getFrontFacing(), + 2) + - 1, + getBaseMetaTileEntity() + .getOffsetY( + getBaseMetaTileEntity() + .getFrontFacing(), + 2) + - 1, + getBaseMetaTileEntity() + .getOffsetZ( + getBaseMetaTileEntity() + .getFrontFacing(), + 2) + - 1, + getBaseMetaTileEntity() + .getOffsetX( + getBaseMetaTileEntity() + .getFrontFacing(), + 2) + + 2, + getBaseMetaTileEntity() + .getOffsetY( + getBaseMetaTileEntity() + .getFrontFacing(), + 2) + + 2, + getBaseMetaTileEntity() + .getOffsetZ( + getBaseMetaTileEntity() + .getFrontFacing(), + 2) + + 2)); for (Object tObject : entities_in_box) { if (((tObject instanceof Entity)) && (!((Entity) tObject).isDead)) { Entity tEntity = (Entity) tObject; -// GT_FML_LOGGER.info("teleport"+(Math.pow(tDistance, 1.5))); - if (getBaseMetaTileEntity().decreaseStoredEnergyUnits((long) (Math.pow(tDistance, 1.5) * weightCalculation(tEntity) * sFPowerMultiplyer), false)) { - //if (hasDimensionalTeleportCapability() && this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId && (hasEgg || mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1)))) { - // mFluid.amount = mFluid.amount - ((int) Math.min(10, (Math.pow(tDistance, 1.5) * weightCalculation(tEntity) / 8192))); + // GT_FML_LOGGER.info("teleport"+(Math.pow(tDistance, 1.5))); + if (getBaseMetaTileEntity() + .decreaseStoredEnergyUnits( + (long) (Math.pow(tDistance, 1.5) + * weightCalculation(tEntity) + * sFPowerMultiplyer), + false)) { + // if (hasDimensionalTeleportCapability() && this.mTargetD != + // getBaseMetaTileEntity().getWorld().provider.dimensionId && (hasEgg || + // mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1)))) { + // mFluid.amount = mFluid.amount - ((int) Math.min(10, (Math.pow(tDistance, 1.5) * + // weightCalculation(tEntity) / 8192))); // if (mFluid.amount < 1) { // mFluid = null; // } - //} + // } if (tEntity.ridingEntity != null) { tEntity.mountEntity(null); } if (tEntity.riddenByEntity != null) { tEntity.riddenByEntity.mountEntity(null); } - if ((this.mTargetD == getBaseMetaTileEntity().getWorld().provider.dimensionId) || (!isDimensionalTeleportAvailable()) || (!GT_Utility.moveEntityToDimensionAtCoords(tEntity, this.mTargetD, this.mTargetX + 0.5D, this.mTargetY + 0.5D, this.mTargetZ + 0.5D))) { + if ((this.mTargetD == getBaseMetaTileEntity().getWorld().provider.dimensionId) + || (!isDimensionalTeleportAvailable()) + || (!GT_Utility.moveEntityToDimensionAtCoords( + tEntity, + this.mTargetD, + this.mTargetX + 0.5D, + this.mTargetY + 0.5D, + this.mTargetZ + 0.5D))) { if ((tEntity instanceof EntityLivingBase)) { - ((EntityLivingBase) tEntity).setPositionAndUpdate(this.mTargetX + 0.5D, this.mTargetY + 0.5D, this.mTargetZ + 0.5D); + ((EntityLivingBase) tEntity) + .setPositionAndUpdate( + this.mTargetX + 0.5D, + this.mTargetY + 0.5D, + this.mTargetZ + 0.5D); } else { - tEntity.setPosition(this.mTargetX + 0.5D, this.mTargetY + 0.5D, this.mTargetZ + 0.5D); + tEntity.setPosition( + this.mTargetX + 0.5D, this.mTargetY + 0.5D, this.mTargetZ + 0.5D); } } } @@ -370,7 +467,13 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank { } private int distanceCalculation() { - return Math.abs(((this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId) && (isDimensionalTeleportAvailable()) ? 4000 : (int) Math.sqrt(Math.pow(getBaseMetaTileEntity().getXCoord() - this.mTargetX, 2.0D) + Math.pow(getBaseMetaTileEntity().getYCoord() - this.mTargetY, 2.0D) + Math.pow(getBaseMetaTileEntity().getZCoord() - this.mTargetZ, 2.0D)))); + return Math.abs( + ((this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId) + && (isDimensionalTeleportAvailable()) + ? 4000 + : (int) Math.sqrt(Math.pow(getBaseMetaTileEntity().getXCoord() - this.mTargetX, 2.0D) + + Math.pow(getBaseMetaTileEntity().getYCoord() - this.mTargetY, 2.0D) + + Math.pow(getBaseMetaTileEntity().getZCoord() - this.mTargetZ, 2.0D)))); } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/long_distance/GT_MetaTileEntity_LongDistancePipelineBase.java b/src/main/java/gregtech/common/tileentities/machines/long_distance/GT_MetaTileEntity_LongDistancePipelineBase.java index a74f8123ec..143548cfaa 100644 --- a/src/main/java/gregtech/common/tileentities/machines/long_distance/GT_MetaTileEntity_LongDistancePipelineBase.java +++ b/src/main/java/gregtech/common/tileentities/machines/long_distance/GT_MetaTileEntity_LongDistancePipelineBase.java @@ -19,9 +19,15 @@ * You should have received a copy of the GNU Lesser General Public License * along with GregTech. If not, see <http://www.gnu.org/licenses/>. */ - package gregtech.common.tileentities.machines.long_distance; +import static mcp.mobius.waila.api.SpecialChars.BLUE; +import static mcp.mobius.waila.api.SpecialChars.GOLD; +import static mcp.mobius.waila.api.SpecialChars.GREEN; +import static mcp.mobius.waila.api.SpecialChars.RED; +import static mcp.mobius.waila.api.SpecialChars.RESET; +import static mcp.mobius.waila.api.SpecialChars.YELLOW; + import gregtech.api.GregTech_API; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -30,6 +36,13 @@ import gregtech.api.items.GT_Block_LongDistancePipe; import gregtech.api.metatileentity.BaseMetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicHull_NonElectric; import gregtech.api.util.GT_Utility; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaDataAccessor; import net.minecraft.block.Block; @@ -42,32 +55,19 @@ import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Queue; - -import static mcp.mobius.waila.api.SpecialChars.BLUE; -import static mcp.mobius.waila.api.SpecialChars.GOLD; -import static mcp.mobius.waila.api.SpecialChars.GREEN; -import static mcp.mobius.waila.api.SpecialChars.RED; -import static mcp.mobius.waila.api.SpecialChars.RESET; -import static mcp.mobius.waila.api.SpecialChars.YELLOW; - public abstract class GT_MetaTileEntity_LongDistancePipelineBase extends GT_MetaTileEntity_BasicHull_NonElectric { public static int minimalDistancePoints = 64; protected GT_MetaTileEntity_LongDistancePipelineBase mTarget = null, mSender = null; protected ChunkCoordinates mTargetPos = null; protected GT_MetaTileEntity_LongDistancePipelineBase mTooCloseTarget = null, mTooCloseSender = null; - public GT_MetaTileEntity_LongDistancePipelineBase(int aID, String aName, String aNameRegional, int aTier, String aDescription) { + public GT_MetaTileEntity_LongDistancePipelineBase( + int aID, String aName, String aNameRegional, int aTier, String aDescription) { super(aID, aName, aNameRegional, aTier, aDescription); } - public GT_MetaTileEntity_LongDistancePipelineBase(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_LongDistancePipelineBase( + String aName, int aTier, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } @@ -87,12 +87,8 @@ public abstract class GT_MetaTileEntity_LongDistancePipelineBase extends GT_Meta super.loadNBTData(aNBT); if (aNBT.hasKey("target")) { mTargetPos = new ChunkCoordinates( - aNBT.getInteger("target.x"), - aNBT.getInteger("target.y"), - aNBT.getInteger("target.z") - ); - if (getDistanceToSelf(mTargetPos) < minimalDistancePoints) - mTargetPos = null; + aNBT.getInteger("target.x"), aNBT.getInteger("target.y"), aNBT.getInteger("target.z")); + if (getDistanceToSelf(mTargetPos) < minimalDistancePoints) mTargetPos = null; } } @@ -133,23 +129,26 @@ public abstract class GT_MetaTileEntity_LongDistancePipelineBase extends GT_Meta // Only check if the target position is loaded TileEntity te = world.getTileEntity(mTargetPos.posX, mTargetPos.posY, mTargetPos.posZ); final IMetaTileEntity tMeta; - if (te instanceof BaseMetaTileEntity && - ((tMeta = ((BaseMetaTileEntity)te).getMetaTileEntity()) instanceof GT_MetaTileEntity_LongDistancePipelineBase) && - isSameClass((GT_MetaTileEntity_LongDistancePipelineBase)tMeta)) - { + if (te instanceof BaseMetaTileEntity + && ((tMeta = ((BaseMetaTileEntity) te).getMetaTileEntity()) + instanceof GT_MetaTileEntity_LongDistancePipelineBase) + && isSameClass((GT_MetaTileEntity_LongDistancePipelineBase) tMeta)) { // It's the right type! - mTarget = (GT_MetaTileEntity_LongDistancePipelineBase)tMeta; - } - else if (te != null) { + mTarget = (GT_MetaTileEntity_LongDistancePipelineBase) tMeta; + } else if (te != null) { // It isn't the right type, kill the target position mTargetPos = null; } } } - if (mTooCloseTarget != null && mTooCloseTarget.mSender == null) mTooCloseTarget.mTooCloseSender = this; - if (mTooCloseSender != null && (mTooCloseSender.isDead() || mTooCloseSender.mTarget != null)) mTooCloseSender = null; + if (mTooCloseTarget != null && mTooCloseTarget.mSender == null) mTooCloseTarget.mTooCloseSender = this; + if (mTooCloseSender != null && (mTooCloseSender.isDead() || mTooCloseSender.mTarget != null)) + mTooCloseSender = null; if (mTarget == null || mTarget == this) return false; - if (mTarget.mSender == null || mTarget.mSender.isDead() || mTarget.mSender.mTarget == null || mTarget.mSender.mTarget.isDead()) { + if (mTarget.mSender == null + || mTarget.mSender.isDead() + || mTarget.mSender.mTarget == null + || mTarget.mSender.mTarget.isDead()) { mTarget.mSender = this; mTarget.mTooCloseSender = null; } @@ -158,19 +157,20 @@ public abstract class GT_MetaTileEntity_LongDistancePipelineBase extends GT_Meta } @Override - public ArrayList<String> getSpecialDebugInfo(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, int aLogLevel, ArrayList<String> aList) { + public ArrayList<String> getSpecialDebugInfo( + IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, int aLogLevel, ArrayList<String> aList) { if (mSender != null && !mSender.isDead() && mSender.mTarget == this) { final ChunkCoordinates coords = mSender.getCoords(); - aList.addAll(Arrays.asList("Is the Target", "Sender is at: X: " + coords.posX + " Y: " + coords.posY + " Z: " + coords.posZ)); + aList.addAll(Arrays.asList( + "Is the Target", "Sender is at: X: " + coords.posX + " Y: " + coords.posY + " Z: " + coords.posZ)); } else { - aList.addAll( - Arrays.asList(checkTarget() ? "Has Target" : "Has no loaded Target", - "Target should be around: X: " + mTargetPos.posX + " Y: " + mTargetPos.posY + " Z: " + mTargetPos.posZ - )); + aList.addAll(Arrays.asList( + checkTarget() ? "Has Target" : "Has no loaded Target", + "Target should be around: X: " + mTargetPos.posX + " Y: " + mTargetPos.posY + " Z: " + + mTargetPos.posZ)); } return aList; - } // What meta should the pipes for this pipeline have @@ -193,44 +193,55 @@ public abstract class GT_MetaTileEntity_LongDistancePipelineBase extends GT_Meta // Start scanning from the output side Block aBlock = gtTile.getBlockAtSide(gtTile.getBackFacing()); - if(aBlock instanceof GT_Block_LongDistancePipe) { + if (aBlock instanceof GT_Block_LongDistancePipe) { byte aMetaData = gtTile.getMetaIDAtSide(gtTile.getBackFacing()); if (aMetaData != getPipeMeta()) return; - HashSet<ChunkCoordinates> - tVisited = new HashSet<>(Collections.singletonList(getCoords())), - tWires = new HashSet<>(); - Queue<ChunkCoordinates> - tQueue = new LinkedList<>(Collections.singletonList(getFacingOffset(gtTile, gtTile.getBackFacing()))); + HashSet<ChunkCoordinates> tVisited = new HashSet<>(Collections.singletonList(getCoords())), + tWires = new HashSet<>(); + Queue<ChunkCoordinates> tQueue = + new LinkedList<>(Collections.singletonList(getFacingOffset(gtTile, gtTile.getBackFacing()))); while (!tQueue.isEmpty()) { final ChunkCoordinates aCoords = tQueue.poll(); - if(world.getBlock(aCoords.posX, aCoords.posY, aCoords.posZ) == aBlock && world.getBlockMetadata(aCoords.posX, aCoords.posY, aCoords.posZ) == aMetaData) { + if (world.getBlock(aCoords.posX, aCoords.posY, aCoords.posZ) == aBlock + && world.getBlockMetadata(aCoords.posX, aCoords.posY, aCoords.posZ) == aMetaData) { // We've got another pipe/wire block // TODO: Make sure it's the right type of pipe/wire via meta ChunkCoordinates tCoords; tWires.add(aCoords); - // For each direction, if we haven't already visisted that coordinate, add it to the end of the queue - if (tVisited.add(tCoords = new ChunkCoordinates(aCoords.posX + 1, aCoords.posY, aCoords.posZ))) tQueue.add(tCoords); - if (tVisited.add(tCoords = new ChunkCoordinates(aCoords.posX - 1, aCoords.posY, aCoords.posZ))) tQueue.add(tCoords); - if (tVisited.add(tCoords = new ChunkCoordinates(aCoords.posX, aCoords.posY + 1, aCoords.posZ))) tQueue.add(tCoords); - if (tVisited.add(tCoords = new ChunkCoordinates(aCoords.posX, aCoords.posY - 1, aCoords.posZ))) tQueue.add(tCoords); - if (tVisited.add(tCoords = new ChunkCoordinates(aCoords.posX, aCoords.posY, aCoords.posZ + 1))) tQueue.add(tCoords); - if (tVisited.add(tCoords = new ChunkCoordinates(aCoords.posX, aCoords.posY, aCoords.posZ - 1))) tQueue.add(tCoords); + // For each direction, if we haven't already visisted that coordinate, add it to the end of the + // queue + if (tVisited.add(tCoords = new ChunkCoordinates(aCoords.posX + 1, aCoords.posY, aCoords.posZ))) + tQueue.add(tCoords); + if (tVisited.add(tCoords = new ChunkCoordinates(aCoords.posX - 1, aCoords.posY, aCoords.posZ))) + tQueue.add(tCoords); + if (tVisited.add(tCoords = new ChunkCoordinates(aCoords.posX, aCoords.posY + 1, aCoords.posZ))) + tQueue.add(tCoords); + if (tVisited.add(tCoords = new ChunkCoordinates(aCoords.posX, aCoords.posY - 1, aCoords.posZ))) + tQueue.add(tCoords); + if (tVisited.add(tCoords = new ChunkCoordinates(aCoords.posX, aCoords.posY, aCoords.posZ + 1))) + tQueue.add(tCoords); + if (tVisited.add(tCoords = new ChunkCoordinates(aCoords.posX, aCoords.posY, aCoords.posZ - 1))) + tQueue.add(tCoords); } else { // It's not a block - let's see if it's a tile entity TileEntity tTileEntity = world.getTileEntity(aCoords.posX, aCoords.posY, aCoords.posZ); - if ( - tTileEntity != gtTile && tTileEntity instanceof BaseMetaTileEntity && - ((BaseMetaTileEntity)tTileEntity).getMetaTileEntity() instanceof GT_MetaTileEntity_LongDistancePipelineBase) - { - final GT_MetaTileEntity_LongDistancePipelineBase tGtTile = (GT_MetaTileEntity_LongDistancePipelineBase)((BaseMetaTileEntity) tTileEntity).getMetaTileEntity(); - if (isSameClass(tGtTile) && tWires.contains( - tGtTile.getFacingOffset((BaseMetaTileEntity)tTileEntity, ((BaseMetaTileEntity) tTileEntity).getFrontFacing()) - )) { - // If it's the same class, and we've scanned a wire in front of it (the input side), we've found our target + if (tTileEntity != gtTile + && tTileEntity instanceof BaseMetaTileEntity + && ((BaseMetaTileEntity) tTileEntity).getMetaTileEntity() + instanceof GT_MetaTileEntity_LongDistancePipelineBase) { + final GT_MetaTileEntity_LongDistancePipelineBase tGtTile = + (GT_MetaTileEntity_LongDistancePipelineBase) + ((BaseMetaTileEntity) tTileEntity).getMetaTileEntity(); + if (isSameClass(tGtTile) + && tWires.contains(tGtTile.getFacingOffset( + (BaseMetaTileEntity) tTileEntity, + ((BaseMetaTileEntity) tTileEntity).getFrontFacing()))) { + // If it's the same class, and we've scanned a wire in front of it (the input side), we've + // found our target // still need to check if it's distant enough int distance = getDistanceToSelf(aCoords); if (distance > minimalDistancePoints) { @@ -245,27 +256,25 @@ public abstract class GT_MetaTileEntity_LongDistancePipelineBase extends GT_Meta } } - // Remove this block from the visited because we might end up back here from another wire that IS connected to the + // Remove this block from the visited because we might end up back here from another wire that + // IS connected to the // input side tVisited.remove(aCoords); } } } } - } protected int getDistanceToSelf(ChunkCoordinates aCoords) { - return Math.abs(getBaseMetaTileEntity().getXCoord() - aCoords.posX) + - Math.abs(getBaseMetaTileEntity().getYCoord() - aCoords.posY) / 2 + - Math.abs(getBaseMetaTileEntity().getZCoord() - aCoords.posZ); + return Math.abs(getBaseMetaTileEntity().getXCoord() - aCoords.posX) + + Math.abs(getBaseMetaTileEntity().getYCoord() - aCoords.posY) / 2 + + Math.abs(getBaseMetaTileEntity().getZCoord() - aCoords.posZ); } public ChunkCoordinates getFacingOffset(IGregTechTileEntity gt_tile, byte aSide) { return new ChunkCoordinates( - gt_tile.getOffsetX(aSide, 1), gt_tile.getOffsetY(aSide, 1), gt_tile.getOffsetZ(aSide, 1) - ); - + gt_tile.getOffsetX(aSide, 1), gt_tile.getOffsetY(aSide, 1), gt_tile.getOffsetZ(aSide, 1)); } public ChunkCoordinates getCoords() { @@ -275,8 +284,9 @@ public abstract class GT_MetaTileEntity_LongDistancePipelineBase extends GT_Meta @Override public void onMachineBlockUpdate() { - //GT_Mod.GT_FML_LOGGER.info("You're dead to me"); - mTargetPos = null; mSender = null; + // GT_Mod.GT_FML_LOGGER.info("You're dead to me"); + mTargetPos = null; + mSender = null; } @Override @@ -285,42 +295,37 @@ public abstract class GT_MetaTileEntity_LongDistancePipelineBase extends GT_Meta } @Override - public boolean shouldTriggerBlockUpdate() { return true; } + public boolean shouldTriggerBlockUpdate() { + return true; + } @Override - public void getWailaBody(ItemStack itemStack, List<String> currentTip, IWailaDataAccessor accessor, IWailaConfigHandler config) { + public void getWailaBody( + ItemStack itemStack, List<String> currentTip, IWailaDataAccessor accessor, IWailaConfigHandler config) { final NBTTagCompound tag = accessor.getNBTData(); final int facing = getBaseMetaTileEntity().getFrontFacing(); final int side = (byte) accessor.getSide().ordinal(); - if (side == facing) - currentTip.add(GOLD + "Pipeline Input" + RESET); - else if (side == ForgeDirection.OPPOSITES[facing]) - currentTip.add(BLUE + "Pipeline Output" + RESET); - else - currentTip.add("Pipeline Side"); + if (side == facing) currentTip.add(GOLD + "Pipeline Input" + RESET); + else if (side == ForgeDirection.OPPOSITES[facing]) currentTip.add(BLUE + "Pipeline Output" + RESET); + else currentTip.add("Pipeline Side"); - if (tag.getBoolean("hasSender")) - currentTip.add("Other End of Input: " + GREEN + "distance" + RESET); + if (tag.getBoolean("hasSender")) currentTip.add("Other End of Input: " + GREEN + "distance" + RESET); else if (tag.getBoolean("hasTooCloseSender")) currentTip.add("Other End of Input: " + RED + "too close" + RESET); - else - currentTip.add("Other End of Input: " + YELLOW + "cannot found(may need to update other end)" + RESET); + else currentTip.add("Other End of Input: " + YELLOW + "cannot found(may need to update other end)" + RESET); - if (tag.getBoolean("hasTarget")) - currentTip.add("Other End of Output: " + GREEN + "distance" + RESET); + if (tag.getBoolean("hasTarget")) currentTip.add("Other End of Output: " + GREEN + "distance" + RESET); else if (tag.getBoolean("hasTooCloseTarget")) currentTip.add("Other End of Output: " + RED + "too close" + RESET); - else - currentTip.add("Other End of Output: " + YELLOW + "cannot found" + RESET); + else currentTip.add("Other End of Output: " + YELLOW + "cannot found" + RESET); super.getWailaBody(itemStack, currentTip, accessor, config); - } - @Override - public void getWailaNBTData(EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y, int z) { + public void getWailaNBTData( + EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y, int z) { super.getWailaNBTData(player, tile, tag, world, x, y, z); tag.setBoolean("hasSender", mSender != null); diff --git a/src/main/java/gregtech/common/tileentities/machines/long_distance/GT_MetaTileEntity_LongDistancePipelineFluid.java b/src/main/java/gregtech/common/tileentities/machines/long_distance/GT_MetaTileEntity_LongDistancePipelineFluid.java index fe0a8527ab..849ce40101 100644 --- a/src/main/java/gregtech/common/tileentities/machines/long_distance/GT_MetaTileEntity_LongDistancePipelineFluid.java +++ b/src/main/java/gregtech/common/tileentities/machines/long_distance/GT_MetaTileEntity_LongDistancePipelineFluid.java @@ -19,9 +19,14 @@ * You should have received a copy of the GNU Lesser General Public License * along with GregTech. If not, see <http://www.gnu.org/licenses/>. */ - package gregtech.common.tileentities.machines.long_distance; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPELINE_FLUID_BACK; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPELINE_FLUID_FRONT; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPELINE_FLUID_SIDE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPELINE_FLUID_SIDE_GLOW; + import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -33,12 +38,6 @@ import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidTankInfo; import net.minecraftforge.fluids.IFluidHandler; -import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPELINE_FLUID_BACK; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPELINE_FLUID_FRONT; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPELINE_FLUID_SIDE; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPELINE_FLUID_SIDE_GLOW; - public class GT_MetaTileEntity_LongDistancePipelineFluid extends GT_MetaTileEntity_LongDistancePipelineBase { static final FluidTankInfo[] emptyTank = {new FluidTankInfo(null, Integer.MAX_VALUE)}; @@ -46,7 +45,8 @@ public class GT_MetaTileEntity_LongDistancePipelineFluid extends GT_MetaTileEnti super(aID, aName, aNameRegional, aTier, "Sends fluids over long distances"); } - public GT_MetaTileEntity_LongDistancePipelineFluid(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_LongDistancePipelineFluid( + String aName, int aTier, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } @@ -63,7 +63,7 @@ public class GT_MetaTileEntity_LongDistancePipelineFluid extends GT_MetaTileEnti public IFluidHandler getTank() { final IGregTechTileEntity tTile = mTarget.getBaseMetaTileEntity(); TileEntity tankTile = tTile.getTileEntityAtSide(tTile.getBackFacing()); - if (tankTile instanceof IFluidHandler) return (IFluidHandler)tankTile; + if (tankTile instanceof IFluidHandler) return (IFluidHandler) tankTile; else return null; } @@ -72,24 +72,27 @@ public class GT_MetaTileEntity_LongDistancePipelineFluid extends GT_MetaTileEnti if (checkTarget()) { final IFluidHandler tankTile = getTank(); if (tankTile != null) return tankTile.getTankInfo(aSide); - } return emptyTank; } + @Override public int fill(ForgeDirection aSide, FluidStack aFluid, boolean aDoFill) { if (checkTarget()) { final IGregTechTileEntity tTile = mTarget.getBaseMetaTileEntity(); final IFluidHandler tankTile = getTank(); - if (tankTile != null) return tankTile.fill(ForgeDirection.getOrientation(tTile.getFrontFacing()), aFluid, aDoFill); + if (tankTile != null) + return tankTile.fill(ForgeDirection.getOrientation(tTile.getFrontFacing()), aFluid, aDoFill); } return 0; } + @Override public FluidStack drain(ForgeDirection aSide, FluidStack aFluid, boolean aDoDrain) { return null; } + @Override public FluidStack drain(ForgeDirection aSide, int aMaxDrain, boolean aDoDrain) { return null; @@ -99,25 +102,36 @@ public class GT_MetaTileEntity_LongDistancePipelineFluid extends GT_MetaTileEnti public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_LongDistancePipelineFluid(mName, mTier, getDescription()[0], mTextures); } + @Override public ITexture[][][] getTextureSet(ITexture[] aTextures) { return new ITexture[0][0][0]; } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { if (aSide == aFacing) - return new ITexture[]{ - MACHINE_CASINGS[mTier][aColorIndex + 1], - TextureFactory.of(OVERLAY_PIPELINE_FLUID_FRONT)}; + return new ITexture[] { + MACHINE_CASINGS[mTier][aColorIndex + 1], TextureFactory.of(OVERLAY_PIPELINE_FLUID_FRONT) + }; else if (aSide == GT_Utility.getOppositeSide(aFacing)) - return new ITexture[]{ - MACHINE_CASINGS[mTier][aColorIndex + 1], - TextureFactory.of(OVERLAY_PIPELINE_FLUID_BACK)}; + return new ITexture[] { + MACHINE_CASINGS[mTier][aColorIndex + 1], TextureFactory.of(OVERLAY_PIPELINE_FLUID_BACK) + }; else - return new ITexture[]{ - MACHINE_CASINGS[mTier][aColorIndex + 1], - TextureFactory.of(OVERLAY_PIPELINE_FLUID_SIDE), - TextureFactory.builder().addIcon(OVERLAY_PIPELINE_FLUID_SIDE_GLOW).glow().build()}; + return new ITexture[] { + MACHINE_CASINGS[mTier][aColorIndex + 1], + TextureFactory.of(OVERLAY_PIPELINE_FLUID_SIDE), + TextureFactory.builder() + .addIcon(OVERLAY_PIPELINE_FLUID_SIDE_GLOW) + .glow() + .build() + }; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/long_distance/GT_MetaTileEntity_LongDistancePipelineItem.java b/src/main/java/gregtech/common/tileentities/machines/long_distance/GT_MetaTileEntity_LongDistancePipelineItem.java index b6b3636ab0..0559290df6 100644 --- a/src/main/java/gregtech/common/tileentities/machines/long_distance/GT_MetaTileEntity_LongDistancePipelineItem.java +++ b/src/main/java/gregtech/common/tileentities/machines/long_distance/GT_MetaTileEntity_LongDistancePipelineItem.java @@ -19,9 +19,14 @@ * You should have received a copy of the GNU Lesser General Public License * along with GregTech. If not, see <http://www.gnu.org/licenses/>. */ - package gregtech.common.tileentities.machines.long_distance; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPELINE_ITEM_BACK; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPELINE_ITEM_FRONT; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPELINE_ITEM_SIDE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPELINE_ITEM_SIDE_GLOW; + import gregtech.api.enums.GT_Values; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -33,18 +38,13 @@ import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPELINE_ITEM_BACK; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPELINE_ITEM_FRONT; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPELINE_ITEM_SIDE; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPELINE_ITEM_SIDE_GLOW; - public class GT_MetaTileEntity_LongDistancePipelineItem extends GT_MetaTileEntity_LongDistancePipelineBase { public GT_MetaTileEntity_LongDistancePipelineItem(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, "Sends Items over long distances"); } - public GT_MetaTileEntity_LongDistancePipelineItem(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_LongDistancePipelineItem( + String aName, int aTier, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } @@ -61,7 +61,7 @@ public class GT_MetaTileEntity_LongDistancePipelineItem extends GT_MetaTileEntit public IInventory getInventory() { final IGregTechTileEntity tTile = mTarget.getBaseMetaTileEntity(); TileEntity invTile = tTile.getTileEntityAtSide(tTile.getBackFacing()); - if (invTile instanceof IInventory) return (IInventory)invTile; + if (invTile instanceof IInventory) return (IInventory) invTile; else return null; } @@ -73,6 +73,7 @@ public class GT_MetaTileEntity_LongDistancePipelineItem extends GT_MetaTileEntit } return null; } + @Override public ItemStack getStackInSlotOnClosing(int aSlot) { if (checkTarget()) { @@ -81,6 +82,7 @@ public class GT_MetaTileEntity_LongDistancePipelineItem extends GT_MetaTileEntit } return null; } + @Override public ItemStack getStackInSlot(int aSlot) { if (checkTarget()) { @@ -89,6 +91,7 @@ public class GT_MetaTileEntity_LongDistancePipelineItem extends GT_MetaTileEntit } return null; } + @Override public String getInventoryName() { if (checkTarget()) { @@ -97,6 +100,7 @@ public class GT_MetaTileEntity_LongDistancePipelineItem extends GT_MetaTileEntit } return super.getInventoryName(); } + @Override public int getSizeInventory() { if (checkTarget()) { @@ -105,6 +109,7 @@ public class GT_MetaTileEntity_LongDistancePipelineItem extends GT_MetaTileEntit } return 0; } + @Override public int getInventoryStackLimit() { if (checkTarget()) { @@ -113,6 +118,7 @@ public class GT_MetaTileEntity_LongDistancePipelineItem extends GT_MetaTileEntit } return 0; } + @Override public void setInventorySlotContents(int aSlot, ItemStack aStack) { if (checkTarget()) { @@ -120,6 +126,7 @@ public class GT_MetaTileEntity_LongDistancePipelineItem extends GT_MetaTileEntit if (iInventory != null) iInventory.setInventorySlotContents(aSlot, aStack); } } + @Override public boolean hasCustomInventoryName() { if (checkTarget()) { @@ -128,6 +135,7 @@ public class GT_MetaTileEntity_LongDistancePipelineItem extends GT_MetaTileEntit } return false; } + @Override public boolean isItemValidForSlot(int aSlot, ItemStack aStack) { if (checkTarget()) { @@ -137,15 +145,16 @@ public class GT_MetaTileEntity_LongDistancePipelineItem extends GT_MetaTileEntit return false; } -// // Relay Sided Inventories -// + // // Relay Sided Inventories + // @Override public int[] getAccessibleSlotsFromSide(int aSide) { if (checkTarget()) { final IGregTechTileEntity tTile = mTarget.getBaseMetaTileEntity(); final IInventory iInventory = getInventory(); - if (iInventory instanceof ISidedInventory) return ((ISidedInventory)iInventory).getAccessibleSlotsFromSide(tTile.getFrontFacing()); + if (iInventory instanceof ISidedInventory) + return ((ISidedInventory) iInventory).getAccessibleSlotsFromSide(tTile.getFrontFacing()); if (iInventory != null) { final int[] tReturn = new int[iInventory.getSizeInventory()]; for (int i = 0; i < tReturn.length; i++) tReturn[i] = i; @@ -161,7 +170,8 @@ public class GT_MetaTileEntity_LongDistancePipelineItem extends GT_MetaTileEntit if (checkTarget()) { final IGregTechTileEntity tTile = mTarget.getBaseMetaTileEntity(); IInventory iInventory = getInventory(); - if (iInventory instanceof ISidedInventory) return ((ISidedInventory)iInventory).canInsertItem(aSlot, aStack, tTile.getFrontFacing()); + if (iInventory instanceof ISidedInventory) + return ((ISidedInventory) iInventory).canInsertItem(aSlot, aStack, tTile.getFrontFacing()); return iInventory != null; } return false; @@ -176,20 +186,31 @@ public class GT_MetaTileEntity_LongDistancePipelineItem extends GT_MetaTileEntit public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_LongDistancePipelineItem(mName, mTier, getDescription()[0], mTextures); } + @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { if (aSide == aFacing) - return new ITexture[]{ - MACHINE_CASINGS[mTier][aColorIndex + 1], - TextureFactory.of(OVERLAY_PIPELINE_ITEM_FRONT)}; + return new ITexture[] { + MACHINE_CASINGS[mTier][aColorIndex + 1], TextureFactory.of(OVERLAY_PIPELINE_ITEM_FRONT) + }; else if (aSide == GT_Utility.getOppositeSide(aFacing)) - return new ITexture[]{ - MACHINE_CASINGS[mTier][aColorIndex + 1], - TextureFactory.of(OVERLAY_PIPELINE_ITEM_BACK)}; + return new ITexture[] { + MACHINE_CASINGS[mTier][aColorIndex + 1], TextureFactory.of(OVERLAY_PIPELINE_ITEM_BACK) + }; else - return new ITexture[]{ - MACHINE_CASINGS[mTier][aColorIndex + 1], - TextureFactory.of(OVERLAY_PIPELINE_ITEM_SIDE), - TextureFactory.builder().addIcon(OVERLAY_PIPELINE_ITEM_SIDE_GLOW).glow().build()}; + return new ITexture[] { + MACHINE_CASINGS[mTier][aColorIndex + 1], + TextureFactory.of(OVERLAY_PIPELINE_ITEM_SIDE), + TextureFactory.builder() + .addIcon(OVERLAY_PIPELINE_ITEM_SIDE_GLOW) + .glow() + .build() + }; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AbstractMultiFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AbstractMultiFurnace.java index af6afbc4c4..3dde1feb83 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AbstractMultiFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AbstractMultiFurnace.java @@ -5,7 +5,8 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_EnhancedMultiBlockBase; import net.minecraft.item.ItemStack; -public abstract class GT_MetaTileEntity_AbstractMultiFurnace<T extends GT_MetaTileEntity_AbstractMultiFurnace<T>> extends GT_MetaTileEntity_EnhancedMultiBlockBase<T> { +public abstract class GT_MetaTileEntity_AbstractMultiFurnace<T extends GT_MetaTileEntity_AbstractMultiFurnace<T>> + extends GT_MetaTileEntity_EnhancedMultiBlockBase<T> { private HeatingCoilLevel mCoilLevel; @@ -23,10 +24,10 @@ public abstract class GT_MetaTileEntity_AbstractMultiFurnace<T extends GT_MetaTi } protected boolean addBottomHatch(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - return addMaintenanceToMachineList(aTileEntity, aBaseCasingIndex) || - addInputToMachineList(aTileEntity, aBaseCasingIndex) || - addOutputToMachineList(aTileEntity, aBaseCasingIndex) || - addEnergyInputToMachineList(aTileEntity, aBaseCasingIndex); + return addMaintenanceToMachineList(aTileEntity, aBaseCasingIndex) + || addInputToMachineList(aTileEntity, aBaseCasingIndex) + || addOutputToMachineList(aTileEntity, aBaseCasingIndex) + || addEnergyInputToMachineList(aTileEntity, aBaseCasingIndex); } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java index 7e3039c83b..d40b569550 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java @@ -1,10 +1,19 @@ package gregtech.common.tileentities.machines.multi; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static gregtech.GT_Mod.GT_FML_LOGGER; +import static gregtech.api.enums.GT_HatchElement.*; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE_GLOW; +import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; + import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IItemSource; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.StructureDefinition; -import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; @@ -24,82 +33,77 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Multi import gregtech.api.render.TextureFactory; import gregtech.api.util.*; import gregtech.api.util.GT_Recipe.GT_Recipe_AssemblyLine; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; -import static gregtech.GT_Mod.GT_FML_LOGGER; -import static gregtech.api.enums.GT_HatchElement.*; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE_GLOW; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE_GLOW; -import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; -import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; - -public class GT_MetaTileEntity_AssemblyLine extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_AssemblyLine> implements ISurvivalConstructable { +public class GT_MetaTileEntity_AssemblyLine + extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_AssemblyLine> + implements ISurvivalConstructable { public ArrayList<GT_MetaTileEntity_Hatch_DataAccess> mDataAccessHatches = new ArrayList<>(); private static final String STRUCTURE_PIECE_FIRST = "first"; private static final String STRUCTURE_PIECE_LATER = "later"; private static final String STRUCTURE_PIECE_LAST = "last"; - private static final IStructureDefinition<GT_MetaTileEntity_AssemblyLine> STRUCTURE_DEFINITION = StructureDefinition.<GT_MetaTileEntity_AssemblyLine>builder() - .addShape(STRUCTURE_PIECE_FIRST, transpose(new String[][]{ - {" ", "e", " "}, - {"~", "l", "G"}, - {"g", "m", "g"}, - {"b", "i", "b"}, - })) - .addShape(STRUCTURE_PIECE_LATER, transpose(new String[][]{ - {" ", "e", " "}, - {"d", "l", "d"}, - {"g", "m", "g"}, - {"b", "I", "b"}, - })) - .addShape(STRUCTURE_PIECE_LAST, transpose(new String[][]{ - {" ", "e", " "}, - {"d", "l", "d"}, - {"g", "m", "g"}, - {"o", "i", "b"}, - })) - .addElement('G', ofBlock(GregTech_API.sBlockCasings3, 10)) // grate machine casing - .addElement('l', ofBlock(GregTech_API.sBlockCasings2, 9)) // assembler machine casing - .addElement('m', ofBlock(GregTech_API.sBlockCasings2, 5)) // assembling line casing - .addElement('g', ofChain( - ofBlockUnlocalizedName("bartworks", "BW_GlasBlocks", 0, true), - ofBlockUnlocalizedName("Thaumcraft", "blockCosmeticOpaque", 2, false), //warded glass - ofBlockUnlocalizedName("IC2", "blockAlloyGlass", 0, true)) - ) - .addElement('e', ofChain( - Energy.newAny(16, 1), - ofBlock(GregTech_API.sBlockCasings2, 0) - )) - .addElement('d', ofChain( - DataHatchElement.DataAccess.newAny(42, 2), - ofBlock(GregTech_API.sBlockCasings3, 10) - )) - .addElement('b', buildHatchAdder(GT_MetaTileEntity_AssemblyLine.class) - .atLeast(InputHatch, InputHatch, InputHatch, InputHatch, Maintenance) - .casingIndex(16).dot(3) - .buildAndChain( - ofBlock(GregTech_API.sBlockCasings2, 0), - ofHatchAdder(GT_MetaTileEntity_AssemblyLine::addOutputToMachineList, 16, 4) - ) - ) - .addElement('I', ofChain( - // all blocks nearby use solid steel casing, so let's use the texture of that - InputBus.newAny(16, 5), - ofHatchAdder(GT_MetaTileEntity_AssemblyLine::addOutputToMachineList, 16, 4) - )) - .addElement('i', InputBus.newAny(16, 5)) - .addElement('o', OutputBus.newAny(16, 4)) - .build(); + private static final IStructureDefinition<GT_MetaTileEntity_AssemblyLine> STRUCTURE_DEFINITION = + StructureDefinition.<GT_MetaTileEntity_AssemblyLine>builder() + .addShape(STRUCTURE_PIECE_FIRST, transpose(new String[][] { + {" ", "e", " "}, + {"~", "l", "G"}, + {"g", "m", "g"}, + {"b", "i", "b"}, + })) + .addShape(STRUCTURE_PIECE_LATER, transpose(new String[][] { + {" ", "e", " "}, + {"d", "l", "d"}, + {"g", "m", "g"}, + {"b", "I", "b"}, + })) + .addShape(STRUCTURE_PIECE_LAST, transpose(new String[][] { + {" ", "e", " "}, + {"d", "l", "d"}, + {"g", "m", "g"}, + {"o", "i", "b"}, + })) + .addElement('G', ofBlock(GregTech_API.sBlockCasings3, 10)) // grate machine casing + .addElement('l', ofBlock(GregTech_API.sBlockCasings2, 9)) // assembler machine casing + .addElement('m', ofBlock(GregTech_API.sBlockCasings2, 5)) // assembling line casing + .addElement( + 'g', + ofChain( + ofBlockUnlocalizedName("bartworks", "BW_GlasBlocks", 0, true), + ofBlockUnlocalizedName( + "Thaumcraft", "blockCosmeticOpaque", 2, false), // warded glass + ofBlockUnlocalizedName("IC2", "blockAlloyGlass", 0, true))) + .addElement('e', ofChain(Energy.newAny(16, 1), ofBlock(GregTech_API.sBlockCasings2, 0))) + .addElement( + 'd', + ofChain( + DataHatchElement.DataAccess.newAny(42, 2), + ofBlock(GregTech_API.sBlockCasings3, 10))) + .addElement( + 'b', + buildHatchAdder(GT_MetaTileEntity_AssemblyLine.class) + .atLeast(InputHatch, InputHatch, InputHatch, InputHatch, Maintenance) + .casingIndex(16) + .dot(3) + .buildAndChain( + ofBlock(GregTech_API.sBlockCasings2, 0), + ofHatchAdder( + GT_MetaTileEntity_AssemblyLine::addOutputToMachineList, 16, 4))) + .addElement( + 'I', + ofChain( + // all blocks nearby use solid steel casing, so let's use the texture of that + InputBus.newAny(16, 5), + ofHatchAdder(GT_MetaTileEntity_AssemblyLine::addOutputToMachineList, 16, 4))) + .addElement('i', InputBus.newAny(16, 5)) + .addElement('o', OutputBus.newAny(16, 4)) + .build(); public GT_MetaTileEntity_AssemblyLine(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -118,48 +122,72 @@ public class GT_MetaTileEntity_AssemblyLine extends GT_MetaTileEntity_EnhancedMu protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Assembling Line") - .addInfo("Controller block for the Assembling Line") - .addInfo("Used to make complex machine parts (LuV+)") - .addInfo("Does not make Assembler items") - .addSeparator() - .beginVariableStructureBlock(5, 16, 4, 4, 3, 3, false)//? - .addStructureInfo("From Bottom to Top, Left to Right") - .addStructureInfo("Layer 1 - Solid Steel Machine Casing, Input Bus (last can be Output Bus), Solid Steel Machine Casing") - .addStructureInfo("Layer 2 - Borosilicate Glass(any)/Warded Glass/Reinforced Glass, Assembling Line Casing, Reinforced Glass") - .addStructureInfo("Layer 3 - Grate Machine Casing, Assembler Machine Casing, Grate Machine Casing") - .addStructureInfo("Layer 4 - Empty, Solid Steel Machine Casing, Empty") - .addStructureInfo("Up to 16 repeating slices, each one allows for 1 more item in recipes") - - .addController("Either Grate on layer 3 of the first slice") - .addEnergyHatch("Any layer 4 casing", 1) - .addMaintenanceHatch("Any layer 1 casing", 3) - .addInputBus("As specified on layer 1", 4, 5) - .addInputHatch("Any layer 1 casing", 3) - .addOutputBus("Replaces Input Bus on final slice or on any solid steel casing on layer 1", 4) - .addOtherStructurePart("Data Access Hatch", "Optional, next to controller", 2) - .toolTipFinisher("Gregtech"); + .addInfo("Controller block for the Assembling Line") + .addInfo("Used to make complex machine parts (LuV+)") + .addInfo("Does not make Assembler items") + .addSeparator() + .beginVariableStructureBlock(5, 16, 4, 4, 3, 3, false) // ? + .addStructureInfo("From Bottom to Top, Left to Right") + .addStructureInfo( + "Layer 1 - Solid Steel Machine Casing, Input Bus (last can be Output Bus), Solid Steel Machine Casing") + .addStructureInfo( + "Layer 2 - Borosilicate Glass(any)/Warded Glass/Reinforced Glass, Assembling Line Casing, Reinforced Glass") + .addStructureInfo("Layer 3 - Grate Machine Casing, Assembler Machine Casing, Grate Machine Casing") + .addStructureInfo("Layer 4 - Empty, Solid Steel Machine Casing, Empty") + .addStructureInfo("Up to 16 repeating slices, each one allows for 1 more item in recipes") + .addController("Either Grate on layer 3 of the first slice") + .addEnergyHatch("Any layer 4 casing", 1) + .addMaintenanceHatch("Any layer 1 casing", 3) + .addInputBus("As specified on layer 1", 4, 5) + .addInputHatch("Any layer 1 casing", 3) + .addOutputBus("Replaces Input Bus on final slice or on any solid steel casing on layer 1", 4) + .addOtherStructurePart("Data Access Hatch", "Optional, next to controller", 2) + .toolTipFinisher("Gregtech"); return tt; } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { if (aSide == aFacing) { if (aActive) - return new ITexture[]{ + return new ITexture[] { BlockIcons.casingTexturePages[0][16], - TextureFactory.builder().addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE_GLOW).extFacing().glow().build()}; - return new ITexture[]{ + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE_GLOW) + .extFacing() + .glow() + .build() + }; + return new ITexture[] { BlockIcons.casingTexturePages[0][16], - TextureFactory.builder().addIcon(OVERLAY_FRONT_ASSEMBLY_LINE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_GLOW).extFacing().glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ASSEMBLY_LINE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_GLOW) + .extFacing() + .glow() + .build() + }; } - return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][16]}; + return new ITexture[] {Textures.BlockIcons.casingTexturePages[0][16]}; } @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "AssemblyLine.png"); + return new GT_GUIContainer_MultiMachine( + aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "AssemblyLine.png"); } @Override @@ -192,13 +220,14 @@ public class GT_MetaTileEntity_AssemblyLine extends GT_MetaTileEntity_EnhancedMu nextDataStick: for (ItemStack tDataStick : tDataStickList) { - GT_AssemblyLineUtils.LookupResult tLookupResult = GT_AssemblyLineUtils.findAssemblyLineRecipeFromDataStick(tDataStick, false); + GT_AssemblyLineUtils.LookupResult tLookupResult = + GT_AssemblyLineUtils.findAssemblyLineRecipeFromDataStick(tDataStick, false); - if (tLookupResult.getType() == GT_AssemblyLineUtils.LookupResultType.INVALID_STICK) - continue; + if (tLookupResult.getType() == GT_AssemblyLineUtils.LookupResultType.INVALID_STICK) continue; GT_Recipe_AssemblyLine tRecipe = tLookupResult.getRecipe(); - // Check if the recipe on the data stick is the current recipe for it's given output, if not we update it and continue to next. + // Check if the recipe on the data stick is the current recipe for it's given output, if not we update it + // and continue to next. if (tLookupResult.getType() != GT_AssemblyLineUtils.LookupResultType.VALID_STACK_AND_VALID_HASH) { tRecipe = GT_AssemblyLineUtils.processDataStick(tDataStick); if (tRecipe == null) { @@ -235,18 +264,21 @@ public class GT_MetaTileEntity_AssemblyLine extends GT_MetaTileEntity_EnhancedMu for (int i = 0; i < aFluidCount; i++) { if (mInputHatches.get(i) == null) { continue nextDataStick; - }else { + } else { if (mInputHatches.get(i) instanceof GT_MetaTileEntity_Hatch_MultiInput) { - GT_MetaTileEntity_Hatch_MultiInput tMultiHatch = (GT_MetaTileEntity_Hatch_MultiInput) mInputHatches.get(i); - if (!tMultiHatch.hasFluid(tRecipe.mFluidInputs[i]) || tMultiHatch.getFluidAmount(tRecipe.mFluidInputs[i]) < tRecipe.mFluidInputs[i].amount) { + GT_MetaTileEntity_Hatch_MultiInput tMultiHatch = + (GT_MetaTileEntity_Hatch_MultiInput) mInputHatches.get(i); + if (!tMultiHatch.hasFluid(tRecipe.mFluidInputs[i]) + || tMultiHatch.getFluidAmount(tRecipe.mFluidInputs[i]) + < tRecipe.mFluidInputs[i].amount) { continue nextDataStick; } tFluids[i] = tRecipe.mFluidInputs[i].amount; tFluidSlot[i] = tMultiHatch.getFluidSlot(tRecipe.mFluidInputs[i]); - } - else { + } else { FluidStack fluidInHatch = mInputHatches.get(i).mFluid; - if (!GT_Utility.areFluidsEqual(fluidInHatch, tRecipe.mFluidInputs[i], true) || fluidInHatch.amount < tRecipe.mFluidInputs[i].amount) { + if (!GT_Utility.areFluidsEqual(fluidInHatch, tRecipe.mFluidInputs[i], true) + || fluidInHatch.amount < tRecipe.mFluidInputs[i].amount) { continue nextDataStick; } tFluids[i] = tRecipe.mFluidInputs[i].amount; @@ -261,7 +293,7 @@ public class GT_MetaTileEntity_AssemblyLine extends GT_MetaTileEntity_EnhancedMu GT_FML_LOGGER.info("Check overclock"); } calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, 1, getMaxInputVoltage()); - //In case recipe is too OP for that machine + // In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) { if (GT_Values.D1) { GT_FML_LOGGER.info("Recipe too OP"); @@ -271,7 +303,7 @@ public class GT_MetaTileEntity_AssemblyLine extends GT_MetaTileEntity_EnhancedMu if (GT_Values.D1) { GT_FML_LOGGER.info("Find available recipe"); } - mOutputItems = new ItemStack[]{tRecipe.mOutput}; + mOutputItems = new ItemStack[] {tRecipe.mOutput}; foundRecipe = true; break; } @@ -281,7 +313,6 @@ public class GT_MetaTileEntity_AssemblyLine extends GT_MetaTileEntity_EnhancedMu return false; } - if (GT_Values.D1) { GT_FML_LOGGER.info("All checked start consuming inputs"); } @@ -292,7 +323,8 @@ public class GT_MetaTileEntity_AssemblyLine extends GT_MetaTileEntity_EnhancedMu for (int i = 0; i < tFluids.length; i++) { if (mInputHatches.get(i) instanceof GT_MetaTileEntity_Hatch_MultiInput) { - GT_MetaTileEntity_Hatch_MultiInput tMultiHatch = (GT_MetaTileEntity_Hatch_MultiInput) mInputHatches.get(i); + GT_MetaTileEntity_Hatch_MultiInput tMultiHatch = + (GT_MetaTileEntity_Hatch_MultiInput) mInputHatches.get(i); tMultiHatch.getFluid(tFluidSlot[i]).amount -= tFluids[i]; if (tMultiHatch.getFluid(tFluidSlot[i]).amount <= 0) { tMultiHatch.setFluid(null, tFluidSlot[i]); @@ -318,12 +350,10 @@ public class GT_MetaTileEntity_AssemblyLine extends GT_MetaTileEntity_EnhancedMu } private static int isStackValidIngredient(ItemStack aSlotStack, ItemStack aIngredient, ItemStack[] alts) { - if (alts == null || alts.length == 0) - return isStackValidIngredient(aSlotStack, aIngredient); + if (alts == null || alts.length == 0) return isStackValidIngredient(aSlotStack, aIngredient); for (ItemStack tAltStack : alts) { int i = isStackValidIngredient(aSlotStack, tAltStack); - if (i >= 0) - return i; + if (i >= 0) return i; } return -1; } @@ -358,15 +388,13 @@ public class GT_MetaTileEntity_AssemblyLine extends GT_MetaTileEntity_EnhancedMu @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { mDataAccessHatches.clear(); - if (!checkPiece(STRUCTURE_PIECE_FIRST, 0, 1, 0)) - return false; + if (!checkPiece(STRUCTURE_PIECE_FIRST, 0, 1, 0)) return false; return checkMachine(true) || checkMachine(false); } private boolean checkMachine(boolean leftToRight) { for (int i = 1; i < 16; i++) { - if (!checkPiece(STRUCTURE_PIECE_LATER, leftToRight ? -i : i, 1, 0)) - return false; + if (!checkPiece(STRUCTURE_PIECE_LATER, leftToRight ? -i : i, 1, 0)) return false; if (!mOutputBusses.isEmpty()) return !mEnergyHatches.isEmpty() && mMaintenanceHatches.size() == 1 && mDataAccessHatches.size() <= 1; } @@ -394,7 +422,7 @@ public class GT_MetaTileEntity_AssemblyLine extends GT_MetaTileEntity_EnhancedMu if (isValidMetaTileEntity(tHatch)) { for (int i = 0; i < tHatch.getBaseMetaTileEntity().getSizeInventory(); i++) { if (tHatch.getBaseMetaTileEntity().getStackInSlot(i) != null - && isCorrectDataItem(tHatch.getBaseMetaTileEntity().getStackInSlot(i), state)) + && isCorrectDataItem(tHatch.getBaseMetaTileEntity().getStackInSlot(i), state)) rList.add(tHatch.getBaseMetaTileEntity().getStackInSlot(i)); } } @@ -440,14 +468,17 @@ public class GT_MetaTileEntity_AssemblyLine extends GT_MetaTileEntity_EnhancedMu @Override public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) { if (mMachine) return -1; - int build = survivialBuildPiece(STRUCTURE_PIECE_FIRST, stackSize, 0, 1, 0, elementBudget, source, actor, false, true); + int build = survivialBuildPiece( + STRUCTURE_PIECE_FIRST, stackSize, 0, 1, 0, elementBudget, source, actor, false, true); if (build >= 0) return build; int tLength = Math.min(stackSize.stackSize + 1, 16); for (int i = 1; i < tLength - 1; i++) { - build = survivialBuildPiece(STRUCTURE_PIECE_LATER, stackSize, -i, 1, 0, elementBudget, source, actor, false, true); + build = survivialBuildPiece( + STRUCTURE_PIECE_LATER, stackSize, -i, 1, 0, elementBudget, source, actor, false, true); if (build >= 0) return build; } - return survivialBuildPiece(STRUCTURE_PIECE_LAST, stackSize, 1 - tLength, 1, 0, elementBudget, source, actor, false); + return survivialBuildPiece( + STRUCTURE_PIECE_LAST, stackSize, 1 - tLength, 1, 0, elementBudget, source, actor, false); } private enum DataHatchElement implements IHatchElement<GT_MetaTileEntity_AssemblyLine> { diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BrickedBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BrickedBlastFurnace.java index e55837ab2d..adf09ad6db 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BrickedBlastFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BrickedBlastFurnace.java @@ -13,12 +13,18 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import net.minecraft.block.Block; import org.lwjgl.input.Keyboard; -public class GT_MetaTileEntity_BrickedBlastFurnace extends GT_MetaTileEntity_PrimitiveBlastFurnace implements ISecondaryDescribable { +public class GT_MetaTileEntity_BrickedBlastFurnace extends GT_MetaTileEntity_PrimitiveBlastFurnace + implements ISecondaryDescribable { private static final ITexture[] FACING_SIDE = {TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_DENSEBRICKS)}; - private static final ITexture[] FACING_FRONT = {TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_BRICKEDBLASTFURNACE_INACTIVE)}; + private static final ITexture[] FACING_FRONT = { + TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_BRICKEDBLASTFURNACE_INACTIVE) + }; private static final ITexture[] FACING_ACTIVE = { - TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_BRICKEDBLASTFURNACE_ACTIVE), - TextureFactory.builder().addIcon(BlockIcons.MACHINE_CASING_BRICKEDBLASTFURNACE_ACTIVE_GLOW).glow().build() + TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_BRICKEDBLASTFURNACE_ACTIVE), + TextureFactory.builder() + .addIcon(BlockIcons.MACHINE_CASING_BRICKEDBLASTFURNACE_ACTIVE_GLOW) + .glow() + .build() }; public GT_MetaTileEntity_BrickedBlastFurnace(int aID, String aName, String aNameRegional) { @@ -66,7 +72,13 @@ public class GT_MetaTileEntity_BrickedBlastFurnace extends GT_MetaTileEntity_Pri } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { if (aSide == aFacing) { return aActive ? FACING_ACTIVE : FACING_FRONT; } @@ -93,4 +105,3 @@ public class GT_MetaTileEntity_BrickedBlastFurnace extends GT_MetaTileEntity_Pri return "Bricked Blast Furnace"; } } - diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java index 93b36d376c..9bccfa3376 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java @@ -1,5 +1,10 @@ package gregtech.common.tileentities.machines.multi; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_BRONZEBLASTFURNACE; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_BRONZEBLASTFURNACE_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_BRONZEBLASTFURNACE_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_BRONZEPLATEDBRICKS; + import gregtech.api.GregTech_API; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -7,17 +12,15 @@ import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.render.TextureFactory; import net.minecraft.block.Block; -import static gregtech.api.enums.Textures.BlockIcons.MACHINE_BRONZEBLASTFURNACE; -import static gregtech.api.enums.Textures.BlockIcons.MACHINE_BRONZEBLASTFURNACE_ACTIVE; -import static gregtech.api.enums.Textures.BlockIcons.MACHINE_BRONZEBLASTFURNACE_ACTIVE_GLOW; -import static gregtech.api.enums.Textures.BlockIcons.MACHINE_BRONZEPLATEDBRICKS; - public class GT_MetaTileEntity_BronzeBlastFurnace extends GT_MetaTileEntity_PrimitiveBlastFurnace { private static final ITexture[] FACING_SIDE = {TextureFactory.of(MACHINE_BRONZEPLATEDBRICKS)}; private static final ITexture[] FACING_FRONT = {TextureFactory.of(MACHINE_BRONZEBLASTFURNACE)}; private static final ITexture[] FACING_ACTIVE = { - TextureFactory.of(MACHINE_BRONZEBLASTFURNACE_ACTIVE), - TextureFactory.builder().addIcon(MACHINE_BRONZEBLASTFURNACE_ACTIVE_GLOW).glow().build() + TextureFactory.of(MACHINE_BRONZEBLASTFURNACE_ACTIVE), + TextureFactory.builder() + .addIcon(MACHINE_BRONZEBLASTFURNACE_ACTIVE_GLOW) + .glow() + .build() }; public GT_MetaTileEntity_BronzeBlastFurnace(int aID, String aName, String aNameRegional) { @@ -30,11 +33,17 @@ public class GT_MetaTileEntity_BronzeBlastFurnace extends GT_MetaTileEntity_Prim @Override public String[] getDescription() { - return new String[]{"Disabled"}; + return new String[] {"Disabled"}; } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { if (aSide == aFacing) { return aActive ? FACING_ACTIVE : FACING_FRONT; } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java index 5f6a34832e..8a2f969b18 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java @@ -1,9 +1,16 @@ package gregtech.common.tileentities.machines.multi; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages; +import static gregtech.api.objects.XSTR.XSTR_INSTANCE; + import gregtech.GT_Mod; import gregtech.api.GregTech_API; -import gregtech.api.enums.ParticleFX; import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.ParticleFX; import gregtech.api.interfaces.ISecondaryDescribable; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -14,6 +21,7 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.WorldSpawnedEventBuilder; import gregtech.common.GT_Pollution; +import java.util.ArrayList; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.player.EntityPlayer; @@ -22,17 +30,8 @@ import net.minecraft.item.ItemStack; import net.minecraft.world.ChunkPosition; import net.minecraftforge.oredict.OreDictionary; -import java.util.ArrayList; - -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_ACTIVE; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_ACTIVE_GLOW; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_GLOW; -import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages; - -import static gregtech.api.objects.XSTR.XSTR_INSTANCE; - -public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_TooltipMultiBlockBase implements ISecondaryDescribable { +public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_TooltipMultiBlockBase + implements ISecondaryDescribable { private boolean running = false; @@ -80,7 +79,7 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_TooltipMul mEfficiencyIncrease = 10000; mMaxProgresstime = Math.max(1, mMaxProgresstime); - //adds all the pollution at once when the recipe starts + // adds all the pollution at once when the recipe starts GT_Pollution.addPollution(getBaseMetaTileEntity(), mMaxProgresstime * getPollutionPerTick(null)); return true; } else { @@ -108,8 +107,18 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_TooltipMul } if (running) { for (ChunkPosition tPos : tList1) { - if (isWoodLog(getBaseMetaTileEntity().getBlockOffset(tPos.chunkPosX, tPos.chunkPosY, tPos.chunkPosZ), getBaseMetaTileEntity().getMetaIDOffset(tPos.chunkPosX, tPos.chunkPosY, tPos.chunkPosZ))) - getBaseMetaTileEntity().getWorld().setBlock(getBaseMetaTileEntity().getXCoord() + tPos.chunkPosX, getBaseMetaTileEntity().getYCoord() + tPos.chunkPosY, getBaseMetaTileEntity().getZCoord() + tPos.chunkPosZ, GregTech_API.sBlockReinforced, 4, 3); + if (isWoodLog( + getBaseMetaTileEntity().getBlockOffset(tPos.chunkPosX, tPos.chunkPosY, tPos.chunkPosZ), + getBaseMetaTileEntity().getMetaIDOffset(tPos.chunkPosX, tPos.chunkPosY, tPos.chunkPosZ))) + getBaseMetaTileEntity() + .getWorld() + .setBlock( + getBaseMetaTileEntity().getXCoord() + tPos.chunkPosX, + getBaseMetaTileEntity().getYCoord() + tPos.chunkPosY, + getBaseMetaTileEntity().getZCoord() + tPos.chunkPosZ, + GregTech_API.sBlockReinforced, + 4, + 3); } running = false; return false; @@ -122,14 +131,16 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_TooltipMul private boolean isWoodLog(Block log, int meta) { for (int id : OreDictionary.getOreIDs(new ItemStack(log, 1, meta))) { - if (OreDictionary.getOreName(id).equals("logWood")) - return true; + if (OreDictionary.getOreName(id).equals("logWood")) return true; } String tTool = log.getHarvestTool(meta); - return OrePrefixes.log.contains(new ItemStack(log, 1, meta)) && ("axe".equals(tTool)) && (log.getMaterial() == Material.wood); + return OrePrefixes.log.contains(new ItemStack(log, 1, meta)) + && ("axe".equals(tTool)) + && (log.getMaterial() == Material.wood); } - private boolean checkAllBlockSides(int aX, int aY, int aZ, ArrayList<? super ChunkPosition> aList1, ArrayList<? super ChunkPosition> aList2) { + private boolean checkAllBlockSides( + int aX, int aY, int aZ, ArrayList<? super ChunkPosition> aList1, ArrayList<? super ChunkPosition> aList2) { boolean expandToChunkXPos = false; boolean expandToChunkXNeg = false; boolean expandToChunkYPos = false; @@ -139,48 +150,50 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_TooltipMul Block blockXPos = getBaseMetaTileEntity().getBlockOffset(aX + 1, aY, aZ); if (aX + 1 < 6 && (isWoodLog(blockXPos, getBaseMetaTileEntity().getMetaIDOffset(aX + 1, aY, aZ)))) { - if (!aList1.contains(new ChunkPosition(aX + 1, aY, aZ)) && (!aList2.contains(new ChunkPosition(aX + 1, aY, aZ)))) - expandToChunkXPos = true; + if (!aList1.contains(new ChunkPosition(aX + 1, aY, aZ)) + && (!aList2.contains(new ChunkPosition(aX + 1, aY, aZ)))) expandToChunkXPos = true; } else if (!(blockXPos == Blocks.dirt || blockXPos == Blocks.grass)) { return false; } Block blockXNeg = getBaseMetaTileEntity().getBlockOffset(aX - 1, aY, aZ); if (aX - 1 > -6 && (isWoodLog(blockXNeg, getBaseMetaTileEntity().getMetaIDOffset(aX - 1, aY, aZ)))) { - if (!aList1.contains(new ChunkPosition(aX - 1, aY, aZ)) && (!aList2.contains(new ChunkPosition(aX - 1, aY, aZ)))) - expandToChunkXNeg = true; + if (!aList1.contains(new ChunkPosition(aX - 1, aY, aZ)) + && (!aList2.contains(new ChunkPosition(aX - 1, aY, aZ)))) expandToChunkXNeg = true; } else if (!(blockXNeg == Blocks.dirt || blockXNeg == Blocks.grass)) { return false; } Block blockYPos = getBaseMetaTileEntity().getBlockOffset(aX, aY + 1, aZ); if (aY + 1 < 1 && (isWoodLog(blockYPos, getBaseMetaTileEntity().getMetaIDOffset(aX, aY + 1, aZ)))) { - if (!aList1.contains(new ChunkPosition(aX, aY + 1, aZ)) && (!aList2.contains(new ChunkPosition(aX, aY + 1, aZ)))) - expandToChunkYPos = true; - } else if (!(blockYPos == Blocks.dirt || blockYPos == Blocks.grass || (aX == 0 && aY == -1 && aZ == 0 && blockYPos == GregTech_API.sBlockMachines))) { + if (!aList1.contains(new ChunkPosition(aX, aY + 1, aZ)) + && (!aList2.contains(new ChunkPosition(aX, aY + 1, aZ)))) expandToChunkYPos = true; + } else if (!(blockYPos == Blocks.dirt + || blockYPos == Blocks.grass + || (aX == 0 && aY == -1 && aZ == 0 && blockYPos == GregTech_API.sBlockMachines))) { return false; } Block blockYNeg = getBaseMetaTileEntity().getBlockOffset(aX, aY - 1, aZ); if (aY - 1 > -6 && (isWoodLog(blockYNeg, getBaseMetaTileEntity().getMetaIDOffset(aX, aY - 1, aZ)))) { - if (!aList1.contains(new ChunkPosition(aX, aY - 1, aZ)) && (!aList2.contains(new ChunkPosition(aX, aY - 1, aZ)))) - expandToChunkYNeg = true; + if (!aList1.contains(new ChunkPosition(aX, aY - 1, aZ)) + && (!aList2.contains(new ChunkPosition(aX, aY - 1, aZ)))) expandToChunkYNeg = true; } else if (blockYNeg != Blocks.brick_block) { return false; } Block blockZPos = getBaseMetaTileEntity().getBlockOffset(aX, aY, aZ + 1); if (aZ + 1 < 6 && (isWoodLog(blockZPos, getBaseMetaTileEntity().getMetaIDOffset(aX, aY, aZ + 1)))) { - if (!aList1.contains(new ChunkPosition(aX, aY, aZ + 1)) && (!aList2.contains(new ChunkPosition(aX, aY, aZ + 1)))) - expandToChunkZPos = true; + if (!aList1.contains(new ChunkPosition(aX, aY, aZ + 1)) + && (!aList2.contains(new ChunkPosition(aX, aY, aZ + 1)))) expandToChunkZPos = true; } else if (!(blockZPos == Blocks.dirt || blockZPos == Blocks.grass)) { return false; } Block blockZNeg = getBaseMetaTileEntity().getBlockOffset(aX, aY, aZ - 1); if (aZ - 1 > -6 && (isWoodLog(blockZNeg, getBaseMetaTileEntity().getMetaIDOffset(aX, aY, aZ - 1)))) { - if (!aList1.contains(new ChunkPosition(aX, aY, aZ - 1)) && (!aList2.contains(new ChunkPosition(aX, aY, aZ - 1)))) - expandToChunkZNeg = true; + if (!aList1.contains(new ChunkPosition(aX, aY, aZ - 1)) + && (!aList2.contains(new ChunkPosition(aX, aY, aZ - 1)))) expandToChunkZNeg = true; } else if (!(blockZNeg == Blocks.dirt || blockZNeg == Blocks.grass)) { return false; } @@ -254,19 +267,33 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_TooltipMul } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { if (aSide == 1) { - if (aActive) return new ITexture[]{ + if (aActive) + return new ITexture[] { casingTexturePages[0][10], TextureFactory.of(OVERLAY_FRONT_ROCK_BREAKER_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_FRONT_ROCK_BREAKER_ACTIVE_GLOW).glow().build()}; - return new ITexture[]{ - casingTexturePages[0][10], - TextureFactory.of(OVERLAY_FRONT_ROCK_BREAKER), - TextureFactory.builder().addIcon(OVERLAY_FRONT_ROCK_BREAKER_GLOW).glow().build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ROCK_BREAKER_ACTIVE_GLOW) + .glow() + .build() + }; + return new ITexture[] { + casingTexturePages[0][10], + TextureFactory.of(OVERLAY_FRONT_ROCK_BREAKER), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ROCK_BREAKER_GLOW) + .glow() + .build(), }; } - return new ITexture[]{casingTexturePages[0][10]}; + return new ITexture[] {casingTexturePages[0][10]}; } @Override @@ -282,13 +309,12 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_TooltipMul if ((aBaseMetaTileEntity.isClientSide()) && (aBaseMetaTileEntity.isActive())) { new WorldSpawnedEventBuilder.ParticleEventBuilder() - .setMotion(0D,0.3D,0D) + .setMotion(0D, 0.3D, 0D) .setIdentifier(ParticleFX.LARGE_SMOKE) .setPosition( aBaseMetaTileEntity.getOffsetX((byte) 1, 1) + XSTR_INSTANCE.nextFloat(), aBaseMetaTileEntity.getOffsetY((byte) 1, 1), - aBaseMetaTileEntity.getOffsetZ((byte) 1, 1) + XSTR_INSTANCE.nextFloat() - ) + aBaseMetaTileEntity.getOffsetZ((byte) 1, 1) + XSTR_INSTANCE.nextFloat()) .setWorld(getBaseMetaTileEntity().getWorld()) .run(); } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java index 6b167654b4..ae935a06bb 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java @@ -1,5 +1,8 @@ package gregtech.common.tileentities.machines.multi; +import static gregtech.api.enums.GT_Values.debugCleanroom; +import static gregtech.api.enums.Textures.BlockIcons.*; + import com.gtnewhorizon.structurelib.StructureLibAPI; import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable; import gregtech.api.GregTech_API; @@ -16,6 +19,8 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Log; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; +import java.util.HashMap; +import java.util.Map; import net.minecraft.block.Block; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; @@ -25,13 +30,8 @@ import net.minecraftforge.common.config.ConfigCategory; import net.minecraftforge.common.config.Configuration; import net.minecraftforge.common.util.ForgeDirection; -import java.util.HashMap; -import java.util.Map; - -import static gregtech.api.enums.GT_Values.debugCleanroom; -import static gregtech.api.enums.Textures.BlockIcons.*; - -public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiBlockBase implements IConstructable, ISecondaryDescribable { +public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiBlockBase + implements IConstructable, ISecondaryDescribable { private int mHeight = -1; public GT_MetaTileEntity_Cleanroom(int aID, String aName, String aNameRegional) { @@ -50,35 +50,36 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiB protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Cleanroom") - .addInfo("Controller block for the Cleanroom") - .addInfo("Consumes 40 EU/t when first turned on") - .addInfo("and 4 EU/t once at 100% efficiency when not overclocked")//? - .addInfo("An energy hatch accepts up to 2A, so you can use 2A LV or 1A MV") - .addInfo("2 LV batteries + 1 LV generator or 1 MV generator")//? - .addInfo("Time required to reach full efficiency is proportional to") - .addInfo("the height of empty space within") - .addInfo("Make sure your Energy Hatch matches! ?") - .addInfo("Machines that cause pollution aren't allowed to be put in.") - .addSeparator() - .beginVariableStructureBlock(3, 15, 4, 15, 3, 15, true) - .addController("Top center") - .addCasingInfo("Plascrete", 20) - .addStructureInfo(GT_Values.cleanroomGlass + "% of the Plascrete can be replaced with Reinforced Glass")//check - .addStructureInfo("Other material can be used in place of Plascrete. See config for detail")//check - .addOtherStructurePart("Filter Machine Casing", "Top besides controller and edges") - .addEnergyHatch("Any casing. Exactly one.")//check - .addMaintenanceHatch("Any casing") - .addStructureInfo("1x Reinforced Door (keep closed or efficiency will reduce)") - .addStructureInfo("Up to 10 Machine Hulls for Item & Energy transfer through walls") - .addStructureInfo("You can also use Diodes for more power") - .addStructureInfo("Diodes also count towards 10 Machine Hulls count limit") - .toolTipFinisher("Gregtech"); + .addInfo("Controller block for the Cleanroom") + .addInfo("Consumes 40 EU/t when first turned on") + .addInfo("and 4 EU/t once at 100% efficiency when not overclocked") // ? + .addInfo("An energy hatch accepts up to 2A, so you can use 2A LV or 1A MV") + .addInfo("2 LV batteries + 1 LV generator or 1 MV generator") // ? + .addInfo("Time required to reach full efficiency is proportional to") + .addInfo("the height of empty space within") + .addInfo("Make sure your Energy Hatch matches! ?") + .addInfo("Machines that cause pollution aren't allowed to be put in.") + .addSeparator() + .beginVariableStructureBlock(3, 15, 4, 15, 3, 15, true) + .addController("Top center") + .addCasingInfo("Plascrete", 20) + .addStructureInfo( + GT_Values.cleanroomGlass + "% of the Plascrete can be replaced with Reinforced Glass") // check + .addStructureInfo("Other material can be used in place of Plascrete. See config for detail") // check + .addOtherStructurePart("Filter Machine Casing", "Top besides controller and edges") + .addEnergyHatch("Any casing. Exactly one.") // check + .addMaintenanceHatch("Any casing") + .addStructureInfo("1x Reinforced Door (keep closed or efficiency will reduce)") + .addStructureInfo("Up to 10 Machine Hulls for Item & Energy transfer through walls") + .addStructureInfo("You can also use Diodes for more power") + .addStructureInfo("Diodes also count towards 10 Machine Hulls count limit") + .toolTipFinisher("Gregtech"); return tt; } @Override public String[] getStructureDescription(ItemStack itemStack) { - return new String[] { "The structure in both X and Z axis has to be a square." }; + return new String[] {"The structure in both X and Z axis has to be a square."}; } @Override @@ -86,7 +87,8 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiB mEfficiencyIncrease = 100; // use the standard overclock mechanism to determine duration and estimate a maximum consumption calculateOverclockedNessMulti(40, 45 * Math.max(1, mHeight - 1), 1, getMaxInputVoltage()); - // negate it to trigger the special energy consumption function. divide by 10 to get the actual final consumption. + // negate it to trigger the special energy consumption function. divide by 10 to get the actual final + // consumption. mEUt /= -10; return true; } @@ -109,9 +111,7 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiB this.mUpdate = 100; if (debugCleanroom) { - GT_Log.out.println( - "Cleanroom: Checking machine" - ); + GT_Log.out.println("Cleanroom: Checking machine"); } for (int i = 1; i < 8; i++) { Block tBlock = aBaseMetaTileEntity.getBlockOffset(i, 0, 0); @@ -143,7 +143,7 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiB } } } - //detect room square for filters + // detect room square for filters for (int i = -x + 1; i < x; i++) { for (int j = -z + 1; j < z; j++) { if (i == 0 && j == 0) continue; @@ -165,9 +165,7 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiB } if (y > -2) { if (debugCleanroom) { - GT_Log.out.println( - "Cleanroom: Room not tall enough?" - ); + GT_Log.out.println("Cleanroom: Room not tall enough?"); } return false; } @@ -177,22 +175,19 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiB if (dX == -x || dX == x || dY == 0 || dY == y || dZ == -z || dZ == z) { Block tBlock = aBaseMetaTileEntity.getBlockOffset(dX, dY, dZ); int tMeta = aBaseMetaTileEntity.getMetaIDOffset(dX, dY, dZ); - if (dY == 0) { // TOP - if (dX == -x || dX == x || dZ == -z || dZ == z) { // Top Border + if (dY == 0) { // TOP + if (dX == -x || dX == x || dZ == -z || dZ == z) { // Top Border if (tBlock != GregTech_API.sBlockReinforced || tMeta != 2) { if (debugCleanroom) { - GT_Log.out.println( - "Cleanroom: Non reinforced block on top edge? tMeta != 2" - ); + GT_Log.out.println("Cleanroom: Non reinforced block on top edge? tMeta != 2"); } return false; } - } else if (dX != 0 || dZ != 0) { // Top Inner exclude center + } else if (dX != 0 || dZ != 0) { // Top Inner exclude center if (tBlock != GregTech_API.sBlockCasings3 || tMeta != 11) { if (debugCleanroom) { GT_Log.out.println( - "Cleanroom: Non reinforced block on top face interior? tMeta != 11" - ); + "Cleanroom: Non reinforced block on top face interior? tMeta != 11"); } return false; } @@ -200,15 +195,17 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiB } else if (tBlock == GregTech_API.sBlockReinforced && tMeta == 2) { mPlascreteCount++; } else { - IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(dX, dY, dZ); - if ((!this.addMaintenanceToMachineList(tTileEntity, 210)) && (!this.addEnergyInputToMachineList(tTileEntity, 210))) { + IGregTechTileEntity tTileEntity = + aBaseMetaTileEntity.getIGregTechTileEntityOffset(dX, dY, dZ); + if ((!this.addMaintenanceToMachineList(tTileEntity, 210)) + && (!this.addEnergyInputToMachineList(tTileEntity, 210))) { if (tBlock instanceof ic2.core.block.BlockIC2Door) { if ((tMeta & 8) == 0) { // let's not fiddle with bits anymore. if (Math.abs(dZ) < z) // on side parallel to z axis - doorState = tMeta == 1 || tMeta == 3 || tMeta == 4 || tMeta == 6; + doorState = tMeta == 1 || tMeta == 3 || tMeta == 4 || tMeta == 6; else if (Math.abs(dX) < x) // on side parallel to x axis - doorState = tMeta == 0 || tMeta == 2 || tMeta == 5 || tMeta == 7; + doorState = tMeta == 0 || tMeta == 2 || tMeta == 5 || tMeta == 7; // corners ignored } mDoorCount++; @@ -217,37 +214,31 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiB IMetaTileEntity aMetaTileEntity = tTileEntity.getMetaTileEntity(); if (aMetaTileEntity == null) { if (debugCleanroom) { - GT_Log.out.println( - "Cleanroom: Missing block? Not a aMetaTileEntity" - ); + GT_Log.out.println("Cleanroom: Missing block? Not a aMetaTileEntity"); } return false; } if (aMetaTileEntity instanceof GT_MetaTileEntity_BasicHull) { mHullCount++; - } - else { + } else { if (debugCleanroom) { - GT_Log.out.println( - "Cleanroom: Incorrect GT block? " + tBlock.getUnlocalizedName() - ); + GT_Log.out.println("Cleanroom: Incorrect GT block? " + + tBlock.getUnlocalizedName()); } return false; } - } - else { - String key = tBlock.getUnlocalizedName() + ":"+ tMeta; + } else { + String key = tBlock.getUnlocalizedName() + ":" + tMeta; if (config.containsKey(key)) { // check with meta first otherBlocks.compute(key, (k, v) -> v == null ? 1 : v + 1); - } - else { + } else { key = tBlock.getUnlocalizedName(); if (config.containsKey(key)) { otherBlocks.compute(key, (k, v) -> v == null ? 1 : v + 1); - } - else { + } else { if (debugCleanroom) - GT_Log.out.println("Cleanroom: not allowed block " + tBlock.getUnlocalizedName()); + GT_Log.out.println("Cleanroom: not allowed block " + + tBlock.getUnlocalizedName()); return false; } } @@ -259,19 +250,19 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiB } } } - if (this.mMaintenanceHatches.size() != 1 || this.mEnergyHatches.size() != 1 || mDoorCount > 2 || mHullCount > 10) { + if (this.mMaintenanceHatches.size() != 1 + || this.mEnergyHatches.size() != 1 + || mDoorCount > 2 + || mHullCount > 10) { return false; } - if (mPlascreteCount < 20) - return false; + if (mPlascreteCount < 20) return false; float ratio = (((float) mPlascreteCount) / 100f); for (Map.Entry<String, Integer> e : otherBlocks.entrySet()) { ConfigEntry ce = config.get(e.getKey()); if (ce.allowedCount > 0) { // count has priority - if (e.getValue() > ce.allowedCount) - return false; - } else if (e.getValue() > ratio * ce.percentage) - return false; + if (e.getValue() > ce.allowedCount) return false; + } else if (e.getValue() > ratio * ce.percentage) return false; } setCallbacks(x, y, z, aBaseMetaTileEntity); @@ -316,9 +307,8 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiB @SuppressWarnings("unchecked") private void checkAndSetCallback(IMachineCallback<?> iMachineCallback) { if (debugCleanroom) - GT_Log.out.println( - "Cleanroom: IMachineCallback detected, checking for cleanroom: " + (iMachineCallback.getType() == this.getClass()) - ); + GT_Log.out.println("Cleanroom: IMachineCallback detected, checking for cleanroom: " + + (iMachineCallback.getType() == this.getClass())); if (iMachineCallback.getType() == this.getClass()) ((IMachineCallback<GT_MetaTileEntity_Cleanroom>) iMachineCallback).setCallbackBase(this); } @@ -329,24 +319,38 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiB } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { if (aSide == ForgeDirection.DOWN.ordinal() || aSide == ForgeDirection.UP.ordinal()) { - return new ITexture[]{ - TextureFactory.of(BLOCK_PLASCRETE), - aActive ? - TextureFactory.of( - TextureFactory.of(OVERLAY_TOP_CLEANROOM_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_TOP_CLEANROOM_ACTIVE_GLOW).glow().build()) : - TextureFactory.of( - TextureFactory.of(OVERLAY_TOP_CLEANROOM), - TextureFactory.builder().addIcon(OVERLAY_TOP_CLEANROOM_GLOW).glow().build())}; + return new ITexture[] { + TextureFactory.of(BLOCK_PLASCRETE), + aActive + ? TextureFactory.of( + TextureFactory.of(OVERLAY_TOP_CLEANROOM_ACTIVE), + TextureFactory.builder() + .addIcon(OVERLAY_TOP_CLEANROOM_ACTIVE_GLOW) + .glow() + .build()) + : TextureFactory.of( + TextureFactory.of(OVERLAY_TOP_CLEANROOM), + TextureFactory.builder() + .addIcon(OVERLAY_TOP_CLEANROOM_GLOW) + .glow() + .build()) + }; } - return new ITexture[]{TextureFactory.of(BLOCK_PLASCRETE)}; + return new ITexture[] {TextureFactory.of(BLOCK_PLASCRETE)}; } @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), "MultiblockDisplay.png"); + return new GT_GUIContainer_MultiMachine( + aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), "MultiblockDisplay.png"); } @Override @@ -383,25 +387,16 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiB int y = baseEntity.getYCoord(); int z = baseEntity.getZCoord(); int yoff = Math.max(i * 2, 3); - for(int X = x - i; X <= x + i; X++) - for(int Y = y; Y >= y - yoff; Y--) - for(int Z = z - i; Z <= z + i; Z++) - { - if(X == x && Y == y && Z == z) - continue; - if(X == x - i || X == x + i || Z == z - i || Z == z + i || Y == y - yoff) - { - if (b) - StructureLibAPI.hintParticle(world, X, Y, Z, GregTech_API.sBlockReinforced, 2); - else - world.setBlock(X, Y, Z, GregTech_API.sBlockReinforced, 2, 2); - } - else if(Y == y) - { - if (b) - StructureLibAPI.hintParticle(world, X, Y, Z, GregTech_API.sBlockCasings3, 11); - else - world.setBlock(X, Y, Z, GregTech_API.sBlockCasings3, 11, 2); + for (int X = x - i; X <= x + i; X++) + for (int Y = y; Y >= y - yoff; Y--) + for (int Z = z - i; Z <= z + i; Z++) { + if (X == x && Y == y && Z == z) continue; + if (X == x - i || X == x + i || Z == z - i || Z == z + i || Y == y - yoff) { + if (b) StructureLibAPI.hintParticle(world, X, Y, Z, GregTech_API.sBlockReinforced, 2); + else world.setBlock(X, Y, Z, GregTech_API.sBlockReinforced, 2, 2); + } else if (Y == y) { + if (b) StructureLibAPI.hintParticle(world, X, Y, Z, GregTech_API.sBlockCasings3, 11); + else world.setBlock(X, Y, Z, GregTech_API.sBlockCasings3, 11, 2); } } } @@ -410,49 +405,56 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiB int percentage; int allowedCount; int meta; + ConfigEntry(int percentage, int count, int meta) { this.percentage = percentage; this.allowedCount = count; this.meta = meta; } } - private final static HashMap<String, ConfigEntry> config = new HashMap<>(); + + private static final HashMap<String, ConfigEntry> config = new HashMap<>(); private static final String category = "cleanroom_allowed_blocks"; private static final int wildcard_meta = Short.MAX_VALUE; private static void setDefaultConfigValues(Configuration cfg) { - cfg.get("cleanroom_allowed_blocks.reinforced_glass", "Name","blockAlloyGlass"); - cfg.get("cleanroom_allowed_blocks.reinforced_glass", "Percentage",5); - cfg.get("cleanroom_allowed_blocks.bw_reinforced_glass_0", "Name","BW_GlasBlocks"); - cfg.get("cleanroom_allowed_blocks.bw_reinforced_glass_0", "Percentage",50); - cfg.get("cleanroom_allowed_blocks.bw_reinforced_glass_0", "Meta",0); - cfg.get("cleanroom_allowed_blocks.bw_reinforced_glass", "Name","BW_GlasBlocks"); - cfg.get("cleanroom_allowed_blocks.bw_reinforced_glass", "Percentage",100); - cfg.get("cleanroom_allowed_blocks.elevator", "Name","tile.openblocks.elevator"); - cfg.get("cleanroom_allowed_blocks.elevator", "Count",1); - cfg.get("cleanroom_allowed_blocks.travel_anchor", "Name","tile.blockTravelAnchor"); - cfg.get("cleanroom_allowed_blocks.travel_anchor", "Count",1); - cfg.get("cleanroom_allowed_blocks.warded_glass", "Name","tile.blockCosmeticOpaque"); - cfg.get("cleanroom_allowed_blocks.warded_glass", "Meta",2); - cfg.get("cleanroom_allowed_blocks.warded_glass", "Percentage",50); + cfg.get("cleanroom_allowed_blocks.reinforced_glass", "Name", "blockAlloyGlass"); + cfg.get("cleanroom_allowed_blocks.reinforced_glass", "Percentage", 5); + cfg.get("cleanroom_allowed_blocks.bw_reinforced_glass_0", "Name", "BW_GlasBlocks"); + cfg.get("cleanroom_allowed_blocks.bw_reinforced_glass_0", "Percentage", 50); + cfg.get("cleanroom_allowed_blocks.bw_reinforced_glass_0", "Meta", 0); + cfg.get("cleanroom_allowed_blocks.bw_reinforced_glass", "Name", "BW_GlasBlocks"); + cfg.get("cleanroom_allowed_blocks.bw_reinforced_glass", "Percentage", 100); + cfg.get("cleanroom_allowed_blocks.elevator", "Name", "tile.openblocks.elevator"); + cfg.get("cleanroom_allowed_blocks.elevator", "Count", 1); + cfg.get("cleanroom_allowed_blocks.travel_anchor", "Name", "tile.blockTravelAnchor"); + cfg.get("cleanroom_allowed_blocks.travel_anchor", "Count", 1); + cfg.get("cleanroom_allowed_blocks.warded_glass", "Name", "tile.blockCosmeticOpaque"); + cfg.get("cleanroom_allowed_blocks.warded_glass", "Meta", 2); + cfg.get("cleanroom_allowed_blocks.warded_glass", "Percentage", 50); } + public static void loadConfig(Configuration cfg) { - if (!cfg.hasCategory(category)) - setDefaultConfigValues(cfg); + if (!cfg.hasCategory(category)) setDefaultConfigValues(cfg); for (ConfigCategory cc : cfg.getCategory(category).getChildren()) { String name = cc.get("Name").getString(); if (cc.containsKey("Count")) { if (cc.containsKey("Meta")) - config.put(name+":"+cc.get("Meta").getInt(), new ConfigEntry(0, cc.get("Count").getInt(), cc.get("Meta").getInt())); - else - config.put(name, new ConfigEntry(0, cc.get("Count").getInt(), wildcard_meta)); - } - else if (cc.containsKey("Percentage")) { + config.put( + name + ":" + cc.get("Meta").getInt(), + new ConfigEntry( + 0, cc.get("Count").getInt(), cc.get("Meta").getInt())); + else config.put(name, new ConfigEntry(0, cc.get("Count").getInt(), wildcard_meta)); + } else if (cc.containsKey("Percentage")) { if (cc.containsKey("Meta")) - config.put(name+":"+cc.get("Meta").getInt(), new ConfigEntry(cc.get("Percentage").getInt(), 0, cc.get("Meta").getInt())); - else - config.put(name, new ConfigEntry(cc.get("Percentage").getInt(), 0, wildcard_meta)); + config.put( + name + ":" + cc.get("Meta").getInt(), + new ConfigEntry( + cc.get("Percentage").getInt(), + 0, + cc.get("Meta").getInt())); + else config.put(name, new ConfigEntry(cc.get("Percentage").getInt(), 0, wildcard_meta)); } } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfillerBase.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfillerBase.java index 52bc0b66e4..873c5bf769 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfillerBase.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfillerBase.java @@ -1,5 +1,7 @@ package gregtech.common.tileentities.machines.multi; +import static gregtech.api.enums.GT_Values.VN; + import gregtech.api.GregTech_API; import gregtech.api.enums.Materials; import gregtech.api.gui.GT_GUIContainer_MultiMachine; @@ -9,8 +11,6 @@ import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; -import static gregtech.api.enums.GT_Values.VN; - public abstract class GT_MetaTileEntity_ConcreteBackfillerBase extends GT_MetaTileEntity_DrillerBase { private int mLastXOff = 0, mLastZOff = 0; @@ -27,30 +27,31 @@ public abstract class GT_MetaTileEntity_ConcreteBackfillerBase extends GT_MetaTi String casings = getCasingBlockItem().get(0).getDisplayName(); final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Concrete Backfiller") - .addInfo("Controller Block for the " + aStructureName) - .addInfo("Will fill in areas below it with light concrete. This goes through walls") - .addInfo("Use it to remove any spawning locations beneath your base to reduce lag") - .addInfo("Will pull back the pipes after it finishes that layer") - .addInfo("Radius is " + getRadius() + " blocks") - .addSeparator() - .beginStructureBlock(3, 7, 3, false) - .addController("Front bottom") - .addOtherStructurePart(casings, "form the 3x1x3 Base") - .addOtherStructurePart(casings, "1x3x1 pillar above the center of the base (2 minimum total)") - .addOtherStructurePart(getFrameMaterial().mName + " Frame Boxes", "Each pillar's side and 1x3x1 on top") - .addEnergyHatch(VN[getMinTier()] + "+, Any base casing", 1) - .addMaintenanceHatch("Any base casing", 1) - .addInputBus("Mining Pipes, optional, any base casing", 1) - .addInputHatch("GT Concrete, any base casing", 1) - .addOutputBus("Mining Pipes, optional, any base casing", 1) - .toolTipFinisher("Gregtech"); - return tt; + tt.addMachineType("Concrete Backfiller") + .addInfo("Controller Block for the " + aStructureName) + .addInfo("Will fill in areas below it with light concrete. This goes through walls") + .addInfo("Use it to remove any spawning locations beneath your base to reduce lag") + .addInfo("Will pull back the pipes after it finishes that layer") + .addInfo("Radius is " + getRadius() + " blocks") + .addSeparator() + .beginStructureBlock(3, 7, 3, false) + .addController("Front bottom") + .addOtherStructurePart(casings, "form the 3x1x3 Base") + .addOtherStructurePart(casings, "1x3x1 pillar above the center of the base (2 minimum total)") + .addOtherStructurePart(getFrameMaterial().mName + " Frame Boxes", "Each pillar's side and 1x3x1 on top") + .addEnergyHatch(VN[getMinTier()] + "+, Any base casing", 1) + .addMaintenanceHatch("Any base casing", 1) + .addInputBus("Mining Pipes, optional, any base casing", 1) + .addInputHatch("GT Concrete, any base casing", 1) + .addOutputBus("Mining Pipes, optional, any base casing", 1) + .toolTipFinisher("Gregtech"); + return tt; } @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "DrillingRig.png"); + return new GT_GUIContainer_MultiMachine( + aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "DrillingRig.png"); } protected abstract int getRadius(); @@ -71,18 +72,18 @@ public abstract class GT_MetaTileEntity_ConcreteBackfillerBase extends GT_MetaTi } @Override - protected boolean workingUpward(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) { - if (isRefillableBlock(xPipe, yHead - 1, zPipe)) - return tryRefillBlock(xPipe, yHead - 1, zPipe); + protected boolean workingUpward( + ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) { + if (isRefillableBlock(xPipe, yHead - 1, zPipe)) return tryRefillBlock(xPipe, yHead - 1, zPipe); int radius = getRadius(); if (mLastXOff == 0 && mLastZOff == 0) { - mLastXOff = - radius; - mLastZOff = - radius; + mLastXOff = -radius; + mLastZOff = -radius; } if (yHead != yDrill) { for (int i = mLastXOff; i <= radius; i++) { - for (int j = (i == mLastXOff ? mLastZOff : - radius); j <= radius; j++) { - if (isRefillableBlock(xPipe + i, yHead, zPipe + j)){ + for (int j = (i == mLastXOff ? mLastZOff : -radius); j <= radius; j++) { + if (isRefillableBlock(xPipe + i, yHead, zPipe + j)) { mLastXOff = i; mLastZOff = j; return tryRefillBlock(xPipe + i, yHead, zPipe + j); @@ -102,10 +103,12 @@ public abstract class GT_MetaTileEntity_ConcreteBackfillerBase extends GT_MetaTi } } - private boolean isRefillableBlock(int aX, int aY, int aZ){ + private boolean isRefillableBlock(int aX, int aY, int aZ) { IGregTechTileEntity aBaseTile = getBaseMetaTileEntity(); - if (!aBaseTile.getBlock(aX, aY, aZ).isAir(aBaseTile.getWorld(), aX, aY, aZ) || aBaseTile.getBlock(aX, aY, aZ).getMaterial().isSolid()) return false; - if (!GT_Utility.setBlockByFakePlayer(getFakePlayer(aBaseTile), aX, aY, aZ, GregTech_API.sBlockConcretes, 8, true)) return false; + if (!aBaseTile.getBlock(aX, aY, aZ).isAir(aBaseTile.getWorld(), aX, aY, aZ) + || aBaseTile.getBlock(aX, aY, aZ).getMaterial().isSolid()) return false; + if (!GT_Utility.setBlockByFakePlayer( + getFakePlayer(aBaseTile), aX, aY, aZ, GregTech_API.sBlockConcretes, 8, true)) return false; return true; } @@ -116,11 +119,10 @@ public abstract class GT_MetaTileEntity_ConcreteBackfillerBase extends GT_MetaTi } private boolean tryConsumeFluid() { - if (!depleteInput(Materials.Concrete.getMolten(144L))){ + if (!depleteInput(Materials.Concrete.getMolten(144L))) { mMaxProgresstime = 0; return false; } return true; } - } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DieselEngine.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DieselEngine.java index 29997c5452..ecf31c240c 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DieselEngine.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DieselEngine.java @@ -1,5 +1,19 @@ package gregtech.common.tileentities.machines.multi; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.lazy; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; +import static gregtech.api.enums.GT_HatchElement.Dynamo; +import static gregtech.api.enums.GT_HatchElement.InputHatch; +import static gregtech.api.enums.GT_HatchElement.Maintenance; +import static gregtech.api.enums.GT_HatchElement.Muffler; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DIESEL_ENGINE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DIESEL_ENGINE_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DIESEL_ENGINE_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DIESEL_ENGINE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages; +import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; + import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IItemSource; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; @@ -18,6 +32,7 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import java.util.ArrayList; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.InventoryPlayer; @@ -27,49 +42,38 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; import net.minecraftforge.fluids.FluidStack; -import java.util.ArrayList; - -import static com.gtnewhorizon.structurelib.structure.StructureUtility.lazy; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; -import static gregtech.api.enums.GT_HatchElement.Dynamo; -import static gregtech.api.enums.GT_HatchElement.InputHatch; -import static gregtech.api.enums.GT_HatchElement.Maintenance; -import static gregtech.api.enums.GT_HatchElement.Muffler; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DIESEL_ENGINE; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DIESEL_ENGINE_ACTIVE; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DIESEL_ENGINE_ACTIVE_GLOW; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DIESEL_ENGINE_GLOW; -import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages; -import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; -import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; -import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional; - -public class GT_MetaTileEntity_DieselEngine extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_DieselEngine> implements ISurvivalConstructable { +public class GT_MetaTileEntity_DieselEngine + extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_DieselEngine> + implements ISurvivalConstructable { private static final String STRUCTURE_PIECE_MAIN = "main"; - private static final ClassValue<IStructureDefinition<GT_MetaTileEntity_DieselEngine>> STRUCTURE_DEFINITION = new ClassValue<IStructureDefinition<GT_MetaTileEntity_DieselEngine>>() { - @Override - protected IStructureDefinition<GT_MetaTileEntity_DieselEngine> computeValue(Class<?> type) { - return StructureDefinition.<GT_MetaTileEntity_DieselEngine>builder() - .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{ - {"---", "iii", "chc", "chc", "ccc", }, - {"---", "i~i", "hgh", "hgh", "cdc", }, - {"---", "iii", "chc", "chc", "ccc", }, - })) - .addElement('i', lazy(t -> ofBlock(t.getIntakeBlock(), t.getIntakeMeta()))) - .addElement('c', lazy(t -> ofBlock(t.getCasingBlock(), t.getCasingMeta()))) - .addElement('g', lazy(t -> ofBlock(t.getGearboxBlock(), t.getGearboxMeta()))) - .addElement('d', lazy(t -> Dynamo.newAny(t.getCasingTextureIndex(), 2))) - .addElement('h', lazy(t -> - buildHatchAdder(GT_MetaTileEntity_DieselEngine.class) - .atLeast(InputHatch, InputHatch, InputHatch, Muffler, Maintenance) - .casingIndex(t.getCasingTextureIndex()) - .dot(1) - .buildAndChain(t.getCasingBlock(), t.getCasingMeta()) - )) - .build(); - } - }; + private static final ClassValue<IStructureDefinition<GT_MetaTileEntity_DieselEngine>> STRUCTURE_DEFINITION = + new ClassValue<IStructureDefinition<GT_MetaTileEntity_DieselEngine>>() { + @Override + protected IStructureDefinition<GT_MetaTileEntity_DieselEngine> computeValue(Class<?> type) { + return StructureDefinition.<GT_MetaTileEntity_DieselEngine>builder() + .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][] { + { + "---", "iii", "chc", "chc", "ccc", + }, + { + "---", "i~i", "hgh", "hgh", "cdc", + }, + { + "---", "iii", "chc", "chc", "ccc", + }, + })) + .addElement('i', lazy(t -> ofBlock(t.getIntakeBlock(), t.getIntakeMeta()))) + .addElement('c', lazy(t -> ofBlock(t.getCasingBlock(), t.getCasingMeta()))) + .addElement('g', lazy(t -> ofBlock(t.getGearboxBlock(), t.getGearboxMeta()))) + .addElement('d', lazy(t -> Dynamo.newAny(t.getCasingTextureIndex(), 2))) + .addElement('h', lazy(t -> buildHatchAdder(GT_MetaTileEntity_DieselEngine.class) + .atLeast(InputHatch, InputHatch, InputHatch, Muffler, Maintenance) + .casingIndex(t.getCasingTextureIndex()) + .dot(1) + .buildAndChain(t.getCasingBlock(), t.getCasingMeta()))) + .build(); + } + }; protected int fuelConsumption = 0; protected int fuelValue = 0; protected int fuelRemaining = 0; @@ -112,18 +116,41 @@ public class GT_MetaTileEntity_DieselEngine extends GT_MetaTileEntity_EnhancedMu } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { if (aSide == aFacing) { - if (aActive) return new ITexture[]{ - casingTexturePages[0][50], - TextureFactory.builder().addIcon(OVERLAY_FRONT_DIESEL_ENGINE_ACTIVE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_DIESEL_ENGINE_ACTIVE_GLOW).extFacing().glow().build()}; - return new ITexture[]{ + if (aActive) + return new ITexture[] { casingTexturePages[0][50], - TextureFactory.builder().addIcon(OVERLAY_FRONT_DIESEL_ENGINE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_DIESEL_ENGINE_GLOW).extFacing().glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_DIESEL_ENGINE_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_DIESEL_ENGINE_ACTIVE_GLOW) + .extFacing() + .glow() + .build() + }; + return new ITexture[] { + casingTexturePages[0][50], + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_DIESEL_ENGINE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_DIESEL_ENGINE_GLOW) + .extFacing() + .glow() + .build() + }; } - return new ITexture[]{casingTexturePages[0][50]}; + return new ITexture[] {casingTexturePages[0][50]}; } @Override @@ -133,7 +160,8 @@ public class GT_MetaTileEntity_DieselEngine extends GT_MetaTileEntity_EnhancedMu @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "LargeDieselEngine.png"); + return new GT_GUIContainer_MultiMachine( + aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "LargeDieselEngine.png"); } // can't use getRecipeMap() or else the fluid hatch will reject oxygen @@ -187,20 +215,25 @@ public class GT_MetaTileEntity_DieselEngine extends GT_MetaTileEntity_EnhancedMu if (tRecipe == null) continue; FluidStack tLiquid = tFluid.copy(); - fuelConsumption = tLiquid.amount = boostEu ? (getBoostFactor() * getNominalOutput() / tRecipe.mSpecialValue) : (getNominalOutput() / tRecipe.mSpecialValue); //Calc fuel consumption - //Deplete that amount + fuelConsumption = tLiquid.amount = boostEu + ? (getBoostFactor() * getNominalOutput() / tRecipe.mSpecialValue) + : (getNominalOutput() / tRecipe.mSpecialValue); // Calc fuel consumption + // Deplete that amount if (!depleteInput(tLiquid)) return false; boostEu = depleteInput(getBooster().getGas(2L * getAdditiveFactor())); - //Deplete Lubricant. 1000L should = 1 hour of runtime (if baseEU = 2048) - if ((mRuntime % 72 == 0 || mRuntime == 0) && !depleteInput(Materials.Lubricant.getFluid((boostEu ? 2L : 1L) * getAdditiveFactor()))) + // Deplete Lubricant. 1000L should = 1 hour of runtime (if baseEU = 2048) + if ((mRuntime % 72 == 0 || mRuntime == 0) + && !depleteInput(Materials.Lubricant.getFluid((boostEu ? 2L : 1L) * getAdditiveFactor()))) return false; fuelValue = tRecipe.mSpecialValue; - //Check to prevent burning HOG without consuming it, if not boosted - if (!boostEu && fuelValue > getNominalOutput()) { return false; } - fuelRemaining = tFluid.amount; //Record available fuel - this.mEUt = mEfficiency < 2000 ? 0 : getNominalOutput(); //Output 0 if startup is less than 20% + // Check to prevent burning HOG without consuming it, if not boosted + if (!boostEu && fuelValue > getNominalOutput()) { + return false; + } + fuelRemaining = tFluid.amount; // Record available fuel + this.mEUt = mEfficiency < 2000 ? 0 : getNominalOutput(); // Output 0 if startup is less than 20% this.mProgresstime = 1; this.mMaxProgresstime = 1; this.mEfficiencyIncrease = getEfficiencyIncrease(); @@ -212,7 +245,6 @@ public class GT_MetaTileEntity_DieselEngine extends GT_MetaTileEntity_EnhancedMu return false; } - @Override public IStructureDefinition<GT_MetaTileEntity_DieselEngine> getStructureDefinition() { return STRUCTURE_DEFINITION.get(getClass()); @@ -220,7 +252,9 @@ public class GT_MetaTileEntity_DieselEngine extends GT_MetaTileEntity_EnhancedMu @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { - return checkPiece(STRUCTURE_PIECE_MAIN, 1, 1, 1) && !mMufflerHatches.isEmpty() && mMaintenanceHatches.size() == 1; + return checkPiece(STRUCTURE_PIECE_MAIN, 1, 1, 1) + && !mMufflerHatches.isEmpty() + && mMaintenanceHatches.size() == 1; } public Block getCasingBlock() { @@ -252,7 +286,10 @@ public class GT_MetaTileEntity_DieselEngine extends GT_MetaTileEntity_EnhancedMu } private boolean addToMachineList(IGregTechTileEntity tTileEntity) { - return ((addMaintenanceToMachineList(tTileEntity, getCasingTextureIndex())) || (addInputToMachineList(tTileEntity, getCasingTextureIndex())) || (addOutputToMachineList(tTileEntity, getCasingTextureIndex())) || (addMufflerToMachineList(tTileEntity, getCasingTextureIndex()))); + return ((addMaintenanceToMachineList(tTileEntity, getCasingTextureIndex())) + || (addInputToMachineList(tTileEntity, getCasingTextureIndex())) + || (addOutputToMachineList(tTileEntity, getCasingTextureIndex())) + || (addMufflerToMachineList(tTileEntity, getCasingTextureIndex()))); } @Override @@ -292,44 +329,47 @@ public class GT_MetaTileEntity_DieselEngine extends GT_MetaTileEntity_EnhancedMu @Override public String[] getInfoData() { - int mPollutionReduction=0; + int mPollutionReduction = 0; for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) { if (isValidMetaTileEntity(tHatch)) { - mPollutionReduction=Math.max(tHatch.calculatePollutionReduction(100),mPollutionReduction); + mPollutionReduction = Math.max(tHatch.calculatePollutionReduction(100), mPollutionReduction); } } - long storedEnergy=0; - long maxEnergy=0; - for(GT_MetaTileEntity_Hatch_Dynamo tHatch : mDynamoHatches) { + long storedEnergy = 0; + long maxEnergy = 0; + for (GT_MetaTileEntity_Hatch_Dynamo tHatch : mDynamoHatches) { if (isValidMetaTileEntity(tHatch)) { - storedEnergy+=tHatch.getBaseMetaTileEntity().getStoredEU(); - maxEnergy+=tHatch.getBaseMetaTileEntity().getEUCapacity(); + storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU(); + maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity(); } } - - return new String[]{ - EnumChatFormatting.BLUE + "Diesel Engine" + EnumChatFormatting.RESET, - StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + - EnumChatFormatting.GREEN + GT_Utility.formatNumbers(storedEnergy) + EnumChatFormatting.RESET + " EU / " + - EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(maxEnergy) + EnumChatFormatting.RESET + " EU", - getIdealStatus() == getRepairStatus() ? - EnumChatFormatting.GREEN + StatCollector.translateToLocal("GT5U.turbine.maintenance.false") + EnumChatFormatting.RESET : - EnumChatFormatting.RED + StatCollector.translateToLocal("GT5U.turbine.maintenance.true") + EnumChatFormatting.RESET, - StatCollector.translateToLocal("GT5U.engine.output") + ": " + - EnumChatFormatting.RED + GT_Utility.formatNumbers((mEUt*mEfficiency/10000)) + EnumChatFormatting.RESET + " EU/t", - StatCollector.translateToLocal("GT5U.engine.consumption") + ": " + - EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(fuelConsumption) + EnumChatFormatting.RESET + " L/t", - StatCollector.translateToLocal("GT5U.engine.value") + ": " + - EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(fuelValue) + EnumChatFormatting.RESET + " EU/L", - StatCollector.translateToLocal("GT5U.turbine.fuel") + ": " + - EnumChatFormatting.GOLD + GT_Utility.formatNumbers(fuelRemaining) + EnumChatFormatting.RESET + " L", - StatCollector.translateToLocal("GT5U.engine.efficiency") + ": " + - EnumChatFormatting.YELLOW + (mEfficiency/100F) + EnumChatFormatting.YELLOW + " %", - StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + - EnumChatFormatting.GREEN + mPollutionReduction + EnumChatFormatting.RESET + " %" - + return new String[] { + EnumChatFormatting.BLUE + "Diesel Engine" + EnumChatFormatting.RESET, + StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(storedEnergy) + EnumChatFormatting.RESET + " EU / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(maxEnergy) + EnumChatFormatting.RESET + " EU", + getIdealStatus() == getRepairStatus() + ? EnumChatFormatting.GREEN + + StatCollector.translateToLocal("GT5U.turbine.maintenance.false") + + EnumChatFormatting.RESET + : EnumChatFormatting.RED + + StatCollector.translateToLocal("GT5U.turbine.maintenance.true") + + EnumChatFormatting.RESET, + StatCollector.translateToLocal("GT5U.engine.output") + ": " + EnumChatFormatting.RED + + GT_Utility.formatNumbers((mEUt * mEfficiency / 10000)) + EnumChatFormatting.RESET + " EU/t", + StatCollector.translateToLocal("GT5U.engine.consumption") + ": " + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(fuelConsumption) + EnumChatFormatting.RESET + " L/t", + StatCollector.translateToLocal("GT5U.engine.value") + ": " + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(fuelValue) + EnumChatFormatting.RESET + " EU/L", + StatCollector.translateToLocal("GT5U.turbine.fuel") + ": " + EnumChatFormatting.GOLD + + GT_Utility.formatNumbers(fuelRemaining) + EnumChatFormatting.RESET + " L", + StatCollector.translateToLocal("GT5U.engine.efficiency") + ": " + EnumChatFormatting.YELLOW + + (mEfficiency / 100F) + EnumChatFormatting.YELLOW + " %", + StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + EnumChatFormatting.GREEN + + mPollutionReduction + EnumChatFormatting.RESET + " %" }; } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java index 867ffa6d02..6b00d693c5 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java @@ -1,5 +1,18 @@ package gregtech.common.tileentities.machines.multi; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.isAir; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; +import static gregtech.api.enums.GT_HatchElement.*; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_GLOW; +import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; + import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IItemSource; @@ -19,28 +32,16 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import java.util.ArrayList; +import java.util.List; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; -import java.util.ArrayList; -import java.util.List; - -import static com.gtnewhorizon.structurelib.structure.StructureUtility.isAir; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; -import static gregtech.api.enums.GT_HatchElement.*; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE_GLOW; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_GLOW; -import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; -import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; - -public class GT_MetaTileEntity_DistillationTower extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_DistillationTower> implements ISurvivalConstructable { +public class GT_MetaTileEntity_DistillationTower + extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_DistillationTower> + implements ISurvivalConstructable { protected static final int CASING_INDEX = 49; protected static final String STRUCTURE_PIECE_BASE = "base"; protected static final String STRUCTURE_PIECE_LAYER = "layer"; @@ -49,48 +50,65 @@ public class GT_MetaTileEntity_DistillationTower extends GT_MetaTileEntity_Enhan private static final IStructureDefinition<GT_MetaTileEntity_DistillationTower> STRUCTURE_DEFINITION; static { - IHatchElement<GT_MetaTileEntity_DistillationTower> layeredOutputHatch = OutputHatch - .withCount(GT_MetaTileEntity_DistillationTower::getCurrentLayerOutputHatchCount) - .withAdder(GT_MetaTileEntity_DistillationTower::addLayerOutputHatch); + IHatchElement<GT_MetaTileEntity_DistillationTower> layeredOutputHatch = OutputHatch.withCount( + GT_MetaTileEntity_DistillationTower::getCurrentLayerOutputHatchCount) + .withAdder(GT_MetaTileEntity_DistillationTower::addLayerOutputHatch); STRUCTURE_DEFINITION = StructureDefinition.<GT_MetaTileEntity_DistillationTower>builder() - .addShape(STRUCTURE_PIECE_BASE, transpose(new String[][]{ - {"b~b", "bbb", "bbb"}, - })) - .addShape(STRUCTURE_PIECE_LAYER, transpose(new String[][]{ - {"lll", "lcl", "lll"} - })) - .addShape(STRUCTURE_PIECE_LAYER_HINT, transpose(new String[][]{ - {"lll", "l-l", "lll"} - })) - .addShape(STRUCTURE_PIECE_TOP_HINT, transpose(new String[][]{ - {"lll", "lll", "lll"} - })) - .addElement('b', ofChain( - buildHatchAdder(GT_MetaTileEntity_DistillationTower.class) - .atLeast(Energy, OutputBus, InputHatch, InputBus, Maintenance) - .casingIndex(CASING_INDEX) - .dot(1) - .build(), - onElementPass(GT_MetaTileEntity_DistillationTower::onCasingFound, ofBlock(GregTech_API.sBlockCasings4, 1)) - )) - .addElement('l', ofChain( - buildHatchAdder(GT_MetaTileEntity_DistillationTower.class) - .atLeast(layeredOutputHatch) - .casingIndex(CASING_INDEX) - .dot(2) - .build(), - ofHatchAdder(GT_MetaTileEntity_DistillationTower::addEnergyInputToMachineList, CASING_INDEX, 2), - ofHatchAdder(GT_MetaTileEntity_DistillationTower::addLayerOutputHatch, CASING_INDEX, 2), - ofHatchAdder(GT_MetaTileEntity_DistillationTower::addMaintenanceToMachineList, CASING_INDEX, 2), - onElementPass(GT_MetaTileEntity_DistillationTower::onCasingFound, ofBlock(GregTech_API.sBlockCasings4, 1)) - )) - .addElement('c', ofChain( - onElementPass(t -> t.onTopLayerFound(false), ofHatchAdder(GT_MetaTileEntity_DistillationTower::addOutputToMachineList, CASING_INDEX, 3)), - onElementPass(t -> t.onTopLayerFound(false), ofHatchAdder(GT_MetaTileEntity_DistillationTower::addMaintenanceToMachineList, CASING_INDEX, 3)), - onElementPass(t -> t.onTopLayerFound(true), ofBlock(GregTech_API.sBlockCasings4, 1)), - isAir() - )) - .build(); + .addShape(STRUCTURE_PIECE_BASE, transpose(new String[][] { + {"b~b", "bbb", "bbb"}, + })) + .addShape(STRUCTURE_PIECE_LAYER, transpose(new String[][] {{"lll", "lcl", "lll"}})) + .addShape(STRUCTURE_PIECE_LAYER_HINT, transpose(new String[][] {{"lll", "l-l", "lll"}})) + .addShape(STRUCTURE_PIECE_TOP_HINT, transpose(new String[][] {{"lll", "lll", "lll"}})) + .addElement( + 'b', + ofChain( + buildHatchAdder(GT_MetaTileEntity_DistillationTower.class) + .atLeast(Energy, OutputBus, InputHatch, InputBus, Maintenance) + .casingIndex(CASING_INDEX) + .dot(1) + .build(), + onElementPass( + GT_MetaTileEntity_DistillationTower::onCasingFound, + ofBlock(GregTech_API.sBlockCasings4, 1)))) + .addElement( + 'l', + ofChain( + buildHatchAdder(GT_MetaTileEntity_DistillationTower.class) + .atLeast(layeredOutputHatch) + .casingIndex(CASING_INDEX) + .dot(2) + .build(), + ofHatchAdder( + GT_MetaTileEntity_DistillationTower::addEnergyInputToMachineList, + CASING_INDEX, + 2), + ofHatchAdder(GT_MetaTileEntity_DistillationTower::addLayerOutputHatch, CASING_INDEX, 2), + ofHatchAdder( + GT_MetaTileEntity_DistillationTower::addMaintenanceToMachineList, + CASING_INDEX, + 2), + onElementPass( + GT_MetaTileEntity_DistillationTower::onCasingFound, + ofBlock(GregTech_API.sBlockCasings4, 1)))) + .addElement( + 'c', + ofChain( + onElementPass( + t -> t.onTopLayerFound(false), + ofHatchAdder( + GT_MetaTileEntity_DistillationTower::addOutputToMachineList, + CASING_INDEX, + 3)), + onElementPass( + t -> t.onTopLayerFound(false), + ofHatchAdder( + GT_MetaTileEntity_DistillationTower::addMaintenanceToMachineList, + CASING_INDEX, + 3)), + onElementPass(t -> t.onTopLayerFound(true), ofBlock(GregTech_API.sBlockCasings4, 1)), + isAir())) + .build(); } protected final List<List<GT_MetaTileEntity_Hatch_Output>> mOutputHatchesByLayer = new ArrayList<>(); @@ -115,41 +133,64 @@ public class GT_MetaTileEntity_DistillationTower extends GT_MetaTileEntity_Enhan protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Distillery") - .addInfo("Controller block for the Distillation Tower") - .addInfo("Fluids are only put out at the correct height") - .addInfo("The correct height equals the slot number in the NEI recipe") - .addSeparator() - .beginVariableStructureBlock(3, 3, 3, 12, 3, 3, true) - .addController("Front bottom") - .addOtherStructurePart("Clean Stainless Steel Machine Casing", "7 x h - 5 (minimum)") - .addEnergyHatch("Any casing", 1, 2) - .addMaintenanceHatch("Any casing", 1, 2, 3) - .addInputHatch("Any bottom layer casing", 1) - .addOutputBus("Any bottom layer casing", 1) - .addOutputHatch("2-11x Output Hatches (At least one per layer except bottom layer)", 2, 3) - .toolTipFinisher("Gregtech"); + .addInfo("Controller block for the Distillation Tower") + .addInfo("Fluids are only put out at the correct height") + .addInfo("The correct height equals the slot number in the NEI recipe") + .addSeparator() + .beginVariableStructureBlock(3, 3, 3, 12, 3, 3, true) + .addController("Front bottom") + .addOtherStructurePart("Clean Stainless Steel Machine Casing", "7 x h - 5 (minimum)") + .addEnergyHatch("Any casing", 1, 2) + .addMaintenanceHatch("Any casing", 1, 2, 3) + .addInputHatch("Any bottom layer casing", 1) + .addOutputBus("Any bottom layer casing", 1) + .addOutputHatch("2-11x Output Hatches (At least one per layer except bottom layer)", 2, 3) + .toolTipFinisher("Gregtech"); return tt; } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { if (aSide == aFacing) { if (aActive) - return new ITexture[]{ + return new ITexture[] { BlockIcons.getCasingTextureForId(CASING_INDEX), - TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE_GLOW).extFacing().glow().build()}; - return new ITexture[]{ + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE_GLOW) + .extFacing() + .glow() + .build() + }; + return new ITexture[] { BlockIcons.getCasingTextureForId(CASING_INDEX), - TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_GLOW).extFacing().glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_GLOW) + .extFacing() + .glow() + .build() + }; } - return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(CASING_INDEX)}; + return new ITexture[] {Textures.BlockIcons.getCasingTextureForId(CASING_INDEX)}; } @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "DistillationTower.png"); + return new GT_GUIContainer_MultiMachine( + aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "DistillationTower.png"); } @Override @@ -203,20 +244,24 @@ public class GT_MetaTileEntity_DistillationTower extends GT_MetaTileEntity_Enhan FluidStack[] tFluids = tFluidList.toArray(new FluidStack[0]); if (tFluids.length > 0) { for (FluidStack tFluid : tFluids) { - tRecipe = GT_Recipe.GT_Recipe_Map.sDistillationRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], new FluidStack[]{tFluid}, inputs); + tRecipe = GT_Recipe.GT_Recipe_Map.sDistillationRecipes.findRecipe( + getBaseMetaTileEntity(), + false, + gregtech.api.enums.GT_Values.V[tTier], + new FluidStack[] {tFluid}, + inputs); if (tRecipe != null) { if (tRecipe.isRecipeInputEqual(true, tFluids, inputs)) { this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, 1, tVoltage); - //In case recipe is too OP for that machine - if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) - return false; + // In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return false; if (this.mEUt > 0) { this.mEUt = (-this.mEUt); } this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); - this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0)}; + this.mOutputItems = new ItemStack[] {tRecipe.getOutput(0)}; this.mOutputFluids = tRecipe.mFluidOutputs.clone(); updateSlots(); return true; @@ -234,19 +279,20 @@ public class GT_MetaTileEntity_DistillationTower extends GT_MetaTileEntity_Enhan protected void onTopLayerFound(boolean aIsCasing) { mTopLayerFound = true; - if (aIsCasing) - onCasingFound(); + if (aIsCasing) onCasingFound(); } protected int getCurrentLayerOutputHatchCount() { - return mOutputHatchesByLayer.size() < mHeight ? 0 : mOutputHatchesByLayer.get(mHeight - 1).size(); + return mOutputHatchesByLayer.size() < mHeight + ? 0 + : mOutputHatchesByLayer.get(mHeight - 1).size(); } protected boolean addLayerOutputHatch(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity == null || aTileEntity.isDead() || !(aTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Output)) - return false; - while (mOutputHatchesByLayer.size() < mHeight) - mOutputHatchesByLayer.add(new ArrayList<>()); + if (aTileEntity == null + || aTileEntity.isDead() + || !(aTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Output)) return false; + while (mOutputHatchesByLayer.size() < mHeight) mOutputHatchesByLayer.add(new ArrayList<>()); GT_MetaTileEntity_Hatch_Output tHatch = (GT_MetaTileEntity_Hatch_Output) aTileEntity.getMetaTileEntity(); tHatch.updateTexture(aBaseCasingIndex); return mOutputHatchesByLayer.get(mHeight - 1).add(tHatch); @@ -272,15 +318,15 @@ public class GT_MetaTileEntity_DistillationTower extends GT_MetaTileEntity_Enhan mCasing = 0; // check base - if (!checkPiece(STRUCTURE_PIECE_BASE, 1, 0, 0)) - return false; + if (!checkPiece(STRUCTURE_PIECE_BASE, 1, 0, 0)) return false; // check each layer while (mHeight < 12) { if (!checkPiece(STRUCTURE_PIECE_LAYER, 1, mHeight, 0)) { return false; } - if (mOutputHatchesByLayer.size() < mHeight || mOutputHatchesByLayer.get(mHeight - 1).isEmpty()) + if (mOutputHatchesByLayer.size() < mHeight + || mOutputHatchesByLayer.get(mHeight - 1).isEmpty()) // layer without output hatch return false; if (mTopLayerFound) { @@ -332,15 +378,18 @@ public class GT_MetaTileEntity_DistillationTower extends GT_MetaTileEntity_Enhan public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) { if (mMachine) return -1; mHeight = 0; - int built = survivialBuildPiece(STRUCTURE_PIECE_BASE, stackSize, 1, 0, 0, elementBudget, source, actor, false, true); + int built = survivialBuildPiece( + STRUCTURE_PIECE_BASE, stackSize, 1, 0, 0, elementBudget, source, actor, false, true); if (built >= 0) return built; int tTotalHeight = Math.min(12, stackSize.stackSize + 2); // min 2 output layer, so at least 1 + 2 height for (int i = 1; i < tTotalHeight - 1; i++) { mHeight = i; - built = survivialBuildPiece(STRUCTURE_PIECE_LAYER_HINT, stackSize, 1, i, 0, elementBudget, source, actor, false, true); + built = survivialBuildPiece( + STRUCTURE_PIECE_LAYER_HINT, stackSize, 1, i, 0, elementBudget, source, actor, false, true); if (built >= 0) return built; } mHeight = tTotalHeight; - return survivialBuildPiece(STRUCTURE_PIECE_TOP_HINT, stackSize, 1, tTotalHeight - 1, 0, elementBudget, source, actor, false, true); + return survivialBuildPiece( + STRUCTURE_PIECE_TOP_HINT, stackSize, 1, tTotalHeight - 1, 0, elementBudget, source, actor, false, true); } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DrillerBase.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DrillerBase.java index b98b1f7b81..0ec74e3a78 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DrillerBase.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DrillerBase.java @@ -1,5 +1,20 @@ package gregtech.common.tileentities.machines.multi; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.lazy; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; +import static gregtech.api.enums.GT_HatchElement.*; +import static gregtech.api.enums.GT_HatchElement.Muffler; +import static gregtech.api.enums.GT_HatchElement.OutputBus; +import static gregtech.api.enums.GT_Values.W; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ORE_DRILL; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ORE_DRILL_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ORE_DRILL_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ORE_DRILL_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.getCasingTextureForId; +import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; +import static gregtech.api.util.GT_StructureUtility.ofFrame; + import com.google.common.collect.ImmutableList; import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; @@ -18,9 +33,11 @@ import gregtech.api.metatileentity.implementations.*; import gregtech.api.objects.GT_ChunkManager; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_StructureUtility; import gregtech.api.util.GT_Utility; import gregtech.api.util.IGT_HatchAdder; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; @@ -32,59 +49,44 @@ import net.minecraft.world.ChunkCoordIntPair; import net.minecraftforge.common.util.FakePlayer; import net.minecraftforge.common.util.ForgeDirection; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import static com.gtnewhorizon.structurelib.structure.StructureUtility.lazy; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; -import static gregtech.api.enums.GT_HatchElement.*; -import static gregtech.api.enums.GT_HatchElement.Muffler; -import static gregtech.api.enums.GT_HatchElement.OutputBus; -import static gregtech.api.enums.GT_Values.W; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ORE_DRILL; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ORE_DRILL_ACTIVE; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ORE_DRILL_ACTIVE_GLOW; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ORE_DRILL_GLOW; -import static gregtech.api.enums.Textures.BlockIcons.getCasingTextureForId; -import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; -import static gregtech.api.util.GT_StructureUtility.ofFrame; -import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; - -public abstract class GT_MetaTileEntity_DrillerBase extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_DrillerBase> implements IChunkLoader, ISurvivalConstructable { +public abstract class GT_MetaTileEntity_DrillerBase + extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_DrillerBase> + implements IChunkLoader, ISurvivalConstructable { private static final ItemStack miningPipe = GT_ModHandler.getIC2Item("miningPipe", 0); private static final ItemStack miningPipeTip = GT_ModHandler.getIC2Item("miningPipeTip", 0); private static final Block miningPipeBlock = GT_Utility.getBlockFromStack(miningPipe); private static final Block miningPipeTipBlock = GT_Utility.getBlockFromStack(miningPipeTip); protected static final String STRUCTURE_PIECE_MAIN = "main"; - protected static final ClassValue<IStructureDefinition<GT_MetaTileEntity_DrillerBase>> STRUCTURE_DEFINITION = new ClassValue<IStructureDefinition<GT_MetaTileEntity_DrillerBase>>() { - @Override - protected IStructureDefinition<GT_MetaTileEntity_DrillerBase> computeValue(Class<?> type) { - return StructureDefinition.<GT_MetaTileEntity_DrillerBase>builder() - .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{ - {" ", " f ", " "}, - {" ", " f ", " "}, - {" ", " f ", " "}, - {" f ", "fcf", " f "}, - {" f ", "fcf", " f "}, - {" f ", "fcf", " f "}, - {"b~b", "bbb", "bbb"}, - })) - .addElement('f', lazy(t -> ofFrame(t.getFrameMaterial()))) - .addElement('c', lazy(t -> ofBlock(t.getCasingBlockItem().getBlock(), t.getCasingBlockItem().get(0).getItemDamage()))) - .addElement('b', lazy(t -> buildHatchAdder(GT_MetaTileEntity_DrillerBase.class) - .atLeastList(t.getAllowedHatches()) - .casingIndex(t.casingTextureIndex) - .dot(1) - .buildAndChain( - t.getCasingBlockItem().getBlock(), t.getCasingBlockItem().get(0).getItemDamage() - ) - )) - .build(); - } - }; + protected static final ClassValue<IStructureDefinition<GT_MetaTileEntity_DrillerBase>> STRUCTURE_DEFINITION = + new ClassValue<IStructureDefinition<GT_MetaTileEntity_DrillerBase>>() { + @Override + protected IStructureDefinition<GT_MetaTileEntity_DrillerBase> computeValue(Class<?> type) { + return StructureDefinition.<GT_MetaTileEntity_DrillerBase>builder() + .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][] { + {" ", " f ", " "}, + {" ", " f ", " "}, + {" ", " f ", " "}, + {" f ", "fcf", " f "}, + {" f ", "fcf", " f "}, + {" f ", "fcf", " f "}, + {"b~b", "bbb", "bbb"}, + })) + .addElement('f', lazy(t -> ofFrame(t.getFrameMaterial()))) + .addElement( + 'c', + lazy(t -> ofBlock( + t.getCasingBlockItem().getBlock(), + t.getCasingBlockItem().get(0).getItemDamage()))) + .addElement('b', lazy(t -> buildHatchAdder(GT_MetaTileEntity_DrillerBase.class) + .atLeastList(t.getAllowedHatches()) + .casingIndex(t.casingTextureIndex) + .dot(1) + .buildAndChain( + t.getCasingBlockItem().getBlock(), + t.getCasingBlockItem().get(0).getItemDamage()))) + .build(); + } + }; private Block casingBlock; private int casingMeta; @@ -95,8 +97,15 @@ public abstract class GT_MetaTileEntity_DrillerBase extends GT_MetaTileEntity_En private ForgeDirection back; private int xDrill, yDrill, zDrill, xPipe, zPipe, yHead; - protected int getXDrill() { return xDrill; } - protected int getZDrill() { return zDrill; } + + protected int getXDrill() { + return xDrill; + } + + protected int getZDrill() { + return zDrill; + } + protected int workState; protected static final int STATE_DOWNWARD = 0, STATE_AT_BOTTOM = 1, STATE_UPWARD = 2; @@ -118,24 +127,49 @@ public abstract class GT_MetaTileEntity_DrillerBase extends GT_MetaTileEntity_En casingBlock = getCasingBlockItem().getBlock(); casingMeta = getCasingBlockItem().get(0).getItemDamage(); int frameId = 4096 + getFrameMaterial().mMetaItemSubID; - frameMeta = GregTech_API.METATILEENTITIES[frameId] != null ? GregTech_API.METATILEENTITIES[frameId].getTileEntityBaseType() : W; + frameMeta = GregTech_API.METATILEENTITIES[frameId] != null + ? GregTech_API.METATILEENTITIES[frameId].getTileEntityBaseType() + : W; casingTextureIndex = getCasingTextureIndex(); workState = STATE_DOWNWARD; } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { if (aSide == aFacing) { - if (aActive) return new ITexture[]{ + if (aActive) + return new ITexture[] { getCasingTextureForId(casingTextureIndex), - TextureFactory.builder().addIcon(OVERLAY_FRONT_ORE_DRILL_ACTIVE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_ORE_DRILL_ACTIVE_GLOW).extFacing().glow().build()}; - return new ITexture[]{ - getCasingTextureForId(casingTextureIndex), - TextureFactory.builder().addIcon(OVERLAY_FRONT_ORE_DRILL).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_ORE_DRILL_GLOW).extFacing().glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ORE_DRILL_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ORE_DRILL_ACTIVE_GLOW) + .extFacing() + .glow() + .build() + }; + return new ITexture[] { + getCasingTextureForId(casingTextureIndex), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ORE_DRILL) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ORE_DRILL_GLOW) + .extFacing() + .glow() + .build() + }; } - return new ITexture[]{getCasingTextureForId(casingTextureIndex)}; + return new ITexture[] {getCasingTextureForId(casingTextureIndex)}; } @Override @@ -156,18 +190,23 @@ public abstract class GT_MetaTileEntity_DrillerBase extends GT_MetaTileEntity_En workState = aNBT.getInteger("workState"); if (aNBT.hasKey("isPickingPipes")) workState = aNBT.getBoolean("isPickingPipes") ? STATE_UPWARD : STATE_DOWNWARD; - if (aNBT.hasKey("chunkLoadingEnabled")) - mChunkLoadingEnabled = aNBT.getBoolean("chunkLoadingEnabled"); + if (aNBT.hasKey("chunkLoadingEnabled")) mChunkLoadingEnabled = aNBT.getBoolean("chunkLoadingEnabled"); if (aNBT.getBoolean("isChunkloading")) { - mCurrentChunk = new ChunkCoordIntPair(aNBT.getInteger("loadedChunkXPos"), aNBT.getInteger("loadedChunkZPos")); + mCurrentChunk = + new ChunkCoordIntPair(aNBT.getInteger("loadedChunkXPos"), aNBT.getInteger("loadedChunkZPos")); } } @Override - public boolean onSolderingToolRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onSolderingToolRightClick( + byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { if (aSide == getBaseMetaTileEntity().getFrontFacing()) { mChunkLoadingEnabled = !mChunkLoadingEnabled; - GT_Utility.sendChatToPlayer(aPlayer, mChunkLoadingEnabled ? GT_Utility.trans("502", "Mining chunk loading enabled") : GT_Utility.trans("503", "Mining chunk loading disabled")); + GT_Utility.sendChatToPlayer( + aPlayer, + mChunkLoadingEnabled + ? GT_Utility.trans("502", "Mining chunk loading enabled") + : GT_Utility.trans("503", "Mining chunk loading disabled")); return true; } return super.onSolderingToolRightClick(aSide, aWrenchingSide, aPlayer, aX, aY, aZ); @@ -175,25 +214,26 @@ public abstract class GT_MetaTileEntity_DrillerBase extends GT_MetaTileEntity_En @Override public void onRemoval() { - if (mChunkLoadingEnabled) - GT_ChunkManager.releaseTicket((TileEntity)getBaseMetaTileEntity()); + if (mChunkLoadingEnabled) GT_ChunkManager.releaseTicket((TileEntity) getBaseMetaTileEntity()); super.onRemoval(); } @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPostTick(aBaseMetaTileEntity, aTick); - if (aBaseMetaTileEntity.isServerSide() && mCurrentChunk != null && !mWorkChunkNeedsReload && !aBaseMetaTileEntity.isAllowedToWork()) { + if (aBaseMetaTileEntity.isServerSide() + && mCurrentChunk != null + && !mWorkChunkNeedsReload + && !aBaseMetaTileEntity.isAllowedToWork()) { // if machine has stopped, stop chunkloading - GT_ChunkManager.releaseTicket((TileEntity)aBaseMetaTileEntity); + GT_ChunkManager.releaseTicket((TileEntity) aBaseMetaTileEntity); mWorkChunkNeedsReload = true; } } protected boolean tryPickPipe() { - if (yHead == yDrill) - return isPickingPipes = false; - if (tryOutputPipe()){ + if (yHead == yDrill) return isPickingPipes = false; + if (tryOutputPipe()) { if (checkBlockAndMeta(xPipe, yHead + 1, zPipe, miningPipeBlock, W)) getBaseMetaTileEntity().getWorld().setBlock(xPipe, yHead + 1, zPipe, miningPipeTipBlock); getBaseMetaTileEntity().getWorld().setBlockToAir(xPipe, yHead, zPipe); @@ -212,7 +252,6 @@ public abstract class GT_MetaTileEntity_DrillerBase extends GT_MetaTileEntity_En return tryLowerPipeState(false) == 0; } - /** * @return 0 for succeeded, 1 for invalid block, 2 for not having mining pipes, 3 for event canceled. */ @@ -226,16 +265,24 @@ public abstract class GT_MetaTileEntity_DrillerBase extends GT_MetaTileEntity_En protected int tryLowerPipeState(boolean isSimulating) { if (!isHasMiningPipes()) return 2; switch (canLowerPipe()) { - case 1: return 1; - case 2: return 3; + case 1: + return 1; + case 2: + return 3; } Block b = getBaseMetaTileEntity().getBlock(xPipe, yHead - 1, zPipe); - if (b != miningPipeTipBlock && !GT_Utility.setBlockByFakePlayer(getFakePlayer(getBaseMetaTileEntity()), xPipe, yHead - 1, zPipe, miningPipeTipBlock, 0, isSimulating)) - return 3; + if (b != miningPipeTipBlock + && !GT_Utility.setBlockByFakePlayer( + getFakePlayer(getBaseMetaTileEntity()), + xPipe, + yHead - 1, + zPipe, + miningPipeTipBlock, + 0, + isSimulating)) return 3; if (!isSimulating) { - if (yHead != yDrill) - getBaseMetaTileEntity().getWorld().setBlock(xPipe, yHead, zPipe, miningPipeBlock); + if (yHead != yDrill) getBaseMetaTileEntity().getWorld().setBlock(xPipe, yHead, zPipe, miningPipeBlock); if (b != miningPipeBlock && b != miningPipeTipBlock) getBaseMetaTileEntity().decrStackSize(1, 1); } @@ -248,7 +295,7 @@ public abstract class GT_MetaTileEntity_DrillerBase extends GT_MetaTileEntity_En if (isHasMiningPipes(maxPipes)) return; ItemStack pipes = getStackInSlot(1); - if(pipes != null && !pipes.isItemEqual(miningPipe)) return; + if (pipes != null && !pipes.isItemEqual(miningPipe)) return; for (ItemStack storedItem : getStoredInputs()) { if (!storedItem.isItemEqual(miningPipe)) continue; @@ -268,7 +315,7 @@ public abstract class GT_MetaTileEntity_DrillerBase extends GT_MetaTileEntity_En updateSlots(); } - private boolean tryOutputPipe(){ + private boolean tryOutputPipe() { if (!getBaseMetaTileEntity().addStackToSlot(1, GT_Utility.copyAmount(1, miningPipe))) mOutputItems = new ItemStack[] {GT_Utility.copyAmount(1, miningPipe)}; return true; @@ -277,7 +324,7 @@ public abstract class GT_MetaTileEntity_DrillerBase extends GT_MetaTileEntity_En /** * @return 0 for available, 1 for invalid block, 2 for event canceled. */ - protected int canLowerPipe(){ + protected int canLowerPipe() { IGregTechTileEntity aBaseTile = getBaseMetaTileEntity(); if (yHead > 0 && GT_Utility.getBlockHardnessAt(aBaseTile.getWorld(), xPipe, yHead - 1, zPipe) >= 0) { return GT_Utility.eraseBlockByFakePlayer(getFakePlayer(aBaseTile), xPipe, yHead - 1, zPipe, true) ? 0 : 2; @@ -303,7 +350,7 @@ public abstract class GT_MetaTileEntity_DrillerBase extends GT_MetaTileEntity_En * @return if no pipes are present */ @Deprecated - protected boolean waitForPipes(){ + protected boolean waitForPipes() { return !isHasMiningPipes(); } @@ -316,23 +363,37 @@ public abstract class GT_MetaTileEntity_DrillerBase extends GT_MetaTileEntity_En return false; } - protected boolean workingDownward(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) { + protected boolean workingDownward( + ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) { switch (tryLowerPipeState()) { - case 2: mMaxProgresstime = 0; return false; - case 3: workState = STATE_UPWARD; return true; - case 1: workState = STATE_AT_BOTTOM; return true; - default: return true; + case 2: + mMaxProgresstime = 0; + return false; + case 3: + workState = STATE_UPWARD; + return true; + case 1: + workState = STATE_AT_BOTTOM; + return true; + default: + return true; } } - protected boolean workingAtBottom(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) { + protected boolean workingAtBottom( + ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) { switch (tryLowerPipeState(true)) { - case 0: workState = STATE_DOWNWARD; return true; - default: workState = STATE_UPWARD; return true; + case 0: + workState = STATE_DOWNWARD; + return true; + default: + workState = STATE_UPWARD; + return true; } } - protected boolean workingUpward(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) { + protected boolean workingUpward( + ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) { if (tryPickPipe()) { return true; } else { @@ -344,7 +405,7 @@ public abstract class GT_MetaTileEntity_DrillerBase extends GT_MetaTileEntity_En @Override public boolean checkRecipe(ItemStack aStack) { - //Public pipe actions + // Public pipe actions setElectricityStats(); int oldYHead = yHead; if (!checkPipesAndSetYHead() || !isEnergyEnough()) { @@ -377,7 +438,10 @@ public abstract class GT_MetaTileEntity_DrillerBase extends GT_MetaTileEntity_En @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { updateCoordinates(); - return checkPiece(STRUCTURE_PIECE_MAIN, 1, 6, 0) && checkHatches() && GT_Utility.getTier(getMaxInputVoltage()) >= getMinTier() && mMaintenanceHatches.size() == 1; + return checkPiece(STRUCTURE_PIECE_MAIN, 1, 6, 0) + && checkHatches() + && GT_Utility.getTier(getMaxInputVoltage()) >= getMinTier() + && mMaintenanceHatches.size() == 1; } private void updateCoordinates() { @@ -391,10 +455,10 @@ public abstract class GT_MetaTileEntity_DrillerBase extends GT_MetaTileEntity_En private boolean checkPipesAndSetYHead() { yHead = yDrill - 1; - while (checkBlockAndMeta(xPipe, yHead, zPipe, miningPipeBlock, W)) yHead--; //skip pipes - //is pipe tip OR is controller layer + while (checkBlockAndMeta(xPipe, yHead, zPipe, miningPipeBlock, W)) yHead--; // skip pipes + // is pipe tip OR is controller layer if (checkBlockAndMeta(xPipe, yHead, zPipe, miningPipeTipBlock, W) || ++yHead == yDrill) return true; - //pipe column is broken - try fix + // pipe column is broken - try fix getBaseMetaTileEntity().getWorld().setBlock(xPipe, yHead, zPipe, miningPipeTipBlock); return true; } @@ -403,7 +467,8 @@ public abstract class GT_MetaTileEntity_DrillerBase extends GT_MetaTileEntity_En protected boolean checkCasingBlock(int xOff, int yOff, int zOff) { return checkBlockAndMetaOffset(xOff, yOff, zOff, casingBlock, casingMeta); } - //meta of frame is getTileEntityBaseType; frame should be checked using its drops (possible a high weight operation) + // meta of frame is getTileEntityBaseType; frame should be checked using its drops (possible a high weight + // operation) @Deprecated protected boolean checkFrameBlock(int xOff, int yOff, int zOff) { return checkBlockAndMetaOffset(xOff, yOff, zOff, GregTech_API.sBlockMachines, frameMeta); @@ -465,11 +530,10 @@ public abstract class GT_MetaTileEntity_DrillerBase extends GT_MetaTileEntity_En protected abstract void setElectricityStats(); - public int getTotalConfigValue(){ + public int getTotalConfigValue() { int config = 0; ArrayList<ItemStack> tCircuitList = getDataItems(1); - for (ItemStack tCircuit : tCircuitList) - config += tCircuit.getItemDamage(); + for (ItemStack tCircuit : tCircuitList) config += tCircuit.getItemDamage(); return config; } @@ -478,7 +542,7 @@ public abstract class GT_MetaTileEntity_DrillerBase extends GT_MetaTileEntity_En /** * @param state using bitmask, 1 for IntegratedCircuit, 2 for DataStick, 4 for DataOrb */ - private boolean isCorrectDataItem(ItemStack aStack, int state){ + private boolean isCorrectDataItem(ItemStack aStack, int state) { if ((state & 1) != 0 && ItemList.Circuit_Integrated.isStackEqual(aStack, true, true)) return true; if ((state & 2) != 0 && ItemList.Tool_DataStick.isStackEqual(aStack, false, true)) return true; return (state & 4) != 0 && ItemList.Tool_DataOrb.isStackEqual(aStack, false, true); @@ -516,7 +580,9 @@ public abstract class GT_MetaTileEntity_DrillerBase extends GT_MetaTileEntity_En } @Override - public ChunkCoordIntPair getActiveChunk(){return mCurrentChunk;} + public ChunkCoordIntPair getActiveChunk() { + return mCurrentChunk; + } @Override public void construct(ItemStack stackSize, boolean hintsOnly) { @@ -530,7 +596,15 @@ public abstract class GT_MetaTileEntity_DrillerBase extends GT_MetaTileEntity_En } protected List<IHatchElement<? super GT_MetaTileEntity_DrillerBase>> getAllowedHatches() { - return ImmutableList.of(InputHatch, OutputHatch, InputBus, OutputBus, Muffler, Maintenance, Energy, DataHatchElement.DataAccess); + return ImmutableList.of( + InputHatch, + OutputHatch, + InputBus, + OutputBus, + Muffler, + Maintenance, + Energy, + DataHatchElement.DataAccess); } private enum DataHatchElement implements IHatchElement<GT_MetaTileEntity_DrillerBase> { diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java index 396bf78b34..a2d1dee4a1 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java @@ -1,5 +1,13 @@ package gregtech.common.tileentities.machines.multi; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; +import static gregtech.api.enums.GT_HatchElement.*; +import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.GT_Values.VN; +import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; +import static gregtech.api.util.GT_StructureUtility.ofCoil; + import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IItemSource; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; @@ -17,6 +25,7 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import java.util.ArrayList; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.InventoryPlayer; @@ -26,49 +35,55 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; import net.minecraftforge.fluids.FluidStack; -import java.util.ArrayList; - -import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; -import static gregtech.api.enums.GT_HatchElement.*; -import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.enums.GT_Values.VN; -import static gregtech.api.enums.Textures.BlockIcons.*; -import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; -import static gregtech.api.util.GT_StructureUtility.ofCoil; - -public class GT_MetaTileEntity_ElectricBlastFurnace extends GT_MetaTileEntity_AbstractMultiFurnace<GT_MetaTileEntity_ElectricBlastFurnace> implements ISurvivalConstructable { +public class GT_MetaTileEntity_ElectricBlastFurnace + extends GT_MetaTileEntity_AbstractMultiFurnace<GT_MetaTileEntity_ElectricBlastFurnace> + implements ISurvivalConstructable { private int mHeatingCapacity = 0; private boolean isBussesSeparate = false; protected final ArrayList<GT_MetaTileEntity_Hatch_Output> mPollutionOutputHatches = new ArrayList<>(); - protected final FluidStack[] pollutionFluidStacks = {Materials.CarbonDioxide.getGas(1000), - Materials.CarbonMonoxide.getGas(1000), Materials.SulfurDioxide.getGas(1000)}; + protected final FluidStack[] pollutionFluidStacks = { + Materials.CarbonDioxide.getGas(1000), + Materials.CarbonMonoxide.getGas(1000), + Materials.SulfurDioxide.getGas(1000) + }; protected static final int CASING_INDEX = 11; protected static final String STRUCTURE_PIECE_MAIN = "main"; - private static final IStructureDefinition<GT_MetaTileEntity_ElectricBlastFurnace> STRUCTURE_DEFINITION = StructureDefinition.<GT_MetaTileEntity_ElectricBlastFurnace>builder() - .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{ - {"ttt", "tmt", "ttt"}, - {"CCC", "C-C", "CCC",}, - {"CCC", "C-C", "CCC",}, - {"b~b", "bbb", "bbb"} - })) - .addElement('t', - buildHatchAdder(GT_MetaTileEntity_ElectricBlastFurnace.class) - .atLeast(OutputHatch.withAdder(GT_MetaTileEntity_ElectricBlastFurnace::addOutputHatchToTopList).withCount(t -> t.mPollutionOutputHatches.size())) - .casingIndex(CASING_INDEX) - .dot(1) - .buildAndChain(GregTech_API.sBlockCasings1, CASING_INDEX) - ) - .addElement('m', Muffler.newAny(CASING_INDEX, 2)) - .addElement('C', ofCoil(GT_MetaTileEntity_ElectricBlastFurnace::setCoilLevel, GT_MetaTileEntity_ElectricBlastFurnace::getCoilLevel)) - .addElement('b', - buildHatchAdder(GT_MetaTileEntity_ElectricBlastFurnace.class) - .atLeast(InputHatch, OutputHatch, InputBus, OutputBus, Maintenance, Energy) - .casingIndex(CASING_INDEX) - .dot(1) - .buildAndChain(GregTech_API.sBlockCasings1, CASING_INDEX) - ) - .build(); + private static final IStructureDefinition<GT_MetaTileEntity_ElectricBlastFurnace> STRUCTURE_DEFINITION = + StructureDefinition.<GT_MetaTileEntity_ElectricBlastFurnace>builder() + .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][] { + {"ttt", "tmt", "ttt"}, + { + "CCC", "C-C", "CCC", + }, + { + "CCC", "C-C", "CCC", + }, + {"b~b", "bbb", "bbb"} + })) + .addElement( + 't', + buildHatchAdder(GT_MetaTileEntity_ElectricBlastFurnace.class) + .atLeast(OutputHatch.withAdder( + GT_MetaTileEntity_ElectricBlastFurnace::addOutputHatchToTopList) + .withCount(t -> t.mPollutionOutputHatches.size())) + .casingIndex(CASING_INDEX) + .dot(1) + .buildAndChain(GregTech_API.sBlockCasings1, CASING_INDEX)) + .addElement('m', Muffler.newAny(CASING_INDEX, 2)) + .addElement( + 'C', + ofCoil( + GT_MetaTileEntity_ElectricBlastFurnace::setCoilLevel, + GT_MetaTileEntity_ElectricBlastFurnace::getCoilLevel)) + .addElement( + 'b', + buildHatchAdder(GT_MetaTileEntity_ElectricBlastFurnace.class) + .atLeast(InputHatch, OutputHatch, InputBus, OutputBus, Maintenance, Energy) + .casingIndex(CASING_INDEX) + .dot(1) + .buildAndChain(GregTech_API.sBlockCasings1, CASING_INDEX)) + .build(); public GT_MetaTileEntity_ElectricBlastFurnace(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -91,7 +106,8 @@ public class GT_MetaTileEntity_ElectricBlastFurnace extends GT_MetaTileEntity_Ab .addInfo("You can use some fluids to reduce recipe time. Place the circuit in the Input Bus") .addInfo("Each 900K over the min. Heat required reduces power consumption by 5% (multiplicatively)") .addInfo("Each 1800K over the min. Heat required grants one perfect overclock") - .addInfo("For each perfect overclock the EBF will reduce recipe time 4 times (instead of 2) (100% efficiency)") + .addInfo( + "For each perfect overclock the EBF will reduce recipe time 4 times (instead of 2) (100% efficiency)") .addInfo("Additionally gives +100K for every tier past MV") .addPollutionAmount(getPollutionPerSecond(null)) .addSeparator() @@ -113,28 +129,51 @@ public class GT_MetaTileEntity_ElectricBlastFurnace extends GT_MetaTileEntity_Ab } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { if (aSide == aFacing) { if (aActive) - return new ITexture[]{ - casingTexturePages[0][CASING_INDEX], - TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE_GLOW).extFacing().glow().build()}; - return new ITexture[]{ + return new ITexture[] { casingTexturePages[0][CASING_INDEX], - TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_GLOW).extFacing().glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE_GLOW) + .extFacing() + .glow() + .build() + }; + return new ITexture[] { + casingTexturePages[0][CASING_INDEX], + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_GLOW) + .extFacing() + .glow() + .build() + }; } - return new ITexture[]{casingTexturePages[0][CASING_INDEX]}; + return new ITexture[] {casingTexturePages[0][CASING_INDEX]}; } @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "ElectricBlastFurnace.png"); + return new GT_GUIContainer_MultiMachine( + aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "ElectricBlastFurnace.png"); } @Override - public int getPollutionPerSecond(ItemStack aStack){ + public int getPollutionPerSecond(ItemStack aStack) { return GT_Mod.gregtechproxy.mPollutionEBFPerSecond; } @@ -155,7 +194,7 @@ public class GT_MetaTileEntity_ElectricBlastFurnace extends GT_MetaTileEntity_Ab @Override public boolean checkRecipe(ItemStack aStack) { - if(isBussesSeparate) { + if (isBussesSeparate) { FluidStack[] tFluids = getStoredFluids().toArray(new FluidStack[0]); for (GT_MetaTileEntity_Hatch_InputBus tBus : mInputBusses) { ArrayList<ItemStack> tInputs = new ArrayList<>(); @@ -177,32 +216,22 @@ public class GT_MetaTileEntity_ElectricBlastFurnace extends GT_MetaTileEntity_Ab } else { return processRecipe(getCompactedInputs(), getCompactedFluids()); } - } + protected boolean processRecipe(ItemStack[] tItems, FluidStack[] tFluids) { - if (tItems.length <= 0) - return false; + if (tItems.length <= 0) return false; long tVoltage = getMaxInputVoltage(); byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe( - getBaseMetaTileEntity(), - false, - V[tTier], - tFluids, - tItems - ); - - if (tRecipe == null) - return false; - if (this.mHeatingCapacity < tRecipe.mSpecialValue) - return false; - if (!tRecipe.isRecipeInputEqual(true, tFluids, tItems)) - return false; - //In case recipe is too OP for that machine - if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) - return false; + getBaseMetaTileEntity(), false, V[tTier], tFluids, tItems); + + if (tRecipe == null) return false; + if (this.mHeatingCapacity < tRecipe.mSpecialValue) return false; + if (!tRecipe.isRecipeInputEqual(true, tFluids, tItems)) return false; + // In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return false; this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; @@ -214,18 +243,13 @@ public class GT_MetaTileEntity_ElectricBlastFurnace extends GT_MetaTileEntity_Ab } if (tHeatCapacityDivTiers > 0) { this.mEUt = (int) (this.mEUt * (Math.pow(0.95, tHeatCapacityDivTiers))); - this.mMaxProgresstime >>= Math.min(tHeatCapacityDivTiers / 2, overclockCount);//extra free overclocking if possible - if (this.mMaxProgresstime < 1) - this.mMaxProgresstime = 1;//no eu efficiency correction + this.mMaxProgresstime >>= + Math.min(tHeatCapacityDivTiers / 2, overclockCount); // extra free overclocking if possible + if (this.mMaxProgresstime < 1) this.mMaxProgresstime = 1; // no eu efficiency correction } this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); - this.mOutputItems = new ItemStack[]{ - tRecipe.getOutput(0), - tRecipe.getOutput(1) - }; - this.mOutputFluids = new FluidStack[]{ - tRecipe.getFluidOutput(0) - }; + this.mOutputItems = new ItemStack[] {tRecipe.getOutput(0), tRecipe.getOutput(1)}; + this.mOutputFluids = new FluidStack[] {tRecipe.getFluidOutput(0)}; updateSlots(); return true; } @@ -238,30 +262,32 @@ public class GT_MetaTileEntity_ElectricBlastFurnace extends GT_MetaTileEntity_Ab protected byte calculateOverclockednessEBF(int aEUt, int aDuration, long maxInputVoltage) { byte mTier = (byte) Math.max(0, GT_Utility.getTier(maxInputVoltage)), timesOverclocked = 0; if (mTier == 0) { - //Long time calculation + // Long time calculation long xMaxProgresstime = ((long) aDuration) << 1; if (xMaxProgresstime > Integer.MAX_VALUE - 1) { - //make impossible if too long + // make impossible if too long mEUt = Integer.MAX_VALUE - 1; mMaxProgresstime = Integer.MAX_VALUE - 1; } else { mEUt = aEUt >> 2; mMaxProgresstime = (int) xMaxProgresstime; } - //return 0; + // return 0; } else { - //Long EUt calculation + // Long EUt calculation long xEUt = aEUt; - //Isnt too low EUt check? + // Isnt too low EUt check? long tempEUt = Math.max(xEUt, V[1]); mMaxProgresstime = aDuration; while (tempEUt <= V[mTier - 1]) { - tempEUt <<= 2;//this actually controls overclocking - //xEUt *= 4;//this is effect of everclocking - mMaxProgresstime >>= 1;//this is effect of overclocking - xEUt = mMaxProgresstime == 0 ? xEUt >> 1 : xEUt << 2;//U know, if the time is less than 1 tick make the machine use less power + tempEUt <<= 2; // this actually controls overclocking + // xEUt *= 4;//this is effect of everclocking + mMaxProgresstime >>= 1; // this is effect of overclocking + xEUt = mMaxProgresstime == 0 + ? xEUt >> 1 + : xEUt << 2; // U know, if the time is less than 1 tick make the machine use less power timesOverclocked++; } if (xEUt > Integer.MAX_VALUE - 1) { @@ -269,10 +295,8 @@ public class GT_MetaTileEntity_ElectricBlastFurnace extends GT_MetaTileEntity_Ab mMaxProgresstime = Integer.MAX_VALUE - 1; } else { mEUt = (int) xEUt; - if (mEUt == 0) - mEUt = 1; - if (mMaxProgresstime == 0) - mMaxProgresstime = 1;//set time to 1 tick + if (mEUt == 0) mEUt = 1; + if (mMaxProgresstime == 0) mMaxProgresstime = 1; // set time to 1 tick } } return timesOverclocked; @@ -297,14 +321,11 @@ public class GT_MetaTileEntity_ElectricBlastFurnace extends GT_MetaTileEntity_Ab mPollutionOutputHatches.clear(); - if (!checkPiece(STRUCTURE_PIECE_MAIN, 1, 3, 0)) - return false; + if (!checkPiece(STRUCTURE_PIECE_MAIN, 1, 3, 0)) return false; - if (getCoilLevel() == HeatingCoilLevel.None) - return false; + if (getCoilLevel() == HeatingCoilLevel.None) return false; - if (mMaintenanceHatches.size() != 1) - return false; + if (mMaintenanceHatches.size() != 1) return false; this.mHeatingCapacity = (int) getCoilLevel().getHeat() + 100 * (GT_Utility.getTier(getMaxInputVoltage()) - 2); return true; @@ -312,13 +333,11 @@ public class GT_MetaTileEntity_ElectricBlastFurnace extends GT_MetaTileEntity_Ab @Override public boolean addOutput(FluidStack aLiquid) { - if (aLiquid == null) - return false; + if (aLiquid == null) return false; FluidStack tLiquid = aLiquid.copy(); boolean isOutputPollution = false; for (FluidStack pollutionFluidStack : pollutionFluidStacks) { - if (!tLiquid.isFluidEqual(pollutionFluidStack)) - continue; + if (!tLiquid.isFluidEqual(pollutionFluidStack)) continue; isOutputPollution = true; break; @@ -328,8 +347,7 @@ public class GT_MetaTileEntity_ElectricBlastFurnace extends GT_MetaTileEntity_Ab tOutputHatches = this.mPollutionOutputHatches; int pollutionReduction = 0; for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) { - if (!isValidMetaTileEntity(tHatch)) - continue; + if (!isValidMetaTileEntity(tHatch)) continue; pollutionReduction = 100 - tHatch.calculatePollutionReduction(100); break; } @@ -337,55 +355,56 @@ public class GT_MetaTileEntity_ElectricBlastFurnace extends GT_MetaTileEntity_Ab } else { tOutputHatches = this.mOutputHatches; } - return dumpFluid(tOutputHatches, tLiquid, true) || - dumpFluid(tOutputHatches, tLiquid, false); + return dumpFluid(tOutputHatches, tLiquid, true) || dumpFluid(tOutputHatches, tLiquid, false); } @Override public String[] getInfoData() { int mPollutionReduction = 0; for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) { - if (!isValidMetaTileEntity(tHatch)) - continue; + if (!isValidMetaTileEntity(tHatch)) continue; mPollutionReduction = Math.max(tHatch.calculatePollutionReduction(100), mPollutionReduction); } long storedEnergy = 0; long maxEnergy = 0; for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) { - if (!isValidMetaTileEntity(tHatch)) - continue; + if (!isValidMetaTileEntity(tHatch)) continue; storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU(); maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity(); } - return new String[]{ - StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + - EnumChatFormatting.GREEN + GT_Utility.formatNumbers(mProgresstime / 20) + EnumChatFormatting.RESET + " s / " + - EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(mMaxProgresstime / 20) + EnumChatFormatting.RESET + " s", - StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + - EnumChatFormatting.GREEN + GT_Utility.formatNumbers(storedEnergy) + EnumChatFormatting.RESET + " EU / " + - EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(maxEnergy) + EnumChatFormatting.RESET + " EU", - StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + - EnumChatFormatting.RED + GT_Utility.formatNumbers(-mEUt) + EnumChatFormatting.RESET + " EU/t", - StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + - EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(getMaxInputVoltage()) + EnumChatFormatting.RESET + " EU/t(*2A) " + - StatCollector.translateToLocal("GT5U.machines.tier") + ": " + - EnumChatFormatting.YELLOW + VN[GT_Utility.getTier(getMaxInputVoltage())] + EnumChatFormatting.RESET, - StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + - EnumChatFormatting.RED + (getIdealStatus() - getRepairStatus()) + EnumChatFormatting.RESET + " " + - StatCollector.translateToLocal("GT5U.multiblock.efficiency") + ": " + - EnumChatFormatting.YELLOW + mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", - StatCollector.translateToLocal("GT5U.EBF.heat") + ": " + - EnumChatFormatting.GREEN + GT_Utility.formatNumbers(mHeatingCapacity) + EnumChatFormatting.RESET + " K", - StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + - EnumChatFormatting.GREEN + mPollutionReduction + EnumChatFormatting.RESET + " %" + return new String[] { + StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(mProgresstime / 20) + EnumChatFormatting.RESET + " s / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(mMaxProgresstime / 20) + EnumChatFormatting.RESET + " s", + StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(storedEnergy) + EnumChatFormatting.RESET + " EU / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(maxEnergy) + EnumChatFormatting.RESET + " EU", + StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + EnumChatFormatting.RED + + GT_Utility.formatNumbers(-mEUt) + EnumChatFormatting.RESET + " EU/t", + StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(getMaxInputVoltage()) + EnumChatFormatting.RESET + " EU/t(*2A) " + + StatCollector.translateToLocal("GT5U.machines.tier") + + ": " + EnumChatFormatting.YELLOW + + VN[GT_Utility.getTier(getMaxInputVoltage())] + EnumChatFormatting.RESET, + StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + EnumChatFormatting.RED + + (getIdealStatus() - getRepairStatus()) + EnumChatFormatting.RESET + " " + + StatCollector.translateToLocal("GT5U.multiblock.efficiency") + + ": " + EnumChatFormatting.YELLOW + + mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", + StatCollector.translateToLocal("GT5U.EBF.heat") + ": " + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(mHeatingCapacity) + EnumChatFormatting.RESET + " K", + StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + EnumChatFormatting.GREEN + + mPollutionReduction + EnumChatFormatting.RESET + " %" }; } @Override public void construct(ItemStack stackSize, boolean hintsOnly) { - buildPiece(STRUCTURE_PIECE_MAIN, stackSize, hintsOnly, 1,3,0); + buildPiece(STRUCTURE_PIECE_MAIN, stackSize, hintsOnly, 1, 3, 0); } @Override @@ -397,7 +416,8 @@ public class GT_MetaTileEntity_ElectricBlastFurnace extends GT_MetaTileEntity_Ab @Override public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { isBussesSeparate = !isBussesSeparate; - GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + isBussesSeparate); + GT_Utility.sendChatToPlayer( + aPlayer, StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + isBussesSeparate); } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java index e618457d9a..5b9979dbb5 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java @@ -1,5 +1,11 @@ package gregtech.common.tileentities.machines.multi; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_EXTREME_DIESEL_ENGINE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_EXTREME_DIESEL_ENGINE_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_EXTREME_DIESEL_ENGINE_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_EXTREME_DIESEL_ENGINE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages; + import gregtech.GT_Mod; import gregtech.api.GregTech_API; import gregtech.api.enums.Materials; @@ -19,18 +25,12 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_EXTREME_DIESEL_ENGINE; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_EXTREME_DIESEL_ENGINE_ACTIVE; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_EXTREME_DIESEL_ENGINE_ACTIVE_GLOW; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_EXTREME_DIESEL_ENGINE_GLOW; -import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages; - public class GT_MetaTileEntity_ExtremeDieselEngine extends GT_MetaTileEntity_DieselEngine { public GT_MetaTileEntity_ExtremeDieselEngine(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); } - + public GT_MetaTileEntity_ExtremeDieselEngine(String aName) { super(aName); } @@ -69,23 +69,47 @@ public class GT_MetaTileEntity_ExtremeDieselEngine extends GT_MetaTileEntity_Die } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { if (aSide == aFacing) { - if (aActive) return new ITexture[]{ + if (aActive) + return new ITexture[] { casingTexturePages[0][60], - TextureFactory.builder().addIcon(OVERLAY_FRONT_EXTREME_DIESEL_ENGINE_ACTIVE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_EXTREME_DIESEL_ENGINE_ACTIVE_GLOW).extFacing().glow().build()}; - return new ITexture[]{ - casingTexturePages[0][60], - TextureFactory.builder().addIcon(OVERLAY_FRONT_EXTREME_DIESEL_ENGINE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_EXTREME_DIESEL_ENGINE_GLOW).extFacing().glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_EXTREME_DIESEL_ENGINE_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_EXTREME_DIESEL_ENGINE_ACTIVE_GLOW) + .extFacing() + .glow() + .build() + }; + return new ITexture[] { + casingTexturePages[0][60], + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_EXTREME_DIESEL_ENGINE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_EXTREME_DIESEL_ENGINE_GLOW) + .extFacing() + .glow() + .build() + }; } - return new ITexture[]{casingTexturePages[0][60]}; + return new ITexture[] {casingTexturePages[0][60]}; } @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "LargeExtremeDieselEngine.png"); + return new GT_GUIContainer_MultiMachine( + aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "LargeExtremeDieselEngine.png"); } @Override @@ -134,7 +158,9 @@ public class GT_MetaTileEntity_ExtremeDieselEngine extends GT_MetaTileEntity_Die } @Override - protected int getBoostFactor() { return 2; } + protected int getBoostFactor() { + return 2; + } @Override protected Materials getBooster() { @@ -163,42 +189,47 @@ public class GT_MetaTileEntity_ExtremeDieselEngine extends GT_MetaTileEntity_Die @Override public String[] getInfoData() { - int mPollutionReduction=0; + int mPollutionReduction = 0; for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) { if (isValidMetaTileEntity(tHatch)) { - mPollutionReduction=Math.max(tHatch.calculatePollutionReduction(100),mPollutionReduction); + mPollutionReduction = Math.max(tHatch.calculatePollutionReduction(100), mPollutionReduction); } } - long storedEnergy=0; - long maxEnergy=0; - for(GT_MetaTileEntity_Hatch_Dynamo tHatch : mDynamoHatches) { + long storedEnergy = 0; + long maxEnergy = 0; + for (GT_MetaTileEntity_Hatch_Dynamo tHatch : mDynamoHatches) { if (isValidMetaTileEntity(tHatch)) { - storedEnergy+=tHatch.getBaseMetaTileEntity().getStoredEU(); - maxEnergy+=tHatch.getBaseMetaTileEntity().getEUCapacity(); + storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU(); + maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity(); } } - - return new String[]{ - EnumChatFormatting.BLUE + "Extreme Diesel Engine" + EnumChatFormatting.RESET, - StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + - EnumChatFormatting.GREEN + GT_Utility.formatNumbers(storedEnergy) + EnumChatFormatting.RESET + " EU / " + - EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(maxEnergy) + EnumChatFormatting.RESET + " EU", - getIdealStatus() == getRepairStatus() ? - EnumChatFormatting.GREEN + StatCollector.translateToLocal("GT5U.turbine.maintenance.false") + EnumChatFormatting.RESET : - EnumChatFormatting.RED + StatCollector.translateToLocal("GT5U.turbine.maintenance.true") + EnumChatFormatting.RESET, - StatCollector.translateToLocal("GT5U.engine.output") + ": " + - EnumChatFormatting.RED + GT_Utility.formatNumbers(-mEUt*mEfficiency/10000) + EnumChatFormatting.RESET + " EU/t", - StatCollector.translateToLocal("GT5U.engine.consumption") + ": " + - EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(fuelConsumption) + EnumChatFormatting.RESET + " L/t", - StatCollector.translateToLocal("GT5U.engine.value") + ": " + - EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(fuelValue) + EnumChatFormatting.RESET + " EU/L", - StatCollector.translateToLocal("GT5U.turbine.fuel") + ": " + - EnumChatFormatting.GOLD + GT_Utility.formatNumbers(fuelRemaining) + EnumChatFormatting.RESET + " L", - StatCollector.translateToLocal("GT5U.engine.efficiency") + ": " + - EnumChatFormatting.YELLOW + (mEfficiency/100F) + EnumChatFormatting.YELLOW + " %", - StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + - EnumChatFormatting.GREEN + mPollutionReduction + EnumChatFormatting.RESET + " %" + + return new String[] { + EnumChatFormatting.BLUE + "Extreme Diesel Engine" + EnumChatFormatting.RESET, + StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(storedEnergy) + EnumChatFormatting.RESET + " EU / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(maxEnergy) + EnumChatFormatting.RESET + " EU", + getIdealStatus() == getRepairStatus() + ? EnumChatFormatting.GREEN + + StatCollector.translateToLocal("GT5U.turbine.maintenance.false") + + EnumChatFormatting.RESET + : EnumChatFormatting.RED + + StatCollector.translateToLocal("GT5U.turbine.maintenance.true") + + EnumChatFormatting.RESET, + StatCollector.translateToLocal("GT5U.engine.output") + ": " + EnumChatFormatting.RED + + GT_Utility.formatNumbers(-mEUt * mEfficiency / 10000) + EnumChatFormatting.RESET + " EU/t", + StatCollector.translateToLocal("GT5U.engine.consumption") + ": " + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(fuelConsumption) + EnumChatFormatting.RESET + " L/t", + StatCollector.translateToLocal("GT5U.engine.value") + ": " + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(fuelValue) + EnumChatFormatting.RESET + " EU/L", + StatCollector.translateToLocal("GT5U.turbine.fuel") + ": " + EnumChatFormatting.GOLD + + GT_Utility.formatNumbers(fuelRemaining) + EnumChatFormatting.RESET + " L", + StatCollector.translateToLocal("GT5U.engine.efficiency") + ": " + EnumChatFormatting.YELLOW + + (mEfficiency / 100F) + EnumChatFormatting.YELLOW + " %", + StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + EnumChatFormatting.GREEN + + mPollutionReduction + EnumChatFormatting.RESET + " %" }; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java index 30f8ff8746..4e708065bd 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java @@ -1,5 +1,17 @@ package gregtech.common.tileentities.machines.multi; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.lazy; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; +import static gregtech.api.enums.GT_HatchElement.Energy; +import static gregtech.api.enums.GT_HatchElement.InputHatch; +import static gregtech.api.enums.GT_HatchElement.OutputHatch; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW; +import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; +import static gregtech.api.util.GT_StructureUtility.filterByMTETier; + import com.google.common.collect.ImmutableMap; import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IItemSource; @@ -20,6 +32,7 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.gui.GT_GUIContainer_FusionReactor; +import java.util.ArrayList; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.InventoryPlayer; @@ -29,28 +42,17 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; import net.minecraftforge.fluids.FluidStack; -import java.util.ArrayList; - -import static com.gtnewhorizon.structurelib.structure.StructureUtility.lazy; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; -import static gregtech.api.enums.GT_HatchElement.Energy; -import static gregtech.api.enums.GT_HatchElement.InputHatch; -import static gregtech.api.enums.GT_HatchElement.OutputHatch; -import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS; -import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW; -import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW; -import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; -import static gregtech.api.util.GT_StructureUtility.filterByMTETier; - -public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_FusionComputer> implements ISurvivalConstructable { +public abstract class GT_MetaTileEntity_FusionComputer + extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_FusionComputer> + implements ISurvivalConstructable { public static final String STRUCTURE_PIECE_MAIN = "main"; - private static final ClassValue<IStructureDefinition<GT_MetaTileEntity_FusionComputer>> STRUCTURE_DEFINITION = new ClassValue<IStructureDefinition<GT_MetaTileEntity_FusionComputer>>() { - @Override - protected IStructureDefinition<GT_MetaTileEntity_FusionComputer> computeValue(Class<?> type) { - return StructureDefinition.<GT_MetaTileEntity_FusionComputer>builder() - .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{ - { + private static final ClassValue<IStructureDefinition<GT_MetaTileEntity_FusionComputer>> STRUCTURE_DEFINITION = + new ClassValue<IStructureDefinition<GT_MetaTileEntity_FusionComputer>>() { + @Override + protected IStructureDefinition<GT_MetaTileEntity_FusionComputer> computeValue(Class<?> type) { + return StructureDefinition.<GT_MetaTileEntity_FusionComputer>builder() + .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][] { + { " ", " ihi ", " hh hh ", @@ -66,8 +68,8 @@ public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity " hh hh ", " ihi ", " ", - }, - { + }, + { " xhx ", " hhccchh ", " eccxhxcce ", @@ -83,8 +85,8 @@ public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity " eccx~xcce ", " hhccchh ", " xhx ", - }, - { + }, + { " ", " ihi ", " hh hh ", @@ -100,46 +102,49 @@ public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity " hh hh ", " ihi ", " ", - } - })) - .addElement('c', lazy(t -> ofBlock(t.getFusionCoil(), t.getFusionCoilMeta()))) - .addElement('h', lazy(t -> ofBlock(t.getCasing(), t.getCasingMeta()))) - .addElement('i', lazy(t -> - buildHatchAdder(GT_MetaTileEntity_FusionComputer.class) - .atLeast(ImmutableMap.of(InputHatch.withAdder(GT_MetaTileEntity_FusionComputer::addInjector), 2)) - .hatchItemFilterAnd(t2 -> filterByMTETier(t2.tier(), Integer.MAX_VALUE)) - .casingIndex(53) - .dot(1) - .buildAndChain(t.getCasing(), t.getCasingMeta())) - ) - .addElement('e', lazy(t -> - buildHatchAdder(GT_MetaTileEntity_FusionComputer.class) - .atLeast(ImmutableMap.of(Energy.withAdder(GT_MetaTileEntity_FusionComputer::addEnergyInjector), 16)) - .hatchItemFilterAnd(t2 -> filterByMTETier(t2.tier(), Integer.MAX_VALUE)) - .casingIndex(53) - .dot(2) - .buildAndChain(t.getCasing(), t.getCasingMeta()) - )) - .addElement('x', lazy(t -> - buildHatchAdder(GT_MetaTileEntity_FusionComputer.class) - .atLeast(OutputHatch.withAdder(GT_MetaTileEntity_FusionComputer::addExtractor)) - .hatchItemFilterAnd(t2 -> filterByMTETier(t2.tier(), Integer.MAX_VALUE)) - .casingIndex(53) - .dot(3) - .buildAndChain(t.getCasing(), t.getCasingMeta()) - )) - .build(); - } - }; + } + })) + .addElement('c', lazy(t -> ofBlock(t.getFusionCoil(), t.getFusionCoilMeta()))) + .addElement('h', lazy(t -> ofBlock(t.getCasing(), t.getCasingMeta()))) + .addElement('i', lazy(t -> buildHatchAdder(GT_MetaTileEntity_FusionComputer.class) + .atLeast(ImmutableMap.of( + InputHatch.withAdder(GT_MetaTileEntity_FusionComputer::addInjector), 2)) + .hatchItemFilterAnd(t2 -> filterByMTETier(t2.tier(), Integer.MAX_VALUE)) + .casingIndex(53) + .dot(1) + .buildAndChain(t.getCasing(), t.getCasingMeta()))) + .addElement('e', lazy(t -> buildHatchAdder(GT_MetaTileEntity_FusionComputer.class) + .atLeast(ImmutableMap.of( + Energy.withAdder(GT_MetaTileEntity_FusionComputer::addEnergyInjector), 16)) + .hatchItemFilterAnd(t2 -> filterByMTETier(t2.tier(), Integer.MAX_VALUE)) + .casingIndex(53) + .dot(2) + .buildAndChain(t.getCasing(), t.getCasingMeta()))) + .addElement('x', lazy(t -> buildHatchAdder(GT_MetaTileEntity_FusionComputer.class) + .atLeast(OutputHatch.withAdder(GT_MetaTileEntity_FusionComputer::addExtractor)) + .hatchItemFilterAnd(t2 -> filterByMTETier(t2.tier(), Integer.MAX_VALUE)) + .casingIndex(53) + .dot(3) + .buildAndChain(t.getCasing(), t.getCasingMeta()))) + .build(); + } + }; public GT_Recipe mLastRecipe; public long mEUStore; static { - Textures.BlockIcons.setCasingTextureForId(52, + Textures.BlockIcons.setCasingTextureForId( + 52, TextureFactory.of( - TextureFactory.builder().addIcon(MACHINE_CASING_FUSION_GLASS_YELLOW).extFacing().build(), - TextureFactory.builder().addIcon(MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW).extFacing().glow().build() - )); + TextureFactory.builder() + .addIcon(MACHINE_CASING_FUSION_GLASS_YELLOW) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW) + .extFacing() + .glow() + .build())); } public GT_MetaTileEntity_FusionComputer(int aID, String aName, String aNameRegional, int tier) { @@ -162,7 +167,12 @@ public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_FusionReactor(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "FusionComputer.png", GT_Recipe.GT_Recipe_Map.sFusionRecipes.mNEIName); + return new GT_GUIContainer_FusionReactor( + aPlayerInventory, + aBaseMetaTileEntity, + getLocalName(), + "FusionComputer.png", + GT_Recipe.GT_Recipe_Map.sFusionRecipes.mNEIName); } @Override @@ -204,7 +214,10 @@ public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { - if (checkPiece(STRUCTURE_PIECE_MAIN, 7, 1, 12) && mInputHatches.size() > 1 && !mOutputHatches.isEmpty() && !mEnergyHatches.isEmpty()) { + if (checkPiece(STRUCTURE_PIECE_MAIN, 7, 1, 12) + && mInputHatches.size() > 1 + && !mOutputHatches.isEmpty() + && !mEnergyHatches.isEmpty()) { mWrench = true; mScrewdriver = true; mSoftHammer = true; @@ -257,10 +270,28 @@ public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity public abstract int getFusionCoilMeta(); @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - if (aSide == aFacing) return new ITexture[]{TextureFactory.builder().addIcon(MACHINE_CASING_FUSION_GLASS).extFacing().build(), getTextureOverlay()}; - if (aActive) return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(52)}; - return new ITexture[]{TextureFactory.builder().addIcon(MACHINE_CASING_FUSION_GLASS).extFacing().build()}; + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { + if (aSide == aFacing) + return new ITexture[] { + TextureFactory.builder() + .addIcon(MACHINE_CASING_FUSION_GLASS) + .extFacing() + .build(), + getTextureOverlay() + }; + if (aActive) return new ITexture[] {Textures.BlockIcons.getCasingTextureForId(52)}; + return new ITexture[] { + TextureFactory.builder() + .addIcon(MACHINE_CASING_FUSION_GLASS) + .extFacing() + .build() + }; } /** @@ -281,22 +312,24 @@ public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity return mStartEnergy < 160000000 ? 2 : 1; } if (this.tierOverclock() == 4) { - return (mStartEnergy < 160000000 ? 4 : (mStartEnergy < 320000000 ? 2 : 1)); - } + return (mStartEnergy < 160000000 ? 4 : (mStartEnergy < 320000000 ? 2 : 1)); + } return (mStartEnergy < 160000000) ? 8 : ((mStartEnergy < 320000000) ? 4 : (mStartEnergy < 640000000) ? 2 : 1); } @Override public boolean checkRecipe(ItemStack aStack) { ArrayList<FluidStack> tFluidList = getStoredFluids(); - int tFluidList_sS=tFluidList.size(); + int tFluidList_sS = tFluidList.size(); for (int i = 0; i < tFluidList_sS - 1; i++) { for (int j = i + 1; j < tFluidList_sS; j++) { if (GT_Utility.areFluidsEqual(tFluidList.get(i), tFluidList.get(j))) { if (tFluidList.get(i).amount >= tFluidList.get(j).amount) { - tFluidList.remove(j--); tFluidList_sS=tFluidList.size(); + tFluidList.remove(j--); + tFluidList_sS = tFluidList.size(); } else { - tFluidList.remove(i--); tFluidList_sS=tFluidList.size(); + tFluidList.remove(i--); + tFluidList_sS = tFluidList.size(); break; } } @@ -306,9 +339,11 @@ public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity FluidStack[] tFluids = tFluidList.toArray(new FluidStack[0]); GT_Recipe tRecipe; - tRecipe = GT_Recipe.GT_Recipe_Map.sFusionRecipes.findRecipe(this.getBaseMetaTileEntity(), this.mLastRecipe, false, GT_Values.V[tier()], tFluids); + tRecipe = GT_Recipe.GT_Recipe_Map.sFusionRecipes.findRecipe( + this.getBaseMetaTileEntity(), this.mLastRecipe, false, GT_Values.V[tier()], tFluids); if (tRecipe == null) { - tRecipe = GT_Recipe.GT_Recipe_Map.sComplexFusionRecipes.findRecipe(this.getBaseMetaTileEntity(), this.mLastRecipe, false, GT_Values.V[tier()], tFluids); + tRecipe = GT_Recipe.GT_Recipe_Map.sComplexFusionRecipes.findRecipe( + this.getBaseMetaTileEntity(), this.mLastRecipe, false, GT_Values.V[tier()], tFluids); } if ((tRecipe == null && !mRunningOnLoad) || (maxEUStore() < tRecipe.mSpecialValue)) { @@ -354,8 +389,7 @@ public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (aBaseMetaTileEntity.isServerSide()) { - if (mEfficiency < 0) - mEfficiency = 0; + if (mEfficiency < 0) mEfficiency = 0; if (mRunningOnLoad && checkMachine(aBaseMetaTileEntity, mInventory[1])) { this.mEUStore = aBaseMetaTileEntity.getStoredEU(); checkRecipe(); @@ -375,7 +409,8 @@ public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity if (isValidMetaTileEntity(tHatch)) { long energyToMove = GT_Values.V[tier()] / 16; if (aBaseMetaTileEntity.getStoredEU() + energyToMove < maxEUStore() - && tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(energyToMove, false)) { + && tHatch.getBaseMetaTileEntity() + .decreaseStoredEnergyUnits(energyToMove, false)) { aBaseMetaTileEntity.increaseStoredEnergyUnits(energyToMove, true); } } @@ -390,23 +425,29 @@ public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity for (ItemStack tStack : mOutputItems) if (tStack != null) addOutput(tStack); if (mOutputFluids != null) for (FluidStack tStack : mOutputFluids) if (tStack != null) addOutput(tStack); - mEfficiency = Math.max(0, Math.min(mEfficiency + mEfficiencyIncrease, getMaxEfficiency(mInventory[1]))); + mEfficiency = Math.max( + 0, Math.min(mEfficiency + mEfficiencyIncrease, getMaxEfficiency(mInventory[1]))); mOutputItems = null; mProgresstime = 0; mMaxProgresstime = 0; mEfficiencyIncrease = 0; if (mOutputFluids != null && mOutputFluids.length > 0) { try { - GT_Mod.achievements.issueAchivementHatchFluid(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), mOutputFluids[0]); + GT_Mod.achievements.issueAchivementHatchFluid( + aBaseMetaTileEntity + .getWorld() + .getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), + mOutputFluids[0]); } catch (Exception ignored) { } } this.mEUStore = aBaseMetaTileEntity.getStoredEU(); - if (aBaseMetaTileEntity.isAllowedToWork()) - checkRecipe(); + if (aBaseMetaTileEntity.isAllowedToWork()) checkRecipe(); } } else { - if (aTick % 100 == 0 || aBaseMetaTileEntity.hasWorkJustBeenEnabled() || aBaseMetaTileEntity.hasInventoryBeenModified()) { + if (aTick % 100 == 0 + || aBaseMetaTileEntity.hasWorkJustBeenEnabled() + || aBaseMetaTileEntity.hasInventoryBeenModified()) { turnCasingActive(mMaxProgresstime > 0); if (aBaseMetaTileEntity.isAllowedToWork()) { this.mEUStore = aBaseMetaTileEntity.getStoredEU(); @@ -414,11 +455,11 @@ public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity if (this.mEUStore < this.mLastRecipe.mSpecialValue - this.mEUt) { criticalStopMachine(); } - aBaseMetaTileEntity.decreaseStoredEnergyUnits(this.mLastRecipe.mSpecialValue - this.mEUt, true); + aBaseMetaTileEntity.decreaseStoredEnergyUnits( + this.mLastRecipe.mSpecialValue - this.mEUt, true); } } - if (mMaxProgresstime <= 0) - mEfficiency = Math.max(0, mEfficiency - 1000); + if (mMaxProgresstime <= 0) mEfficiency = Math.max(0, mEfficiency - 1000); } } } else { @@ -426,7 +467,8 @@ public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity stopMachine(); } } - aBaseMetaTileEntity.setErrorDisplayID((aBaseMetaTileEntity.getErrorDisplayID() & ~127) | (mMachine ? 0 : 64)); + aBaseMetaTileEntity.setErrorDisplayID( + (aBaseMetaTileEntity.getErrorDisplayID() & ~127) | (mMachine ? 0 : 64)); aBaseMetaTileEntity.setActive(mMaxProgresstime > 0); } } @@ -462,6 +504,7 @@ public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity public int getDamageToComponent(ItemStack aStack) { return 0; } + @Override public boolean explodesOnComponentBreak(ItemStack aStack) { return false; @@ -475,25 +518,31 @@ public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity @Override public String[] getInfoData() { - String tier = tier() == 6 ? EnumChatFormatting.RED+"I"+EnumChatFormatting.RESET : tier() == 7 ? EnumChatFormatting.YELLOW+"II"+EnumChatFormatting.RESET : tier() == 8 ? EnumChatFormatting.GRAY+"III"+EnumChatFormatting.RESET : "IV"; + String tier = tier() == 6 + ? EnumChatFormatting.RED + "I" + EnumChatFormatting.RESET + : tier() == 7 + ? EnumChatFormatting.YELLOW + "II" + EnumChatFormatting.RESET + : tier() == 8 ? EnumChatFormatting.GRAY + "III" + EnumChatFormatting.RESET : "IV"; float plasmaOut = 0; int powerRequired = 0; if (this.mLastRecipe != null) { powerRequired = this.mLastRecipe.mEUt; if (this.mLastRecipe.getFluidOutput(0) != null) { - plasmaOut = (float)this.mLastRecipe.getFluidOutput(0).amount / (float)this.mLastRecipe.mDuration; + plasmaOut = (float) this.mLastRecipe.getFluidOutput(0).amount / (float) this.mLastRecipe.mDuration; } } - return new String[]{ - EnumChatFormatting.BLUE + "Fusion Reactor MK " + EnumChatFormatting.RESET + tier, - StatCollector.translateToLocal("GT5U.fusion.req") + ": " + - EnumChatFormatting.RED + GT_Utility.formatNumbers(powerRequired) + EnumChatFormatting.RESET + "EU/t", - StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + - EnumChatFormatting.GREEN + GT_Utility.formatNumbers(mEUStore) + EnumChatFormatting.RESET + " EU / " + - EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(maxEUStore()) + EnumChatFormatting.RESET + " EU", - StatCollector.translateToLocal("GT5U.fusion.plasma") + ": " + - EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(plasmaOut) + EnumChatFormatting.RESET + "L/t"}; + return new String[] { + EnumChatFormatting.BLUE + "Fusion Reactor MK " + EnumChatFormatting.RESET + tier, + StatCollector.translateToLocal("GT5U.fusion.req") + ": " + EnumChatFormatting.RED + + GT_Utility.formatNumbers(powerRequired) + EnumChatFormatting.RESET + "EU/t", + StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(mEUStore) + EnumChatFormatting.RESET + " EU / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(maxEUStore()) + EnumChatFormatting.RESET + " EU", + StatCollector.translateToLocal("GT5U.fusion.plasma") + ": " + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(plasmaOut) + EnumChatFormatting.RESET + "L/t" + }; } @Override @@ -509,6 +558,7 @@ public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity @Override public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) { if (mMachine) return -1; - return survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 7, 1, 12, elementBudget, source, actor, false, true); + return survivialBuildPiece( + STRUCTURE_PIECE_MAIN, stackSize, 7, 1, 12, elementBudget, source, actor, false, true); } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer1.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer1.java index dd942d2635..ef218cb643 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer1.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer1.java @@ -1,5 +1,8 @@ package gregtech.common.tileentities.machines.multi; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FUSION1; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FUSION1_GLOW; + import gregtech.api.GregTech_API; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -8,14 +11,15 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import net.minecraft.block.Block; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FUSION1; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FUSION1_GLOW; - public class GT_MetaTileEntity_FusionComputer1 extends GT_MetaTileEntity_FusionComputer { private static final ITexture textureOverlay = TextureFactory.of( TextureFactory.builder().addIcon(OVERLAY_FUSION1).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FUSION1_GLOW).extFacing().glow().build()); + TextureFactory.builder() + .addIcon(OVERLAY_FUSION1_GLOW) + .extFacing() + .glow() + .build()); public GT_MetaTileEntity_FusionComputer1(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, 6); @@ -92,5 +96,4 @@ public class GT_MetaTileEntity_FusionComputer1 extends GT_MetaTileEntity_FusionC public int tierOverclock() { return 1; } - } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer2.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer2.java index 8d2b0b6d3b..a763e1f639 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer2.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer2.java @@ -1,5 +1,8 @@ package gregtech.common.tileentities.machines.multi; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FUSION2; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FUSION2_GLOW; + import gregtech.api.GregTech_API; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -8,14 +11,15 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import net.minecraft.block.Block; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FUSION2; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FUSION2_GLOW; - public class GT_MetaTileEntity_FusionComputer2 extends GT_MetaTileEntity_FusionComputer { private static final ITexture textureOverlay = TextureFactory.of( TextureFactory.builder().addIcon(OVERLAY_FUSION2).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FUSION2_GLOW).extFacing().glow().build()); + TextureFactory.builder() + .addIcon(OVERLAY_FUSION2_GLOW) + .extFacing() + .glow() + .build()); public GT_MetaTileEntity_FusionComputer2(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, 6); diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer3.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer3.java index 67cb06f3c1..c2c0367d61 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer3.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer3.java @@ -1,5 +1,8 @@ package gregtech.common.tileentities.machines.multi; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FUSION3; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FUSION3_GLOW; + import gregtech.api.GregTech_API; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -8,14 +11,15 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import net.minecraft.block.Block; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FUSION3; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FUSION3_GLOW; - public class GT_MetaTileEntity_FusionComputer3 extends GT_MetaTileEntity_FusionComputer { private static final ITexture textureOverlay = TextureFactory.of( TextureFactory.builder().addIcon(OVERLAY_FUSION3).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FUSION3_GLOW).extFacing().glow().build()); + TextureFactory.builder() + .addIcon(OVERLAY_FUSION3_GLOW) + .extFacing() + .glow() + .build()); public GT_MetaTileEntity_FusionComputer3(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, 6); @@ -93,4 +97,3 @@ public class GT_MetaTileEntity_FusionComputer3 extends GT_MetaTileEntity_FusionC return 4; } } - diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_HeatExchanger.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_HeatExchanger.java index d006f6d961..d1614bccc5 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_HeatExchanger.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_HeatExchanger.java @@ -1,5 +1,12 @@ package gregtech.common.tileentities.machines.multi; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; +import static gregtech.api.enums.GT_HatchElement.*; +import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; + import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IItemSource; @@ -29,48 +36,57 @@ import net.minecraft.util.StatCollector; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; -import static gregtech.api.enums.GT_HatchElement.*; -import static gregtech.api.enums.Textures.BlockIcons.*; -import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; - -public class GT_MetaTileEntity_HeatExchanger extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_HeatExchanger> implements ISurvivalConstructable { +public class GT_MetaTileEntity_HeatExchanger + extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_HeatExchanger> + implements ISurvivalConstructable { private static final int CASING_INDEX = 50; private static final String STRUCTURE_PIECE_MAIN = "main"; - private static final IStructureDefinition<GT_MetaTileEntity_HeatExchanger> STRUCTURE_DEFINITION = StructureDefinition.<GT_MetaTileEntity_HeatExchanger>builder() - .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{ - {"ccc", "cCc", "ccc"}, - {"ccc", "cPc", "ccc"}, - {"ccc", "cPc", "ccc"}, - {"c~c", "cHc", "ccc"}, - })) - .addElement('P', ofBlock(GregTech_API.sBlockCasings2, 14)) - .addElement('C', OutputHatch.withAdder(GT_MetaTileEntity_HeatExchanger::addColdFluidOutputToMachineList).withCount(t -> isValidMetaTileEntity(t.mOutputColdFluidHatch) ? 1 : 0).newAny(CASING_INDEX, 3)) - .addElement('H', OutputHatch.withAdder(GT_MetaTileEntity_HeatExchanger::addHotFluidInputToMachineList).withCount(t -> isValidMetaTileEntity(t.mInputHotFluidHatch) ? 1 : 0).newAny(CASING_INDEX, 3)) - .addElement('c', buildHatchAdder(GT_MetaTileEntity_HeatExchanger.class) - .atLeast(InputBus, InputHatch, OutputBus, OutputHatch, Maintenance) - .casingIndex(CASING_INDEX) - .dot(1) - .buildAndChain(onElementPass(GT_MetaTileEntity_HeatExchanger::onCasingAdded, ofBlock(GregTech_API.sBlockCasings4, (byte) 2)) - )) - .build(); - public static float penalty_per_config = 0.015f; // penalize 1.5% efficiency per circuitry level (1-25) + private static final IStructureDefinition<GT_MetaTileEntity_HeatExchanger> STRUCTURE_DEFINITION = + StructureDefinition.<GT_MetaTileEntity_HeatExchanger>builder() + .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][] { + {"ccc", "cCc", "ccc"}, + {"ccc", "cPc", "ccc"}, + {"ccc", "cPc", "ccc"}, + {"c~c", "cHc", "ccc"}, + })) + .addElement('P', ofBlock(GregTech_API.sBlockCasings2, 14)) + .addElement( + 'C', + OutputHatch.withAdder(GT_MetaTileEntity_HeatExchanger::addColdFluidOutputToMachineList) + .withCount(t -> isValidMetaTileEntity(t.mOutputColdFluidHatch) ? 1 : 0) + .newAny(CASING_INDEX, 3)) + .addElement( + 'H', + OutputHatch.withAdder(GT_MetaTileEntity_HeatExchanger::addHotFluidInputToMachineList) + .withCount(t -> isValidMetaTileEntity(t.mInputHotFluidHatch) ? 1 : 0) + .newAny(CASING_INDEX, 3)) + .addElement( + 'c', + buildHatchAdder(GT_MetaTileEntity_HeatExchanger.class) + .atLeast(InputBus, InputHatch, OutputBus, OutputHatch, Maintenance) + .casingIndex(CASING_INDEX) + .dot(1) + .buildAndChain(onElementPass( + GT_MetaTileEntity_HeatExchanger::onCasingAdded, + ofBlock(GregTech_API.sBlockCasings4, (byte) 2)))) + .build(); + public static float penalty_per_config = 0.015f; // penalize 1.5% efficiency per circuitry level (1-25) private GT_MetaTileEntity_Hatch_Input mInputHotFluidHatch; private GT_MetaTileEntity_Hatch_Output mOutputColdFluidHatch; private boolean superheated = false; - private int superheated_threshold=0; + private int superheated_threshold = 0; /** * How much more steam we can make without draining real water. Unit is (1L/GT_Values.STEAM_PER_WATER) */ private int steamBudget; + private int mCasingAmount; public GT_MetaTileEntity_HeatExchanger(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); } + public GT_MetaTileEntity_HeatExchanger(String aName) { super(aName); } @@ -114,24 +130,47 @@ public class GT_MetaTileEntity_HeatExchanger extends GT_MetaTileEntity_EnhancedM } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { if (aSide == aFacing) { if (aActive) - return new ITexture[]{ - casingTexturePages[0][CASING_INDEX], - TextureFactory.builder().addIcon(OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE_GLOW).extFacing().glow().build()}; - return new ITexture[]{ + return new ITexture[] { casingTexturePages[0][CASING_INDEX], - TextureFactory.builder().addIcon(OVERLAY_FRONT_HEAT_EXCHANGER).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_HEAT_EXCHANGER_GLOW).extFacing().glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE_GLOW) + .extFacing() + .glow() + .build() + }; + return new ITexture[] { + casingTexturePages[0][CASING_INDEX], + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_HEAT_EXCHANGER) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_HEAT_EXCHANGER_GLOW) + .extFacing() + .glow() + .build() + }; } - return new ITexture[]{casingTexturePages[0][CASING_INDEX]}; + return new ITexture[] {casingTexturePages[0][CASING_INDEX]}; } @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "LargeHeatExchanger.png"); + return new GT_GUIContainer_MultiMachine( + aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "LargeHeatExchanger.png"); } @Override @@ -146,16 +185,15 @@ public class GT_MetaTileEntity_HeatExchanger extends GT_MetaTileEntity_EnhancedM @Override public boolean checkRecipe(ItemStack aStack) { - if (mInputHotFluidHatch.getFluid() == null) - return true; + if (mInputHotFluidHatch.getFluid() == null) return true; int fluidAmountToConsume = mInputHotFluidHatch.getFluidAmount(); // how much fluid is in hatch - superheated_threshold = 4000; // default: must have 4000L per second to generate superheated steam - float efficiency = 1f; // default: operate at 100% efficiency with no integrated circuitry + superheated_threshold = 4000; // default: must have 4000L per second to generate superheated steam + float efficiency = 1f; // default: operate at 100% efficiency with no integrated circuitry int shs_reduction_per_config = 150; // reduce threshold 150L/s per circuitry level (1-25) float steam_output_multiplier = 20f; // default: multiply output by 4 * 10 (boosted x5) - float penalty = 0.0f; // penalty to apply to output based on circuitry level (1-25). + float penalty = 0.0f; // penalty to apply to output based on circuitry level (1-25). boolean do_lava = false; // Do we have an integrated circuit with a valid configuration? @@ -176,15 +214,18 @@ public class GT_MetaTileEntity_HeatExchanger extends GT_MetaTileEntity_EnhancedM do_lava = true; } else if (mInputHotFluidHatch.getFluid().isFluidEqual(FluidRegistry.getFluidStack("ic2hotcoolant", 1))) { steam_output_multiplier /= 2f; // was boosted x2 on top of x5 -> total x10 -> nerf with this code back to 5x - superheated_threshold /=5f; // 10x smaller since the Hot Things production in reactor is the same. + superheated_threshold /= 5f; // 10x smaller since the Hot Things production in reactor is the same. } else { // If we're working with neither, fail out - superheated_threshold=0; + superheated_threshold = 0; return false; } - superheated = fluidAmountToConsume >= superheated_threshold; // set the internal superheated flag if we have enough hot fluid. Used in the onRunningTick method. - fluidAmountToConsume = Math.min(fluidAmountToConsume, superheated_threshold * 2); // Don't consume too much hot fluid per second + superheated = fluidAmountToConsume + >= superheated_threshold; // set the internal superheated flag if we have enough hot fluid. Used in the + // onRunningTick method. + fluidAmountToConsume = Math.min( + fluidAmountToConsume, superheated_threshold * 2); // Don't consume too much hot fluid per second mInputHotFluidHatch.drain(fluidAmountToConsume, true); this.mMaxProgresstime = 20; this.mEUt = (int) (fluidAmountToConsume * steam_output_multiplier * efficiency); @@ -208,24 +249,27 @@ public class GT_MetaTileEntity_HeatExchanger extends GT_MetaTileEntity_EnhancedM @Override public boolean onRunningTick(ItemStack aStack) { if (this.mEUt > 0) { - int tGeneratedEU = (int) (this.mEUt * 2L * this.mEfficiency / 10000L); // APPROXIMATELY how much steam to generate. + int tGeneratedEU = + (int) (this.mEUt * 2L * this.mEfficiency / 10000L); // APPROXIMATELY how much steam to generate. if (tGeneratedEU > 0) { if (superheated) tGeneratedEU /= 2; // We produce half as much superheated steam if necessary int distilledConsumed = useWater(tGeneratedEU); // how much distilled water to consume - //tGeneratedEU = distilledConsumed * 160; // EXACTLY how much steam to generate, producing a perfect 1:160 ratio with distilled water consumption + // tGeneratedEU = distilledConsumed * 160; // EXACTLY how much steam to generate, producing a perfect + // 1:160 ratio with distilled water consumption FluidStack distilledStack = GT_ModHandler.getDistilledWater(distilledConsumed); if (depleteInput(distilledStack)) // Consume the distilled water { if (superheated) { - addOutput(FluidRegistry.getFluidStack("ic2superheatedsteam", tGeneratedEU)); // Generate superheated steam + addOutput(FluidRegistry.getFluidStack( + "ic2superheatedsteam", tGeneratedEU)); // Generate superheated steam } else { addOutput(GT_ModHandler.getSteam(tGeneratedEU)); // Generate regular steam } } else { - GT_Log.exp.println(this.mName+" had no more Distilled water!"); + GT_Log.exp.println(this.mName + " had no more Distilled water!"); explodeMultiblock(); // Generate crater } } @@ -285,6 +329,7 @@ public class GT_MetaTileEntity_HeatExchanger extends GT_MetaTileEntity_EnhancedM public int getDamageToComponent(ItemStack aStack) { return 0; } + @Override public boolean explodesOnComponentBreak(ItemStack aStack) { return false; @@ -302,20 +347,26 @@ public class GT_MetaTileEntity_HeatExchanger extends GT_MetaTileEntity_EnhancedM @Override public String[] getInfoData() { - return new String[]{ - StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + - EnumChatFormatting.GREEN + GT_Utility.formatNumbers(mProgresstime / 20) + EnumChatFormatting.RESET + " s / " + - EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(mMaxProgresstime / 20) + EnumChatFormatting.RESET + " s", - StatCollector.translateToLocal("GT5U.multiblock.usage") + " " + StatCollector.translateToLocal("GT5U.LHE.steam") + ": " + - (superheated ? EnumChatFormatting.RED : EnumChatFormatting.YELLOW) + GT_Utility.formatNumbers(superheated ? -2 * mEUt : -mEUt) + EnumChatFormatting.RESET + " EU/t", - StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + - EnumChatFormatting.RED + (getIdealStatus() - getRepairStatus()) + EnumChatFormatting.RESET + " " + - StatCollector.translateToLocal("GT5U.multiblock.efficiency") + ": " + - EnumChatFormatting.YELLOW + mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", - StatCollector.translateToLocal("GT5U.LHE.superheated") + ": " + - (superheated ? EnumChatFormatting.RED : EnumChatFormatting.BLUE) + superheated + EnumChatFormatting.RESET, - StatCollector.translateToLocal("GT5U.LHE.superheated") + " " + StatCollector.translateToLocal("GT5U.LHE.threshold") + ": " + - EnumChatFormatting.GREEN + GT_Utility.formatNumbers(superheated_threshold) + EnumChatFormatting.RESET + return new String[] { + StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(mProgresstime / 20) + EnumChatFormatting.RESET + " s / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(mMaxProgresstime / 20) + EnumChatFormatting.RESET + " s", + StatCollector.translateToLocal("GT5U.multiblock.usage") + " " + + StatCollector.translateToLocal("GT5U.LHE.steam") + ": " + + (superheated ? EnumChatFormatting.RED : EnumChatFormatting.YELLOW) + + GT_Utility.formatNumbers(superheated ? -2 * mEUt : -mEUt) + EnumChatFormatting.RESET + " EU/t", + StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + EnumChatFormatting.RED + + (getIdealStatus() - getRepairStatus()) + EnumChatFormatting.RESET + " " + + StatCollector.translateToLocal("GT5U.multiblock.efficiency") + + ": " + EnumChatFormatting.YELLOW + + mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", + StatCollector.translateToLocal("GT5U.LHE.superheated") + ": " + + (superheated ? EnumChatFormatting.RED : EnumChatFormatting.BLUE) + superheated + + EnumChatFormatting.RESET, + StatCollector.translateToLocal("GT5U.LHE.superheated") + " " + + StatCollector.translateToLocal("GT5U.LHE.threshold") + ": " + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(superheated_threshold) + EnumChatFormatting.RESET }; } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java index e0e3124d4c..6f55e3c9a3 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java @@ -1,5 +1,9 @@ package gregtech.common.tileentities.machines.multi; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; +import static gregtech.api.enums.Textures.BlockIcons.*; + import com.gtnewhorizon.structurelib.structure.IStructureElement; import gregtech.GT_Mod; import gregtech.api.GregTech_API; @@ -15,16 +19,12 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import java.util.ArrayList; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; -import java.util.ArrayList; - -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; -import static gregtech.api.enums.Textures.BlockIcons.*; - -public class GT_MetaTileEntity_ImplosionCompressor extends GT_MetaTileEntity_CubicMultiBlockBase<GT_MetaTileEntity_ImplosionCompressor> { +public class GT_MetaTileEntity_ImplosionCompressor + extends GT_MetaTileEntity_CubicMultiBlockBase<GT_MetaTileEntity_ImplosionCompressor> { public GT_MetaTileEntity_ImplosionCompressor(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); } @@ -42,46 +42,71 @@ public class GT_MetaTileEntity_ImplosionCompressor extends GT_MetaTileEntity_Cub protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Implosion Compressor") - .addInfo("Explosions are fun") - .addInfo("Controller block for the Implosion Compressor") - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .beginStructureBlock(3, 3, 3, true) - .addController("Front center") - .addCasingInfo("Solid Steel Machine Casing", 16) - .addStructureInfo("Casings can be replaced with Explosion Warning Signs") - .addEnergyHatch("Any casing", 1) - .addMaintenanceHatch("Any casing", 1) - .addMufflerHatch("Any casing", 1) - .addInputBus("Any casing", 1) - .addOutputBus("Any casing", 1) - .toolTipFinisher("Gregtech"); + .addInfo("Explosions are fun") + .addInfo("Controller block for the Implosion Compressor") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(3, 3, 3, true) + .addController("Front center") + .addCasingInfo("Solid Steel Machine Casing", 16) + .addStructureInfo("Casings can be replaced with Explosion Warning Signs") + .addEnergyHatch("Any casing", 1) + .addMaintenanceHatch("Any casing", 1) + .addMufflerHatch("Any casing", 1) + .addInputBus("Any casing", 1) + .addOutputBus("Any casing", 1) + .toolTipFinisher("Gregtech"); return tt; } @Override public boolean addToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - return super.addToMachineList(aTileEntity, aBaseCasingIndex) || addMufflerToMachineList(aTileEntity, aBaseCasingIndex); + return super.addToMachineList(aTileEntity, aBaseCasingIndex) + || addMufflerToMachineList(aTileEntity, aBaseCasingIndex); } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { if (aSide == aFacing) { - if (aActive) return new ITexture[]{ - BlockIcons.casingTexturePages[0][16], - TextureFactory.builder().addIcon(OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE_GLOW).extFacing().glow().build()}; - return new ITexture[]{ + if (aActive) + return new ITexture[] { + BlockIcons.casingTexturePages[0][16], + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE_GLOW) + .extFacing() + .glow() + .build() + }; + return new ITexture[] { BlockIcons.casingTexturePages[0][16], - TextureFactory.builder().addIcon(OVERLAY_FRONT_IMPLOSION_COMPRESSOR).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_IMPLOSION_COMPRESSOR_GLOW).extFacing().glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_IMPLOSION_COMPRESSOR) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_IMPLOSION_COMPRESSOR_GLOW) + .extFacing() + .glow() + .build() + }; } - return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][16]}; + return new ITexture[] {Textures.BlockIcons.casingTexturePages[0][16]}; } @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "ImplosionCompressor.png"); + return new GT_GUIContainer_MultiMachine( + aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "ImplosionCompressor.png"); } @Override @@ -114,19 +139,19 @@ public class GT_MetaTileEntity_ImplosionCompressor extends GT_MetaTileEntity_Cub } ItemStack[] tInputs = tInputList.toArray(new ItemStack[0]); if (!tInputList.isEmpty()) { - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sImplosionRecipes.findRecipe(getBaseMetaTileEntity(), false, 9223372036854775807L, null, tInputs); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sImplosionRecipes.findRecipe( + getBaseMetaTileEntity(), false, 9223372036854775807L, null, tInputs); if ((tRecipe != null) && (tRecipe.isRecipeInputEqual(true, null, tInputs))) { this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; - //OC THAT EXPLOSIVE SHIT!!! + // OC THAT EXPLOSIVE SHIT!!! calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, 1, getMaxInputVoltage()); - //In case recipe is too OP for that machine - if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) - return false; + // In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return false; if (this.mEUt > 0) { this.mEUt = (-this.mEUt); } - this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0), tRecipe.getOutput(1)}; + this.mOutputItems = new ItemStack[] {tRecipe.getOutput(0), tRecipe.getOutput(1)}; sendLoopStart((byte) 20); updateSlots(); return true; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_IntegratedOreFactory.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_IntegratedOreFactory.java index c66ed732d9..8afdfa65b7 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_IntegratedOreFactory.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_IntegratedOreFactory.java @@ -1,5 +1,11 @@ package gregtech.common.tileentities.machines.multi; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static gregtech.api.enums.GT_HatchElement.*; +import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; +import static gregtech.api.util.GT_StructureUtility.ofFrame; + import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IItemSource; @@ -19,6 +25,8 @@ import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import java.util.*; +import java.util.stream.Collectors; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; @@ -28,17 +36,9 @@ import net.minecraft.util.StatCollector; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; -import java.util.*; -import java.util.stream.Collectors; - -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; -import static gregtech.api.enums.GT_HatchElement.*; -import static gregtech.api.enums.Textures.BlockIcons.*; -import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; -import static gregtech.api.util.GT_StructureUtility.ofFrame; -import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional; - -public class GT_MetaTileEntity_IntegratedOreFactory extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_IntegratedOreFactory> implements ISurvivalConstructable { +public class GT_MetaTileEntity_IntegratedOreFactory + extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_IntegratedOreFactory> + implements ISurvivalConstructable { private static final int CASING_INDEX1 = 183; private static final int CASING_INDEX2 = 49; @@ -50,50 +50,57 @@ public class GT_MetaTileEntity_IntegratedOreFactory extends GT_MetaTileEntity_En private static final String SIFTER = "Sifter"; private static final String CHEM_WASH = "Chemical Bathing"; private static final String STRUCTURE_PIECE_MAIN = "main"; - private static final IStructureDefinition<GT_MetaTileEntity_IntegratedOreFactory> STRUCTURE_DEFINITION = StructureDefinition.<GT_MetaTileEntity_IntegratedOreFactory>builder() - .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{ - {" ", " ", " WWW ", " WWW ", " ", " "}, - {" ", " sss ", " sppps", " sppps", " sss ", " "}, - {" ", " sss ", " s s", " s s", " sss ", " "}, - {" ", " sss ", " sppps", " sppps", " sss ", " "}, - {" ", " sss ", " s s", " s s", " sss ", " "}, - {" ", " sss ", " sppps", " sppps", " sss ", " "}, - {"iiiiii ", "iIIIIiisssi", "iIIIIis s", "iIIIIis s", "iIIIIiisssi", "iiiiii "}, - {"iggggi ", "gt t isssi", "g xx sppps", "g xx sppps", "gt t isssi", "iggggi "}, - {"iggggi ", "gt t isssi", "g xx s s", "g xx s s", "gt t isssi", "iggggi "}, - {"iggggi ", "gt t is~si", "g xx spppO", "g xx spppO", "gt t isssi", "iggggi "}, - {"iggggi ", "gt t isssi", "g xx s O", "g xx s O", "gt t isssi", "iggggi "}, - {"EEEEEE ", "EEEEEEEEEEE", "EEEEEEEEEEE", "EEEEEEEEEEE", "EEEEEEEEEEE", "EEEEEE "} - })) - .addElement('i', ofBlock(GregTech_API.sBlockCasings8, 7)) - .addElement('s', ofBlock(GregTech_API.sBlockCasings4, 1)) - .addElement('g', ofBlockAnyMeta(GameRegistry.findBlock("IC2", "blockAlloyGlass"))) - .addElement('x', ofBlock(GregTech_API.sBlockCasings2, 3)) - .addElement('p', ofBlock(GregTech_API.sBlockCasings2, 15)) - .addElement('t', ofFrame(Materials.TungstenSteel)) - .addElement('E', buildHatchAdder(GT_MetaTileEntity_IntegratedOreFactory.class) - .atLeast(Energy, Maintenance) - .casingIndex(CASING_INDEX1) - .dot(1) - .buildAndChain(GregTech_API.sBlockCasings8, 7) - ) - .addElement('I', buildHatchAdder(GT_MetaTileEntity_IntegratedOreFactory.class) - .atLeast(InputBus) - .casingIndex(CASING_INDEX1) - .dot(2) - .buildAndChain(GregTech_API.sBlockCasings8, 7) - ) - .addElement('W', buildHatchAdder(GT_MetaTileEntity_IntegratedOreFactory.class) - .atLeast(InputHatch, Muffler) - .casingIndex(CASING_INDEX1) - .dot(3) - .buildAndChain(GregTech_API.sBlockCasings4, 1)) - .addElement('O', buildHatchAdder(GT_MetaTileEntity_IntegratedOreFactory.class) - .atLeast(OutputBus, OutputHatch) - .casingIndex(CASING_INDEX2) - .dot(4) - .buildAndChain(GregTech_API.sBlockCasings4, 1)) - .build(); + private static final IStructureDefinition<GT_MetaTileEntity_IntegratedOreFactory> STRUCTURE_DEFINITION = + StructureDefinition.<GT_MetaTileEntity_IntegratedOreFactory>builder() + .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][] { + {" ", " ", " WWW ", " WWW ", " ", " "}, + {" ", " sss ", " sppps", " sppps", " sss ", " "}, + {" ", " sss ", " s s", " s s", " sss ", " "}, + {" ", " sss ", " sppps", " sppps", " sss ", " "}, + {" ", " sss ", " s s", " s s", " sss ", " "}, + {" ", " sss ", " sppps", " sppps", " sss ", " "}, + {"iiiiii ", "iIIIIiisssi", "iIIIIis s", "iIIIIis s", "iIIIIiisssi", "iiiiii "}, + {"iggggi ", "gt t isssi", "g xx sppps", "g xx sppps", "gt t isssi", "iggggi "}, + {"iggggi ", "gt t isssi", "g xx s s", "g xx s s", "gt t isssi", "iggggi "}, + {"iggggi ", "gt t is~si", "g xx spppO", "g xx spppO", "gt t isssi", "iggggi "}, + {"iggggi ", "gt t isssi", "g xx s O", "g xx s O", "gt t isssi", "iggggi "}, + {"EEEEEE ", "EEEEEEEEEEE", "EEEEEEEEEEE", "EEEEEEEEEEE", "EEEEEEEEEEE", "EEEEEE "} + })) + .addElement('i', ofBlock(GregTech_API.sBlockCasings8, 7)) + .addElement('s', ofBlock(GregTech_API.sBlockCasings4, 1)) + .addElement('g', ofBlockAnyMeta(GameRegistry.findBlock("IC2", "blockAlloyGlass"))) + .addElement('x', ofBlock(GregTech_API.sBlockCasings2, 3)) + .addElement('p', ofBlock(GregTech_API.sBlockCasings2, 15)) + .addElement('t', ofFrame(Materials.TungstenSteel)) + .addElement( + 'E', + buildHatchAdder(GT_MetaTileEntity_IntegratedOreFactory.class) + .atLeast(Energy, Maintenance) + .casingIndex(CASING_INDEX1) + .dot(1) + .buildAndChain(GregTech_API.sBlockCasings8, 7)) + .addElement( + 'I', + buildHatchAdder(GT_MetaTileEntity_IntegratedOreFactory.class) + .atLeast(InputBus) + .casingIndex(CASING_INDEX1) + .dot(2) + .buildAndChain(GregTech_API.sBlockCasings8, 7)) + .addElement( + 'W', + buildHatchAdder(GT_MetaTileEntity_IntegratedOreFactory.class) + .atLeast(InputHatch, Muffler) + .casingIndex(CASING_INDEX1) + .dot(3) + .buildAndChain(GregTech_API.sBlockCasings4, 1)) + .addElement( + 'O', + buildHatchAdder(GT_MetaTileEntity_IntegratedOreFactory.class) + .atLeast(OutputBus, OutputHatch) + .casingIndex(CASING_INDEX2) + .dot(4) + .buildAndChain(GregTech_API.sBlockCasings4, 1)) + .build(); private static final HashSet<Integer> isCrushedOre = new HashSet<>(); private static final HashSet<Integer> isCrushedPureOre = new HashSet<>(); @@ -169,24 +176,24 @@ public class GT_MetaTileEntity_IntegratedOreFactory extends GT_MetaTileEntity_En protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Ore Processor") - .addInfo("Controller Block for the Integrated Ore Factory") - .addInfo("It is OP. I mean ore processor.") - .addInfo("Do all ore procession in one step.") - .addInfo("Can process up to 1024 ores per time.") - .addInfo("Every ore costs 30EU/t, 2L lubricant, 200L distilled water.") - .addInfo("Process time is depend on mode.") - .addInfo("Use a screwdriver to switch mode.") - .addInfo("Sneak click with screwdriver to void the stone dusts.") - .addSeparator() - .beginStructureBlock(6, 12, 11, false) - .addController("The third layer") - .addEnergyHatch("Button Casing", 1) - .addMaintenanceHatch("Button Casing", 1) - .addInputBus("Input ore/crushed ore", 2) - .addInputHatch("Input lubricant/distilled water/washing chemicals", 3) - .addMufflerHatch("Output Pollution", 3) - .addOutputBus("Output products", 4) - .toolTipFinisher("Gregtech"); + .addInfo("Controller Block for the Integrated Ore Factory") + .addInfo("It is OP. I mean ore processor.") + .addInfo("Do all ore procession in one step.") + .addInfo("Can process up to 1024 ores per time.") + .addInfo("Every ore costs 30EU/t, 2L lubricant, 200L distilled water.") + .addInfo("Process time is depend on mode.") + .addInfo("Use a screwdriver to switch mode.") + .addInfo("Sneak click with screwdriver to void the stone dusts.") + .addSeparator() + .beginStructureBlock(6, 12, 11, false) + .addController("The third layer") + .addEnergyHatch("Button Casing", 1) + .addMaintenanceHatch("Button Casing", 1) + .addInputBus("Input ore/crushed ore", 2) + .addInputHatch("Input lubricant/distilled water/washing chemicals", 3) + .addMufflerHatch("Output Pollution", 3) + .addOutputBus("Output products", 4) + .toolTipFinisher("Gregtech"); return tt; } @@ -224,7 +231,7 @@ public class GT_MetaTileEntity_IntegratedOreFactory extends GT_MetaTileEntity_En case 4: return 17 * 20; } - //go to hell + // go to hell return 1000000000; } @@ -260,8 +267,12 @@ public class GT_MetaTileEntity_IntegratedOreFactory extends GT_MetaTileEntity_En if (tCharged <= 0) break; int tID = GT_Utility.stackToInt(ore); if (tID == 0) continue; - if (isPureDust.contains(tID) || isImpureDust.contains(tID) || isCrushedPureOre.contains(tID) || - isThermal.contains(tID) || isCrushedOre.contains(tID) || isOre.contains(tID)) { + if (isPureDust.contains(tID) + || isImpureDust.contains(tID) + || isCrushedPureOre.contains(tID) + || isThermal.contains(tID) + || isCrushedOre.contains(tID) + || isOre.contains(tID)) { if (ore.stackSize <= tCharged) { tRealUsed += ore.stackSize; tOres.add(GT_Utility.copy(ore)); @@ -345,20 +356,33 @@ public class GT_MetaTileEntity_IntegratedOreFactory extends GT_MetaTileEntity_En public final void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { if (aPlayer.isSneaking()) { sVoidStone = !sVoidStone; - GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocalFormatted("GT5U.machines.oreprocessor.void", sVoidStone)); + GT_Utility.sendChatToPlayer( + aPlayer, StatCollector.translateToLocalFormatted("GT5U.machines.oreprocessor.void", sVoidStone)); return; } sMode = (sMode + 1) % 5; String des; switch (sMode) { - case 0: des = EnumChatFormatting.AQUA + CRUSH + "->" + WASH + "->" + THERMAL + "->" + CRUSH; break; - case 1: des = EnumChatFormatting.AQUA + CRUSH + "->" + WASH + "->" + CRUSH + "->" + CENTRIFUGE; break; - case 2: des = EnumChatFormatting.AQUA + CRUSH + "->" + CRUSH + "->" + CENTRIFUGE; break; - case 3: des = EnumChatFormatting.AQUA + CRUSH + "->" + WASH + "->" + SIFTER; break; - case 4: des = EnumChatFormatting.AQUA + CRUSH + "->" + CHEM_WASH + "->" + CRUSH + "->" + CENTRIFUGE; break; - default: des = ""; + case 0: + des = EnumChatFormatting.AQUA + CRUSH + "->" + WASH + "->" + THERMAL + "->" + CRUSH; + break; + case 1: + des = EnumChatFormatting.AQUA + CRUSH + "->" + WASH + "->" + CRUSH + "->" + CENTRIFUGE; + break; + case 2: + des = EnumChatFormatting.AQUA + CRUSH + "->" + CRUSH + "->" + CENTRIFUGE; + break; + case 3: + des = EnumChatFormatting.AQUA + CRUSH + "->" + WASH + "->" + SIFTER; + break; + case 4: + des = EnumChatFormatting.AQUA + CRUSH + "->" + CHEM_WASH + "->" + CRUSH + "->" + CENTRIFUGE; + break; + default: + des = ""; } - GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocalFormatted("GT5U.machines.oreprocessor", des, getTime() / 20)); + GT_Utility.sendChatToPlayer( + aPlayer, StatCollector.translateToLocalFormatted("GT5U.machines.oreprocessor", des, getTime() / 20)); } @Override @@ -382,7 +406,8 @@ public class GT_MetaTileEntity_IntegratedOreFactory extends GT_MetaTileEntity_En for (ItemStack aStack : sMidProduct) { int tID = GT_Utility.stackToInt(aStack); if (checkTypes(tID, aTables)) { - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sMaceratorRecipes.findRecipe(getBaseMetaTileEntity(), false, GT_Values.V[15], null, aStack); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sMaceratorRecipes.findRecipe( + getBaseMetaTileEntity(), false, GT_Values.V[15], null, aStack); if (tRecipe != null) { tProduct.addAll(getOutputStack(tRecipe, aStack.stackSize)); } else { @@ -403,7 +428,12 @@ public class GT_MetaTileEntity_IntegratedOreFactory extends GT_MetaTileEntity_En for (ItemStack aStack : sMidProduct) { int tID = GT_Utility.stackToInt(aStack); if (checkTypes(tID, aTables)) { - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sOreWasherRecipes.findRecipe(getBaseMetaTileEntity(), false, GT_Values.V[15], new FluidStack[]{GT_ModHandler.getDistilledWater(Integer.MAX_VALUE)}, aStack); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sOreWasherRecipes.findRecipe( + getBaseMetaTileEntity(), + false, + GT_Values.V[15], + new FluidStack[] {GT_ModHandler.getDistilledWater(Integer.MAX_VALUE)}, + aStack); if (tRecipe != null) { tProduct.addAll(getOutputStack(tRecipe, aStack.stackSize)); } else { @@ -424,7 +454,8 @@ public class GT_MetaTileEntity_IntegratedOreFactory extends GT_MetaTileEntity_En for (ItemStack aStack : sMidProduct) { int tID = GT_Utility.stackToInt(aStack); if (checkTypes(tID, aTables)) { - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sThermalCentrifugeRecipes.findRecipe(getBaseMetaTileEntity(), false, GT_Values.V[15], null, aStack); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sThermalCentrifugeRecipes.findRecipe( + getBaseMetaTileEntity(), false, GT_Values.V[15], null, aStack); if (tRecipe != null) { tProduct.addAll(getOutputStack(tRecipe, aStack.stackSize)); } else { @@ -445,7 +476,8 @@ public class GT_MetaTileEntity_IntegratedOreFactory extends GT_MetaTileEntity_En for (ItemStack aStack : sMidProduct) { int tID = GT_Utility.stackToInt(aStack); if (checkTypes(tID, aTables)) { - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.findRecipe(getBaseMetaTileEntity(), false, GT_Values.V[15], null, aStack); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.findRecipe( + getBaseMetaTileEntity(), false, GT_Values.V[15], null, aStack); if (tRecipe != null) { tProduct.addAll(getOutputStack(tRecipe, aStack.stackSize)); } else { @@ -466,7 +498,8 @@ public class GT_MetaTileEntity_IntegratedOreFactory extends GT_MetaTileEntity_En for (ItemStack aStack : sMidProduct) { int tID = GT_Utility.stackToInt(aStack); if (checkTypes(tID, aTables)) { - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sSifterRecipes.findRecipe(getBaseMetaTileEntity(), false, GT_Values.V[15], null, aStack); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sSifterRecipes.findRecipe( + getBaseMetaTileEntity(), false, GT_Values.V[15], null, aStack); if (tRecipe != null) { tProduct.addAll(getOutputStack(tRecipe, aStack.stackSize)); } else { @@ -487,9 +520,15 @@ public class GT_MetaTileEntity_IntegratedOreFactory extends GT_MetaTileEntity_En for (ItemStack aStack : sMidProduct) { int tID = GT_Utility.stackToInt(aStack); if (checkTypes(tID, aTables)) { - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sChemicalBathRecipes.findRecipe(getBaseMetaTileEntity(), false, GT_Values.V[15], getStoredFluids().toArray(new FluidStack[0]), aStack); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sChemicalBathRecipes.findRecipe( + getBaseMetaTileEntity(), + false, + GT_Values.V[15], + getStoredFluids().toArray(new FluidStack[0]), + aStack); if (tRecipe != null && tRecipe.getRepresentativeFluidInput(0) != null) { - FluidStack tInputFluid = tRecipe.getRepresentativeFluidInput(0).copy(); + FluidStack tInputFluid = + tRecipe.getRepresentativeFluidInput(0).copy(); int tStored = getFluidAmount(tInputFluid); int tWashed = Math.min(tStored / tInputFluid.amount, aStack.stackSize); depleteInput(new FluidStack(tInputFluid.getFluid(), tWashed * tInputFluid.amount)); @@ -521,7 +560,7 @@ public class GT_MetaTileEntity_IntegratedOreFactory extends GT_MetaTileEntity_En private List<ItemStack> getOutputStack(GT_Recipe aRecipe, int aTime) { List<ItemStack> tOutput = new ArrayList<>(); - for (int i = 0; i < aRecipe.mOutputs.length; i ++) { + for (int i = 0; i < aRecipe.mOutputs.length; i++) { if (aRecipe.getOutput(i) == null) { continue; } @@ -529,12 +568,13 @@ public class GT_MetaTileEntity_IntegratedOreFactory extends GT_MetaTileEntity_En if (tChance == 10000) { tOutput.add(GT_Utility.copyAmountUnsafe(aTime * aRecipe.getOutput(i).stackSize, aRecipe.getOutput(i))); } else { - //Use Normal Distribution + // Use Normal Distribution double u = aTime * (tChance / 10000D); double e = aTime * (tChance / 10000D) * (1 - (tChance / 10000D)); Random random = new Random(); int tAmount = (int) Math.ceil(Math.sqrt(e) * random.nextGaussian() + u); - tOutput.add(GT_Utility.copyAmountUnsafe(tAmount * aRecipe.getOutput(i).stackSize, aRecipe.getOutput(i))); + tOutput.add( + GT_Utility.copyAmountUnsafe(tAmount * aRecipe.getOutput(i).stackSize, aRecipe.getOutput(i))); } } return tOutput.stream().filter(i -> (i != null && i.stackSize > 0)).collect(Collectors.toList()); @@ -562,13 +602,15 @@ public class GT_MetaTileEntity_IntegratedOreFactory extends GT_MetaTileEntity_En for (Integer id : rProduct.keySet()) { ItemStack stack = GT_Utility.intToStack(id); sMidProduct[cnt] = GT_Utility.copyAmountUnsafe(rProduct.get(id), stack); - cnt ++; + cnt++; } } @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { - return checkPiece(STRUCTURE_PIECE_MAIN, 8, 9, 1) && mMaintenanceHatches.size() <= 1 && !mMufflerHatches.isEmpty(); + return checkPiece(STRUCTURE_PIECE_MAIN, 8, 9, 1) + && mMaintenanceHatches.size() <= 1 + && !mMufflerHatches.isEmpty(); } @Override @@ -597,18 +639,40 @@ public class GT_MetaTileEntity_IntegratedOreFactory extends GT_MetaTileEntity_En } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { if (aSide == aFacing) { if (aActive) - return new ITexture[]{ + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX2), - TextureFactory.builder().addIcon(OVERLAY_FRONT_PROCESSING_ARRAY_ACTIVE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_PROCESSING_ARRAY_ACTIVE_GLOW).extFacing().glow().build()}; - return new ITexture[]{ + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_PROCESSING_ARRAY_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_PROCESSING_ARRAY_ACTIVE_GLOW) + .extFacing() + .glow() + .build() + }; + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX2), - TextureFactory.builder().addIcon(OVERLAY_FRONT_PROCESSING_ARRAY).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_PROCESSING_ARRAY_GLOW).extFacing().glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_PROCESSING_ARRAY) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_PROCESSING_ARRAY_GLOW) + .extFacing() + .glow() + .build() + }; } - return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(CASING_INDEX2)}; + return new ITexture[] {Textures.BlockIcons.getCasingTextureForId(CASING_INDEX2)}; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java index b45875d9e7..323b6bd2a9 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java @@ -1,5 +1,18 @@ package gregtech.common.tileentities.machines.multi; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.lazy; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; +import static gregtech.api.enums.GT_HatchElement.*; +import static gregtech.api.enums.GT_Values.STEAM_PER_WATER; +import static gregtech.api.enums.ItemList.Circuit_Integrated; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER_GLOW; +import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; + import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IItemSource; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; @@ -20,6 +33,7 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import java.util.ArrayList; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.InventoryPlayer; @@ -28,63 +42,49 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; -import java.util.ArrayList; - -import static com.gtnewhorizon.structurelib.structure.StructureUtility.lazy; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; -import static gregtech.api.enums.GT_HatchElement.*; -import static gregtech.api.enums.GT_Values.STEAM_PER_WATER; -import static gregtech.api.enums.ItemList.Circuit_Integrated; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER_ACTIVE; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER_ACTIVE_GLOW; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER_GLOW; -import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; -import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; - -public abstract class GT_MetaTileEntity_LargeBoiler extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_LargeBoiler> implements ISurvivalConstructable { +public abstract class GT_MetaTileEntity_LargeBoiler + extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_LargeBoiler> + implements ISurvivalConstructable { private static final String STRUCTURE_PIECE_MAIN = "main"; - private static final ClassValue<IStructureDefinition<GT_MetaTileEntity_LargeBoiler>> STRUCTURE_DEFINITION =new ClassValue<IStructureDefinition<GT_MetaTileEntity_LargeBoiler>>() { - @Override - protected IStructureDefinition<GT_MetaTileEntity_LargeBoiler> computeValue(Class<?> type) { - return StructureDefinition.<GT_MetaTileEntity_LargeBoiler>builder() - .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{ - {"ccc", "ccc", "ccc"}, - {"ccc", "cPc", "ccc"}, - {"ccc", "cPc", "ccc"}, - {"ccc", "cPc", "ccc"}, - {"f~f", "fff", "fff"}, - })) - .addElement('P', lazy(t -> ofBlock(t.getPipeBlock(), t.getPipeMeta()))) - .addElement('c', lazy(t -> - buildHatchAdder(GT_MetaTileEntity_LargeBoiler.class) - .atLeast(OutputHatch) - .casingIndex(t.getCasingTextureIndex()) - .dot(2) - .buildAndChain(onElementPass(GT_MetaTileEntity_LargeBoiler::onCasingAdded, ofBlock(t.getCasingBlock(), t.getCasingMeta()))) - )) - .addElement('f', lazy(t -> - buildHatchAdder(GT_MetaTileEntity_LargeBoiler.class) - .atLeast(Maintenance, InputHatch, InputBus, Muffler) - .casingIndex(t.getFireboxTextureIndex()) - .dot(1) - .buildAndChain(onElementPass(GT_MetaTileEntity_LargeBoiler::onFireboxAdded, ofBlock(t.getFireboxBlock(), t.getFireboxMeta()))) - )) - .build(); - } - }; + private static final ClassValue<IStructureDefinition<GT_MetaTileEntity_LargeBoiler>> STRUCTURE_DEFINITION = + new ClassValue<IStructureDefinition<GT_MetaTileEntity_LargeBoiler>>() { + @Override + protected IStructureDefinition<GT_MetaTileEntity_LargeBoiler> computeValue(Class<?> type) { + return StructureDefinition.<GT_MetaTileEntity_LargeBoiler>builder() + .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][] { + {"ccc", "ccc", "ccc"}, + {"ccc", "cPc", "ccc"}, + {"ccc", "cPc", "ccc"}, + {"ccc", "cPc", "ccc"}, + {"f~f", "fff", "fff"}, + })) + .addElement('P', lazy(t -> ofBlock(t.getPipeBlock(), t.getPipeMeta()))) + .addElement('c', lazy(t -> buildHatchAdder(GT_MetaTileEntity_LargeBoiler.class) + .atLeast(OutputHatch) + .casingIndex(t.getCasingTextureIndex()) + .dot(2) + .buildAndChain(onElementPass( + GT_MetaTileEntity_LargeBoiler::onCasingAdded, + ofBlock(t.getCasingBlock(), t.getCasingMeta()))))) + .addElement('f', lazy(t -> buildHatchAdder(GT_MetaTileEntity_LargeBoiler.class) + .atLeast(Maintenance, InputHatch, InputBus, Muffler) + .casingIndex(t.getFireboxTextureIndex()) + .dot(1) + .buildAndChain(onElementPass( + GT_MetaTileEntity_LargeBoiler::onFireboxAdded, + ofBlock(t.getFireboxBlock(), t.getFireboxMeta()))))) + .build(); + } + }; private boolean firstRun = true; private int mSuperEfficencyIncrease = 0; - private int integratedCircuitConfig = 0; //Steam output is reduced by 1000L per config - private int excessWater = 0; //Eliminate rounding errors for water - private int excessFuel = 0; //Eliminate rounding errors for fuels that burn half items - private int excessProjectedEU = 0; //Eliminate rounding errors from throttling the boiler + private int integratedCircuitConfig = 0; // Steam output is reduced by 1000L per config + private int excessWater = 0; // Eliminate rounding errors for water + private int excessFuel = 0; // Eliminate rounding errors for fuels that burn half items + private int excessProjectedEU = 0; // Eliminate rounding errors from throttling the boiler private int mCasingAmount; private int mFireboxAmount; - protected int pollutionPerSecond = 1; //placeholder for the child classes + protected int pollutionPerSecond = 1; // placeholder for the child classes public GT_MetaTileEntity_LargeBoiler(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -98,26 +98,30 @@ public abstract class GT_MetaTileEntity_LargeBoiler extends GT_MetaTileEntity_En protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Boiler") - .addInfo("Controller block for the Large " + getCasingMaterial() + " Boiler"); - // Tooltip differs between the boilers that output Superheated Steam (Titanium and Tungstensteel) and the ones that do not (Bronze and Steel) - if (isSuperheated()) { - tt.addInfo("Produces " + (getEUt() * 40) * ((runtimeBoost(20) / (20f)) / superToNormalSteam) + "L of Superheated Steam with 1 Coal at " + (getEUt() * 40) / superToNormalSteam + "L/s")//? + tt.addMachineType("Boiler").addInfo("Controller block for the Large " + getCasingMaterial() + " Boiler"); + // Tooltip differs between the boilers that output Superheated Steam (Titanium and Tungstensteel) and the ones + // that do not (Bronze and Steel) + if (isSuperheated()) { + tt.addInfo("Produces " + (getEUt() * 40) * ((runtimeBoost(20) / (20f)) / superToNormalSteam) + + "L of Superheated Steam with 1 Coal at " + (getEUt() * 40) / superToNormalSteam + + "L/s") // ? .addInfo("A programmed circuit in the main block throttles the boiler (-1000L/s per config)") .addInfo("Only some solid fuels are allowed (check the NEI Large Boiler tab for details)") .addInfo("If there are any disallowed fuels in the input bus, the boiler won't run!"); - } - else { - tt.addInfo("Produces " + (getEUt() * 40) * (runtimeBoost(20) / 20f) + "L of Steam with 1 Coal at " + getEUt() * 40 + "L/s")//? + } else { + tt.addInfo("Produces " + (getEUt() * 40) * (runtimeBoost(20) / 20f) + "L of Steam with 1 Coal at " + + getEUt() * 40 + "L/s") // ? .addInfo("A programmed circuit in the main block throttles the boiler (-1000L/s per config)") .addInfo("Solid Fuels with a burn value that is too high or too low will not work"); - } - tt.addInfo(String.format("Diesel fuels have 1/4 efficiency - Takes %.2f seconds to heat up", 500.0 / getEfficiencyIncrease()))//? check semifluid again + } + tt.addInfo(String.format( + "Diesel fuels have 1/4 efficiency - Takes %.2f seconds to heat up", + 500.0 / getEfficiencyIncrease())) // ? check semifluid again .addPollutionAmount(getPollutionPerSecond(null)) .addSeparator() .beginStructureBlock(3, 5, 3, false) .addController("Front bottom") - .addCasingInfo(getCasingMaterial() + " " + getCasingBlockType() + " Casing", 24)//? + .addCasingInfo(getCasingMaterial() + " " + getCasingBlockType() + " Casing", 24) // ? .addOtherStructurePart(getCasingMaterial() + " Fire Boxes", "Bottom layer, 3 minimum") .addOtherStructurePart(getCasingMaterial() + " Pipe Casing Blocks", "Inner 3 blocks") .addMaintenanceHatch("Any firebox", 1) @@ -156,34 +160,59 @@ public abstract class GT_MetaTileEntity_LargeBoiler extends GT_MetaTileEntity_En public abstract int getEfficiencyIncrease(); - public int getIntegratedCircuitConfig(){ + public int getIntegratedCircuitConfig() { return integratedCircuitConfig; } @Override public int getPollutionPerSecond(ItemStack aStack) { - //allows for 0 pollution if circuit throttle is too high - return Math.max(0, (int) (pollutionPerSecond * (1-GT_Mod.gregtechproxy.mPollutionReleasedByThrottle*getIntegratedCircuitConfig()))); + // allows for 0 pollution if circuit throttle is too high + return Math.max(0, (int) (pollutionPerSecond + * (1 - GT_Mod.gregtechproxy.mPollutionReleasedByThrottle * getIntegratedCircuitConfig()))); } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { if (aSide == aFacing) { - if (aActive) return new ITexture[]{ + if (aActive) + return new ITexture[] { BlockIcons.getCasingTextureForId(getCasingTextureIndex()), - TextureFactory.builder().addIcon(OVERLAY_FRONT_LARGE_BOILER_ACTIVE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_LARGE_BOILER_ACTIVE_GLOW).extFacing().glow().build()}; - return new ITexture[]{ - BlockIcons.getCasingTextureForId(getCasingTextureIndex()), - TextureFactory.builder().addIcon(OVERLAY_FRONT_LARGE_BOILER).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_LARGE_BOILER_GLOW).extFacing().glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_LARGE_BOILER_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_LARGE_BOILER_ACTIVE_GLOW) + .extFacing() + .glow() + .build() + }; + return new ITexture[] { + BlockIcons.getCasingTextureForId(getCasingTextureIndex()), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_LARGE_BOILER) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_LARGE_BOILER_GLOW) + .extFacing() + .glow() + .build() + }; } - return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(getCasingTextureIndex())}; + return new ITexture[] {Textures.BlockIcons.getCasingTextureForId(getCasingTextureIndex())}; } @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "LargeBoiler.png"); + return new GT_GUIContainer_MultiMachine( + aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "LargeBoiler.png"); } @Override @@ -192,11 +221,12 @@ public abstract class GT_MetaTileEntity_LargeBoiler extends GT_MetaTileEntity_En } boolean isFuelValid() { - if (!isSuperheated()) - return true; + if (!isSuperheated()) return true; for (ItemStack input : getStoredInputs()) { - if (!GT_Recipe.GT_Recipe_Map_LargeBoilerFakeFuels.isAllowedSolidFuel(input) && !Circuit_Integrated.isStackEqual(input, true, true)) { - //if any item is not in ALLOWED_SOLID_FUELS, operation cannot be allowed because it might still be consumed + if (!GT_Recipe.GT_Recipe_Map_LargeBoilerFakeFuels.isAllowedSolidFuel(input) + && !Circuit_Integrated.isStackEqual(input, true, true)) { + // if any item is not in ALLOWED_SOLID_FUELS, operation cannot be allowed because it might still be + // consumed this.mMaxProgresstime = 0; this.mEUt = 0; return false; @@ -207,9 +237,8 @@ public abstract class GT_MetaTileEntity_LargeBoiler extends GT_MetaTileEntity_En @Override public boolean checkRecipe(ItemStack aStack) { - if (!isFuelValid()) - return false; - //Do we have an integrated circuit with a valid configuration? + if (!isFuelValid()) return false; + // Do we have an integrated circuit with a valid configuration? if (Circuit_Integrated.isStackEqual(mInventory[1], true, true)) { int circuit_config = mInventory[1].getItemDamage(); if (circuit_config >= 1 && circuit_config <= 25) { @@ -217,7 +246,7 @@ public abstract class GT_MetaTileEntity_LargeBoiler extends GT_MetaTileEntity_En this.integratedCircuitConfig = circuit_config; } } else { - //If not, set the config to zero + // If not, set the config to zero this.integratedCircuitConfig = 0; } @@ -240,7 +269,8 @@ public abstract class GT_MetaTileEntity_LargeBoiler extends GT_MetaTileEntity_En if (tFluid != null) { tFluid.amount = 1000; if (depleteInput(tFluid)) { - this.mMaxProgresstime = adjustBurnTimeForConfig(Math.max(1, runtimeBoost(tRecipe.mSpecialValue * 2))); + this.mMaxProgresstime = + adjustBurnTimeForConfig(Math.max(1, runtimeBoost(tRecipe.mSpecialValue * 2))); this.mEUt = adjustEUtForConfig(getEUt()); this.mEfficiencyIncrease = this.mMaxProgresstime * getEfficiencyIncrease(); return true; @@ -253,15 +283,16 @@ public abstract class GT_MetaTileEntity_LargeBoiler extends GT_MetaTileEntity_En if (!tInputList.isEmpty()) { if (isSuperheated()) { for (ItemStack tInput : tInputList) { - if (tInput != GT_OreDictUnificator.get(OrePrefixes.bucket, Materials.Lava, 1)){ - if (GT_Utility.getFluidForFilledItem(tInput, true) == null && (this.mMaxProgresstime = GT_ModHandler.getFuelValue(tInput) / 80) > 0) { + if (tInput != GT_OreDictUnificator.get(OrePrefixes.bucket, Materials.Lava, 1)) { + if (GT_Utility.getFluidForFilledItem(tInput, true) == null + && (this.mMaxProgresstime = GT_ModHandler.getFuelValue(tInput) / 80) > 0) { this.excessFuel += GT_ModHandler.getFuelValue(tInput) % 80; this.mMaxProgresstime += this.excessFuel / 80; this.excessFuel %= 80; this.mMaxProgresstime = adjustBurnTimeForConfig(runtimeBoost(this.mMaxProgresstime)); this.mEUt = adjustEUtForConfig(getEUt()); this.mEfficiencyIncrease = this.mMaxProgresstime * getEfficiencyIncrease(); - this.mOutputItems = new ItemStack[]{GT_Utility.getContainerItem(tInput, true)}; + this.mOutputItems = new ItemStack[] {GT_Utility.getContainerItem(tInput, true)}; tInput.stackSize -= 1; updateSlots(); if (this.mEfficiencyIncrease > 5000) { @@ -272,19 +303,22 @@ public abstract class GT_MetaTileEntity_LargeBoiler extends GT_MetaTileEntity_En } } } - } - else { + } else { for (ItemStack tInput : tInputList) { - if (tInput != GT_OreDictUnificator.get(OrePrefixes.bucket, Materials.Lava, 1)){ - // Solid fuels with burn values below getEUt are ignored (mostly items like sticks), and also those with very high fuel values that would cause an overflow error. - if (GT_Utility.getFluidForFilledItem(tInput, true) == null && (this.mMaxProgresstime = GT_ModHandler.getFuelValue(tInput) / 80) > 0 && (GT_ModHandler.getFuelValue(tInput) * 2 / this.getEUt()) > 1 && GT_ModHandler.getFuelValue(tInput) < 100000000) { + if (tInput != GT_OreDictUnificator.get(OrePrefixes.bucket, Materials.Lava, 1)) { + // Solid fuels with burn values below getEUt are ignored (mostly items like sticks), and also + // those with very high fuel values that would cause an overflow error. + if (GT_Utility.getFluidForFilledItem(tInput, true) == null + && (this.mMaxProgresstime = GT_ModHandler.getFuelValue(tInput) / 80) > 0 + && (GT_ModHandler.getFuelValue(tInput) * 2 / this.getEUt()) > 1 + && GT_ModHandler.getFuelValue(tInput) < 100000000) { this.excessFuel += GT_ModHandler.getFuelValue(tInput) % 80; this.mMaxProgresstime += this.excessFuel / 80; this.excessFuel %= 80; this.mMaxProgresstime = adjustBurnTimeForConfig(runtimeBoost(this.mMaxProgresstime)); this.mEUt = adjustEUtForConfig(getEUt()); this.mEfficiencyIncrease = this.mMaxProgresstime * getEfficiencyIncrease(); - this.mOutputItems = new ItemStack[]{GT_Utility.getContainerItem(tInput, true)}; + this.mOutputItems = new ItemStack[] {GT_Utility.getContainerItem(tInput, true)}; tInput.stackSize -= 1; updateSlots(); if (this.mEfficiencyIncrease > 5000) { @@ -296,7 +330,6 @@ public abstract class GT_MetaTileEntity_LargeBoiler extends GT_MetaTileEntity_En } } } - } this.mMaxProgresstime = 0; this.mEUt = 0; @@ -307,13 +340,17 @@ public abstract class GT_MetaTileEntity_LargeBoiler extends GT_MetaTileEntity_En abstract boolean isSuperheated(); - final private int superToNormalSteam = 3; + private final int superToNormalSteam = 3; @Override public boolean onRunningTick(ItemStack aStack) { if (this.mEUt > 0) { if (this.mSuperEfficencyIncrease > 0) - mEfficiency = Math.max(0, Math.min(mEfficiency + mSuperEfficencyIncrease, getMaxEfficiency(mInventory[1]) - ((getIdealStatus() - getRepairStatus()) * 1000))); + mEfficiency = Math.max( + 0, + Math.min( + mEfficiency + mSuperEfficencyIncrease, + getMaxEfficiency(mInventory[1]) - ((getIdealStatus() - getRepairStatus()) * 1000))); int tGeneratedEU = (int) (this.mEUt * 2L * this.mEfficiency / 10000L); if (tGeneratedEU > 0) { long amount = (tGeneratedEU + STEAM_PER_WATER) / STEAM_PER_WATER; @@ -321,24 +358,26 @@ public abstract class GT_MetaTileEntity_LargeBoiler extends GT_MetaTileEntity_En amount -= excessWater / STEAM_PER_WATER; excessWater %= STEAM_PER_WATER; if (isSuperheated()) { - // Consumes only one third of the water if producing Superheated Steam, to maintain water in the chain. - if (depleteInput(Materials.Water.getFluid(amount / superToNormalSteam)) || depleteInput(GT_ModHandler.getDistilledWater(amount / superToNormalSteam))) { - // Outputs Superheated Steam instead of Steam, at one third of the amount (equivalent in power output to the normal Steam amount). - addOutput(FluidRegistry.getFluidStack("ic2superheatedsteam", tGeneratedEU / superToNormalSteam)); + // Consumes only one third of the water if producing Superheated Steam, to maintain water in the + // chain. + if (depleteInput(Materials.Water.getFluid(amount / superToNormalSteam)) + || depleteInput(GT_ModHandler.getDistilledWater(amount / superToNormalSteam))) { + // Outputs Superheated Steam instead of Steam, at one third of the amount (equivalent in power + // output to the normal Steam amount). + addOutput( + FluidRegistry.getFluidStack("ic2superheatedsteam", tGeneratedEU / superToNormalSteam)); } else { GT_Log.exp.println("Boiler " + this.mName + " had no Water!"); explodeMultiblock(); } - } - - else { - if (depleteInput(Materials.Water.getFluid(amount)) || depleteInput(GT_ModHandler.getDistilledWater(amount))) { + } else { + if (depleteInput(Materials.Water.getFluid(amount)) + || depleteInput(GT_ModHandler.getDistilledWater(amount))) { addOutput(GT_ModHandler.getSteam(tGeneratedEU)); } else { GT_Log.exp.println("Boiler " + this.mName + " had no Water!"); explodeMultiblock(); } - } } return true; @@ -366,7 +405,9 @@ public abstract class GT_MetaTileEntity_LargeBoiler extends GT_MetaTileEntity_En public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (mProgresstime > 0 && firstRun) { firstRun = false; - GT_Mod.achievements.issueAchievement(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), "extremepressure"); + GT_Mod.achievements.issueAchievement( + aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), + "extremepressure"); } super.onPostTick(aBaseMetaTileEntity, aTick); } @@ -388,8 +429,11 @@ public abstract class GT_MetaTileEntity_LargeBoiler extends GT_MetaTileEntity_En public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { mCasingAmount = 0; mFireboxAmount = 0; - return checkPiece(STRUCTURE_PIECE_MAIN, 1, 4, 0) && mCasingAmount >= 24 && mFireboxAmount >= 3 && - mMaintenanceHatches.size() == 1 && !mMufflerHatches.isEmpty(); + return checkPiece(STRUCTURE_PIECE_MAIN, 1, 4, 0) + && mCasingAmount >= 24 + && mFireboxAmount >= 3 + && mMaintenanceHatches.size() == 1 + && !mMufflerHatches.isEmpty(); } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Bronze.java index 0fa1b98f59..970000da11 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Bronze.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Bronze.java @@ -5,7 +5,6 @@ import gregtech.api.GregTech_API; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; public class GT_MetaTileEntity_LargeBoiler_Bronze extends GT_MetaTileEntity_LargeBoiler { @@ -25,8 +24,8 @@ public class GT_MetaTileEntity_LargeBoiler_Bronze extends GT_MetaTileEntity_Larg } @Override - public String getCasingMaterial(){ - return "Bronze"; + public String getCasingMaterial() { + return "Bronze"; } @Override @@ -90,5 +89,7 @@ public class GT_MetaTileEntity_LargeBoiler_Bronze extends GT_MetaTileEntity_Larg } @Override - boolean isSuperheated() { return false; } + boolean isSuperheated() { + return false; + } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Steel.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Steel.java index 2ed236f676..bc30228b3a 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Steel.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Steel.java @@ -5,7 +5,6 @@ import gregtech.api.GregTech_API; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; public class GT_MetaTileEntity_LargeBoiler_Steel extends GT_MetaTileEntity_LargeBoiler { public GT_MetaTileEntity_LargeBoiler_Steel(int aID, String aName, String aNameRegional) { @@ -24,8 +23,8 @@ public class GT_MetaTileEntity_LargeBoiler_Steel extends GT_MetaTileEntity_Large } @Override - public String getCasingMaterial(){ - return "Steel"; + public String getCasingMaterial() { + return "Steel"; } @Override @@ -84,8 +83,12 @@ public class GT_MetaTileEntity_LargeBoiler_Steel extends GT_MetaTileEntity_Large } @Override - int runtimeBoost(int mTime) { return mTime; } + int runtimeBoost(int mTime) { + return mTime; + } @Override - boolean isSuperheated() { return false; } + boolean isSuperheated() { + return false; + } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java index 8ae4b6034a..bda83f7210 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java @@ -4,9 +4,7 @@ import gregtech.GT_Mod; import gregtech.api.GregTech_API; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.util.GT_Recipe.GT_Recipe_Map_LargeBoilerFakeFuels; import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; public class GT_MetaTileEntity_LargeBoiler_Titanium extends GT_MetaTileEntity_LargeBoiler { public GT_MetaTileEntity_LargeBoiler_Titanium(int aID, String aName, String aNameRegional) { @@ -25,14 +23,14 @@ public class GT_MetaTileEntity_LargeBoiler_Titanium extends GT_MetaTileEntity_La } @Override - public String getCasingMaterial(){ - return "Titanium"; + public String getCasingMaterial() { + return "Titanium"; } - @Override - public String getCasingBlockType() { - return "Machine Casings"; - } + @Override + public String getCasingBlockType() { + return "Machine Casings"; + } @Override public Block getCasingBlock() { @@ -90,5 +88,7 @@ public class GT_MetaTileEntity_LargeBoiler_Titanium extends GT_MetaTileEntity_La } @Override - boolean isSuperheated() { return true; } + boolean isSuperheated() { + return true; + } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java index e1e6e18091..3b73b4f407 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java @@ -4,9 +4,7 @@ import gregtech.GT_Mod; import gregtech.api.GregTech_API; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.util.GT_Recipe.GT_Recipe_Map_LargeBoilerFakeFuels; import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; public class GT_MetaTileEntity_LargeBoiler_TungstenSteel extends GT_MetaTileEntity_LargeBoiler { public GT_MetaTileEntity_LargeBoiler_TungstenSteel(int aID, String aName, String aNameRegional) { @@ -25,8 +23,8 @@ public class GT_MetaTileEntity_LargeBoiler_TungstenSteel extends GT_MetaTileEnti } @Override - public String getCasingMaterial(){ - return "TungstenSteel"; + public String getCasingMaterial() { + return "TungstenSteel"; } @Override @@ -85,8 +83,12 @@ public class GT_MetaTileEntity_LargeBoiler_TungstenSteel extends GT_MetaTileEnti } @Override - int runtimeBoost(int mTime) { return mTime * 120 / 750; } + int runtimeBoost(int mTime) { + return mTime * 120 / 750; + } @Override - boolean isSuperheated() { return true; } + boolean isSuperheated() { + return true; + } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeChemicalReactor.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeChemicalReactor.java index 54758167f1..d27bd429af 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeChemicalReactor.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeChemicalReactor.java @@ -1,5 +1,16 @@ package gregtech.common.tileentities.machines.multi; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; +import static gregtech.api.enums.GT_HatchElement.*; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages; +import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; + import com.gtnewhorizon.structurelib.StructureLibAPI; import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.*; @@ -17,6 +28,8 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Single_Recipe_Check; import gregtech.api.util.GT_Utility; +import java.util.ArrayList; +import java.util.function.Consumer; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.InventoryPlayer; @@ -25,48 +38,40 @@ import net.minecraft.util.IChatComponent; import net.minecraft.world.World; import net.minecraftforge.fluids.FluidStack; -import java.util.ArrayList; -import java.util.function.Consumer; - -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; -import static gregtech.api.enums.GT_HatchElement.*; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE_GLOW; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_GLOW; -import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages; -import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; -import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; - -public class GT_MetaTileEntity_LargeChemicalReactor extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_LargeChemicalReactor> implements ISurvivalConstructable { +public class GT_MetaTileEntity_LargeChemicalReactor + extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_LargeChemicalReactor> + implements ISurvivalConstructable { private static final int CASING_INDEX = 176; private static final String STRUCTURE_PIECE_MAIN = "main"; - private static final IStructureDefinition<GT_MetaTileEntity_LargeChemicalReactor> STRUCTURE_DEFINITION = StructureDefinition.<GT_MetaTileEntity_LargeChemicalReactor>builder() - .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{ - {"ccc", "cxc", "ccc"}, - {"c~c", "xPx", "cxc"}, - {"ccc", "cxc", "ccc"}, - })) - .addElement('P', ofBlock(GregTech_API.sBlockCasings8, 1)) - .addElement('c', buildHatchAdder(GT_MetaTileEntity_LargeChemicalReactor.class) - .atLeast(InputHatch, OutputHatch, InputBus, OutputBus, Maintenance, Energy) - .casingIndex(CASING_INDEX) - .dot(1) - .buildAndChain(onElementPass(GT_MetaTileEntity_LargeChemicalReactor::onCasingAdded, ofBlock(GregTech_API.sBlockCasings8, 0)) - )) - .addElement('x', buildHatchAdder(GT_MetaTileEntity_LargeChemicalReactor.class) - .atLeast(InputHatch, OutputHatch, InputBus, OutputBus, Maintenance, Energy) - .casingIndex(CASING_INDEX) - .dot(1) - .buildAndChain( - CoilStructureElement.INSTANCE, - onElementPass(GT_MetaTileEntity_LargeChemicalReactor::onCasingAdded, ofBlock(GregTech_API.sBlockCasings8, 0)) - ) - ) - .build(); + private static final IStructureDefinition<GT_MetaTileEntity_LargeChemicalReactor> STRUCTURE_DEFINITION = + StructureDefinition.<GT_MetaTileEntity_LargeChemicalReactor>builder() + .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][] { + {"ccc", "cxc", "ccc"}, + {"c~c", "xPx", "cxc"}, + {"ccc", "cxc", "ccc"}, + })) + .addElement('P', ofBlock(GregTech_API.sBlockCasings8, 1)) + .addElement( + 'c', + buildHatchAdder(GT_MetaTileEntity_LargeChemicalReactor.class) + .atLeast(InputHatch, OutputHatch, InputBus, OutputBus, Maintenance, Energy) + .casingIndex(CASING_INDEX) + .dot(1) + .buildAndChain(onElementPass( + GT_MetaTileEntity_LargeChemicalReactor::onCasingAdded, + ofBlock(GregTech_API.sBlockCasings8, 0)))) + .addElement( + 'x', + buildHatchAdder(GT_MetaTileEntity_LargeChemicalReactor.class) + .atLeast(InputHatch, OutputHatch, InputBus, OutputBus, Maintenance, Energy) + .casingIndex(CASING_INDEX) + .dot(1) + .buildAndChain( + CoilStructureElement.INSTANCE, + onElementPass( + GT_MetaTileEntity_LargeChemicalReactor::onCasingAdded, + ofBlock(GregTech_API.sBlockCasings8, 0)))) + .build(); private int mCasingAmount; private int mCoilAmount; @@ -109,24 +114,47 @@ public class GT_MetaTileEntity_LargeChemicalReactor extends GT_MetaTileEntity_En } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, - boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { if (aSide == aFacing) { - if (aActive) return new ITexture[]{ - casingTexturePages[1][48], - TextureFactory.builder().addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE_GLOW).extFacing().glow().build()}; - return new ITexture[]{ + if (aActive) + return new ITexture[] { casingTexturePages[1][48], - TextureFactory.builder().addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_GLOW).extFacing().glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE_GLOW) + .extFacing() + .glow() + .build() + }; + return new ITexture[] { + casingTexturePages[1][48], + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_GLOW) + .extFacing() + .glow() + .build() + }; } - return new ITexture[]{casingTexturePages[1][48]}; + return new ITexture[] {casingTexturePages[1][48]}; } @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "LargeChemicalReactor.png"); + return new GT_GUIContainer_MultiMachine( + aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "LargeChemicalReactor.png"); } @Override @@ -168,15 +196,16 @@ public class GT_MetaTileEntity_LargeChemicalReactor extends GT_MetaTileEntity_En tSingleRecipeCheckBuilder = GT_Single_Recipe_Check.builder(this).setBefore(); } - tRecipe = GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes.findRecipe(getBaseMetaTileEntity(), false, - false, gregtech.api.enums.GT_Values.V[tier], fluids, inputs); + tRecipe = GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes.findRecipe( + getBaseMetaTileEntity(), false, false, gregtech.api.enums.GT_Values.V[tier], fluids, inputs); if (tRecipe == null || !tRecipe.isRecipeInputEqual(true, fluids, inputs)) { return false; } if (mLockedToSingleRecipe) { - mSingleRecipeCheck = tSingleRecipeCheckBuilder.setAfter().setRecipe(tRecipe).build(); + mSingleRecipeCheck = + tSingleRecipeCheckBuilder.setAfter().setRecipe(tRecipe).build(); } } @@ -184,9 +213,8 @@ public class GT_MetaTileEntity_LargeChemicalReactor extends GT_MetaTileEntity_En this.mEfficiencyIncrease = 10000; calculatePerfectOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, 1, tVoltage); - //In case recipe is too OP for that machine - if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) - return false; + // In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return false; if (this.mEUt > 0) { this.mEUt = (-this.mEUt); } @@ -214,9 +242,11 @@ public class GT_MetaTileEntity_LargeChemicalReactor extends GT_MetaTileEntity_En public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { mCasingAmount = 0; mCoilAmount = 0; - return checkPiece(STRUCTURE_PIECE_MAIN, 1, 1, 0) && - mCasingAmount >= 8 && mCoilAmount == 1 && - !mEnergyHatches.isEmpty() && mMaintenanceHatches.size() == 1; + return checkPiece(STRUCTURE_PIECE_MAIN, 1, 1, 0) + && mCasingAmount >= 8 + && mCoilAmount == 1 + && !mEnergyHatches.isEmpty() + && mMaintenanceHatches.size() == 1; } @Override @@ -253,7 +283,8 @@ public class GT_MetaTileEntity_LargeChemicalReactor extends GT_MetaTileEntity_En @Override public boolean check(GT_MetaTileEntity_LargeChemicalReactor t, World world, int x, int y, int z) { Block block = world.getBlock(x, y, z); - if (block instanceof IHeatingCoil && ((IHeatingCoil) block).getCoilHeat(world.getBlockMetadata(x, y, z)) != HeatingCoilLevel.None) { + if (block instanceof IHeatingCoil + && ((IHeatingCoil) block).getCoilHeat(world.getBlockMetadata(x, y, z)) != HeatingCoilLevel.None) { return t.mCoilAmount++ == 0; } else { return false; @@ -261,13 +292,15 @@ public class GT_MetaTileEntity_LargeChemicalReactor extends GT_MetaTileEntity_En } @Override - public boolean spawnHint(GT_MetaTileEntity_LargeChemicalReactor t, World world, int x, int y, int z, ItemStack trigger) { + public boolean spawnHint( + GT_MetaTileEntity_LargeChemicalReactor t, World world, int x, int y, int z, ItemStack trigger) { StructureLibAPI.hintParticle(world, x, y, z, GregTech_API.sBlockCasings5, 0); return true; } @Override - public boolean placeBlock(GT_MetaTileEntity_LargeChemicalReactor t, World world, int x, int y, int z, ItemStack trigger) { + public boolean placeBlock( + GT_MetaTileEntity_LargeChemicalReactor t, World world, int x, int y, int z, ItemStack trigger) { if (t.mCoilAmount > 0) return false; boolean b = world.setBlock(x, y, z, GregTech_API.sBlockCasings5, 0, 3); if (b) t.mCoilAmount++; @@ -275,13 +308,23 @@ public class GT_MetaTileEntity_LargeChemicalReactor extends GT_MetaTileEntity_En } @Override - public PlaceResult survivalPlaceBlock(GT_MetaTileEntity_LargeChemicalReactor t, World world, int x, int y, int z, ItemStack trigger, IItemSource s, EntityPlayerMP actor, Consumer<IChatComponent> chatter) { + public PlaceResult survivalPlaceBlock( + GT_MetaTileEntity_LargeChemicalReactor t, + World world, + int x, + int y, + int z, + ItemStack trigger, + IItemSource s, + EntityPlayerMP actor, + Consumer<IChatComponent> chatter) { if (t.mCoilAmount > 0) return PlaceResult.SKIP; - if (check(t, world, x, y,z)) return PlaceResult.SKIP; + if (check(t, world, x, y, z)) return PlaceResult.SKIP; if (!StructureLibAPI.isBlockTriviallyReplaceable(world, x, y, z, actor)) return PlaceResult.REJECT; ItemStack result = s.takeOne(ItemStackPredicate.from(GregTech_API.sBlockCasings5), true); if (result == null) return PlaceResult.REJECT; - PlaceResult ret = StructureUtility.survivalPlaceBlock(result, ItemStackPredicate.NBTMode.EXACT, null, true, world, x, y, z, s, actor, chatter); + PlaceResult ret = StructureUtility.survivalPlaceBlock( + result, ItemStackPredicate.NBTMode.EXACT, null, true, world, x, y, z, s, actor, chatter); if (ret == PlaceResult.ACCEPT) t.mCoilAmount++; return ret; } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine.java index fcf87d8a34..3593e73d8d 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine.java @@ -1,5 +1,11 @@ package gregtech.common.tileentities.machines.multi; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.lazy; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; +import static gregtech.api.enums.GT_HatchElement.*; +import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; + import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IItemSource; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; @@ -13,6 +19,7 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Dynam import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; import gregtech.api.util.GT_Utility; import gregtech.common.items.GT_MetaGenerated_Tool_01; +import java.util.ArrayList; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.InventoryPlayer; @@ -23,43 +30,49 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; import net.minecraftforge.fluids.FluidStack; -import java.util.ArrayList; - -import static com.gtnewhorizon.structurelib.structure.StructureUtility.lazy; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; -import static gregtech.api.enums.GT_HatchElement.*; -import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; -import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; -import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional; - -public abstract class GT_MetaTileEntity_LargeTurbine extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_LargeTurbine> implements ISurvivalConstructable { +public abstract class GT_MetaTileEntity_LargeTurbine + extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_LargeTurbine> + implements ISurvivalConstructable { private static final String STRUCTURE_PIECE_MAIN = "main"; - private static final ClassValue<IStructureDefinition<GT_MetaTileEntity_LargeTurbine>> STRUCTURE_DEFINITION = new ClassValue<IStructureDefinition<GT_MetaTileEntity_LargeTurbine>>() { - @Override - protected IStructureDefinition<GT_MetaTileEntity_LargeTurbine> computeValue(Class<?> type) { - return StructureDefinition.<GT_MetaTileEntity_LargeTurbine>builder() - .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{ - {" ", "xxxxx", "xxxxx", "xxxxx", "xxxxx",}, - {" --- ", "xcccx", "xhhhx", "xhhhx", "xhhhx",}, - {" --- ", "xc~cx", "xh-hx", "xh-hx", "xhdhx",}, - {" --- ", "xcccx", "xhhhx", "xhhhx", "xhhhx",}, - {" ", "xxxxx", "xxxxx", "xxxxx", "xxxxx",}, - })) - .addElement('c', lazy(t -> ofBlock(t.getCasingBlock(), t.getCasingMeta()))) - .addElement('d', lazy(t -> Dynamo.newAny(t.getCasingTextureIndex(), 1))) - .addElement('h', lazy(t -> buildHatchAdder(GT_MetaTileEntity_LargeTurbine.class) - .atLeast(Maintenance, InputHatch, OutputHatch, OutputBus, InputBus, Muffler) - .casingIndex(t.getCasingTextureIndex()) - .dot(2) - .buildAndChain(t.getCasingBlock(), t.getCasingMeta()))) - .addElement('x', (IStructureElementCheckOnly<GT_MetaTileEntity_LargeTurbine>) (aContext, aWorld, aX, aY, aZ) -> { - TileEntity tTile = aWorld.getTileEntity(aX, aY, aZ); - return !(tTile instanceof IGregTechTileEntity) || !(((IGregTechTileEntity) tTile).getMetaTileEntity() instanceof GT_MetaTileEntity_LargeTurbine); - }) - .build(); - } - }; + private static final ClassValue<IStructureDefinition<GT_MetaTileEntity_LargeTurbine>> STRUCTURE_DEFINITION = + new ClassValue<IStructureDefinition<GT_MetaTileEntity_LargeTurbine>>() { + @Override + protected IStructureDefinition<GT_MetaTileEntity_LargeTurbine> computeValue(Class<?> type) { + return StructureDefinition.<GT_MetaTileEntity_LargeTurbine>builder() + .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][] { + { + " ", "xxxxx", "xxxxx", "xxxxx", "xxxxx", + }, + { + " --- ", "xcccx", "xhhhx", "xhhhx", "xhhhx", + }, + { + " --- ", "xc~cx", "xh-hx", "xh-hx", "xhdhx", + }, + { + " --- ", "xcccx", "xhhhx", "xhhhx", "xhhhx", + }, + { + " ", "xxxxx", "xxxxx", "xxxxx", "xxxxx", + }, + })) + .addElement('c', lazy(t -> ofBlock(t.getCasingBlock(), t.getCasingMeta()))) + .addElement('d', lazy(t -> Dynamo.newAny(t.getCasingTextureIndex(), 1))) + .addElement('h', lazy(t -> buildHatchAdder(GT_MetaTileEntity_LargeTurbine.class) + .atLeast(Maintenance, InputHatch, OutputHatch, OutputBus, InputBus, Muffler) + .casingIndex(t.getCasingTextureIndex()) + .dot(2) + .buildAndChain(t.getCasingBlock(), t.getCasingMeta()))) + .addElement('x', (IStructureElementCheckOnly<GT_MetaTileEntity_LargeTurbine>) + (aContext, aWorld, aX, aY, aZ) -> { + TileEntity tTile = aWorld.getTileEntity(aX, aY, aZ); + return !(tTile instanceof IGregTechTileEntity) + || !(((IGregTechTileEntity) tTile).getMetaTileEntity() + instanceof GT_MetaTileEntity_LargeTurbine); + }) + .build(); + } + }; protected int baseEff = 0; protected int optFlow = 0; @@ -68,7 +81,7 @@ public abstract class GT_MetaTileEntity_LargeTurbine extends GT_MetaTileEntity_E protected int counter = 0; protected boolean looseFit = false; protected int overflowMultiplier = 0; - protected float[] flowMultipliers = new float[]{1, 1, 1}; + protected float[] flowMultipliers = new float[] {1, 1, 1}; public GT_MetaTileEntity_LargeTurbine(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -85,7 +98,8 @@ public abstract class GT_MetaTileEntity_LargeTurbine extends GT_MetaTileEntity_E @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "LargeTurbine.png"); + return new GT_GUIContainer_MultiMachine( + aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "LargeTurbine.png"); } @Override @@ -95,7 +109,9 @@ public abstract class GT_MetaTileEntity_LargeTurbine extends GT_MetaTileEntity_E @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { - return checkPiece(STRUCTURE_PIECE_MAIN, 2, 2, 1) && mMaintenanceHatches.size() == 1 && mMufflerHatches.isEmpty() == (getPollutionPerTick(null) == 0); + return checkPiece(STRUCTURE_PIECE_MAIN, 2, 2, 1) + && mMaintenanceHatches.size() == 1 + && mMufflerHatches.isEmpty() == (getPollutionPerTick(null) == 0); } public abstract Block getCasingBlock(); @@ -106,7 +122,10 @@ public abstract class GT_MetaTileEntity_LargeTurbine extends GT_MetaTileEntity_E @Override public boolean addToMachineList(IGregTechTileEntity tTileEntity, int aBaseCasingIndex) { - return addMaintenanceToMachineList(tTileEntity, getCasingTextureIndex()) || addInputToMachineList(tTileEntity, getCasingTextureIndex()) || addOutputToMachineList(tTileEntity, getCasingTextureIndex()) || addMufflerToMachineList(tTileEntity, getCasingTextureIndex()); + return addMaintenanceToMachineList(tTileEntity, getCasingTextureIndex()) + || addInputToMachineList(tTileEntity, getCasingTextureIndex()) + || addOutputToMachineList(tTileEntity, getCasingTextureIndex()) + || addMufflerToMachineList(tTileEntity, getCasingTextureIndex()); } @Override @@ -121,19 +140,30 @@ public abstract class GT_MetaTileEntity_LargeTurbine extends GT_MetaTileEntity_E @Override public boolean checkRecipe(ItemStack aStack) { - if ((counter & 7) == 0 && (aStack == null || !(aStack.getItem() instanceof GT_MetaGenerated_Tool) || aStack.getItemDamage() < 170 || aStack.getItemDamage() > 179)) { + if ((counter & 7) == 0 + && (aStack == null + || !(aStack.getItem() instanceof GT_MetaGenerated_Tool) + || aStack.getItemDamage() < 170 + || aStack.getItemDamage() > 179)) { stopMachine(); return false; } ArrayList<FluidStack> tFluids = getStoredFluids(); if (tFluids.size() > 0) { - if (baseEff == 0 || optFlow == 0 || counter >= 512 || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled() + if (baseEff == 0 + || optFlow == 0 + || counter >= 512 + || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled() || this.getBaseMetaTileEntity().hasInventoryBeenModified()) { counter = 0; - baseEff = GT_Utility.safeInt((long) ((5F + ((GT_MetaGenerated_Tool) aStack.getItem()).getToolCombatDamage(aStack)) * 1000F)); - optFlow = GT_Utility.safeInt((long) Math.max(Float.MIN_NORMAL, - ((GT_MetaGenerated_Tool) aStack.getItem()).getToolStats(aStack).getSpeedMultiplier() + baseEff = GT_Utility.safeInt( + (long) ((5F + ((GT_MetaGenerated_Tool) aStack.getItem()).getToolCombatDamage(aStack)) * 1000F)); + optFlow = GT_Utility.safeInt((long) Math.max( + Float.MIN_NORMAL, + ((GT_MetaGenerated_Tool) aStack.getItem()) + .getToolStats(aStack) + .getSpeedMultiplier() * GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mToolSpeed * 50)); @@ -143,8 +173,8 @@ public abstract class GT_MetaTileEntity_LargeTurbine extends GT_MetaTileEntity_E flowMultipliers[1] = GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mGasMultiplier; flowMultipliers[2] = GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mPlasmaMultiplier; - if(optFlow<=0 || baseEff<=0){ - stopMachine();//in case the turbine got removed + if (optFlow <= 0 || baseEff <= 0) { + stopMachine(); // in case the turbine got removed return false; } } else { @@ -152,23 +182,28 @@ public abstract class GT_MetaTileEntity_LargeTurbine extends GT_MetaTileEntity_E } } - int newPower = fluidIntoPower(tFluids, optFlow, baseEff, overflowMultiplier, flowMultipliers); // How much the turbine should be producing with this flow + int newPower = fluidIntoPower( + tFluids, + optFlow, + baseEff, + overflowMultiplier, + flowMultipliers); // How much the turbine should be producing with this flow int difference = newPower - this.mEUt; // difference between current output and new output - // Magic numbers: can always change by at least 10 eu/t, but otherwise by at most 1 percent of the difference in power level (per tick) + // Magic numbers: can always change by at least 10 eu/t, but otherwise by at most 1 percent of the difference in + // power level (per tick) // This is how much the turbine can actually change during this tick - int maxChangeAllowed = Math.max(10, GT_Utility.safeInt((long)Math.abs(difference)/100)); + int maxChangeAllowed = Math.max(10, GT_Utility.safeInt((long) Math.abs(difference) / 100)); if (Math.abs(difference) > maxChangeAllowed) { // If this difference is too big, use the maximum allowed change int change = maxChangeAllowed * (difference > 0 ? 1 : -1); // Make the change positive or negative. this.mEUt += change; // Apply the change - } else - this.mEUt = newPower; + } else this.mEUt = newPower; if (this.mEUt <= 0) { - //stopMachine(); - this.mEUt=0; - this.mEfficiency=0; + // stopMachine(); + this.mEUt = 0; + this.mEfficiency = 0; return false; } else { this.mMaxProgresstime = 1; @@ -178,7 +213,8 @@ public abstract class GT_MetaTileEntity_LargeTurbine extends GT_MetaTileEntity_E } } - abstract int fluidIntoPower(ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff, int overflowMultiplier, float[] flowMultipliers); + abstract int fluidIntoPower( + ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff, int overflowMultiplier, float[] flowMultipliers); abstract float getOverflowEfficiency(int totalFlow, int actualOptimalFlow, int overflowMultiplier); @@ -199,11 +235,9 @@ public abstract class GT_MetaTileEntity_LargeTurbine extends GT_MetaTileEntity_E int toolQualityLevel = GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mToolQuality; if (toolQualityLevel >= 6) { aOverflowMultiplier = 3; - } - else if (toolQualityLevel >= 3) { + } else if (toolQualityLevel >= 3) { aOverflowMultiplier = 2; - } - else { + } else { aOverflowMultiplier = 1; } return aOverflowMultiplier; @@ -232,58 +266,74 @@ public abstract class GT_MetaTileEntity_LargeTurbine extends GT_MetaTileEntity_E @Override public String[] getInfoData() { - int mPollutionReduction=0; + int mPollutionReduction = 0; for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) { if (isValidMetaTileEntity(tHatch)) { - mPollutionReduction=Math.max(tHatch.calculatePollutionReduction(100),mPollutionReduction); + mPollutionReduction = Math.max(tHatch.calculatePollutionReduction(100), mPollutionReduction); } } - String tRunning = mMaxProgresstime>0 ? - - EnumChatFormatting.GREEN+StatCollector.translateToLocal("GT5U.turbine.running.true")+EnumChatFormatting.RESET : - EnumChatFormatting.RED+StatCollector.translateToLocal("GT5U.turbine.running.false")+EnumChatFormatting.RESET; - String tMaintainance = getIdealStatus() == getRepairStatus() ? - EnumChatFormatting.GREEN+StatCollector.translateToLocal("GT5U.turbine.maintenance.false")+EnumChatFormatting.RESET : - EnumChatFormatting.RED+StatCollector.translateToLocal("GT5U.turbine.maintenance.true")+EnumChatFormatting.RESET ; + String tRunning = mMaxProgresstime > 0 + ? EnumChatFormatting.GREEN + + StatCollector.translateToLocal("GT5U.turbine.running.true") + + EnumChatFormatting.RESET + : EnumChatFormatting.RED + + StatCollector.translateToLocal("GT5U.turbine.running.false") + + EnumChatFormatting.RESET; + String tMaintainance = getIdealStatus() == getRepairStatus() + ? EnumChatFormatting.GREEN + + StatCollector.translateToLocal("GT5U.turbine.maintenance.false") + + EnumChatFormatting.RESET + : EnumChatFormatting.RED + + StatCollector.translateToLocal("GT5U.turbine.maintenance.true") + + EnumChatFormatting.RESET; int tDura = 0; if (mInventory[1] != null && mInventory[1].getItem() instanceof GT_MetaGenerated_Tool_01) { - tDura = GT_Utility.safeInt((long)(100.0f / GT_MetaGenerated_Tool.getToolMaxDamage(mInventory[1]) * (GT_MetaGenerated_Tool.getToolDamage(mInventory[1]))+1)); + tDura = GT_Utility.safeInt((long) (100.0f + / GT_MetaGenerated_Tool.getToolMaxDamage(mInventory[1]) + * (GT_MetaGenerated_Tool.getToolDamage(mInventory[1])) + + 1)); } - long storedEnergy=0; - long maxEnergy=0; - for(GT_MetaTileEntity_Hatch_Dynamo tHatch : mDynamoHatches) { + long storedEnergy = 0; + long maxEnergy = 0; + for (GT_MetaTileEntity_Hatch_Dynamo tHatch : mDynamoHatches) { if (isValidMetaTileEntity(tHatch)) { - storedEnergy+=tHatch.getBaseMetaTileEntity().getStoredEU(); - maxEnergy+=tHatch.getBaseMetaTileEntity().getEUCapacity(); + storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU(); + maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity(); } } - String[] ret = new String[]{ - // 8 Lines available for information panels - tRunning + ": " + EnumChatFormatting.RED + GT_Utility.formatNumbers(mEUt) + EnumChatFormatting.RESET + " EU/t", /* 1 */ - tMaintainance, /* 2 */ - StatCollector.translateToLocal("GT5U.turbine.efficiency") + ": " + - EnumChatFormatting.YELLOW + (mEfficiency / 100F) + EnumChatFormatting.RESET + "%", /* 2 */ - StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + - EnumChatFormatting.GREEN + GT_Utility.formatNumbers(storedEnergy) + EnumChatFormatting.RESET + " EU / " + /* 3 */ - EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(maxEnergy) + EnumChatFormatting.RESET + " EU", - StatCollector.translateToLocal("GT5U.turbine.flow") + ": " + - EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(GT_Utility.safeInt((long) realOptFlow)) + EnumChatFormatting.RESET + " L/t" + /* 4 */ - EnumChatFormatting.YELLOW + " (" + (looseFit ? StatCollector.translateToLocal("GT5U.turbine.loose") : StatCollector.translateToLocal("GT5U.turbine.tight")) + ")", /* 5 */ - StatCollector.translateToLocal("GT5U.turbine.fuel") + ": " + - EnumChatFormatting.GOLD + GT_Utility.formatNumbers(storedFluid) + EnumChatFormatting.RESET + "L", /* 6 */ - StatCollector.translateToLocal("GT5U.turbine.dmg") + ": " + - EnumChatFormatting.RED + tDura + EnumChatFormatting.RESET + "%", /* 7 */ - StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + - EnumChatFormatting.GREEN + mPollutionReduction + EnumChatFormatting.RESET + " %" /* 8 */ + String[] ret = new String[] { + // 8 Lines available for information panels + tRunning + ": " + EnumChatFormatting.RED + GT_Utility.formatNumbers(mEUt) + EnumChatFormatting.RESET + + " EU/t", /* 1 */ + tMaintainance, /* 2 */ + StatCollector.translateToLocal("GT5U.turbine.efficiency") + ": " + EnumChatFormatting.YELLOW + + (mEfficiency / 100F) + EnumChatFormatting.RESET + "%", /* 2 */ + StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(storedEnergy) + EnumChatFormatting.RESET + " EU / " + + /* 3 */ EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(maxEnergy) + EnumChatFormatting.RESET + " EU", + StatCollector.translateToLocal("GT5U.turbine.flow") + ": " + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(GT_Utility.safeInt((long) realOptFlow)) + EnumChatFormatting.RESET + + " L/t" + /* 4 */ EnumChatFormatting.YELLOW + + " (" + + (looseFit + ? StatCollector.translateToLocal("GT5U.turbine.loose") + : StatCollector.translateToLocal("GT5U.turbine.tight")) + + ")", /* 5 */ + StatCollector.translateToLocal("GT5U.turbine.fuel") + ": " + EnumChatFormatting.GOLD + + GT_Utility.formatNumbers(storedFluid) + EnumChatFormatting.RESET + "L", /* 6 */ + StatCollector.translateToLocal("GT5U.turbine.dmg") + ": " + EnumChatFormatting.RED + tDura + + EnumChatFormatting.RESET + "%", /* 7 */ + StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + EnumChatFormatting.GREEN + + mPollutionReduction + EnumChatFormatting.RESET + " %" /* 8 */ }; if (!this.getClass().getName().contains("Steam")) - ret[4] = StatCollector.translateToLocal("GT5U.turbine.flow") + ": " + EnumChatFormatting.YELLOW + GT_Utility.safeInt((long) realOptFlow) + EnumChatFormatting.RESET + " L/t"; + ret[4] = StatCollector.translateToLocal("GT5U.turbine.flow") + ": " + EnumChatFormatting.YELLOW + + GT_Utility.safeInt((long) realOptFlow) + EnumChatFormatting.RESET + " L/t"; return ret; - - } public boolean hasTurbine() { diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java index c16b7851fa..18f9ac884e 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java @@ -1,5 +1,7 @@ package gregtech.common.tileentities.machines.multi; +import static gregtech.api.enums.Textures.BlockIcons.*; + import gregtech.GT_Mod; import gregtech.api.GregTech_API; import gregtech.api.interfaces.ITexture; @@ -10,14 +12,11 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; +import java.util.ArrayList; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; -import java.util.ArrayList; - -import static gregtech.api.enums.Textures.BlockIcons.*; - public class GT_MetaTileEntity_LargeTurbine_Gas extends GT_MetaTileEntity_LargeTurbine { public GT_MetaTileEntity_LargeTurbine_Gas(int aID, String aName, String aNameRegional) { @@ -29,11 +28,32 @@ public class GT_MetaTileEntity_LargeTurbine_Gas extends GT_MetaTileEntity_LargeT } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return new ITexture[]{MACHINE_CASINGS[1][aColorIndex + 1], - aFacing == aSide ? - (aActive ? TextureFactory.builder().addIcon(LARGETURBINE_SS_ACTIVE5).extFacing().build() : hasTurbine() ? TextureFactory.builder().addIcon(LARGETURBINE_SS5).extFacing().build() : TextureFactory.builder().addIcon(LARGETURBINE_SS_EMPTY5).extFacing().build()) - : casingTexturePages[0][58]}; + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { + return new ITexture[] { + MACHINE_CASINGS[1][aColorIndex + 1], + aFacing == aSide + ? (aActive + ? TextureFactory.builder() + .addIcon(LARGETURBINE_SS_ACTIVE5) + .extFacing() + .build() + : hasTurbine() + ? TextureFactory.builder() + .addIcon(LARGETURBINE_SS5) + .extFacing() + .build() + : TextureFactory.builder() + .addIcon(LARGETURBINE_SS_EMPTY5) + .extFacing() + .build()) + : casingTexturePages[0][58] + }; } @Override @@ -44,7 +64,7 @@ public class GT_MetaTileEntity_LargeTurbine_Gas extends GT_MetaTileEntity_LargeT .addInfo("Needs a Turbine, place inside controller") .addInfo("Warning: Will be capped at 8192 EU/t in a future update") .addInfo("See the Advanced Large Gas Turbine as the next, uncapped, option") - //.addInfo("The excess fuel that gets consumed will be voided!") + // .addInfo("The excess fuel that gets consumed will be voided!") .addPollutionAmount(getPollutionPerSecond(null)) .addSeparator() .beginStructureBlock(3, 3, 4, true) @@ -91,12 +111,19 @@ public class GT_MetaTileEntity_LargeTurbine_Gas extends GT_MetaTileEntity_LargeT } @Override - int fluidIntoPower(ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff, int overflowMultiplier, float[] flowMultipliers) { + int fluidIntoPower( + ArrayList<FluidStack> aFluids, + int aOptFlow, + int aBaseEff, + int overflowMultiplier, + float[] flowMultipliers) { if (aFluids.size() >= 1) { int tEU = 0; int actualOptimalFlow = 0; - FluidStack firstFuelType = new FluidStack(aFluids.get(0), 0); // Identify a SINGLE type of fluid to process. Doesn't matter which one. Ignore the rest! + FluidStack firstFuelType = new FluidStack( + aFluids.get(0), + 0); // Identify a SINGLE type of fluid to process. Doesn't matter which one. Ignore the rest! int fuelValue = getFuelValue(firstFuelType); if (aOptFlow < fuelValue) { @@ -113,8 +140,10 @@ public class GT_MetaTileEntity_LargeTurbine_Gas extends GT_MetaTileEntity_LargeT this.realOptFlow = actualOptimalFlow; // Allowed to use up to 450% optimal flow rate, depending on the value of overflowMultiplier. - // This value is chosen because the highest EU/t possible depends on the overflowMultiplier, and the formula used - // makes it so the flow rate for that max, per value of overflowMultiplier, is (percentage of optimal flow rate): + // This value is chosen because the highest EU/t possible depends on the overflowMultiplier, and the formula + // used + // makes it so the flow rate for that max, per value of overflowMultiplier, is (percentage of optimal flow + // rate): // - 150% if it is 1 // - 300% if it is 2 // - 450% if it is 3 @@ -144,19 +173,20 @@ public class GT_MetaTileEntity_LargeTurbine_Gas extends GT_MetaTileEntity_LargeT tEU = GT_Utility.safeInt((long) tEU * (long) aBaseEff / 10000L); } - // EU/t output cap to properly tier the LGT against the Advanced LGT, will be implemented in a future dev update + // EU/t output cap to properly tier the LGT against the Advanced LGT, will be implemented in a future dev + // update /*if (tEU > 8192) { tEU = 8192; }*/ - // If next output is above the maximum the dynamo can handle, set it to the maximum instead of exploding the turbine + // If next output is above the maximum the dynamo can handle, set it to the maximum instead of exploding the + // turbine // Raising the maximum allowed flow rate to account for the efficiency changes beyond the optimal flow // When the max fuel consumption rate was increased, turbines could explode on world load - if (tEU > getMaximumOutput()){ + if (tEU > getMaximumOutput()) { tEU = GT_Utility.safeInt(getMaximumOutput()); } return tEU; - } return 0; } @@ -164,19 +194,20 @@ public class GT_MetaTileEntity_LargeTurbine_Gas extends GT_MetaTileEntity_LargeT @Override float getOverflowEfficiency(int totalFlow, int actualOptimalFlow, int overflowMultiplier) { // overflowMultiplier changes how quickly the turbine loses efficiency after flow goes beyond the optimal value - // At the default value of 1, any flow will generate less EU/t than optimal flow, regardless of the amount of fuel used + // At the default value of 1, any flow will generate less EU/t than optimal flow, regardless of the amount of + // fuel used // The bigger this number is, the slower efficiency loss happens as flow moves beyond the optimal value // Gases are the second most efficient in this regard, with plasma being the most efficient float efficiency = 0; if (totalFlow > actualOptimalFlow) { - efficiency = 1.0f - Math.abs((totalFlow - actualOptimalFlow)) / ((float) actualOptimalFlow * ((overflowMultiplier * 3) - 1)); - } - else { + efficiency = 1.0f + - Math.abs((totalFlow - actualOptimalFlow)) + / ((float) actualOptimalFlow * ((overflowMultiplier * 3) - 1)); + } else { efficiency = 1.0f - Math.abs((totalFlow - actualOptimalFlow) / (float) actualOptimalFlow); } return efficiency; } - } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_GasAdvanced.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_GasAdvanced.java index 244055ac61..9bc20e5f6e 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_GasAdvanced.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_GasAdvanced.java @@ -1,5 +1,7 @@ package gregtech.common.tileentities.machines.multi; +import static gregtech.api.enums.Textures.BlockIcons.*; + import gregtech.GT_Mod; import gregtech.api.GregTech_API; import gregtech.api.interfaces.ITexture; @@ -10,15 +12,11 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; +import java.util.ArrayList; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; -import java.util.ArrayList; - -import static gregtech.api.enums.Textures.BlockIcons.*; -import static gregtech.api.items.GT_MetaGenerated_Tool.getPrimaryMaterial; - public class GT_MetaTileEntity_LargeTurbine_GasAdvanced extends GT_MetaTileEntity_LargeTurbine { public GT_MetaTileEntity_LargeTurbine_GasAdvanced(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -29,32 +27,53 @@ public class GT_MetaTileEntity_LargeTurbine_GasAdvanced extends GT_MetaTileEntit } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return new ITexture[]{MACHINE_CASINGS[1][aColorIndex + 1], - aFacing == aSide ? - (aActive ? TextureFactory.builder().addIcon(LARGETURBINE_ADVGAS_ACTIVE5).extFacing().build() : hasTurbine() ? TextureFactory.builder().addIcon(LARGETURBINE_ADVGAS5).extFacing().build() : TextureFactory.builder().addIcon(LARGETURBINE_ADVGAS_EMPTY5).extFacing().build()) - : casingTexturePages[1][57]}; + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { + return new ITexture[] { + MACHINE_CASINGS[1][aColorIndex + 1], + aFacing == aSide + ? (aActive + ? TextureFactory.builder() + .addIcon(LARGETURBINE_ADVGAS_ACTIVE5) + .extFacing() + .build() + : hasTurbine() + ? TextureFactory.builder() + .addIcon(LARGETURBINE_ADVGAS5) + .extFacing() + .build() + : TextureFactory.builder() + .addIcon(LARGETURBINE_ADVGAS_EMPTY5) + .extFacing() + .build()) + : casingTexturePages[1][57] + }; } @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Gas Turbine") - .addInfo("Warning: This is an experimental multiblock, subject to changes ") - .addInfo("Controller block for the Large Advanced Gas Turbine") - .addInfo("Needs a Turbine, place inside controller") - .addInfo("Only accepts gases above 800k EU/bucket") - .addInfo("Has no maximum EU/t output, only depends on the Dynamo Hatch") - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .beginStructureBlock(3, 3, 4, true) - .addController("Front center") - .addCasingInfo("Advanced Gas Turbine Casing", 24) - .addDynamoHatch("Back center", 1) - .addMaintenanceHatch("Side centered", 2) - .addMufflerHatch("Side centered", 2) - .addInputHatch("Gas Fuel, Side centered", 2) - .toolTipFinisher("Gregtech"); + .addInfo("Warning: This is an experimental multiblock, subject to changes ") + .addInfo("Controller block for the Large Advanced Gas Turbine") + .addInfo("Needs a Turbine, place inside controller") + .addInfo("Only accepts gases above 800k EU/bucket") + .addInfo("Has no maximum EU/t output, only depends on the Dynamo Hatch") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(3, 3, 4, true) + .addController("Front center") + .addCasingInfo("Advanced Gas Turbine Casing", 24) + .addDynamoHatch("Back center", 1) + .addMaintenanceHatch("Side centered", 2) + .addMufflerHatch("Side centered", 2) + .addInputHatch("Gas Fuel, Side centered", 2) + .toolTipFinisher("Gregtech"); return tt; } @@ -81,7 +100,9 @@ public class GT_MetaTileEntity_LargeTurbine_GasAdvanced extends GT_MetaTileEntit } @Override - public int getCasingTextureIndex() { return 185; } + public int getCasingTextureIndex() { + return 185; + } @Override public int getPollutionPerSecond(ItemStack aStack) { @@ -89,12 +110,19 @@ public class GT_MetaTileEntity_LargeTurbine_GasAdvanced extends GT_MetaTileEntit } @Override - int fluidIntoPower(ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff, int overflowMultiplier, float[] flowMultipliers) { + int fluidIntoPower( + ArrayList<FluidStack> aFluids, + int aOptFlow, + int aBaseEff, + int overflowMultiplier, + float[] flowMultipliers) { if (aFluids.size() >= 1) { int tEU = 0; int actualOptimalFlow = 0; - FluidStack firstFuelType = new FluidStack(aFluids.get(0), 0); // Identify a SINGLE type of fluid to process. Doesn't matter which one. Ignore the rest! + FluidStack firstFuelType = new FluidStack( + aFluids.get(0), + 0); // Identify a SINGLE type of fluid to process. Doesn't matter which one. Ignore the rest! int fuelValue = getFuelValue(firstFuelType); if (fuelValue < 100) { @@ -115,8 +143,10 @@ public class GT_MetaTileEntity_LargeTurbine_GasAdvanced extends GT_MetaTileEntit this.realOptFlow = actualOptimalFlow; // Allowed to use up to 450% optimal flow rate, depending on the value of overflowMultiplier. - // This value is chosen because the highest EU/t possible depends on the overflowMultiplier, and the formula used - // makes it so the flow rate for that max, per value of overflowMultiplier, is (percentage of optimal flow rate): + // This value is chosen because the highest EU/t possible depends on the overflowMultiplier, and the formula + // used + // makes it so the flow rate for that max, per value of overflowMultiplier, is (percentage of optimal flow + // rate): // - 150% if it is 1 // - 300% if it is 2 // - 450% if it is 3 @@ -146,14 +176,14 @@ public class GT_MetaTileEntity_LargeTurbine_GasAdvanced extends GT_MetaTileEntit tEU = GT_Utility.safeInt((long) tEU * (long) aBaseEff / 10000L); } - // If next output is above the maximum the dynamo can handle, set it to the maximum instead of exploding the turbine + // If next output is above the maximum the dynamo can handle, set it to the maximum instead of exploding the + // turbine // Raising the maximum allowed flow rate to account for the efficiency changes beyond the optimal flow // When the max fuel consumption rate was increased, turbines could explode on world load - if (tEU > getMaximumOutput()){ + if (tEU > getMaximumOutput()) { tEU = GT_Utility.safeInt(getMaximumOutput()); } return tEU; - } return 0; } @@ -161,15 +191,17 @@ public class GT_MetaTileEntity_LargeTurbine_GasAdvanced extends GT_MetaTileEntit @Override float getOverflowEfficiency(int totalFlow, int actualOptimalFlow, int overflowMultiplier) { // overflowMultiplier changes how quickly the turbine loses efficiency after flow goes beyond the optimal value - // At the default value of 1, any flow will generate less EU/t than optimal flow, regardless of the amount of fuel used + // At the default value of 1, any flow will generate less EU/t than optimal flow, regardless of the amount of + // fuel used // The bigger this number is, the slower efficiency loss happens as flow moves beyond the optimal value // Gases are the second most efficient in this regard, with plasma being the most efficient float efficiency = 0; if (totalFlow > actualOptimalFlow) { - efficiency = 1.0f - Math.abs((totalFlow - actualOptimalFlow)) / ((float) actualOptimalFlow * ((overflowMultiplier * 3) - 1)); - } - else { + efficiency = 1.0f + - Math.abs((totalFlow - actualOptimalFlow)) + / ((float) actualOptimalFlow * ((overflowMultiplier * 3) - 1)); + } else { efficiency = 1.0f - Math.abs((totalFlow - actualOptimalFlow) / (float) actualOptimalFlow); } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java index 651bb36706..709a02af7c 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java @@ -1,5 +1,9 @@ package gregtech.common.tileentities.machines.multi; +import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.api.objects.XSTR.XSTR_INSTANCE; +import static gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_LargeTurbine_Steam.calculateLooseFlow; + import gregtech.GT_Mod; import gregtech.api.GregTech_API; import gregtech.api.interfaces.ITexture; @@ -9,18 +13,13 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Utility; +import java.util.ArrayList; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.fluids.FluidStack; -import java.util.ArrayList; - -import static gregtech.api.enums.Textures.BlockIcons.*; -import static gregtech.api.objects.XSTR.XSTR_INSTANCE; -import static gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_LargeTurbine_Steam.calculateLooseFlow; - public class GT_MetaTileEntity_LargeTurbine_HPSteam extends GT_MetaTileEntity_LargeTurbine { public boolean achievement = false; @@ -35,11 +34,32 @@ public class GT_MetaTileEntity_LargeTurbine_HPSteam extends GT_MetaTileEntity_La } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return new ITexture[]{MACHINE_CASINGS[1][aColorIndex + 1], - aFacing == aSide ? - (aActive ? TextureFactory.builder().addIcon(LARGETURBINE_TI_ACTIVE5).extFacing().build() : hasTurbine() ? TextureFactory.builder().addIcon(LARGETURBINE_TI5).extFacing().build() : TextureFactory.builder().addIcon(LARGETURBINE_TI_EMPTY5).extFacing().build()) - : casingTexturePages[0][59]}; + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { + return new ITexture[] { + MACHINE_CASINGS[1][aColorIndex + 1], + aFacing == aSide + ? (aActive + ? TextureFactory.builder() + .addIcon(LARGETURBINE_TI_ACTIVE5) + .extFacing() + .build() + : hasTurbine() + ? TextureFactory.builder() + .addIcon(LARGETURBINE_TI5) + .extFacing() + .build() + : TextureFactory.builder() + .addIcon(LARGETURBINE_TI_EMPTY5) + .extFacing() + .build()) + : casingTexturePages[0][59] + }; } @Override @@ -84,7 +104,12 @@ public class GT_MetaTileEntity_LargeTurbine_HPSteam extends GT_MetaTileEntity_La } @Override - int fluidIntoPower(ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff, int overflowEfficiency, float[] flowMultipliers) { + int fluidIntoPower( + ArrayList<FluidStack> aFluids, + int aOptFlow, + int aBaseEff, + int overflowEfficiency, + float[] flowMultipliers) { if (looseFit) { long[] calculatedFlow = calculateLooseFlow(aOptFlow, aBaseEff); aOptFlow = GT_Utility.safeInt(calculatedFlow[0]); @@ -95,8 +120,10 @@ public class GT_MetaTileEntity_LargeTurbine_HPSteam extends GT_MetaTileEntity_La int flow = 0; // Allowed to use up to 300% optimal flow rate, depending on the value of overflowMultiplier. - // This value is chosen because the highest EU/t possible depends on the overflowMultiplier, and the formula used - // makes it so the flow rate for that max, per value of overflowMultiplier, is (percentage of optimal flow rate): + // This value is chosen because the highest EU/t possible depends on the overflowMultiplier, and the formula + // used + // makes it so the flow rate for that max, per value of overflowMultiplier, is (percentage of optimal flow + // rate): // - 200% if it is 1 // - 250% if it is 2 // - 300% if it is 3 @@ -115,7 +142,12 @@ public class GT_MetaTileEntity_LargeTurbine_HPSteam extends GT_MetaTileEntity_La totalFlow += flow; // track total input used if (!achievement) { try { - GT_Mod.achievements.issueAchievement(this.getBaseMetaTileEntity().getWorld().getPlayerEntityByName(this.getBaseMetaTileEntity().getOwnerName()), "efficientsteam"); + GT_Mod.achievements.issueAchievement( + this.getBaseMetaTileEntity() + .getWorld() + .getPlayerEntityByName( + this.getBaseMetaTileEntity().getOwnerName()), + "efficientsteam"); } catch (Exception ignored) { } achievement = true; @@ -135,9 +167,11 @@ public class GT_MetaTileEntity_LargeTurbine_HPSteam extends GT_MetaTileEntity_La tEU = Math.max(1, GT_Utility.safeInt((long) tEU * (long) aBaseEff / 10000L)); } - // If next output is above the maximum the dynamo can handle, set it to the maximum instead of exploding the turbine - // Raising the maximum allowed flow rate to account for the efficiency changes beyond the optimal flow rate can explode turbines on world load - if (tEU > getMaximumOutput()){ + // If next output is above the maximum the dynamo can handle, set it to the maximum instead of exploding the + // turbine + // Raising the maximum allowed flow rate to account for the efficiency changes beyond the optimal flow rate can + // explode turbines on world load + if (tEU > getMaximumOutput()) { tEU = GT_Utility.safeInt(getMaximumOutput()); } @@ -147,15 +181,18 @@ public class GT_MetaTileEntity_LargeTurbine_HPSteam extends GT_MetaTileEntity_La @Override float getOverflowEfficiency(int totalFlow, int actualOptimalFlow, int overflowMultiplier) { // overflowMultiplier changes how quickly the turbine loses efficiency after flow goes beyond the optimal value - // At the default value of 1, any flow will generate less EU/t than optimal flow, regardless of the amount of fuel used + // At the default value of 1, any flow will generate less EU/t than optimal flow, regardless of the amount of + // fuel used // The bigger this number is, the slower efficiency loss happens as flow moves beyond the optimal value - // Superheated steam is the second least efficient out of all turbine fuels in this regard, with steam being the least efficient + // Superheated steam is the second least efficient out of all turbine fuels in this regard, with steam being the + // least efficient float efficiency = 0; if (totalFlow > actualOptimalFlow) { - efficiency = 1.0f - Math.abs((totalFlow - actualOptimalFlow)) / ((float) actualOptimalFlow * (overflowMultiplier + 2)); - } - else { + efficiency = 1.0f + - Math.abs((totalFlow - actualOptimalFlow)) + / ((float) actualOptimalFlow * (overflowMultiplier + 2)); + } else { efficiency = 1.0f - Math.abs((totalFlow - actualOptimalFlow) / (float) actualOptimalFlow); } @@ -166,7 +203,11 @@ public class GT_MetaTileEntity_LargeTurbine_HPSteam extends GT_MetaTileEntity_La public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { if (aSide == getBaseMetaTileEntity().getFrontFacing()) { looseFit ^= true; - GT_Utility.sendChatToPlayer(aPlayer, looseFit ? GT_Utility.trans("500", "Fitting: Loose - More Flow") : GT_Utility.trans("501", "Fitting: Tight - More Efficiency")); + GT_Utility.sendChatToPlayer( + aPlayer, + looseFit + ? GT_Utility.trans("500", "Fitting: Loose - More Flow") + : GT_Utility.trans("501", "Fitting: Tight - More Efficiency")); } } @@ -175,7 +216,6 @@ public class GT_MetaTileEntity_LargeTurbine_HPSteam extends GT_MetaTileEntity_La return (looseFit && XSTR_INSTANCE.nextInt(4) == 0) ? 0 : 1; } - @Override public String[] getInfoData() { super.looseFit = looseFit; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java index 01bf9118ca..21e9572d20 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java @@ -1,5 +1,7 @@ package gregtech.common.tileentities.machines.multi; +import static gregtech.api.enums.Textures.BlockIcons.*; + import gregtech.api.GregTech_API; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -13,6 +15,7 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; import gregtech.common.items.GT_MetaGenerated_Tool_01; +import java.util.ArrayList; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; @@ -20,10 +23,6 @@ import net.minecraft.util.StatCollector; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; -import java.util.ArrayList; - -import static gregtech.api.enums.Textures.BlockIcons.*; - public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_LargeTurbine { public GT_MetaTileEntity_LargeTurbine_Plasma(int aID, String aName, String aNameRegional) { @@ -35,11 +34,32 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return new ITexture[]{MACHINE_CASINGS[1][aColorIndex + 1], - aFacing == aSide ? - (aActive ? TextureFactory.builder().addIcon(LARGETURBINE_TU_ACTIVE5).extFacing().build() : hasTurbine() ? TextureFactory.builder().addIcon(LARGETURBINE_TU5).extFacing().build() : TextureFactory.builder().addIcon(LARGETURBINE_TU_EMPTY5).extFacing().build()) - : casingTexturePages[0][60]}; + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { + return new ITexture[] { + MACHINE_CASINGS[1][aColorIndex + 1], + aFacing == aSide + ? (aActive + ? TextureFactory.builder() + .addIcon(LARGETURBINE_TU_ACTIVE5) + .extFacing() + .build() + : hasTurbine() + ? TextureFactory.builder() + .addIcon(LARGETURBINE_TU5) + .extFacing() + .build() + : TextureFactory.builder() + .addIcon(LARGETURBINE_TU_EMPTY5) + .extFacing() + .build()) + : casingTexturePages[0][60] + }; } @Override @@ -89,21 +109,31 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar } @Override - int fluidIntoPower(ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff, int overflowMultiplier, float[] flowMultipliers) { + int fluidIntoPower( + ArrayList<FluidStack> aFluids, + int aOptFlow, + int aBaseEff, + int overflowMultiplier, + float[] flowMultipliers) { if (aFluids.size() >= 1) { - aOptFlow *= 800;//CHANGED THINGS HERE, check recipe runs once per 20 ticks + aOptFlow *= 800; // CHANGED THINGS HERE, check recipe runs once per 20 ticks int tEU = 0; int actualOptimalFlow = 0; - FluidStack firstFuelType = new FluidStack(aFluids.get(0), 0); // Identify a SINGLE type of fluid to process. Doesn't matter which one. Ignore the rest! + FluidStack firstFuelType = new FluidStack( + aFluids.get(0), + 0); // Identify a SINGLE type of fluid to process. Doesn't matter which one. Ignore the rest! int fuelValue = getFuelValue(firstFuelType); - actualOptimalFlow = GT_Utility.safeInt((long) Math.ceil((double) aOptFlow * flowMultipliers[2] / (double) fuelValue)); + actualOptimalFlow = + GT_Utility.safeInt((long) Math.ceil((double) aOptFlow * flowMultipliers[2] / (double) fuelValue)); this.realOptFlow = actualOptimalFlow; // For scanner info // Allowed to use up to 550% optimal flow rate, depending on the value of overflowMultiplier. - // This value is chosen because the highest EU/t possible depends on the overflowMultiplier, and the formula used - // makes it so the flow rate for that max, per value of overflowMultiplier, is (percentage of optimal flow rate): + // This value is chosen because the highest EU/t possible depends on the overflowMultiplier, and the formula + // used + // makes it so the flow rate for that max, per value of overflowMultiplier, is (percentage of optimal flow + // rate): // - 250% if it is 1 // - 400% if it is 2 // - 550% if it is 3 @@ -137,7 +167,7 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar if (totalFlow <= 0) return 0; tEU = GT_Utility.safeInt((long) ((fuelValue / 20D) * (double) totalFlow)); - //GT_FML_LOGGER.info(totalFlow+" : "+fuelValue+" : "+aOptFlow+" : "+actualOptimalFlow+" : "+tEU); + // GT_FML_LOGGER.info(totalFlow+" : "+fuelValue+" : "+aOptFlow+" : "+actualOptimalFlow+" : "+tEU); if (totalFlow == actualOptimalFlow) { tEU = GT_Utility.safeInt((long) (aBaseEff / 10000D * tEU)); @@ -147,14 +177,15 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar tEU = GT_Utility.safeInt((long) (aBaseEff / 10000D * tEU)); } - // If next output is above the maximum the dynamo can handle, set it to the maximum instead of exploding the turbine - // Raising the maximum allowed flow rate to account for the efficiency changes beyond the optimal flow rate can explode turbines on world load - if (tEU > getMaximumOutput()){ + // If next output is above the maximum the dynamo can handle, set it to the maximum instead of exploding the + // turbine + // Raising the maximum allowed flow rate to account for the efficiency changes beyond the optimal flow rate + // can explode turbines on world load + if (tEU > getMaximumOutput()) { tEU = GT_Utility.safeInt(getMaximumOutput()); } return tEU; - } return 0; } @@ -162,15 +193,17 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar @Override float getOverflowEfficiency(int totalFlow, int actualOptimalFlow, int overflowMultiplier) { // overflowMultiplier changes how quickly the turbine loses efficiency after flow goes beyond the optimal value - // At the default value of 1, any flow will generate less EU/t than optimal flow, regardless of the amount of fuel used + // At the default value of 1, any flow will generate less EU/t than optimal flow, regardless of the amount of + // fuel used // The bigger this number is, the slower efficiency loss happens as flow moves beyond the optimal value // Plasmas are the most efficient out of all turbine fuels in this regard float efficiency = 0; if (totalFlow > actualOptimalFlow) { - efficiency = 1.0f - Math.abs((totalFlow - actualOptimalFlow)) / ((float) actualOptimalFlow * ((overflowMultiplier * 3) + 1)); - } - else { + efficiency = 1.0f + - Math.abs((totalFlow - actualOptimalFlow)) + / ((float) actualOptimalFlow * ((overflowMultiplier * 3) + 1)); + } else { efficiency = 1.0f - Math.abs((totalFlow - actualOptimalFlow) / (float) actualOptimalFlow); } @@ -179,18 +212,29 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar @Override public boolean checkRecipe(ItemStack aStack) { - if ((counter & 7) == 0 && (aStack == null || !(aStack.getItem() instanceof GT_MetaGenerated_Tool) || aStack.getItemDamage() < 170 || aStack.getItemDamage() > 179)) { + if ((counter & 7) == 0 + && (aStack == null + || !(aStack.getItem() instanceof GT_MetaGenerated_Tool) + || aStack.getItemDamage() < 170 + || aStack.getItemDamage() > 179)) { stopMachine(); return false; } ArrayList<FluidStack> tFluids = getStoredFluids(); if (!tFluids.isEmpty()) { - if (baseEff == 0 || optFlow == 0 || counter >= 512 || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled() + if (baseEff == 0 + || optFlow == 0 + || counter >= 512 + || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled() || this.getBaseMetaTileEntity().hasInventoryBeenModified()) { counter = 0; - baseEff = GT_Utility.safeInt((long) ((5F + ((GT_MetaGenerated_Tool) aStack.getItem()).getToolCombatDamage(aStack)) * 1000F)); - optFlow = GT_Utility.safeInt((long) Math.max(Float.MIN_NORMAL, - ((GT_MetaGenerated_Tool) aStack.getItem()).getToolStats(aStack).getSpeedMultiplier() + baseEff = GT_Utility.safeInt( + (long) ((5F + ((GT_MetaGenerated_Tool) aStack.getItem()).getToolCombatDamage(aStack)) * 1000F)); + optFlow = GT_Utility.safeInt((long) Math.max( + Float.MIN_NORMAL, + ((GT_MetaGenerated_Tool) aStack.getItem()) + .getToolStats(aStack) + .getSpeedMultiplier() * ((GT_MetaGenerated_Tool) aStack.getItem()).getPrimaryMaterial(aStack).mToolSpeed * 50)); overflowMultiplier = getOverflowMultiplier(aStack); @@ -200,26 +244,31 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar } if (optFlow <= 0 || baseEff <= 0) { - stopMachine();//in case the turbine got removed + stopMachine(); // in case the turbine got removed return false; } - int newPower = fluidIntoPower(tFluids, optFlow, baseEff, overflowMultiplier, flowMultipliers); // How much the turbine should be producing with this flow + int newPower = fluidIntoPower( + tFluids, + optFlow, + baseEff, + overflowMultiplier, + flowMultipliers); // How much the turbine should be producing with this flow int difference = newPower - this.mEUt; // difference between current output and new output - // Magic numbers: can always change by at least 10 eu/t, but otherwise by at most 1 percent of the difference in power level (per tick) + // Magic numbers: can always change by at least 10 eu/t, but otherwise by at most 1 percent of the difference in + // power level (per tick) // This is how much the turbine can actually change during this tick int maxChangeAllowed = Math.max(200, GT_Utility.safeInt((long) Math.abs(difference) / 5)); if (Math.abs(difference) > maxChangeAllowed) { // If this difference is too big, use the maximum allowed change int change = maxChangeAllowed * (difference > 0 ? 1 : -1); // Make the change positive or negative. this.mEUt += change; // Apply the change - } else - this.mEUt = newPower; + } else this.mEUt = newPower; if (this.mEUt <= 0) { - //stopMachine(); + // stopMachine(); this.mEUt = 0; this.mEfficiency = 0; return false; @@ -232,57 +281,75 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar } } - @Override + @Override public String[] getInfoData() { - int mPollutionReduction=0; + int mPollutionReduction = 0; for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) { if (isValidMetaTileEntity(tHatch)) { - mPollutionReduction=Math.max(tHatch.calculatePollutionReduction(100),mPollutionReduction); + mPollutionReduction = Math.max(tHatch.calculatePollutionReduction(100), mPollutionReduction); } } - String tRunning = mMaxProgresstime>0 ? - - EnumChatFormatting.GREEN+StatCollector.translateToLocal("GT5U.turbine.running.true")+EnumChatFormatting.RESET : - EnumChatFormatting.RED+StatCollector.translateToLocal("GT5U.turbine.running.false")+EnumChatFormatting.RESET; - String tMaintainance = getIdealStatus() == getRepairStatus() ? - EnumChatFormatting.GREEN+StatCollector.translateToLocal("GT5U.turbine.maintenance.false")+EnumChatFormatting.RESET : - EnumChatFormatting.RED+StatCollector.translateToLocal("GT5U.turbine.maintenance.true")+EnumChatFormatting.RESET ; + String tRunning = mMaxProgresstime > 0 + ? EnumChatFormatting.GREEN + + StatCollector.translateToLocal("GT5U.turbine.running.true") + + EnumChatFormatting.RESET + : EnumChatFormatting.RED + + StatCollector.translateToLocal("GT5U.turbine.running.false") + + EnumChatFormatting.RESET; + String tMaintainance = getIdealStatus() == getRepairStatus() + ? EnumChatFormatting.GREEN + + StatCollector.translateToLocal("GT5U.turbine.maintenance.false") + + EnumChatFormatting.RESET + : EnumChatFormatting.RED + + StatCollector.translateToLocal("GT5U.turbine.maintenance.true") + + EnumChatFormatting.RESET; int tDura = 0; if (mInventory[1] != null && mInventory[1].getItem() instanceof GT_MetaGenerated_Tool_01) { - tDura = GT_Utility.safeInt((long)(100.0f / GT_MetaGenerated_Tool.getToolMaxDamage(mInventory[1]) * (GT_MetaGenerated_Tool.getToolDamage(mInventory[1]))+1)); + tDura = GT_Utility.safeInt((long) (100.0f + / GT_MetaGenerated_Tool.getToolMaxDamage(mInventory[1]) + * (GT_MetaGenerated_Tool.getToolDamage(mInventory[1])) + + 1)); } - long storedEnergy=0; - long maxEnergy=0; - for(GT_MetaTileEntity_Hatch_Dynamo tHatch : mDynamoHatches) { + long storedEnergy = 0; + long maxEnergy = 0; + for (GT_MetaTileEntity_Hatch_Dynamo tHatch : mDynamoHatches) { if (isValidMetaTileEntity(tHatch)) { - storedEnergy+=tHatch.getBaseMetaTileEntity().getStoredEU(); - maxEnergy+=tHatch.getBaseMetaTileEntity().getEUCapacity(); + storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU(); + maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity(); } } - String[] ret = new String[]{ - // 8 Lines available for information panels - tRunning + ": " + EnumChatFormatting.RED + GT_Utility.formatNumbers(mEUt) + EnumChatFormatting.RESET + " EU/t", /* 1 */ - tMaintainance, /* 2 */ - StatCollector.translateToLocal("GT5U.turbine.efficiency") + ": " + - EnumChatFormatting.YELLOW + (mEfficiency/100F) + EnumChatFormatting.RESET + "%", /* 2 */ - StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + - EnumChatFormatting.GREEN + GT_Utility.formatNumbers(storedEnergy) + EnumChatFormatting.RESET + " EU / " + /* 3 */ - EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(maxEnergy) + EnumChatFormatting.RESET + " EU", - StatCollector.translateToLocal("GT5U.turbine.flow") + ": " + - EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(GT_Utility.safeInt((long)realOptFlow)) + EnumChatFormatting.RESET + " L/s" + /* 4 */ - EnumChatFormatting.YELLOW + " (" + (looseFit?StatCollector.translateToLocal("GT5U.turbine.loose"):StatCollector.translateToLocal("GT5U.turbine.tight")) + ")", /* 5 */ - StatCollector.translateToLocal("GT5U.turbine.fuel") + ": " + - EnumChatFormatting.GOLD + GT_Utility.formatNumbers(storedFluid) + EnumChatFormatting.RESET + "L", /* 6 */ - StatCollector.translateToLocal("GT5U.turbine.dmg") + ": " + - EnumChatFormatting.RED + Integer.toString(tDura) + EnumChatFormatting.RESET + "%", /* 7 */ - StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + - EnumChatFormatting.GREEN + mPollutionReduction + EnumChatFormatting.RESET + " %" /* 8 */ + String[] ret = new String[] { + // 8 Lines available for information panels + tRunning + ": " + EnumChatFormatting.RED + GT_Utility.formatNumbers(mEUt) + EnumChatFormatting.RESET + + " EU/t", /* 1 */ + tMaintainance, /* 2 */ + StatCollector.translateToLocal("GT5U.turbine.efficiency") + ": " + EnumChatFormatting.YELLOW + + (mEfficiency / 100F) + EnumChatFormatting.RESET + "%", /* 2 */ + StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(storedEnergy) + EnumChatFormatting.RESET + " EU / " + + /* 3 */ EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(maxEnergy) + EnumChatFormatting.RESET + " EU", + StatCollector.translateToLocal("GT5U.turbine.flow") + ": " + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(GT_Utility.safeInt((long) realOptFlow)) + EnumChatFormatting.RESET + + " L/s" + /* 4 */ EnumChatFormatting.YELLOW + + " (" + + (looseFit + ? StatCollector.translateToLocal("GT5U.turbine.loose") + : StatCollector.translateToLocal("GT5U.turbine.tight")) + + ")", /* 5 */ + StatCollector.translateToLocal("GT5U.turbine.fuel") + ": " + EnumChatFormatting.GOLD + + GT_Utility.formatNumbers(storedFluid) + EnumChatFormatting.RESET + "L", /* 6 */ + StatCollector.translateToLocal("GT5U.turbine.dmg") + ": " + EnumChatFormatting.RED + Integer.toString(tDura) + + EnumChatFormatting.RESET + "%", /* 7 */ + StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + EnumChatFormatting.GREEN + + mPollutionReduction + EnumChatFormatting.RESET + " %" /* 8 */ }; if (!this.getClass().getName().contains("Steam")) - ret[4]=StatCollector.translateToLocal("GT5U.turbine.flow")+": "+EnumChatFormatting.YELLOW+GT_Utility.safeInt((long)realOptFlow)+EnumChatFormatting.RESET+" L/s"; + ret[4] = StatCollector.translateToLocal("GT5U.turbine.flow") + ": " + EnumChatFormatting.YELLOW + + GT_Utility.safeInt((long) realOptFlow) + EnumChatFormatting.RESET + " L/s"; return ret; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java index 9da596b6e6..3d17b25399 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java @@ -1,5 +1,9 @@ package gregtech.common.tileentities.machines.multi; +import static gregtech.api.enums.GT_Values.STEAM_PER_WATER; +import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.api.objects.XSTR.XSTR_INSTANCE; + import gregtech.GT_Mod; import gregtech.api.GregTech_API; import gregtech.api.interfaces.ITexture; @@ -9,18 +13,13 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Utility; +import java.util.ArrayList; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.fluids.FluidStack; -import java.util.ArrayList; - -import static gregtech.api.enums.GT_Values.STEAM_PER_WATER; -import static gregtech.api.enums.Textures.BlockIcons.*; -import static gregtech.api.objects.XSTR.XSTR_INSTANCE; - public class GT_MetaTileEntity_LargeTurbine_Steam extends GT_MetaTileEntity_LargeTurbine { private int excessWater; @@ -31,17 +30,37 @@ public class GT_MetaTileEntity_LargeTurbine_Steam extends GT_MetaTileEntity_Larg super(aID, aName, aNameRegional); } - public GT_MetaTileEntity_LargeTurbine_Steam(String aName) { super(aName); } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return new ITexture[]{MACHINE_CASINGS[1][aColorIndex + 1], - aFacing == aSide ? - (aActive ? TextureFactory.builder().addIcon(LARGETURBINE_ST_ACTIVE5).extFacing().build() : hasTurbine() ? TextureFactory.builder().addIcon(LARGETURBINE_ST5).extFacing().build() : TextureFactory.builder().addIcon(LARGETURBINE_ST_EMPTY5).extFacing().build()) - : casingTexturePages[0][57]}; + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { + return new ITexture[] { + MACHINE_CASINGS[1][aColorIndex + 1], + aFacing == aSide + ? (aActive + ? TextureFactory.builder() + .addIcon(LARGETURBINE_ST_ACTIVE5) + .extFacing() + .build() + : hasTurbine() + ? TextureFactory.builder() + .addIcon(LARGETURBINE_ST5) + .extFacing() + .build() + : TextureFactory.builder() + .addIcon(LARGETURBINE_ST_EMPTY5) + .extFacing() + .build()) + : casingTexturePages[0][57] + }; } @Override @@ -93,7 +112,12 @@ public class GT_MetaTileEntity_LargeTurbine_Steam extends GT_MetaTileEntity_Larg } @Override - int fluidIntoPower(ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff, int overflowEfficiency, float[] flowMultipliers) { + int fluidIntoPower( + ArrayList<FluidStack> aFluids, + int aOptFlow, + int aBaseEff, + int overflowEfficiency, + float[] flowMultipliers) { if (looseFit) { long[] calculatedFlow = calculateLooseFlow(aOptFlow, aBaseEff); aOptFlow = GT_Utility.safeInt(calculatedFlow[0]); @@ -104,8 +128,10 @@ public class GT_MetaTileEntity_LargeTurbine_Steam extends GT_MetaTileEntity_Larg int flow = 0; // Allowed to use up to 250% optimal flow rate, depending on the value of overflowMultiplier. - // This value is chosen because the highest EU/t possible depends on the overflowMultiplier, and the formula used - // makes it so the flow rate for that max, per value of overflowMultiplier, is (percentage of optimal flow rate): + // This value is chosen because the highest EU/t possible depends on the overflowMultiplier, and the formula + // used + // makes it so the flow rate for that max, per value of overflowMultiplier, is (percentage of optimal flow + // rate): // - 150% if it is 1 // - 200% if it is 2 // - 250% if it is 3 @@ -114,7 +140,9 @@ public class GT_MetaTileEntity_LargeTurbine_Steam extends GT_MetaTileEntity_Larg this.realOptFlow = aOptFlow * flowMultipliers[0]; storedFluid = 0; - for (int i = 0; i < aFluids.size() && remainingFlow > 0; i++) { // loop through each hatch; extract inputs and track totals. + for (int i = 0; + i < aFluids.size() && remainingFlow > 0; + i++) { // loop through each hatch; extract inputs and track totals. final FluidStack aFluidStack = aFluids.get(i); if (GT_ModHandler.isAnySteam(aFluidStack)) { flow = Math.min(aFluidStack.amount, remainingFlow); // try to use up to the max flow defined just above @@ -123,7 +151,12 @@ public class GT_MetaTileEntity_LargeTurbine_Steam extends GT_MetaTileEntity_Larg remainingFlow -= flow; // track amount we're allowed to continue depleting from hatches totalFlow += flow; // track total input used if (!achievement) { - GT_Mod.achievements.issueAchievement(this.getBaseMetaTileEntity().getWorld().getPlayerEntityByName(this.getBaseMetaTileEntity().getOwnerName()), "muchsteam"); + GT_Mod.achievements.issueAchievement( + this.getBaseMetaTileEntity() + .getWorld() + .getPlayerEntityByName( + this.getBaseMetaTileEntity().getOwnerName()), + "muchsteam"); achievement = true; } } else if (GT_ModHandler.isSuperHeatedSteam(aFluidStack)) { @@ -142,9 +175,11 @@ public class GT_MetaTileEntity_LargeTurbine_Steam extends GT_MetaTileEntity_Larg tEU = Math.max(1, GT_Utility.safeInt((long) tEU * (long) aBaseEff / 20000L)); } - // If next output is above the maximum the dynamo can handle, set it to the maximum instead of exploding the turbine - // Raising the maximum allowed flow rate to account for the efficiency changes beyond the optimal flow rate can explode turbines on world load - if (tEU > getMaximumOutput()){ + // If next output is above the maximum the dynamo can handle, set it to the maximum instead of exploding the + // turbine + // Raising the maximum allowed flow rate to account for the efficiency changes beyond the optimal flow rate can + // explode turbines on world load + if (tEU > getMaximumOutput()) { tEU = GT_Utility.safeInt(getMaximumOutput()); } @@ -154,15 +189,17 @@ public class GT_MetaTileEntity_LargeTurbine_Steam extends GT_MetaTileEntity_Larg @Override float getOverflowEfficiency(int totalFlow, int actualOptimalFlow, int overflowMultiplier) { // overflowMultiplier changes how quickly the turbine loses efficiency after flow goes beyond the optimal value - // At the default value of 1, any flow will generate less EU/t than optimal flow, regardless of the amount of fuel used + // At the default value of 1, any flow will generate less EU/t than optimal flow, regardless of the amount of + // fuel used // The bigger this number is, the slower efficiency loss happens as flow moves beyond the optimal value // Steam is the least efficient out of all turbine fuels in this regard float efficiency = 0; if (totalFlow > actualOptimalFlow) { - efficiency = 1.0f - Math.abs((totalFlow - actualOptimalFlow)) / ((float) actualOptimalFlow * (overflowMultiplier + 1)); - } - else { + efficiency = 1.0f + - Math.abs((totalFlow - actualOptimalFlow)) + / ((float) actualOptimalFlow * (overflowMultiplier + 1)); + } else { efficiency = 1.0f - Math.abs((totalFlow - actualOptimalFlow) / (float) actualOptimalFlow); } @@ -171,29 +208,29 @@ public class GT_MetaTileEntity_LargeTurbine_Steam extends GT_MetaTileEntity_Larg public static long[] calculateLooseFlow(int aOptFlow, int aBaseEff) { aOptFlow *= 4; - if(aBaseEff>=26000) { + if (aBaseEff >= 26000) { aOptFlow *= Math.pow(1.1f, ((aBaseEff - 8000) / 10000F) * 20f); aBaseEff *= 0.6f; - }else if(aBaseEff>22000) { + } else if (aBaseEff > 22000) { aOptFlow *= Math.pow(1.1f, ((aBaseEff - 7000) / 10000F) * 20f); aBaseEff *= 0.65f; - }else if(aBaseEff>18000) { + } else if (aBaseEff > 18000) { aOptFlow *= Math.pow(1.1f, ((aBaseEff - 6000) / 10000F) * 20f); aBaseEff *= 0.70f; - }else if(aBaseEff>14000) { + } else if (aBaseEff > 14000) { aOptFlow *= Math.pow(1.1f, ((aBaseEff - 5000) / 10000F) * 20f); aBaseEff *= 0.75f; - }else if(aBaseEff>10000) { + } else if (aBaseEff > 10000) { aOptFlow *= Math.pow(1.1f, ((aBaseEff - 4000) / 10000F) * 20f); aBaseEff *= 0.8f; - }else if(aBaseEff>6000) { + } else if (aBaseEff > 6000) { aOptFlow *= Math.pow(1.1f, ((aBaseEff - 3000) / 10000F) * 20f); aBaseEff *= 0.85f; - }else{ + } else { aBaseEff *= 0.9f; } - if (aBaseEff % 100 != 0){ + if (aBaseEff % 100 != 0) { aBaseEff -= aBaseEff % 100; } @@ -207,7 +244,11 @@ public class GT_MetaTileEntity_LargeTurbine_Steam extends GT_MetaTileEntity_Larg public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { if (aSide == getBaseMetaTileEntity().getFrontFacing()) { looseFit ^= true; - GT_Utility.sendChatToPlayer(aPlayer, looseFit ? GT_Utility.trans("500", "Fitting: Loose - More Flow") : GT_Utility.trans("501", "Fitting: Tight - More Efficiency")); + GT_Utility.sendChatToPlayer( + aPlayer, + looseFit + ? GT_Utility.trans("500", "Fitting: Loose - More Flow") + : GT_Utility.trans("501", "Fitting: Tight - More Efficiency")); } } @@ -216,7 +257,6 @@ public class GT_MetaTileEntity_LargeTurbine_Steam extends GT_MetaTileEntity_Larg return (looseFit && XSTR_INSTANCE.nextInt(4) == 0) ? 0 : 1; } - @Override public String[] getInfoData() { super.looseFit = looseFit; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java index b0de2803b3..7d3b341786 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java @@ -1,5 +1,16 @@ package gregtech.common.tileentities.machines.multi; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; +import static gregtech.api.enums.GT_HatchElement.*; +import static gregtech.api.enums.GT_Values.VN; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_MULTI_SMELTER; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_MULTI_SMELTER_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_MULTI_SMELTER_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_MULTI_SMELTER_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages; + import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IItemSource; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; @@ -22,6 +33,7 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_StructureUtility; import gregtech.api.util.GT_Utility; +import java.util.ArrayList; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; @@ -29,43 +41,40 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; -import java.util.ArrayList; - -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; -import static gregtech.api.enums.GT_HatchElement.*; -import static gregtech.api.enums.GT_Values.VN; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_MULTI_SMELTER; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_MULTI_SMELTER_ACTIVE; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_MULTI_SMELTER_ACTIVE_GLOW; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_MULTI_SMELTER_GLOW; -import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages; - -public class GT_MetaTileEntity_MultiFurnace extends GT_MetaTileEntity_AbstractMultiFurnace<GT_MetaTileEntity_MultiFurnace> implements ISurvivalConstructable { +public class GT_MetaTileEntity_MultiFurnace + extends GT_MetaTileEntity_AbstractMultiFurnace<GT_MetaTileEntity_MultiFurnace> + implements ISurvivalConstructable { private int mLevel = 0; private int mCostDiscount = 1; private static final int CASING_INDEX = 11; private static final String STRUCTURE_PIECE_MAIN = "main"; - private static final IStructureDefinition<GT_MetaTileEntity_MultiFurnace> STRUCTURE_DEFINITION = StructureDefinition.<GT_MetaTileEntity_MultiFurnace>builder() - .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{ - {"ccc", "cmc", "ccc"}, - {"CCC", "C-C", "CCC",}, - {"b~b", "bbb", "bbb"} - })) - .addElement('c', ofBlock(GregTech_API.sBlockCasings1, CASING_INDEX)) - .addElement('m', Muffler.newAny(CASING_INDEX, 2)) - .addElement('C', GT_StructureUtility.ofCoil(GT_MetaTileEntity_MultiFurnace::setCoilLevel, GT_MetaTileEntity_MultiFurnace::getCoilLevel)) - .addElement('b', ofChain( - GT_StructureUtility.<GT_MetaTileEntity_MultiFurnace>buildHatchAdder() - .atLeast(Maintenance, InputBus, OutputBus, Energy) - .casingIndex(CASING_INDEX) - .dot(1) - .build(), - ofBlock(GregTech_API.sBlockCasings1, CASING_INDEX) - )) - .build(); + private static final IStructureDefinition<GT_MetaTileEntity_MultiFurnace> STRUCTURE_DEFINITION = + StructureDefinition.<GT_MetaTileEntity_MultiFurnace>builder() + .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][] { + {"ccc", "cmc", "ccc"}, + { + "CCC", "C-C", "CCC", + }, + {"b~b", "bbb", "bbb"} + })) + .addElement('c', ofBlock(GregTech_API.sBlockCasings1, CASING_INDEX)) + .addElement('m', Muffler.newAny(CASING_INDEX, 2)) + .addElement( + 'C', + GT_StructureUtility.ofCoil( + GT_MetaTileEntity_MultiFurnace::setCoilLevel, + GT_MetaTileEntity_MultiFurnace::getCoilLevel)) + .addElement( + 'b', + ofChain( + GT_StructureUtility.<GT_MetaTileEntity_MultiFurnace>buildHatchAdder() + .atLeast(Maintenance, InputBus, OutputBus, Energy) + .casingIndex(CASING_INDEX) + .dot(1) + .build(), + ofBlock(GregTech_API.sBlockCasings1, CASING_INDEX))) + .build(); public GT_MetaTileEntity_MultiFurnace(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -103,21 +112,45 @@ public class GT_MetaTileEntity_MultiFurnace extends GT_MetaTileEntity_AbstractMu } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - if (aSide != aFacing) return new ITexture[]{casingTexturePages[0][CASING_INDEX]}; - if (aActive) return new ITexture[]{ - casingTexturePages[0][CASING_INDEX], - TextureFactory.builder().addIcon(OVERLAY_FRONT_MULTI_SMELTER_ACTIVE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_MULTI_SMELTER_ACTIVE_GLOW).extFacing().glow().build()}; - return new ITexture[]{ + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { + if (aSide != aFacing) return new ITexture[] {casingTexturePages[0][CASING_INDEX]}; + if (aActive) + return new ITexture[] { casingTexturePages[0][CASING_INDEX], - TextureFactory.builder().addIcon(OVERLAY_FRONT_MULTI_SMELTER).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_MULTI_SMELTER_GLOW).extFacing().glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_MULTI_SMELTER_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_MULTI_SMELTER_ACTIVE_GLOW) + .extFacing() + .glow() + .build() + }; + return new ITexture[] { + casingTexturePages[0][CASING_INDEX], + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_MULTI_SMELTER) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_MULTI_SMELTER_GLOW) + .extFacing() + .glow() + .build() + }; } @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "MultiFurnace.png"); + return new GT_GUIContainer_MultiMachine( + aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "MultiFurnace.png"); } @Override @@ -126,15 +159,14 @@ public class GT_MetaTileEntity_MultiFurnace extends GT_MetaTileEntity_AbstractMu } @Override - public int getPollutionPerSecond(ItemStack aStack){ + public int getPollutionPerSecond(ItemStack aStack) { return GT_Mod.gregtechproxy.mPollutionMultiSmelterPerSecond; } @Override public boolean checkRecipe(ItemStack aStack) { ArrayList<ItemStack> tInputList = getStoredInputs(); - if (tInputList.isEmpty()) - return false; + if (tInputList.isEmpty()) return false; int mVolatage = GT_Utility.safeInt(getMaxInputVoltage()); int tMaxParrallel = 8 * this.mLevel; @@ -171,16 +203,13 @@ public class GT_MetaTileEntity_MultiFurnace extends GT_MetaTileEntity_AbstractMu this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; calculateOverclockedNessMulti(4, 512, 1, mVolatage); - //In case recipe is too OP for that machine - if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) - return false; + // In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return false; - this.mEUt = GT_Utility.safeInt(((long)mEUt) * this.mLevel / (long)this.mCostDiscount,1); - if (mEUt == Integer.MAX_VALUE - 1) - return false; + this.mEUt = GT_Utility.safeInt(((long) mEUt) * this.mLevel / (long) this.mCostDiscount, 1); + if (mEUt == Integer.MAX_VALUE - 1) return false; - if (this.mEUt > 0) - this.mEUt = (-this.mEUt); + if (this.mEUt > 0) this.mEUt = (-this.mEUt); } updateSlots(); return true; @@ -192,7 +221,7 @@ public class GT_MetaTileEntity_MultiFurnace extends GT_MetaTileEntity_AbstractMu } @Override - public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack){ + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { this.mLevel = 0; this.mCostDiscount = 1; @@ -200,14 +229,11 @@ public class GT_MetaTileEntity_MultiFurnace extends GT_MetaTileEntity_AbstractMu setCoilLevel(HeatingCoilLevel.None); - if (!checkPiece(STRUCTURE_PIECE_MAIN, 1, 2, 0)) - return false; + if (!checkPiece(STRUCTURE_PIECE_MAIN, 1, 2, 0)) return false; - if (getCoilLevel() == HeatingCoilLevel.None) - return false; + if (getCoilLevel() == HeatingCoilLevel.None) return false; - if (mMaintenanceHatches.size() != 1) - return false; + if (mMaintenanceHatches.size() != 1) return false; this.mLevel = getCoilLevel().getLevel(); this.mCostDiscount = getCoilLevel().getCostDiscount(); @@ -225,49 +251,56 @@ public class GT_MetaTileEntity_MultiFurnace extends GT_MetaTileEntity_AbstractMu for (int zPos = tZ - 1; zPos <= tZ + 1; zPos++) { if ((xPos == tX) && (zPos == tZ)) continue; tUsedMeta = aBaseMetaTileEntity.getMetaID(xPos, tY + 1, zPos); - if (tUsedMeta >= 12 && tUsedMeta <= 14 && aBaseMetaTileEntity.getBlock(xPos, tY + 1, zPos) == GregTech_API.sBlockCasings1) - aBaseMetaTileEntity.getWorld().setBlock(xPos, tY + 1, zPos, GregTech_API.sBlockCasings5, tUsedMeta - 12, 3); + if (tUsedMeta >= 12 + && tUsedMeta <= 14 + && aBaseMetaTileEntity.getBlock(xPos, tY + 1, zPos) == GregTech_API.sBlockCasings1) + aBaseMetaTileEntity + .getWorld() + .setBlock(xPos, tY + 1, zPos, GregTech_API.sBlockCasings5, tUsedMeta - 12, 3); } } - @Override public String[] getInfoData() { - int mPollutionReduction=0; + int mPollutionReduction = 0; for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) if (isValidMetaTileEntity(tHatch)) mPollutionReduction = Math.max(tHatch.calculatePollutionReduction(100), mPollutionReduction); - long storedEnergy=0; - long maxEnergy=0; - for(GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) + long storedEnergy = 0; + long maxEnergy = 0; + for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) if (isValidMetaTileEntity(tHatch)) { storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU(); maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity(); } - return new String[]{ - StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + - EnumChatFormatting.GREEN + GT_Utility.formatNumbers(mProgresstime / 20) + EnumChatFormatting.RESET + " s / " + - EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(mMaxProgresstime / 20) + EnumChatFormatting.RESET + " s", - StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + - EnumChatFormatting.GREEN + GT_Utility.formatNumbers(storedEnergy) + EnumChatFormatting.RESET + " EU / " + - EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(maxEnergy) + EnumChatFormatting.RESET + " EU", - StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + - EnumChatFormatting.RED + GT_Utility.formatNumbers(-mEUt) + EnumChatFormatting.RESET + " EU/t", - StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + - EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(getMaxInputVoltage()) + EnumChatFormatting.RESET + " EU/t(*2A) " + - StatCollector.translateToLocal("GT5U.machines.tier") + ": " + - EnumChatFormatting.YELLOW + VN[GT_Utility.getTier(getMaxInputVoltage())] + EnumChatFormatting.RESET, - StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + - EnumChatFormatting.RED + (getIdealStatus() - getRepairStatus()) + EnumChatFormatting.RESET + " " + - StatCollector.translateToLocal("GT5U.multiblock.efficiency") + ": " + - EnumChatFormatting.YELLOW + mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", - StatCollector.translateToLocal("GT5U.MS.multismelting") + ": " + - EnumChatFormatting.GREEN + mLevel * 8 + EnumChatFormatting.RESET + - " Discount: (EU/t) / " + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(mCostDiscount) + EnumChatFormatting.RESET, - StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + - EnumChatFormatting.GREEN + mPollutionReduction + EnumChatFormatting.RESET + " %" + return new String[] { + StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(mProgresstime / 20) + EnumChatFormatting.RESET + " s / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(mMaxProgresstime / 20) + EnumChatFormatting.RESET + " s", + StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(storedEnergy) + EnumChatFormatting.RESET + " EU / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(maxEnergy) + EnumChatFormatting.RESET + " EU", + StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + EnumChatFormatting.RED + + GT_Utility.formatNumbers(-mEUt) + EnumChatFormatting.RESET + " EU/t", + StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(getMaxInputVoltage()) + EnumChatFormatting.RESET + " EU/t(*2A) " + + StatCollector.translateToLocal("GT5U.machines.tier") + + ": " + EnumChatFormatting.YELLOW + + VN[GT_Utility.getTier(getMaxInputVoltage())] + EnumChatFormatting.RESET, + StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + EnumChatFormatting.RED + + (getIdealStatus() - getRepairStatus()) + EnumChatFormatting.RESET + " " + + StatCollector.translateToLocal("GT5U.multiblock.efficiency") + + ": " + EnumChatFormatting.YELLOW + + mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", + StatCollector.translateToLocal("GT5U.MS.multismelting") + ": " + EnumChatFormatting.GREEN + + mLevel * 8 + EnumChatFormatting.RESET + " Discount: (EU/t) / " + + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(mCostDiscount) + EnumChatFormatting.RESET, + StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + EnumChatFormatting.GREEN + + mPollutionReduction + EnumChatFormatting.RESET + " %" }; } @@ -280,10 +313,10 @@ public class GT_MetaTileEntity_MultiFurnace extends GT_MetaTileEntity_AbstractMu if (aTileEntity == null) return false; IMetaTileEntity tMTE = aTileEntity.getMetaTileEntity(); if (tMTE == null) return false; - return tMTE instanceof GT_MetaTileEntity_Hatch_Energy || - tMTE instanceof GT_MetaTileEntity_Hatch_InputBus || - tMTE instanceof GT_MetaTileEntity_Hatch_OutputBus || - tMTE instanceof GT_MetaTileEntity_Hatch_Maintenance; + return tMTE instanceof GT_MetaTileEntity_Hatch_Energy + || tMTE instanceof GT_MetaTileEntity_Hatch_InputBus + || tMTE instanceof GT_MetaTileEntity_Hatch_OutputBus + || tMTE instanceof GT_MetaTileEntity_Hatch_Maintenance; } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilCracker.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilCracker.java index fe91d2cf81..dacf503128 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilCracker.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilCracker.java @@ -1,5 +1,17 @@ package gregtech.common.tileentities.machines.multi; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_CRACKER; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_CRACKER_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_CRACKER_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_CRACKER_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages; +import static gregtech.api.util.GT_StructureUtility.ofCoil; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; + import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IItemSource; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; @@ -17,56 +29,67 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import java.util.ArrayList; +import java.util.List; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; -import java.util.ArrayList; -import java.util.List; - -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_CRACKER; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_CRACKER_ACTIVE; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_CRACKER_ACTIVE_GLOW; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_CRACKER_GLOW; -import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages; -import static gregtech.api.util.GT_StructureUtility.ofCoil; -import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; - -public class GT_MetaTileEntity_OilCracker extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_OilCracker> implements ISurvivalConstructable { +public class GT_MetaTileEntity_OilCracker extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_OilCracker> + implements ISurvivalConstructable { private static final byte CASING_INDEX = 49; private static final String STRUCTURE_PIECE_MAIN = "main"; - private static final IStructureDefinition<GT_MetaTileEntity_OilCracker> STRUCTURE_DEFINITION = StructureDefinition.<GT_MetaTileEntity_OilCracker>builder() - .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{ - {"lcmcr", "lcmcr", "lcmcr"}, - {"lc~cr", "l---r", "lcmcr"}, - {"lcmcr", "lcmcr", "lcmcr"}, - })) - .addElement('c', ofCoil(GT_MetaTileEntity_OilCracker::setCoilLevel, GT_MetaTileEntity_OilCracker::getCoilLevel)) - .addElement('l', ofChain( // TODO figure out what to do with this - ofHatchAdder(GT_MetaTileEntity_OilCracker::addLeftHatchToMachineList, CASING_INDEX, 2), - ofHatchAdder(GT_MetaTileEntity_OilCracker::addEnergyInputToMachineList, CASING_INDEX, 1), - ofHatchAdder(GT_MetaTileEntity_OilCracker::addMaintenanceToMachineList, CASING_INDEX, 1), - onElementPass(GT_MetaTileEntity_OilCracker::onCasingAdded, ofBlock(GregTech_API.sBlockCasings4, 1)) - )) - .addElement('r', ofChain( - ofHatchAdder(GT_MetaTileEntity_OilCracker::addRightHatchToMachineList, CASING_INDEX, 3), - ofHatchAdder(GT_MetaTileEntity_OilCracker::addEnergyInputToMachineList, CASING_INDEX, 1), - ofHatchAdder(GT_MetaTileEntity_OilCracker::addMaintenanceToMachineList, CASING_INDEX, 1), - onElementPass(GT_MetaTileEntity_OilCracker::onCasingAdded, ofBlock(GregTech_API.sBlockCasings4, 1)) - )) - .addElement('m', ofChain( - ofHatchAdder(GT_MetaTileEntity_OilCracker::addMiddleInputToMachineList, CASING_INDEX, 1), - ofHatchAdder(GT_MetaTileEntity_OilCracker::addEnergyInputToMachineList, CASING_INDEX, 1), - ofHatchAdder(GT_MetaTileEntity_OilCracker::addMaintenanceToMachineList, CASING_INDEX, 1), - onElementPass(GT_MetaTileEntity_OilCracker::onCasingAdded, ofBlock(GregTech_API.sBlockCasings4, 1)) - )) - .build(); + private static final IStructureDefinition<GT_MetaTileEntity_OilCracker> STRUCTURE_DEFINITION = + StructureDefinition.<GT_MetaTileEntity_OilCracker>builder() + .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][] { + {"lcmcr", "lcmcr", "lcmcr"}, + {"lc~cr", "l---r", "lcmcr"}, + {"lcmcr", "lcmcr", "lcmcr"}, + })) + .addElement( + 'c', + ofCoil( + GT_MetaTileEntity_OilCracker::setCoilLevel, + GT_MetaTileEntity_OilCracker::getCoilLevel)) + .addElement( + 'l', + ofChain( // TODO figure out what to do with this + ofHatchAdder( + GT_MetaTileEntity_OilCracker::addLeftHatchToMachineList, CASING_INDEX, 2), + ofHatchAdder( + GT_MetaTileEntity_OilCracker::addEnergyInputToMachineList, CASING_INDEX, 1), + ofHatchAdder( + GT_MetaTileEntity_OilCracker::addMaintenanceToMachineList, CASING_INDEX, 1), + onElementPass( + GT_MetaTileEntity_OilCracker::onCasingAdded, + ofBlock(GregTech_API.sBlockCasings4, 1)))) + .addElement( + 'r', + ofChain( + ofHatchAdder( + GT_MetaTileEntity_OilCracker::addRightHatchToMachineList, CASING_INDEX, 3), + ofHatchAdder( + GT_MetaTileEntity_OilCracker::addEnergyInputToMachineList, CASING_INDEX, 1), + ofHatchAdder( + GT_MetaTileEntity_OilCracker::addMaintenanceToMachineList, CASING_INDEX, 1), + onElementPass( + GT_MetaTileEntity_OilCracker::onCasingAdded, + ofBlock(GregTech_API.sBlockCasings4, 1)))) + .addElement( + 'm', + ofChain( + ofHatchAdder( + GT_MetaTileEntity_OilCracker::addMiddleInputToMachineList, CASING_INDEX, 1), + ofHatchAdder( + GT_MetaTileEntity_OilCracker::addEnergyInputToMachineList, CASING_INDEX, 1), + ofHatchAdder( + GT_MetaTileEntity_OilCracker::addMaintenanceToMachineList, CASING_INDEX, 1), + onElementPass( + GT_MetaTileEntity_OilCracker::onCasingAdded, + ofBlock(GregTech_API.sBlockCasings4, 1)))) + .build(); private HeatingCoilLevel heatLevel; protected final List<GT_MetaTileEntity_Hatch_Input> mMiddleInputHatches = new ArrayList<>(); // 0 -> left, 1 -> right, any other -> not found @@ -103,7 +126,7 @@ public class GT_MetaTileEntity_OilCracker extends GT_MetaTileEntity_EnhancedMult .addEnergyHatch("Any casing", 1) .addMaintenanceHatch("Any casing", 1) .addInputHatch("Steam/Hydrogen ONLY, Any middle ring casing", 1) - .addInputHatch("Any left/right side casing",2, 3) + .addInputHatch("Any left/right side casing", 2, 3) .addOutputHatch("Any right/left side casing", 2, 3) .addStructureInfo("Input/Output Hatches must be on opposite sides!") .addStructureHint("GT5U.cracker.io_side") @@ -112,21 +135,47 @@ public class GT_MetaTileEntity_OilCracker extends GT_MetaTileEntity_EnhancedMult } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { if (aSide == aFacing) { - if (aActive) return new ITexture[]{casingTexturePages[0][CASING_INDEX], - TextureFactory.builder().addIcon(OVERLAY_FRONT_OIL_CRACKER_ACTIVE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_OIL_CRACKER_ACTIVE_GLOW).extFacing().glow().build()}; - return new ITexture[]{casingTexturePages[0][CASING_INDEX], - TextureFactory.builder().addIcon(OVERLAY_FRONT_OIL_CRACKER).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_OIL_CRACKER_GLOW).extFacing().glow().build()}; + if (aActive) + return new ITexture[] { + casingTexturePages[0][CASING_INDEX], + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_OIL_CRACKER_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_OIL_CRACKER_ACTIVE_GLOW) + .extFacing() + .glow() + .build() + }; + return new ITexture[] { + casingTexturePages[0][CASING_INDEX], + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_OIL_CRACKER) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_OIL_CRACKER_GLOW) + .extFacing() + .glow() + .build() + }; } - return new ITexture[]{casingTexturePages[0][CASING_INDEX]}; + return new ITexture[] {casingTexturePages[0][CASING_INDEX]}; } @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "OilCrackingUnit.png"); + return new GT_GUIContainer_MultiMachine( + aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "OilCrackingUnit.png"); } @Override @@ -141,37 +190,33 @@ public class GT_MetaTileEntity_OilCracker extends GT_MetaTileEntity_EnhancedMult long tVoltage = getMaxInputVoltage(); byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); - GT_Recipe tRecipe = getRecipeMap().findRecipe( - getBaseMetaTileEntity(), - false, - gregtech.api.enums.GT_Values.V[tTier], - tFluidInputs, - mInventory[1] - ); + GT_Recipe tRecipe = getRecipeMap() + .findRecipe( + getBaseMetaTileEntity(), + false, + gregtech.api.enums.GT_Values.V[tTier], + tFluidInputs, + mInventory[1]); - if (tRecipe == null) - return false; + if (tRecipe == null) return false; if (tRecipe.isRecipeInputEqual(true, tFluidInputs, mInventory[1])) { this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, 1, tVoltage); - //In case recipe is too OP for that machine - if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) - return false; + // In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return false; // heatLevel.getTier() starts at 0 if (this.heatLevel.getTier() < 5) { this.mEUt *= 1 - (0.1D * (this.heatLevel.getTier() + 1)); - } - else { + } else { this.mEUt *= 0.5; } - if (this.mEUt > 0) - this.mEUt = (-this.mEUt); + if (this.mEUt > 0) this.mEUt = (-this.mEUt); - this.mOutputFluids = new FluidStack[]{tRecipe.getFluidOutput(0)}; + this.mOutputFluids = new FluidStack[] {tRecipe.getFluidOutput(0)}; return true; } return false; @@ -208,8 +253,7 @@ public class GT_MetaTileEntity_OilCracker extends GT_MetaTileEntity_EnhancedMult IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity == null) return false; if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - if (mInputOnSide == 1) - return false; + if (mInputOnSide == 1) return false; mInputOnSide = 0; mOutputOnSide = 1; GT_MetaTileEntity_Hatch_Input tHatch = (GT_MetaTileEntity_Hatch_Input) aMetaTileEntity; @@ -218,8 +262,7 @@ public class GT_MetaTileEntity_OilCracker extends GT_MetaTileEntity_EnhancedMult return mInputHatches.add(tHatch); } if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { - if (mOutputOnSide == 1) - return false; + if (mOutputOnSide == 1) return false; mInputOnSide = 1; mOutputOnSide = 0; GT_MetaTileEntity_Hatch_Output tHatch = (GT_MetaTileEntity_Hatch_Output) aMetaTileEntity; @@ -234,8 +277,7 @@ public class GT_MetaTileEntity_OilCracker extends GT_MetaTileEntity_EnhancedMult IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity == null) return false; if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - if (mInputOnSide == 0) - return false; + if (mInputOnSide == 0) return false; mInputOnSide = 1; mOutputOnSide = 0; GT_MetaTileEntity_Hatch_Input tHatch = (GT_MetaTileEntity_Hatch_Input) aMetaTileEntity; @@ -244,8 +286,7 @@ public class GT_MetaTileEntity_OilCracker extends GT_MetaTileEntity_EnhancedMult return mInputHatches.add(tHatch); } if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { - if (mOutputOnSide == 0) - return false; + if (mOutputOnSide == 0) return false; mInputOnSide = 0; mOutputOnSide = 1; GT_MetaTileEntity_Hatch_Output tHatch = (GT_MetaTileEntity_Hatch_Output) aMetaTileEntity; @@ -267,9 +308,12 @@ public class GT_MetaTileEntity_OilCracker extends GT_MetaTileEntity_EnhancedMult mInputOnSide = -1; mOutputOnSide = -1; replaceDeprecatedCoils(aBaseMetaTileEntity); - return checkPiece(STRUCTURE_PIECE_MAIN, 2, 1, 0) && - mInputOnSide != -1 && mOutputOnSide != -1 && mCasingAmount >= 18 && - mMaintenanceHatches.size() == 1 && !mMiddleInputHatches.isEmpty(); + return checkPiece(STRUCTURE_PIECE_MAIN, 2, 1, 0) + && mInputOnSide != -1 + && mOutputOnSide != -1 + && mCasingAmount >= 18 + && mMaintenanceHatches.size() == 1 + && !mMiddleInputHatches.isEmpty(); } @Override @@ -306,24 +350,15 @@ public class GT_MetaTileEntity_OilCracker extends GT_MetaTileEntity_EnhancedMult for (int xPos = tX - 1; xPos <= tX + 1; xPos += (xDir != 0 ? 1 : 2)) for (int yPos = tY - 1; yPos <= tY + 1; yPos++) for (int zPos = tZ - 1; zPos <= tZ + 1; zPos += (xDir != 0 ? 2 : 1)) { - if ((yPos == tY) && (xPos == tX || zPos == tZ)) - continue; + if ((yPos == tY) && (xPos == tX || zPos == tZ)) continue; byte tUsedMeta = aBaseMetaTileEntity.getMetaID(xPos, yPos, zPos); - if (tUsedMeta < 12) - continue; - if (tUsedMeta > 14) - continue; - if (aBaseMetaTileEntity.getBlock(xPos, yPos, zPos) != GregTech_API.sBlockCasings1) - continue; - - aBaseMetaTileEntity.getWorld().setBlock( - xPos, - yPos, - zPos, - GregTech_API.sBlockCasings5, - tUsedMeta - 12, - 3 - ); + if (tUsedMeta < 12) continue; + if (tUsedMeta > 14) continue; + if (aBaseMetaTileEntity.getBlock(xPos, yPos, zPos) != GregTech_API.sBlockCasings1) continue; + + aBaseMetaTileEntity + .getWorld() + .setBlock(xPos, yPos, zPos, GregTech_API.sBlockCasings5, tUsedMeta - 12, 3); } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrillBase.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrillBase.java index 9af495bcb3..a282cb3620 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrillBase.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrillBase.java @@ -1,5 +1,14 @@ package gregtech.common.tileentities.machines.multi; +import static gregtech.api.enums.GT_Values.*; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_DRILL; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_DRILL_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_DRILL_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_DRILL_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.getCasingTextureForId; +import static gregtech.common.GT_UndergroundOil.undergroundOil; +import static gregtech.common.GT_UndergroundOil.undergroundOilReadInformation; + import gregtech.api.gui.GT_GUIContainer_MultiMachine; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -8,6 +17,9 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Log; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Utility; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; @@ -20,19 +32,6 @@ import net.minecraft.world.chunk.Chunk; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import static gregtech.api.enums.GT_Values.*; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_DRILL; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_DRILL_ACTIVE; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_DRILL_ACTIVE_GLOW; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_DRILL_GLOW; -import static gregtech.api.enums.Textures.BlockIcons.getCasingTextureForId; -import static gregtech.common.GT_UndergroundOil.undergroundOil; -import static gregtech.common.GT_UndergroundOil.undergroundOilReadInformation; - public abstract class GT_MetaTileEntity_OilDrillBase extends GT_MetaTileEntity_DrillerBase { private final ArrayList<Chunk> mOilFieldChunks = new ArrayList<>(); private int mOilId = 0; @@ -49,18 +48,41 @@ public abstract class GT_MetaTileEntity_OilDrillBase extends GT_MetaTileEntity_D } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { if (aSide == aFacing) { - if (aActive) return new ITexture[]{ - getCasingTextureForId(casingTextureIndex), - TextureFactory.builder().addIcon(OVERLAY_FRONT_OIL_DRILL_ACTIVE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_OIL_DRILL_ACTIVE_GLOW).extFacing().glow().build()}; - return new ITexture[]{ + if (aActive) + return new ITexture[] { getCasingTextureForId(casingTextureIndex), - TextureFactory.builder().addIcon(OVERLAY_FRONT_OIL_DRILL).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_OIL_DRILL_GLOW).extFacing().glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_OIL_DRILL_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_OIL_DRILL_ACTIVE_GLOW) + .extFacing() + .glow() + .build() + }; + return new ITexture[] { + getCasingTextureForId(casingTextureIndex), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_OIL_DRILL) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_OIL_DRILL_GLOW) + .extFacing() + .glow() + .build() + }; } - return new ITexture[]{getCasingTextureForId(casingTextureIndex)}; + return new ITexture[] {getCasingTextureForId(casingTextureIndex)}; } @Override @@ -74,8 +96,7 @@ public abstract class GT_MetaTileEntity_OilDrillBase extends GT_MetaTileEntity_D public void loadNBTData(NBTTagCompound aNBT) { super.loadNBTData(aNBT); mOilId = aNBT.getInteger("mOilId"); - if (aNBT.hasKey("chunkRangeConfig")) - chunkRangeConfig = aNBT.getInteger("chunkRangeConfig"); + if (aNBT.hasKey("chunkRangeConfig")) chunkRangeConfig = aNBT.getInteger("chunkRangeConfig"); } protected GT_Multiblock_Tooltip_Builder createTooltip(String tierSuffix) { @@ -83,11 +104,14 @@ public abstract class GT_MetaTileEntity_OilDrillBase extends GT_MetaTileEntity_D final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Pump") - .addInfo("Controller Block for the Oil/Gas/Fluid Drilling Rig " + (tierSuffix != null ? tierSuffix : "")) + .addInfo( + "Controller Block for the Oil/Gas/Fluid Drilling Rig " + (tierSuffix != null ? tierSuffix : "")) .addInfo("Works on " + getRangeInChunks() + "x" + getRangeInChunks() + " chunks") .addInfo("Use a Screwdriver to configure range") .addInfo("Use Programmed Circuits to ignore near exhausted oil field") - .addInfo("If total circuit # is greater than output amount it will halt. If it worked right.")//doesn't work + .addInfo( + "If total circuit # is greater than output amount it will halt. If it worked right.") // doesn't + // work .addSeparator() .beginStructureBlock(3, 7, 3, false) .addController("Front bottom") @@ -102,10 +126,10 @@ public abstract class GT_MetaTileEntity_OilDrillBase extends GT_MetaTileEntity_D return tt; } - @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "DrillingRig.png"); + return new GT_GUIContainer_MultiMachine( + aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "DrillingRig.png"); } protected abstract int getRangeInChunks(); @@ -118,17 +142,19 @@ public abstract class GT_MetaTileEntity_OilDrillBase extends GT_MetaTileEntity_D if (chunkRangeConfig > 0) { chunkRangeConfig--; } - if (chunkRangeConfig == 0) - chunkRangeConfig = getRangeInChunks(); + if (chunkRangeConfig == 0) chunkRangeConfig = getRangeInChunks(); } else { if (chunkRangeConfig <= getRangeInChunks()) { chunkRangeConfig++; } - if (chunkRangeConfig > getRangeInChunks()) - chunkRangeConfig = 1; + if (chunkRangeConfig > getRangeInChunks()) chunkRangeConfig = 1; } if (oldChunkRange != chunkRangeConfig) mOilFieldChunks.clear(); - GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("GT5U.machines.workareaset") + " " + chunkRangeConfig + "x" + chunkRangeConfig + StatCollector.translateToLocal("GT5U.machines.chunks"));//TODO Add translation support + GT_Utility.sendChatToPlayer( + aPlayer, + StatCollector.translateToLocal("GT5U.machines.workareaset") + " " + chunkRangeConfig + "x" + + chunkRangeConfig + + StatCollector.translateToLocal("GT5U.machines.chunks")); // TODO Add translation support } @Override @@ -141,23 +167,30 @@ public abstract class GT_MetaTileEntity_OilDrillBase extends GT_MetaTileEntity_D this.mEfficiency = getCurrentEfficiency(null); this.mEfficiencyIncrease = 10000; int tier = Math.max(0, GT_Utility.getTier(getMaxInputVoltage())); - this.mEUt = -7 << (tier << 1);//(1/4) A of current tier when at bottom (7/8) A of current tier while mining - this.mMaxProgresstime = Math.max(1, - (workState == STATE_AT_BOTTOM ? - (64 * (chunkRangeConfig * chunkRangeConfig))>>(getMinTier()-1) : - 120 - ) >> tier); + this.mEUt = -7 << (tier << 1); // (1/4) A of current tier when at bottom (7/8) A of current tier while mining + this.mMaxProgresstime = Math.max( + 1, + (workState == STATE_AT_BOTTOM + ? (64 * (chunkRangeConfig * chunkRangeConfig)) >> (getMinTier() - 1) + : 120) + >> tier); } - protected float computeSpeed(){ - return .5F+(GT_Utility.getTier(getMaxInputVoltage()) - getMinTier()) *.25F; + protected float computeSpeed() { + return .5F + (GT_Utility.getTier(getMaxInputVoltage()) - getMinTier()) * .25F; } @Override - protected boolean workingAtBottom(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) { + protected boolean workingAtBottom( + ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) { switch (tryLowerPipeState(true)) { - case 0: workState = STATE_DOWNWARD; setElectricityStats(); return true; - case 3: workState = STATE_UPWARD; return true; + case 0: + workState = STATE_DOWNWARD; + setElectricityStats(); + return true; + case 3: + workState = STATE_UPWARD; + return true; } if (reachingVoidOrBedrock() && tryFillChunkList()) { @@ -168,17 +201,17 @@ public abstract class GT_MetaTileEntity_OilDrillBase extends GT_MetaTileEntity_D } float speed = computeSpeed(); FluidStack tFluid = pumpOil(speed); - if (tFluid != null && tFluid.amount > getTotalConfigValue()){ - this.mOutputFluids = new FluidStack[]{tFluid}; + if (tFluid != null && tFluid.amount > getTotalConfigValue()) { + this.mOutputFluids = new FluidStack[] {tFluid}; return true; } } - GT_ChunkManager.releaseTicket((TileEntity)getBaseMetaTileEntity()); + GT_ChunkManager.releaseTicket((TileEntity) getBaseMetaTileEntity()); workState = STATE_UPWARD; return true; } - private boolean tryFillChunkList(){ + private boolean tryFillChunkList() { FluidStack tFluid, tOil; if (mOilId <= 0) { tFluid = undergroundOilReadInformation(getBaseMetaTileEntity()); @@ -186,95 +219,80 @@ public abstract class GT_MetaTileEntity_OilDrillBase extends GT_MetaTileEntity_D mOilId = tFluid.getFluidID(); } if (debugDriller) { - GT_Log.out.println( - " Driller on fluid = " + mOilId - ); + GT_Log.out.println(" Driller on fluid = " + mOilId); } tOil = new FluidStack(FluidRegistry.getFluid(mOilId), 0); if (mOilFieldChunks.isEmpty()) { - Chunk tChunk = getBaseMetaTileEntity().getWorld().getChunkFromBlockCoords(getBaseMetaTileEntity().getXCoord(), getBaseMetaTileEntity().getZCoord()); + Chunk tChunk = getBaseMetaTileEntity() + .getWorld() + .getChunkFromBlockCoords( + getBaseMetaTileEntity().getXCoord(), + getBaseMetaTileEntity().getZCoord()); int range = chunkRangeConfig; - int xChunk = Math.floorDiv(tChunk.xPosition,range) * range; //Java was written by idiots. For negative values, / returns rounded towards zero. Fucking morons. - int zChunk = Math.floorDiv(tChunk.zPosition,range) * range; + int xChunk = Math.floorDiv(tChunk.xPosition, range) + * range; // Java was written by idiots. For negative values, / returns rounded towards zero. + // Fucking morons. + int zChunk = Math.floorDiv(tChunk.zPosition, range) * range; if (debugDriller) { - GT_Log.out.println( - "tChunk.xPosition = " + tChunk.xPosition + - " tChunk.zPosition = " + tChunk.zPosition + - " xChunk = " + xChunk + - " zChunk = " + zChunk - ); + GT_Log.out.println("tChunk.xPosition = " + tChunk.xPosition + " tChunk.zPosition = " + + tChunk.zPosition + " xChunk = " + + xChunk + " zChunk = " + + zChunk); } for (int i = 0; i < range; i++) { for (int j = 0; j < range; j++) { if (debugDriller) { - GT_Log.out.println( - " getChunkX = " + (xChunk + i) + - " getChunkZ = " + (zChunk + j) - ); + GT_Log.out.println(" getChunkX = " + (xChunk + i) + " getChunkZ = " + (zChunk + j)); } tChunk = getBaseMetaTileEntity().getWorld().getChunkFromChunkCoords(xChunk + i, zChunk + j); tFluid = undergroundOilReadInformation(tChunk); if (debugDriller) { GT_Log.out.println( - " Fluid in chunk = " + tFluid.getFluid().getID() - ); + " Fluid in chunk = " + tFluid.getFluid().getID()); } if (tOil.isFluidEqual(tFluid) && tFluid.amount > 0) { mOilFieldChunks.add(tChunk); if (debugDriller) { - GT_Log.out.println( - " Matching fluid, quantity = " + tFluid.amount - ); + GT_Log.out.println(" Matching fluid, quantity = " + tFluid.amount); } } } } } if (debugDriller) { - GT_Log.out.println( - "mOilFieldChunks.size = " + mOilFieldChunks.size() - ); + GT_Log.out.println("mOilFieldChunks.size = " + mOilFieldChunks.size()); } return !mOilFieldChunks.isEmpty(); } - protected FluidStack pumpOil(float speed){ + protected FluidStack pumpOil(float speed) { if (mOilId <= 0) return null; FluidStack tFluid, tOil; tOil = new FluidStack(FluidRegistry.getFluid(mOilId), 0); if (debugDriller) { - GT_Log.out.println( - " pump speed = " + speed - ); + GT_Log.out.println(" pump speed = " + speed); } ArrayList<Chunk> emptyChunks = new ArrayList<>(); for (Chunk tChunk : mOilFieldChunks) { - tFluid = undergroundOil(tChunk,speed); + tFluid = undergroundOil(tChunk, speed); if (debugDriller) { - GT_Log.out.println( - " chunkX = " + tChunk.getChunkCoordIntPair().chunkXPos + - " chunkZ = " + tChunk.getChunkCoordIntPair().chunkZPos - ); - if( tFluid != null ) { - GT_Log.out.println( - " Fluid pumped = " + tFluid.amount - ); + GT_Log.out.println(" chunkX = " + tChunk.getChunkCoordIntPair().chunkXPos + " chunkZ = " + + tChunk.getChunkCoordIntPair().chunkZPos); + if (tFluid != null) { + GT_Log.out.println(" Fluid pumped = " + tFluid.amount); } else { - GT_Log.out.println( - " No fluid pumped " - ); + GT_Log.out.println(" No fluid pumped "); } - } - if (tFluid == null || tFluid.amount<1) emptyChunks.add(tChunk); + if (tFluid == null || tFluid.amount < 1) emptyChunks.add(tChunk); if (tOil.isFluidEqual(tFluid)) tOil.amount += tFluid.amount; } - for( Chunk tChunk : emptyChunks) { - mOilFieldChunks.remove( tChunk ); + for (Chunk tChunk : emptyChunks) { + mOilFieldChunks.remove(tChunk); } mOilFlow = tOil.amount; return tOil.amount == 0 ? null : tOil; @@ -282,11 +300,18 @@ public abstract class GT_MetaTileEntity_OilDrillBase extends GT_MetaTileEntity_D @Override public String[] getInfoData() { - List<String> l = new ArrayList<>(Arrays.asList(EnumChatFormatting.BLUE + StatCollector.translateToLocal("GT5U.machines.oilfluidpump") + EnumChatFormatting.RESET, - StatCollector.translateToLocal("GT5U.machines.workarea") + ": " + EnumChatFormatting.GREEN + (chunkRangeConfig) + " x " + (chunkRangeConfig) + - EnumChatFormatting.RESET + " " + StatCollector.translateToLocal("GT5U.machines.chunks"), - "Drilling fluid: " + EnumChatFormatting.GREEN + (mOilId > 0 ? FluidRegistry.getFluid(mOilId).getName() : "None") + EnumChatFormatting.RESET, - "Drilling flow: " + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(this.mMaxProgresstime > 0 ? (mOilFlow / this.mMaxProgresstime) : 0) + EnumChatFormatting.RESET + " L/t")); + List<String> l = new ArrayList<>(Arrays.asList( + EnumChatFormatting.BLUE + + StatCollector.translateToLocal("GT5U.machines.oilfluidpump") + + EnumChatFormatting.RESET, + StatCollector.translateToLocal("GT5U.machines.workarea") + ": " + EnumChatFormatting.GREEN + + (chunkRangeConfig) + " x " + (chunkRangeConfig) + EnumChatFormatting.RESET + " " + + StatCollector.translateToLocal("GT5U.machines.chunks"), + "Drilling fluid: " + EnumChatFormatting.GREEN + + (mOilId > 0 ? FluidRegistry.getFluid(mOilId).getName() : "None") + EnumChatFormatting.RESET, + "Drilling flow: " + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(this.mMaxProgresstime > 0 ? (mOilFlow / this.mMaxProgresstime) : 0) + + EnumChatFormatting.RESET + " L/t")); l.addAll(Arrays.asList(super.getInfoData())); return l.toArray(new String[0]); } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrillInfinite.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrillInfinite.java index 5eb5333045..6fa7c00f0f 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrillInfinite.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrillInfinite.java @@ -1,5 +1,7 @@ package gregtech.common.tileentities.machines.multi; +import static gregtech.api.enums.GT_Values.VN; + import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -8,9 +10,7 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Utility; import net.minecraftforge.fluids.FluidStack; -import static gregtech.api.enums.GT_Values.VN; - -public class GT_MetaTileEntity_OilDrillInfinite extends GT_MetaTileEntity_OilDrillBase{ +public class GT_MetaTileEntity_OilDrillInfinite extends GT_MetaTileEntity_OilDrillBase { public GT_MetaTileEntity_OilDrillInfinite(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); } @@ -47,7 +47,7 @@ public class GT_MetaTileEntity_OilDrillInfinite extends GT_MetaTileEntity_OilDri } @Override - protected FluidStack pumpOil(float speed){ + protected FluidStack pumpOil(float speed) { return super.pumpOil(-speed); } @@ -72,8 +72,8 @@ public class GT_MetaTileEntity_OilDrillInfinite extends GT_MetaTileEntity_OilDri } @Override - protected float computeSpeed(){ - return .5F+(GT_Utility.getTier(getMaxInputVoltage()) - getMinTier()+5) *.25F; + protected float computeSpeed() { + return .5F + (GT_Utility.getTier(getMaxInputVoltage()) - getMinTier() + 5) * .25F; } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant1.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant1.java index ac3e40c5f5..859f826320 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant1.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant1.java @@ -9,12 +9,12 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder; public class GT_MetaTileEntity_OreDrillingPlant1 extends GT_MetaTileEntity_OreDrillingPlantBase { public GT_MetaTileEntity_OreDrillingPlant1(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); - mTier=1; + mTier = 1; } public GT_MetaTileEntity_OreDrillingPlant1(String aName) { super(aName); - mTier=1; + mTier = 1; } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant2.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant2.java index bf9c628911..e178bdab83 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant2.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant2.java @@ -9,12 +9,12 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder; public class GT_MetaTileEntity_OreDrillingPlant2 extends GT_MetaTileEntity_OreDrillingPlantBase { public GT_MetaTileEntity_OreDrillingPlant2(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); - mTier=2; + mTier = 2; } public GT_MetaTileEntity_OreDrillingPlant2(String aName) { super(aName); - mTier=2; + mTier = 2; } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant3.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant3.java index 411bbef3a7..b8ac96a8a7 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant3.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant3.java @@ -9,12 +9,12 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder; public class GT_MetaTileEntity_OreDrillingPlant3 extends GT_MetaTileEntity_OreDrillingPlantBase { public GT_MetaTileEntity_OreDrillingPlant3(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); - mTier=3; + mTier = 3; } public GT_MetaTileEntity_OreDrillingPlant3(String aName) { super(aName); - mTier=3; + mTier = 3; } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant4.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant4.java index d7daea327c..e4a3da16ac 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant4.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant4.java @@ -9,12 +9,12 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder; public class GT_MetaTileEntity_OreDrillingPlant4 extends GT_MetaTileEntity_OreDrillingPlantBase { public GT_MetaTileEntity_OreDrillingPlant4(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); - mTier=4; + mTier = 4; } public GT_MetaTileEntity_OreDrillingPlant4(String aName) { super(aName); - mTier=4; + mTier = 4; } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlantBase.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlantBase.java index 188525c7c9..5116d453fc 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlantBase.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlantBase.java @@ -1,5 +1,7 @@ package gregtech.common.tileentities.machines.multi; +import static gregtech.api.enums.GT_Values.VN; + import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; @@ -13,7 +15,10 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.blocks.GT_Block_Ores_Abstract; import gregtech.common.blocks.GT_TileEntity_Ores; - +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; @@ -26,13 +31,6 @@ import net.minecraft.world.ChunkCoordIntPair; import net.minecraft.world.ChunkPosition; import net.minecraftforge.fluids.FluidStack; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashSet; - -import static gregtech.api.enums.GT_Values.VN; - public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTileEntity_DrillerBase { private final ArrayList<ChunkPosition> oreBlockPositions = new ArrayList<>(); protected int mTier = 1; @@ -67,7 +65,8 @@ public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTile @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "OreDrillingPlant.png"); + return new GT_GUIContainer_MultiMachine( + aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "OreDrillingPlant.png"); } @Override @@ -77,29 +76,31 @@ public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTile if (chunkRadiusConfig > 0) { chunkRadiusConfig--; } - if (chunkRadiusConfig == 0) - chunkRadiusConfig = getRadiusInChunks(); + if (chunkRadiusConfig == 0) chunkRadiusConfig = getRadiusInChunks(); } else { if (chunkRadiusConfig <= getRadiusInChunks()) { chunkRadiusConfig++; } - if (chunkRadiusConfig > getRadiusInChunks()) - chunkRadiusConfig = 1; + if (chunkRadiusConfig > getRadiusInChunks()) chunkRadiusConfig = 1; } - GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("GT5U.machines.workareaset") + " " + (chunkRadiusConfig << 4) + " " + StatCollector.translateToLocal("GT5U.machines.radius")); + GT_Utility.sendChatToPlayer( + aPlayer, + StatCollector.translateToLocal("GT5U.machines.workareaset") + " " + (chunkRadiusConfig << 4) + " " + + StatCollector.translateToLocal("GT5U.machines.radius")); } @Override - public boolean onWireCutterRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onWireCutterRightClick( + byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { replaceWithCobblestone = !replaceWithCobblestone; GT_Utility.sendChatToPlayer(aPlayer, "Replace with cobblestone " + replaceWithCobblestone); return true; } @Override - protected boolean workingDownward(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) { - if (yHead != oldYHead) - oreBlockPositions.clear(); + protected boolean workingDownward( + ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) { + if (yHead != oldYHead) oreBlockPositions.clear(); if (mWorkChunkNeedsReload && mChunkLoadingEnabled) { // ask to load machine itself GT_ChunkManager.requestChunkLoad((TileEntity) getBaseMetaTileEntity(), null); @@ -108,16 +109,23 @@ public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTile fillMineListIfEmpty(xDrill, yDrill, zDrill, xPipe, zPipe, yHead); if (oreBlockPositions.isEmpty()) { switch (tryLowerPipeState()) { - case 2: mMaxProgresstime = 0; return false; - case 3: workState = STATE_UPWARD; return true; - case 1: workState = STATE_AT_BOTTOM; return true; + case 2: + mMaxProgresstime = 0; + return false; + case 3: + workState = STATE_UPWARD; + return true; + case 1: + workState = STATE_AT_BOTTOM; + return true; } - //new layer - fill again + // new layer - fill again fillMineListIfEmpty(xDrill, yDrill, zDrill, xPipe, zPipe, yHead); } return processOreList(); } - private boolean processOreList(){ + + private boolean processOreList() { ChunkPosition oreBlockPos = null; int x = 0, y = 0, z = 0; Block oreBlock = null; @@ -147,16 +155,22 @@ public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTile Collection<ItemStack> oreBlockDrops = getBlockDrops(oreBlock, x, y, z); ItemStack cobble = GT_Utility.getCobbleForOre(oreBlock, metaData); if (replaceWithCobblestone) { - getBaseMetaTileEntity().getWorld().setBlock(x, y, z, Block.getBlockFromItem(cobble.getItem()), cobble.getItemDamage(), 3); + getBaseMetaTileEntity() + .getWorld() + .setBlock(x, y, z, Block.getBlockFromItem(cobble.getItem()), cobble.getItemDamage(), 3); } else { - getBaseMetaTileEntity().getWorld().setBlockToAir(oreBlockPos.chunkPosX, oreBlockPos.chunkPosY, oreBlockPos.chunkPosZ); + getBaseMetaTileEntity() + .getWorld() + .setBlockToAir(oreBlockPos.chunkPosX, oreBlockPos.chunkPosY, oreBlockPos.chunkPosZ); } mOutputItems = getOutputByDrops(oreBlockDrops); } return true; } + @Override - protected boolean workingAtBottom(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) { + protected boolean workingAtBottom( + ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) { if (!mChunkLoadingEnabled) return super.workingAtBottom(aStack, xDrill, yDrill, zDrill, xPipe, zPipe, yHead, oldYHead); @@ -166,16 +180,15 @@ public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTile } if (mWorkChunkNeedsReload) { - GT_ChunkManager.requestChunkLoad((TileEntity)getBaseMetaTileEntity(), mCurrentChunk); + GT_ChunkManager.requestChunkLoad((TileEntity) getBaseMetaTileEntity(), mCurrentChunk); mWorkChunkNeedsReload = false; return true; } - if (oreBlockPositions.isEmpty()){ + if (oreBlockPositions.isEmpty()) { fillChunkMineList(yHead, yDrill); if (oreBlockPositions.isEmpty()) { - GT_ChunkManager.releaseChunk((TileEntity)getBaseMetaTileEntity(), mCurrentChunk); - if (!moveToNextChunk(xDrill >> 4, zDrill >> 4)) - workState = STATE_UPWARD; + GT_ChunkManager.releaseChunk((TileEntity) getBaseMetaTileEntity(), mCurrentChunk); + if (!moveToNextChunk(xDrill >> 4, zDrill >> 4)) workState = STATE_UPWARD; return true; } } @@ -188,24 +201,24 @@ public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTile // use corner closest to the drill as mining area center final int leftRight = (getXDrill() - (centerX << 4)) < 8 ? 0 : 1; final int topBottom = (getZDrill() - (centerZ << 4)) < 8 ? 0 : 1; - mCurrentChunk = new ChunkCoordIntPair(centerX - chunkRadiusConfig + leftRight, centerZ - chunkRadiusConfig + topBottom); - GT_ChunkManager.requestChunkLoad((TileEntity)getBaseMetaTileEntity(), mCurrentChunk); + mCurrentChunk = + new ChunkCoordIntPair(centerX - chunkRadiusConfig + leftRight, centerZ - chunkRadiusConfig + topBottom); + GT_ChunkManager.requestChunkLoad((TileEntity) getBaseMetaTileEntity(), mCurrentChunk); mWorkChunkNeedsReload = false; } @Override - protected boolean workingUpward(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) { + protected boolean workingUpward( + ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) { if (!mChunkLoadingEnabled || oreBlockPositions.isEmpty()) return super.workingUpward(aStack, xDrill, yDrill, zDrill, xPipe, zPipe, yHead, oldYHead); boolean result = processOreList(); - if (oreBlockPositions.isEmpty()) - GT_ChunkManager.releaseTicket((TileEntity)getBaseMetaTileEntity()); + if (oreBlockPositions.isEmpty()) GT_ChunkManager.releaseTicket((TileEntity) getBaseMetaTileEntity()); return result; } - private boolean moveToNextChunk(int centerX, int centerZ){ - if (mCurrentChunk == null) - return false; + private boolean moveToNextChunk(int centerX, int centerZ) { + if (mCurrentChunk == null) return false; // use corner closest to the drill as mining area center final int left = centerX - chunkRadiusConfig + ((getXDrill() - (centerX << 4)) < 8 ? 0 : 1); final int right = left + chunkRadiusConfig * 2; @@ -234,13 +247,17 @@ public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTile return false; } mCurrentChunk = new ChunkCoordIntPair(nextChunkX, nextChunkZ); - GT_ChunkManager.requestChunkLoad((TileEntity)getBaseMetaTileEntity(), new ChunkCoordIntPair(nextChunkX, nextChunkZ)); + GT_ChunkManager.requestChunkLoad( + (TileEntity) getBaseMetaTileEntity(), new ChunkCoordIntPair(nextChunkX, nextChunkZ)); return true; } @Override - protected boolean checkHatches(){ - return !mMaintenanceHatches.isEmpty() && !mInputHatches.isEmpty() && !mOutputBusses.isEmpty() && !mEnergyHatches.isEmpty(); + protected boolean checkHatches() { + return !mMaintenanceHatches.isEmpty() + && !mInputHatches.isEmpty() + && !mOutputBusses.isEmpty() + && !mEnergyHatches.isEmpty(); } @Override @@ -249,7 +266,9 @@ public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTile this.mEfficiencyIncrease = 10000; int tier = Math.max(1, GT_Utility.getTier(getMaxInputVoltage())); this.mEUt = -3 * (1 << (tier << 1)); - this.mMaxProgresstime = ((workState == STATE_DOWNWARD || workState == STATE_AT_BOTTOM) ? getBaseProgressTime() : 80) / (1 <<tier); + this.mMaxProgresstime = + ((workState == STATE_DOWNWARD || workState == STATE_AT_BOTTOM) ? getBaseProgressTime() : 80) + / (1 << tier); this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); } @@ -261,7 +280,8 @@ public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTile outputItems.add(multiplyStackSize(currentItem)); return; } - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sMaceratorRecipes.findRecipe(getBaseMetaTileEntity(), false, voltage, null, currentItem); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sMaceratorRecipes.findRecipe( + getBaseMetaTileEntity(), false, voltage, null, currentItem); if (tRecipe == null) { outputItems.add(currentItem); return; @@ -280,14 +300,14 @@ public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTile ItemData itemData = GT_OreDictUnificator.getItemData(currentItem); return itemData == null || itemData.mPrefix != OrePrefixes.crushed - && itemData.mPrefix != OrePrefixes.dustImpure - && itemData.mPrefix != OrePrefixes.dust - && itemData.mPrefix != OrePrefixes.gem - && itemData.mPrefix != OrePrefixes.gemChipped - && itemData.mPrefix != OrePrefixes.gemExquisite - && itemData.mPrefix != OrePrefixes.gemFlawed - && itemData.mPrefix != OrePrefixes.gemFlawless - && itemData.mMaterial.mMaterial != Materials.Oilsands; + && itemData.mPrefix != OrePrefixes.dustImpure + && itemData.mPrefix != OrePrefixes.dust + && itemData.mPrefix != OrePrefixes.gem + && itemData.mPrefix != OrePrefixes.gemChipped + && itemData.mPrefix != OrePrefixes.gemExquisite + && itemData.mPrefix != OrePrefixes.gemFlawed + && itemData.mPrefix != OrePrefixes.gemFlawless + && itemData.mMaterial.mMaterial != Materials.Oilsands; } private ItemStack multiplyStackSize(ItemStack itemStack) { @@ -299,8 +319,7 @@ public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTile final int blockMeta = getBaseMetaTileEntity().getMetaID(posX, posY, posZ); if (oreBlock.canSilkHarvest(getBaseMetaTileEntity().getWorld(), null, posX, posY, posZ, blockMeta)) { return Collections.singleton(new ItemStack(oreBlock, 1, blockMeta)); - } else - return oreBlock.getDrops(getBaseMetaTileEntity().getWorld(), posX, posY, posZ, blockMeta, mTier + 3); + } else return oreBlock.getDrops(getBaseMetaTileEntity().getWorld(), posX, posY, posZ, blockMeta, mTier + 3); } private boolean tryConsumeDrillingFluid() { @@ -312,32 +331,26 @@ public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTile } private void fillChunkMineList(int yHead, int yDrill) { - if (mCurrentChunk == null || !oreBlockPositions.isEmpty()) - return; + if (mCurrentChunk == null || !oreBlockPositions.isEmpty()) return; final int minX = mCurrentChunk.chunkXPos << 4; final int maxX = minX + 16; final int minZ = mCurrentChunk.chunkZPos << 4; final int maxZ = minZ + 16; for (int x = minX; x < maxX; ++x) - for (int z = minZ; z < maxZ; ++z) - for (int y = yHead; y < yDrill; ++y) - tryAddOreBlockToMineList(x, y, z); + for (int z = minZ; z < maxZ; ++z) for (int y = yHead; y < yDrill; ++y) tryAddOreBlockToMineList(x, y, z); } private void fillMineListIfEmpty(int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead) { - if (!oreBlockPositions.isEmpty()) - return; + if (!oreBlockPositions.isEmpty()) return; tryAddOreBlockToMineList(xPipe, yHead - 1, zPipe); - if (yHead == yDrill) - return; //skip controller block layer + if (yHead == yDrill) return; // skip controller block layer if (mChunkLoadingEnabled) { int startX = (xDrill >> 4) << 4; int startZ = (zDrill >> 4) << 4; for (int x = startX; x < (startX + 16); ++x) - for (int z = startZ; z < (startZ + 16); ++z) - tryAddOreBlockToMineList(x, yHead, z); + for (int z = startZ; z < (startZ + 16); ++z) tryAddOreBlockToMineList(x, yHead, z); } else { int radius = chunkRadiusConfig << 4; for (int xOff = -radius; xOff <= radius; xOff++) @@ -355,8 +368,7 @@ public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTile TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntity(x, y, z); if (tTileEntity instanceof GT_TileEntity_Ores && ((GT_TileEntity_Ores) tTileEntity).mNatural) oreBlockPositions.add(blockPos); - } else if (GT_Utility.isOre(block, blockMeta)) - oreBlockPositions.add(blockPos); + } else if (GT_Utility.isOre(block, blockMeta)) oreBlockPositions.add(blockPos); } } @@ -368,37 +380,39 @@ public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTile String casings = getCasingBlockItem().get(0).getDisplayName(); final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Miner") - .addInfo("Controller Block for the Ore Drilling Plant " + (tierSuffix != null ? tierSuffix : "")) - .addInfo("Use a Screwdriver to configure block radius") - .addInfo("Maximum radius is " + (getRadiusInChunks() << 4) + " blocks") - .addInfo("Use Soldering iron to turn off chunk mode") - .addInfo("Use Wire Cutter to toggle replacing mined blocks with cobblestone") - .addInfo("In chunk mode, working area center is the chunk corner nearest to the drill") - .addInfo("Gives ~3x as much crushed ore vs normal processing") - .addInfo("Fortune bonus of " + (mTier + 3) + ". Only works on small ores") - .addSeparator() - .beginStructureBlock(3, 7, 3, false) - .addController("Front bottom") - .addOtherStructurePart(casings, "form the 3x1x3 Base") - .addOtherStructurePart(casings, "1x3x1 pillar above the center of the base (2 minimum total)") - .addOtherStructurePart(getFrameMaterial().mName + " Frame Boxes", "Each pillar's side and 1x3x1 on top") - .addEnergyHatch(VN[getMinTier()] + "+, Any base casing", 1) - .addMaintenanceHatch("Any base casing", 1) - .addInputBus("Mining Pipes, optional, any base casing", 1) - .addInputHatch("Drilling Fluid, any base casing", 1) - .addOutputBus("Any base casing", 1) - .toolTipFinisher("Gregtech"); - return tt; + tt.addMachineType("Miner") + .addInfo("Controller Block for the Ore Drilling Plant " + (tierSuffix != null ? tierSuffix : "")) + .addInfo("Use a Screwdriver to configure block radius") + .addInfo("Maximum radius is " + (getRadiusInChunks() << 4) + " blocks") + .addInfo("Use Soldering iron to turn off chunk mode") + .addInfo("Use Wire Cutter to toggle replacing mined blocks with cobblestone") + .addInfo("In chunk mode, working area center is the chunk corner nearest to the drill") + .addInfo("Gives ~3x as much crushed ore vs normal processing") + .addInfo("Fortune bonus of " + (mTier + 3) + ". Only works on small ores") + .addSeparator() + .beginStructureBlock(3, 7, 3, false) + .addController("Front bottom") + .addOtherStructurePart(casings, "form the 3x1x3 Base") + .addOtherStructurePart(casings, "1x3x1 pillar above the center of the base (2 minimum total)") + .addOtherStructurePart(getFrameMaterial().mName + " Frame Boxes", "Each pillar's side and 1x3x1 on top") + .addEnergyHatch(VN[getMinTier()] + "+, Any base casing", 1) + .addMaintenanceHatch("Any base casing", 1) + .addInputBus("Mining Pipes, optional, any base casing", 1) + .addInputHatch("Drilling Fluid, any base casing", 1) + .addOutputBus("Any base casing", 1) + .toolTipFinisher("Gregtech"); + return tt; } @Override public String[] getInfoData() { final int diameter = chunkRadiusConfig * 2; - return new String[]{ - EnumChatFormatting.BLUE+StatCollector.translateToLocal("GT5U.machines.minermulti")+EnumChatFormatting.RESET, - StatCollector.translateToLocal("GT5U.machines.workarea")+": " + EnumChatFormatting.GREEN + diameter + "x" + diameter + - EnumChatFormatting.RESET+" " + StatCollector.translateToLocal("GT5U.machines.chunks") + return new String[] { + EnumChatFormatting.BLUE + + StatCollector.translateToLocal("GT5U.machines.minermulti") + + EnumChatFormatting.RESET, + StatCollector.translateToLocal("GT5U.machines.workarea") + ": " + EnumChatFormatting.GREEN + diameter + "x" + + diameter + EnumChatFormatting.RESET + " " + StatCollector.translateToLocal("GT5U.machines.chunks") }; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PlasmaForge.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PlasmaForge.java index 10b1b3eec8..210d1bfe05 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PlasmaForge.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PlasmaForge.java @@ -1,6 +1,13 @@ package gregtech.common.tileentities.machines.multi; -import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static gregtech.api.enums.GT_HatchElement.*; +import static gregtech.api.enums.GT_Values.*; +import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; +import static gregtech.api.util.GT_StructureUtility.ofCoil; +import static java.lang.Math.*; + import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IItemSource; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; @@ -20,6 +27,8 @@ import gregtech.api.util.GT_ExoticEnergyInputHelper; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import java.util.ArrayList; +import java.util.List; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; @@ -30,20 +39,8 @@ import net.minecraft.util.StatCollector; import net.minecraft.world.ChunkCoordIntPair; import net.minecraftforge.fluids.FluidStack; -import java.util.List; -import java.util.ArrayList; - -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; -import static gregtech.api.enums.GT_HatchElement.*; -import static gregtech.api.enums.GT_Values.*; -import static gregtech.api.enums.Textures.BlockIcons.*; -import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; -import static gregtech.api.util.GT_StructureUtility.ofCoil; -import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional; -import static java.lang.Math.*; - - -public class GT_MetaTileEntity_PlasmaForge extends GT_MetaTileEntity_AbstractMultiFurnace<GT_MetaTileEntity_PlasmaForge> implements ISurvivalConstructable { +public class GT_MetaTileEntity_PlasmaForge extends GT_MetaTileEntity_AbstractMultiFurnace<GT_MetaTileEntity_PlasmaForge> + implements ISurvivalConstructable { // 3600 seconds in an hour, 8 hours, 20 ticks in a second. private static final double max_efficiency_time_in_ticks = 3600d * 8d * 20d; @@ -76,45 +73,868 @@ public class GT_MetaTileEntity_PlasmaForge extends GT_MetaTileEntity_AbstractMul // Custom long EU per tick value given that mEUt is an int. Required to overclock beyond MAX voltage. private long EU_per_tick = 0; - @SuppressWarnings("SpellCheckingInspection") private static final String[][] structure_string = new String[][] { - {" ", " N N N N ", " N N N N ", " N N N N ", " ", " ", " ", " N N N N ", " N N N N ", " NNN NNN N N NNN NNN ", " ", " ", " ", " NNN NNN NNN NNN ", " ", " ", " ", " ", " ", " NNN NNN NNN NNN ", " ", " ", " ", " NNN NNN NNN NNN "}, - {" N N N N ", " bCCCb bCCCb ", " bCCCb bCCCb ", " bCCCb bCCCb ", " N N N N ", " ", " N N N N ", " bCCCb bCCCb ", " bCCCb bCCCb ", "NbbbN NbbNCCCb bCCCNbbN NbbbN", " CCC CCC N N CCC CCC ", " CCC CCC CCC CCC ", " CCC CCC CCC CCC ", "NbbbN NbbbN NbbbN NbbbN", " N N N N ", " N N N N ", " ", " N N N N ", " N N N N ", "NbbbN NbbbN NbbbN NbbbN", " CCC CCC CCC CCC ", " CCC CCC CCC CCC ", " CCC CCC CCC CCC ", "NbbbN NbbbN N N NbbbN NbbbN",}, - {" N N N N ", " bCCCb bCCCb ", " NNNbbbbbNNsNNbbbbbNNN ", " ss bCCCb bCCCb ss ", " s N N N N s ", " s s ", " N N N N N N ", " N bCCCb bCCCb N ", " N sbbbbbNNsNNbbbbbs N ", "NbbbN NbbNCCCb bCCCNbbN NbbbN", " CbC CbC N N CbC CbC ", " CbC CbC CbC CbC ", " CbC CbC CbC CbC ", "NbbbN NbbbN NbbbN NbbbN", " NNN NNN NNN NNN ", " NNN NNN NNN NNN ", " s s s s ", " NNN NNN NNN NNN ", " NNN NNN NNN NNN ", "NbbbN NbbbN NbbbN NbbbN", " CbC CbC CbC CbC ", " CbC CbC CbC CbC ", " CbC CbC CbC CbC ", "NbbbN NbbbNNNNNsNsNNNNNbbbN NbbbN",}, - {" N N N N ", " bCCCb bCCCb ", " ss bCCCb bCCCb ss ", " bCCCb bCCCb ", " s NCCCN NCCCN s ", " s NCCCN NCCCN s ", " NCCCN NCCCN ", " bCCCb bCCCb ", " bCCCb bCCCb ", "NbbbNNNbbNCCCb bCCCNbbNNNbbbN", " CCCCCCCCC N N CCCCCCCCC ", " CCCCCCCCC CCCCCCCCC ", " CCCCCCCCC CCCCCCCCC ", "NbbbNNNbbbN NbbbNNNbbbN", " N N N N ", " N N N N ", " ", " N N N N ", " N N N N ", "NbbbNNNbbbN NbbbNNNbbbN", " CCCCCCCCC CCCCCCCCC ", " CCCCCCCCC CCCCCCCCC ", " CCCCCCCCC CCCCCCCCC ", "NbbbNNNbbbN NbN NbbbNNNbbbN",}, - {" ", " N N N N ", " s N N N N s ", " s NCCCN NCCCN s ", " ", " ", " ", " NCCCN NCCCN ", " N N N N ", " NNN NN N N NN NNN ", " C C C C ", " C C C C ", " C C C C ", " NNN NNN NNN NNN ", " ", " ", " ", " ", " ", " NNN NNN NNN NNN ", " C C C C ", " C C C C ", " C C C C ", " NNN NNN NbN NNN NNN ",}, - {" ", " ", " s s ", " s NCCCN NCCCN s ", " ", " ", " ", " NCCCN NCCCN ", " ", " N N N N ", " C C C C ", " C C C C ", " C C C C ", " N N N N ", " ", " ", " ", " ", " ", " N N N N ", " C C C C ", " C C C C ", " C C C C ", " N N NbN N N ",}, - {" ", " N N N N ", " N N N N N N ", " NCCCN NCCCN ", " ", " ", " ", " NCCCN NCCCN ", " N N N N ", " NNN NN N N NN NNN ", " C C C C ", " C C C C ", " C C C C ", " NNN NNN NNN NNN ", " ", " ", " ", " ", " ", " NNN NNN NNN NNN ", " C C C C ", " C C C C ", " C C C C ", " NNN NNN NbN NNN NNN ",}, - {" N N N N ", " bCCCb bCCCb ", " N bCCCb bCCCb N ", " bCCCb bCCCb ", " NCCCN NCCCN ", " NCCCN NCCCN ", " NCCCN NCCCN ", " bCCCb bCCCb ", " bCCCb bCCCb ", "NbbbNNNbbNCCCb bCCCNbbNNNbbbN", " CCCCCCCCC N N CCCCCCCCC ", " CCCCCCCCC CCCCCCCCC ", " CCCCCCCCC CCCCCCCCC ", "NbbbNNNbbbN NbbbNNNbbbN", " N N N N ", " N N N N ", " ", " N N N N ", " N N N N ", "NbbbNNNbbbN NbbbNNNbbbN", " CCCCCCCCC CCCCCCCCC ", " CCCCCCCCC CCCCCCCCC ", " CCCCCCCCC CCCCCCCCC ", "NbbbNNNbbbN NbN NbbbNNNbbbN",}, - {" N N N N ", " bCCCb bCCCb ", " N sbbbbbNNsNNbbbbbs N ", " bCCCb bCCCb ", " N N N N ", " ", " N N N N ", " bCCCb bCCCb ", " s sbbbbbNNsNNbbbbbs s ", "NbbbN NbbNCCCb bCCCNbbN NbbbN", " CbC CbC N N CbC CbC ", " CbC CbC CbC CbC ", " CbC CbC CbC CbC ", "NbbbN NbbbN NbbbN NbbbN", " NNN NNN NNN NNN ", " NNN NNN NNN NNN ", " s s s s ", " NNN NNN NNN NNN ", " NNN NNN NNN NNN ", "NbbbN NbbbN NbbbN NbbbN", " CbC CbC CbC CbC ", " CbC CbC CbC CbC ", " CbC CbC CbC CbC ", "NbbbN NbbbNNNNNsNsNNNNNbbbN NbbbN",}, - {" NNN NNN N N NNN NNN ", "NbbbN NbbNCCCb bCCCNbbN NbbbN", "NbbbN NbbNCCCb bCCCNbbN NbbbN", "NbbbNNNbbNCCCb bCCCNbbNNNbbbN", " NNN NNN N N NNN NNN ", " N N N N ", " NNN NNN N N NNN NNN ", "NbbbNNNbbNCCCb bCCCNbbNNNbbbN", "NbbbN NbbNCCCb bCCCNbbN NbbbN", "NNNN NNNCCCb bCCCNNN NNNN", " CCC CCC N N CCC CCC ", " CCC CCC CCC CCC ", " CCC CCC CCC CCC ", "NbbbN NbbbN NbbbN NbbbN", " N N N N ", " N N N N ", " ", " N N N N ", " N N N N ", "NbbbN NbbbN NbbbN NbbbN", " CCC CCC CCC CCC ", " CCC CCC CCC CCC ", " CCC CCC CCC CCC ", "NbbbN NbbbN NbN NbbbN NbbbN",}, - {" ", " CCC CCC N N CCC CCC ", " CbC CbC N N CbC CbC ", " CCCCCCCCC N N CCCCCCCCC ", " C C C C ", " C C C C ", " C C C C ", " CCCCCCCCC N N CCCCCCCCC ", " CbC CbC N N CbC CbC ", " CCC CCC N N CCC CCC ", " ", " ", " ", " NNN NNN NNN NNN ", " ", " ", " ", " ", " ", " NNN NNN NNN NNN ", " ", " ", " ", " NNN NNN NbN NNN NNN ",}, - {" ", " CCC CCC CCC CCC ", " CbC CbC CbC CbC ", " CCCCCCCCC CCCCCCCCC ", " C C C C ", " C C C C ", " C C C C ", " CCCCCCCCC CCCCCCCCC ", " CbC CbC CbC CbC ", " CCC CCC CCC CCC ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " N N NbN N N ",}, - {" ", " CCC CCC CCC CCC ", " CbC CbC CbC CbC ", " CCCCCCCCC CCCCCCCCC ", " C C C C ", " C C C C ", " C C C C ", " CCCCCCCCC CCCCCCCCC ", " CbC CbC CbC CbC ", " CCC CCC CCC CCC ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " N N NbN N N ",}, - {" NNN NNN NNN NNN ", "NbbbN NbbbN NbbbN NbbbN", "NbbbN NbbbN NbbbN NbbbN", "NbbbNNNbbbN NbbbNNNbbbN", " NNN NNN NNN NNN ", " N N N N ", " NNN NNN NNN NNN ", "NbbbNNNbbbN NbbbNNNbbbN", "NbbbN NbbbN NbbbN NbbbN", "NbbbN NbbbN NbbbN NbbbN", " NNN NNN NNN NNN ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " N N NsNsN N N ",}, - {" ", " ", " N N N N ", " ", " ", " ", " ", " ", " N N N N ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " N N NbbbbbN N N ",}, - {" ", " ", " N N N N ", " ", " ", " ", " ", " ", " N N N N ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " N ", " NsNNNNNsNNNNsbbbbbsNNNNsNNNNNsN ",}, - {" ", " ", " s s s s ", " ", " ", " ", " ", " ", " s s s s ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ~ ", " NNN ", " NbbbbbNbbbbNbbbbbNbbbbNbbbbbN ",}, - {" ", " ", " N N N N ", " ", " ", " ", " ", " ", " N N N N ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " N ", " NsNNNNNsNNNNsbbbbbsNNNNsNNNNNsN ",}, - {" ", " ", " N N N N ", " ", " ", " ", " ", " ", " N N N N ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " N N NbbbbbN N N ",}, - {" NNN NNN NNN NNN ", "NbbbN NbbbN NbbbN NbbbN", "NbbbN NbbbN NbbbN NbbbN", "NbbbNNNbbbN NbbbNNNbbbN", " NNN NNN NNN NNN ", " N N N N ", " NNN NNN NNN NNN ", "NbbbNNNbbbN NbbbNNNbbbN", "NbbbN NbbbN NbbbN NbbbN", "NbbbN NbbbN NbbbN NbbbN", " NNN NNN NNN NNN ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " N N NsNsN N N ",}, - {" ", " CCC CCC CCC CCC ", " CbC CbC CbC CbC ", " CCCCCCCCC CCCCCCCCC ", " C C C C ", " C C C C ", " C C C C ", " CCCCCCCCC CCCCCCCCC ", " CbC CbC CbC CbC ", " CCC CCC CCC CCC ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " N N NbN N N ",}, - {" ", " CCC CCC CCC CCC ", " CbC CbC CbC CbC ", " CCCCCCCCC CCCCCCCCC ", " C C C C ", " C C C C ", " C C C C ", " CCCCCCCCC CCCCCCCCC ", " CbC CbC CbC CbC ", " CCC CCC CCC CCC ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " N N NbN N N ",}, - {" ", " CCC CCC N N CCC CCC ", " CbC CbC N N CbC CbC ", " CCCCCCCCC N N CCCCCCCCC ", " C C C C ", " C C C C ", " C C C C ", " CCCCCCCCC N N CCCCCCCCC ", " CbC CbC N N CbC CbC ", " CCC CCC N N CCC CCC ", " ", " ", " ", " NNN NNN NNN NNN ", " ", " ", " ", " ", " ", " NNN NNN NNN NNN ", " ", " ", " ", " NNN NNN NbN NNN NNN ",}, - {" NNN NNN N N NNN NNN ", "NbbbN NbbNCCCb bCCCNbbN NbbbN", "NbbbN NbbNCCCb bCCCNbbN NbbbN", "NbbbNNNbbNCCCb bCCCNbbNNNbbbN", " NNN NNN N N NNN NNN ", " N N N N ", " NNN NNN N N NNN NNN ", "NbbbNNNbbNCCCb bCCCNbbNNNbbbN", "NbbbN NbbNCCCb bCCCNbbN NbbbN", "NNNN NNNCCCb bCCCNNN NNNN", " CCC CCC N N CCC CCC ", " CCC CCC CCC CCC ", " CCC CCC CCC CCC ", "NbbbN NbbbN NbbbN NbbbN", " N N N N ", " N N N N ", " ", " N N N N ", " N N N N ", "NbbbN NbbbN NbbbN NbbbN", " CCC CCC CCC CCC ", " CCC CCC CCC CCC ", " CCC CCC CCC CCC ", "NbbbN NbbbN NbN NbbbN NbbbN",}, - {" N N N N ", " bCCCb bCCCb ", " N sbbbbbNNsNNbbbbbs N ", " bCCCb bCCCb ", " N N N N ", " ", " N N N N ", " bCCCb bCCCb ", " s sbbbbbNNsNNbbbbbs s ", "NbbbN NbbNCCCb bCCCNbbN NbbbN", " CbC CbC N N CbC CbC ", " CbC CbC CbC CbC ", " CbC CbC CbC CbC ", "NbbbN NbbbN NbbbN NbbbN", " NNN NNN NNN NNN ", " NNN NNN NNN NNN ", " s s s s ", " NNN NNN NNN NNN ", " NNN NNN NNN NNN ", "NbbbN NbbbN NbbbN NbbbN", " CbC CbC CbC CbC ", " CbC CbC CbC CbC ", " CbC CbC CbC CbC ", "NbbbN NbbbNNNNNsNsNNNNNbbbN NbbbN",}, - {" N N N N ", " bCCCb bCCCb ", " N bCCCb bCCCb N ", " bCCCb bCCCb ", " NCCCN NCCCN ", " NCCCN NCCCN ", " NCCCN NCCCN ", " bCCCb bCCCb ", " bCCCb bCCCb ", "NbbbNNNbbNCCCb bCCCNbbNNNbbbN", " CCCCCCCCC N N CCCCCCCCC ", " CCCCCCCCC CCCCCCCCC ", " CCCCCCCCC CCCCCCCCC ", "NbbbNNNbbbN NbbbNNNbbbN", " N N N N ", " N N N N ", " ", " N N N N ", " N N N N ", "NbbbNNNbbbN NbbbNNNbbbN", " CCCCCCCCC CCCCCCCCC ", " CCCCCCCCC CCCCCCCCC ", " CCCCCCCCC CCCCCCCCC ", "NbbbNNNbbbN NbN NbbbNNNbbbN",}, - {" ", " N N N N ", " N N N N N N ", " NCCCN NCCCN ", " ", " ", " ", " NCCCN NCCCN ", " N N N N ", " NNN NN N N NN NNN ", " C C C C ", " C C C C ", " C C C C ", " NNN NNN NNN NNN ", " ", " ", " ", " ", " ", " NNN NNN NNN NNN ", " C C C C ", " C C C C ", " C C C C ", " NNN NNN NbN NNN NNN ",}, - {" ", " ", " s s ", " s NCCCN NCCCN s ", " ", " ", " ", " NCCCN NCCCN ", " ", " N N N N ", " C C C C ", " C C C C ", " C C C C ", " N N N N ", " ", " ", " ", " ", " ", " N N N N ", " C C C C ", " C C C C ", " C C C C ", " N N NbN N N ",}, - {" ", " N N N N ", " s N N N N s ", " s NCCCN NCCCN s ", " ", " ", " ", " NCCCN NCCCN ", " N N N N ", " NNN NN N N NN NNN ", " C C C C ", " C C C C ", " C C C C ", " NNN NNN NNN NNN ", " ", " ", " ", " ", " ", " NNN NNN NNN NNN ", " C C C C ", " C C C C ", " C C C C ", " NNN NNN NbN NNN NNN ",}, - {" N N N N ", " bCCCb bCCCb ", " ss bCCCb bCCCb ss ", " bCCCb bCCCb ", " s NCCCN NCCCN s ", " s NCCCN NCCCN s ", " NCCCN NCCCN ", " bCCCb bCCCb ", " bCCCb bCCCb ", "NbbbNNNbbNCCCb bCCCNbbNNNbbbN", " CCCCCCCCC N N CCCCCCCCC ", " CCCCCCCCC CCCCCCCCC ", " CCCCCCCCC CCCCCCCCC ", "NbbbNNNbbbN NbbbNNNbbbN", " N N N N ", " N N N N ", " ", " N N N N ", " N N N N ", "NbbbNNNbbbN NbbbNNNbbbN", " CCCCCCCCC CCCCCCCCC ", " CCCCCCCCC CCCCCCCCC ", " CCCCCCCCC CCCCCCCCC ", "NbbbNNNbbbN NbN NbbbNNNbbbN",}, - {" N N N N ", " bCCCb bCCCb ", " NNNbbbbbNNsNNbbbbbNNN ", " ss bCCCb bCCCb ss ", " s N N N N s ", " s s ", " N N N N N N ", " N bCCCb bCCCb N ", " N sbbbbbNNsNNbbbbbs N ", "NbbbN NbbNCCCb bCCCNbbN NbbbN", " CbC CbC N N CbC CbC ", " CbC CbC CbC CbC ", " CbC CbC CbC CbC ", "NbbbN NbbbN NbbbN NbbbN", " NNN NNN NNN NNN ", " NNN NNN NNN NNN ", " s s s s ", " NNN NNN NNN NNN ", " NNN NNN NNN NNN ", "NbbbN NbbbN NbbbN NbbbN", " CbC CbC CbC CbC ", " CbC CbC CbC CbC ", " CbC CbC CbC CbC ", "NbbbN NbbbNNNNNsNsNNNNNbbbN NbbbN",}, - {" N N N N ", " bCCCb bCCCb ", " bCCCb bCCCb ", " bCCCb bCCCb ", " N N N N ", " ", " N N N N ", " bCCCb bCCCb ", " bCCCb bCCCb ", "NbbbN NbbNCCCb bCCCNbbN NbbbN", " CCC CCC N N CCC CCC ", " CCC CCC CCC CCC ", " CCC CCC CCC CCC ", "NbbbN NbbbN NbbbN NbbbN", " N N N N ", " N N N N ", " ", " N N N N ", " N N N N ", "NbbbN NbbbN NbbbN NbbbN", " CCC CCC CCC CCC ", " CCC CCC CCC CCC ", " CCC CCC CCC CCC ", "NbbbN NbbbN N N NbbbN NbbbN",}, - {" ", " N N N N ", " N N N N ", " N N N N ", " ", " ", " ", " N N N N ", " N N N N ", " NNN NNN N N NNN NNN ", " ", " ", " ", " NNN NNN NNN NNN ", " ", " ", " ", " ", " ", " NNN NNN NNN NNN ", " ", " ", " ", " NNN NNN NNN NNN ",} + { + " ", + " N N N N ", + " N N N N ", + " N N N N ", + " ", + " ", + " ", + " N N N N ", + " N N N N ", + " NNN NNN N N NNN NNN ", + " ", + " ", + " ", + " NNN NNN NNN NNN ", + " ", + " ", + " ", + " ", + " ", + " NNN NNN NNN NNN ", + " ", + " ", + " ", + " NNN NNN NNN NNN " + }, + { + " N N N N ", + " bCCCb bCCCb ", + " bCCCb bCCCb ", + " bCCCb bCCCb ", + " N N N N ", + " ", + " N N N N ", + " bCCCb bCCCb ", + " bCCCb bCCCb ", + "NbbbN NbbNCCCb bCCCNbbN NbbbN", + " CCC CCC N N CCC CCC ", + " CCC CCC CCC CCC ", + " CCC CCC CCC CCC ", + "NbbbN NbbbN NbbbN NbbbN", + " N N N N ", + " N N N N ", + " ", + " N N N N ", + " N N N N ", + "NbbbN NbbbN NbbbN NbbbN", + " CCC CCC CCC CCC ", + " CCC CCC CCC CCC ", + " CCC CCC CCC CCC ", + "NbbbN NbbbN N N NbbbN NbbbN", + }, + { + " N N N N ", + " bCCCb bCCCb ", + " NNNbbbbbNNsNNbbbbbNNN ", + " ss bCCCb bCCCb ss ", + " s N N N N s ", + " s s ", + " N N N N N N ", + " N bCCCb bCCCb N ", + " N sbbbbbNNsNNbbbbbs N ", + "NbbbN NbbNCCCb bCCCNbbN NbbbN", + " CbC CbC N N CbC CbC ", + " CbC CbC CbC CbC ", + " CbC CbC CbC CbC ", + "NbbbN NbbbN NbbbN NbbbN", + " NNN NNN NNN NNN ", + " NNN NNN NNN NNN ", + " s s s s ", + " NNN NNN NNN NNN ", + " NNN NNN NNN NNN ", + "NbbbN NbbbN NbbbN NbbbN", + " CbC CbC CbC CbC ", + " CbC CbC CbC CbC ", + " CbC CbC CbC CbC ", + "NbbbN NbbbNNNNNsNsNNNNNbbbN NbbbN", + }, + { + " N N N N ", + " bCCCb bCCCb ", + " ss bCCCb bCCCb ss ", + " bCCCb bCCCb ", + " s NCCCN NCCCN s ", + " s NCCCN NCCCN s ", + " NCCCN NCCCN ", + " bCCCb bCCCb ", + " bCCCb bCCCb ", + "NbbbNNNbbNCCCb bCCCNbbNNNbbbN", + " CCCCCCCCC N N CCCCCCCCC ", + " CCCCCCCCC CCCCCCCCC ", + " CCCCCCCCC CCCCCCCCC ", + "NbbbNNNbbbN NbbbNNNbbbN", + " N N N N ", + " N N N N ", + " ", + " N N N N ", + " N N N N ", + "NbbbNNNbbbN NbbbNNNbbbN", + " CCCCCCCCC CCCCCCCCC ", + " CCCCCCCCC CCCCCCCCC ", + " CCCCCCCCC CCCCCCCCC ", + "NbbbNNNbbbN NbN NbbbNNNbbbN", + }, + { + " ", + " N N N N ", + " s N N N N s ", + " s NCCCN NCCCN s ", + " ", + " ", + " ", + " NCCCN NCCCN ", + " N N N N ", + " NNN NN N N NN NNN ", + " C C C C ", + " C C C C ", + " C C C C ", + " NNN NNN NNN NNN ", + " ", + " ", + " ", + " ", + " ", + " NNN NNN NNN NNN ", + " C C C C ", + " C C C C ", + " C C C C ", + " NNN NNN NbN NNN NNN ", + }, + { + " ", + " ", + " s s ", + " s NCCCN NCCCN s ", + " ", + " ", + " ", + " NCCCN NCCCN ", + " ", + " N N N N ", + " C C C C ", + " C C C C ", + " C C C C ", + " N N N N ", + " ", + " ", + " ", + " ", + " ", + " N N N N ", + " C C C C ", + " C C C C ", + " C C C C ", + " N N NbN N N ", + }, + { + " ", + " N N N N ", + " N N N N N N ", + " NCCCN NCCCN ", + " ", + " ", + " ", + " NCCCN NCCCN ", + " N N N N ", + " NNN NN N N NN NNN ", + " C C C C ", + " C C C C ", + " C C C C ", + " NNN NNN NNN NNN ", + " ", + " ", + " ", + " ", + " ", + " NNN NNN NNN NNN ", + " C C C C ", + " C C C C ", + " C C C C ", + " NNN NNN NbN NNN NNN ", + }, + { + " N N N N ", + " bCCCb bCCCb ", + " N bCCCb bCCCb N ", + " bCCCb bCCCb ", + " NCCCN NCCCN ", + " NCCCN NCCCN ", + " NCCCN NCCCN ", + " bCCCb bCCCb ", + " bCCCb bCCCb ", + "NbbbNNNbbNCCCb bCCCNbbNNNbbbN", + " CCCCCCCCC N N CCCCCCCCC ", + " CCCCCCCCC CCCCCCCCC ", + " CCCCCCCCC CCCCCCCCC ", + "NbbbNNNbbbN NbbbNNNbbbN", + " N N N N ", + " N N N N ", + " ", + " N N N N ", + " N N N N ", + "NbbbNNNbbbN NbbbNNNbbbN", + " CCCCCCCCC CCCCCCCCC ", + " CCCCCCCCC CCCCCCCCC ", + " CCCCCCCCC CCCCCCCCC ", + "NbbbNNNbbbN NbN NbbbNNNbbbN", + }, + { + " N N N N ", + " bCCCb bCCCb ", + " N sbbbbbNNsNNbbbbbs N ", + " bCCCb bCCCb ", + " N N N N ", + " ", + " N N N N ", + " bCCCb bCCCb ", + " s sbbbbbNNsNNbbbbbs s ", + "NbbbN NbbNCCCb bCCCNbbN NbbbN", + " CbC CbC N N CbC CbC ", + " CbC CbC CbC CbC ", + " CbC CbC CbC CbC ", + "NbbbN NbbbN NbbbN NbbbN", + " NNN NNN NNN NNN ", + " NNN NNN NNN NNN ", + " s s s s ", + " NNN NNN NNN NNN ", + " NNN NNN NNN NNN ", + "NbbbN NbbbN NbbbN NbbbN", + " CbC CbC CbC CbC ", + " CbC CbC CbC CbC ", + " CbC CbC CbC CbC ", + "NbbbN NbbbNNNNNsNsNNNNNbbbN NbbbN", + }, + { + " NNN NNN N N NNN NNN ", + "NbbbN NbbNCCCb bCCCNbbN NbbbN", + "NbbbN NbbNCCCb bCCCNbbN NbbbN", + "NbbbNNNbbNCCCb bCCCNbbNNNbbbN", + " NNN NNN N N NNN NNN ", + " N N N N ", + " NNN NNN N N NNN NNN ", + "NbbbNNNbbNCCCb bCCCNbbNNNbbbN", + "NbbbN NbbNCCCb bCCCNbbN NbbbN", + "NNNN NNNCCCb bCCCNNN NNNN", + " CCC CCC N N CCC CCC ", + " CCC CCC CCC CCC ", + " CCC CCC CCC CCC ", + "NbbbN NbbbN NbbbN NbbbN", + " N N N N ", + " N N N N ", + " ", + " N N N N ", + " N N N N ", + "NbbbN NbbbN NbbbN NbbbN", + " CCC CCC CCC CCC ", + " CCC CCC CCC CCC ", + " CCC CCC CCC CCC ", + "NbbbN NbbbN NbN NbbbN NbbbN", + }, + { + " ", + " CCC CCC N N CCC CCC ", + " CbC CbC N N CbC CbC ", + " CCCCCCCCC N N CCCCCCCCC ", + " C C C C ", + " C C C C ", + " C C C C ", + " CCCCCCCCC N N CCCCCCCCC ", + " CbC CbC N N CbC CbC ", + " CCC CCC N N CCC CCC ", + " ", + " ", + " ", + " NNN NNN NNN NNN ", + " ", + " ", + " ", + " ", + " ", + " NNN NNN NNN NNN ", + " ", + " ", + " ", + " NNN NNN NbN NNN NNN ", + }, + { + " ", + " CCC CCC CCC CCC ", + " CbC CbC CbC CbC ", + " CCCCCCCCC CCCCCCCCC ", + " C C C C ", + " C C C C ", + " C C C C ", + " CCCCCCCCC CCCCCCCCC ", + " CbC CbC CbC CbC ", + " CCC CCC CCC CCC ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " N N NbN N N ", + }, + { + " ", + " CCC CCC CCC CCC ", + " CbC CbC CbC CbC ", + " CCCCCCCCC CCCCCCCCC ", + " C C C C ", + " C C C C ", + " C C C C ", + " CCCCCCCCC CCCCCCCCC ", + " CbC CbC CbC CbC ", + " CCC CCC CCC CCC ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " N N NbN N N ", + }, + { + " NNN NNN NNN NNN ", + "NbbbN NbbbN NbbbN NbbbN", + "NbbbN NbbbN NbbbN NbbbN", + "NbbbNNNbbbN NbbbNNNbbbN", + " NNN NNN NNN NNN ", + " N N N N ", + " NNN NNN NNN NNN ", + "NbbbNNNbbbN NbbbNNNbbbN", + "NbbbN NbbbN NbbbN NbbbN", + "NbbbN NbbbN NbbbN NbbbN", + " NNN NNN NNN NNN ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " N N NsNsN N N ", + }, + { + " ", + " ", + " N N N N ", + " ", + " ", + " ", + " ", + " ", + " N N N N ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " N N NbbbbbN N N ", + }, + { + " ", + " ", + " N N N N ", + " ", + " ", + " ", + " ", + " ", + " N N N N ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " N ", + " NsNNNNNsNNNNsbbbbbsNNNNsNNNNNsN ", + }, + { + " ", + " ", + " s s s s ", + " ", + " ", + " ", + " ", + " ", + " s s s s ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ~ ", + " NNN ", + " NbbbbbNbbbbNbbbbbNbbbbNbbbbbN ", + }, + { + " ", + " ", + " N N N N ", + " ", + " ", + " ", + " ", + " ", + " N N N N ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " N ", + " NsNNNNNsNNNNsbbbbbsNNNNsNNNNNsN ", + }, + { + " ", + " ", + " N N N N ", + " ", + " ", + " ", + " ", + " ", + " N N N N ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " N N NbbbbbN N N ", + }, + { + " NNN NNN NNN NNN ", + "NbbbN NbbbN NbbbN NbbbN", + "NbbbN NbbbN NbbbN NbbbN", + "NbbbNNNbbbN NbbbNNNbbbN", + " NNN NNN NNN NNN ", + " N N N N ", + " NNN NNN NNN NNN ", + "NbbbNNNbbbN NbbbNNNbbbN", + "NbbbN NbbbN NbbbN NbbbN", + "NbbbN NbbbN NbbbN NbbbN", + " NNN NNN NNN NNN ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " N N NsNsN N N ", + }, + { + " ", + " CCC CCC CCC CCC ", + " CbC CbC CbC CbC ", + " CCCCCCCCC CCCCCCCCC ", + " C C C C ", + " C C C C ", + " C C C C ", + " CCCCCCCCC CCCCCCCCC ", + " CbC CbC CbC CbC ", + " CCC CCC CCC CCC ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " N N NbN N N ", + }, + { + " ", + " CCC CCC CCC CCC ", + " CbC CbC CbC CbC ", + " CCCCCCCCC CCCCCCCCC ", + " C C C C ", + " C C C C ", + " C C C C ", + " CCCCCCCCC CCCCCCCCC ", + " CbC CbC CbC CbC ", + " CCC CCC CCC CCC ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " N N NbN N N ", + }, + { + " ", + " CCC CCC N N CCC CCC ", + " CbC CbC N N CbC CbC ", + " CCCCCCCCC N N CCCCCCCCC ", + " C C C C ", + " C C C C ", + " C C C C ", + " CCCCCCCCC N N CCCCCCCCC ", + " CbC CbC N N CbC CbC ", + " CCC CCC N N CCC CCC ", + " ", + " ", + " ", + " NNN NNN NNN NNN ", + " ", + " ", + " ", + " ", + " ", + " NNN NNN NNN NNN ", + " ", + " ", + " ", + " NNN NNN NbN NNN NNN ", + }, + { + " NNN NNN N N NNN NNN ", + "NbbbN NbbNCCCb bCCCNbbN NbbbN", + "NbbbN NbbNCCCb bCCCNbbN NbbbN", + "NbbbNNNbbNCCCb bCCCNbbNNNbbbN", + " NNN NNN N N NNN NNN ", + " N N N N ", + " NNN NNN N N NNN NNN ", + "NbbbNNNbbNCCCb bCCCNbbNNNbbbN", + "NbbbN NbbNCCCb bCCCNbbN NbbbN", + "NNNN NNNCCCb bCCCNNN NNNN", + " CCC CCC N N CCC CCC ", + " CCC CCC CCC CCC ", + " CCC CCC CCC CCC ", + "NbbbN NbbbN NbbbN NbbbN", + " N N N N ", + " N N N N ", + " ", + " N N N N ", + " N N N N ", + "NbbbN NbbbN NbbbN NbbbN", + " CCC CCC CCC CCC ", + " CCC CCC CCC CCC ", + " CCC CCC CCC CCC ", + "NbbbN NbbbN NbN NbbbN NbbbN", + }, + { + " N N N N ", + " bCCCb bCCCb ", + " N sbbbbbNNsNNbbbbbs N ", + " bCCCb bCCCb ", + " N N N N ", + " ", + " N N N N ", + " bCCCb bCCCb ", + " s sbbbbbNNsNNbbbbbs s ", + "NbbbN NbbNCCCb bCCCNbbN NbbbN", + " CbC CbC N N CbC CbC ", + " CbC CbC CbC CbC ", + " CbC CbC CbC CbC ", + "NbbbN NbbbN NbbbN NbbbN", + " NNN NNN NNN NNN ", + " NNN NNN NNN NNN ", + " s s s s ", + " NNN NNN NNN NNN ", + " NNN NNN NNN NNN ", + "NbbbN NbbbN NbbbN NbbbN", + " CbC CbC CbC CbC ", + " CbC CbC CbC CbC ", + " CbC CbC CbC CbC ", + "NbbbN NbbbNNNNNsNsNNNNNbbbN NbbbN", + }, + { + " N N N N ", + " bCCCb bCCCb ", + " N bCCCb bCCCb N ", + " bCCCb bCCCb ", + " NCCCN NCCCN ", + " NCCCN NCCCN ", + " NCCCN NCCCN ", + " bCCCb bCCCb ", + " bCCCb bCCCb ", + "NbbbNNNbbNCCCb bCCCNbbNNNbbbN", + " CCCCCCCCC N N CCCCCCCCC ", + " CCCCCCCCC CCCCCCCCC ", + " CCCCCCCCC CCCCCCCCC ", + "NbbbNNNbbbN NbbbNNNbbbN", + " N N N N ", + " N N N N ", + " ", + " N N N N ", + " N N N N ", + "NbbbNNNbbbN NbbbNNNbbbN", + " CCCCCCCCC CCCCCCCCC ", + " CCCCCCCCC CCCCCCCCC ", + " CCCCCCCCC CCCCCCCCC ", + "NbbbNNNbbbN NbN NbbbNNNbbbN", + }, + { + " ", + " N N N N ", + " N N N N N N ", + " NCCCN NCCCN ", + " ", + " ", + " ", + " NCCCN NCCCN ", + " N N N N ", + " NNN NN N N NN NNN ", + " C C C C ", + " C C C C ", + " C C C C ", + " NNN NNN NNN NNN ", + " ", + " ", + " ", + " ", + " ", + " NNN NNN NNN NNN ", + " C C C C ", + " C C C C ", + " C C C C ", + " NNN NNN NbN NNN NNN ", + }, + { + " ", + " ", + " s s ", + " s NCCCN NCCCN s ", + " ", + " ", + " ", + " NCCCN NCCCN ", + " ", + " N N N N ", + " C C C C ", + " C C C C ", + " C C C C ", + " N N N N ", + " ", + " ", + " ", + " ", + " ", + " N N N N ", + " C C C C ", + " C C C C ", + " C C C C ", + " N N NbN N N ", + }, + { + " ", + " N N N N ", + " s N N N N s ", + " s NCCCN NCCCN s ", + " ", + " ", + " ", + " NCCCN NCCCN ", + " N N N N ", + " NNN NN N N NN NNN ", + " C C C C ", + " C C C C ", + " C C C C ", + " NNN NNN NNN NNN ", + " ", + " ", + " ", + " ", + " ", + " NNN NNN NNN NNN ", + " C C C C ", + " C C C C ", + " C C C C ", + " NNN NNN NbN NNN NNN ", + }, + { + " N N N N ", + " bCCCb bCCCb ", + " ss bCCCb bCCCb ss ", + " bCCCb bCCCb ", + " s NCCCN NCCCN s ", + " s NCCCN NCCCN s ", + " NCCCN NCCCN ", + " bCCCb bCCCb ", + " bCCCb bCCCb ", + "NbbbNNNbbNCCCb bCCCNbbNNNbbbN", + " CCCCCCCCC N N CCCCCCCCC ", + " CCCCCCCCC CCCCCCCCC ", + " CCCCCCCCC CCCCCCCCC ", + "NbbbNNNbbbN NbbbNNNbbbN", + " N N N N ", + " N N N N ", + " ", + " N N N N ", + " N N N N ", + "NbbbNNNbbbN NbbbNNNbbbN", + " CCCCCCCCC CCCCCCCCC ", + " CCCCCCCCC CCCCCCCCC ", + " CCCCCCCCC CCCCCCCCC ", + "NbbbNNNbbbN NbN NbbbNNNbbbN", + }, + { + " N N N N ", + " bCCCb bCCCb ", + " NNNbbbbbNNsNNbbbbbNNN ", + " ss bCCCb bCCCb ss ", + " s N N N N s ", + " s s ", + " N N N N N N ", + " N bCCCb bCCCb N ", + " N sbbbbbNNsNNbbbbbs N ", + "NbbbN NbbNCCCb bCCCNbbN NbbbN", + " CbC CbC N N CbC CbC ", + " CbC CbC CbC CbC ", + " CbC CbC CbC CbC ", + "NbbbN NbbbN NbbbN NbbbN", + " NNN NNN NNN NNN ", + " NNN NNN NNN NNN ", + " s s s s ", + " NNN NNN NNN NNN ", + " NNN NNN NNN NNN ", + "NbbbN NbbbN NbbbN NbbbN", + " CbC CbC CbC CbC ", + " CbC CbC CbC CbC ", + " CbC CbC CbC CbC ", + "NbbbN NbbbNNNNNsNsNNNNNbbbN NbbbN", + }, + { + " N N N N ", + " bCCCb bCCCb ", + " bCCCb bCCCb ", + " bCCCb bCCCb ", + " N N N N ", + " ", + " N N N N ", + " bCCCb bCCCb ", + " bCCCb bCCCb ", + "NbbbN NbbNCCCb bCCCNbbN NbbbN", + " CCC CCC N N CCC CCC ", + " CCC CCC CCC CCC ", + " CCC CCC CCC CCC ", + "NbbbN NbbbN NbbbN NbbbN", + " N N N N ", + " N N N N ", + " ", + " N N N N ", + " N N N N ", + "NbbbN NbbbN NbbbN NbbbN", + " CCC CCC CCC CCC ", + " CCC CCC CCC CCC ", + " CCC CCC CCC CCC ", + "NbbbN NbbbN N N NbbbN NbbbN", + }, + { + " ", + " N N N N ", + " N N N N ", + " N N N N ", + " ", + " ", + " ", + " N N N N ", + " N N N N ", + " NNN NNN N N NNN NNN ", + " ", + " ", + " ", + " NNN NNN NNN NNN ", + " ", + " ", + " ", + " ", + " ", + " NNN NNN NNN NNN ", + " ", + " ", + " ", + " NNN NNN NNN NNN ", + } }; - protected static final int DIM_TRANS_CASING = 12; protected static final int DIM_INJECTION_CASING = 13; protected static final int DIM_BRIDGE_CASING = 14; @@ -122,17 +942,31 @@ public class GT_MetaTileEntity_PlasmaForge extends GT_MetaTileEntity_AbstractMul private boolean isMultiChunkloaded = true; protected static final String STRUCTURE_PIECE_MAIN = "main"; - private static final IStructureDefinition<GT_MetaTileEntity_PlasmaForge> STRUCTURE_DEFINITION = StructureDefinition.<GT_MetaTileEntity_PlasmaForge>builder() - .addShape(STRUCTURE_PIECE_MAIN, structure_string) - .addElement('C', ofCoil(GT_MetaTileEntity_PlasmaForge::setCoilLevel, GT_MetaTileEntity_PlasmaForge::getCoilLevel)) - .addElement('b', buildHatchAdder(GT_MetaTileEntity_PlasmaForge.class) - .atLeast(InputHatch, OutputHatch, InputBus, OutputBus, Energy, ExoticEnergy, Maintenance) - .casingIndex(DIM_INJECTION_CASING) - .dot(3) - .buildAndChain(GregTech_API.sBlockCasings1, DIM_INJECTION_CASING)) - .addElement('N', ofBlock(GregTech_API.sBlockCasings1, DIM_TRANS_CASING)) - .addElement('s', ofBlock(GregTech_API.sBlockCasings1, DIM_BRIDGE_CASING)) - .build(); + private static final IStructureDefinition<GT_MetaTileEntity_PlasmaForge> STRUCTURE_DEFINITION = + StructureDefinition.<GT_MetaTileEntity_PlasmaForge>builder() + .addShape(STRUCTURE_PIECE_MAIN, structure_string) + .addElement( + 'C', + ofCoil( + GT_MetaTileEntity_PlasmaForge::setCoilLevel, + GT_MetaTileEntity_PlasmaForge::getCoilLevel)) + .addElement( + 'b', + buildHatchAdder(GT_MetaTileEntity_PlasmaForge.class) + .atLeast( + InputHatch, + OutputHatch, + InputBus, + OutputBus, + Energy, + ExoticEnergy, + Maintenance) + .casingIndex(DIM_INJECTION_CASING) + .dot(3) + .buildAndChain(GregTech_API.sBlockCasings1, DIM_INJECTION_CASING)) + .addElement('N', ofBlock(GregTech_API.sBlockCasings1, DIM_TRANS_CASING)) + .addElement('s', ofBlock(GregTech_API.sBlockCasings1, DIM_BRIDGE_CASING)) + .build(); @Override protected boolean addBottomHatch(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { @@ -157,26 +991,42 @@ public class GT_MetaTileEntity_PlasmaForge extends GT_MetaTileEntity_AbstractMul protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addInfo("Transcending Dimensional Boundaries.") - .addInfo("Takes " + EnumChatFormatting.RED + GT_Utility.formatNumbers(max_efficiency_time_in_ticks/(3600*20)) + EnumChatFormatting.GRAY + " hours of continuous run time to fully breach dimensional") - .addInfo("boundaries and achieve maximum efficiency. This reduces fuel") - .addInfo("consumption by up to " + EnumChatFormatting.RED + GT_Utility.formatNumbers(100*maximum_discount) + "%" + EnumChatFormatting.GRAY + ". Supports overclocking beyond MAX voltage.") - .addInfo(AuthorColen) - .addSeparator() - .beginStructureBlock(33, 24, 33, false) - .addStructureInfo("DTPF Structure is too complex! See schematic for details.") - .addStructureInfo(EnumChatFormatting.GOLD + "2112" + EnumChatFormatting.GRAY + " Heating coils required.") - .addStructureInfo(EnumChatFormatting.GOLD + "120" + EnumChatFormatting.GRAY + " Dimensional bridge blocks required.") - .addStructureInfo(EnumChatFormatting.GOLD + "1270" + EnumChatFormatting.GRAY + " Dimensional injection casings required.") - .addStructureInfo(EnumChatFormatting.GOLD + "2121" + EnumChatFormatting.GRAY + " Dimensionally transcendent casings required.") - .addStructureInfo("--------------------------------------------") - .addStructureInfo("Requires " + EnumChatFormatting.GOLD + "1" + EnumChatFormatting.GRAY + "-" + EnumChatFormatting.GOLD + "2" + EnumChatFormatting.GRAY + " energy hatches or " + EnumChatFormatting.GOLD + "1" + EnumChatFormatting.GRAY + " TT energy hatch.") - .addStructureInfo("Requires " + EnumChatFormatting.GOLD + "1" + EnumChatFormatting.GRAY + " maintenance hatch.") - .addStructureInfo("Requires " + EnumChatFormatting.GOLD + min_input_hatch + EnumChatFormatting.GRAY + "-" + EnumChatFormatting.GOLD + max_input_hatch + EnumChatFormatting.GRAY + " input hatches.") - .addStructureInfo("Requires " + EnumChatFormatting.GOLD + min_output_hatch + EnumChatFormatting.GRAY + "-" + EnumChatFormatting.GOLD + max_output_hatch + EnumChatFormatting.GRAY + " output hatches.") - .addStructureInfo("Requires " + EnumChatFormatting.GOLD + min_input_bus + EnumChatFormatting.GRAY + "-" + EnumChatFormatting.GOLD + max_input_bus + EnumChatFormatting.GRAY + " input busses.") - .addStructureInfo("Requires " + EnumChatFormatting.GOLD + min_output_bus + EnumChatFormatting.GRAY + "-" + EnumChatFormatting.GOLD + max_input_bus + EnumChatFormatting.GRAY + " output busses.") - .addStructureInfo("--------------------------------------------") - .toolTipFinisher("Gregtech"); + .addInfo("Takes " + EnumChatFormatting.RED + + GT_Utility.formatNumbers(max_efficiency_time_in_ticks / (3600 * 20)) + EnumChatFormatting.GRAY + + " hours of continuous run time to fully breach dimensional") + .addInfo("boundaries and achieve maximum efficiency. This reduces fuel") + .addInfo("consumption by up to " + EnumChatFormatting.RED + + GT_Utility.formatNumbers(100 * maximum_discount) + "%" + EnumChatFormatting.GRAY + + ". Supports overclocking beyond MAX voltage.") + .addInfo(AuthorColen) + .addSeparator() + .beginStructureBlock(33, 24, 33, false) + .addStructureInfo("DTPF Structure is too complex! See schematic for details.") + .addStructureInfo( + EnumChatFormatting.GOLD + "2112" + EnumChatFormatting.GRAY + " Heating coils required.") + .addStructureInfo(EnumChatFormatting.GOLD + "120" + EnumChatFormatting.GRAY + + " Dimensional bridge blocks required.") + .addStructureInfo(EnumChatFormatting.GOLD + "1270" + EnumChatFormatting.GRAY + + " Dimensional injection casings required.") + .addStructureInfo(EnumChatFormatting.GOLD + "2121" + EnumChatFormatting.GRAY + + " Dimensionally transcendent casings required.") + .addStructureInfo("--------------------------------------------") + .addStructureInfo("Requires " + EnumChatFormatting.GOLD + "1" + EnumChatFormatting.GRAY + "-" + + EnumChatFormatting.GOLD + "2" + EnumChatFormatting.GRAY + " energy hatches or " + + EnumChatFormatting.GOLD + "1" + EnumChatFormatting.GRAY + " TT energy hatch.") + .addStructureInfo( + "Requires " + EnumChatFormatting.GOLD + "1" + EnumChatFormatting.GRAY + " maintenance hatch.") + .addStructureInfo("Requires " + EnumChatFormatting.GOLD + min_input_hatch + EnumChatFormatting.GRAY + + "-" + EnumChatFormatting.GOLD + max_input_hatch + EnumChatFormatting.GRAY + " input hatches.") + .addStructureInfo("Requires " + EnumChatFormatting.GOLD + min_output_hatch + EnumChatFormatting.GRAY + + "-" + EnumChatFormatting.GOLD + max_output_hatch + EnumChatFormatting.GRAY + + " output hatches.") + .addStructureInfo("Requires " + EnumChatFormatting.GOLD + min_input_bus + EnumChatFormatting.GRAY + "-" + + EnumChatFormatting.GOLD + max_input_bus + EnumChatFormatting.GRAY + " input busses.") + .addStructureInfo("Requires " + EnumChatFormatting.GOLD + min_output_bus + EnumChatFormatting.GRAY + "-" + + EnumChatFormatting.GOLD + max_input_bus + EnumChatFormatting.GRAY + " output busses.") + .addStructureInfo("--------------------------------------------") + .toolTipFinisher("Gregtech"); return tt; } @@ -187,27 +1037,43 @@ public class GT_MetaTileEntity_PlasmaForge extends GT_MetaTileEntity_AbstractMul } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { if (aSide == aFacing) { if (aActive) - return new ITexture[]{ + return new ITexture[] { casingTexturePages[0][DIM_BRIDGE_CASING], - TextureFactory.builder().addIcon(OVERLAY_DTPF_ON).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FUSION1_GLOW).extFacing().glow().build()}; - return new ITexture[]{ + TextureFactory.builder() + .addIcon(OVERLAY_DTPF_ON) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FUSION1_GLOW) + .extFacing() + .glow() + .build() + }; + return new ITexture[] { casingTexturePages[0][DIM_BRIDGE_CASING], - TextureFactory.builder().addIcon(OVERLAY_DTPF_OFF).extFacing().build()}; + TextureFactory.builder().addIcon(OVERLAY_DTPF_OFF).extFacing().build() + }; } - return new ITexture[]{casingTexturePages[0][DIM_BRIDGE_CASING]}; + return new ITexture[] {casingTexturePages[0][DIM_BRIDGE_CASING]}; } @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "PlasmaForge.png"); + return new GT_GUIContainer_MultiMachine( + aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "PlasmaForge.png"); } @Override - public int getPollutionPerSecond(ItemStack aStack){ + public int getPollutionPerSecond(ItemStack aStack) { return 0; } @@ -253,20 +1119,13 @@ public class GT_MetaTileEntity_PlasmaForge extends GT_MetaTileEntity_AbstractMul // Look up recipe. If not found it will return null. GT_Recipe tRecipe_0 = GT_Recipe.GT_Recipe_Map.sPlasmaForgeRecipes.findRecipe( - getBaseMetaTileEntity(), - false, - tTotalEU, - tFluids, - tItems - ); + getBaseMetaTileEntity(), false, tTotalEU, tFluids, tItems); // Check if recipe found. - if (tRecipe_0 == null) - return false; + if (tRecipe_0 == null) return false; // If coil heat capacity is too low, refuse to start recipe. - if (mHeatingCapacity <= tRecipe_0.mSpecialValue) - return false; + if (mHeatingCapacity <= tRecipe_0.mSpecialValue) return false; // Reduce fuel quantity if machine has been running for long enough. GT_Recipe tRecipe_1 = tRecipe_0.copy(); @@ -287,11 +1146,8 @@ public class GT_MetaTileEntity_PlasmaForge extends GT_MetaTileEntity_AbstractMul } } - // Takes items/fluids from hatches/busses. - if (!tRecipe_1.isRecipeInputEqual(true, tFluids, tItems)) - return false; - + if (!tRecipe_1.isRecipeInputEqual(true, tFluids, tItems)) return false; // Logic for overclocking calculations. double EU_input_tier = log(tTotalEU) / log4; @@ -324,27 +1180,21 @@ public class GT_MetaTileEntity_PlasmaForge extends GT_MetaTileEntity_AbstractMul setCoilLevel(HeatingCoilLevel.None); // Check the main structure - if (!checkPiece(STRUCTURE_PIECE_MAIN, 16, 21, 16)) - return false; + if (!checkPiece(STRUCTURE_PIECE_MAIN, 16, 21, 16)) return false; - if (getCoilLevel() == HeatingCoilLevel.None) - return false; + if (getCoilLevel() == HeatingCoilLevel.None) return false; // Item input bus check. - if ((mInputBusses.size() < min_input_bus) || (mInputBusses.size() > max_input_bus)) - return false; + if ((mInputBusses.size() < min_input_bus) || (mInputBusses.size() > max_input_bus)) return false; // Item output bus check. - if ((mOutputBusses.size() < min_output_bus) || (mOutputBusses.size() > max_output_bus)) - return false; + if ((mOutputBusses.size() < min_output_bus) || (mOutputBusses.size() > max_output_bus)) return false; // Fluid input hatch check. - if ((mInputHatches.size() < min_input_hatch) || (mInputHatches.size() > max_input_hatch)) - return false; + if ((mInputHatches.size() < min_input_hatch) || (mInputHatches.size() > max_input_hatch)) return false; // Fluid output hatch check. - if ((mOutputHatches.size() < min_output_hatch) || (mOutputHatches.size() > max_output_hatch)) - return false; + if ((mOutputHatches.size() < min_output_hatch) || (mOutputHatches.size() > max_output_hatch)) return false; // If there is more than 1 TT energy hatch, the structure check will fail. // If there is a TT hatch and a normal hatch, the structure check will fail. @@ -359,18 +1209,18 @@ public class GT_MetaTileEntity_PlasmaForge extends GT_MetaTileEntity_AbstractMul // Check will also fail if energy hatches are not of the same tier. byte tier_of_hatch = mEnergyHatches.get(0).mTier; - for(GT_MetaTileEntity_Hatch_Energy energyHatch : mEnergyHatches) { - if (energyHatch.mTier != tier_of_hatch) { return false; } + for (GT_MetaTileEntity_Hatch_Energy energyHatch : mEnergyHatches) { + if (energyHatch.mTier != tier_of_hatch) { + return false; + } } } // If there are no energy hatches or TT energy hatches, structure will fail to form. - if ((mEnergyHatches.size() == 0) && (mExoticEnergyHatches.size() == 0)) - return false; + if ((mEnergyHatches.size() == 0) && (mExoticEnergyHatches.size() == 0)) return false; // One maintenance hatch only. Mandatory. - if (mMaintenanceHatches.size() != 1) - return false; + if (mMaintenanceHatches.size() != 1) return false; // Heat capacity of coils used on multi. No free heat from extra EU! mHeatingCapacity = (int) getCoilLevel().getHeat(); @@ -386,12 +1236,10 @@ public class GT_MetaTileEntity_PlasmaForge extends GT_MetaTileEntity_AbstractMul @Override public boolean addOutput(FluidStack aLiquid) { - if (aLiquid == null) - return false; + if (aLiquid == null) return false; FluidStack tLiquid = aLiquid.copy(); - return dumpFluid(mOutputHatches, tLiquid, true) || - dumpFluid(mOutputHatches, tLiquid, false); + return dumpFluid(mOutputHatches, tLiquid, true) || dumpFluid(mOutputHatches, tLiquid, false); } @Override @@ -416,33 +1264,45 @@ public class GT_MetaTileEntity_PlasmaForge extends GT_MetaTileEntity_AbstractMul @Override public String[] getInfoData() { - long storedEnergy=0; - long maxEnergy=0; + long storedEnergy = 0; + long maxEnergy = 0; - for(GT_MetaTileEntity_Hatch tHatch : mExoticEnergyHatches) { + for (GT_MetaTileEntity_Hatch tHatch : mExoticEnergyHatches) { if (isValidMetaTileEntity(tHatch)) { - storedEnergy+=tHatch.getBaseMetaTileEntity().getStoredEU(); - maxEnergy+=tHatch.getBaseMetaTileEntity().getEUCapacity(); + storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU(); + maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity(); } } - return new String[]{ + return new String[] { "------------ Critical Information ------------", - StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + - EnumChatFormatting.GREEN + GT_Utility.formatNumbers(mProgresstime) + EnumChatFormatting.RESET + "t / " + - EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(mMaxProgresstime) + EnumChatFormatting.RESET + "t", - StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + - EnumChatFormatting.GREEN + GT_Utility.formatNumbers(storedEnergy) + EnumChatFormatting.RESET + " EU / " + - EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(maxEnergy) + EnumChatFormatting.RESET + " EU", - StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + - EnumChatFormatting.RED + GT_Utility.formatNumbers(-EU_per_tick) + EnumChatFormatting.RESET + " EU/t", - StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + - EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(GT_ExoticEnergyInputHelper.getMaxInputVoltageMulti(getExoticAndNormalEnergyHatchList())) + EnumChatFormatting.RESET + " EU/t(*" + EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(GT_ExoticEnergyInputHelper.getMaxInputAmpsMulti(getExoticAndNormalEnergyHatchList())) + EnumChatFormatting.RESET + "A) " + - StatCollector.translateToLocal("GT5U.machines.tier") + ": " + - EnumChatFormatting.YELLOW + VN[GT_Utility.getTier(GT_ExoticEnergyInputHelper.getMaxInputVoltageMulti(getExoticAndNormalEnergyHatchList()))] + EnumChatFormatting.RESET, - StatCollector.translateToLocal("GT5U.EBF.heat") + ": " + - EnumChatFormatting.GREEN + GT_Utility.formatNumbers(mHeatingCapacity) + EnumChatFormatting.RESET + " K", - "Ticks run: " + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(running_time) + EnumChatFormatting.RESET + ", Fuel Discount: " + EnumChatFormatting.RED + GT_Utility.formatNumbers(100 * (1-discount)) + EnumChatFormatting.RESET + "%", + StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(mProgresstime) + EnumChatFormatting.RESET + "t / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(mMaxProgresstime) + EnumChatFormatting.RESET + "t", + StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(storedEnergy) + EnumChatFormatting.RESET + " EU / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(maxEnergy) + EnumChatFormatting.RESET + " EU", + StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + EnumChatFormatting.RED + + GT_Utility.formatNumbers(-EU_per_tick) + EnumChatFormatting.RESET + " EU/t", + StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers( + GT_ExoticEnergyInputHelper.getMaxInputVoltageMulti(getExoticAndNormalEnergyHatchList())) + + EnumChatFormatting.RESET + " EU/t(*" + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers( + GT_ExoticEnergyInputHelper.getMaxInputAmpsMulti(getExoticAndNormalEnergyHatchList())) + + EnumChatFormatting.RESET + "A) " + StatCollector.translateToLocal("GT5U.machines.tier") + + ": " + EnumChatFormatting.YELLOW + + VN[ + GT_Utility.getTier(GT_ExoticEnergyInputHelper.getMaxInputVoltageMulti( + getExoticAndNormalEnergyHatchList()))] + + EnumChatFormatting.RESET, + StatCollector.translateToLocal("GT5U.EBF.heat") + ": " + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(mHeatingCapacity) + EnumChatFormatting.RESET + " K", + "Ticks run: " + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(running_time) + EnumChatFormatting.RESET + + ", Fuel Discount: " + EnumChatFormatting.RED + GT_Utility.formatNumbers(100 * (1 - discount)) + + EnumChatFormatting.RESET + "%", "-----------------------------------------" }; } @@ -474,15 +1334,33 @@ public class GT_MetaTileEntity_PlasmaForge extends GT_MetaTileEntity_AbstractMul int ControllerXCoordinate = ((TileEntity) aBaseMetaTileEntity).xCoord; int ControllerZCoordinate = ((TileEntity) aBaseMetaTileEntity).zCoord; - GT_ChunkManager.requestChunkLoad((TileEntity) aBaseMetaTileEntity, new ChunkCoordIntPair(ControllerXCoordinate, ControllerZCoordinate)); - GT_ChunkManager.requestChunkLoad((TileEntity) aBaseMetaTileEntity, new ChunkCoordIntPair(ControllerXCoordinate + 16, ControllerZCoordinate)); - GT_ChunkManager.requestChunkLoad((TileEntity) aBaseMetaTileEntity, new ChunkCoordIntPair(ControllerXCoordinate - 16, ControllerZCoordinate)); - GT_ChunkManager.requestChunkLoad((TileEntity) aBaseMetaTileEntity, new ChunkCoordIntPair(ControllerXCoordinate, ControllerZCoordinate + 16)); - GT_ChunkManager.requestChunkLoad((TileEntity) aBaseMetaTileEntity, new ChunkCoordIntPair(ControllerXCoordinate, ControllerZCoordinate - 16)); - GT_ChunkManager.requestChunkLoad((TileEntity) aBaseMetaTileEntity, new ChunkCoordIntPair(ControllerXCoordinate + 16, ControllerZCoordinate + 16)); - GT_ChunkManager.requestChunkLoad((TileEntity) aBaseMetaTileEntity, new ChunkCoordIntPair(ControllerXCoordinate + 16, ControllerZCoordinate - 16)); - GT_ChunkManager.requestChunkLoad((TileEntity) aBaseMetaTileEntity, new ChunkCoordIntPair(ControllerXCoordinate - 16, ControllerZCoordinate + 16)); - GT_ChunkManager.requestChunkLoad((TileEntity) aBaseMetaTileEntity, new ChunkCoordIntPair(ControllerXCoordinate - 16, ControllerZCoordinate - 16)); + GT_ChunkManager.requestChunkLoad( + (TileEntity) aBaseMetaTileEntity, + new ChunkCoordIntPair(ControllerXCoordinate, ControllerZCoordinate)); + GT_ChunkManager.requestChunkLoad( + (TileEntity) aBaseMetaTileEntity, + new ChunkCoordIntPair(ControllerXCoordinate + 16, ControllerZCoordinate)); + GT_ChunkManager.requestChunkLoad( + (TileEntity) aBaseMetaTileEntity, + new ChunkCoordIntPair(ControllerXCoordinate - 16, ControllerZCoordinate)); + GT_ChunkManager.requestChunkLoad( + (TileEntity) aBaseMetaTileEntity, + new ChunkCoordIntPair(ControllerXCoordinate, ControllerZCoordinate + 16)); + GT_ChunkManager.requestChunkLoad( + (TileEntity) aBaseMetaTileEntity, + new ChunkCoordIntPair(ControllerXCoordinate, ControllerZCoordinate - 16)); + GT_ChunkManager.requestChunkLoad( + (TileEntity) aBaseMetaTileEntity, + new ChunkCoordIntPair(ControllerXCoordinate + 16, ControllerZCoordinate + 16)); + GT_ChunkManager.requestChunkLoad( + (TileEntity) aBaseMetaTileEntity, + new ChunkCoordIntPair(ControllerXCoordinate + 16, ControllerZCoordinate - 16)); + GT_ChunkManager.requestChunkLoad( + (TileEntity) aBaseMetaTileEntity, + new ChunkCoordIntPair(ControllerXCoordinate - 16, ControllerZCoordinate + 16)); + GT_ChunkManager.requestChunkLoad( + (TileEntity) aBaseMetaTileEntity, + new ChunkCoordIntPair(ControllerXCoordinate - 16, ControllerZCoordinate - 16)); isMultiChunkloaded = true; } @@ -492,7 +1370,7 @@ public class GT_MetaTileEntity_PlasmaForge extends GT_MetaTileEntity_AbstractMul @Override public void construct(ItemStack stackSize, boolean hintsOnly) { - buildPiece(STRUCTURE_PIECE_MAIN, stackSize, hintsOnly, 16,21,16); + buildPiece(STRUCTURE_PIECE_MAIN, stackSize, hintsOnly, 16, 21, 16); } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PrimitiveBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PrimitiveBlastFurnace.java index 955bc3620b..e53bf880ba 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PrimitiveBlastFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PrimitiveBlastFurnace.java @@ -1,5 +1,7 @@ package gregtech.common.tileentities.machines.multi; +import static gregtech.api.objects.XSTR.XSTR_INSTANCE; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.GT_Mod; @@ -23,8 +25,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.common.util.ForgeDirection; -import static gregtech.api.objects.XSTR.XSTR_INSTANCE; - public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace extends MetaTileEntity { public static final int INPUT_SLOTS = 3, OUTPUT_SLOTS = 3; @@ -38,11 +38,11 @@ public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace extends MetaTileEn @Deprecated public ItemStack mOutputItem1; + @Deprecated public ItemStack mOutputItem2; - public GT_MetaTileEntity_PrimitiveBlastFurnace(int aID, String aName, - String aNameRegional) { + public GT_MetaTileEntity_PrimitiveBlastFurnace(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, INPUT_SLOTS + OUTPUT_SLOTS); } @@ -118,7 +118,8 @@ public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace extends MetaTileEn @Override public boolean allowCoverOnSide(byte aSide, GT_ItemStack aCoverID) { - return (GregTech_API.getCoverBehaviorNew(aCoverID.toStack()).isSimpleCover()) && (super.allowCoverOnSide(aSide, aCoverID)); + return (GregTech_API.getCoverBehaviorNew(aCoverID.toStack()).isSimpleCover()) + && (super.allowCoverOnSide(aSide, aCoverID)); } @Override @@ -151,8 +152,7 @@ public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace extends MetaTileEn } @Override - public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, - EntityPlayer aPlayer) { + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { if (aBaseMetaTileEntity.isClientSide()) { return true; } @@ -161,35 +161,39 @@ public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace extends MetaTileEn } @Override - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, - IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_Container_PrimitiveBlastFurnace(aPlayerInventory, - aBaseMetaTileEntity); + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_Container_PrimitiveBlastFurnace(aPlayerInventory, aBaseMetaTileEntity); } @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, - IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_PrimitiveBlastFurnace(aPlayerInventory, - aBaseMetaTileEntity, getName(), - GT_Recipe.GT_Recipe_Map.sPrimitiveBlastRecipes.mNEIName); + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_PrimitiveBlastFurnace( + aPlayerInventory, + aBaseMetaTileEntity, + getName(), + GT_Recipe.GT_Recipe_Map.sPrimitiveBlastRecipes.mNEIName); } private boolean checkMachine() { - int xDir = - ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetX; - int zDir = - ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetZ; + int xDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetX; + int zDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetZ; for (int i = -1; i < 2; i++) { for (int j = -1; j < 3; j++) { for (int k = -1; k < 2; k++) { if ((xDir + i != 0) || (j != 0) || (zDir + k != 0)) { if ((i != 0) || (j == -1) || (k != 0)) { - if (!isCorrectCasingBlock(getBaseMetaTileEntity().getBlockOffset(xDir + i, j, zDir + k)) || !isCorrectCasingMetaID(getBaseMetaTileEntity().getMetaIDOffset(xDir + i, j, zDir + k))) { + if (!isCorrectCasingBlock(getBaseMetaTileEntity().getBlockOffset(xDir + i, j, zDir + k)) + || !isCorrectCasingMetaID( + getBaseMetaTileEntity().getMetaIDOffset(xDir + i, j, zDir + k))) { mChimneyBlocked = false; return false; } - } else if ((!GT_Utility.arrayContains(getBaseMetaTileEntity().getBlockOffset(xDir + i, j, zDir + k), Blocks.lava, Blocks.flowing_lava, null)) && (!getBaseMetaTileEntity().getAirOffset(xDir + i, j, zDir + k))) { + } else if ((!GT_Utility.arrayContains( + getBaseMetaTileEntity().getBlockOffset(xDir + i, j, zDir + k), + Blocks.lava, + Blocks.flowing_lava, + null)) + && (!getBaseMetaTileEntity().getAirOffset(xDir + i, j, zDir + k))) { mChimneyBlocked = true; return false; } @@ -211,16 +215,20 @@ public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace extends MetaTileEn } @Override - public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, - long aTimer) { - final int lavaX = - aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1); - final int lavaZ = - aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1); + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) { + final int lavaX = aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1); + final int lavaZ = aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1); if ((aBaseMetaTileEntity.isClientSide()) && (aBaseMetaTileEntity.isActive())) { - new WorldSpawnedEventBuilder.ParticleEventBuilder().setMotion(0D, - 0.3D, 0D).setIdentifier(ParticleFX.LARGE_SMOKE).setPosition(lavaX + XSTR_INSTANCE.nextFloat(), aBaseMetaTileEntity.getOffsetY(aBaseMetaTileEntity.getBackFacing(), 1), lavaZ + XSTR_INSTANCE.nextFloat()).setWorld(getBaseMetaTileEntity().getWorld()).run(); + new WorldSpawnedEventBuilder.ParticleEventBuilder() + .setMotion(0D, 0.3D, 0D) + .setIdentifier(ParticleFX.LARGE_SMOKE) + .setPosition( + lavaX + XSTR_INSTANCE.nextFloat(), + aBaseMetaTileEntity.getOffsetY(aBaseMetaTileEntity.getBackFacing(), 1), + lavaZ + XSTR_INSTANCE.nextFloat()) + .setWorld(getBaseMetaTileEntity().getWorld()) + .run(); } if (aBaseMetaTileEntity.isServerSide()) { if (this.mUpdate-- == 0) { @@ -233,46 +241,47 @@ public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace extends MetaTileEn this.mOutputItems = null; this.mProgresstime = 0; this.mMaxProgresstime = 0; - GT_Mod.achievements.issueAchievement(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), "steel"); + GT_Mod.achievements.issueAchievement( + aBaseMetaTileEntity + .getWorld() + .getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), + "steel"); } } else if (aBaseMetaTileEntity.isAllowedToWork()) { checkRecipe(); } } if (this.mMaxProgresstime > 0 && (aTimer % 20L == 0L)) { - GT_Pollution.addPollution(this.getBaseMetaTileEntity(), - GT_Mod.gregtechproxy.mPollutionPrimitveBlastFurnacePerSecond); + GT_Pollution.addPollution( + this.getBaseMetaTileEntity(), GT_Mod.gregtechproxy.mPollutionPrimitveBlastFurnacePerSecond); } aBaseMetaTileEntity.setActive((this.mMaxProgresstime > 0) && (this.mMachine)); final short lavaY = aBaseMetaTileEntity.getYCoord(); if (aBaseMetaTileEntity.isActive()) { if (aBaseMetaTileEntity.getAir(lavaX, lavaY, lavaZ)) { - aBaseMetaTileEntity.getWorld().setBlock(lavaX, lavaY, - lavaZ, Blocks.lava, 1, 2); + aBaseMetaTileEntity.getWorld().setBlock(lavaX, lavaY, lavaZ, Blocks.lava, 1, 2); this.mUpdate = 1; } if (aBaseMetaTileEntity.getAir(lavaX, lavaY + 1, lavaZ)) { - aBaseMetaTileEntity.getWorld().setBlock(lavaX, lavaY + 1, - lavaZ, Blocks.lava, 1, 2); + aBaseMetaTileEntity.getWorld().setBlock(lavaX, lavaY + 1, lavaZ, Blocks.lava, 1, 2); this.mUpdate = 1; } } else { - Block lowerLava = aBaseMetaTileEntity.getBlock(lavaX, lavaY, - lavaZ); - Block upperLava = aBaseMetaTileEntity.getBlock(lavaX, - lavaY + 1, lavaZ); - if (mChimneyBlocked && lowerLava == Blocks.air && upperLava == Blocks.air && aBaseMetaTileEntity.getAir(lavaX, lavaY + 2, lavaZ)) { + Block lowerLava = aBaseMetaTileEntity.getBlock(lavaX, lavaY, lavaZ); + Block upperLava = aBaseMetaTileEntity.getBlock(lavaX, lavaY + 1, lavaZ); + if (mChimneyBlocked + && lowerLava == Blocks.air + && upperLava == Blocks.air + && aBaseMetaTileEntity.getAir(lavaX, lavaY + 2, lavaZ)) { this.mUpdate = 0; } if (lowerLava == Blocks.lava) { - aBaseMetaTileEntity.getWorld().setBlock(lavaX, lavaY, - lavaZ, Blocks.air, 0, 2); + aBaseMetaTileEntity.getWorld().setBlock(lavaX, lavaY, lavaZ, Blocks.air, 0, 2); this.mUpdate = 1; } if (upperLava == Blocks.lava) { - aBaseMetaTileEntity.getWorld().setBlock(lavaX, lavaY + 1, - lavaZ, Blocks.air, 0, 2); + aBaseMetaTileEntity.getWorld().setBlock(lavaX, lavaY + 1, lavaZ, Blocks.air, 0, 2); this.mUpdate = 1; } } @@ -293,14 +302,11 @@ public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace extends MetaTileEn final byte frontFacing = aBaseMetaTileEntity.getFrontFacing(); - final double oX = - aBaseMetaTileEntity.getOffsetX(frontFacing, 1) + 0.5D; + final double oX = aBaseMetaTileEntity.getOffsetX(frontFacing, 1) + 0.5D; final double oY = aBaseMetaTileEntity.getOffsetY(frontFacing, 1); - final double oZ = - aBaseMetaTileEntity.getOffsetZ(frontFacing, 1) + 0.5D; + final double oZ = aBaseMetaTileEntity.getOffsetZ(frontFacing, 1) + 0.5D; final double offset = -0.48D; - final double horizontal = - XSTR_INSTANCE.nextFloat() * 8D / 16D - 4D / 16D; + final double horizontal = XSTR_INSTANCE.nextFloat() * 8D / 16D - 4D / 16D; final double x, y, z; @@ -321,8 +327,10 @@ public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace extends MetaTileEn z = oZ + offset; } - ParticleEventBuilder particleEventBuilder = - (new ParticleEventBuilder()).setMotion(0D, 0D, 0D).setPosition(x, y, z).setWorld(getBaseMetaTileEntity().getWorld()); + ParticleEventBuilder particleEventBuilder = (new ParticleEventBuilder()) + .setMotion(0D, 0D, 0D) + .setPosition(x, y, z) + .setWorld(getBaseMetaTileEntity().getWorld()); particleEventBuilder.setIdentifier(ParticleFX.SMOKE).run(); particleEventBuilder.setIdentifier(ParticleFX.FLAME).run(); } @@ -341,24 +349,23 @@ public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace extends MetaTileEn for (int i = 0; i < limit; i++) { int absi = INPUT_SLOTS + i; if (this.mInventory[absi] == null) { - this.mInventory[absi] = - GT_Utility.copyOrNull(this.mOutputItems[i]); - } else if (GT_Utility.areStacksEqual(this.mInventory[absi], - this.mOutputItems[i])) { - this.mInventory[absi].stackSize = - Math.min(this.mInventory[absi].getMaxStackSize(), + this.mInventory[absi] = GT_Utility.copyOrNull(this.mOutputItems[i]); + } else if (GT_Utility.areStacksEqual(this.mInventory[absi], this.mOutputItems[i])) { + this.mInventory[absi].stackSize = Math.min( + this.mInventory[absi].getMaxStackSize(), this.mInventory[absi].stackSize + this.mOutputItems[i].stackSize); } } } - private boolean spaceForOutput(ItemStack outputStack, - int relativeOutputSlot) { + private boolean spaceForOutput(ItemStack outputStack, int relativeOutputSlot) { int absoluteSlot = relativeOutputSlot + INPUT_SLOTS; if (this.mInventory[absoluteSlot] == null || outputStack == null) { return true; } - return ((this.mInventory[absoluteSlot].stackSize + outputStack.stackSize <= this.mInventory[absoluteSlot].getMaxStackSize()) && (GT_Utility.areStacksEqual(this.mInventory[absoluteSlot], outputStack))); + return ((this.mInventory[absoluteSlot].stackSize + outputStack.stackSize + <= this.mInventory[absoluteSlot].getMaxStackSize()) + && (GT_Utility.areStacksEqual(this.mInventory[absoluteSlot], outputStack))); } private boolean checkRecipe() { @@ -367,8 +374,8 @@ public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace extends MetaTileEn } ItemStack[] inputs = new ItemStack[INPUT_SLOTS]; System.arraycopy(mInventory, 0, inputs, 0, INPUT_SLOTS); - GT_Recipe recipe = - GT_Recipe.GT_Recipe_Map.sPrimitiveBlastRecipes.findRecipe(getBaseMetaTileEntity(), false, 0, null, inputs); + GT_Recipe recipe = GT_Recipe.GT_Recipe_Map.sPrimitiveBlastRecipes.findRecipe( + getBaseMetaTileEntity(), false, 0, null, inputs); if (recipe == null) { this.mOutputItems = null; return false; @@ -401,14 +408,12 @@ public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace extends MetaTileEn } @Override - public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, - int aIndex, byte aSide, ItemStack aStack) { + public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { return aIndex > INPUT_SLOTS; } @Override - public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, - int aIndex, byte aSide, ItemStack aStack) { + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { return !GT_Utility.areStacksEqual(aStack, this.mInventory[0]); } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java index 4cd73dab3c..bf91c80532 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java @@ -1,5 +1,16 @@ package gregtech.common.tileentities.machines.multi; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static gregtech.api.enums.GT_HatchElement.*; +import static gregtech.api.enums.GT_HatchElement.Energy; +import static gregtech.api.enums.GT_HatchElement.Maintenance; +import static gregtech.api.enums.GT_Values.VN; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_PROCESSING_ARRAY; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_PROCESSING_ARRAY_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_PROCESSING_ARRAY_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_PROCESSING_ARRAY_GLOW; +import static gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine.isValidForLowGravity; + import com.google.common.collect.ImmutableList; import com.gtnewhorizon.structurelib.structure.IStructureElement; import gregtech.GT_Mod; @@ -20,8 +31,13 @@ import gregtech.api.util.GT_ProcessingArray_Manager; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Single_Recipe_Check_Processing_Array; -import gregtech.common.blocks.GT_Item_Machines; import gregtech.api.util.GT_Utility; +import gregtech.common.blocks.GT_Item_Machines; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Objects; +import java.util.stream.Stream; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; @@ -30,24 +46,8 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; import net.minecraftforge.fluids.FluidStack; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Objects; -import java.util.stream.Stream; - -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; -import static gregtech.api.enums.GT_HatchElement.*; -import static gregtech.api.enums.GT_HatchElement.Energy; -import static gregtech.api.enums.GT_HatchElement.Maintenance; -import static gregtech.api.enums.GT_Values.VN; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_PROCESSING_ARRAY; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_PROCESSING_ARRAY_ACTIVE; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_PROCESSING_ARRAY_ACTIVE_GLOW; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_PROCESSING_ARRAY_GLOW; -import static gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine.isValidForLowGravity; - -public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_CubicMultiBlockBase<GT_MetaTileEntity_ProcessingArray> { +public class GT_MetaTileEntity_ProcessingArray + extends GT_MetaTileEntity_CubicMultiBlockBase<GT_MetaTileEntity_ProcessingArray> { private GT_Recipe_Map mLastRecipeMap; private GT_Recipe mLastRecipe; @@ -97,30 +97,55 @@ public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_CubicMu @Override public boolean addToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - return super.addToMachineList(aTileEntity, aBaseCasingIndex) || addExoticEnergyInputToMachineList(aTileEntity, aBaseCasingIndex); + return super.addToMachineList(aTileEntity, aBaseCasingIndex) + || addExoticEnergyInputToMachineList(aTileEntity, aBaseCasingIndex); } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { if (aSide == aFacing) { - if (aActive) return new ITexture[]{ - BlockIcons.casingTexturePages[0][48], - TextureFactory.builder().addIcon(OVERLAY_FRONT_PROCESSING_ARRAY_ACTIVE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_PROCESSING_ARRAY_ACTIVE_GLOW).extFacing().glow().build()}; - return new ITexture[]{ + if (aActive) + return new ITexture[] { BlockIcons.casingTexturePages[0][48], - TextureFactory.builder().addIcon(OVERLAY_FRONT_PROCESSING_ARRAY).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_PROCESSING_ARRAY_GLOW).extFacing().glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_PROCESSING_ARRAY_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_PROCESSING_ARRAY_ACTIVE_GLOW) + .extFacing() + .glow() + .build() + }; + return new ITexture[] { + BlockIcons.casingTexturePages[0][48], + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_PROCESSING_ARRAY) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_PROCESSING_ARRAY_GLOW) + .extFacing() + .glow() + .build() + }; } - return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][48]}; + return new ITexture[] {Textures.BlockIcons.casingTexturePages[0][48]}; } @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "ProcessingArray.png"); + return new GT_GUIContainer_MultiMachine( + aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "ProcessingArray.png"); } - //TODO: Expand so it also does the non recipe map recipes + // TODO: Expand so it also does the non recipe map recipes /* public void remoteRecipeCheck() { if (mInventory[1] == null) return; @@ -143,12 +168,12 @@ public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_CubicMu } */ - //Gets the recipe map for the given machine through its unlocalized name + // Gets the recipe map for the given machine through its unlocalized name @Override public GT_Recipe_Map getRecipeMap() { if (isCorrectMachinePart(mInventory[1])) { int length = mInventory[1].getUnlocalizedName().length(); - String aMachineName = mInventory[1].getUnlocalizedName().substring(17,length-8); + String aMachineName = mInventory[1].getUnlocalizedName().substring(17, length - 8); return GT_ProcessingArray_Manager.giveRecipeMap(aMachineName); } return null; @@ -183,26 +208,25 @@ public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_CubicMu if (mLastRecipe == null) { IMetaTileEntity aMachine = GT_Item_Machines.getMetaTileEntity(mInventory[1]); - if (aMachine!=null) - tTier = ((GT_MetaTileEntity_TieredMachineBlock) aMachine).mTier; + if (aMachine != null) tTier = ((GT_MetaTileEntity_TieredMachineBlock) aMachine).mTier; mMult = 0; - if (downtierUEV && tTier>9){ - switch(tTier){ + if (downtierUEV && tTier > 9) { + switch (tTier) { default: - tTier=0; + tTier = 0; break; case 10: - tTier=9; - mMult=2; //Parallels are 4x as strong and require 4x less EU/t + tTier = 9; + mMult = 2; // Parallels are 4x as strong and require 4x less EU/t case 11: - tTier=9; - mMult=4; //Parallels are 16x as strong and require 16x less EU/t + tTier = 9; + mMult = 4; // Parallels are 16x as strong and require 16x less EU/t case 12: case 13: case 14: case 15: - tTier=9; - mMult=6; //Parallels are 64x as strong and require 64x less EU/t + tTier = 9; + mMult = 6; // Parallels are 64x as strong and require 64x less EU/t } } } @@ -213,14 +237,11 @@ public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_CubicMu for (GT_MetaTileEntity_Hatch_InputBus tHatch : mInputBusses) { IGregTechTileEntity tInputBus = tHatch.getBaseMetaTileEntity(); for (int i = tInputBus.getSizeInventory() - 1; i >= 0; i--) { - if (tInputBus.getStackInSlot(i) != null) - tInputList.add(tInputBus.getStackInSlot(i)); + if (tInputBus.getStackInSlot(i) != null) tInputList.add(tInputBus.getStackInSlot(i)); } ItemStack[] tInputs = tInputList.toArray(new ItemStack[0]); - if (processRecipe(tInputs, tFluids, map)) - return true; - else - tInputList.clear(); + if (processRecipe(tInputs, tFluids, map)) return true; + else tInputList.clear(); } } else { ArrayList<ItemStack> tInputList = getStoredInputs(); @@ -231,7 +252,8 @@ public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_CubicMu } public boolean processLockedRecipe() { - GT_Single_Recipe_Check_Processing_Array tSingleRecipeCheck = (GT_Single_Recipe_Check_Processing_Array) mSingleRecipeCheck; + GT_Single_Recipe_Check_Processing_Array tSingleRecipeCheck = + (GT_Single_Recipe_Check_Processing_Array) mSingleRecipeCheck; int machines = mInventory[1].stackSize << mMult; int parallel = tSingleRecipeCheck.checkRecipeInputs(true, machines); @@ -241,17 +263,20 @@ public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_CubicMu public boolean processRecipe(ItemStack[] tInputs, FluidStack[] tFluids, GT_Recipe.GT_Recipe_Map map) { if (tInputs.length <= 0 && tFluids.length <= 0) return false; - GT_Recipe tRecipe = map.findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); + GT_Recipe tRecipe = map.findRecipe( + getBaseMetaTileEntity(), mLastRecipe, false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); if (tRecipe == null) return false; - if (GT_Mod.gregtechproxy.mLowGravProcessing && tRecipe.mSpecialValue == -100 && - !isValidForLowGravity(tRecipe, getBaseMetaTileEntity().getWorld().provider.dimensionId)) + if (GT_Mod.gregtechproxy.mLowGravProcessing + && tRecipe.mSpecialValue == -100 + && !isValidForLowGravity(tRecipe, getBaseMetaTileEntity().getWorld().provider.dimensionId)) return false; GT_Single_Recipe_Check_Processing_Array.Builder tSingleRecipeCheckBuilder = null; if (mLockedToSingleRecipe) { // We're locked to a single recipe, but haven't built the recipe checker yet. // Build the checker on next successful recipe. - tSingleRecipeCheckBuilder = GT_Single_Recipe_Check_Processing_Array.processingArrayBuilder(this).setBefore(); + tSingleRecipeCheckBuilder = GT_Single_Recipe_Check_Processing_Array.processingArrayBuilder(this) + .setBefore(); } boolean recipeLocked = false; @@ -263,12 +288,11 @@ public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_CubicMu break; } else if (mLockedToSingleRecipe && !recipeLocked) { // We want to lock to a single run of the recipe. - mSingleRecipeCheck = - tSingleRecipeCheckBuilder - .setAfter() - .setRecipe(tRecipe) - .setRecipeAmperage(map.mAmperage) - .build(); + mSingleRecipeCheck = tSingleRecipeCheckBuilder + .setAfter() + .setRecipe(tRecipe) + .setRecipeAmperage(map.mAmperage) + .build(); recipeLocked = true; } } @@ -288,12 +312,10 @@ public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_CubicMu this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; calculateOverclockedNessMulti(aRecipe.mEUt, aRecipe.mDuration, aAmperage, GT_Values.V[tTier]); - //In case recipe is too OP for that machine - if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) - return false; + // In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return false; this.mEUt = GT_Utility.safeInt(((long) this.mEUt * parallel) >> mMult, 1); - if (mEUt == Integer.MAX_VALUE - 1) - return false; + if (mEUt == Integer.MAX_VALUE - 1) return false; if (this.mEUt > 0) { this.mEUt = (-this.mEUt); @@ -325,7 +347,7 @@ public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_CubicMu .flatMap(GT_MetaTileEntity_ProcessingArray::splitOversizedStack) .filter(is -> is.stackSize > 0) .toArray(ItemStack[]::new); - this.mOutputFluids = new FluidStack[]{tFOut}; + this.mOutputFluids = new FluidStack[] {tFOut}; updateSlots(); return true; } @@ -394,12 +416,14 @@ public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_CubicMu super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ); } else { mSeparate = !mSeparate; - GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + mSeparate); + GT_Utility.sendChatToPlayer( + aPlayer, StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + mSeparate); } } @Override - public boolean onWireCutterRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onWireCutterRightClick( + byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { downtierUEV = !downtierUEV; mLastRecipe = null; // clears last recipe GT_Utility.sendChatToPlayer(aPlayer, "Treat UEV+ machines as multiple UHV " + downtierUEV); @@ -423,7 +447,8 @@ public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_CubicMu @Override protected List<IHatchElement<? super GT_MetaTileEntity_CubicMultiBlockBase<?>>> getAllowedHatches() { - return ImmutableList.of(InputHatch, OutputHatch, InputBus, OutputBus, Muffler, Maintenance, Energy, ExoticEnergy); + return ImmutableList.of( + InputHatch, OutputHatch, InputBus, OutputBus, Muffler, Maintenance, Energy, ExoticEnergy); } @Override @@ -439,38 +464,50 @@ public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_CubicMu @Override public String[] getInfoData() { - long storedEnergy=0; - long maxEnergy=0; - for(GT_MetaTileEntity_Hatch tHatch : mExoticEnergyHatches) { + long storedEnergy = 0; + long maxEnergy = 0; + for (GT_MetaTileEntity_Hatch tHatch : mExoticEnergyHatches) { if (isValidMetaTileEntity(tHatch)) { - storedEnergy+=tHatch.getBaseMetaTileEntity().getStoredEU(); - maxEnergy+=tHatch.getBaseMetaTileEntity().getEUCapacity(); + storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU(); + maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity(); } } - return new String[]{ - StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + - EnumChatFormatting.GREEN + GT_Utility.formatNumbers(mProgresstime / 20) + EnumChatFormatting.RESET + " s / " + - EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(mMaxProgresstime / 20) + EnumChatFormatting.RESET + " s", - StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + - EnumChatFormatting.GREEN + GT_Utility.formatNumbers(storedEnergy) + EnumChatFormatting.RESET + " EU / " + - EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(maxEnergy) + EnumChatFormatting.RESET + " EU", - StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + - EnumChatFormatting.RED + GT_Utility.formatNumbers(-mEUt) + EnumChatFormatting.RESET + " EU/t", - StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + - EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(GT_ExoticEnergyInputHelper.getMaxInputVoltageMulti(getExoticAndNormalEnergyHatchList())) + EnumChatFormatting.RESET + " EU/t(*" + GT_Utility.formatNumbers(GT_ExoticEnergyInputHelper.getMaxInputAmpsMulti(getExoticAndNormalEnergyHatchList())) + "A) " + - StatCollector.translateToLocal("GT5U.machines.tier") + ": " + - EnumChatFormatting.YELLOW + VN[GT_Utility.getTier(GT_ExoticEnergyInputHelper.getMaxInputVoltageMulti(getExoticAndNormalEnergyHatchList()))] + EnumChatFormatting.RESET, - StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + - EnumChatFormatting.RED + (getIdealStatus() - getRepairStatus()) + EnumChatFormatting.RESET + " " + - StatCollector.translateToLocal("GT5U.multiblock.efficiency") + ": " + - EnumChatFormatting.YELLOW + mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", - StatCollector.translateToLocal("GT5U.PA.machinetier") + ": " + - EnumChatFormatting.GREEN + tTier + EnumChatFormatting.RESET + " " + - StatCollector.translateToLocal("GT5U.PA.discount") + ": " + - EnumChatFormatting.GREEN + (1 << mMult) + EnumChatFormatting.RESET + " x", - StatCollector.translateToLocal("GT5U.PA.parallel") + ": " + - EnumChatFormatting.GREEN + GT_Utility.formatNumbers((mInventory[1] != null) ? (mInventory[1].stackSize << mMult) : 0) + EnumChatFormatting.RESET + return new String[] { + StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(mProgresstime / 20) + EnumChatFormatting.RESET + " s / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(mMaxProgresstime / 20) + EnumChatFormatting.RESET + " s", + StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(storedEnergy) + EnumChatFormatting.RESET + " EU / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(maxEnergy) + EnumChatFormatting.RESET + " EU", + StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + EnumChatFormatting.RED + + GT_Utility.formatNumbers(-mEUt) + EnumChatFormatting.RESET + " EU/t", + StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers( + GT_ExoticEnergyInputHelper.getMaxInputVoltageMulti(getExoticAndNormalEnergyHatchList())) + + EnumChatFormatting.RESET + " EU/t(*" + + GT_Utility.formatNumbers( + GT_ExoticEnergyInputHelper.getMaxInputAmpsMulti(getExoticAndNormalEnergyHatchList())) + + "A) " + StatCollector.translateToLocal("GT5U.machines.tier") + + ": " + EnumChatFormatting.YELLOW + + VN[ + GT_Utility.getTier(GT_ExoticEnergyInputHelper.getMaxInputVoltageMulti( + getExoticAndNormalEnergyHatchList()))] + + EnumChatFormatting.RESET, + StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + EnumChatFormatting.RED + + (getIdealStatus() - getRepairStatus()) + EnumChatFormatting.RESET + " " + + StatCollector.translateToLocal("GT5U.multiblock.efficiency") + + ": " + EnumChatFormatting.YELLOW + + mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", + StatCollector.translateToLocal("GT5U.PA.machinetier") + ": " + EnumChatFormatting.GREEN + + tTier + EnumChatFormatting.RESET + " " + StatCollector.translateToLocal("GT5U.PA.discount") + + ": " + EnumChatFormatting.GREEN + + (1 << mMult) + EnumChatFormatting.RESET + " x", + StatCollector.translateToLocal("GT5U.PA.parallel") + ": " + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers((mInventory[1] != null) ? (mInventory[1].stackSize << mMult) : 0) + + EnumChatFormatting.RESET }; } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java index 16a655b20c..26c538e20b 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java @@ -1,5 +1,18 @@ package gregtech.common.tileentities.machines.multi; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlockUnlocalizedName; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; +import static gregtech.api.enums.GT_HatchElement.*; +import static gregtech.api.enums.GT_Values.MOD_ID_DC; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_PYROLYSE_OVEN; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_PYROLYSE_OVEN_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_PYROLYSE_OVEN_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_PYROLYSE_OVEN_GLOW; +import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; +import static gregtech.api.util.GT_StructureUtility.ofCoil; + import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IItemSource; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; @@ -27,55 +40,52 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlockUnlocalizedName; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; -import static gregtech.api.enums.GT_HatchElement.*; -import static gregtech.api.enums.GT_Values.MOD_ID_DC; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_PYROLYSE_OVEN; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_PYROLYSE_OVEN_ACTIVE; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_PYROLYSE_OVEN_ACTIVE_GLOW; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_PYROLYSE_OVEN_GLOW; -import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; -import static gregtech.api.util.GT_StructureUtility.ofCoil; -import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; - -public class GT_MetaTileEntity_PyrolyseOven extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_PyrolyseOven> implements ISurvivalConstructable { +public class GT_MetaTileEntity_PyrolyseOven + extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_PyrolyseOven> + implements ISurvivalConstructable { private HeatingCoilLevel coilHeat; - //public static GT_CopiedBlockTexture mTextureULV = new GT_CopiedBlockTexture(Block.getBlockFromItem(ItemList.Casing_ULV.get(1).getItem()), 6, 0, Dyes.MACHINE_METAL.mRGBa); + // public static GT_CopiedBlockTexture mTextureULV = new + // GT_CopiedBlockTexture(Block.getBlockFromItem(ItemList.Casing_ULV.get(1).getItem()), 6, 0, + // Dyes.MACHINE_METAL.mRGBa); private static final int CASING_INDEX = 1090; - private static final IStructureDefinition<GT_MetaTileEntity_PyrolyseOven> STRUCTURE_DEFINITION = createStructureDefinition(); + private static final IStructureDefinition<GT_MetaTileEntity_PyrolyseOven> STRUCTURE_DEFINITION = + createStructureDefinition(); private static IStructureDefinition<GT_MetaTileEntity_PyrolyseOven> createStructureDefinition() { - IStructureElement<GT_MetaTileEntity_PyrolyseOven> tCasingElement = - Loader.isModLoaded(MOD_ID_DC) ? - ofBlockUnlocalizedName(MOD_ID_DC, "gt.blockcasingsNH", 2) : - ofBlock(GregTech_API.sBlockCasings1, 0); + IStructureElement<GT_MetaTileEntity_PyrolyseOven> tCasingElement = Loader.isModLoaded(MOD_ID_DC) + ? ofBlockUnlocalizedName(MOD_ID_DC, "gt.blockcasingsNH", 2) + : ofBlock(GregTech_API.sBlockCasings1, 0); return StructureDefinition.<GT_MetaTileEntity_PyrolyseOven>builder() - .addShape("main", transpose(new String[][]{ - {"ccccc", "ctttc", "ctttc", "ctttc", "ccccc"}, - {"ccccc", "c---c", "c---c", "c---c", "ccccc"}, - {"ccccc", "c---c", "c---c", "c---c", "ccccc"}, - {"bb~bb", "bCCCb", "bCCCb", "bCCCb", "bbbbb"}, + .addShape("main", transpose(new String[][] { + {"ccccc", "ctttc", "ctttc", "ctttc", "ccccc"}, + {"ccccc", "c---c", "c---c", "c---c", "ccccc"}, + {"ccccc", "c---c", "c---c", "c---c", "ccccc"}, + {"bb~bb", "bCCCb", "bCCCb", "bCCCb", "bbbbb"}, })) .addElement('c', onElementPass(GT_MetaTileEntity_PyrolyseOven::onCasingAdded, tCasingElement)) - .addElement('C', ofCoil(GT_MetaTileEntity_PyrolyseOven::setCoilLevel, GT_MetaTileEntity_PyrolyseOven::getCoilLevel)) - .addElement('b', buildHatchAdder(GT_MetaTileEntity_PyrolyseOven.class) - .atLeast(OutputBus, OutputHatch, Energy, Maintenance) - .casingIndex(CASING_INDEX) - .dot(1) - .buildAndChain(onElementPass(GT_MetaTileEntity_PyrolyseOven::onCasingAdded, tCasingElement)) - ) - .addElement('t', buildHatchAdder(GT_MetaTileEntity_PyrolyseOven.class) - .atLeast(InputBus, InputHatch, Muffler) - .casingIndex(CASING_INDEX) - .dot(1) - .buildAndChain(onElementPass(GT_MetaTileEntity_PyrolyseOven::onCasingAdded, tCasingElement)) - ) + .addElement( + 'C', + ofCoil( + GT_MetaTileEntity_PyrolyseOven::setCoilLevel, + GT_MetaTileEntity_PyrolyseOven::getCoilLevel)) + .addElement( + 'b', + buildHatchAdder(GT_MetaTileEntity_PyrolyseOven.class) + .atLeast(OutputBus, OutputHatch, Energy, Maintenance) + .casingIndex(CASING_INDEX) + .dot(1) + .buildAndChain( + onElementPass(GT_MetaTileEntity_PyrolyseOven::onCasingAdded, tCasingElement))) + .addElement( + 't', + buildHatchAdder(GT_MetaTileEntity_PyrolyseOven.class) + .atLeast(InputBus, InputHatch, Muffler) + .casingIndex(CASING_INDEX) + .dot(1) + .buildAndChain( + onElementPass(GT_MetaTileEntity_PyrolyseOven::onCasingAdded, tCasingElement))) .build(); } @@ -116,24 +126,47 @@ public class GT_MetaTileEntity_PyrolyseOven extends GT_MetaTileEntity_EnhancedMu } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { if (aSide == aFacing) { if (aActive) - return new ITexture[]{ - BlockIcons.casingTexturePages[8][66], - TextureFactory.builder().addIcon(OVERLAY_FRONT_PYROLYSE_OVEN_ACTIVE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_PYROLYSE_OVEN_ACTIVE_GLOW).extFacing().glow().build()}; - return new ITexture[]{ + return new ITexture[] { BlockIcons.casingTexturePages[8][66], - TextureFactory.builder().addIcon(OVERLAY_FRONT_PYROLYSE_OVEN).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_PYROLYSE_OVEN_GLOW).extFacing().glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_PYROLYSE_OVEN_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_PYROLYSE_OVEN_ACTIVE_GLOW) + .extFacing() + .glow() + .build() + }; + return new ITexture[] { + BlockIcons.casingTexturePages[8][66], + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_PYROLYSE_OVEN) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_PYROLYSE_OVEN_GLOW) + .extFacing() + .glow() + .build() + }; } - return new ITexture[]{Textures.BlockIcons.casingTexturePages[8][66]}; + return new ITexture[] {Textures.BlockIcons.casingTexturePages[8][66]}; } @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "PyrolyseOven.png"); + return new GT_GUIContainer_MultiMachine( + aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "PyrolyseOven.png"); } @Override @@ -157,8 +190,7 @@ public class GT_MetaTileEntity_PyrolyseOven extends GT_MetaTileEntity_EnhancedMu ItemStack[] tInputs = getCompactedInputs(); FluidStack[] tFluids = getCompactedFluids(); - if (tInputs.length <= 0) - return false; + if (tInputs.length <= 0) return false; GT_Single_Recipe_Check.Builder tSingleRecipeCheckBuilder = null; if (mLockedToSingleRecipe) { @@ -167,13 +199,14 @@ public class GT_MetaTileEntity_PyrolyseOven extends GT_MetaTileEntity_EnhancedMu tSingleRecipeCheckBuilder = GT_Single_Recipe_Check.builder(this).setBefore(); } - tRecipe = GT_Recipe.GT_Recipe_Map.sPyrolyseRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); + tRecipe = GT_Recipe.GT_Recipe_Map.sPyrolyseRecipes.findRecipe( + getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); - if (tRecipe == null || !tRecipe.isRecipeInputEqual(true, tFluids, tInputs)) - return false; + if (tRecipe == null || !tRecipe.isRecipeInputEqual(true, tFluids, tInputs)) return false; if (mLockedToSingleRecipe) { - mSingleRecipeCheck = tSingleRecipeCheckBuilder.setAfter().setRecipe(tRecipe).build(); + mSingleRecipeCheck = + tSingleRecipeCheckBuilder.setAfter().setRecipe(tRecipe).build(); } } @@ -181,16 +214,12 @@ public class GT_MetaTileEntity_PyrolyseOven extends GT_MetaTileEntity_EnhancedMu this.mEfficiencyIncrease = 10000; calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, 1, tVoltage); - //In case recipe is too OP for that machine - if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) - return false; - if (this.mEUt > 0) - this.mEUt = (-this.mEUt); + // In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return false; + if (this.mEUt > 0) this.mEUt = (-this.mEUt); this.mMaxProgresstime = Math.max(mMaxProgresstime * 2 / (1 + coilHeat.getTier()), 1); - if (tRecipe.mOutputs.length > 0) - this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0)}; - if (tRecipe.mFluidOutputs.length > 0) - this.mOutputFluids = new FluidStack[]{tRecipe.getFluidOutput(0)}; + if (tRecipe.mOutputs.length > 0) this.mOutputItems = new ItemStack[] {tRecipe.getOutput(0)}; + if (tRecipe.mFluidOutputs.length > 0) this.mOutputFluids = new FluidStack[] {tRecipe.getFluidOutput(0)}; updateSlots(); return true; } @@ -217,8 +246,10 @@ public class GT_MetaTileEntity_PyrolyseOven extends GT_MetaTileEntity_EnhancedMu coilHeat = HeatingCoilLevel.None; mCasingAmount = 0; replaceDeprecatedCoils(aBaseMetaTileEntity); - return checkPiece("main", 2, 3, 0) && mCasingAmount >= 60 && - mMaintenanceHatches.size() == 1 && !mMufflerHatches.isEmpty(); + return checkPiece("main", 2, 3, 0) + && mCasingAmount >= 60 + && mMaintenanceHatches.size() == 1 + && !mMufflerHatches.isEmpty(); } @Override @@ -259,8 +290,8 @@ public class GT_MetaTileEntity_PyrolyseOven extends GT_MetaTileEntity_EnhancedMu int tZ = aBaseMetaTileEntity.getZCoord() + zDir * 2; for (int xPos = tX - 1; xPos <= tX + 1; xPos++) { for (int zPos = tZ - 1; zPos <= tZ + 1; zPos++) { - if (aBaseMetaTileEntity.getBlock(xPos, tY, zPos) == GregTech_API.sBlockCasings1 && - aBaseMetaTileEntity.getMetaID(xPos, tY, zPos) == 13) { + if (aBaseMetaTileEntity.getBlock(xPos, tY, zPos) == GregTech_API.sBlockCasings1 + && aBaseMetaTileEntity.getMetaID(xPos, tY, zPos) == 13) { aBaseMetaTileEntity.getWorld().setBlock(xPos, tY, zPos, GregTech_API.sBlockCasings5, 1, 3); } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_VacuumFreezer.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_VacuumFreezer.java index f476e78310..5bbed8951c 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_VacuumFreezer.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_VacuumFreezer.java @@ -1,5 +1,11 @@ package gregtech.common.tileentities.machines.multi; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages; + import com.gtnewhorizon.structurelib.structure.IStructureElement; import com.gtnewhorizon.structurelib.structure.StructureUtility; import gregtech.api.GregTech_API; @@ -16,13 +22,8 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE_GLOW; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER_GLOW; -import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages; - -public class GT_MetaTileEntity_VacuumFreezer extends GT_MetaTileEntity_CubicMultiBlockBase<GT_MetaTileEntity_VacuumFreezer> { +public class GT_MetaTileEntity_VacuumFreezer + extends GT_MetaTileEntity_CubicMultiBlockBase<GT_MetaTileEntity_VacuumFreezer> { public GT_MetaTileEntity_VacuumFreezer(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); } @@ -57,29 +58,52 @@ public class GT_MetaTileEntity_VacuumFreezer extends GT_MetaTileEntity_CubicMult } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { ITexture[] rTexture; if (aSide == aFacing) { if (aActive) { - rTexture = new ITexture[]{ - casingTexturePages[0][17], - TextureFactory.builder().addIcon(OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE_GLOW).extFacing().glow().build()}; + rTexture = new ITexture[] { + casingTexturePages[0][17], + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE_GLOW) + .extFacing() + .glow() + .build() + }; } else { - rTexture = new ITexture[]{ - casingTexturePages[0][17], - TextureFactory.builder().addIcon(OVERLAY_FRONT_VACUUM_FREEZER).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_VACUUM_FREEZER_GLOW).extFacing().glow().build()}; + rTexture = new ITexture[] { + casingTexturePages[0][17], + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_VACUUM_FREEZER) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_VACUUM_FREEZER_GLOW) + .extFacing() + .glow() + .build() + }; } } else { - rTexture = new ITexture[]{casingTexturePages[0][17]}; + rTexture = new ITexture[] {casingTexturePages[0][17]}; } return rTexture; } @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "VacuumFreezer.png"); + return new GT_GUIContainer_MultiMachine( + aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "VacuumFreezer.png"); } @Override @@ -99,22 +123,23 @@ public class GT_MetaTileEntity_VacuumFreezer extends GT_MetaTileEntity_CubicMult long tVoltage = getMaxInputVoltage(); byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); - GT_Recipe tRecipe = getRecipeMap().findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluidList, tInputList); + GT_Recipe tRecipe = getRecipeMap() + .findRecipe( + getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluidList, tInputList); if (tRecipe != null) { if (tRecipe.isRecipeInputEqual(true, tFluidList, tInputList)) { this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, 1, tVoltage); - //In case recipe is too OP for that machine - if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) - return false; + // In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return false; if (this.mEUt > 0) { this.mEUt = (-this.mEUt); } this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); - this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0)}; - this.mOutputFluids = new FluidStack[]{tRecipe.getFluidOutput(0)}; + this.mOutputItems = new ItemStack[] {tRecipe.getOutput(0)}; + this.mOutputFluids = new FluidStack[] {tRecipe.getFluidOutput(0)}; updateSlots(); return true; } diff --git a/src/main/java/gregtech/common/tileentities/machines/multiblock/MultiBlock_Macerator.java b/src/main/java/gregtech/common/tileentities/machines/multiblock/MultiBlock_Macerator.java index 23a2a484d1..09aae61527 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multiblock/MultiBlock_Macerator.java +++ b/src/main/java/gregtech/common/tileentities/machines/multiblock/MultiBlock_Macerator.java @@ -1,17 +1,5 @@ package gregtech.common.tileentities.machines.multiblock; -import com.gtnewhorizon.structurelib.structure.IStructureDefinition; -import com.gtnewhorizon.structurelib.structure.StructureDefinition; -import com.gtnewhorizon.structurelib.util.Vec3Impl; -import gregtech.api.interfaces.ITexture; -import gregtech.api.multitileentity.multiblock.base.MultiBlockPart; -import gregtech.api.multitileentity.multiblock.base.MultiBlock_Stackable; -import gregtech.api.render.TextureFactory; -import gregtech.api.util.GT_Multiblock_Tooltip_Builder; -import gregtech.common.render.GT_MultiTexture; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; - import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS; @@ -24,6 +12,15 @@ import static gregtech.api.multitileentity.multiblock.base.MultiBlockPart.ITEM_I import static gregtech.api.multitileentity.multiblock.base.MultiBlockPart.ITEM_OUT; import static gregtech.api.multitileentity.multiblock.base.MultiBlockPart.NOTHING; +import com.gtnewhorizon.structurelib.structure.IStructureDefinition; +import com.gtnewhorizon.structurelib.structure.StructureDefinition; +import com.gtnewhorizon.structurelib.util.Vec3Impl; +import gregtech.api.interfaces.ITexture; +import gregtech.api.multitileentity.multiblock.base.MultiBlock_Stackable; +import gregtech.api.render.TextureFactory; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; +import net.minecraft.block.Block; + public class MultiBlock_Macerator extends MultiBlock_Stackable<MultiBlock_Macerator> { private IStructureDefinition<MultiBlock_Macerator> STRUCTURE_DEFINITION = null; @@ -36,52 +33,59 @@ public class MultiBlock_Macerator extends MultiBlock_Stackable<MultiBlock_Macera public IStructureDefinition<MultiBlock_Macerator> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<MultiBlock_Macerator>builder() - .addShape(STACKABLE_TOP, transpose(new String[][] { - {" CCC ", "CCCCC", "CCCCC", "CCCCC", " CCC "}, - })) - .addShape(STACKABLE_MIDDLE, transpose(new String[][] { - {" BBB ", " B---B ", "DC---CD", " B---B ", " BBB "}, - })) - .addShape(STACKABLE_BOTTOM, transpose(new String[][] { - {" A~A ", "AAAAA", "AAAAA", "AAAAA", " AAA "}, - })) - .addElement('A', ofChain(addMultiTileCasing(getCasingRegistryID(), getCasingMeta(), ENERGY_IN))) - .addElement('B', ofChain(addMultiTileCasing(getCasingRegistryID(), getCasingMeta(), FLUID_IN | ITEM_IN | FLUID_OUT | ITEM_OUT))) - .addElement('C', addMultiTileCasing(getCasingRegistryID(), getCasingMeta(), NOTHING)) - .addElement('D', addMultiTileCasing(getCasingRegistryID(), getCasingMeta(), NOTHING)) - .build(); + .addShape(STACKABLE_TOP, transpose(new String[][] { + {" CCC ", "CCCCC", "CCCCC", "CCCCC", " CCC "}, + })) + .addShape(STACKABLE_MIDDLE, transpose(new String[][] { + {" BBB ", " B---B ", "DC---CD", " B---B ", " BBB "}, + })) + .addShape(STACKABLE_BOTTOM, transpose(new String[][] { + {" A~A ", "AAAAA", "AAAAA", "AAAAA", " AAA "}, + })) + .addElement('A', ofChain(addMultiTileCasing(getCasingRegistryID(), getCasingMeta(), ENERGY_IN))) + .addElement( + 'B', + ofChain(addMultiTileCasing( + getCasingRegistryID(), getCasingMeta(), FLUID_IN | ITEM_IN | FLUID_OUT | ITEM_OUT))) + .addElement('C', addMultiTileCasing(getCasingRegistryID(), getCasingMeta(), NOTHING)) + .addElement('D', addMultiTileCasing(getCasingRegistryID(), getCasingMeta(), NOTHING)) + .build(); } return STRUCTURE_DEFINITION; } - @Override public short getCasingRegistryID() { + @Override + public short getCasingRegistryID() { return getMultiTileEntityRegistryID(); } - @Override public short getCasingMeta() { + @Override + public short getCasingMeta() { return 18000; } @Override - public boolean hasTop() { return true; } - + public boolean hasTop() { + return true; + } @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Macerator") - .addInfo("Controller for the Macerator") - .addSeparator() - .beginVariableStructureBlock(7, 9, 2 + getMinStacks(), 2+getMaxStacks(), 7, 9, true) - .addController("Bottom Front Center") - .addCasingInfo("Test Casing", 60) - .addEnergyHatch("Any bottom layer casing") - .addInputHatch("Any non-optional external facing casing on the stacks") - .addInputBus("Any non-optional external facing casing on the stacks") - .addOutputHatch("Any non-optional external facing casing on the stacks") - .addOutputBus("Any non-optional external facing casing on the stacks") - .addStructureInfo(String.format("Stackable middle stacks between %d-%d time(s).", getMinStacks(), getMaxStacks())) - .toolTipFinisher("Wildcard"); + .addInfo("Controller for the Macerator") + .addSeparator() + .beginVariableStructureBlock(7, 9, 2 + getMinStacks(), 2 + getMaxStacks(), 7, 9, true) + .addController("Bottom Front Center") + .addCasingInfo("Test Casing", 60) + .addEnergyHatch("Any bottom layer casing") + .addInputHatch("Any non-optional external facing casing on the stacks") + .addInputBus("Any non-optional external facing casing on the stacks") + .addOutputHatch("Any non-optional external facing casing on the stacks") + .addOutputBus("Any non-optional external facing casing on the stacks") + .addStructureInfo( + String.format("Stackable middle stacks between %d-%d time(s).", getMinStacks(), getMaxStacks())) + .toolTipFinisher("Wildcard"); return tt; } @@ -95,7 +99,6 @@ public class MultiBlock_Macerator extends MultiBlock_Stackable<MultiBlock_Macera return 10; } - @Override public Vec3Impl getStartingStructureOffset() { return new Vec3Impl(2, 0, 0); @@ -119,19 +122,24 @@ public class MultiBlock_Macerator extends MultiBlock_Stackable<MultiBlock_Macera @Override public ITexture[] getTexture(Block aBlock, byte aSide, boolean isActive, int aRenderPass) { // TODO: MTE(Texture) - if(mFacing == aSide) { - return new ITexture[]{ + if (mFacing == aSide) { + return new ITexture[] { // Base Texture MACHINE_CASINGS[1][0], // Active - TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE).extFacing().build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE) + .extFacing() + .build(), // Active Glow - TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE_GLOW).extFacing().glow().build() + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE_GLOW) + .extFacing() + .glow() + .build() }; } // Base Texture - return new ITexture[]{ MACHINE_CASINGS[1][0]}; + return new ITexture[] {MACHINE_CASINGS[1][0]}; } - - } diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Bronze.java index 821c3bfabc..129af9dc27 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Bronze.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Bronze.java @@ -1,5 +1,7 @@ package gregtech.common.tileentities.machines.steam; +import static gregtech.api.enums.Textures.BlockIcons.*; + import gregtech.api.enums.SoundResource; import gregtech.api.gui.GT_GUIContainer_BasicMachine; import gregtech.api.interfaces.ITexture; @@ -11,8 +13,6 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.InventoryPlayer; -import static gregtech.api.enums.Textures.BlockIcons.*; - public class GT_MetaTileEntity_AlloySmelter_Bronze extends GT_MetaTileEntity_BasicMachine_Bronze { public GT_MetaTileEntity_AlloySmelter_Bronze(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, "Combination Smelter", 2, 1, false); @@ -38,7 +38,12 @@ public class GT_MetaTileEntity_AlloySmelter_Bronze extends GT_MetaTileEntity_Bas @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "BronzeAlloySmelter.png", GT_Recipe.GT_Recipe_Map.sAlloySmelterRecipes.mUnlocalizedName); + return new GT_GUIContainer_BasicMachine( + aPlayerInventory, + aBaseMetaTileEntity, + getLocalName(), + "BronzeAlloySmelter.png", + GT_Recipe.GT_Recipe_Map.sAlloySmelterRecipes.mUnlocalizedName); } @Override @@ -61,65 +66,97 @@ public class GT_MetaTileEntity_AlloySmelter_Bronze extends GT_MetaTileEntity_Bas @Override public ITexture[] getSideFacingActive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getSideFacingActive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_ALLOY_SMELTER_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_SIDE_STEAM_ALLOY_SMELTER_ACTIVE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_STEAM_ALLOY_SMELTER_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getSideFacingInactive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getSideFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_ALLOY_SMELTER), - TextureFactory.builder().addIcon(OVERLAY_SIDE_STEAM_ALLOY_SMELTER_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_STEAM_ALLOY_SMELTER_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getFrontFacingActive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getFrontFacingActive(aColor)[0], TextureFactory.of(OVERLAY_FRONT_STEAM_ALLOY_SMELTER_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_FRONT_STEAM_ALLOY_SMELTER_ACTIVE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_STEAM_ALLOY_SMELTER_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getFrontFacingInactive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getFrontFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_FRONT_STEAM_ALLOY_SMELTER), - TextureFactory.builder().addIcon(OVERLAY_FRONT_STEAM_ALLOY_SMELTER_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_STEAM_ALLOY_SMELTER_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getTopFacingActive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getTopFacingActive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_ALLOY_SMELTER_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_TOP_STEAM_ALLOY_SMELTER_ACTIVE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_TOP_STEAM_ALLOY_SMELTER_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getTopFacingInactive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getTopFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_ALLOY_SMELTER), - TextureFactory.builder().addIcon(OVERLAY_TOP_STEAM_ALLOY_SMELTER_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_TOP_STEAM_ALLOY_SMELTER_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getBottomFacingActive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getBottomFacingActive(aColor)[0], TextureFactory.of(OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER_ACTIVE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getBottomFacingInactive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getBottomFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER), - TextureFactory.builder().addIcon(OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER_GLOW) + .glow() + .build() + }; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Steel.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Steel.java index efd66a4f8f..2ad1a2ff01 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Steel.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Steel.java @@ -1,5 +1,7 @@ package gregtech.common.tileentities.machines.steam; +import static gregtech.api.enums.Textures.BlockIcons.*; + import gregtech.api.enums.SoundResource; import gregtech.api.gui.GT_GUIContainer_BasicMachine; import gregtech.api.interfaces.ITexture; @@ -11,8 +13,6 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.InventoryPlayer; -import static gregtech.api.enums.Textures.BlockIcons.*; - public class GT_MetaTileEntity_AlloySmelter_Steel extends GT_MetaTileEntity_BasicMachine_Steel { public GT_MetaTileEntity_AlloySmelter_Steel(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, "Combination Smelter", 2, 1, true); @@ -38,7 +38,12 @@ public class GT_MetaTileEntity_AlloySmelter_Steel extends GT_MetaTileEntity_Basi @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "SteelAlloySmelter.png", GT_Recipe.GT_Recipe_Map.sAlloySmelterRecipes.mUnlocalizedName); + return new GT_GUIContainer_BasicMachine( + aPlayerInventory, + aBaseMetaTileEntity, + getLocalName(), + "SteelAlloySmelter.png", + GT_Recipe.GT_Recipe_Map.sAlloySmelterRecipes.mUnlocalizedName); } @Override @@ -61,65 +66,97 @@ public class GT_MetaTileEntity_AlloySmelter_Steel extends GT_MetaTileEntity_Basi @Override public ITexture[] getSideFacingActive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getSideFacingActive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_ALLOY_SMELTER_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_SIDE_STEAM_ALLOY_SMELTER_ACTIVE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_STEAM_ALLOY_SMELTER_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getSideFacingInactive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getSideFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_ALLOY_SMELTER), - TextureFactory.builder().addIcon(OVERLAY_SIDE_STEAM_ALLOY_SMELTER_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_STEAM_ALLOY_SMELTER_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getFrontFacingActive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getFrontFacingActive(aColor)[0], TextureFactory.of(OVERLAY_FRONT_STEAM_ALLOY_SMELTER_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_FRONT_STEAM_ALLOY_SMELTER_ACTIVE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_STEAM_ALLOY_SMELTER_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getFrontFacingInactive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getFrontFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_FRONT_STEAM_ALLOY_SMELTER), - TextureFactory.builder().addIcon(OVERLAY_FRONT_STEAM_ALLOY_SMELTER_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_STEAM_ALLOY_SMELTER_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getTopFacingActive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getTopFacingActive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_ALLOY_SMELTER_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_TOP_STEAM_ALLOY_SMELTER_ACTIVE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_TOP_STEAM_ALLOY_SMELTER_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getTopFacingInactive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getTopFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_ALLOY_SMELTER), - TextureFactory.builder().addIcon(OVERLAY_TOP_STEAM_ALLOY_SMELTER_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_TOP_STEAM_ALLOY_SMELTER_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getBottomFacingActive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getBottomFacingActive(aColor)[0], TextureFactory.of(OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER_ACTIVE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getBottomFacingInactive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getBottomFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER), - TextureFactory.builder().addIcon(OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER_GLOW) + .glow() + .build() + }; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Bronze.java index 9073b997ed..9fe3586790 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Bronze.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Bronze.java @@ -1,5 +1,7 @@ package gregtech.common.tileentities.machines.steam; +import static gregtech.api.enums.Textures.BlockIcons.*; + import gregtech.api.enums.SoundResource; import gregtech.api.gui.GT_GUIContainer_BasicMachine; import gregtech.api.interfaces.ITexture; @@ -11,8 +13,6 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.InventoryPlayer; -import static gregtech.api.enums.Textures.BlockIcons.*; - public class GT_MetaTileEntity_Compressor_Bronze extends GT_MetaTileEntity_BasicMachine_Bronze { public GT_MetaTileEntity_Compressor_Bronze(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, "Compressing Items", 1, 1, false); @@ -28,7 +28,12 @@ public class GT_MetaTileEntity_Compressor_Bronze extends GT_MetaTileEntity_Basic @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "BronzeCompressor.png", GT_Recipe.GT_Recipe_Map.sCompressorRecipes.mUnlocalizedName); + return new GT_GUIContainer_BasicMachine( + aPlayerInventory, + aBaseMetaTileEntity, + getLocalName(), + "BronzeCompressor.png", + GT_Recipe.GT_Recipe_Map.sCompressorRecipes.mUnlocalizedName); } @Override @@ -56,65 +61,97 @@ public class GT_MetaTileEntity_Compressor_Bronze extends GT_MetaTileEntity_Basic @Override public ITexture[] getSideFacingActive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getSideFacingActive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_COMPRESSOR_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_SIDE_STEAM_COMPRESSOR_ACTIVE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_STEAM_COMPRESSOR_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getSideFacingInactive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getSideFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_COMPRESSOR), - TextureFactory.builder().addIcon(OVERLAY_SIDE_STEAM_COMPRESSOR_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_STEAM_COMPRESSOR_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getFrontFacingActive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getFrontFacingActive(aColor)[0], TextureFactory.of(OVERLAY_FRONT_STEAM_COMPRESSOR_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_FRONT_STEAM_COMPRESSOR_ACTIVE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_STEAM_COMPRESSOR_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getFrontFacingInactive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getFrontFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_FRONT_STEAM_COMPRESSOR), - TextureFactory.builder().addIcon(OVERLAY_FRONT_STEAM_COMPRESSOR_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_STEAM_COMPRESSOR_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getTopFacingActive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getTopFacingActive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_COMPRESSOR_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_TOP_STEAM_COMPRESSOR_ACTIVE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_TOP_STEAM_COMPRESSOR_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getTopFacingInactive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getTopFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_COMPRESSOR), - TextureFactory.builder().addIcon(OVERLAY_TOP_STEAM_COMPRESSOR_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_TOP_STEAM_COMPRESSOR_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getBottomFacingActive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getBottomFacingActive(aColor)[0], TextureFactory.of(OVERLAY_BOTTOM_STEAM_COMPRESSOR_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_BOTTOM_STEAM_COMPRESSOR_ACTIVE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_STEAM_COMPRESSOR_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getBottomFacingInactive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getBottomFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_BOTTOM_STEAM_COMPRESSOR), - TextureFactory.builder().addIcon(OVERLAY_BOTTOM_STEAM_COMPRESSOR_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_STEAM_COMPRESSOR_GLOW) + .glow() + .build() + }; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Steel.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Steel.java index 51f44a8c77..e3781e91a8 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Steel.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Steel.java @@ -1,5 +1,7 @@ package gregtech.common.tileentities.machines.steam; +import static gregtech.api.enums.Textures.BlockIcons.*; + import gregtech.api.enums.SoundResource; import gregtech.api.gui.GT_GUIContainer_BasicMachine; import gregtech.api.interfaces.ITexture; @@ -11,8 +13,6 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.InventoryPlayer; -import static gregtech.api.enums.Textures.BlockIcons.*; - public class GT_MetaTileEntity_Compressor_Steel extends GT_MetaTileEntity_BasicMachine_Steel { public GT_MetaTileEntity_Compressor_Steel(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, "Compressing Items", 1, 1, true); @@ -28,7 +28,12 @@ public class GT_MetaTileEntity_Compressor_Steel extends GT_MetaTileEntity_BasicM @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "SteelCompressor.png", GT_Recipe.GT_Recipe_Map.sCompressorRecipes.mUnlocalizedName); + return new GT_GUIContainer_BasicMachine( + aPlayerInventory, + aBaseMetaTileEntity, + getLocalName(), + "SteelCompressor.png", + GT_Recipe.GT_Recipe_Map.sCompressorRecipes.mUnlocalizedName); } @Override @@ -56,65 +61,97 @@ public class GT_MetaTileEntity_Compressor_Steel extends GT_MetaTileEntity_BasicM @Override public ITexture[] getSideFacingActive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getSideFacingActive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_COMPRESSOR_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_SIDE_STEAM_COMPRESSOR_ACTIVE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_STEAM_COMPRESSOR_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getSideFacingInactive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getSideFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_COMPRESSOR), - TextureFactory.builder().addIcon(OVERLAY_SIDE_STEAM_COMPRESSOR_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_STEAM_COMPRESSOR_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getFrontFacingActive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getFrontFacingActive(aColor)[0], TextureFactory.of(OVERLAY_FRONT_STEAM_COMPRESSOR_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_FRONT_STEAM_COMPRESSOR_ACTIVE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_STEAM_COMPRESSOR_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getFrontFacingInactive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getFrontFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_FRONT_STEAM_COMPRESSOR), - TextureFactory.builder().addIcon(OVERLAY_FRONT_STEAM_COMPRESSOR_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_STEAM_COMPRESSOR_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getTopFacingActive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getTopFacingActive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_COMPRESSOR_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_TOP_STEAM_COMPRESSOR_ACTIVE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_TOP_STEAM_COMPRESSOR_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getTopFacingInactive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getTopFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_COMPRESSOR), - TextureFactory.builder().addIcon(OVERLAY_TOP_STEAM_COMPRESSOR_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_TOP_STEAM_COMPRESSOR_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getBottomFacingActive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getBottomFacingActive(aColor)[0], TextureFactory.of(OVERLAY_BOTTOM_STEAM_COMPRESSOR_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_BOTTOM_STEAM_COMPRESSOR_ACTIVE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_STEAM_COMPRESSOR_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getBottomFacingInactive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getBottomFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_BOTTOM_STEAM_COMPRESSOR), - TextureFactory.builder().addIcon(OVERLAY_BOTTOM_STEAM_COMPRESSOR_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_STEAM_COMPRESSOR_GLOW) + .glow() + .build() + }; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Bronze.java index 0773c09204..17fda5fc8d 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Bronze.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Bronze.java @@ -1,5 +1,7 @@ package gregtech.common.tileentities.machines.steam; +import static gregtech.api.enums.Textures.BlockIcons.*; + import gregtech.api.enums.SoundResource; import gregtech.api.gui.GT_GUIContainer_BasicMachine; import gregtech.api.interfaces.ITexture; @@ -11,8 +13,6 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.InventoryPlayer; -import static gregtech.api.enums.Textures.BlockIcons.*; - public class GT_MetaTileEntity_Extractor_Bronze extends GT_MetaTileEntity_BasicMachine_Bronze { public GT_MetaTileEntity_Extractor_Bronze(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, "Extracting your first Rubber", 1, 1, false); @@ -28,7 +28,12 @@ public class GT_MetaTileEntity_Extractor_Bronze extends GT_MetaTileEntity_BasicM @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "BronzeExtractor.png", GT_Recipe.GT_Recipe_Map.sExtractorRecipes.mUnlocalizedName); + return new GT_GUIContainer_BasicMachine( + aPlayerInventory, + aBaseMetaTileEntity, + getLocalName(), + "BronzeExtractor.png", + GT_Recipe.GT_Recipe_Map.sExtractorRecipes.mUnlocalizedName); } @Override @@ -56,65 +61,97 @@ public class GT_MetaTileEntity_Extractor_Bronze extends GT_MetaTileEntity_BasicM @Override public ITexture[] getSideFacingActive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getSideFacingActive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_EXTRACTOR_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_SIDE_STEAM_EXTRACTOR_ACTIVE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_STEAM_EXTRACTOR_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getSideFacingInactive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getSideFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_EXTRACTOR), - TextureFactory.builder().addIcon(OVERLAY_SIDE_STEAM_EXTRACTOR_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_STEAM_EXTRACTOR_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getFrontFacingActive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getFrontFacingActive(aColor)[0], TextureFactory.of(OVERLAY_FRONT_STEAM_EXTRACTOR_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_FRONT_STEAM_EXTRACTOR_ACTIVE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_STEAM_EXTRACTOR_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getFrontFacingInactive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getFrontFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_FRONT_STEAM_EXTRACTOR), - TextureFactory.builder().addIcon(OVERLAY_FRONT_STEAM_EXTRACTOR_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_STEAM_EXTRACTOR_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getTopFacingActive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getTopFacingActive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_EXTRACTOR_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_TOP_STEAM_EXTRACTOR_ACTIVE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_TOP_STEAM_EXTRACTOR_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getTopFacingInactive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getTopFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_EXTRACTOR), - TextureFactory.builder().addIcon(OVERLAY_TOP_STEAM_EXTRACTOR_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_TOP_STEAM_EXTRACTOR_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getBottomFacingActive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getBottomFacingActive(aColor)[0], TextureFactory.of(OVERLAY_BOTTOM_STEAM_EXTRACTOR_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_BOTTOM_STEAM_EXTRACTOR_ACTIVE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_STEAM_EXTRACTOR_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getBottomFacingInactive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getBottomFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_BOTTOM_STEAM_EXTRACTOR), - TextureFactory.builder().addIcon(OVERLAY_BOTTOM_STEAM_EXTRACTOR_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_STEAM_EXTRACTOR_GLOW) + .glow() + .build() + }; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Steel.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Steel.java index d471259250..c7ebeee12b 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Steel.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Steel.java @@ -1,5 +1,7 @@ package gregtech.common.tileentities.machines.steam; +import static gregtech.api.enums.Textures.BlockIcons.*; + import gregtech.api.enums.SoundResource; import gregtech.api.gui.GT_GUIContainer_BasicMachine; import gregtech.api.interfaces.ITexture; @@ -11,8 +13,6 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.InventoryPlayer; -import static gregtech.api.enums.Textures.BlockIcons.*; - public class GT_MetaTileEntity_Extractor_Steel extends GT_MetaTileEntity_BasicMachine_Steel { public GT_MetaTileEntity_Extractor_Steel(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, "Extracting your first Rubber", 1, 1, true); @@ -28,7 +28,12 @@ public class GT_MetaTileEntity_Extractor_Steel extends GT_MetaTileEntity_BasicMa @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "SteelExtractor.png", GT_Recipe.GT_Recipe_Map.sExtractorRecipes.mUnlocalizedName); + return new GT_GUIContainer_BasicMachine( + aPlayerInventory, + aBaseMetaTileEntity, + getLocalName(), + "SteelExtractor.png", + GT_Recipe.GT_Recipe_Map.sExtractorRecipes.mUnlocalizedName); } @Override @@ -56,65 +61,97 @@ public class GT_MetaTileEntity_Extractor_Steel extends GT_MetaTileEntity_BasicMa @Override public ITexture[] getSideFacingActive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getSideFacingActive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_EXTRACTOR_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_SIDE_STEAM_EXTRACTOR_ACTIVE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_STEAM_EXTRACTOR_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getSideFacingInactive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getSideFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_EXTRACTOR), - TextureFactory.builder().addIcon(OVERLAY_SIDE_STEAM_EXTRACTOR_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_STEAM_EXTRACTOR_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getFrontFacingActive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getFrontFacingActive(aColor)[0], TextureFactory.of(OVERLAY_FRONT_STEAM_EXTRACTOR_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_FRONT_STEAM_EXTRACTOR_ACTIVE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_STEAM_EXTRACTOR_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getFrontFacingInactive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getFrontFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_FRONT_STEAM_EXTRACTOR), - TextureFactory.builder().addIcon(OVERLAY_FRONT_STEAM_EXTRACTOR_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_STEAM_EXTRACTOR_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getTopFacingActive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getTopFacingActive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_EXTRACTOR_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_TOP_STEAM_EXTRACTOR_ACTIVE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_TOP_STEAM_EXTRACTOR_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getTopFacingInactive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getTopFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_EXTRACTOR), - TextureFactory.builder().addIcon(OVERLAY_TOP_STEAM_EXTRACTOR_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_TOP_STEAM_EXTRACTOR_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getBottomFacingActive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getBottomFacingActive(aColor)[0], TextureFactory.of(OVERLAY_BOTTOM_STEAM_EXTRACTOR_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_BOTTOM_STEAM_EXTRACTOR_ACTIVE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_STEAM_EXTRACTOR_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getBottomFacingInactive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getBottomFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_BOTTOM_STEAM_EXTRACTOR), - TextureFactory.builder().addIcon(OVERLAY_BOTTOM_STEAM_EXTRACTOR_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_STEAM_EXTRACTOR_GLOW) + .glow() + .build() + }; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Bronze.java index eb2b91416c..a22d1cb3e3 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Bronze.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Bronze.java @@ -1,5 +1,8 @@ package gregtech.common.tileentities.machines.steam; +import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.api.objects.XSTR.XSTR_INSTANCE; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.ParticleFX; @@ -17,9 +20,6 @@ import net.minecraft.block.Block; import net.minecraft.entity.player.InventoryPlayer; import net.minecraftforge.common.util.ForgeDirection; -import static gregtech.api.enums.Textures.BlockIcons.*; -import static gregtech.api.objects.XSTR.XSTR_INSTANCE; - public class GT_MetaTileEntity_ForgeHammer_Bronze extends GT_MetaTileEntity_BasicMachine_Bronze { public GT_MetaTileEntity_ForgeHammer_Bronze(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, "Forge Hammer", 1, 1, false); @@ -40,7 +40,14 @@ public class GT_MetaTileEntity_ForgeHammer_Bronze extends GT_MetaTileEntity_Basi @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "BronzeHammer.png", GT_Recipe.GT_Recipe_Map.sHammerRecipes.mUnlocalizedName, (byte) 6, (byte) 3); + return new GT_GUIContainer_BasicMachine( + aPlayerInventory, + aBaseMetaTileEntity, + getLocalName(), + "BronzeHammer.png", + GT_Recipe.GT_Recipe_Map.sHammerRecipes.mUnlocalizedName, + (byte) 6, + (byte) 3); } @Override @@ -63,66 +70,98 @@ public class GT_MetaTileEntity_ForgeHammer_Bronze extends GT_MetaTileEntity_Basi @Override public ITexture[] getSideFacingActive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getSideFacingActive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_HAMMER_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_SIDE_STEAM_HAMMER_ACTIVE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_STEAM_HAMMER_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getSideFacingInactive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getSideFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_HAMMER), - TextureFactory.builder().addIcon(OVERLAY_SIDE_STEAM_HAMMER_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_STEAM_HAMMER_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getFrontFacingActive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getFrontFacingActive(aColor)[0], TextureFactory.of(OVERLAY_FRONT_STEAM_HAMMER_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_FRONT_STEAM_HAMMER_ACTIVE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_STEAM_HAMMER_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getFrontFacingInactive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getFrontFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_FRONT_STEAM_HAMMER), - TextureFactory.builder().addIcon(OVERLAY_FRONT_STEAM_HAMMER_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_STEAM_HAMMER_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getTopFacingActive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getTopFacingActive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_HAMMER_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_TOP_STEAM_HAMMER_ACTIVE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_TOP_STEAM_HAMMER_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getTopFacingInactive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getTopFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_HAMMER), - TextureFactory.builder().addIcon(OVERLAY_TOP_STEAM_HAMMER_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_TOP_STEAM_HAMMER_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getBottomFacingActive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getBottomFacingActive(aColor)[0], TextureFactory.of(OVERLAY_BOTTOM_STEAM_HAMMER_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_BOTTOM_STEAM_HAMMER_ACTIVE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_STEAM_HAMMER_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getBottomFacingInactive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getBottomFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_BOTTOM_STEAM_HAMMER), - TextureFactory.builder().addIcon(OVERLAY_BOTTOM_STEAM_HAMMER_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_STEAM_HAMMER_GLOW) + .glow() + .build() + }; } /** @@ -141,8 +180,8 @@ public class GT_MetaTileEntity_ForgeHammer_Bronze extends GT_MetaTileEntity_Basi final byte mainFacing = (byte) this.mMainFacing; if (mainFacing > 1 - && aBaseMetaTileEntity.getCoverIDAtSide(mainFacing) == 0 - && !aBaseMetaTileEntity.getOpacityAtSide(mainFacing)) { + && aBaseMetaTileEntity.getCoverIDAtSide(mainFacing) == 0 + && !aBaseMetaTileEntity.getOpacityAtSide(mainFacing)) { final double oX = aBaseMetaTileEntity.getXCoord(); final double oY = aBaseMetaTileEntity.getYCoord(); @@ -177,8 +216,7 @@ public class GT_MetaTileEntity_ForgeHammer_Bronze extends GT_MetaTileEntity_Basi mZ = .05D; } - ParticleEventBuilder particleEventBuilder = - (new ParticleEventBuilder()) + ParticleEventBuilder particleEventBuilder = (new ParticleEventBuilder()) .setMotion(mX, 0, mZ) .setPosition(x, y, z) .setWorld(getBaseMetaTileEntity().getWorld()); diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Steel.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Steel.java index db31c74499..dd233aa6f2 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Steel.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Steel.java @@ -1,5 +1,8 @@ package gregtech.common.tileentities.machines.steam; +import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.api.objects.XSTR.XSTR_INSTANCE; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.ParticleFX; @@ -17,9 +20,6 @@ import net.minecraft.block.Block; import net.minecraft.entity.player.InventoryPlayer; import net.minecraftforge.common.util.ForgeDirection; -import static gregtech.api.enums.Textures.BlockIcons.*; -import static gregtech.api.objects.XSTR.XSTR_INSTANCE; - public class GT_MetaTileEntity_ForgeHammer_Steel extends GT_MetaTileEntity_BasicMachine_Steel { public GT_MetaTileEntity_ForgeHammer_Steel(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, "Forge Hammer", 1, 1, true); @@ -40,7 +40,14 @@ public class GT_MetaTileEntity_ForgeHammer_Steel extends GT_MetaTileEntity_Basic @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "SteelHammer.png", GT_Recipe.GT_Recipe_Map.sHammerRecipes.mUnlocalizedName, (byte) 6, (byte) 3); + return new GT_GUIContainer_BasicMachine( + aPlayerInventory, + aBaseMetaTileEntity, + getLocalName(), + "SteelHammer.png", + GT_Recipe.GT_Recipe_Map.sHammerRecipes.mUnlocalizedName, + (byte) 6, + (byte) 3); } @Override @@ -63,66 +70,98 @@ public class GT_MetaTileEntity_ForgeHammer_Steel extends GT_MetaTileEntity_Basic @Override public ITexture[] getSideFacingActive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getSideFacingActive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_HAMMER_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_SIDE_STEAM_HAMMER_ACTIVE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_STEAM_HAMMER_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getSideFacingInactive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getSideFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_HAMMER), - TextureFactory.builder().addIcon(OVERLAY_SIDE_STEAM_HAMMER_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_STEAM_HAMMER_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getFrontFacingActive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getFrontFacingActive(aColor)[0], TextureFactory.of(OVERLAY_FRONT_STEAM_HAMMER_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_FRONT_STEAM_HAMMER_ACTIVE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_STEAM_HAMMER_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getFrontFacingInactive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getFrontFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_FRONT_STEAM_HAMMER), - TextureFactory.builder().addIcon(OVERLAY_FRONT_STEAM_HAMMER_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_STEAM_HAMMER_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getTopFacingActive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getTopFacingActive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_HAMMER_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_TOP_STEAM_HAMMER_ACTIVE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_TOP_STEAM_HAMMER_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getTopFacingInactive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getTopFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_HAMMER), - TextureFactory.builder().addIcon(OVERLAY_TOP_STEAM_HAMMER_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_TOP_STEAM_HAMMER_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getBottomFacingActive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getBottomFacingActive(aColor)[0], TextureFactory.of(OVERLAY_BOTTOM_STEAM_HAMMER_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_BOTTOM_STEAM_HAMMER_ACTIVE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_STEAM_HAMMER_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getBottomFacingInactive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getBottomFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_BOTTOM_STEAM_HAMMER), - TextureFactory.builder().addIcon(OVERLAY_BOTTOM_STEAM_HAMMER_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_STEAM_HAMMER_GLOW) + .glow() + .build() + }; } /** @@ -141,8 +180,8 @@ public class GT_MetaTileEntity_ForgeHammer_Steel extends GT_MetaTileEntity_Basic final byte mainFacing = (byte) this.mMainFacing; if (mainFacing > 1 - && aBaseMetaTileEntity.getCoverIDAtSide(mainFacing) == 0 - && !aBaseMetaTileEntity.getOpacityAtSide(mainFacing)) { + && aBaseMetaTileEntity.getCoverIDAtSide(mainFacing) == 0 + && !aBaseMetaTileEntity.getOpacityAtSide(mainFacing)) { final double oX = aBaseMetaTileEntity.getXCoord(); final double oY = aBaseMetaTileEntity.getYCoord(); @@ -177,8 +216,7 @@ public class GT_MetaTileEntity_ForgeHammer_Steel extends GT_MetaTileEntity_Basic mZ = .05D; } - ParticleEventBuilder particleEventBuilder = - (new ParticleEventBuilder()) + ParticleEventBuilder particleEventBuilder = (new ParticleEventBuilder()) .setMotion(mX, 0, mZ) .setPosition(x, y, z) .setWorld(getBaseMetaTileEntity().getWorld()); diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Bronze.java index 0a8ed8a6fd..cd99dda2e2 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Bronze.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Bronze.java @@ -1,5 +1,7 @@ package gregtech.common.tileentities.machines.steam; +import static gregtech.api.enums.Textures.BlockIcons.*; + import gregtech.api.enums.SoundResource; import gregtech.api.gui.GT_GUIContainer_BasicMachine; import gregtech.api.interfaces.ITexture; @@ -12,8 +14,6 @@ import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; -import static gregtech.api.enums.Textures.BlockIcons.*; - public class GT_MetaTileEntity_Furnace_Bronze extends GT_MetaTileEntity_BasicMachine_Bronze { public GT_MetaTileEntity_Furnace_Bronze(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, "Smelting things with compressed Steam", 1, 1, false); @@ -34,7 +34,8 @@ public class GT_MetaTileEntity_Furnace_Bronze extends GT_MetaTileEntity_BasicMac @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "BronzeFurnace.png", "smelting"); + return new GT_GUIContainer_BasicMachine( + aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "BronzeFurnace.png", "smelting"); } @Override @@ -53,8 +54,10 @@ public class GT_MetaTileEntity_Furnace_Bronze extends GT_MetaTileEntity_BasicMac } @Override - protected boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - return super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack) && GT_ModHandler.getSmeltingOutput(GT_Utility.copyAmount(64L, aStack), false, null) != null; + protected boolean allowPutStackValidated( + IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack) + && GT_ModHandler.getSmeltingOutput(GT_Utility.copyAmount(64L, aStack), false, null) != null; } @Override @@ -72,66 +75,98 @@ public class GT_MetaTileEntity_Furnace_Bronze extends GT_MetaTileEntity_BasicMac @Override public ITexture[] getSideFacingActive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getSideFacingActive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_FURNACE_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_SIDE_STEAM_FURNACE_ACTIVE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_STEAM_FURNACE_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getSideFacingInactive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getSideFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_FURNACE), - TextureFactory.builder().addIcon(OVERLAY_SIDE_STEAM_FURNACE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_STEAM_FURNACE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getFrontFacingActive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getFrontFacingActive(aColor)[0], TextureFactory.of(OVERLAY_FRONT_STEAM_FURNACE_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_FRONT_STEAM_FURNACE_ACTIVE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_STEAM_FURNACE_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getFrontFacingInactive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getFrontFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_FRONT_STEAM_FURNACE), - TextureFactory.builder().addIcon(OVERLAY_FRONT_STEAM_FURNACE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_STEAM_FURNACE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getTopFacingActive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getTopFacingActive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_FURNACE_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_BOTTOM_STEAM_FURNACE_ACTIVE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_STEAM_FURNACE_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getTopFacingInactive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getTopFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_FURNACE), - TextureFactory.builder().addIcon(OVERLAY_TOP_STEAM_FURNACE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_TOP_STEAM_FURNACE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getBottomFacingActive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getBottomFacingActive(aColor)[0], TextureFactory.of(OVERLAY_BOTTOM_STEAM_FURNACE_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_BOTTOM_STEAM_FURNACE_ACTIVE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_STEAM_FURNACE_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getBottomFacingInactive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getBottomFacingInactive(aColor)[0], TextureFactory.of( - TextureFactory.of(OVERLAY_BOTTOM_STEAM_FURNACE), - TextureFactory.builder().addIcon(OVERLAY_BOTTOM_STEAM_FURNACE_GLOW).glow().build())}; + TextureFactory.of(OVERLAY_BOTTOM_STEAM_FURNACE), + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_STEAM_FURNACE_GLOW) + .glow() + .build()) + }; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Steel.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Steel.java index a4c76773a5..3bc35d8c47 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Steel.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Steel.java @@ -1,5 +1,7 @@ package gregtech.common.tileentities.machines.steam; +import static gregtech.api.enums.Textures.BlockIcons.*; + import gregtech.api.enums.SoundResource; import gregtech.api.gui.GT_GUIContainer_BasicMachine; import gregtech.api.interfaces.ITexture; @@ -12,8 +14,6 @@ import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; -import static gregtech.api.enums.Textures.BlockIcons.*; - public class GT_MetaTileEntity_Furnace_Steel extends GT_MetaTileEntity_BasicMachine_Steel { public GT_MetaTileEntity_Furnace_Steel(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, "Smelting things with compressed Steam", 1, 1, true); @@ -34,7 +34,8 @@ public class GT_MetaTileEntity_Furnace_Steel extends GT_MetaTileEntity_BasicMach @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "SteelFurnace.png", "smelting"); + return new GT_GUIContainer_BasicMachine( + aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "SteelFurnace.png", "smelting"); } @Override @@ -53,8 +54,10 @@ public class GT_MetaTileEntity_Furnace_Steel extends GT_MetaTileEntity_BasicMach } @Override - protected boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - return super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack) && GT_ModHandler.getSmeltingOutput(GT_Utility.copyAmount(64L, aStack), false, null) != null; + protected boolean allowPutStackValidated( + IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack) + && GT_ModHandler.getSmeltingOutput(GT_Utility.copyAmount(64L, aStack), false, null) != null; } @Override @@ -72,65 +75,97 @@ public class GT_MetaTileEntity_Furnace_Steel extends GT_MetaTileEntity_BasicMach @Override public ITexture[] getSideFacingActive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getSideFacingActive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_FURNACE_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_SIDE_STEAM_FURNACE_ACTIVE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_STEAM_FURNACE_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getSideFacingInactive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getSideFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_FURNACE), - TextureFactory.builder().addIcon(OVERLAY_SIDE_STEAM_FURNACE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_STEAM_FURNACE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getFrontFacingActive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getFrontFacingActive(aColor)[0], TextureFactory.of(OVERLAY_FRONT_STEAM_FURNACE_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_FRONT_STEAM_FURNACE_ACTIVE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_STEAM_FURNACE_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getFrontFacingInactive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getFrontFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_FRONT_STEAM_FURNACE), - TextureFactory.builder().addIcon(OVERLAY_FRONT_STEAM_FURNACE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_STEAM_FURNACE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getTopFacingActive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getTopFacingActive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_FURNACE_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_BOTTOM_STEAM_FURNACE_ACTIVE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_STEAM_FURNACE_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getTopFacingInactive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getTopFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_FURNACE), - TextureFactory.builder().addIcon(OVERLAY_TOP_STEAM_FURNACE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_TOP_STEAM_FURNACE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getBottomFacingActive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getBottomFacingActive(aColor)[0], TextureFactory.of(OVERLAY_BOTTOM_STEAM_FURNACE_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_BOTTOM_STEAM_FURNACE_ACTIVE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_STEAM_FURNACE_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getBottomFacingInactive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getBottomFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_BOTTOM_STEAM_FURNACE), - TextureFactory.builder().addIcon(OVERLAY_BOTTOM_STEAM_FURNACE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_STEAM_FURNACE_GLOW) + .glow() + .build() + }; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Bronze.java index fe107957bf..f6f5bf8477 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Bronze.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Bronze.java @@ -1,5 +1,9 @@ package gregtech.common.tileentities.machines.steam; +import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.api.objects.XSTR.XSTR_INSTANCE; + import gregtech.api.enums.ParticleFX; import gregtech.api.enums.SoundResource; import gregtech.api.gui.GT_GUIContainer_BasicMachine; @@ -17,10 +21,6 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; -import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.enums.Textures.BlockIcons.*; -import static gregtech.api.objects.XSTR.XSTR_INSTANCE; - public class GT_MetaTileEntity_Macerator_Bronze extends GT_MetaTileEntity_BasicMachine_Bronze { public GT_MetaTileEntity_Macerator_Bronze(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, "Macerating your Ores", 1, 1, false); @@ -36,7 +36,12 @@ public class GT_MetaTileEntity_Macerator_Bronze extends GT_MetaTileEntity_BasicM @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "BronzeMacerator.png", GT_Recipe_Map.sMaceratorRecipes.mUnlocalizedName); + return new GT_GUIContainer_BasicMachine( + aPlayerInventory, + aBaseMetaTileEntity, + getLocalName(), + "BronzeMacerator.png", + GT_Recipe_Map.sMaceratorRecipes.mUnlocalizedName); } @Override @@ -52,19 +57,18 @@ public class GT_MetaTileEntity_Macerator_Bronze extends GT_MetaTileEntity_BasicM final byte topFacing = (byte) ForgeDirection.UP.ordinal(); if (aBaseMetaTileEntity.getFrontFacing() != topFacing - && aBaseMetaTileEntity.getCoverIDAtSide(topFacing) == 0 - && !aBaseMetaTileEntity.getOpacityAtSide(topFacing)) { + && aBaseMetaTileEntity.getCoverIDAtSide(topFacing) == 0 + && !aBaseMetaTileEntity.getOpacityAtSide(topFacing)) { new ParticleEventBuilder() - .setMotion(0.0D, 0.0D, 0.0D) - .setIdentifier(ParticleFX.SMOKE) - .setPosition( - aBaseMetaTileEntity.getXCoord() + 0.8F - XSTR_INSTANCE.nextFloat() * 0.6F, - aBaseMetaTileEntity.getYCoord() + 0.9F + XSTR_INSTANCE.nextFloat() * 0.2F, - aBaseMetaTileEntity.getZCoord() + 0.8F - XSTR_INSTANCE.nextFloat() * 0.6F - ) - .setWorld(getBaseMetaTileEntity().getWorld()) - .run(); + .setMotion(0.0D, 0.0D, 0.0D) + .setIdentifier(ParticleFX.SMOKE) + .setPosition( + aBaseMetaTileEntity.getXCoord() + 0.8F - XSTR_INSTANCE.nextFloat() * 0.6F, + aBaseMetaTileEntity.getYCoord() + 0.9F + XSTR_INSTANCE.nextFloat() * 0.2F, + aBaseMetaTileEntity.getZCoord() + 0.8F - XSTR_INSTANCE.nextFloat() * 0.6F) + .setWorld(getBaseMetaTileEntity().getWorld()) + .run(); } } } @@ -76,7 +80,8 @@ public class GT_MetaTileEntity_Macerator_Bronze extends GT_MetaTileEntity_BasicM @Override public int checkRecipe() { - GT_Recipe tRecipe = getRecipeList().findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, V[mTier], null, null, getAllInputs()); + GT_Recipe tRecipe = getRecipeList() + .findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, V[mTier], null, null, getAllInputs()); if (tRecipe == null) return DID_NOT_FIND_RECIPE; if (tRecipe.mCanBeBuffered) mLastRecipe = tRecipe; if (!canOutput(tRecipe)) { @@ -84,7 +89,7 @@ public class GT_MetaTileEntity_Macerator_Bronze extends GT_MetaTileEntity_BasicM return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; } - if (!tRecipe.isRecipeInputEqual(true, new FluidStack[]{getFillableStack()}, getAllInputs())) + if (!tRecipe.isRecipeInputEqual(true, new FluidStack[] {getFillableStack()}, getAllInputs())) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; if (tRecipe.getOutput(0) != null) mOutputItems[0] = tRecipe.getOutput(0); calculateOverclockedNess(tRecipe); @@ -92,8 +97,10 @@ public class GT_MetaTileEntity_Macerator_Bronze extends GT_MetaTileEntity_BasicM } @Override - protected boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - return super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack) && GT_Recipe_Map.sMaceratorRecipes.containsInput(GT_Utility.copyAmount(64L, aStack)); + protected boolean allowPutStackValidated( + IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack) + && GT_Recipe_Map.sMaceratorRecipes.containsInput(GT_Utility.copyAmount(64L, aStack)); } @Override @@ -111,65 +118,97 @@ public class GT_MetaTileEntity_Macerator_Bronze extends GT_MetaTileEntity_BasicM @Override public ITexture[] getSideFacingActive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getSideFacingActive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_MACERATOR_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_SIDE_STEAM_MACERATOR_ACTIVE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_STEAM_MACERATOR_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getSideFacingInactive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getSideFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_MACERATOR), - TextureFactory.builder().addIcon(OVERLAY_SIDE_STEAM_MACERATOR_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_STEAM_MACERATOR_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getFrontFacingActive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getFrontFacingActive(aColor)[0], TextureFactory.of(OVERLAY_FRONT_STEAM_MACERATOR_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_FRONT_STEAM_MACERATOR_ACTIVE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_STEAM_MACERATOR_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getFrontFacingInactive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getFrontFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_FRONT_STEAM_MACERATOR), - TextureFactory.builder().addIcon(OVERLAY_FRONT_STEAM_MACERATOR_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_STEAM_MACERATOR_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getTopFacingActive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getTopFacingActive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_MACERATOR_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_TOP_STEAM_MACERATOR_ACTIVE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_TOP_STEAM_MACERATOR_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getTopFacingInactive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getTopFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_MACERATOR), - TextureFactory.builder().addIcon(OVERLAY_TOP_STEAM_MACERATOR_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_TOP_STEAM_MACERATOR_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getBottomFacingActive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getBottomFacingActive(aColor)[0], TextureFactory.of(OVERLAY_BOTTOM_STEAM_MACERATOR_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_BOTTOM_STEAM_MACERATOR_ACTIVE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_STEAM_MACERATOR_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getBottomFacingInactive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getBottomFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_BOTTOM_STEAM_MACERATOR), - TextureFactory.builder().addIcon(OVERLAY_BOTTOM_STEAM_MACERATOR_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_STEAM_MACERATOR_GLOW) + .glow() + .build() + }; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Steel.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Steel.java index 638419034e..14acdb9b45 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Steel.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Steel.java @@ -1,5 +1,9 @@ package gregtech.common.tileentities.machines.steam; +import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.api.objects.XSTR.XSTR_INSTANCE; + import gregtech.api.enums.ParticleFX; import gregtech.api.enums.SoundResource; import gregtech.api.gui.GT_GUIContainer_BasicMachine; @@ -17,10 +21,6 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; -import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.enums.Textures.BlockIcons.*; -import static gregtech.api.objects.XSTR.XSTR_INSTANCE; - public class GT_MetaTileEntity_Macerator_Steel extends GT_MetaTileEntity_BasicMachine_Steel { public GT_MetaTileEntity_Macerator_Steel(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, "Macerating your Ores", 1, 1, true); @@ -36,7 +36,12 @@ public class GT_MetaTileEntity_Macerator_Steel extends GT_MetaTileEntity_BasicMa @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "SteelMacerator.png", GT_Recipe_Map.sMaceratorRecipes.mUnlocalizedName); + return new GT_GUIContainer_BasicMachine( + aPlayerInventory, + aBaseMetaTileEntity, + getLocalName(), + "SteelMacerator.png", + GT_Recipe_Map.sMaceratorRecipes.mUnlocalizedName); } @Override @@ -52,19 +57,18 @@ public class GT_MetaTileEntity_Macerator_Steel extends GT_MetaTileEntity_BasicMa final byte topFacing = (byte) ForgeDirection.UP.ordinal(); if (aBaseMetaTileEntity.getFrontFacing() != topFacing - && aBaseMetaTileEntity.getCoverIDAtSide(topFacing) == 0 - && !aBaseMetaTileEntity.getOpacityAtSide(topFacing)) { + && aBaseMetaTileEntity.getCoverIDAtSide(topFacing) == 0 + && !aBaseMetaTileEntity.getOpacityAtSide(topFacing)) { new WorldSpawnedEventBuilder.ParticleEventBuilder() - .setMotion(0.0D, 0.0D, 0.0D) - .setIdentifier(ParticleFX.SMOKE) - .setPosition( - aBaseMetaTileEntity.getXCoord() + 0.8F - XSTR_INSTANCE.nextFloat() * 0.6F, - aBaseMetaTileEntity.getYCoord() + 0.9F + XSTR_INSTANCE.nextFloat() * 0.2F, - aBaseMetaTileEntity.getZCoord() + 0.8F - XSTR_INSTANCE.nextFloat() * 0.6F - ) - .setWorld(getBaseMetaTileEntity().getWorld()) - .run(); + .setMotion(0.0D, 0.0D, 0.0D) + .setIdentifier(ParticleFX.SMOKE) + .setPosition( + aBaseMetaTileEntity.getXCoord() + 0.8F - XSTR_INSTANCE.nextFloat() * 0.6F, + aBaseMetaTileEntity.getYCoord() + 0.9F + XSTR_INSTANCE.nextFloat() * 0.2F, + aBaseMetaTileEntity.getZCoord() + 0.8F - XSTR_INSTANCE.nextFloat() * 0.6F) + .setWorld(getBaseMetaTileEntity().getWorld()) + .run(); } } } @@ -76,7 +80,8 @@ public class GT_MetaTileEntity_Macerator_Steel extends GT_MetaTileEntity_BasicMa @Override public int checkRecipe() { - GT_Recipe tRecipe = getRecipeList().findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, V[mTier], null, null, getAllInputs()); + GT_Recipe tRecipe = getRecipeList() + .findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, V[mTier], null, null, getAllInputs()); if (tRecipe == null) return DID_NOT_FIND_RECIPE; if (tRecipe.mCanBeBuffered) mLastRecipe = tRecipe; if (!canOutput(tRecipe)) { @@ -84,7 +89,7 @@ public class GT_MetaTileEntity_Macerator_Steel extends GT_MetaTileEntity_BasicMa return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; } - if (!tRecipe.isRecipeInputEqual(true, new FluidStack[]{getFillableStack()}, getAllInputs())) + if (!tRecipe.isRecipeInputEqual(true, new FluidStack[] {getFillableStack()}, getAllInputs())) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; if (tRecipe.getOutput(0) != null) mOutputItems[0] = tRecipe.getOutput(0); calculateOverclockedNess(tRecipe); @@ -92,8 +97,10 @@ public class GT_MetaTileEntity_Macerator_Steel extends GT_MetaTileEntity_BasicMa } @Override - public boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - return super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack) && GT_Recipe_Map.sMaceratorRecipes.containsInput(GT_Utility.copyAmount(64L, aStack)); + public boolean allowPutStackValidated( + IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack) + && GT_Recipe_Map.sMaceratorRecipes.containsInput(GT_Utility.copyAmount(64L, aStack)); } @Override @@ -111,60 +118,97 @@ public class GT_MetaTileEntity_Macerator_Steel extends GT_MetaTileEntity_BasicMa @Override public ITexture[] getSideFacingActive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getSideFacingActive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_MACERATOR_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_SIDE_STEAM_MACERATOR_ACTIVE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_STEAM_MACERATOR_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getSideFacingInactive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getSideFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_MACERATOR), - TextureFactory.builder().addIcon(OVERLAY_SIDE_STEAM_MACERATOR_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_STEAM_MACERATOR_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getFrontFacingActive(byte aColor) { - return new ITexture[]{ + return new ITexture[] { super.getFrontFacingActive(aColor)[0], TextureFactory.of(OVERLAY_FRONT_STEAM_MACERATOR_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_FRONT_STEAM_MACERATOR_ACTIVE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_STEAM_MACERATOR_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getFrontFacingInactive(byte aColor) { - return new ITexture[]{super.getFrontFacingInactive(aColor)[0], + return new ITexture[] { + super.getFrontFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_FRONT_STEAM_MACERATOR), - TextureFactory.builder().addIcon(OVERLAY_FRONT_STEAM_MACERATOR_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_STEAM_MACERATOR_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getTopFacingActive(byte aColor) { - return new ITexture[]{super.getTopFacingActive(aColor)[0], + return new ITexture[] { + super.getTopFacingActive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_MACERATOR_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_TOP_STEAM_MACERATOR_ACTIVE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_TOP_STEAM_MACERATOR_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getTopFacingInactive(byte aColor) { - return new ITexture[]{super.getTopFacingInactive(aColor)[0], + return new ITexture[] { + super.getTopFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_MACERATOR), - TextureFactory.builder().addIcon(OVERLAY_TOP_STEAM_MACERATOR_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_TOP_STEAM_MACERATOR_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getBottomFacingActive(byte aColor) { - return new ITexture[]{super.getBottomFacingActive(aColor)[0], + return new ITexture[] { + super.getBottomFacingActive(aColor)[0], TextureFactory.of(OVERLAY_BOTTOM_STEAM_MACERATOR_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_BOTTOM_STEAM_MACERATOR_ACTIVE_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_STEAM_MACERATOR_ACTIVE_GLOW) + .glow() + .build() + }; } @Override public ITexture[] getBottomFacingInactive(byte aColor) { - return new ITexture[]{super.getBottomFacingInactive(aColor)[0], + return new ITexture[] { + super.getBottomFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_BOTTOM_STEAM_MACERATOR), - TextureFactory.builder().addIcon(OVERLAY_BOTTOM_STEAM_MACERATOR_GLOW).glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_STEAM_MACERATOR_GLOW) + .glow() + .build() + }; } } diff --git a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java index ffd1fd0e4a..8c844b8071 100644 --- a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java +++ b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java @@ -1,5 +1,9 @@ package gregtech.common.tileentities.storage; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_SCHEST; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_SCHEST_GLOW; + import cpw.mods.fml.common.Optional; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; @@ -11,6 +15,8 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Utility; import gregtech.common.gui.GT_Container_QuantumChest; import gregtech.common.gui.GT_GUIContainer_QuantumChest; +import java.util.HashMap; +import java.util.Map; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; @@ -18,26 +24,21 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; -import java.util.HashMap; -import java.util.Map; - -import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_SCHEST; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_SCHEST_GLOW; - @Optional.Interface(iface = "appeng.api.storage.IMEMonitor", modid = "appliedenergistics2", striprefs = true) -public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEntity_TieredMachineBlock implements appeng.api.storage.IMEMonitor<appeng.api.storage.data.IAEItemStack> { +public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEntity_TieredMachineBlock + implements appeng.api.storage.IMEMonitor<appeng.api.storage.data.IAEItemStack> { protected boolean mVoidOverflow = false; public boolean voidBreak; - private Map<appeng.api.storage.IMEMonitorHandlerReceiver<appeng.api.storage.data.IAEItemStack>, Object> listeners = null; + private Map<appeng.api.storage.IMEMonitorHandlerReceiver<appeng.api.storage.data.IAEItemStack>, Object> listeners = + null; public GT_MetaTileEntity_DigitalChestBase(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 3, new String[]{ - "This Chest stores " + GT_Utility.formatNumbers(commonSizeCompute(aTier)) + " Blocks", - "Use a screwdriver to enable", - "voiding items on overflow", - "Can keep its contents when harvested", - "Sneak when harvesting to void its contents" + super(aID, aName, aNameRegional, aTier, 3, new String[] { + "This Chest stores " + GT_Utility.formatNumbers(commonSizeCompute(aTier)) + " Blocks", + "Use a screwdriver to enable", + "voiding items on overflow", + "Can keep its contents when harvested", + "Sneak when harvesting to void its contents" }); } @@ -72,28 +73,35 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti super(aName, aTier, 3, aDescription, aTextures); } - public GT_MetaTileEntity_DigitalChestBase(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_DigitalChestBase( + String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, 3, aDescription, aTextures); } @Optional.Method(modid = "appliedenergistics2") public static void registerAEIntegration() { - appeng.api.AEApi.instance().registries().externalStorage().addExternalStorageInterface(new AE2DigitalChestHandler()); + appeng.api.AEApi.instance() + .registries() + .externalStorage() + .addExternalStorageInterface(new AE2DigitalChestHandler()); } @Optional.Method(modid = "appliedenergistics2") @Override - public void addListener(appeng.api.storage.IMEMonitorHandlerReceiver<appeng.api.storage.data.IAEItemStack> imeMonitorHandlerReceiver, Object o) { - if (listeners == null) - listeners = new HashMap<>(); + public void addListener( + appeng.api.storage.IMEMonitorHandlerReceiver<appeng.api.storage.data.IAEItemStack> + imeMonitorHandlerReceiver, + Object o) { + if (listeners == null) listeners = new HashMap<>(); listeners.put(imeMonitorHandlerReceiver, o); } @Optional.Method(modid = "appliedenergistics2") @Override - public void removeListener(appeng.api.storage.IMEMonitorHandlerReceiver<appeng.api.storage.data.IAEItemStack> imeMonitorHandlerReceiver) { - if (listeners == null) - listeners = new HashMap<>(); + public void removeListener( + appeng.api.storage.IMEMonitorHandlerReceiver<appeng.api.storage.data.IAEItemStack> + imeMonitorHandlerReceiver) { + if (listeners == null) listeners = new HashMap<>(); listeners.remove(imeMonitorHandlerReceiver); } @@ -107,8 +115,7 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti @Override public boolean isPrioritized(appeng.api.storage.data.IAEItemStack iaeItemStack) { ItemStack s = getItemStack(); - if (s == null || iaeItemStack == null) - return false; + if (s == null || iaeItemStack == null) return false; return iaeItemStack.isSameType(s); } @@ -116,8 +123,7 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti @Override public boolean canAccept(appeng.api.storage.data.IAEItemStack iaeItemStack) { ItemStack s = getItemStack(); - if (s == null || iaeItemStack == null) - return true; + if (s == null || iaeItemStack == null) return true; return iaeItemStack.isSameType(s); } @@ -145,7 +151,8 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti @Override @Optional.Method(modid = "appliedenergistics2") - public appeng.api.storage.data.IItemList<appeng.api.storage.data.IAEItemStack> getAvailableItems(final appeng.api.storage.data.IItemList out) { + public appeng.api.storage.data.IItemList<appeng.api.storage.data.IAEItemStack> getAvailableItems( + final appeng.api.storage.data.IItemList out) { ItemStack storedStack = getItemStack(); if (storedStack != null) { appeng.util.item.AEItemStack s = appeng.util.item.AEItemStack.create(storedStack); @@ -195,12 +202,13 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti @Override @Optional.Method(modid = "appliedenergistics2") - public appeng.api.storage.data.IAEItemStack injectItems(final appeng.api.storage.data.IAEItemStack input, final appeng.api.config.Actionable mode, final appeng.api.networking.security.BaseActionSource src) { + public appeng.api.storage.data.IAEItemStack injectItems( + final appeng.api.storage.data.IAEItemStack input, + final appeng.api.config.Actionable mode, + final appeng.api.networking.security.BaseActionSource src) { final ItemStack inputStack = input.getItemStack(); - if (inputStack == null) - return null; - if (getBaseMetaTileEntity() == null) - return input; + if (inputStack == null) return null; + if (getBaseMetaTileEntity() == null) return input; if (mode != appeng.api.config.Actionable.SIMULATE) getBaseMetaTileEntity().markDirty(); ItemStack storedStack = getItemStack(); @@ -208,8 +216,7 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti if (GT_Utility.areStacksEqual(storedStack, inputStack)) { if (input.getStackSize() + getItemCount() > getMaxItemCount()) { if (mVoidOverflow) { - if (mode != appeng.api.config.Actionable.SIMULATE) - setItemCount(getMaxItemCount()); + if (mode != appeng.api.config.Actionable.SIMULATE) setItemCount(getMaxItemCount()); return null; } return createOverflowStack(input.getStackSize() + getItemCount(), mode); @@ -220,12 +227,9 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti } return input; } - if (mode != appeng.api.config.Actionable.SIMULATE) - setItemStack(inputStack.copy()); - if (input.getStackSize() > getMaxItemCount()) - return createOverflowStack(input.getStackSize(), mode); - if (mode != appeng.api.config.Actionable.SIMULATE) - setItemCount((int) input.getStackSize()); + if (mode != appeng.api.config.Actionable.SIMULATE) setItemStack(inputStack.copy()); + if (input.getStackSize() > getMaxItemCount()) return createOverflowStack(input.getStackSize(), mode); + if (mode != appeng.api.config.Actionable.SIMULATE) setItemCount((int) input.getStackSize()); return null; } @@ -233,24 +237,24 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti private appeng.api.storage.data.IAEItemStack createOverflowStack(long size, appeng.api.config.Actionable mode) { final appeng.api.storage.data.IAEItemStack overflow = appeng.util.item.AEItemStack.create(getItemStack()); overflow.setStackSize(size - getMaxItemCount()); - if (mode != appeng.api.config.Actionable.SIMULATE) - setItemCount(getMaxItemCount()); + if (mode != appeng.api.config.Actionable.SIMULATE) setItemCount(getMaxItemCount()); return overflow; } @Override @Optional.Method(modid = "appliedenergistics2") - public appeng.api.storage.data.IAEItemStack extractItems(final appeng.api.storage.data.IAEItemStack request, final appeng.api.config.Actionable mode, final appeng.api.networking.security.BaseActionSource src) { + public appeng.api.storage.data.IAEItemStack extractItems( + final appeng.api.storage.data.IAEItemStack request, + final appeng.api.config.Actionable mode, + final appeng.api.networking.security.BaseActionSource src) { if (request.isSameType(getItemStack())) { - if (getBaseMetaTileEntity() == null) - return null; + if (getBaseMetaTileEntity() == null) return null; if (mode != appeng.api.config.Actionable.SIMULATE) getBaseMetaTileEntity().markDirty(); if (request.getStackSize() >= getItemCount()) { appeng.util.item.AEItemStack result = appeng.util.item.AEItemStack.create(getItemStack()); result.setStackSize(getItemCount()); - if (mode != appeng.api.config.Actionable.SIMULATE) - setItemCount(0); + if (mode != appeng.api.config.Actionable.SIMULATE) setItemCount(0); return result; } else { if (mode != appeng.api.config.Actionable.SIMULATE) @@ -270,7 +274,10 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti @Override public final void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { mVoidOverflow = !mVoidOverflow; - GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal(mVoidOverflow ? "GT5U.machines.voidoveflow.enabled" : "GT5U.machines.voidoveflow.disabled")); + GT_Utility.sendChatToPlayer( + aPlayer, + StatCollector.translateToLocal( + mVoidOverflow ? "GT5U.machines.voidoveflow.enabled" : "GT5U.machines.voidoveflow.disabled")); } @Override @@ -288,7 +295,9 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti ItemStack stack = getItemStack(); int savedCount = count; - if ((mInventory[0] != null) && ((count < getMaxItemCount()) || mVoidOverflow) && GT_Utility.areStacksEqual(mInventory[0], stack)) { + if ((mInventory[0] != null) + && ((count < getMaxItemCount()) || mVoidOverflow) + && GT_Utility.areStacksEqual(mInventory[0], stack)) { count += mInventory[0].stackSize; if (count <= getMaxItemCount()) { mInventory[0] = null; @@ -305,7 +314,9 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti mInventory[1] = stack.copy(); mInventory[1].stackSize = Math.min(stack.getMaxStackSize(), count); count -= mInventory[1].stackSize; - } else if ((count > 0) && GT_Utility.areStacksEqual(mInventory[1], stack) && mInventory[1].getMaxStackSize() > mInventory[1].stackSize) { + } else if ((count > 0) + && GT_Utility.areStacksEqual(mInventory[1], stack) + && mInventory[1].getMaxStackSize() > mInventory[1].stackSize) { int tmp = Math.min(count, mInventory[1].getMaxStackSize() - mInventory[1].stackSize); mInventory[1].stackSize += tmp; count -= tmp; @@ -318,10 +329,8 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti mInventory[2] = null; } - if (GregTech_API.mAE2) - notifyListeners(count - savedCount, stack); - if (count != savedCount) - getBaseMetaTileEntity().markDirty(); + if (GregTech_API.mAE2) notifyListeners(count - savedCount, stack); + if (count != savedCount) getBaseMetaTileEntity().markDirty(); } } @@ -359,7 +368,9 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti @Override public int getProgresstime() { - return getItemCount() + (mInventory[0] == null ? 0 : mInventory[0].stackSize) + (mInventory[1] == null ? 0 : mInventory[1].stackSize); + return getItemCount() + + (mInventory[0] == null ? 0 : mInventory[0].stackSize) + + (mInventory[1] == null ? 0 : mInventory[1].stackSize); } @Override @@ -376,20 +387,20 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti public String[] getInfoData() { if (getItemStack() == null) { - return new String[]{ - EnumChatFormatting.BLUE + chestName() + EnumChatFormatting.RESET, - "Stored Items:", - EnumChatFormatting.GOLD + "No Items" + EnumChatFormatting.RESET, - EnumChatFormatting.GREEN + "0" + EnumChatFormatting.RESET + " " + - EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(getMaxItemCount()) + EnumChatFormatting.RESET - }; - } - return new String[]{ + return new String[] { EnumChatFormatting.BLUE + chestName() + EnumChatFormatting.RESET, "Stored Items:", - EnumChatFormatting.GOLD + getItemStack().getDisplayName() + EnumChatFormatting.RESET, - EnumChatFormatting.GREEN + GT_Utility.formatNumbers(getItemCount()) + EnumChatFormatting.RESET + " " + - EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(getMaxItemCount()) + EnumChatFormatting.RESET + EnumChatFormatting.GOLD + "No Items" + EnumChatFormatting.RESET, + EnumChatFormatting.GREEN + "0" + EnumChatFormatting.RESET + " " + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(getMaxItemCount()) + EnumChatFormatting.RESET + }; + } + return new String[] { + EnumChatFormatting.BLUE + chestName() + EnumChatFormatting.RESET, + "Stored Items:", + EnumChatFormatting.GOLD + getItemStack().getDisplayName() + EnumChatFormatting.RESET, + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(getItemCount()) + EnumChatFormatting.RESET + " " + + EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(getMaxItemCount()) + EnumChatFormatting.RESET }; } @@ -406,31 +417,25 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti listeners = new HashMap<>(); return; } - if (count == 0 || stack == null) - return; + if (count == 0 || stack == null) return; appeng.util.item.ItemList change = new appeng.util.item.ItemList(); appeng.util.item.AEItemStack s = appeng.util.item.AEItemStack.create(stack); s.setStackSize(count); change.add(s); listeners.forEach((l, o) -> { - if (l.isValid(o)) - l.postChange(this, change, null); - else - removeListener(l); + if (l.isValid(o)) l.postChange(this, change, null); + else removeListener(l); }); } @Optional.Method(modid = "appliedenergistics2") private boolean hasActiveMEConnection() { - if (listeners == null || listeners.isEmpty()) - return false; - for (Map.Entry<appeng.api.storage.IMEMonitorHandlerReceiver<appeng.api.storage.data.IAEItemStack>, Object> e : listeners.entrySet()) - { - if ((e.getKey() instanceof appeng.api.parts.IPart)) - { + if (listeners == null || listeners.isEmpty()) return false; + for (Map.Entry<appeng.api.storage.IMEMonitorHandlerReceiver<appeng.api.storage.data.IAEItemStack>, Object> e : + listeners.entrySet()) { + if ((e.getKey() instanceof appeng.api.parts.IPart)) { appeng.api.networking.IGridNode n = ((appeng.api.parts.IPart) e.getKey()).getGridNode(); - if (n != null && n.isActive()) - return true; + if (n != null && n.isActive()) return true; } } // if there are no active storage buses - clear the listeners @@ -441,42 +446,43 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti @Override public void saveNBTData(NBTTagCompound aNBT) { aNBT.setInteger("mItemCount", getItemCount()); - if (getItemStack() != null) - aNBT.setTag("mItemStack", getItemStack().writeToNBT(new NBTTagCompound())); + if (getItemStack() != null) aNBT.setTag("mItemStack", getItemStack().writeToNBT(new NBTTagCompound())); aNBT.setBoolean("mVoidOverflow", mVoidOverflow); } @Override public void loadNBTData(NBTTagCompound aNBT) { - if (aNBT.hasKey("mItemCount")) - setItemCount(aNBT.getInteger("mItemCount")); + if (aNBT.hasKey("mItemCount")) setItemCount(aNBT.getInteger("mItemCount")); if (aNBT.hasKey("mItemStack")) setItemStack(ItemStack.loadItemStackFromNBT((NBTTagCompound) aNBT.getTag("mItemStack"))); mVoidOverflow = aNBT.getBoolean("mVoidOverflow"); - } @Override public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - if (GregTech_API.mAE2 && GT_Values.disableDigitalChestsExternalAccess && hasActiveMEConnection()) - return false; + if (GregTech_API.mAE2 && GT_Values.disableDigitalChestsExternalAccess && hasActiveMEConnection()) return false; return aIndex == 1; } @Override public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - if (GregTech_API.mAE2 && GT_Values.disableDigitalChestsExternalAccess && hasActiveMEConnection()) - return false; + if (GregTech_API.mAE2 && GT_Values.disableDigitalChestsExternalAccess && hasActiveMEConnection()) return false; return aIndex == 0 && (mInventory[0] == null || GT_Utility.areStacksEqual(mInventory[0], aStack)); } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - if (aSide != aFacing) return new ITexture[]{MACHINE_CASINGS[mTier][aColorIndex + 1]}; - return new ITexture[]{ - MACHINE_CASINGS[mTier][aColorIndex + 1], - TextureFactory.of(OVERLAY_SCHEST), - TextureFactory.builder().addIcon(OVERLAY_SCHEST_GLOW).glow().build() + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { + if (aSide != aFacing) return new ITexture[] {MACHINE_CASINGS[mTier][aColorIndex + 1]}; + return new ITexture[] { + MACHINE_CASINGS[mTier][aColorIndex + 1], + TextureFactory.of(OVERLAY_SCHEST), + TextureFactory.builder().addIcon(OVERLAY_SCHEST_GLOW).glow().build() }; } } diff --git a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalTankBase.java b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalTankBase.java index 2567a80252..6b2a9caf4b 100644 --- a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalTankBase.java +++ b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalTankBase.java @@ -1,5 +1,9 @@ package gregtech.common.tileentities.storage; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_QTANK; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_QTANK_GLOW; + import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank; @@ -13,17 +17,12 @@ import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidTankInfo; -import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_QTANK; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_QTANK_GLOW; - public abstract class GT_MetaTileEntity_DigitalTankBase extends GT_MetaTileEntity_BasicTank { protected boolean mVoidOverflow = false; private boolean voidBreak; - public GT_MetaTileEntity_DigitalTankBase(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 3, new String[]{ + super(aID, aName, aNameRegional, aTier, 3, new String[] { "Stores " + GT_Utility.formatNumbers(commonSizeCompute(aTier)) + "L of fluid", "Use a screwdriver to enable", "voiding fluid on overflow", @@ -59,7 +58,6 @@ public abstract class GT_MetaTileEntity_DigitalTankBase extends GT_MetaTileEntit } } - public GT_MetaTileEntity_DigitalTankBase(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, 3, aDescription, aTextures); } @@ -84,7 +82,6 @@ public abstract class GT_MetaTileEntity_DigitalTankBase extends GT_MetaTileEntit super.setItemNBT(aNBT); } - @Override public void saveNBTData(NBTTagCompound aNBT) { super.saveNBTData(aNBT); @@ -97,7 +94,6 @@ public abstract class GT_MetaTileEntity_DigitalTankBase extends GT_MetaTileEntit mVoidOverflow = aNBT.getBoolean("mVoidOverflow"); } - @Override public boolean isSimpleMachine() { return true; @@ -134,9 +130,15 @@ public abstract class GT_MetaTileEntity_DigitalTankBase extends GT_MetaTileEntit } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - if (aSide != ForgeDirection.UP.ordinal()) return new ITexture[]{MACHINE_CASINGS[mTier][aColorIndex + 1]}; - return new ITexture[]{ + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { + if (aSide != ForgeDirection.UP.ordinal()) return new ITexture[] {MACHINE_CASINGS[mTier][aColorIndex + 1]}; + return new ITexture[] { MACHINE_CASINGS[mTier][aColorIndex + 1], TextureFactory.of(OVERLAY_QTANK), TextureFactory.builder().addIcon(OVERLAY_QTANK_GLOW).glow().build() @@ -158,7 +160,10 @@ public abstract class GT_MetaTileEntity_DigitalTankBase extends GT_MetaTileEntit @Override public final void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { mVoidOverflow = !mVoidOverflow; - GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal(mVoidOverflow ? "GT5U.machines.voidoveflow.enabled" : "GT5U.machines.voidoveflow.disabled")); + GT_Utility.sendChatToPlayer( + aPlayer, + StatCollector.translateToLocal( + mVoidOverflow ? "GT5U.machines.voidoveflow.enabled" : "GT5U.machines.voidoveflow.disabled")); } @Override @@ -185,8 +190,7 @@ public abstract class GT_MetaTileEntity_DigitalTankBase extends GT_MetaTileEntit if (isFluidChangingAllowed() && getFillableStack() != null && getFillableStack().amount <= 0) setFillableStack(null); - if (mOpenerCount > 0) - updateFluidDisplayItem(); + if (mOpenerCount > 0) updateFluidDisplayItem(); if (doesEmptyContainers()) { FluidStack tFluid = GT_Utility.getFluidForFilledItem(mInventory[getInputSlot()], true); @@ -196,7 +200,10 @@ public abstract class GT_MetaTileEntity_DigitalTankBase extends GT_MetaTileEntit if ((tFluid.amount <= getRealCapacity()) || mVoidOverflow) { tFluid = tFluid.copy(); tFluid.amount = Math.min(tFluid.amount, getRealCapacity()); - if (aBaseMetaTileEntity.addStackToSlot(getOutputSlot(), GT_Utility.getContainerForFilledItem(mInventory[getInputSlot()], true), 1)) { + if (aBaseMetaTileEntity.addStackToSlot( + getOutputSlot(), + GT_Utility.getContainerForFilledItem(mInventory[getInputSlot()], true), + 1)) { setFillableStack(tFluid); this.onEmptyingContainerWhenEmpty(); aBaseMetaTileEntity.decrStackSize(getInputSlot(), 1); @@ -205,9 +212,14 @@ public abstract class GT_MetaTileEntity_DigitalTankBase extends GT_MetaTileEntit } } else { if (tFluid.isFluidEqual(getFillableStack())) { - if ((((long) tFluid.amount + getFillableStack().amount) <= (long) getRealCapacity()) || mVoidOverflow) { - if (aBaseMetaTileEntity.addStackToSlot(getOutputSlot(), GT_Utility.getContainerForFilledItem(mInventory[getInputSlot()], true), 1)) { - getFillableStack().amount += Math.min(tFluid.amount, getRealCapacity() - getFillableStack().amount); + if ((((long) tFluid.amount + getFillableStack().amount) <= (long) getRealCapacity()) + || mVoidOverflow) { + if (aBaseMetaTileEntity.addStackToSlot( + getOutputSlot(), + GT_Utility.getContainerForFilledItem(mInventory[getInputSlot()], true), + 1)) { + getFillableStack().amount += + Math.min(tFluid.amount, getRealCapacity() - getFillableStack().amount); aBaseMetaTileEntity.decrStackSize(getInputSlot(), 1); } } @@ -217,7 +229,8 @@ public abstract class GT_MetaTileEntity_DigitalTankBase extends GT_MetaTileEntit } if (doesFillContainers()) { - ItemStack tOutput = GT_Utility.fillFluidContainer(getDrainableStack(), mInventory[getInputSlot()], false, true); + ItemStack tOutput = + GT_Utility.fillFluidContainer(getDrainableStack(), mInventory[getInputSlot()], false, true); if (tOutput != null && aBaseMetaTileEntity.addStackToSlot(getOutputSlot(), tOutput, 1)) { FluidStack tFluid = GT_Utility.getFluidForFilledItem(tOutput, true); aBaseMetaTileEntity.decrStackSize(getInputSlot(), 1); @@ -230,8 +243,11 @@ public abstract class GT_MetaTileEntity_DigitalTankBase extends GT_MetaTileEntit @Override public int fill(FluidStack aFluid, boolean doFill) { - if (aFluid == null || aFluid.getFluid().getID() <= 0 || aFluid.amount <= 0 || !canTankBeFilled() || !isFluidInputAllowed(aFluid)) - return 0; + if (aFluid == null + || aFluid.getFluid().getID() <= 0 + || aFluid.amount <= 0 + || !canTankBeFilled() + || !isFluidInputAllowed(aFluid)) return 0; if (getFillableStack() != null && !getFillableStack().isFluidEqual(aFluid)) { return 0; } @@ -276,7 +292,7 @@ public abstract class GT_MetaTileEntity_DigitalTankBase extends GT_MetaTileEntit return mVoidOverflow ? Integer.MAX_VALUE : getRealCapacity(); } - public int getRealCapacity(){ + public int getRealCapacity() { return commonSizeCompute(mTier); } @@ -292,6 +308,6 @@ public abstract class GT_MetaTileEntity_DigitalTankBase extends GT_MetaTileEntit @Override public FluidTankInfo[] getTankInfo(ForgeDirection aSide) { - return new FluidTankInfo[]{getInfo()}; + return new FluidTankInfo[] {getInfo()}; } } diff --git a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_Locker.java b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_Locker.java index ce8380f419..b4d5345391 100644 --- a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_Locker.java +++ b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_Locker.java @@ -1,5 +1,10 @@ package gregtech.common.tileentities.storage; +import static gregtech.api.enums.Textures.BlockIcons.LOCKERS; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAYS_ENERGY_IN; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_LOCKER; + import gregtech.api.enums.SoundResource; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -12,11 +17,6 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import static gregtech.api.enums.Textures.BlockIcons.LOCKERS; -import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAYS_ENERGY_IN; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_LOCKER; - public class GT_MetaTileEntity_Locker extends GT_MetaTileEntity_TieredMachineBlock { public byte mType = 0; @@ -55,9 +55,19 @@ public class GT_MetaTileEntity_Locker extends GT_MetaTileEntity_TieredMachineBlo } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { if (aSide == aFacing) { - return new ITexture[]{this.mTextures[2][(aColorIndex + 1)][0], this.mTextures[2][(aColorIndex + 1)][1], LOCKERS[Math.abs(this.mType % LOCKERS.length)]}; + return new ITexture[] { + this.mTextures[2][(aColorIndex + 1)][0], + this.mTextures[2][(aColorIndex + 1)][1], + LOCKERS[Math.abs(this.mType % LOCKERS.length)] + }; } return this.mTextures[0][(aColorIndex + 1)]; } @@ -172,7 +182,8 @@ public class GT_MetaTileEntity_Locker extends GT_MetaTileEntity_TieredMachineBlo } @Override - public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) { + public boolean onRightclick( + IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) { if ((aBaseMetaTileEntity.isServerSide()) && (aSide == aBaseMetaTileEntity.getFrontFacing())) { for (int i = 0; i < 4; i++) { ItemStack tSwapStack = this.mInventory[i]; diff --git a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumChest.java b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumChest.java index f991fea66e..384b55cc4c 100644 --- a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumChest.java +++ b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumChest.java @@ -47,8 +47,7 @@ public class GT_MetaTileEntity_QuantumChest extends GT_MetaTileEntity_DigitalChe mInvData.appendTag(tNBT); } } - if (mItemStack != null) - aNBT.setTag("mItemStack", getItemStack().writeToNBT(new NBTTagCompound())); + if (mItemStack != null) aNBT.setTag("mItemStack", getItemStack().writeToNBT(new NBTTagCompound())); aNBT.setTag("Inventory", mInvData); aNBT.setInteger("mItemCount", getItemCount()); aNBT.setBoolean("mVoidOverflow", mVoidOverflow); @@ -58,7 +57,7 @@ public class GT_MetaTileEntity_QuantumChest extends GT_MetaTileEntity_DigitalChe @Override protected String chestName() { - return "Quantum Chest"; + return "Quantum Chest"; } @Override @@ -73,7 +72,7 @@ public class GT_MetaTileEntity_QuantumChest extends GT_MetaTileEntity_DigitalChe @Override protected ItemStack getItemStack() { - return mItemStack; + return mItemStack; } @Override diff --git a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumTank.java b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumTank.java index da283a19d8..886dd676e7 100644 --- a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumTank.java +++ b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumTank.java @@ -28,21 +28,22 @@ public class GT_MetaTileEntity_QuantumTank extends GT_MetaTileEntity_DigitalTank public String[] getInfoData() { if (mFluid == null) { - return new String[]{ - EnumChatFormatting.BLUE + "Quantum Tank" + EnumChatFormatting.RESET, - "Stored Fluid:", - EnumChatFormatting.GOLD + "No Fluid" + EnumChatFormatting.RESET, - EnumChatFormatting.GREEN + Integer.toString(0) + " L" + EnumChatFormatting.RESET + " " + - EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(getCapacity()) + " L" + EnumChatFormatting.RESET - }; - } - return new String[]{ + return new String[] { EnumChatFormatting.BLUE + "Quantum Tank" + EnumChatFormatting.RESET, "Stored Fluid:", - EnumChatFormatting.GOLD + mFluid.getLocalizedName() + EnumChatFormatting.RESET, - EnumChatFormatting.GREEN + GT_Utility.formatNumbers(mFluid.amount) + " L" + EnumChatFormatting.RESET + " " + - EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(getCapacity()) + " L" + EnumChatFormatting.RESET + EnumChatFormatting.GOLD + "No Fluid" + EnumChatFormatting.RESET, + EnumChatFormatting.GREEN + Integer.toString(0) + " L" + EnumChatFormatting.RESET + " " + + EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(getCapacity()) + " L" + + EnumChatFormatting.RESET + }; + } + return new String[] { + EnumChatFormatting.BLUE + "Quantum Tank" + EnumChatFormatting.RESET, + "Stored Fluid:", + EnumChatFormatting.GOLD + mFluid.getLocalizedName() + EnumChatFormatting.RESET, + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(mFluid.amount) + " L" + EnumChatFormatting.RESET + " " + + EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(getCapacity()) + " L" + + EnumChatFormatting.RESET }; } - } diff --git a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_SuperChest.java b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_SuperChest.java index 92f9aec998..f2be7312ec 100644 --- a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_SuperChest.java +++ b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_SuperChest.java @@ -42,8 +42,7 @@ public class GT_MetaTileEntity_SuperChest extends GT_MetaTileEntity_DigitalChest mInvData.appendTag(tNBT); } } - if (mItemStack != null) - aNBT.setTag("mItemStack", getItemStack().writeToNBT(new NBTTagCompound())); + if (mItemStack != null) aNBT.setTag("mItemStack", getItemStack().writeToNBT(new NBTTagCompound())); aNBT.setTag("Inventory", mInvData); aNBT.setInteger("mItemCount", getItemCount()); aNBT.setBoolean("mVoidOverflow", mVoidOverflow); diff --git a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_SuperTank.java b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_SuperTank.java index dbe54e9005..3b7fb8e849 100644 --- a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_SuperTank.java +++ b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_SuperTank.java @@ -28,21 +28,21 @@ public class GT_MetaTileEntity_SuperTank extends GT_MetaTileEntity_DigitalTankBa public String[] getInfoData() { if (mFluid == null) { - return new String[]{ - EnumChatFormatting.BLUE + "Super Tank" + EnumChatFormatting.RESET, - "Stored Fluid:", - EnumChatFormatting.GOLD + "No Fluid" + EnumChatFormatting.RESET, - EnumChatFormatting.GREEN + "0 L" + EnumChatFormatting.RESET + " " + - EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(getCapacity()) + " L" + EnumChatFormatting.RESET - }; - } - return new String[]{ + return new String[] { EnumChatFormatting.BLUE + "Super Tank" + EnumChatFormatting.RESET, "Stored Fluid:", - EnumChatFormatting.GOLD + mFluid.getLocalizedName() + EnumChatFormatting.RESET, - EnumChatFormatting.GREEN + GT_Utility.formatNumbers(mFluid.amount) + " L" + EnumChatFormatting.RESET + " " + - EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(getCapacity()) + " L" + EnumChatFormatting.RESET + EnumChatFormatting.GOLD + "No Fluid" + EnumChatFormatting.RESET, + EnumChatFormatting.GREEN + "0 L" + EnumChatFormatting.RESET + " " + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(getCapacity()) + " L" + EnumChatFormatting.RESET + }; + } + return new String[] { + EnumChatFormatting.BLUE + "Super Tank" + EnumChatFormatting.RESET, + "Stored Fluid:", + EnumChatFormatting.GOLD + mFluid.getLocalizedName() + EnumChatFormatting.RESET, + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(mFluid.amount) + " L" + EnumChatFormatting.RESET + " " + + EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(getCapacity()) + " L" + + EnumChatFormatting.RESET }; } - } diff --git a/src/main/java/gregtech/common/tools/GT_Tool.java b/src/main/java/gregtech/common/tools/GT_Tool.java index 3fa80a9f0a..bd17809e59 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool.java +++ b/src/main/java/gregtech/common/tools/GT_Tool.java @@ -4,6 +4,7 @@ import gregtech.api.damagesources.GT_DamageSources; import gregtech.api.enums.SoundResource; import gregtech.api.interfaces.IToolStats; import gregtech.api.items.GT_MetaGenerated_Tool; +import java.util.List; import net.minecraft.block.Block; import net.minecraft.enchantment.Enchantment; import net.minecraft.entity.Entity; @@ -17,8 +18,6 @@ import net.minecraft.util.IChatComponent; import net.minecraft.world.World; import net.minecraftforge.event.world.BlockEvent; -import java.util.List; - public abstract class GT_Tool implements IToolStats { public static final Enchantment[] FORTUNE_ENCHANTMENT = {Enchantment.fortune}; public static final Enchantment[] LOOTING_ENCHANTMENT = {Enchantment.looting}; @@ -101,8 +100,8 @@ public abstract class GT_Tool implements IToolStats { } @Override - public boolean isChainsaw(){ - return false; + public boolean isChainsaw() { + return false; } @Override @@ -127,15 +126,30 @@ public abstract class GT_Tool implements IToolStats { @Override public DamageSource getDamageSource(EntityLivingBase aPlayer, Entity aEntity) { - return GT_DamageSources.getCombatDamage((aPlayer instanceof EntityPlayer) ? "player" : "mob", aPlayer, (aEntity instanceof EntityLivingBase) ? getDeathMessage(aPlayer, (EntityLivingBase) aEntity) : null); + return GT_DamageSources.getCombatDamage( + (aPlayer instanceof EntityPlayer) ? "player" : "mob", + aPlayer, + (aEntity instanceof EntityLivingBase) ? getDeathMessage(aPlayer, (EntityLivingBase) aEntity) : null); } public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new EntityDamageSource((aPlayer instanceof EntityPlayer) ? "player" : "mob", aPlayer).func_151519_b(aEntity); - } - - @Override - public int convertBlockDrops(List<ItemStack> aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent) { + return new EntityDamageSource((aPlayer instanceof EntityPlayer) ? "player" : "mob", aPlayer) + .func_151519_b(aEntity); + } + + @Override + public int convertBlockDrops( + List<ItemStack> aDrops, + ItemStack aStack, + EntityPlayer aPlayer, + Block aBlock, + int aX, + int aY, + int aZ, + byte aMetaData, + int aFortune, + boolean aSilkTouch, + BlockEvent.HarvestDropsEvent aEvent) { return 0; } @@ -162,21 +176,30 @@ public abstract class GT_Tool implements IToolStats { } @Override - public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID) { - } + public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID) {} @Override - public float getNormalDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer) { + public float getNormalDamageAgainstEntity( + float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer) { return aOriginalDamage; } @Override - public float getMagicDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer) { + public float getMagicDamageAgainstEntity( + float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer) { return aOriginalDamage; } - @Override - public float getMiningSpeed(Block aBlock, byte aMetaData, float aDefault, EntityPlayer aPlayer, World worldObj, int aX, int aY, int aZ) { - return aDefault; - } + @Override + public float getMiningSpeed( + Block aBlock, + byte aMetaData, + float aDefault, + EntityPlayer aPlayer, + World worldObj, + int aX, + int aY, + int aZ) { + return aDefault; + } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Axe.java b/src/main/java/gregtech/common/tools/GT_Tool_Axe.java index 302ea9867f..5155d061fe 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Axe.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Axe.java @@ -5,6 +5,7 @@ import gregtech.api.enums.OrePrefixes; import gregtech.api.interfaces.IIconContainer; import gregtech.api.items.GT_MetaGenerated_Tool; import gregtech.api.util.GT_ToolHarvestHelper; +import java.util.List; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.EntityLivingBase; @@ -16,8 +17,6 @@ import net.minecraft.util.IChatComponent; import net.minecraft.world.World; import net.minecraftforge.event.world.BlockEvent; -import java.util.List; - public class GT_Tool_Axe extends GT_Tool { @Override public int getToolDamagePerBlockBreak() { @@ -91,17 +90,31 @@ public class GT_Tool_Axe extends GT_Tool { @Override public boolean isMinableBlock(Block aBlock, byte aMetaData) { - return GT_ToolHarvestHelper.isAppropriateTool(aBlock,aMetaData ,"axe") - || GT_ToolHarvestHelper.isAppropriateMaterial(aBlock ,Material.wood); - } - - @Override - public int convertBlockDrops(List<ItemStack> aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent) { + return GT_ToolHarvestHelper.isAppropriateTool(aBlock, aMetaData, "axe") + || GT_ToolHarvestHelper.isAppropriateMaterial(aBlock, Material.wood); + } + + @Override + public int convertBlockDrops( + List<ItemStack> aDrops, + ItemStack aStack, + EntityPlayer aPlayer, + Block aBlock, + int aX, + int aY, + int aZ, + byte aMetaData, + int aFortune, + boolean aSilkTouch, + BlockEvent.HarvestDropsEvent aEvent) { int rAmount = 0; - if ((GregTech_API.sTimber) && (!aPlayer.isSneaking()) && (OrePrefixes.log.contains(new ItemStack(aBlock, 1, aMetaData)))) { + if ((GregTech_API.sTimber) + && (!aPlayer.isSneaking()) + && (OrePrefixes.log.contains(new ItemStack(aBlock, 1, aMetaData)))) { int tY = aY + 1; for (int tH = aPlayer.worldObj.getHeight(); tY < tH; tY++) { - if ((aPlayer.worldObj.getBlock(aX, tY, aZ) != aBlock) || (!aPlayer.worldObj.func_147480_a(aX, tY, aZ, true))) { + if ((aPlayer.worldObj.getBlock(aX, tY, aZ) != aBlock) + || (!aPlayer.worldObj.func_147480_a(aX, tY, aZ, true))) { break; } rAmount++; @@ -111,19 +124,29 @@ public class GT_Tool_Axe extends GT_Tool { } @Override - public float getMiningSpeed(Block aBlock, byte aMetaData, float aDefault, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ) - { - if (aBlock.isWood(aPlayer.worldObj, aX, aY, aZ) && OrePrefixes.log.contains(new ItemStack(aBlock, 1, aMetaData))){ - float rAmount = 1.0F;float tIncrement = 1.0F; - if ((GregTech_API.sTimber) && !aPlayer.isSneaking()){ - int tY = aY + 1; - for (int tH = aPlayer.worldObj.getHeight(); (tY < tH) && (aPlayer.worldObj.getBlock(aX, tY, aZ) == aBlock); tY++){ - tIncrement += 0.1F;rAmount += tIncrement; - } + public float getMiningSpeed( + Block aBlock, byte aMetaData, float aDefault, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ) { + if (aBlock.isWood(aPlayer.worldObj, aX, aY, aZ) + && OrePrefixes.log.contains(new ItemStack(aBlock, 1, aMetaData))) { + float rAmount = 1.0F; + float tIncrement = 1.0F; + if ((GregTech_API.sTimber) && !aPlayer.isSneaking()) { + int tY = aY + 1; + for (int tH = aPlayer.worldObj.getHeight(); + (tY < tH) && (aPlayer.worldObj.getBlock(aX, tY, aZ) == aBlock); + tY++) { + tIncrement += 0.1F; + rAmount += tIncrement; + } + } + return 2.0F * aDefault / rAmount; } - return 2.0F * aDefault / rAmount; - } - return (aBlock.getMaterial() == Material.leaves) || (aBlock.getMaterial() == Material.vine) || (aBlock.getMaterial() == Material.plants) || (aBlock.getMaterial() == Material.gourd) ? aDefault / 4.0F : aDefault; + return (aBlock.getMaterial() == Material.leaves) + || (aBlock.getMaterial() == Material.vine) + || (aBlock.getMaterial() == Material.plants) + || (aBlock.getMaterial() == Material.gourd) + ? aDefault / 4.0F + : aDefault; } @Override @@ -133,20 +156,29 @@ public class GT_Tool_Axe extends GT_Tool { @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mIconSet.mTextures[OrePrefixes.toolHeadAxe.mTextureIndex] : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mIconSet.mTextures[OrePrefixes.stick.mTextureIndex]; + return aIsToolHead + ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack) + .mIconSet + .mTextures[OrePrefixes.toolHeadAxe.mTextureIndex] + : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack) + .mIconSet + .mTextures[OrePrefixes.stick.mTextureIndex]; } @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; + return aIsToolHead + ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa + : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } @Override - public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID) { - } + public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID) {} @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " has been chopped by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE); + return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + + " has been chopped by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + + EnumChatFormatting.WHITE); } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_BranchCutter.java b/src/main/java/gregtech/common/tools/GT_Tool_BranchCutter.java index a123ff1ff6..228d06d2a7 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_BranchCutter.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_BranchCutter.java @@ -6,6 +6,7 @@ import gregtech.api.items.GT_MetaGenerated_Tool; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_ToolHarvestHelper; import gregtech.api.util.GT_Utility; +import java.util.List; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.EntityLivingBase; @@ -18,8 +19,6 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; import net.minecraftforge.event.world.BlockEvent; -import java.util.List; - public class GT_Tool_BranchCutter extends GT_Tool { @Override public float getBaseDamage() { @@ -42,9 +41,21 @@ public class GT_Tool_BranchCutter extends GT_Tool { } @Override - public int convertBlockDrops(List<ItemStack> aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent) { + public int convertBlockDrops( + List<ItemStack> aDrops, + ItemStack aStack, + EntityPlayer aPlayer, + Block aBlock, + int aX, + int aY, + int aZ, + byte aMetaData, + int aFortune, + boolean aSilkTouch, + BlockEvent.HarvestDropsEvent aEvent) { if (aBlock.getMaterial() == Material.leaves) { - aEvent.dropChance = Math.min(1.0F, Math.max(aEvent.dropChance, (aStack.getItem().getHarvestLevel(aStack, "") + 1) * 0.2F)); + aEvent.dropChance = Math.min( + 1.0F, Math.max(aEvent.dropChance, (aStack.getItem().getHarvestLevel(aStack, "") + 1) * 0.2F)); if (aBlock == Blocks.leaves) { aDrops.clear(); if (((aMetaData & 0x3) == 0) && (aPlayer.worldObj.rand.nextInt(9) <= aFortune * 2)) { @@ -65,8 +76,8 @@ public class GT_Tool_BranchCutter extends GT_Tool { @Override public boolean isMinableBlock(Block aBlock, byte aMetaData) { - return GT_ToolHarvestHelper.isAppropriateTool(aBlock , aMetaData ,"grafter") - || GT_ToolHarvestHelper.isAppropriateMaterial(aBlock ,Material.leaves); + return GT_ToolHarvestHelper.isAppropriateTool(aBlock, aMetaData, "grafter") + || GT_ToolHarvestHelper.isAppropriateMaterial(aBlock, Material.leaves); } @Override @@ -76,11 +87,15 @@ public class GT_Tool_BranchCutter extends GT_Tool { @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; + return aIsToolHead + ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa + : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " has been trimmed by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE); + return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + + " has been trimmed by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + + EnumChatFormatting.WHITE); } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_ButcheryKnife.java b/src/main/java/gregtech/common/tools/GT_Tool_ButcheryKnife.java index f57ba7f5d3..ab10e40bae 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_ButcheryKnife.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_ButcheryKnife.java @@ -70,7 +70,7 @@ public class GT_Tool_ButcheryKnife extends GT_Tool { @Override public int[] getEnchantmentLevels(ItemStack aStack) { - return new int[]{(2 + GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mToolQuality) / 2}; + return new int[] {(2 + GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mToolQuality) / 2}; } @Override @@ -80,12 +80,16 @@ public class GT_Tool_ButcheryKnife extends GT_Tool { @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; + return aIsToolHead + ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa + : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new ChatComponentText(EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE + " has butchered " + EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE); + return new ChatComponentText( + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE + " has butchered " + + EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE); } @Override diff --git a/src/main/java/gregtech/common/tools/GT_Tool_BuzzSaw.java b/src/main/java/gregtech/common/tools/GT_Tool_BuzzSaw.java index cbdb1871cc..db57a82cb8 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_BuzzSaw.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_BuzzSaw.java @@ -54,16 +54,24 @@ public class GT_Tool_BuzzSaw extends GT_Tool_Saw { @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { - return !aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadBuzzSaw.mTextureIndex] : Textures.ItemIcons.HANDLE_BUZZSAW; + return !aIsToolHead + ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack) + .mIconSet + .mTextures[gregtech.api.enums.OrePrefixes.toolHeadBuzzSaw.mTextureIndex] + : Textures.ItemIcons.HANDLE_BUZZSAW; } @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return !aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; + return !aIsToolHead + ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa + : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " got buzzed by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE); + return new ChatComponentText( + EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " got buzzed by " + + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE); } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Chainsaw_HV.java b/src/main/java/gregtech/common/tools/GT_Tool_Chainsaw_HV.java index 117b7b6bc0..a031fbc9da 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Chainsaw_HV.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Chainsaw_HV.java @@ -47,6 +47,10 @@ public class GT_Tool_Chainsaw_HV extends GT_Tool_Chainsaw_LV { @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead ? gregtech.api.items.GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadChainsaw.mTextureIndex] : Textures.ItemIcons.POWER_UNIT_HV; + return aIsToolHead + ? gregtech.api.items.GT_MetaGenerated_Tool.getPrimaryMaterial(aStack) + .mIconSet + .mTextures[gregtech.api.enums.OrePrefixes.toolHeadChainsaw.mTextureIndex] + : Textures.ItemIcons.POWER_UNIT_HV; } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Chainsaw_LV.java b/src/main/java/gregtech/common/tools/GT_Tool_Chainsaw_LV.java index b796fb6fce..f0b26eb913 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Chainsaw_LV.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Chainsaw_LV.java @@ -7,6 +7,8 @@ import gregtech.api.enums.SoundResource; import gregtech.api.enums.Textures; import gregtech.api.interfaces.IIconContainer; import gregtech.api.items.GT_MetaGenerated_Tool; +import java.util.ArrayList; +import java.util.List; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.EntityLivingBase; @@ -20,9 +22,6 @@ import net.minecraft.world.World; import net.minecraftforge.common.IShearable; import net.minecraftforge.event.world.BlockEvent; -import java.util.ArrayList; -import java.util.List; - public class GT_Tool_Chainsaw_LV extends GT_Tool_Saw { @Override public int getToolDamagePerBlockBreak() { @@ -85,8 +84,8 @@ public class GT_Tool_Chainsaw_LV extends GT_Tool_Saw { } @Override - public boolean isChainsaw(){ - return true; + public boolean isChainsaw() { + return true; } @Override @@ -103,28 +102,43 @@ public class GT_Tool_Chainsaw_LV extends GT_Tool_Saw { } catch (Exception ignored) { } } + @Override - public int convertBlockDrops(List<ItemStack> aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent) { + public int convertBlockDrops( + List<ItemStack> aDrops, + ItemStack aStack, + EntityPlayer aPlayer, + Block aBlock, + int aX, + int aY, + int aZ, + byte aMetaData, + int aFortune, + boolean aSilkTouch, + BlockEvent.HarvestDropsEvent aEvent) { int rAmount = 0; if ((aBlock.getMaterial() == Material.leaves) && ((aBlock instanceof IShearable))) { aPlayer.worldObj.setBlock(aX, aY, aZ, aBlock, aMetaData, 0); if (((IShearable) aBlock).isShearable(aStack, aPlayer.worldObj, aX, aY, aZ)) { - ArrayList<ItemStack> tDrops = ((IShearable) aBlock).onSheared(aStack, aPlayer.worldObj, aX, aY, aZ, aFortune); + ArrayList<ItemStack> tDrops = + ((IShearable) aBlock).onSheared(aStack, aPlayer.worldObj, aX, aY, aZ, aFortune); aDrops.clear(); - } aPlayer.worldObj.setBlock(aX, aY, aZ, Blocks.air, 0, 0); - } else - if (((aBlock.getMaterial() == Material.ice) || (aBlock.getMaterial() == Material.packedIce)) && (aDrops.isEmpty())) { + } else if (((aBlock.getMaterial() == Material.ice) || (aBlock.getMaterial() == Material.packedIce)) + && (aDrops.isEmpty())) { aDrops.add(new ItemStack(aBlock, 1, aMetaData)); aPlayer.worldObj.setBlockToAir(aX, aY, aZ); aEvent.dropChance = 1.0F; return 1; } - if ((GregTech_API.sTimber) && (!aPlayer.isSneaking()) && (OrePrefixes.log.contains(new ItemStack(aBlock, 1, aMetaData)))) { + if ((GregTech_API.sTimber) + && (!aPlayer.isSneaking()) + && (OrePrefixes.log.contains(new ItemStack(aBlock, 1, aMetaData)))) { int tY = aY + 1; for (int tH = aPlayer.worldObj.getHeight(); tY < tH; tY++) { - if ((aPlayer.worldObj.getBlock(aX, tY, aZ) != aBlock) || (!aPlayer.worldObj.func_147480_a(aX, tY, aZ, true))) { + if ((aPlayer.worldObj.getBlock(aX, tY, aZ) != aBlock) + || (!aPlayer.worldObj.func_147480_a(aX, tY, aZ, true))) { break; } rAmount++; @@ -134,33 +148,51 @@ public class GT_Tool_Chainsaw_LV extends GT_Tool_Saw { } @Override - public float getMiningSpeed(Block aBlock, byte aMetaData, float aDefault, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ) - { - if (aBlock.isWood(aPlayer.worldObj, aX, aY, aZ) && OrePrefixes.log.contains(new ItemStack(aBlock, 1, aMetaData))){ - float rAmount = 1.0F;float tIncrement = 1.0F; - if ((GregTech_API.sTimber) && !aPlayer.isSneaking()){ - int tY = aY + 1; - for (int tH = aPlayer.worldObj.getHeight(); (tY < tH) && (aPlayer.worldObj.getBlock(aX, tY, aZ) == aBlock); tY++){ - tIncrement += 0.1F;rAmount += tIncrement; - } + public float getMiningSpeed( + Block aBlock, byte aMetaData, float aDefault, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ) { + if (aBlock.isWood(aPlayer.worldObj, aX, aY, aZ) + && OrePrefixes.log.contains(new ItemStack(aBlock, 1, aMetaData))) { + float rAmount = 1.0F; + float tIncrement = 1.0F; + if ((GregTech_API.sTimber) && !aPlayer.isSneaking()) { + int tY = aY + 1; + for (int tH = aPlayer.worldObj.getHeight(); + (tY < tH) && (aPlayer.worldObj.getBlock(aX, tY, aZ) == aBlock); + tY++) { + tIncrement += 0.1F; + rAmount += tIncrement; + } + } + return 2.0F * aDefault / rAmount; } - return 2.0F * aDefault / rAmount; - } - return (aBlock.getMaterial() == Material.leaves) || (aBlock.getMaterial() == Material.vine) || (aBlock.getMaterial() == Material.plants) || (aBlock.getMaterial() == Material.gourd) ? aDefault / 4.0F : aDefault; + return (aBlock.getMaterial() == Material.leaves) + || (aBlock.getMaterial() == Material.vine) + || (aBlock.getMaterial() == Material.plants) + || (aBlock.getMaterial() == Material.gourd) + ? aDefault / 4.0F + : aDefault; } @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadChainsaw.mTextureIndex] : Textures.ItemIcons.POWER_UNIT_LV; + return aIsToolHead + ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack) + .mIconSet + .mTextures[gregtech.api.enums.OrePrefixes.toolHeadChainsaw.mTextureIndex] + : Textures.ItemIcons.POWER_UNIT_LV; } @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; + return aIsToolHead + ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa + : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " was massacred by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE); + return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + + " was massacred by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + + EnumChatFormatting.WHITE); } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Chainsaw_MV.java b/src/main/java/gregtech/common/tools/GT_Tool_Chainsaw_MV.java index e571a26cfc..c28f89e361 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Chainsaw_MV.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Chainsaw_MV.java @@ -47,6 +47,10 @@ public class GT_Tool_Chainsaw_MV extends GT_Tool_Chainsaw_LV { @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead ? gregtech.api.items.GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadChainsaw.mTextureIndex] : Textures.ItemIcons.POWER_UNIT_MV; + return aIsToolHead + ? gregtech.api.items.GT_MetaGenerated_Tool.getPrimaryMaterial(aStack) + .mIconSet + .mTextures[gregtech.api.enums.OrePrefixes.toolHeadChainsaw.mTextureIndex] + : Textures.ItemIcons.POWER_UNIT_MV; } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Crowbar.java b/src/main/java/gregtech/common/tools/GT_Tool_Crowbar.java index a0c3e9a059..aeff5ecd17 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Crowbar.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Crowbar.java @@ -7,6 +7,7 @@ import gregtech.api.interfaces.IToolStats; import gregtech.api.items.GT_MetaGenerated_Tool; import gregtech.common.items.GT_MetaGenerated_Tool_01; import gregtech.common.items.behaviors.Behaviour_Crowbar; +import java.util.Iterator; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.EntityLivingBase; @@ -15,8 +16,6 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; -import java.util.Iterator; - public class GT_Tool_Crowbar extends GT_Tool { @Override public int getToolDamagePerBlockBreak() { @@ -95,7 +94,12 @@ public class GT_Tool_Crowbar extends GT_Tool { } String tTool = aBlock.getHarvestTool(aMetaData); if ((tTool == null) || (tTool.equals(""))) { - for (Iterator i$ = GT_MetaGenerated_Tool_01.INSTANCE.mToolStats.values().iterator(); i$.hasNext(); i$.next()) { + for (Iterator i$ = GT_MetaGenerated_Tool_01.INSTANCE + .mToolStats + .values() + .iterator(); + i$.hasNext(); + i$.next()) { if (((i$ instanceof GT_Tool_Crowbar)) && (!((IToolStats) i$).isMinableBlock(aBlock, aMetaData))) { return false; } @@ -127,6 +131,8 @@ public class GT_Tool_Crowbar extends GT_Tool { @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " was removed by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE); + return new ChatComponentText( + EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " was removed by " + + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE); } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Drill_HV.java b/src/main/java/gregtech/common/tools/GT_Tool_Drill_HV.java index 36c414d40f..018bf3d636 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Drill_HV.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Drill_HV.java @@ -59,6 +59,10 @@ public class GT_Tool_Drill_HV extends GT_Tool_Drill_LV { @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead ? gregtech.api.items.GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadDrill.mTextureIndex] : Textures.ItemIcons.POWER_UNIT_HV; + return aIsToolHead + ? gregtech.api.items.GT_MetaGenerated_Tool.getPrimaryMaterial(aStack) + .mIconSet + .mTextures[gregtech.api.enums.OrePrefixes.toolHeadDrill.mTextureIndex] + : Textures.ItemIcons.POWER_UNIT_HV; } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Drill_LV.java b/src/main/java/gregtech/common/tools/GT_Tool_Drill_LV.java index cea56791a0..202d9750ad 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Drill_LV.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Drill_LV.java @@ -90,18 +90,17 @@ public class GT_Tool_Drill_LV extends GT_Tool { @Override public boolean isMinableBlock(Block aBlock, byte aMetaData) { return GT_ToolHarvestHelper.isAppropriateTool(aBlock, aMetaData, "pickaxe", "shovel") - || GT_ToolHarvestHelper.isAppropriateMaterial(aBlock, - Material.rock, - Material.iron, - Material.anvil, - Material.sand, - Material.grass, - Material.ground, - Material.snow, - Material.clay, - Material.glass - ); - + || GT_ToolHarvestHelper.isAppropriateMaterial( + aBlock, + Material.rock, + Material.iron, + Material.anvil, + Material.sand, + Material.grass, + Material.ground, + Material.snow, + Material.clay, + Material.glass); } @Override @@ -111,17 +110,22 @@ public class GT_Tool_Drill_LV extends GT_Tool { @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadDrill.mTextureIndex] : Textures.ItemIcons.POWER_UNIT_LV; + return aIsToolHead + ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack) + .mIconSet + .mTextures[gregtech.api.enums.OrePrefixes.toolHeadDrill.mTextureIndex] + : Textures.ItemIcons.POWER_UNIT_LV; } @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; + return aIsToolHead + ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa + : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } @Override - public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID) { - } + public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID) {} @Override public void onToolCrafted(ItemStack aStack, EntityPlayer aPlayer) { @@ -137,6 +141,8 @@ public class GT_Tool_Drill_LV extends GT_Tool { @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " got the Drill! (by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE + ")"); + return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + + " got the Drill! (by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + + EnumChatFormatting.WHITE + ")"); } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Drill_MV.java b/src/main/java/gregtech/common/tools/GT_Tool_Drill_MV.java index 7bfddc6f98..b512a9d0bb 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Drill_MV.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Drill_MV.java @@ -5,8 +5,7 @@ import gregtech.api.enums.Textures; import gregtech.api.interfaces.IIconContainer; import net.minecraft.item.ItemStack; -public class GT_Tool_Drill_MV - extends GT_Tool_Drill_LV { +public class GT_Tool_Drill_MV extends GT_Tool_Drill_LV { @Override public int getToolDamagePerBlockBreak() { return GT_Mod.gregtechproxy.mHardRock ? 100 : 200; @@ -49,6 +48,10 @@ public class GT_Tool_Drill_MV @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead ? gregtech.api.items.GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadDrill.mTextureIndex] : Textures.ItemIcons.POWER_UNIT_MV; + return aIsToolHead + ? gregtech.api.items.GT_MetaGenerated_Tool.getPrimaryMaterial(aStack) + .mIconSet + .mTextures[gregtech.api.enums.OrePrefixes.toolHeadDrill.mTextureIndex] + : Textures.ItemIcons.POWER_UNIT_MV; } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_File.java b/src/main/java/gregtech/common/tools/GT_Tool_File.java index e09f1cd784..6dfcaf685e 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_File.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_File.java @@ -11,8 +11,7 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; -public class GT_Tool_File - extends GT_Tool { +public class GT_Tool_File extends GT_Tool { @Override public int getToolDamagePerBlockBreak() { return 50; @@ -85,7 +84,7 @@ public class GT_Tool_File @Override public boolean isMinableBlock(Block aBlock, byte aMetaData) { - return GT_ToolHarvestHelper.isAppropriateTool(aBlock ,aMetaData,"file"); + return GT_ToolHarvestHelper.isAppropriateTool(aBlock, aMetaData, "file"); } @Override @@ -95,20 +94,27 @@ public class GT_Tool_File @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { - return !aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadFile.mTextureIndex] : Textures.ItemIcons.HANDLE_FILE; + return !aIsToolHead + ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack) + .mIconSet + .mTextures[gregtech.api.enums.OrePrefixes.toolHeadFile.mTextureIndex] + : Textures.ItemIcons.HANDLE_FILE; } @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return !aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; + return !aIsToolHead + ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa + : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } @Override - public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID) { - } + public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID) {} @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " has been filed D for 'Dead' by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE); + return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + + " has been filed D for 'Dead' by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + + EnumChatFormatting.WHITE); } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_HardHammer.java b/src/main/java/gregtech/common/tools/GT_Tool_HardHammer.java index 130766759e..355078497e 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_HardHammer.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_HardHammer.java @@ -1,5 +1,7 @@ package gregtech.common.tools; +import static gregtech.GT_Mod.MAX_IC2; + import gregtech.GT_Mod; import gregtech.api.enums.SoundResource; import gregtech.api.interfaces.IIconContainer; @@ -8,6 +10,8 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_ToolHarvestHelper; import gregtech.api.util.GT_Utility; import gregtech.common.items.behaviors.Behaviour_Prospecting; +import java.util.Arrays; +import java.util.List; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.Entity; @@ -20,16 +24,13 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; import net.minecraftforge.event.world.BlockEvent; -import java.util.Arrays; -import java.util.List; - -import static gregtech.GT_Mod.MAX_IC2; - public class GT_Tool_HardHammer extends GT_Tool { - public static final List<String> mEffectiveList = Arrays.asList(EntityIronGolem.class.getName(), "EntityTowerGuardian"); + public static final List<String> mEffectiveList = + Arrays.asList(EntityIronGolem.class.getName(), "EntityTowerGuardian"); @Override - public float getNormalDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer) { + public float getNormalDamageAgainstEntity( + float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer) { String tName = aEntity.getClass().getName(); tName = tName.substring(tName.lastIndexOf('.') + 1); return (mEffectiveList.contains(tName)) || (tName.contains("Golem")) ? aOriginalDamage * 2.0F : aOriginalDamage; @@ -118,21 +119,31 @@ public class GT_Tool_HardHammer extends GT_Tool { @Override public boolean isMinableBlock(Block aBlock, byte aMetaData) { return GT_ToolHarvestHelper.isAppropriateTool(aBlock, aMetaData, "hammer", "pickaxe") - || GT_ToolHarvestHelper.isAppropriateMaterial(aBlock, - Material.rock, - Material.glass, - Material.ice, - Material.packedIce) + || GT_ToolHarvestHelper.isAppropriateMaterial( + aBlock, Material.rock, Material.glass, Material.ice, Material.packedIce) || GT_Recipe.GT_Recipe_Map.sHammerRecipes.containsInput(new ItemStack(aBlock, 1, aMetaData)); } @Override - public int convertBlockDrops(List<ItemStack> aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent) { + public int convertBlockDrops( + List<ItemStack> aDrops, + ItemStack aStack, + EntityPlayer aPlayer, + Block aBlock, + int aX, + int aY, + int aZ, + byte aMetaData, + int aFortune, + boolean aSilkTouch, + BlockEvent.HarvestDropsEvent aEvent) { int rConversions = 0; - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes.findRecipe(null, true, MAX_IC2, null, new ItemStack(aBlock, 1, aMetaData)); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes.findRecipe( + null, true, MAX_IC2, null, new ItemStack(aBlock, 1, aMetaData)); if ((tRecipe == null) || (aBlock.hasTileEntity(aMetaData))) { for (ItemStack tDrop : aDrops) { - tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes.findRecipe(null, true, MAX_IC2, null, GT_Utility.copyAmount(1L, tDrop)); + tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes.findRecipe( + null, true, MAX_IC2, null, GT_Utility.copyAmount(1L, tDrop)); if (tRecipe != null) { ItemStack tHammeringOutput = tRecipe.getOutput(0); if (tHammeringOutput != null) { @@ -158,12 +169,20 @@ public class GT_Tool_HardHammer extends GT_Tool { @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadHammer.mTextureIndex] : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.stick.mTextureIndex]; + return aIsToolHead + ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack) + .mIconSet + .mTextures[gregtech.api.enums.OrePrefixes.toolHeadHammer.mTextureIndex] + : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack) + .mIconSet + .mTextures[gregtech.api.enums.OrePrefixes.stick.mTextureIndex]; } @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; + return aIsToolHead + ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa + : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } @Override @@ -173,7 +192,9 @@ public class GT_Tool_HardHammer extends GT_Tool { @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " was squashed by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE); + return new ChatComponentText( + EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " was squashed by " + + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE); } @Override diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Hoe.java b/src/main/java/gregtech/common/tools/GT_Tool_Hoe.java index 67cfade9c8..84dbdba266 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Hoe.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Hoe.java @@ -82,8 +82,8 @@ public class GT_Tool_Hoe extends GT_Tool { @Override public boolean isMinableBlock(Block aBlock, byte aMetaData) { - return GT_ToolHarvestHelper.isAppropriateTool(aBlock , aMetaData ,"hoe") - || GT_ToolHarvestHelper.isAppropriateMaterial(aBlock ,Material.gourd); + return GT_ToolHarvestHelper.isAppropriateTool(aBlock, aMetaData, "hoe") + || GT_ToolHarvestHelper.isAppropriateMaterial(aBlock, Material.gourd); } @Override @@ -93,12 +93,20 @@ public class GT_Tool_Hoe extends GT_Tool { @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadHoe.mTextureIndex] : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.stick.mTextureIndex]; + return aIsToolHead + ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack) + .mIconSet + .mTextures[gregtech.api.enums.OrePrefixes.toolHeadHoe.mTextureIndex] + : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack) + .mIconSet + .mTextures[gregtech.api.enums.OrePrefixes.stick.mTextureIndex]; } @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; + return aIsToolHead + ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa + : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } @Override @@ -114,6 +122,8 @@ public class GT_Tool_Hoe extends GT_Tool { @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " has been called a stupid Hoe by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE); + return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + + " has been called a stupid Hoe by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + + EnumChatFormatting.WHITE); } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_JackHammer.java b/src/main/java/gregtech/common/tools/GT_Tool_JackHammer.java index 3a37e4d3e3..220ac01aba 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_JackHammer.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_JackHammer.java @@ -6,6 +6,7 @@ import gregtech.api.interfaces.IIconContainer; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_ToolHarvestHelper; import gregtech.api.util.GT_Utility; +import java.util.List; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.EntityLivingBase; @@ -16,8 +17,6 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; import net.minecraftforge.event.world.BlockEvent; -import java.util.List; - public class GT_Tool_JackHammer extends GT_Tool_Drill_LV { @Override public int getToolDamagePerBlockBreak() { @@ -61,23 +60,36 @@ public class GT_Tool_JackHammer extends GT_Tool_Drill_LV { @Override public boolean isMinableBlock(Block aBlock, byte aMetaData) { - return GT_ToolHarvestHelper.isAppropriateTool(aBlock , aMetaData ,"pickaxe")// - || GT_ToolHarvestHelper.isAppropriateMaterial(aBlock,// - Material.rock,// - Material.glass,// - Material.ice,// - Material.packedIce// - ); - + return GT_ToolHarvestHelper.isAppropriateTool(aBlock, aMetaData, "pickaxe") // + || GT_ToolHarvestHelper.isAppropriateMaterial( + aBlock, // + Material.rock, // + Material.glass, // + Material.ice, // + Material.packedIce // + ); } @Override - public int convertBlockDrops(List<ItemStack> aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent) { + public int convertBlockDrops( + List<ItemStack> aDrops, + ItemStack aStack, + EntityPlayer aPlayer, + Block aBlock, + int aX, + int aY, + int aZ, + byte aMetaData, + int aFortune, + boolean aSilkTouch, + BlockEvent.HarvestDropsEvent aEvent) { int rConversions = 0; - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes.findRecipe(null, true, 2147483647L, null, new ItemStack(aBlock, 1, aMetaData)); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes.findRecipe( + null, true, 2147483647L, null, new ItemStack(aBlock, 1, aMetaData)); if ((tRecipe == null) || (aBlock.hasTileEntity(aMetaData))) { for (ItemStack tDrop : aDrops) { - tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes.findRecipe(null, true, 2147483647L, null, GT_Utility.copyAmount(1L, new Object[]{tDrop})); + tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes.findRecipe( + null, true, 2147483647L, null, GT_Utility.copyAmount(1L, new Object[] {tDrop})); if (tRecipe != null) { ItemStack tHammeringOutput = tRecipe.getOutput(0); if (tHammeringOutput != null) { @@ -105,7 +117,6 @@ public class GT_Tool_JackHammer extends GT_Tool_Drill_LV { } } - @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? Textures.ItemIcons.JACKHAMMER : null; @@ -113,6 +124,8 @@ public class GT_Tool_JackHammer extends GT_Tool_Drill_LV { @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " has been jackhammered into pieces by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE); + return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + + " has been jackhammered into pieces by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + + EnumChatFormatting.WHITE); } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Knife.java b/src/main/java/gregtech/common/tools/GT_Tool_Knife.java index 2a4ba6fff9..c211e1ac27 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Knife.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Knife.java @@ -57,6 +57,9 @@ public class GT_Tool_Knife extends GT_Tool_Sword { @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new ChatComponentText("<" + EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + "> " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE + " what are you doing?, " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE + "?!? STAHP!!!"); + return new ChatComponentText("<" + EnumChatFormatting.RED + aEntity.getCommandSenderName() + + EnumChatFormatting.WHITE + "> " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + + EnumChatFormatting.WHITE + " what are you doing?, " + EnumChatFormatting.GREEN + + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE + "?!? STAHP!!!"); } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Mortar.java b/src/main/java/gregtech/common/tools/GT_Tool_Mortar.java index 4244a00638..1042ab6344 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Mortar.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Mortar.java @@ -103,11 +103,12 @@ public class GT_Tool_Mortar extends GT_Tool { } @Override - public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID) { - } + public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID) {} @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " was grounded by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE); + return new ChatComponentText( + EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " was grounded by " + + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE); } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Pickaxe.java b/src/main/java/gregtech/common/tools/GT_Tool_Pickaxe.java index aebd965428..ce7707b4c2 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Pickaxe.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Pickaxe.java @@ -82,13 +82,13 @@ public class GT_Tool_Pickaxe extends GT_Tool { @Override public boolean isMinableBlock(Block aBlock, byte aMetaData) { - return GT_ToolHarvestHelper.isAppropriateTool(aBlock , aMetaData ,"pickaxe")// - || GT_ToolHarvestHelper.isAppropriateMaterial(aBlock,// - Material.rock, - Material.iron, - Material.anvil, - Material.glass - ); + return GT_ToolHarvestHelper.isAppropriateTool(aBlock, aMetaData, "pickaxe") // + || GT_ToolHarvestHelper.isAppropriateMaterial( + aBlock, // + Material.rock, + Material.iron, + Material.anvil, + Material.glass); } @Override @@ -98,17 +98,24 @@ public class GT_Tool_Pickaxe extends GT_Tool { @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadPickaxe.mTextureIndex] : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.stick.mTextureIndex]; + return aIsToolHead + ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack) + .mIconSet + .mTextures[gregtech.api.enums.OrePrefixes.toolHeadPickaxe.mTextureIndex] + : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack) + .mIconSet + .mTextures[gregtech.api.enums.OrePrefixes.stick.mTextureIndex]; } @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; + return aIsToolHead + ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa + : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } @Override - public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID) { - } + public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID) {} @Override public void onToolCrafted(ItemStack aStack, EntityPlayer aPlayer) { @@ -123,6 +130,8 @@ public class GT_Tool_Pickaxe extends GT_Tool { @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " got mined by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE); + return new ChatComponentText( + EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " got mined by " + + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE); } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Plow.java b/src/main/java/gregtech/common/tools/GT_Tool_Plow.java index 3c61e93c9f..dcf5c2675e 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Plow.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Plow.java @@ -3,6 +3,7 @@ package gregtech.common.tools; import gregtech.api.interfaces.IIconContainer; import gregtech.api.items.GT_MetaGenerated_Tool; import gregtech.api.util.GT_ToolHarvestHelper; +import java.util.List; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.Entity; @@ -16,13 +17,12 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; import net.minecraftforge.event.world.BlockEvent; -import java.util.List; - public class GT_Tool_Plow extends GT_Tool { private ThreadLocal<Object> sIsHarvestingRightNow = new ThreadLocal(); @Override - public float getNormalDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer) { + public float getNormalDamageAgainstEntity( + float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer) { return (aEntity instanceof EntitySnowman) ? aOriginalDamage * 4.0F : aOriginalDamage; } @@ -33,23 +33,38 @@ public class GT_Tool_Plow extends GT_Tool { @Override public boolean isMinableBlock(Block aBlock, byte aMetaData) { - return GT_ToolHarvestHelper.isAppropriateTool(aBlock , aMetaData ,"plow") - || GT_ToolHarvestHelper.isAppropriateMaterial(aBlock ,Material.snow ,Material.craftedSnow); - + return GT_ToolHarvestHelper.isAppropriateTool(aBlock, aMetaData, "plow") + || GT_ToolHarvestHelper.isAppropriateMaterial(aBlock, Material.snow, Material.craftedSnow); } @Override - public int convertBlockDrops(List<ItemStack> aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent) { + public int convertBlockDrops( + List<ItemStack> aDrops, + ItemStack aStack, + EntityPlayer aPlayer, + Block aBlock, + int aX, + int aY, + int aZ, + byte aMetaData, + int aFortune, + boolean aSilkTouch, + BlockEvent.HarvestDropsEvent aEvent) { int rConversions = 0; if ((this.sIsHarvestingRightNow.get() == null) && ((aPlayer instanceof EntityPlayerMP))) { this.sIsHarvestingRightNow.set(this); for (int i = -1; i < 2; i++) { for (int j = -1; j < 2; j++) { for (int k = -1; k < 2; k++) { - if (((i != 0) || (j != 0) || (k != 0)) - && (aStack.getItem().getDigSpeed(aStack, aPlayer.worldObj.getBlock(aX + i, aY + j, aZ + k), aPlayer.worldObj.getBlockMetadata(aX + i, aY + j, aZ + k)) > 0.0F) - && (((EntityPlayerMP) aPlayer).theItemInWorldManager.tryHarvestBlock(aX + i, aY + j, aZ + k))) - { + if (((i != 0) || (j != 0) || (k != 0)) + && (aStack.getItem() + .getDigSpeed( + aStack, + aPlayer.worldObj.getBlock(aX + i, aY + j, aZ + k), + aPlayer.worldObj.getBlockMetadata(aX + i, aY + j, aZ + k)) + > 0.0F) + && (((EntityPlayerMP) aPlayer) + .theItemInWorldManager.tryHarvestBlock(aX + i, aY + j, aZ + k))) { rConversions++; } } @@ -62,16 +77,26 @@ public class GT_Tool_Plow extends GT_Tool { @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadPlow.mTextureIndex] : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.stick.mTextureIndex]; + return aIsToolHead + ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack) + .mIconSet + .mTextures[gregtech.api.enums.OrePrefixes.toolHeadPlow.mTextureIndex] + : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack) + .mIconSet + .mTextures[gregtech.api.enums.OrePrefixes.stick.mTextureIndex]; } @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; + return aIsToolHead + ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa + : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new ChatComponentText(EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE + " plew through the yard of " + EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE); + return new ChatComponentText(EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + + EnumChatFormatting.WHITE + " plew through the yard of " + EnumChatFormatting.RED + + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE); } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Plunger.java b/src/main/java/gregtech/common/tools/GT_Tool_Plunger.java index 5c99702baa..a8f557045f 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Plunger.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Plunger.java @@ -44,7 +44,7 @@ public class GT_Tool_Plunger extends GT_Tool { @Override public boolean isMinableBlock(Block aBlock, byte aMetaData) { - return GT_ToolHarvestHelper.isAppropriateTool(aBlock,aMetaData , "plunger"); + return GT_ToolHarvestHelper.isAppropriateTool(aBlock, aMetaData, "plunger"); } @Override @@ -54,7 +54,9 @@ public class GT_Tool_Plunger extends GT_Tool { @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; + return aIsToolHead + ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa + : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } @Override @@ -62,7 +64,12 @@ public class GT_Tool_Plunger extends GT_Tool { aItem.addItemBehavior(aID, new Behaviour_Plunger_Item(getToolDamagePerDropConversion())); aItem.addItemBehavior(aID, new Behaviour_Plunger_Fluid(getToolDamagePerDropConversion())); try { - Object tObject = GT_Utility.callConstructor("gregtech.common.items.behaviors.Behaviour_Plunger_Essentia", 0, null, false, getToolDamagePerDropConversion()); + Object tObject = GT_Utility.callConstructor( + "gregtech.common.items.behaviors.Behaviour_Plunger_Essentia", + 0, + null, + false, + getToolDamagePerDropConversion()); if ((tObject instanceof IItemBehaviour)) { aItem.addItemBehavior(aID, (IItemBehaviour) tObject); } @@ -72,6 +79,8 @@ public class GT_Tool_Plunger extends GT_Tool { @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " got stuck trying to escape through a Pipe while fighting " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE); + return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + + " got stuck trying to escape through a Pipe while fighting " + EnumChatFormatting.GREEN + + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE); } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_RollingPin.java b/src/main/java/gregtech/common/tools/GT_Tool_RollingPin.java index b4b1422d92..3b554c39a4 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_RollingPin.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_RollingPin.java @@ -48,8 +48,7 @@ public class GT_Tool_RollingPin extends GT_Tool { } @Override - public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID) { - } + public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID) {} @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { @@ -58,6 +57,8 @@ public class GT_Tool_RollingPin extends GT_Tool { @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " got flattened by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE); + return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + + " got flattened by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + + EnumChatFormatting.WHITE); } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Saw.java b/src/main/java/gregtech/common/tools/GT_Tool_Saw.java index f2ec7dc4e1..881ed6f61f 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Saw.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Saw.java @@ -4,6 +4,8 @@ import gregtech.api.enums.Textures; import gregtech.api.interfaces.IIconContainer; import gregtech.api.items.GT_MetaGenerated_Tool; import gregtech.api.util.GT_ToolHarvestHelper; +import java.util.ArrayList; +import java.util.List; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.EntityLivingBase; @@ -16,9 +18,6 @@ import net.minecraft.util.IChatComponent; import net.minecraftforge.common.IShearable; import net.minecraftforge.event.world.BlockEvent; -import java.util.ArrayList; -import java.util.List; - public class GT_Tool_Saw extends GT_Tool { @Override public int getToolDamagePerBlockBreak() { @@ -76,17 +75,30 @@ public class GT_Tool_Saw extends GT_Tool { } @Override - public int convertBlockDrops(List<ItemStack> aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent) { + public int convertBlockDrops( + List<ItemStack> aDrops, + ItemStack aStack, + EntityPlayer aPlayer, + Block aBlock, + int aX, + int aY, + int aZ, + byte aMetaData, + int aFortune, + boolean aSilkTouch, + BlockEvent.HarvestDropsEvent aEvent) { if ((aBlock.getMaterial() == Material.leaves) && ((aBlock instanceof IShearable))) { aPlayer.worldObj.setBlock(aX, aY, aZ, aBlock, aMetaData, 0); if (((IShearable) aBlock).isShearable(aStack, aPlayer.worldObj, aX, aY, aZ)) { - ArrayList<ItemStack> tDrops = ((IShearable) aBlock).onSheared(aStack, aPlayer.worldObj, aX, aY, aZ, aFortune); + ArrayList<ItemStack> tDrops = + ((IShearable) aBlock).onSheared(aStack, aPlayer.worldObj, aX, aY, aZ, aFortune); aDrops.clear(); aDrops.addAll(tDrops); aEvent.dropChance = 1.0F; } aPlayer.worldObj.setBlock(aX, aY, aZ, Blocks.air, 0, 0); - } else if (((aBlock.getMaterial() == Material.ice) || (aBlock.getMaterial() == Material.packedIce)) && (aDrops.isEmpty())) { + } else if (((aBlock.getMaterial() == Material.ice) || (aBlock.getMaterial() == Material.packedIce)) + && (aDrops.isEmpty())) { aDrops.add(new ItemStack(aBlock, 1, aMetaData)); aPlayer.worldObj.setBlockToAir(aX, aY, aZ); aEvent.dropChance = 1.0F; @@ -97,16 +109,15 @@ public class GT_Tool_Saw extends GT_Tool { @Override public boolean isMinableBlock(Block aBlock, byte aMetaData) { - return GT_ToolHarvestHelper.isAppropriateTool(aBlock , aMetaData ,"axe" ,"saw") - || GT_ToolHarvestHelper.isAppropriateMaterial(aBlock, - Material.leaves, - Material.vine, - Material.wood, - Material.cactus, - Material.ice, - Material.packedIce - ); - + return GT_ToolHarvestHelper.isAppropriateTool(aBlock, aMetaData, "axe", "saw") + || GT_ToolHarvestHelper.isAppropriateMaterial( + aBlock, + Material.leaves, + Material.vine, + Material.wood, + Material.cactus, + Material.ice, + Material.packedIce); } @Override @@ -116,20 +127,27 @@ public class GT_Tool_Saw extends GT_Tool { @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadSaw.mTextureIndex] : Textures.ItemIcons.HANDLE_SAW; + return aIsToolHead + ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack) + .mIconSet + .mTextures[gregtech.api.enums.OrePrefixes.toolHeadSaw.mTextureIndex] + : Textures.ItemIcons.HANDLE_SAW; } @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; + return aIsToolHead + ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa + : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } @Override - public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID) { - } + public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID) {} @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " was getting cut down by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE); + return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + + " was getting cut down by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + + EnumChatFormatting.WHITE); } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Scoop.java b/src/main/java/gregtech/common/tools/GT_Tool_Scoop.java index 64c40c3b2a..06423f2d45 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Scoop.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Scoop.java @@ -2,7 +2,6 @@ package gregtech.common.tools; import cpw.mods.fml.common.Loader; import gregtech.api.enums.GT_Values; -import gregtech.api.enums.SoundResource; import gregtech.api.enums.Textures; import gregtech.api.interfaces.IIconContainer; import gregtech.api.items.GT_MetaGenerated_Tool; @@ -87,8 +86,8 @@ public class GT_Tool_Scoop extends GT_Tool { @Override public boolean isMinableBlock(Block aBlock, byte aMetaData) { - return GT_ToolHarvestHelper.isAppropriateTool(aBlock , aMetaData ,"scoop") - || GT_ToolHarvestHelper.isAppropriateMaterial(aBlock ,sBeeHiveMaterial); + return GT_ToolHarvestHelper.isAppropriateTool(aBlock, aMetaData, "scoop") + || GT_ToolHarvestHelper.isAppropriateMaterial(aBlock, sBeeHiveMaterial); } @Override @@ -103,21 +102,24 @@ public class GT_Tool_Scoop extends GT_Tool { @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; + return aIsToolHead + ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa + : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } @Override public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID) { - if(Loader.isModLoaded(GT_Values.MOD_ID_FR)){ + if (Loader.isModLoaded(GT_Values.MOD_ID_FR)) { aItem.addItemBehavior(aID, new Behaviour_Scoop(200)); - }else{ + } else { aItem.addItemBehavior(aID, new Behaviour_None()); } - } @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " got scooped up by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE); + return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + + " got scooped up by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + + EnumChatFormatting.WHITE); } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Screwdriver.java b/src/main/java/gregtech/common/tools/GT_Tool_Screwdriver.java index a15c6429cd..b09839f0cc 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Screwdriver.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Screwdriver.java @@ -6,6 +6,8 @@ import gregtech.api.interfaces.IIconContainer; import gregtech.api.items.GT_MetaGenerated_Tool; import gregtech.api.util.GT_ToolHarvestHelper; import gregtech.common.items.behaviors.Behaviour_Screwdriver; +import java.util.Arrays; +import java.util.List; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.Entity; @@ -18,14 +20,18 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; -import java.util.Arrays; -import java.util.List; - public class GT_Tool_Screwdriver extends GT_Tool { - public static final List<String> mEffectiveList = Arrays.asList(EntityCaveSpider.class.getName(), EntitySpider.class.getName(), "EntityTFHedgeSpider", "EntityTFKingSpider", "EntityTFSwarmSpider", "EntityTFTowerBroodling"); + public static final List<String> mEffectiveList = Arrays.asList( + EntityCaveSpider.class.getName(), + EntitySpider.class.getName(), + "EntityTFHedgeSpider", + "EntityTFKingSpider", + "EntityTFSwarmSpider", + "EntityTFTowerBroodling"); @Override - public float getNormalDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer) { + public float getNormalDamageAgainstEntity( + float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer) { String tName = aEntity.getClass().getName(); tName = tName.substring(tName.lastIndexOf('.') + 1); return mEffectiveList.contains(tName) ? aOriginalDamage * 2.0F : aOriginalDamage; @@ -103,8 +109,8 @@ public class GT_Tool_Screwdriver extends GT_Tool { @Override public boolean isMinableBlock(Block aBlock, byte aMetaData) { - return GT_ToolHarvestHelper.isAppropriateTool(aBlock , aMetaData ,"screwdriver") - || GT_ToolHarvestHelper.isAppropriateMaterial(aBlock ,Material.circuits); + return GT_ToolHarvestHelper.isAppropriateTool(aBlock, aMetaData, "screwdriver") + || GT_ToolHarvestHelper.isAppropriateMaterial(aBlock, Material.circuits); } @Override @@ -114,12 +120,18 @@ public class GT_Tool_Screwdriver extends GT_Tool { @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { - return !aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadScrewdriver.mTextureIndex] : Textures.ItemIcons.HANDLE_SCREWDRIVER; + return !aIsToolHead + ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack) + .mIconSet + .mTextures[gregtech.api.enums.OrePrefixes.toolHeadScrewdriver.mTextureIndex] + : Textures.ItemIcons.HANDLE_SCREWDRIVER; } @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return !aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; + return !aIsToolHead + ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa + : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } @Override @@ -129,6 +141,8 @@ public class GT_Tool_Screwdriver extends GT_Tool { @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " is screwed! (by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE + ")"); + return new ChatComponentText( + EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " is screwed! (by " + + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE + ")"); } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Screwdriver_LV.java b/src/main/java/gregtech/common/tools/GT_Tool_Screwdriver_LV.java index d8d97cdc4b..4243e9549f 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Screwdriver_LV.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Screwdriver_LV.java @@ -18,11 +18,17 @@ public class GT_Tool_Screwdriver_LV extends GT_Tool_Screwdriver { @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { - return !aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadScrewdriver.mTextureIndex] : Textures.ItemIcons.HANDLE_ELECTRIC_SCREWDRIVER; + return !aIsToolHead + ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack) + .mIconSet + .mTextures[gregtech.api.enums.OrePrefixes.toolHeadScrewdriver.mTextureIndex] + : Textures.ItemIcons.HANDLE_ELECTRIC_SCREWDRIVER; } @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return !aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; + return !aIsToolHead + ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa + : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Sense.java b/src/main/java/gregtech/common/tools/GT_Tool_Sense.java index 84c63854c2..18245a7897 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Sense.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Sense.java @@ -4,6 +4,7 @@ import gregtech.api.interfaces.IIconContainer; import gregtech.api.items.GT_MetaGenerated_Tool; import gregtech.api.util.GT_ToolHarvestHelper; import gregtech.common.items.behaviors.Behaviour_Sense; +import java.util.List; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.EntityLivingBase; @@ -15,8 +16,6 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; import net.minecraftforge.event.world.BlockEvent; -import java.util.List; - public class GT_Tool_Sense extends GT_Tool { private ThreadLocal<Object> sIsHarvestingRightNow = new ThreadLocal(); @@ -24,30 +23,46 @@ public class GT_Tool_Sense extends GT_Tool { public float getBaseDamage() { return 3.0F; } - + @Override public float getMaxDurabilityMultiplier() { return 4.0F; } - @Override public boolean isMinableBlock(Block aBlock, byte aMetaData) { - return GT_ToolHarvestHelper.isAppropriateTool(aBlock , aMetaData ,"sense" , "scythe") - || GT_ToolHarvestHelper.isAppropriateMaterial(aBlock ,Material.plants ,Material.leaves); + return GT_ToolHarvestHelper.isAppropriateTool(aBlock, aMetaData, "sense", "scythe") + || GT_ToolHarvestHelper.isAppropriateMaterial(aBlock, Material.plants, Material.leaves); } @Override - public int convertBlockDrops(List<ItemStack> aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent) { + public int convertBlockDrops( + List<ItemStack> aDrops, + ItemStack aStack, + EntityPlayer aPlayer, + Block aBlock, + int aX, + int aY, + int aZ, + byte aMetaData, + int aFortune, + boolean aSilkTouch, + BlockEvent.HarvestDropsEvent aEvent) { int rConversions = 0; if ((this.sIsHarvestingRightNow.get() == null) && ((aPlayer instanceof EntityPlayerMP))) { this.sIsHarvestingRightNow.set(this); for (int i = -2; i < 3; i++) { for (int j = -2; j < 3; j++) { for (int k = -2; k < 3; k++) { - if (((i != 0) || (j != 0) || (k != 0)) - && (aStack.getItem().getDigSpeed(aStack, aPlayer.worldObj.getBlock(aX + i, aY + j, aZ + k), aPlayer.worldObj.getBlockMetadata(aX + i, aY + j, aZ + k)) > 0.0F) - && (((EntityPlayerMP) aPlayer).theItemInWorldManager.tryHarvestBlock(aX + i, aY + j, aZ + k))) { + if (((i != 0) || (j != 0) || (k != 0)) + && (aStack.getItem() + .getDigSpeed( + aStack, + aPlayer.worldObj.getBlock(aX + i, aY + j, aZ + k), + aPlayer.worldObj.getBlockMetadata(aX + i, aY + j, aZ + k)) + > 0.0F) + && (((EntityPlayerMP) aPlayer) + .theItemInWorldManager.tryHarvestBlock(aX + i, aY + j, aZ + k))) { rConversions++; } } @@ -60,12 +75,20 @@ public class GT_Tool_Sense extends GT_Tool { @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadSense.mTextureIndex] : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.stick.mTextureIndex]; + return aIsToolHead + ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack) + .mIconSet + .mTextures[gregtech.api.enums.OrePrefixes.toolHeadSense.mTextureIndex] + : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack) + .mIconSet + .mTextures[gregtech.api.enums.OrePrefixes.stick.mTextureIndex]; } @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; + return aIsToolHead + ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa + : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } @Override @@ -75,6 +98,8 @@ public class GT_Tool_Sense extends GT_Tool { @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new ChatComponentText(EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE + " has taken the Soul of " + EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE); + return new ChatComponentText(EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + + EnumChatFormatting.WHITE + " has taken the Soul of " + EnumChatFormatting.RED + + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE); } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Shovel.java b/src/main/java/gregtech/common/tools/GT_Tool_Shovel.java index 8b29b6adf2..1cd88bf281 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Shovel.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Shovel.java @@ -80,13 +80,8 @@ public class GT_Tool_Shovel extends GT_Tool { @Override public boolean isMinableBlock(Block aBlock, byte aMetaData) { return GT_ToolHarvestHelper.isAppropriateTool(aBlock, aMetaData, "shovel") - || GT_ToolHarvestHelper.isAppropriateMaterial(aBlock, - Material.sand, - Material.grass, - Material.ground, - Material.snow, - Material.clay - ); + || GT_ToolHarvestHelper.isAppropriateMaterial( + aBlock, Material.sand, Material.grass, Material.ground, Material.snow, Material.clay); } @Override @@ -96,20 +91,29 @@ public class GT_Tool_Shovel extends GT_Tool { @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadShovel.mTextureIndex] : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.stick.mTextureIndex]; + return aIsToolHead + ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack) + .mIconSet + .mTextures[gregtech.api.enums.OrePrefixes.toolHeadShovel.mTextureIndex] + : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack) + .mIconSet + .mTextures[gregtech.api.enums.OrePrefixes.stick.mTextureIndex]; } @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; + return aIsToolHead + ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa + : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } @Override - public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID) { - } + public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID) {} @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " got dug up by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE); + return new ChatComponentText( + EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " got dug up by " + + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE); } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_SoftHammer.java b/src/main/java/gregtech/common/tools/GT_Tool_SoftHammer.java index 87255cfeb8..09e4174c96 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_SoftHammer.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_SoftHammer.java @@ -96,7 +96,7 @@ public class GT_Tool_SoftHammer extends GT_Tool { @Override public boolean isMinableBlock(Block aBlock, byte aMetaData) { - return GT_ToolHarvestHelper.isAppropriateTool(aBlock , aMetaData ,"softhammer"); + return GT_ToolHarvestHelper.isAppropriateTool(aBlock, aMetaData, "softhammer"); } @Override @@ -106,12 +106,20 @@ public class GT_Tool_SoftHammer extends GT_Tool { @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadMallet.mTextureIndex] : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.handleMallet.mTextureIndex]; + return aIsToolHead + ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack) + .mIconSet + .mTextures[gregtech.api.enums.OrePrefixes.toolHeadMallet.mTextureIndex] + : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack) + .mIconSet + .mTextures[gregtech.api.enums.OrePrefixes.handleMallet.mTextureIndex]; } @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; + return aIsToolHead + ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa + : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } @Override @@ -121,6 +129,8 @@ public class GT_Tool_SoftHammer extends GT_Tool { @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " was hammered to death by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE); + return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + + " was hammered to death by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + + EnumChatFormatting.WHITE); } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Soldering_Iron.java b/src/main/java/gregtech/common/tools/GT_Tool_Soldering_Iron.java index a5f2bb1e01..2d4728e4da 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Soldering_Iron.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Soldering_Iron.java @@ -6,6 +6,8 @@ import gregtech.api.interfaces.IIconContainer; import gregtech.api.items.GT_MetaGenerated_Tool; import gregtech.api.util.GT_ToolHarvestHelper; import gregtech.common.items.behaviors.Behaviour_Screwdriver; +import java.util.Arrays; +import java.util.List; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.Entity; @@ -18,14 +20,18 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; -import java.util.Arrays; -import java.util.List; - public class GT_Tool_Soldering_Iron extends GT_Tool { - public static final List<String> mEffectiveList = Arrays.asList(EntityCaveSpider.class.getName(), EntitySpider.class.getName(), "EntityTFHedgeSpider", "EntityTFKingSpider", "EntityTFSwarmSpider", "EntityTFTowerBroodling"); + public static final List<String> mEffectiveList = Arrays.asList( + EntityCaveSpider.class.getName(), + EntitySpider.class.getName(), + "EntityTFHedgeSpider", + "EntityTFKingSpider", + "EntityTFSwarmSpider", + "EntityTFTowerBroodling"); @Override - public float getNormalDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer) { + public float getNormalDamageAgainstEntity( + float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer) { String tName = aEntity.getClass().getName(); tName = tName.substring(tName.lastIndexOf('.') + 1); return mEffectiveList.contains(tName) ? aOriginalDamage * 2.0F : aOriginalDamage; @@ -105,7 +111,6 @@ public class GT_Tool_Soldering_Iron extends GT_Tool { public boolean isMinableBlock(Block aBlock, byte aMetaData) { return GT_ToolHarvestHelper.isAppropriateTool(aBlock, aMetaData, "soldering_iron") || GT_ToolHarvestHelper.isAppropriateMaterial(aBlock, Material.circuits); - } @Override @@ -115,12 +120,16 @@ public class GT_Tool_Soldering_Iron extends GT_Tool { @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { - return !aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mIconSet.mTextures[49] : Textures.ItemIcons.HANDLE_SOLDERING; + return !aIsToolHead + ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mIconSet.mTextures[49] + : Textures.ItemIcons.HANDLE_SOLDERING; } @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return !aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; + return !aIsToolHead + ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa + : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } @Override @@ -130,6 +139,8 @@ public class GT_Tool_Soldering_Iron extends GT_Tool { @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " got soldert! (by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE + ")"); + return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + + " got soldert! (by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + + EnumChatFormatting.WHITE + ")"); } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Sword.java b/src/main/java/gregtech/common/tools/GT_Tool_Sword.java index 4f1d60a37a..baafab6136 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Sword.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Sword.java @@ -84,19 +84,19 @@ public class GT_Tool_Sword extends GT_Tool { @Override public boolean isMinableBlock(Block aBlock, byte aMetaData) { return GT_ToolHarvestHelper.isAppropriateTool(aBlock, aMetaData, "sword") - || GT_ToolHarvestHelper.isAppropriateMaterial(aBlock, - Material.leaves, - Material.gourd, - Material.vine, - Material.web, - Material.cloth, - Material.carpet, - Material.plants, - Material.cactus, - Material.cake, - Material.tnt, - Material.sponge - ); + || GT_ToolHarvestHelper.isAppropriateMaterial( + aBlock, + Material.leaves, + Material.gourd, + Material.vine, + Material.web, + Material.cloth, + Material.carpet, + Material.plants, + Material.cactus, + Material.cake, + Material.tnt, + Material.sponge); } @Override @@ -106,12 +106,18 @@ public class GT_Tool_Sword extends GT_Tool { @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { - return !aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadSword.mTextureIndex] : Textures.ItemIcons.HANDLE_SWORD; + return !aIsToolHead + ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack) + .mIconSet + .mTextures[gregtech.api.enums.OrePrefixes.toolHeadSword.mTextureIndex] + : Textures.ItemIcons.HANDLE_SWORD; } @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return !aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; + return !aIsToolHead + ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa + : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } @Override diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Turbine.java b/src/main/java/gregtech/common/tools/GT_Tool_Turbine.java index 249ca04acb..dd5d2b424e 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Turbine.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Turbine.java @@ -30,8 +30,9 @@ public abstract class GT_Tool_Turbine extends GT_Tool { @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new ChatComponentText(EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE + " put " + EnumChatFormatting.RED + - aEntity.getCommandSenderName() + "s" + EnumChatFormatting.WHITE + " head into a turbine"); + return new ChatComponentText(EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + + EnumChatFormatting.WHITE + " put " + EnumChatFormatting.RED + aEntity.getCommandSenderName() + "s" + + EnumChatFormatting.WHITE + " head into a turbine"); } public abstract IIconContainer getTurbineIcon(); diff --git a/src/main/java/gregtech/common/tools/GT_Tool_UniversalSpade.java b/src/main/java/gregtech/common/tools/GT_Tool_UniversalSpade.java index d494af7e76..b534ef2d23 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_UniversalSpade.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_UniversalSpade.java @@ -89,26 +89,26 @@ public class GT_Tool_UniversalSpade extends GT_Tool { @Override public boolean isMinableBlock(Block aBlock, byte aMetaData) { return GT_ToolHarvestHelper.isAppropriateTool(aBlock, aMetaData, "shovel", "axe", "saw", "sword", "crowbar") - || GT_ToolHarvestHelper.isAppropriateMaterial(aBlock, - Material.sand, - Material.grass, - Material.ground, - Material.snow, - Material.clay, - Material.leaves, - Material.vine, - Material.wood, - Material.cactus, - Material.circuits, - Material.gourd, - Material.web, - Material.cloth, - Material.carpet, - Material.plants, - Material.cake, - Material.tnt, - Material.sponge - ); + || GT_ToolHarvestHelper.isAppropriateMaterial( + aBlock, + Material.sand, + Material.grass, + Material.ground, + Material.snow, + Material.clay, + Material.leaves, + Material.vine, + Material.wood, + Material.cactus, + Material.circuits, + Material.gourd, + Material.web, + Material.cloth, + Material.carpet, + Material.plants, + Material.cake, + Material.tnt, + Material.sponge); } @Override @@ -118,12 +118,20 @@ public class GT_Tool_UniversalSpade extends GT_Tool { @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadUniversalSpade.mTextureIndex] : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.stick.mTextureIndex]; + return aIsToolHead + ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack) + .mIconSet + .mTextures[gregtech.api.enums.OrePrefixes.toolHeadUniversalSpade.mTextureIndex] + : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack) + .mIconSet + .mTextures[gregtech.api.enums.OrePrefixes.stick.mTextureIndex]; } @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; + return aIsToolHead + ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa + : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } @Override @@ -143,6 +151,8 @@ public class GT_Tool_UniversalSpade extends GT_Tool { @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " has been digged by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE); + return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + + " has been digged by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + + EnumChatFormatting.WHITE); } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_WireCutter.java b/src/main/java/gregtech/common/tools/GT_Tool_WireCutter.java index b9282b4224..dedf87a553 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_WireCutter.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_WireCutter.java @@ -80,7 +80,7 @@ public class GT_Tool_WireCutter extends GT_Tool { @Override public boolean isMinableBlock(Block aBlock, byte aMetaData) { - return GT_ToolHarvestHelper.isAppropriateTool(aBlock , aMetaData ,"cutter"); + return GT_ToolHarvestHelper.isAppropriateTool(aBlock, aMetaData, "cutter"); } @Override @@ -95,15 +95,18 @@ public class GT_Tool_WireCutter extends GT_Tool { @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; + return aIsToolHead + ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa + : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } @Override - public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID) { - } + public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID) {} @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new ChatComponentText(EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE + " has cut the Cable for the Life Support Machine of " + EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE); + return new ChatComponentText(EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + + EnumChatFormatting.WHITE + " has cut the Cable for the Life Support Machine of " + + EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE); } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Wrench.java b/src/main/java/gregtech/common/tools/GT_Tool_Wrench.java index 95ebc36bb2..77aac357e8 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Wrench.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Wrench.java @@ -6,6 +6,8 @@ import gregtech.api.interfaces.IIconContainer; import gregtech.api.items.GT_MetaGenerated_Tool; import gregtech.api.util.GT_ToolHarvestHelper; import gregtech.common.items.behaviors.Behaviour_Wrench; +import java.util.Arrays; +import java.util.List; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.Entity; @@ -18,14 +20,13 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; -import java.util.Arrays; -import java.util.List; - public class GT_Tool_Wrench extends GT_Tool { - public static final List<String> mEffectiveList = Arrays.asList(EntityIronGolem.class.getName(), "EntityTowerGuardian"); + public static final List<String> mEffectiveList = + Arrays.asList(EntityIronGolem.class.getName(), "EntityTowerGuardian"); @Override - public float getNormalDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer) { + public float getNormalDamageAgainstEntity( + float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer) { String tName = aEntity.getClass().getName(); tName = tName.substring(tName.lastIndexOf('.') + 1); return (mEffectiveList.contains(tName)) || (tName.contains("Golem")) ? aOriginalDamage * 2.0F : aOriginalDamage; @@ -110,8 +111,7 @@ public class GT_Tool_Wrench extends GT_Tool { public boolean isMinableBlock(Block aBlock, byte aMetaData) { return GT_ToolHarvestHelper.isAppropriateTool(aBlock, aMetaData, "wrench") || GT_ToolHarvestHelper.isAppropriateMaterial(aBlock, Material.piston) - || GT_ToolHarvestHelper.isSpecialBlock(aBlock,Blocks.hopper, Blocks.dispenser, Blocks.dropper); - + || GT_ToolHarvestHelper.isSpecialBlock(aBlock, Blocks.hopper, Blocks.dispenser, Blocks.dropper); } @Override @@ -136,7 +136,8 @@ public class GT_Tool_Wrench extends GT_Tool { @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new ChatComponentText(EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE + " threw a Monkey Wrench into the Plans of " + EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE); + return new ChatComponentText(EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + + EnumChatFormatting.WHITE + " threw a Monkey Wrench into the Plans of " + EnumChatFormatting.RED + + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE); } } - diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Wrench_HV.java b/src/main/java/gregtech/common/tools/GT_Tool_Wrench_HV.java index 4ec433d9a7..e0ccdfde4f 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Wrench_HV.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Wrench_HV.java @@ -53,11 +53,17 @@ public class GT_Tool_Wrench_HV extends GT_Tool_Wrench_LV { @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadWrench.mTextureIndex] : Textures.ItemIcons.POWER_UNIT_HV; + return aIsToolHead + ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack) + .mIconSet + .mTextures[gregtech.api.enums.OrePrefixes.toolHeadWrench.mTextureIndex] + : Textures.ItemIcons.POWER_UNIT_HV; } @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; + return aIsToolHead + ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa + : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Wrench_LV.java b/src/main/java/gregtech/common/tools/GT_Tool_Wrench_LV.java index 12b83dcb83..999d26ae9e 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Wrench_LV.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Wrench_LV.java @@ -9,7 +9,8 @@ import net.minecraft.item.ItemStack; public class GT_Tool_Wrench_LV extends GT_Tool_Wrench { @Override - public float getNormalDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer) { + public float getNormalDamageAgainstEntity( + float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer) { return aOriginalDamage; } @@ -60,11 +61,17 @@ public class GT_Tool_Wrench_LV extends GT_Tool_Wrench { @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadWrench.mTextureIndex] : Textures.ItemIcons.POWER_UNIT_LV; + return aIsToolHead + ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack) + .mIconSet + .mTextures[gregtech.api.enums.OrePrefixes.toolHeadWrench.mTextureIndex] + : Textures.ItemIcons.POWER_UNIT_LV; } @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; + return aIsToolHead + ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa + : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Wrench_MV.java b/src/main/java/gregtech/common/tools/GT_Tool_Wrench_MV.java index 5ffc3b1481..fe2f0611ab 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Wrench_MV.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Wrench_MV.java @@ -53,11 +53,17 @@ public class GT_Tool_Wrench_MV extends GT_Tool_Wrench_LV { @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadWrench.mTextureIndex] : Textures.ItemIcons.POWER_UNIT_MV; + return aIsToolHead + ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack) + .mIconSet + .mTextures[gregtech.api.enums.OrePrefixes.toolHeadWrench.mTextureIndex] + : Textures.ItemIcons.POWER_UNIT_MV; } @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; + return aIsToolHead + ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa + : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } } |