diff options
Diffstat (limited to 'src/main/java/gregtech/common/GT_Client.java')
-rw-r--r-- | src/main/java/gregtech/common/GT_Client.java | 413 |
1 files changed, 286 insertions, 127 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(); |