Jump to content

Recommended Posts

Posted

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

*/

Posted

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.

Posted

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'

Posted

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.

Posted

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.

Posted

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.

Posted

 

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.

Posted

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 :)

Posted

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!

Posted

Stability is overrated :D

 

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!

Posted

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)

Posted

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.

Posted

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>

 

Posted

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.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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