Résolu Problème ClientProxy
-
Salut,
Depuis ce matin, ma classe ClientProxy fonctionne plus, je ne sais pas pourquoi.
Du coup, mon zoom, mes projectiles, ne marchent plus.Mes classes :
ClientProxy.java
package com.multi7200.tam; import net.minecraft.client.settings.KeyBinding; import org.lwjgl.input.Keyboard; import com.multi7200.tam.entity.EntityDisk; import com.multi7200.tam.entity.EntityNitron; import com.multi7200.tam.model.ModelDisk; import com.multi7200.tam.render.RenderDisk; import com.multi7200.tam.render.RenderNitron; import cpw.mods.fml.client.FMLClientHandler; import cpw.mods.fml.client.registry.ClientRegistry; import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.ObfuscationReflectionHelper; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.InputEvent.KeyInputEvent; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class ClientProxy extends CommonProxy { private static KeyBinding keyBindZoom; private boolean state; @Override public void registerRender() { System.out.println("eeee"); RenderingRegistry.registerEntityRenderingHandler(EntityDisk.class, new RenderDisk(new ModelDisk())); RenderingRegistry.registerEntityRenderingHandler(EntityNitron.class, new RenderNitron()); FMLCommonHandler.instance().bus().register(this); keyBindZoom = new KeyBinding("tamod.keyzoom", Keyboard.KEY_A, "key.categories.gameplay"); ClientRegistry.registerKeyBinding(keyBindZoom); } @SubscribeEvent public void onEvent(KeyInputEvent event) { if(keyBindZoom.isPressed()) { if(state == false) { ObfuscationReflectionHelper.setPrivateValue(net.minecraft.client.renderer.EntityRenderer.class, FMLClientHandler.instance().getClient().entityRenderer, 6.5D, "cameraZoom", "field_78503_V"); state = true; } else if(state == true) { ObfuscationReflectionHelper.setPrivateValue(net.minecraft.client.renderer.EntityRenderer.class, FMLClientHandler.instance().getClient().entityRenderer, 1.0D, "cameraZoom", "field_78503_V"); state = false; } } } }
TribesAscendMod.java(classe principale)
package com.multi7200.tam; import java.awt.Color; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.Minecraft; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.stats.Achievement; import net.minecraftforge.common.MinecraftForge; import com.multi7200.tam.blocks.BlockDelimitation; import com.multi7200.tam.entity.EntityDisk; import com.multi7200.tam.entity.EntityNitron; import com.multi7200.tam.gui.GuiTribesAscendGameOverlay; import com.multi7200.tam.weapons.TAExplosiveNitron; import com.multi7200.tam.weapons.TALightSpinfusor; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.registry.EntityRegistry; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; @Mod(modid = "TAMod", version = "0.1") public class TribesAscendMod { public static final String modID = "tam:"; public static Item lightSpinfusor, spinDisk, explosiveNitron, midAir; public static Block MapDelimitation; @Instance("TAMod") public static TribesAscendMod instance; @SidedProxy(clientSide = "com.multi7200.tam.ClientProxy", serverSide = "com.multi7200.tam.CommonProxy") public static CommonProxy proxy; @EventHandler public void preInit(FMLPreInitializationEvent event) { this.lightSpinfusor = new TALightSpinfusor().setUnlocalizedName("light_spin").setFull3D().setTextureName(this.modID + "lightspin").setCreativeTab(CreativeTabs.tabTools); this.MapDelimitation = new BlockDelimitation(Material.rock).setCreativeTab(CreativeTabs.tabBlock).setBlockTextureName(this.modID + "mapdel"); this.explosiveNitron = new TAExplosiveNitron().setUnlocalizedName("explosive_nitron").setFull3D().setTextureName(this.modID + "explosivenitron").setCreativeTab(CreativeTabs.tabTools); GameRegistry.registerItem(lightSpinfusor, "tam_lightspin"); GameRegistry.registerItem(explosiveNitron, "tam_explosivenitron"); GameRegistry.registerBlock(MapDelimitation, "block_mapdel"); LanguageRegistry.addName(lightSpinfusor, "Light Spinfusor"); LanguageRegistry.addName(MapDelimitation, "Map Delimitation block DEV"); LanguageRegistry.addName(explosiveNitron, "Explosive Nitorn"); } public void init(FMLInitializationEvent event) { EntityRegistry.registerGlobalEntityID(EntityNitron.class, "nitron", EntityRegistry.findGlobalUniqueEntityId(), new Color(0, 255, 0).getRGB(), new Color(255, 0, 0).getRGB()); EntityRegistry.registerGlobalEntityID(EntityDisk.class, "disk", EntityRegistry.findGlobalUniqueEntityId(), new Color(0, 255, 0).getRGB(), new Color(255, 0, 0).getRGB()); EntityRegistry.registerModEntity(EntityDisk.class, "disk", 420, this.instance, 120, 3, true); EntityRegistry.registerModEntity(EntityNitron.class, "nitron", 500, this.instance, 40, 1, true); proxy.registerRender(); } @EventHandler public void postInit(FMLPostInitializationEvent event) { MinecraftForge.EVENT_BUS.register(new GuiTribesAscendGameOverlay(Minecraft.getMinecraft())); } }
Merci de m’éclairer !
-
Salut,
Parce qu’il manque le @EventHandler au dessus de la fonction init. -
Merci, c’est vraiment con j’ai du le supprimer