From 011d2a771a2c414781188e1616b9f5776abcff1e Mon Sep 17 00:00:00 2001 From: Technus Date: Mon, 18 Apr 2016 12:48:28 +0200 Subject: [PATCH 1/3] Adding GT:NH Capes --- build.properties | 2 +- src/main/java/gregtech/common/GT_Client.java | 22 +++++++++++++++++++ .../common/render/GT_CapeRenderer.java | 17 +++++++++++++- 3 files changed, 39 insertions(+), 2 deletions(-) diff --git a/build.properties b/build.properties index d131a917..2770ef27 100644 --- a/build.properties +++ b/build.properties @@ -1,7 +1,7 @@ minecraft.version=1.7.10 forge.version=10.13.4.1566-1.7.10 -gt.version=5.08.33.12 +gt.version=5.08.33.15 ae2.version=rv2-beta-33 applecore.version=1.7.10-1.2.1+107.59407 diff --git a/src/main/java/gregtech/common/GT_Client.java b/src/main/java/gregtech/common/GT_Client.java index a50fc174..b54c3e3e 100644 --- a/src/main/java/gregtech/common/GT_Client.java +++ b/src/main/java/gregtech/common/GT_Client.java @@ -231,6 +231,28 @@ public class GT_Client extends GT_Proxy } public void run() { + try { + GT_Log.out.println("GT New Horizons: Downloading Cape List."); + @SuppressWarnings("resource") + Scanner tScanner = new Scanner(new URL("https://raw.githubusercontent.com/GTNewHorizons/CustomGTCapeHook-Cape-List/master/capes.txt").openStream()); + while (tScanner.hasNextLine()) { + String tName = tScanner.nextLine(); + + if (tName.contains(":")) { + int splitLocation = tName.indexOf(":"); + String username = tName.substring(0, splitLocation); + if (!this.mCapeList.contains(username.toLowerCase()) && !this.mCapeList.contains(tName.toLowerCase())) { + this.mCapeList.add(tName.toLowerCase()); + } + } else { + if (!this.mCapeList.contains(tName.toLowerCase())) { + this.mCapeList.add(tName.toLowerCase()); + } + } + } + } catch (Throwable e) { + } + try { GT_Log.out.println("GT_Mod: Downloading Cape List."); @SuppressWarnings("resource") diff --git a/src/main/java/gregtech/common/render/GT_CapeRenderer.java b/src/main/java/gregtech/common/render/GT_CapeRenderer.java index 49ba9a72..852880e4 100644 --- a/src/main/java/gregtech/common/render/GT_CapeRenderer.java +++ b/src/main/java/gregtech/common/render/GT_CapeRenderer.java @@ -17,7 +17,13 @@ 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")}; + 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 mCapeList; public GT_CapeRenderer(Collection aCapeList) { @@ -52,6 +58,15 @@ public class GT_CapeRenderer if (aPlayer.getDisplayName().equalsIgnoreCase("GregoriusT")) { tResource = this.mCapes[3]; } + if (this.mCapeList.contains(aPlayer.getDisplayName().toLowerCase()+":capeDonor")) { + tResource = this.mCapes[4]; + } + if (this.mCapeList.contains(aPlayer.getDisplayName().toLowerCase()+":capeDev")) { + tResource = this.mCapes[5]; + } + if (this.mCapeList.contains(aPlayer.getDisplayName().toLowerCase()+":capeTec")) { + tResource = this.mCapes[6]; + } if ((tResource != null) && (!aPlayer.getHideCape())) { bindTexture(tResource); GL11.glPushMatrix(); From bf62bffefb785cc7f9590c3b526e99aaa7b64b9a Mon Sep 17 00:00:00 2001 From: Technus Date: Mon, 18 Apr 2016 12:48:28 +0200 Subject: [PATCH 2/3] Adding GT:NH Capes --- src/main/java/gregtech/common/GT_Client.java | 22 +++++++++++++++++++ .../common/render/GT_CapeRenderer.java | 17 +++++++++++++- 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/src/main/java/gregtech/common/GT_Client.java b/src/main/java/gregtech/common/GT_Client.java index a50fc174..b54c3e3e 100644 --- a/src/main/java/gregtech/common/GT_Client.java +++ b/src/main/java/gregtech/common/GT_Client.java @@ -231,6 +231,28 @@ public class GT_Client extends GT_Proxy } public void run() { + try { + GT_Log.out.println("GT New Horizons: Downloading Cape List."); + @SuppressWarnings("resource") + Scanner tScanner = new Scanner(new URL("https://raw.githubusercontent.com/GTNewHorizons/CustomGTCapeHook-Cape-List/master/capes.txt").openStream()); + while (tScanner.hasNextLine()) { + String tName = tScanner.nextLine(); + + if (tName.contains(":")) { + int splitLocation = tName.indexOf(":"); + String username = tName.substring(0, splitLocation); + if (!this.mCapeList.contains(username.toLowerCase()) && !this.mCapeList.contains(tName.toLowerCase())) { + this.mCapeList.add(tName.toLowerCase()); + } + } else { + if (!this.mCapeList.contains(tName.toLowerCase())) { + this.mCapeList.add(tName.toLowerCase()); + } + } + } + } catch (Throwable e) { + } + try { GT_Log.out.println("GT_Mod: Downloading Cape List."); @SuppressWarnings("resource") diff --git a/src/main/java/gregtech/common/render/GT_CapeRenderer.java b/src/main/java/gregtech/common/render/GT_CapeRenderer.java index 49ba9a72..852880e4 100644 --- a/src/main/java/gregtech/common/render/GT_CapeRenderer.java +++ b/src/main/java/gregtech/common/render/GT_CapeRenderer.java @@ -17,7 +17,13 @@ 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")}; + 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 mCapeList; public GT_CapeRenderer(Collection aCapeList) { @@ -52,6 +58,15 @@ public class GT_CapeRenderer if (aPlayer.getDisplayName().equalsIgnoreCase("GregoriusT")) { tResource = this.mCapes[3]; } + if (this.mCapeList.contains(aPlayer.getDisplayName().toLowerCase()+":capeDonor")) { + tResource = this.mCapes[4]; + } + if (this.mCapeList.contains(aPlayer.getDisplayName().toLowerCase()+":capeDev")) { + tResource = this.mCapes[5]; + } + if (this.mCapeList.contains(aPlayer.getDisplayName().toLowerCase()+":capeTec")) { + tResource = this.mCapes[6]; + } if ((tResource != null) && (!aPlayer.getHideCape())) { bindTexture(tResource); GL11.glPushMatrix(); From 324b1b56e709966998d57ab4c078d5e8628d9f75 Mon Sep 17 00:00:00 2001 From: Technus Date: Mon, 18 Apr 2016 16:25:35 +0200 Subject: [PATCH 3/3] Adding GT:NH Capes --- src/main/java/gregtech/common/GT_Client.java | 26 ++++++++++--------- .../common/render/GT_CapeRenderer.java | 6 ++--- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/main/java/gregtech/common/GT_Client.java b/src/main/java/gregtech/common/GT_Client.java index b54c3e3e..e58669e1 100644 --- a/src/main/java/gregtech/common/GT_Client.java +++ b/src/main/java/gregtech/common/GT_Client.java @@ -231,6 +231,19 @@ public class GT_Client extends GT_Proxy } public void run() { + try { + GT_Log.out.println("GT_Mod: Downloading Cape List."); + @SuppressWarnings("resource") + Scanner tScanner = new Scanner(new URL("http://files.minecraftforge.net/maven/com/gregoriust/gregtech/capelist.txt").openStream()); + while (tScanner.hasNextLine()) { + String tName = tScanner.nextLine(); + if (!this.mCapeList.contains(tName.toLowerCase())) { + this.mCapeList.add(tName.toLowerCase()); + } + } + } catch (Throwable e) { + } + try { GT_Log.out.println("GT New Horizons: Downloading Cape List."); @SuppressWarnings("resource") @@ -253,18 +266,7 @@ public class GT_Client extends GT_Proxy } catch (Throwable e) { } - try { - GT_Log.out.println("GT_Mod: Downloading Cape List."); - @SuppressWarnings("resource") - Scanner tScanner = new Scanner(new URL("http://files.minecraftforge.net/maven/com/gregoriust/gregtech/capelist.txt").openStream()); - while (tScanner.hasNextLine()) { - String tName = tScanner.nextLine(); - if (!this.mCapeList.contains(tName.toLowerCase())) { - this.mCapeList.add(tName.toLowerCase()); - } - } - } catch (Throwable e) { - } + try { GT_Log.out.println("GT_Mod: Downloading News."); @SuppressWarnings("resource") diff --git a/src/main/java/gregtech/common/render/GT_CapeRenderer.java b/src/main/java/gregtech/common/render/GT_CapeRenderer.java index 852880e4..c62a6870 100644 --- a/src/main/java/gregtech/common/render/GT_CapeRenderer.java +++ b/src/main/java/gregtech/common/render/GT_CapeRenderer.java @@ -58,13 +58,13 @@ public class GT_CapeRenderer 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]; } if ((tResource != null) && (!aPlayer.getHideCape())) {