mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-23 21:49:45 +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
@@ -21,6 +21,9 @@ import tconstruct.library.crafting.LiquidCasting;
|
||||
import tconstruct.mechworks.TinkerMechworks;
|
||||
import tconstruct.mechworks.landmine.behavior.Behavior;
|
||||
import tconstruct.mechworks.landmine.behavior.stackCombo.SpecialStackHandler;
|
||||
import tconstruct.plugins.imc.TinkerBuildcraft;
|
||||
import tconstruct.plugins.imc.TinkerThaumcraft;
|
||||
import tconstruct.plugins.nei.TinkerNEI;
|
||||
import tconstruct.smeltery.TinkerSmeltery;
|
||||
import tconstruct.tools.TinkerTools;
|
||||
import tconstruct.util.EnvironmentChecks;
|
||||
@@ -107,6 +110,9 @@ public class TConstruct
|
||||
pulsar.registerPulse(new TinkerSmeltery());
|
||||
pulsar.registerPulse(new TinkerMechworks());
|
||||
pulsar.registerPulse(new TinkerArmor());
|
||||
pulsar.registerPulse(new TinkerNEI());
|
||||
pulsar.registerPulse(new TinkerThaumcraft());
|
||||
pulsar.registerPulse(new TinkerBuildcraft());
|
||||
/*pulsar.registerPulse(new TinkerPrayers());
|
||||
pulsar.registerPulse(new TinkerCropify());*/
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package tconstruct.plugins.imc;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import mantle.pulsar.pulse.Handler;
|
||||
import mantle.pulsar.pulse.Pulse;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.smeltery.TinkerSmeltery;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
import cpw.mods.fml.common.registry.GameRegistry.ObjectHolder;
|
||||
|
||||
@ObjectHolder(TConstruct.modID)
|
||||
@Pulse(id = "Tinkers Buildcraft addon", description = "The Builcraft addon for Tinkers.", modsRequired = "BuildCraft|Transport", forced = true)
|
||||
public class TinkerBuildcraft {
|
||||
|
||||
@Handler
|
||||
public void init (FMLInitializationEvent event)
|
||||
{
|
||||
TConstruct.logger.info("[BC|Transport] Registering facades.");
|
||||
// Smeltery Blocks
|
||||
addFacade(TinkerSmeltery.smeltery, 2);
|
||||
for (int sc = 4; sc < 11; sc++)
|
||||
{
|
||||
addFacade(TinkerSmeltery.smeltery, sc);
|
||||
}
|
||||
|
||||
addFacade(TinkerSmeltery.searedBlock, 0);
|
||||
addFacade(TinkerSmeltery.searedBlockNether, 0);
|
||||
}
|
||||
|
||||
private void addFacade (Block b, int meta)
|
||||
{
|
||||
FMLInterModComms.sendMessage("BuildCraft|Transport", "add-facade", new ItemStack(b, 1, meta));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package tconstruct.plugins.imc;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import mantle.pulsar.pulse.Handler;
|
||||
import mantle.pulsar.pulse.Pulse;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.smeltery.TinkerSmeltery;
|
||||
import tconstruct.world.TinkerWorld;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
import cpw.mods.fml.common.registry.GameRegistry.ObjectHolder;
|
||||
|
||||
@ObjectHolder(TConstruct.modID)
|
||||
@Pulse(id = "Tinkers Thaumcraft addon", description = "The Thaumcraft addon for Tinkers.", modsRequired = "Thaumcraft", forced = true)
|
||||
public class TinkerThaumcraft {
|
||||
|
||||
@Handler
|
||||
public void init(FMLInitializationEvent event)
|
||||
{
|
||||
TConstruct.logger.info("[Thaumcraft] Registering harvestables.");
|
||||
FMLInterModComms.sendMessage("Thaumcraft", "harvestClickableCrop", new ItemStack(TinkerWorld.oreBerry, 1, 12));
|
||||
FMLInterModComms.sendMessage("Thaumcraft", "harvestClickableCrop", new ItemStack(TinkerWorld.oreBerry, 1, 13));
|
||||
FMLInterModComms.sendMessage("Thaumcraft", "harvestClickableCrop", new ItemStack(TinkerWorld.oreBerry, 1, 14));
|
||||
FMLInterModComms.sendMessage("Thaumcraft", "harvestClickableCrop", new ItemStack(TinkerWorld.oreBerry, 1, 15));
|
||||
FMLInterModComms.sendMessage("Thaumcraft", "harvestClickableCrop", new ItemStack(TinkerWorld.oreBerrySecond, 1, 12));
|
||||
FMLInterModComms.sendMessage("Thaumcraft", "harvestClickableCrop", new ItemStack(TinkerWorld.oreBerrySecond, 1, 13));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package tconstruct.plugins.nei;
|
||||
|
||||
import codechicken.nei.api.API;
|
||||
import codechicken.nei.recipe.DefaultOverlayHandler;
|
||||
import mantle.pulsar.pulse.Handler;
|
||||
import mantle.pulsar.pulse.Pulse;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.tools.gui.CraftingStationGui;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.registry.GameRegistry.ObjectHolder;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
|
||||
@ObjectHolder(TConstruct.modID)
|
||||
@Pulse(id = "Tinkers Not Enough Items Addon", description = "The NEI addon for Tinkers.", modsRequired = "NotEnoughItems", forced = true)
|
||||
public class TinkerNEI {
|
||||
|
||||
@Handler
|
||||
public void init (FMLInitializationEvent event)
|
||||
{
|
||||
if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT)
|
||||
{
|
||||
API.registerGuiOverlay(CraftingStationGui.class, "crafting");
|
||||
API.registerGuiOverlayHandler(CraftingStationGui.class, new DefaultOverlayHandler(), "crafting");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user