From 010cca1c6646a90e9a66cda577010a1a66b62af8 Mon Sep 17 00:00:00 2001 From: MachineMuse Date: Thu, 25 Apr 2013 12:27:51 -0600 Subject: [PATCH] more attempts at thaum render fixes --- .../powersuits/client/ClientProxy.java | 127 +++++++++--------- .../powersuits/common/CommonProxy.java | 51 ++++--- .../powersuits/common/ModularPowersuits.java | 2 +- .../event/ThaumRenderEventHandler.java | 2 + 4 files changed, 90 insertions(+), 92 deletions(-) diff --git a/src/minecraft/net/machinemuse/powersuits/client/ClientProxy.java b/src/minecraft/net/machinemuse/powersuits/client/ClientProxy.java index 4bfad43..4c38ccb 100644 --- a/src/minecraft/net/machinemuse/powersuits/client/ClientProxy.java +++ b/src/minecraft/net/machinemuse/powersuits/client/ClientProxy.java @@ -1,5 +1,10 @@ package net.machinemuse.powersuits.client; +import cpw.mods.fml.client.registry.ClientRegistry; +import cpw.mods.fml.client.registry.KeyBindingRegistry; +import cpw.mods.fml.client.registry.RenderingRegistry; +import cpw.mods.fml.common.registry.TickRegistry; +import cpw.mods.fml.relauncher.Side; import net.machinemuse.general.sound.SoundLoader; import net.machinemuse.powersuits.block.TileEntityLuxCapacitor; import net.machinemuse.powersuits.block.TileEntityTinkerTable; @@ -20,91 +25,83 @@ import net.machinemuse.powersuits.tick.PlayerTickHandler; import net.machinemuse.powersuits.tick.RenderTickHandler; import net.minecraftforge.client.MinecraftForgeClient; import net.minecraftforge.common.MinecraftForge; -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.client.registry.KeyBindingRegistry; -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.registry.TickRegistry; -import cpw.mods.fml.relauncher.Side; /** * The Client Proxy does all the things that should only be done client-side, * like registering client-side handlers and renderers. - * + * * @author MachineMuse - * */ public class ClientProxy extends CommonProxy { - private static ToolRenderer toolRenderer; - private static ClientTickHandler clientTickHandler; - private static RenderTickHandler renderTickHandler; - private static PlayerTickHandler playerTickHandler; - public static KeybindKeyHandler keybindHandler; + private static ToolRenderer toolRenderer; + private static ClientTickHandler clientTickHandler; + private static RenderTickHandler renderTickHandler; + private static PlayerTickHandler playerTickHandler; + public static KeybindKeyHandler keybindHandler; - @Override - public void registerSounds() { - MinecraftForge.EVENT_BUS.register(new SoundLoader()); - } + @Override + public void registerEvents() { + MinecraftForge.EVENT_BUS.register(new SoundLoader()); + if (ModCompatability.isThaumCraftLoaded() && ModCompatability.enableThaumGogglesModule()) { + MinecraftForge.EVENT_BUS.register(new ThaumRenderEventHandler()); + } + } - /** - * Register all the custom renderers for this mod. - */ - @Override - public void registerRenderers() { - toolRenderer = new ToolRenderer(); - MinecraftForgeClient.registerItemRenderer(ModularPowersuits.powerTool.itemID, toolRenderer); + /** + * Register all the custom renderers for this mod. + */ + @Override + public void registerRenderers() { + toolRenderer = new ToolRenderer(); + MinecraftForgeClient.registerItemRenderer(ModularPowersuits.powerTool.itemID, toolRenderer); - int tinkTableRenderID = RenderingRegistry.getNextAvailableRenderId(); - TinkerTableRenderer tinkTableRenderer = new TinkerTableRenderer(tinkTableRenderID); - ModularPowersuits.tinkerTable.setRenderType(tinkTableRenderID); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTinkerTable.class, tinkTableRenderer); - RenderingRegistry.registerBlockHandler(tinkTableRenderer); + int tinkTableRenderID = RenderingRegistry.getNextAvailableRenderId(); + TinkerTableRenderer tinkTableRenderer = new TinkerTableRenderer(tinkTableRenderID); + ModularPowersuits.tinkerTable.setRenderType(tinkTableRenderID); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTinkerTable.class, tinkTableRenderer); + RenderingRegistry.registerBlockHandler(tinkTableRenderer); - int luxCapacitorRenderID = RenderingRegistry.getNextAvailableRenderId(); - RenderLuxCapacitorTESR luxCapacitorRenderer = new RenderLuxCapacitorTESR(luxCapacitorRenderID); - ModularPowersuits.luxCapacitor.setRenderType(luxCapacitorRenderID); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityLuxCapacitor.class, luxCapacitorRenderer); - RenderingRegistry.registerBlockHandler(luxCapacitorRenderer); + int luxCapacitorRenderID = RenderingRegistry.getNextAvailableRenderId(); + RenderLuxCapacitorTESR luxCapacitorRenderer = new RenderLuxCapacitorTESR(luxCapacitorRenderID); + ModularPowersuits.luxCapacitor.setRenderType(luxCapacitorRenderID); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityLuxCapacitor.class, luxCapacitorRenderer); + RenderingRegistry.registerBlockHandler(luxCapacitorRenderer); - RenderingRegistry.registerEntityRenderingHandler(EntityPlasmaBolt.class, new RenderPlasmaBolt()); - RenderingRegistry.registerEntityRenderingHandler(EntitySpinningBlade.class, new RenderSpinningBlade()); - RenderingRegistry.registerEntityRenderingHandler(EntityLuxCapacitor.class, new RenderLuxCapacitorEntity()); + RenderingRegistry.registerEntityRenderingHandler(EntityPlasmaBolt.class, new RenderPlasmaBolt()); + RenderingRegistry.registerEntityRenderingHandler(EntitySpinningBlade.class, new RenderSpinningBlade()); + RenderingRegistry.registerEntityRenderingHandler(EntityLuxCapacitor.class, new RenderLuxCapacitorEntity()); - MinecraftForge.EVENT_BUS.register(new TextureStitchHandler()); + MinecraftForge.EVENT_BUS.register(new TextureStitchHandler()); - } + } - /** - * Register the tick handler (for on-tick behaviour) and packet handler (for - * network synchronization and permission stuff). - */ - @Override - public void registerHandlers() { - super.registerHandlers(); - keybindHandler = new KeybindKeyHandler(); - KeyBindingRegistry.registerKeyBinding(keybindHandler); - KeybindManager.readInKeybinds(); + /** + * Register the tick handler (for on-tick behaviour) and packet handler (for + * network synchronization and permission stuff). + */ + @Override + public void registerHandlers() { + super.registerHandlers(); + keybindHandler = new KeybindKeyHandler(); + KeyBindingRegistry.registerKeyBinding(keybindHandler); + KeybindManager.readInKeybinds(); - playerTickHandler = new PlayerTickHandler(); - TickRegistry.registerTickHandler(playerTickHandler, Side.CLIENT); - // TickRegistry.registerTickHandler(playerTickHandler, Side.SERVER); + playerTickHandler = new PlayerTickHandler(); + TickRegistry.registerTickHandler(playerTickHandler, Side.CLIENT); + // TickRegistry.registerTickHandler(playerTickHandler, Side.SERVER); - renderTickHandler = new RenderTickHandler(); - TickRegistry.registerTickHandler(renderTickHandler, Side.CLIENT); + renderTickHandler = new RenderTickHandler(); + TickRegistry.registerTickHandler(renderTickHandler, Side.CLIENT); - clientTickHandler = new ClientTickHandler(); - TickRegistry.registerTickHandler(clientTickHandler, Side.CLIENT); + clientTickHandler = new ClientTickHandler(); + TickRegistry.registerTickHandler(clientTickHandler, Side.CLIENT); - MinecraftForge.EVENT_BUS.register(new SoundLoader()); - if (ModCompatability.isThaumCraftLoaded() && ModCompatability.enableThaumGogglesModule()) { - MinecraftForge.EVENT_BUS.register(new ThaumRenderEventHandler()); - } + packetHandler = new MusePacketHandler().register(); + } - packetHandler = new MusePacketHandler().register(); - } + @Override + public void postInit() { - @Override - public void postInit() { - - } + } } \ No newline at end of file diff --git a/src/minecraft/net/machinemuse/powersuits/common/CommonProxy.java b/src/minecraft/net/machinemuse/powersuits/common/CommonProxy.java index 3d48623..f85a56f 100644 --- a/src/minecraft/net/machinemuse/powersuits/common/CommonProxy.java +++ b/src/minecraft/net/machinemuse/powersuits/common/CommonProxy.java @@ -1,46 +1,45 @@ package net.machinemuse.powersuits.common; -import net.machinemuse.powersuits.network.MusePacketHandler; -import net.machinemuse.powersuits.tick.PlayerTickHandler; import cpw.mods.fml.common.registry.TickRegistry; import cpw.mods.fml.relauncher.Side; +import net.machinemuse.powersuits.network.MusePacketHandler; +import net.machinemuse.powersuits.tick.PlayerTickHandler; /** * Server side of the CommonProxy/ClientProxy paradigm. Provides functions which * the ClientProxy will override if the behaviour is different for client and * server. - * + * * @author MachineMuse - * */ public class CommonProxy { - public static String ITEMS_PNG = "/tutorial/generic/items.png"; - public static String BLOCK_PNG = "/tutorial/generic/block.png"; + public static String ITEMS_PNG = "/tutorial/generic/items.png"; + public static String BLOCK_PNG = "/tutorial/generic/block.png"; - public static MusePacketHandler packetHandler; - public static PlayerTickHandler playerTickHandler; + public static MusePacketHandler packetHandler; + public static PlayerTickHandler playerTickHandler; - public void registerSounds() { - } + public void registerEvents() { + } - /** - * Only the client needs to register renderers. - */ - public void registerRenderers() { - } + /** + * Only the client needs to register renderers. + */ + public void registerRenderers() { + } - /** - * Register the server-side tickhandler and packethandler. - */ - public void registerHandlers() { - playerTickHandler = new PlayerTickHandler(); - TickRegistry.registerTickHandler(playerTickHandler, Side.SERVER); + /** + * Register the server-side tickhandler and packethandler. + */ + public void registerHandlers() { + playerTickHandler = new PlayerTickHandler(); + TickRegistry.registerTickHandler(playerTickHandler, Side.SERVER); - packetHandler = new MusePacketHandler(); - packetHandler.register(); - } + packetHandler = new MusePacketHandler(); + packetHandler.register(); + } - public void postInit() { - } + public void postInit() { + } } diff --git a/src/minecraft/net/machinemuse/powersuits/common/ModularPowersuits.java b/src/minecraft/net/machinemuse/powersuits/common/ModularPowersuits.java index c7b17c5..285ff26 100644 --- a/src/minecraft/net/machinemuse/powersuits/common/ModularPowersuits.java +++ b/src/minecraft/net/machinemuse/powersuits/common/ModularPowersuits.java @@ -92,7 +92,7 @@ public class ModularPowersuits { Config.init(new Configuration(event.getSuggestedConfigurationFile())); MinecraftForge.EVENT_BUS.register(new EventHandler()); MinecraftForge.EVENT_BUS.register(new MovementManager()); - proxy.registerSounds(); + proxy.registerEvents(); } public static Config config; diff --git a/src/minecraft/net/machinemuse/powersuits/event/ThaumRenderEventHandler.java b/src/minecraft/net/machinemuse/powersuits/event/ThaumRenderEventHandler.java index 885d223..10c0b28 100644 --- a/src/minecraft/net/machinemuse/powersuits/event/ThaumRenderEventHandler.java +++ b/src/minecraft/net/machinemuse/powersuits/event/ThaumRenderEventHandler.java @@ -35,6 +35,8 @@ public class ThaumRenderEventHandler { @SideOnly(Side.CLIENT) @ForgeSubscribe public void renderLast(RenderWorldLastEvent event) { + float tagscale = getTagScale(); + if (tagscale > 0.0F) setTagScale(tagscale - 0.005F); EntityPlayer player = Minecraft.getMinecraft().thePlayer; if (player != null && player.inventory.armorItemInSlot(3) != null && player.inventory.armorItemInSlot(3).getItem() instanceof IModularItem) { ItemStack stack = player.inventory.armorItemInSlot(3);