diff options
author | Alkalus <draknyte1@hotmail.com> | 2017-09-09 20:18:49 +1000 |
---|---|---|
committer | Alkalus <draknyte1@hotmail.com> | 2017-09-09 20:18:49 +1000 |
commit | 866441a1afcc2cdd74e2230904d4ddb1f43bf037 (patch) | |
tree | 6a8a021654d9a1ed69b5010f3256af8a8f1f7b6d /src/Java/gtPlusPlus/core | |
parent | e5eeb63d2f8307aebf13453b664386a7d28d3e8b (diff) | |
download | GT5-Unofficial-866441a1afcc2cdd74e2230904d4ddb1f43bf037.tar.gz GT5-Unofficial-866441a1afcc2cdd74e2230904d4ddb1f43bf037.tar.bz2 GT5-Unofficial-866441a1afcc2cdd74e2230904d4ddb1f43bf037.zip |
+ Added Cape handler for shits and giggles.
Diffstat (limited to 'src/Java/gtPlusPlus/core')
-rw-r--r-- | src/Java/gtPlusPlus/core/lib/CORE.java | 3 | ||||
-rw-r--r-- | src/Java/gtPlusPlus/core/proxy/ClientProxy.java | 54 |
2 files changed, 49 insertions, 8 deletions
diff --git a/src/Java/gtPlusPlus/core/lib/CORE.java b/src/Java/gtPlusPlus/core/lib/CORE.java index 5d88740aac..a45db02fe6 100644 --- a/src/Java/gtPlusPlus/core/lib/CORE.java +++ b/src/Java/gtPlusPlus/core/lib/CORE.java @@ -45,6 +45,9 @@ public class CORE { public static final boolean MAIN_GREGTECH_5U_EXPERIMENTAL_FORK = Meta_GT_Proxy.areWeUsingGregtech5uExperimental(); public static final int GREGTECH_API_VERSION = GregTech_API.VERSION; public static IGregtech_RecipeAdder RA; + + public static boolean mEnableCape = false; + @Deprecated public static IGregtech_RecipeAdder sRecipeAdder; public static GregtechRecipe GT_Recipe = new GregtechRecipe(); diff --git a/src/Java/gtPlusPlus/core/proxy/ClientProxy.java b/src/Java/gtPlusPlus/core/proxy/ClientProxy.java index d13e7f347b..1500982990 100644 --- a/src/Java/gtPlusPlus/core/proxy/ClientProxy.java +++ b/src/Java/gtPlusPlus/core/proxy/ClientProxy.java @@ -1,9 +1,14 @@ package gtPlusPlus.core.proxy; +import java.net.URL; +import java.util.HashSet; +import java.util.Scanner; + import cpw.mods.fml.client.registry.ClientRegistry; import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.common.Optional; import cpw.mods.fml.common.event.*; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gtPlusPlus.GTplusplus; @@ -19,27 +24,33 @@ import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.tileentities.general.TileEntityFirepit; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.particles.EntityParticleFXMysterious; +import gtPlusPlus.xmod.gregtech.common.render.GTPP_CapeRenderer; import net.minecraft.client.Minecraft; import net.minecraft.client.particle.EntityFX; import net.minecraft.client.renderer.entity.RenderIronGolem; import net.minecraft.entity.Entity; -public class ClientProxy extends CommonProxy{ - - /*private final HashSet<String> mCapeList = new HashSet<String>(); - private final CapeHandler mCapeRenderer; +public class ClientProxy extends CommonProxy implements Runnable{ - ClientProxy(){ - mCapeRenderer = new CapeHandler(mCapeList); - } - */ + private final HashSet mCapeList = new HashSet(); + private final GTPP_CapeRenderer mCapeRenderer; + + public ClientProxy(){ + mCapeRenderer = new GTPP_CapeRenderer(mCapeList); + } + @SubscribeEvent + public void receiveRenderSpecialsEvent(net.minecraftforge.client.event.RenderPlayerEvent.Specials.Pre aEvent) { + mCapeRenderer.receiveRenderSpecialsEvent(aEvent); + } + @SideOnly(Side.CLIENT) public static String playerName = ""; @Override public void preInit(final FMLPreInitializationEvent e) { super.preInit(e); + onPreLoad(); //Do this weird things for textures. GTplusplus.loadTextures(); //We boot up the sneak manager. @@ -136,5 +147,32 @@ public class ClientProxy extends CommonProxy{ } + + public void onPreLoad() { + String arr$[] = { + "draknyte1", "fobius" + }; + int len$ = arr$.length; + for (int i$ = 0; i$ < len$; i$++) { + String tName = arr$[i$]; + mCapeList.add(tName.toLowerCase()); + } + (new Thread(this)).start(); + } + + public void run() { + try { + Utils.LOG_INFO("Skip: GT++ Mod: Downloading Cape List."); + @SuppressWarnings("resource") + Scanner tScanner = new Scanner(new URL("https://github.com/draknyte1/GTplusplus/blob/master/SupporterList.txt").openStream()); + while (tScanner.hasNextLine()) { + String tName = tScanner.nextLine(); + if (!this.mCapeList.contains(tName.toLowerCase())) { + this.mCapeList.add(tName.toLowerCase()); + } + } + } catch (Throwable e) { + } + } } |