Jump to content

stumblinbear

Members
  • Posts

    23
  • Joined

  • Last visited

Everything posted by stumblinbear

  1. So, I'm updating the mod I've been working on to 1.8, but the RenderBlocks class that I used to render... blocks... into a custom GUI no longer exists. I switched to using RenderItem renderItemModel(ItemStack). It renders items fine, but it only renders blocks registered within my mod. They all run off the same renderItemModel, leading me to believe there is another function I can use for blocks. But, I have yet to find it... Any ideas? :L GL11.glPushMatrix(); { GL11.glTranslatef(x, y, 0F); GL11.glScalef(20F * scale, 20F * scale, 1F); GL11.glTranslatef(.55F, .7F, 1F); GL11.glRotatef(180F, 1F, 0F, 0F); if(spin) if(itemStack.getItem() instanceof ItemBlock) { GL11.glRotatef(20F, 1F, 0F, 0F); GL11.glRotatef(Minecraft.getMinecraft().theWorld.getTotalWorldTime() % 360, 0F, 1F, 0F); }else GL11.glTranslatef(0F, (float)Math.sin(Minecraft.getMinecraft().theWorld.getTotalWorldTime() / 20F) * .1F, 0F); renderItem.renderItemModel(itemStack); } GL11.glPopMatrix();
  2. I commented this out and tried it ont he server-side, and it worked. Turns out I had to make a function that was set to @SideOnly that returns the player for client side. packet.readBytes(data); switch(FMLCommonHandler.instance().getEffectiveSide()) { case CLIENT: packet.executeClient(getClient()); //packet.executeClient(Minecraft.getMinecraft().thePlayer); break; case SERVER: INetHandler netHandler = ctx.channel().attr(NetworkRegistry.NET_HANDLER).get(); packet.executeServer(((NetHandlerPlayServer)netHandler).playerEntity); break; } Thanks for the help!
  3. Sorry bout that, here ya go. [spoiler=Crash Report] ---- Minecraft Crash Report ---- // I just don't know what went wrong Time: 7/23/14 4:10 PM Description: Exception in server tick loop cpw.mods.fml.common.LoaderException: java.lang.NoClassDefFoundError: net/minecraft/client/entity/EntityClientPlayerMP at cpw.mods.fml.common.LoadController.transition(LoadController.java:162) at cpw.mods.fml.common.Loader.initializeMods(Loader.java:691) at cpw.mods.fml.server.FMLServerHandler.finishServerLoading(FMLServerHandler.java:97) at cpw.mods.fml.common.FMLCommonHandler.onServerStarted(FMLCommonHandler.java:318) at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(DedicatedServer.java:187) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:374) at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:669) Caused by: java.lang.NoClassDefFoundError: net/minecraft/client/entity/EntityClientPlayerMP at com.codingforcookies.betterrecords.src.BetterRecords.init(BetterRecords.java:56) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:622) at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:513) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:622) at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:208) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:187) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:622) at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:118) at cpw.mods.fml.common.Loader.initializeMods(Loader.java:690) ... 5 more Caused by: java.lang.ClassNotFoundException: net.minecraft.client.entity.EntityClientPlayerMP at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:323) at java.lang.ClassLoader.loadClass(ClassLoader.java:268) ... 33 more Caused by: java.lang.NullPointerException A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- System Details -- Details: Minecraft Version: 1.7.2 Operating System: Linux (i386) version 2.6.32-042stab084.17 Java Version: 1.6.0_32, Sun Microsystems Inc. Java VM Version: OpenJDK Server VM (mixed mode), Sun Microsystems Inc. Memory: 879346272 bytes (838 MB) / 1029046272 bytes (981 MB) up to 1029046272 bytes (981 MB) JVM Flags: 2 total; -Xmx1024M -Xms1024M AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP v9.03 FML v7.2.211.1121 Minecraft Forge 10.12.2.1121 4 mods loaded, 4 mods active mcp{9.03} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized FML{7.2.211.1121} [Forge Mod Loader] (forge.jar) Unloaded->Constructed->Pre-initialized->Initialized Forge{10.12.2.1121} [Minecraft Forge] (forge.jar) Unloaded->Constructed->Pre-initialized->Initialized betterrecords{1.0.12} [better Records] (betterrecords-1.0.12.jar) Unloaded->Constructed->Pre-initialized->Errored Profiler Position: N/A (disabled) Is Modded: Definitely; Server brand changed to 'fml,forge' Type: Dedicated Server (map_server.txt)
  4. Upon exporting my mod, and placing it into a server, I'm getting a peculiar error. While singleplayer works perfectly fine, the server throws: Caused by: java.lang.NoClassDefFoundError: net/minecraft/client/entity/EntityClientPlayerMP This seems to suggest that my registration code is client side ony, but what is the server-side packet channel registration code? Here's the line throwing the error: PacketHandler.channels = NetworkRegistry.INSTANCE.newChannel("BetterRecords", new ChannelHandler()); It is currently under FMLInitializationEvent. Any help is greatly appreciated as this is the last thing I need before I may release said mod.
  5. Okay, I have been attempting to, upon the world loading, to keep every chunk that a specific entity is in loaded. I have tried loading a chunk that I had placed the entity in, then see if it was loaded: Minecraft.getMinecraft().theWorld.getChunkFromChunkCoords(11, 0); System.out.println(Minecraft.getMinecraft().theWorld.getChunkFromChunkCoords(11, 0).isChunkLoaded); But, that always returns false and the entity never updated. Perhaps I'm putting it in the incorrect place? I have tried it in the server and client tick events, as well as in an entity, but they all showed the same failure. Could anyone help/lead me in the correct direction? Also, is there a way to fetch all the entities in a world, even if the chunk hasn't been loaded as of yet?
  6. I am attempting to get localized strings that are set via my language file so I can have different lore for each metadata in an item. I have tried using LanguageRegistry.instance().getStringLocalization() but that throws a peculiar error: [19:58:19] [Client thread/FATAL]: Reported exception thrown! net.minecraft.util.ReportedException: Rendering screen at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1173) ~[EntityRenderer.class:?] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1022) ~[Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:910) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:112) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_51] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_51] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_51] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_51] at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) [launchwrapper-1.9.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?] Caused by: java.lang.NullPointerException at cpw.mods.fml.client.FMLClientHandler.getCurrentLanguage(FMLClientHandler.java:581) ~[FMLClientHandler.class:?] at cpw.mods.fml.common.FMLCommonHandler.getCurrentLanguage(FMLCommonHandler.java:469) ~[FMLCommonHandler.class:?] at cpw.mods.fml.common.registry.LanguageRegistry.getStringLocalization(LanguageRegistry.java:59) ~[LanguageRegistry.class:?] at com.codingforcookies.uesatellites.src.items.Upgrade.addInformation(Upgrade.java:35) ~[upgrade.class:?] at net.minecraft.item.ItemStack.getTooltip(ItemStack.java:642) ~[itemStack.class:?] at net.minecraft.client.gui.GuiScreen.renderToolTip(GuiScreen.java:122) ~[GuiScreen.class:?] at net.minecraft.client.gui.inventory.GuiContainerCreative.renderToolTip(GuiContainerCreative.java:768) ~[GuiContainerCreative.class:?] at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:190) ~[GuiContainer.class:?] at net.minecraft.client.renderer.InventoryEffectRenderer.drawScreen(InventoryEffectRenderer.java:44) ~[inventoryEffectRenderer.class:?] at net.minecraft.client.gui.inventory.GuiContainerCreative.drawScreen(GuiContainerCreative.java:672) ~[GuiContainerCreative.class:?] at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1143) ~[EntityRenderer.class:?] ... 9 more I am absolutely positive that the unlocalized name exists, but alas, nothing has worked. Can someone help?
  7. I've already configured it to work with the new launcher :3
  8. I am working on a Minecraft launcher to auto-install all my server's mods automatically. Everything installs and runs, but it loaded from .minecraft instead of my folder... So I made a mod that overrides Minecraft.java(Only way I know how to do it) to change the directory for the folder. It changed the directory fine. But, after forge is done setting up, I get an odd error... Here's the log... I do NOT want to use MultiMC... I already looked through their source to see how they did it and came up with nothing... Can anyone help?
  9. Probably a stupidly simple issue... But I made an item renderer and it worked fine, but after a code edit, it just... stopped... working... Anyway... If anyone can help that'd be great (Please note that I changed a few names of stuff to keep the mod a secret...) CustomItemRenderer Code: public class ItemRenderHandler implements IItemRenderer { ModelBase renderModel = null; int renderID = 0; public ItemRenderHandler(String par1Name, int par2RenderID) { MainModFile.log(Level.INFO, "Registering ItemRenderHandler for " + par1Name + " with render ID " + par2RenderID + "."); this.renderID = par2RenderID; switch(this.renderID) { case(0): renderModel = new ModelBook(); break; default: break; } } @Override public boolean handleRenderType(ItemStack item, ItemRenderType type) { MainModFile.log(Level.INFO, "Handle Render Type."); return true; } @Override public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { if(type.equals(ItemRendererHelper.BLOCK_3D)) { MainModFile.log(Level.INFO, "Block_3D is enabled."); return false; } MainModFile.log(Level.INFO, "Block_3D is not enabled."); return true; } @Override public void renderItem(ItemRenderType type, ItemStack item, Object... data) { MainModFile.log(Level.INFO, "Rendering Item!"); GL11.glPushMatrix(); switch(this.renderID) { case(0): ClientProxy.mc.renderEngine.bindTexture(CommonProxy.PATH + "book.png"); switch (type) { case EQUIPPED: if(ClientProxy.mc.gameSettings.thirdPersonView == 0) { GL11.glTranslatef(1F, 0.6F, 0F); GL11.glRotatef(0F, 1, 0, 0); GL11.glRotatef(180F, 0, 1, 0); GL11.glRotatef(20F, 0, 0, 1); } else { GL11.glTranslatef(0.5F, 1.3F, 0.8F); GL11.glRotatef(0F, 1, 0, 0); GL11.glRotatef(140F, 0, 1, 0); GL11.glRotatef(0F, 0, 0, 1); } GL11.glScalef(2.25F, 2.25F, 2.25F); renderModel.render((Entity)null, 0.0F, 0.0F, 0.0F, 1.0F, 0.0F, 0.0625F); break; case INVENTORY: GL11.glTranslatef(0F, 0F, 0F); GL11.glRotatef(170F, 1, 0, 0); GL11.glRotatef(65F, 0, 1, 0); GL11.glRotatef(-50F, 0, 0, 1); GL11.glScalef(1.5F, 1.5F, 1.5F); renderModel.render((Entity)null, 0.0F, 0.0F, 0.0F, 1.0F, 0.0F, 0.0625F); break; case ENTITY: GL11.glTranslatef(0F, 1F, 0F); GL11.glRotatef(1F, 1, 0, 0); GL11.glRotatef(1F, 0, 1, 0); GL11.glRotatef(90F, 0, 0, 1); GL11.glScalef(1.5F, 1.5F, 1.5F); renderModel.render((Entity)null, 0.0F, 0.0F, 0.0F, 1.0F, 0.0F, 0.0625F); break; default: break; } break; case(1): ClientProxy.mc.renderEngine.bindTexture(CommonProxy.PATH + "Glow.png"); GL11.glDepthFunc(GL11.GL_LEQUAL); GL11.glEnable(GL11.GL_ALPHA_TEST); GL11.glAlphaFunc(GL11.GL_GREATER, 0.5F); switch (type) { case EQUIPPED: if(ClientProxy.mc.gameSettings.thirdPersonView == 0) { for (int j = 0; j < 1; ++j) { GL11.glTranslatef(1F, 0.6F, 0F); GL11.glRotatef(0F, 1, 0, 0); GL11.glRotatef(180F, 0, 1, 0); GL11.glRotatef(20F, 0, 0, 1); } } else { for (int j = 0; j < 1; ++j) { GL11.glTranslatef(0.5F, 1.3F, 0.8F); GL11.glRotatef(0F, 1, 0, 0); GL11.glRotatef(140F, 0, 1, 0); GL11.glRotatef(0F, 0, 0, 1); } } GL11.glScalef(2.25F, 2.25F, 2.25F); break; case INVENTORY: for (int j = 0; j < 1; ++j) { GL11.glTranslatef(0F, 0F, 0F); GL11.glRotatef(170F, 1, 0, 0); GL11.glRotatef(65F, 0, 1, 0); GL11.glRotatef(-50F, 0, 0, 1); GL11.glScalef(1.5F, 1.5F, 1.5F); } break; case ENTITY: for (int j = 0; j < 1; ++j) { GL11.glTranslatef(0F, 1F, 0F); GL11.glRotatef(1F, 1, 0, 0); GL11.glRotatef(1F, 0, 1, 0); GL11.glRotatef(90F, 0, 0, 1); GL11.glScalef(1.5F, 1.5F, 1.5F); } break; default: break; } GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL11.GL_BLEND); GL11.glDepthMask(false); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); Tessellator tessellator = Tessellator.instance; tessellator.startDrawing(GL11.GL_QUADS); tessellator.addVertex(0, 0, 0); tessellator.addVertex(0, 25, 0); tessellator.addVertex(25, 25, 0); tessellator.addVertex(25, 0, 0); tessellator.draw(); GL11.glDepthMask(true); GL11.glDisable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); GL11.glDepthFunc(GL11.GL_EQUAL); break; default: break; } GL11.glPopMatrix(); } } ClientProxy: public class ClientProxy extends CommonProxy { public static Minecraft mc; @Override public void setUpRenderThings() { mc = FMLClientHandler.instance().getClient(); MinecraftForgeClient.registerItemRenderer(ItemIDs.BOOK_ID, new ItemRenderHandler(Strings.BOOK_NAME, 0)); MinecraftForgeClient.registerItemRenderer(ItemIDs.GLOW_ID, new ItemRenderHandler(Strings.GLOW_NAME, 1)); } } I can confirm that the itemrenderers are getting added, but nothing else in the file is. Cheers, Stumblinbear
  10. Ok, i ran it again through eclipse and it said it doesn't have a corrent MANIFEST Manifest-Version: 1.0 FMLCorePlugin: codingforcookies.asm.CFC_LoadingPlugin
  11. I tested it outside of eclipse and recompiled inside my minecraft.jar already... That is when it threw the error...
  12. First of all, your Recipe class should implement IRecipe, then copy the addRecipe code from the CraftingManager and change the file declarations to your new class that extends IRecipe...
  13. Just copy the IRecipe into a new class file, make a new addRecipe, and add a small if statement into your IRecipe to check if the slot stacksize and item stacksize are the same... It will force having the correct stackSizes but oncrafted it only removed 1 :\ I do not know how to fix this, just mess with it. Maybe make a craftingHandler, and set the oncrafted to check if it was your recipe? i dont know...
  14. Is there anywhere that i can find a list of all the possible Forge Handlers, Trackers, and Events? I've been looking in the packages, but I'm afraid I may have missed some...
  15. I would, but it doesn't throw any... except that the variable is not public....
  16. Ok, thanks for that! Hmm, it worked, but it doesn't show in-game... Help? What's wrong with my code? ModMetadata data = event.getModMetadata(); data.modId = MyModId"; data.name = "RANDOM"; data.version = "0.8.649"; data.url = "url url url url"; data.authorList = Arrays.asList(new String[] { "Person" }); data.description = "DESCRIPTION."; data.dependants = "*"; Also, I have another issue... at data.dependants, I need to set that to * to make it load last every time... (Please don't tell me to rename my mod with a Z at the beginning...) But I don't know what to put instead of "*" (Which always gives me errors) And you don't think I tried Access Transformers? I rebuilt the same Transformer from the ground up 6 or 7 times (Because I thought i screwed it up...), put it into a jar and dropped it into my coremods folder. I used the tutorial on the forge wiki. And I could never get it to work... If you have any suggestions for me on making the transformer, then please, enlighten me... And yes, i converted the variable I wanted changed into mcp then into forge and changed the /'s to .'s... Does and An Access Transformer allow changing the variable at any given moment?
  17. I know there is a way to do it, I've been googleing and searching for hours for the answer... Also, how do i force a mod to be loaded last? This is what i currently have( Of course its all fake stuff ): public ModContainer() { super(new ModMetadata()); ModMetadata mcModInfo = super.getMetadata(); mcModInfo.modId = "MyModId"; mcModInfo.name = "RANDOM"; mcModInfo.version = "201354.0213"; mcModInfo.url = "lo.l.com"; mcModInfo.authorList = Arrays.asList(new String[] { "HTRIDEP:J" }); mcModInfo.description = "A Mod..."; } If anyone knows how, please tell me. Please, Please, PLEASE, don't tell me to put it in my mods zip folder... It edits 2 base classes that are never used and there is no way around it... (Unless forge makes the Timer in Minecraft.java public, and the debugCamera in EntityRenderer as well... Which i doubt...) FIXED: For anyone else having these problems: Fixed the modInfo my using the modMeta in Forge's PreInitializationEvent. Fixed Loading My Mod Last by putting dependencies="after:*" in my @Mod annotation Fixed my ASM by using this in my MANIFEST.MF Manifest-Version: 1.0 FMLCorePlugin: path.to.LoadingPlugin -Dfml.coreMods.load=path.to.LoadingPlugin
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.