diff --git a/client/cpw/mods/fml/client/BlockRenderInfo.java b/client/cpw/mods/fml/client/BlockRenderInfo.java new file mode 100644 index 0000000000..9aca940204 --- /dev/null +++ b/client/cpw/mods/fml/client/BlockRenderInfo.java @@ -0,0 +1,49 @@ +/* + * The FML Forge Mod Loader suite. + * Copyright (C) 2012 cpw + * + * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 2.1 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +package cpw.mods.fml.client; + +import cpw.mods.fml.common.IBlockRenderInfo; + +/** + * @author cpw + * + */ +public class BlockRenderInfo implements IBlockRenderInfo +{ + private int renderId; + private boolean forInventory; + + /** + * + */ + public BlockRenderInfo(int renderId, boolean forInventory) + { + this.renderId=renderId; + this.forInventory=forInventory; + } + + @Override + public int getRenderId() + { + return renderId; + } + + @Override + public boolean getInventoryRendering() + { + return forInventory; + } + +} diff --git a/client/cpw/mods/fml/client/FMLClientHandler.java b/client/cpw/mods/fml/client/FMLClientHandler.java index 2c5adc2815..f5401b4622 100644 --- a/client/cpw/mods/fml/client/FMLClientHandler.java +++ b/client/cpw/mods/fml/client/FMLClientHandler.java @@ -12,13 +12,19 @@ */ package cpw.mods.fml.client; +import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; +import java.io.InputStream; import java.io.UnsupportedEncodingException; import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; import java.util.Random; import java.util.logging.Logger; +import javax.imageio.ImageIO; + import net.minecraft.client.Minecraft; import net.minecraft.src.BaseMod; import net.minecraft.src.BiomeGenBase; @@ -26,21 +32,27 @@ import net.minecraft.src.ClientRegistry; import net.minecraft.src.CommonRegistry; import net.minecraft.src.EntityItem; import net.minecraft.src.EntityPlayer; +import net.minecraft.src.GuiScreen; import net.minecraft.src.IChunkProvider; import net.minecraft.src.IInventory; import net.minecraft.src.ItemStack; +import net.minecraft.src.KeyBinding; import net.minecraft.src.NetworkManager; import net.minecraft.src.Packet1Login; import net.minecraft.src.Packet250CustomPayload; import net.minecraft.src.Packet3Chat; +import net.minecraft.src.RenderEngine; +import net.minecraft.src.RenderPlayer; import net.minecraft.src.StringTranslate; import net.minecraft.src.World; import net.minecraft.src.WorldType; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.IFMLSidedHandler; +import cpw.mods.fml.common.IKeyHandler; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.ModContainer; import cpw.mods.fml.common.ModContainer.TickType; +import cpw.mods.fml.common.modloader.ModLoaderHelper; import cpw.mods.fml.common.modloader.ModLoaderModContainer; /** @@ -74,13 +86,15 @@ public class FMLClientHandler implements IFMLSidedHandler */ private Minecraft client; - private boolean preInitializationComplete; - /** * A handy list of the default overworld biomes */ private BiomeGenBase[] defaultOverworldBiomes; + private int nextRenderId; + + private static HashMap> overrideInfo = new HashMap>(); + /** * Called to start the whole game off from * {@link MinecraftServer#startServer} @@ -121,17 +135,28 @@ public class FMLClientHandler implements IFMLSidedHandler FMLCommonHandler.instance().registerSidedDelegate(this); CommonRegistry.registerRegistry(new ClientRegistry()); Loader.instance().loadMods(); - preInitializationComplete=true; } /** - * Called a bit later on during server initialization to finish loading mods + * Called a bit later on during initialization to finish loading mods + * Also initializes key bindings + * */ public void onLoadComplete() { Loader.instance().initializeMods(); + client.field_6304_y.loadModKeySettings(harvestKeyBindings()); } + public KeyBinding[] harvestKeyBindings() { + List allKeys=FMLCommonHandler.instance().gatherKeyBindings(); + KeyBinding[] keys=new KeyBinding[allKeys.size()]; + int i=0; + for (IKeyHandler key : allKeys) { + keys[i++]=(KeyBinding)key.getKeyBinding(); + } + return keys; + } /** * Every tick just before world and other ticks occur */ @@ -526,4 +551,79 @@ public class FMLClientHandler implements IFMLSidedHandler { return StringTranslate.func_20162_a().func_44024_c(); } + + /** + * @param armor + * @return + */ + public int addNewArmourRendererPrefix(String armor) + { + return RenderPlayer.addNewArmourPrefix(armor); + } + + public void addNewTextureOverride(String textureToOverride, String overridingTexturePath, int location) { + if (!overrideInfo.containsKey(textureToOverride)) + { + overrideInfo.put(textureToOverride, new ArrayList()); + } + ArrayList list = overrideInfo.get(textureToOverride); + OverrideInfo info = new OverrideInfo(); + info.index = location; + info.override = overridingTexturePath; + info.texture = textureToOverride; + list.add(info); + } + /** + * @param mod + * @param inventoryRenderer + * @return + */ + public int obtainBlockModelIdFor(BaseMod mod, boolean inventoryRenderer) + { + ModLoaderModContainer mlmc=ModLoaderHelper.registerRenderHelper(mod); + int renderId=nextRenderId++; + mlmc.addRenderHandler(new BlockRenderInfo(renderId, inventoryRenderer)); + return renderId; + } + + /** + * @param renderEngine + * @param path + * @return + */ + public BufferedImage loadImageFromTexturePack(RenderEngine renderEngine, String path) throws IOException + { + InputStream image=renderEngine.getTexturePackList().field_6534_a.func_6481_a(path); + if (image==null) { + throw new RuntimeException(String.format("The requested image path %s is not found",path)); + } + BufferedImage result=ImageIO.read(image); + if (result==null) + { + throw new RuntimeException(String.format("The requested image path %s appears to be corrupted",path)); + } + return result; + } + + /** + * @param player + * @param gui + */ + public void displayGuiScreen(EntityPlayer player, GuiScreen gui) + { + if (client.field_22009_h==player && gui != null) { + client.func_6272_a(gui); + } + } + + /** + * @param mod + * @param keyHandler + * @param allowRepeat + */ + public void registerKeyHandler(BaseMod mod, KeyBinding keyHandler, boolean allowRepeat) + { + ModLoaderModContainer mlmc=ModLoaderHelper.registerKeyHelper(mod); + mlmc.addKeyHandler(new KeyBindingHandler(keyHandler, allowRepeat)); + } } diff --git a/client/cpw/mods/fml/client/KeyBindingHandler.java b/client/cpw/mods/fml/client/KeyBindingHandler.java new file mode 100644 index 0000000000..c836de4e86 --- /dev/null +++ b/client/cpw/mods/fml/client/KeyBindingHandler.java @@ -0,0 +1,46 @@ +/* + * The FML Forge Mod Loader suite. + * Copyright (C) 2012 cpw + * + * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 2.1 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +package cpw.mods.fml.client; + +import net.minecraft.src.KeyBinding; +import cpw.mods.fml.common.IKeyHandler; + +/** + * @author cpw + * + */ +public class KeyBindingHandler implements IKeyHandler +{ + + private boolean shouldRepeat; + private KeyBinding keyBinding; + + /** + * @param keyHandler + * @param allowRepeat + */ + public KeyBindingHandler(KeyBinding keyHandler, boolean allowRepeat) + { + this.keyBinding=keyHandler; + this.shouldRepeat=allowRepeat; + } + + @Override + public Object getKeyBinding() + { + return this.keyBinding; + } + +} diff --git a/client/cpw/mods/fml/client/OverrideInfo.java b/client/cpw/mods/fml/client/OverrideInfo.java new file mode 100644 index 0000000000..e54e2a4821 --- /dev/null +++ b/client/cpw/mods/fml/client/OverrideInfo.java @@ -0,0 +1,22 @@ +/* + * The FML Forge Mod Loader suite. + * Copyright (C) 2012 cpw + * + * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 2.1 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +package cpw.mods.fml.client; + +class OverrideInfo +{ + public String texture; + public String override; + public int index; +} \ No newline at end of file diff --git a/client/net/minecraft/src/BaseMod.java b/client/net/minecraft/src/BaseMod.java index f78a1eac75..5036c0af2a 100644 --- a/client/net/minecraft/src/BaseMod.java +++ b/client/net/minecraft/src/BaseMod.java @@ -84,13 +84,13 @@ public abstract class BaseMod implements IWorldGenerator, IPickupNotifier, IDisp } @Override - public void onPlayerLogout(Object player) + public final void onPlayerLogout(Object player) { onClientLogout((EntityPlayer) player); } @Override - public void onPlayerChangedDimension(Object player) + public final void onPlayerChangedDimension(Object player) { onClientDimensionChanged((EntityPlayer) player); } diff --git a/client/net/minecraft/src/ModLoader.java b/client/net/minecraft/src/ModLoader.java index ec88cc20a0..35b425e8be 100644 --- a/client/net/minecraft/src/ModLoader.java +++ b/client/net/minecraft/src/ModLoader.java @@ -14,9 +14,7 @@ package net.minecraft.src; */ import java.awt.image.BufferedImage; -import java.util.ArrayList; import java.util.EnumSet; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.logging.Logger; @@ -34,14 +32,6 @@ import cpw.mods.fml.common.modloader.ModLoaderModContainer; public class ModLoader { - private static class OverrideInfo - { - public String texture; - public String override; - public int index; - } - private static HashMap> overrideInfo = new HashMap>(); - /** * Not used on the server. * @@ -88,8 +78,7 @@ public class ModLoader */ public static int addArmor(String armor) { - // TODO - return 0; + return FMLClientHandler.instance().addNewArmourRendererPrefix(armor); } /** @@ -183,16 +172,7 @@ public class ModLoader */ public static void addOverride(String path, String overlayPath, int index) { - if (!overrideInfo.containsKey(path)) - { - overrideInfo.put(path, new ArrayList()); - } - ArrayList list = overrideInfo.get(path); - OverrideInfo info = new OverrideInfo(); - info.index = index; - info.override = overlayPath; - info.texture = path; - list.add(info); + FMLClientHandler.instance().addNewTextureOverride(path, overlayPath, index); } /** @@ -435,10 +415,9 @@ public class ModLoader * Stubbed method on the server to return a unique model id * */ - public static int getUniqueBlockModelID(BaseMod mod, boolean flag) + public static int getUniqueBlockModelID(BaseMod mod, boolean inventoryRenderer) { - // TODO - return 0; + return FMLClientHandler.instance().obtainBlockModelIdFor(mod, inventoryRenderer); } /** @@ -471,8 +450,7 @@ public class ModLoader public static boolean isGUIOpen(Class gui) { - //TODO - return false; + return FMLClientHandler.instance().getClient().field_6313_p!=null && FMLClientHandler.instance().getClient().field_6313_p.equals(gui); } /** @@ -494,10 +472,9 @@ public class ModLoader { } - public static BufferedImage loadImage(RenderEngine texCache, String path) + public static BufferedImage loadImage(RenderEngine renderEngine, String path) throws Exception { - //TODO - return null; + return FMLClientHandler.instance().loadImageFromTexturePack(renderEngine, path); } /** @@ -519,7 +496,7 @@ public class ModLoader public static void openGUI(EntityPlayer player, GuiScreen gui) { - //TODO + FMLClientHandler.instance().displayGuiScreen(player, gui); } @Deprecated @@ -539,15 +516,15 @@ public class ModLoader { } - static KeyBinding[] registerAllKeys(KeyBinding[] keys) + @Deprecated + public static KeyBinding[] registerAllKeys(KeyBinding[] keys) { - //TODO return keys; } + @Deprecated static void registerAllTextureOverrides(RenderEngine cache) { - //TODO } /** @@ -597,9 +574,9 @@ public class ModLoader CommonRegistry.registerEntityID(entityClass, entityName, id, background, foreground); } - static void registerKey(BaseMod mod, KeyBinding keyHandler, boolean allowRepeat) + public static void registerKey(BaseMod mod, KeyBinding keyHandler, boolean allowRepeat) { - //TODO + FMLClientHandler.instance().registerKeyHandler(mod, keyHandler, allowRepeat); } /** diff --git a/common/cpw/mods/fml/common/FMLCommonHandler.java b/common/cpw/mods/fml/common/FMLCommonHandler.java index 6f61506e70..8cc8db23f2 100644 --- a/common/cpw/mods/fml/common/FMLCommonHandler.java +++ b/common/cpw/mods/fml/common/FMLCommonHandler.java @@ -116,6 +116,19 @@ public class FMLCommonHandler mod.tickEnd(type, data); } } + + public List gatherKeyBindings() { + List allKeys=new ArrayList(); + for (ModContainer mod : Loader.getModList()) + { + allKeys.addAll(mod.getKeys()); + } + for (ModContainer mod : extraTickers) + { + allKeys.addAll(mod.getKeys()); + } + return allKeys; + } /** * @return the instance */ diff --git a/common/cpw/mods/fml/common/FMLModContainer.java b/common/cpw/mods/fml/common/FMLModContainer.java index 16848ce653..2c4311745b 100644 --- a/common/cpw/mods/fml/common/FMLModContainer.java +++ b/common/cpw/mods/fml/common/FMLModContainer.java @@ -306,4 +306,13 @@ public class FMLModContainer implements ModContainer // TODO Auto-generated method stub return null; } + /* (non-Javadoc) + * @see cpw.mods.fml.common.ModContainer#getKeys() + */ + @Override + public List getKeys() + { + // TODO Auto-generated method stub + return null; + } } diff --git a/common/cpw/mods/fml/common/IBlockRenderInfo.java b/common/cpw/mods/fml/common/IBlockRenderInfo.java new file mode 100644 index 0000000000..22c94bda81 --- /dev/null +++ b/common/cpw/mods/fml/common/IBlockRenderInfo.java @@ -0,0 +1,25 @@ +/* + * The FML Forge Mod Loader suite. + * Copyright (C) 2012 cpw + * + * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 2.1 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +package cpw.mods.fml.common; + +/** + * @author cpw + * + */ +public interface IBlockRenderInfo +{ + public int getRenderId(); + public boolean getInventoryRendering(); +} diff --git a/common/cpw/mods/fml/common/IKeyHandler.java b/common/cpw/mods/fml/common/IKeyHandler.java new file mode 100644 index 0000000000..e53696328a --- /dev/null +++ b/common/cpw/mods/fml/common/IKeyHandler.java @@ -0,0 +1,26 @@ +/* + * The FML Forge Mod Loader suite. + * Copyright (C) 2012 cpw + * + * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 2.1 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +package cpw.mods.fml.common; + +/** + * @author cpw + * + */ +public interface IKeyHandler +{ + + Object getKeyBinding(); + +} diff --git a/common/cpw/mods/fml/common/ModContainer.java b/common/cpw/mods/fml/common/ModContainer.java index 5e8875f6b5..4cf5903e10 100644 --- a/common/cpw/mods/fml/common/ModContainer.java +++ b/common/cpw/mods/fml/common/ModContainer.java @@ -173,4 +173,6 @@ public interface ModContainer public enum TickType { WORLD, RENDER, GUI, WORLDGUI; } + + List getKeys(); } diff --git a/common/cpw/mods/fml/common/modloader/ModLoaderHelper.java b/common/cpw/mods/fml/common/modloader/ModLoaderHelper.java index f07ca3c3de..2beb47e64d 100644 --- a/common/cpw/mods/fml/common/modloader/ModLoaderHelper.java +++ b/common/cpw/mods/fml/common/modloader/ModLoaderHelper.java @@ -28,18 +28,11 @@ import cpw.mods.fml.common.ModContainer.TickType; */ public class ModLoaderHelper { - private static Map tickers=new HashMap(); + private static Map notModCallbacks=new HashMap(); public static void updateStandardTicks(BaseMod mod, boolean enable, boolean useClock) { - ModLoaderModContainer mlmc=(ModLoaderModContainer) ModLoaderModContainer.findContainerFor(mod); - if (mlmc==null) { - mlmc=tickers.get(mod); - if (mlmc==null) { - mlmc=new ModLoaderModContainer(mod); - tickers.put(mod, mlmc); - } - } + ModLoaderModContainer mlmc = findOrBuildModContainer(mod); EnumSet ticks = mlmc.getTickTypes(); // If we're enabled and we don't want clock ticks we get render ticks if (enable && !useClock && FMLCommonHandler.instance().isClient()) { @@ -57,14 +50,7 @@ public class ModLoaderHelper public static void updateGUITicks(BaseMod mod, boolean enable, boolean useClock) { - ModLoaderModContainer mlmc=(ModLoaderModContainer) ModLoaderModContainer.findContainerFor(mod); - if (mlmc==null) { - mlmc=tickers.get(mod); - if (mlmc==null) { - mlmc=new ModLoaderModContainer(mod); - tickers.put(mod, mlmc); - } - } + ModLoaderModContainer mlmc = findOrBuildModContainer(mod); EnumSet ticks = mlmc.getTickTypes(); // If we're enabled and we don't want clock ticks we get render ticks if (enable && !useClock && FMLCommonHandler.instance().isClient()) { @@ -79,4 +65,36 @@ public class ModLoaderHelper ticks.remove(TickType.WORLDGUI); } } + + /** + * @param mod + * @return + */ + private static ModLoaderModContainer findOrBuildModContainer(BaseMod mod) + { + ModLoaderModContainer mlmc=(ModLoaderModContainer) ModLoaderModContainer.findContainerFor(mod); + if (mlmc==null) { + mlmc=notModCallbacks.get(mod); + if (mlmc==null) { + mlmc=new ModLoaderModContainer(mod); + notModCallbacks.put(mod, mlmc); + } + } + return mlmc; + } + + public static ModLoaderModContainer registerRenderHelper(BaseMod mod) { + ModLoaderModContainer mlmc=findOrBuildModContainer(mod); + return mlmc; + } + + /** + * @param mod + * @return + */ + public static ModLoaderModContainer registerKeyHelper(BaseMod mod) + { + ModLoaderModContainer mlmc=findOrBuildModContainer(mod); + return mlmc; + } } diff --git a/common/cpw/mods/fml/common/modloader/ModLoaderModContainer.java b/common/cpw/mods/fml/common/modloader/ModLoaderModContainer.java index 113f9ab17c..dacd30ecbd 100644 --- a/common/cpw/mods/fml/common/modloader/ModLoaderModContainer.java +++ b/common/cpw/mods/fml/common/modloader/ModLoaderModContainer.java @@ -19,6 +19,7 @@ import java.io.FileWriter; import java.io.IOException; import java.lang.reflect.Field; import java.lang.reflect.Modifier; +import java.util.AbstractCollection; import java.util.ArrayList; import java.util.EnumSet; import java.util.HashMap; @@ -33,9 +34,11 @@ import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.IConsoleHandler; import cpw.mods.fml.common.ICraftingHandler; import cpw.mods.fml.common.IDispenseHandler; +import cpw.mods.fml.common.IKeyHandler; import cpw.mods.fml.common.INetworkHandler; import cpw.mods.fml.common.IPickupNotifier; import cpw.mods.fml.common.IPlayerTracker; +import cpw.mods.fml.common.IBlockRenderInfo; import cpw.mods.fml.common.IWorldGenerator; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.LoaderException; @@ -51,6 +54,9 @@ public class ModLoaderModContainer implements ModContainer private ArrayList dependencies; private ArrayList preDependencies; private ArrayList postDependencies; + private ArrayList blockRenderInfos; + private ArrayList keyHandlers; + public ModLoaderModContainer(Class modClazz, File modSource) { this.modClazz = modClazz; @@ -551,4 +557,28 @@ public class ModLoaderModContainer implements ModContainer { return ticks; } + + /** + * @param renderId + * @param inventoryRenderer + */ + public void addRenderHandler(IBlockRenderInfo handler) + { + blockRenderInfos.add(handler); + } + + /** + * @param keyHandler + * @param allowRepeat + */ + public void addKeyHandler(IKeyHandler handler) + { + keyHandlers.add(handler); + } + + @Override + public List getKeys() + { + return keyHandlers; + } } diff --git a/patches/minecraft/net/minecraft/src/GameSettings.java.patch b/patches/minecraft/net/minecraft/src/GameSettings.java.patch new file mode 100644 index 0000000000..ef1e3863fb --- /dev/null +++ b/patches/minecraft/net/minecraft/src/GameSettings.java.patch @@ -0,0 +1,31 @@ +--- ../src-base/minecraft/net/minecraft/src/GameSettings.java 0000-00-00 00:00:00.000000000 -0000 ++++ ../src-work/minecraft/net/minecraft/src/GameSettings.java 0000-00-00 00:00:00.000000000 -0000 +@@ -5,6 +5,9 @@ + import java.io.FileReader; + import java.io.FileWriter; + import java.io.PrintWriter; ++import java.util.Arrays; ++import java.util.List; ++ + import net.minecraft.client.Minecraft; + import org.lwjgl.input.Keyboard; + +@@ -477,4 +480,18 @@ + { + return this.field_1580_e < 2 && this.field_40445_l; + } ++ ++ /** ++ * @param harvestKeyBindings ++ */ ++ public void loadModKeySettings(KeyBinding[] modKeyBindings) ++ { ++ KeyBinding[] allKeys=new KeyBinding[field_1564_t.length+modKeyBindings.length]; ++ System.arraycopy(field_1564_t, 0, allKeys, 0, field_1564_t.length); ++ System.arraycopy(modKeyBindings, 0, allKeys, field_1564_t.length, modKeyBindings.length); ++ field_1564_t=allKeys; ++ ++ // Reload settings with mod keys in place ++ func_6519_a(); ++ } + } diff --git a/patches/minecraft/net/minecraft/src/RenderEngine.java.patch b/patches/minecraft/net/minecraft/src/RenderEngine.java.patch new file mode 100644 index 0000000000..4ecfb66fe6 --- /dev/null +++ b/patches/minecraft/net/minecraft/src/RenderEngine.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/src/RenderEngine.java 0000-00-00 00:00:00.000000000 -0000 ++++ ../src-work/minecraft/net/minecraft/src/RenderEngine.java 0000-00-00 00:00:00.000000000 -0000 +@@ -635,4 +635,8 @@ + GL11.glBindTexture(GL11.GL_TEXTURE_2D, p_1076_1_); + } + } ++ ++ public TexturePackList getTexturePackList() { ++ return field_6527_k; ++ } + } diff --git a/patches/minecraft/net/minecraft/src/RenderPlayer.java.patch b/patches/minecraft/net/minecraft/src/RenderPlayer.java.patch new file mode 100644 index 0000000000..cfda908ff3 --- /dev/null +++ b/patches/minecraft/net/minecraft/src/RenderPlayer.java.patch @@ -0,0 +1,32 @@ +--- ../src-base/minecraft/net/minecraft/src/RenderPlayer.java 0000-00-00 00:00:00.000000000 -0000 ++++ ../src-work/minecraft/net/minecraft/src/RenderPlayer.java 0000-00-00 00:00:00.000000000 -0000 +@@ -1,5 +1,8 @@ + package net.minecraft.src; + ++import java.util.Arrays; ++import java.util.List; ++ + import net.minecraft.client.Minecraft; + import org.lwjgl.opengl.GL11; + +@@ -8,7 +11,7 @@ + private ModelBiped field_209_f; + private ModelBiped field_208_g; + private ModelBiped field_207_h; +- private static final String[] field_206_i = new String[] {"cloth", "chain", "iron", "diamond", "gold"}; ++ private static String[] field_206_i = new String[] {"cloth", "chain", "iron", "diamond", "gold"}; + + public RenderPlayer() + { +@@ -407,4 +410,11 @@ + { + this.func_188_a((EntityPlayer)p_147_1_, p_147_2_, p_147_4_, p_147_6_, p_147_8_, p_147_9_); + } ++ ++ public static int addNewArmourPrefix(String prefix) { ++ List armours=Arrays.asList(field_206_i); ++ armours.add(prefix); ++ field_206_i=armours.toArray(new String[0]); ++ return armours.indexOf(prefix); ++ } + }