Posted July 4, 201411 yr Ok, I'm trying to update SpringMine's BetterLog mod to 1.7.2. Here's my code: /* 1: */ package mods.springmine.BetterLog; /* 2: */ /* 3: */ import cpw.mods.fml.client.registry.RenderingRegistry; /* 4: */ import cpw.mods.fml.common.Mod; /* 5: */ import cpw.mods.fml.common.Mod.EventHandler; /* 6: */ import cpw.mods.fml.common.event.FMLInitializationEvent; /* 7: */ import cpw.mods.fml.common.event.FMLPreInitializationEvent; /* 9: */ import cpw.mods.fml.relauncher.Side; /* 10: */ import mods.springmine.utils.BlockModelRender; /* 11: */ import net.minecraft.block.Block; /* 12: */ import net.minecraft.block.BlockLog; /* 14: */ /* 15: */ @Mod(modid="mods.springmine.BetterLog", name="BetterLog", version="1.6.2") /* 16: */ /* 17: */ public class BetterLog /* 18: */ { /* 19: */ public static int RenderType; /* 20: */ /* 21: */ @Mod.EventHandler /* 22: */ public void preinit(FMLPreInitializationEvent event) /* 23: */ { /* 24:24 */ int tempid = Block.field_71951_J.field_71990_ca; /* 25:25 */ Block.field_71973_m[tempid] = null; /* 26:26 */ Block block = new BlockBetterLog(tempid); /* 27:27 */ net.minecraft.item.Item.field_77698_e[tempid] = new ItemMultiTextureTile(tempid - 256, block, BlockLog.field_72142_a).func_77655_b("log"); /* 28: */ } /* 29: */ /* 30: */ @Mod.EventHandler /* 31: */ public void init(FMLInitializationEvent event) /* 32: */ { /* 33:35 */ if (event.getSide() == Side.CLIENT) /* 34: */ { /* 35:37 */ RenderType = RenderingRegistry.getNextAvailableRenderId(); /* 36:38 */ RenderingRegistry.registerBlockHandler(RenderType, new BlockModelRender(new ModelBetterLog(), RenderType, true)); /* 37: */ } /* 38: */ } /* 39: */ } /* Location: C:\Users\*****\Downloads\BetterLog162.zip * Qualified Name: mods.springmine.BetterLog.BetterLog * JD-Core Version: 0.7.0.1 */
July 4, 201411 yr Author Ok, my code is here(w/o line numbers): http://pastebin.com/4HNwrRD3 My problem is a couple errors on this line: net.minecraft.item.Item.field_77698_e[tempid] = new ItemMultiTextureTile(tempid - 256, block, BlockLog.getBlockById(tempid)).setUnlocalizedName("log"); Not sure how to change ItemMultiTextureTile and field_77698_e to their 1.7.2 equivalents.
July 4, 201411 yr Author No, this mod was meant to render all the vanilla wood with a new, rounder model. I have most of the errors fixed, but some still bug me. Like the ones on this line: net.minecraft.item.Item.field_77698_e[tempid] = new ItemMultiTexture(tempid - 256, block, BlockLog.getBlockById(tempid)).setUnlocalizedName("log"); . The errors are: 'field_77698_e cannot be resolved or is not a field', and 'ItemMultiTextureTile cannot be resolved to a type'
July 4, 201411 yr It says right there. field_77698_e does not exist (anymore), and it seems you haven't imported the class ItemMultiTexture . What is field_77698_e supposed to be? Have a look through Item.java and replace field_77698_e with the deobfuscated name, if it exists.
July 4, 201411 yr Author I'm working with Forge 1.7.2 w/ Gradle, and it seems it didn't download the minecraft jars, so I can't find the 1.7.2 item.java file. Also, I imported it and now it is undefined.
July 4, 201411 yr The Item.java will need to be decompiled and deobfuscated to make any sense. This has probably already happened if your development environment is set up correctly, but the location of the java files has changed from 1.6.4, I believe. They now reside in forge/build/tmp/recompSrc.
July 4, 201411 yr Author The Item.java will need to be decompiled and deobfuscated to make any sense. This has probably already happened if your development environment is set up correctly, but the location of the java files has changed from 1.6.4, I believe. They now reside in forge/build/tmp/recompSrc. I looked in forge/build/tmp/ and there was no recompSrc folder. I followed all the directions for installing the Forge src and it still won't show up.
July 4, 201411 yr Author Most of it was normal, but for some reason it skipped the srgs and minecraft's client and server jars.
July 4, 201411 yr That would be why you do not have the deobfuscated java files. Could you paste the entire output from gradle?
July 4, 201411 yr Author C:\Users\joshl\Desktop\forge-1.7.2-10.12.2.1121-src>gradlew.bat setupDecompWorks pace **************************** Powered By MCP: http://mcp.ocean-labs.de/ Searge, ProfMobius, Fesh0r, R4wk, ZeuX, IngisKahn MCP Data version : unknown **************************** :extractUserDev :getAssetsIndex :getAssets :copyAssets :extractNatives :genSrgs SKIPPED :makeStart SKIPPED :downloadMcpTools :downloadClient SKIPPED :downloadServer SKIPPED :mergeJars SKIPPED :deobfuscateJar SKIPPED :decompile SKIPPED :processSources SKIPPED :remapJar SKIPPED :extractMinecraftSrc SKIPPED :recompMinecraft SKIPPED :repackMinecraft SKIPPED :setupDecompWorkspace BUILD SUCCESSFUL Total time: 57.673 secs C:\Users\joshl\Desktop\forge-1.7.2-10.12.2.1121-src> Here it is. Dunno why these were skipped.
July 4, 201411 yr Make a backup of your source files, reunzip a fresh forge zip, and rerun the command, perhaps?
July 4, 201411 yr Author Have done it several times with the same problem. It's really getting on my nerves.
July 4, 201411 yr I assume you have internet access? I am looking forward to someone wiser solving your issue. Sorry.
July 4, 201411 yr I use reflection for my own diabolical ends (read: replacing vanilla Blocks). That seems to work well, for the most part, for now. Looking forward to a more recommended way of doing that, though
July 4, 201411 yr Hence diabolical! I can see how it could corrupt worlds, but what I am working on using reflection is merely a proof of concept. Once Forge for 1.7 supports replacing vanilla Blocks (if it ever will), I will port the code. For now, though, reflection seems to be the best way for me to test out my ideas as if that system was already in place. Thank you for the heads up, though!
July 4, 201411 yr Stability is overrated I may as well prepare for the future. Plus, I don't like reading changelogs and then not get to play with the awesome new features right away!
July 5, 201411 yr just a bit of hijack(sorry), but i use asm to replace items, blocks and remove some entities,while i do a bunch of sanity checks, can it still corrupt worlds? if so, do i need to hook the world load/save events and make backups of the world? thanks edit: its just me or this guy decompiled a mod using JAD? (hence line numbers and obfuscated names)
July 5, 201411 yr Author Have you run the eclipse command after running setupDecompWorkspace? For your actual problem, I misunderstood the first time. You are trying to replace vanilla Blocks. This is no longer (or rather: not yet) possible in Forge for 1.7 because of the switch to a non-id based system. I don't think running the eclipse command lets me have the deobfuscated classes.
July 5, 201411 yr Author You mean type in both setupDecompWorkspace AND eclipse in the same line? Hmmm, I'll try that, can't guarantee anything since the output last time skipped the srg as well as the client and server jars. Edit: Nope, gave me this output: C:\Users\joshl\Desktop\forge-1.7.2-10.12.2.1121-src>gradlew.bat setupDecompWorks pace eclipse **************************** Powered By MCP: http://mcp.ocean-labs.de/ Searge, ProfMobius, Fesh0r, R4wk, ZeuX, IngisKahn MCP Data version : unknown **************************** :extractUserDev :getAssetsIndex :getAssets :copyAssets :extractNatives :genSrgs SKIPPED :makeStart SKIPPED :downloadMcpTools :downloadClient SKIPPED :downloadServer SKIPPED :mergeJars SKIPPED :deobfuscateJar SKIPPED :decompile SKIPPED :processSources SKIPPED :remapJar SKIPPED :extractMinecraftSrc SKIPPED :recompMinecraft SKIPPED :repackMinecraft SKIPPED :setupDecompWorkspace :eclipseClasspath :eclipseJdt :eclipseProject :eclipse BUILD SUCCESSFUL Total time: 1 mins 13.113 secs C:\Users\joshl\Desktop\forge-1.7.2-10.12.2.1121-src>
July 5, 201411 yr Author Ohhhh, so that's where it is. Damn, forgot about that. Thnx. Edit: My first error happens to be "field_71951_J cannot be resolved or is not a field". I know it doesn't exist in 1.7.2, but looking through Block.java has not given me anything useful.
July 5, 201411 yr Author Is there another way? I've not been able to find any specific tutorials, and it cannot be impossible to do.
July 5, 201411 yr Author How is BetterLogs replacing Vanilla blocks? It is only giving them new models. It does not change any vanilla code at all.
July 5, 201411 yr Author Is there any way I could change the render for vanilla logs to the more rounded shape given by SpringMine's mod(as in, a 1.7 alternative I could use to achieve a similar result)?
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.