Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

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

*/

  • 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.

  • 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'

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.

  • 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. 

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.

  • 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.

That would be why you do not have the deobfuscated java files.

 

Could you paste the entire output from gradle?

  • 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.

Make a backup of your source files, reunzip a fresh forge zip, and rerun the command, perhaps?

I assume you have internet access?

 

I am looking forward to someone wiser solving your issue. Sorry.

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

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!

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!

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)

  • 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.

  • 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>

 

  • 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.

  • 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.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.