mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-26 15:03:01 +00:00
Removing anything to do with capes, adding back the NEI, and IMC plugins
This commit is contained in:
1 parent
f58e80425a
commit
316dddbaa8
6 files changed
+102
-182
No files matched your search
@@ -13,7 +13,6 @@ import tconstruct.armor.ArmorProxyClient;
|
||||
import tconstruct.armor.ArmorProxyCommon;
|
||||
import tconstruct.armor.PlayerAbilityHelper;
|
||||
import tconstruct.armor.items.TravelGear;
|
||||
import tconstruct.client.event.EventCloakRender;
|
||||
import tconstruct.client.tabs.TabRegistry;
|
||||
import tconstruct.util.network.AccessoryInventoryPacket;
|
||||
import tconstruct.util.network.BeltPacket;
|
||||
@@ -25,7 +24,6 @@ public class TControls extends TKeyHandler
|
||||
{
|
||||
public static final String keybindCategory = "tconstruct.keybindings";
|
||||
public static KeyBinding armorKey = new KeyBinding("key.tarmor", 24, keybindCategory);
|
||||
public static KeyBinding refreshCapes = new KeyBinding("key.tcapes.reload", 88, keybindCategory);
|
||||
public static KeyBinding toggleGoggles = new KeyBinding("key.tgoggles", 34, keybindCategory);
|
||||
public static KeyBinding beltSwap = new KeyBinding("key.tbelt", 48, keybindCategory);
|
||||
public static KeyBinding zoomKey = new KeyBinding("key.tzoom", 44, keybindCategory); //TODO: Make this hold, not toggle
|
||||
@@ -46,7 +44,7 @@ public class TControls extends TKeyHandler
|
||||
|
||||
public TControls()
|
||||
{
|
||||
super(new KeyBinding[] { armorKey, refreshCapes, toggleGoggles, beltSwap, zoomKey }, new boolean[] { false, false, false, false, false }, getVanillaKeyBindings(), new boolean[] { false, false });
|
||||
super(new KeyBinding[] { armorKey, toggleGoggles, beltSwap, zoomKey }, new boolean[] { false, false, false, false }, getVanillaKeyBindings(), new boolean[] { false, false });
|
||||
/*ClientRegistry.registerKeyBinding(armorKey);
|
||||
ClientRegistry.registerKeyBinding(refreshCapes);
|
||||
ClientRegistry.registerKeyBinding(toggleGoggles);
|
||||
@@ -76,10 +74,6 @@ public class TControls extends TKeyHandler
|
||||
{
|
||||
TabRegistry.addTabsToInventory((GuiContainer) mc.currentScreen);
|
||||
}
|
||||
if (kb == refreshCapes && mc.currentScreen == null)
|
||||
{
|
||||
EventCloakRender.instance.refreshCapes();
|
||||
}
|
||||
if (kb == jumpKey) // Double jump
|
||||
{
|
||||
if (mc.thePlayer.capabilities.isCreativeMode)
|
||||
|
||||
@@ -1,175 +0,0 @@
|
||||
package tconstruct.client.event;
|
||||
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Image;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
import javax.swing.ImageIcon;
|
||||
|
||||
import mantle.lib.environment.EnvironmentChecks;
|
||||
import net.minecraft.client.entity.AbstractClientPlayer;
|
||||
import net.minecraftforge.client.event.RenderPlayerEvent;
|
||||
import tconstruct.TConstruct;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
public class EventCloakRender
|
||||
{
|
||||
|
||||
private final String serverLocation = "https://raw.github.com/SlimeKnights/TinkersConstruct/master/capes.txt";
|
||||
private final int timeout = 1000;
|
||||
|
||||
private static final Graphics TEST_GRAPHICS = new BufferedImage(128, 128, BufferedImage.TYPE_INT_RGB).getGraphics();
|
||||
private HashMap<String, String> cloaks = new HashMap<String, String>();
|
||||
private ArrayList<AbstractClientPlayer> capePlayers = new ArrayList<AbstractClientPlayer>();
|
||||
|
||||
public static EventCloakRender instance;
|
||||
|
||||
public EventCloakRender()
|
||||
{
|
||||
buildCloakURLDatabase();
|
||||
instance = this;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onPreRenderSpecials (RenderPlayerEvent.Specials.Pre event)
|
||||
{
|
||||
if (Loader.isModLoaded("shadersmod") || EnvironmentChecks.hasOptifine)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (event.entityPlayer instanceof AbstractClientPlayer)
|
||||
{
|
||||
AbstractClientPlayer abstractClientPlayer = (AbstractClientPlayer) event.entityPlayer;
|
||||
|
||||
if (!capePlayers.contains(abstractClientPlayer))
|
||||
{
|
||||
String cloakURL = cloaks.get(event.entityPlayer.getDisplayName());
|
||||
|
||||
if (cloakURL == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
capePlayers.add(abstractClientPlayer);
|
||||
|
||||
//abstractClientPlayer.getTextureCape().textureUploaded = false;
|
||||
//new Thread(new CloakThread(abstractClientPlayer, cloakURL)).start();
|
||||
//event.renderCape = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void buildCloakURLDatabase ()
|
||||
{
|
||||
URL url;
|
||||
try
|
||||
{
|
||||
url = new URL(serverLocation);
|
||||
URLConnection con = url.openConnection();
|
||||
con.setConnectTimeout(timeout);
|
||||
con.setReadTimeout(timeout);
|
||||
InputStream io = con.getInputStream();
|
||||
BufferedReader br = new BufferedReader(new InputStreamReader(io));
|
||||
|
||||
String str;
|
||||
int linetracker = 1;
|
||||
while ((str = br.readLine()) != null)
|
||||
{
|
||||
if (!str.startsWith("--"))
|
||||
{
|
||||
if (str.contains(":"))
|
||||
{
|
||||
String nick = str.substring(0, str.indexOf(":"));
|
||||
String link = str.substring(str.indexOf(":") + 1);
|
||||
new Thread(new CloakPreload(link)).start();
|
||||
cloaks.put(nick, link);
|
||||
}
|
||||
else
|
||||
{
|
||||
TConstruct.logger.error("[SkinLoader] Syntax error on line " + linetracker + ": " + str);
|
||||
}
|
||||
}
|
||||
linetracker++;
|
||||
}
|
||||
|
||||
br.close();
|
||||
}
|
||||
catch (MalformedURLException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private class CloakThread implements Runnable
|
||||
{
|
||||
|
||||
AbstractClientPlayer abstractClientPlayer;
|
||||
String cloakURL;
|
||||
|
||||
public CloakThread(AbstractClientPlayer player, String cloak)
|
||||
{
|
||||
abstractClientPlayer = player;
|
||||
cloakURL = cloak;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run ()
|
||||
{
|
||||
try
|
||||
{
|
||||
Image cape = new ImageIcon(new URL(cloakURL)).getImage();
|
||||
//BufferedImage bo = new BufferedImage(cape.getWidth(null), cape.getHeight(null), BufferedImage.TYPE_INT_ARGB);
|
||||
//bo.getGraphics().drawImage(cape, 0, 0, null);
|
||||
//abstractClientPlayer.getTextureCape().setBufferedImage(bo);
|
||||
}
|
||||
catch (MalformedURLException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class CloakPreload implements Runnable
|
||||
{
|
||||
String cloakURL;
|
||||
|
||||
public CloakPreload(String link)
|
||||
{
|
||||
cloakURL = link;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run ()
|
||||
{
|
||||
try
|
||||
{
|
||||
TEST_GRAPHICS.drawImage(new ImageIcon(new URL(cloakURL)).getImage(), 0, 0, null);
|
||||
}
|
||||
catch (MalformedURLException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void refreshCapes ()
|
||||
{
|
||||
cloaks.clear();
|
||||
capePlayers.clear();
|
||||
buildCloakURLDatabase();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user