Jump to content

Help Getting from Eclipse to Main Game


Recommended Posts

Hello all,


Allow me to describe my situation.  I have recently done a clean install of the latest Minecraft, v. 1.6.2.  I would like to make a simple modification to the Minecraft Files so that lava would behave like water, in that it is self replicating when two lava source blocks are placed diagonally from one another like water.


Now, let me describe as best I can the process I have used so far.


* Created a file on my Desktop named "Minecraft 1.6.2 Modding Files"

* Installed the Java JDK "jdk-7u25-windows-x64" and placed it in the above folder

* Installed Forge 9.10.0 Minecraft 1.6.2 and placed it in the same folder

* Installed MCP per the Install command in the forge folder

* Installed latest version of Eclipse

* Opened Eclipse and set workspace to: "C:\Users\Me\Desktop\Minecraft 1.6.2 Modding Files\forge\mcp\eclipse


* Navigated to and opened file "BlockFlowing.java" by following the path: "Minecraft > Source > net.minecraft.block > BlockFlowing.java"


* Went to the line of code (93-103, if unaltered):



            if (this.numAdjacentSources >= 2 && this.blockMaterial == Material.water)


                if (par1World.getBlockMaterial(par2, par3 - 1, par4).isSolid())


                    j1 = 0;


                else if (par1World.getBlockMaterial(par2, par3 - 1, par4) == this.blockMaterial && par1World.getBlockMetadata(par2, par3 - 1, par4) == 0)


                    j1 = 0;





* Did a control copy and pasted it on the line below the closing brace.

* Replaced where it says " == Material.water" with " == Materal.lava"

* Saved the file

* Ran the program in Eclipse

* Was able to make the game work as I wanted.  I could dig a 2x2x1 hole, file in two opposite corners with lava, and then the two empty corners converted to lava source blocks.

* Exited out of Eclipse




This is where I'm having trouble.  The next steps I took were:


* Open up the MCP folder under the Forge files

* Ran the Decompile .BAT file

* Ran the Recompile .BAT file

* Ran the reobfuscate .BAT file

* Opened up the reobf and minecraft folders under "forge > mcp > reobf > minecraft

* In this folder was a single file, named "apa.class"

* In a new explorer window I navigated to C:\Users\Me\AppData\Roaming\.minecraft

* From there I opened up the 1.6.2 Jar file under "versions > 1.6.2" using 7-zip

* I deleted the current apa.class file and copied the new apa.class file from the forge folder

* I deleted the META-INF folder from 7-zip

* Closed the Jar file and opened up the new minecraft launcher

* Created new creative world, but lava behaved prior to my changes, i.e. did not generate new source blocks. 




I have to doubt that there is something wrong with the code, since it worked as expected in Eclipse.  I think the problem lies in somehow getting the file reobfuscated and over to Minecraft proper.  Any ideas would be greatly appreciated.





Link to comment
Share on other sites

Chibill:  I have no idea what that means, but if it's something you want to do, then I'd be super appreciative!


GotoLink: Per your advice, I uninstalled MCP from the forge folder, reinstalled, redid the code, and did the same thing I did in the OP, except I did not decompile first.  I only ran recompile and reobfuscate.  It still didn't work.


*Note* I did notice that I am getting the "No Scala path" error.  I'm not exactly sure what that means.

Link to comment
Share on other sites

*Note* I did notice that I am getting the "No Scala path" error.  I'm not exactly sure what that means.


The Scala Path error is (I think) normal. I've been getting the same error for a while and I can re/decompile, reobfuscate, ect. without a hitch.


Also, I have been unable to reproduce this bug. I followed your steps exactly and cannot reproduce the error.

Link to comment
Share on other sites

I do apologize.  I know the forum said this was not a Java tutorial, so I'm trying to do the best I can.  I guess I will continue to look at it on weekends when I have time and will try to see if I deviated from my original steps any.  But I do greatly appreciate you taking the time to see if you could find my error.  That's incredibly nice of you!

Link to comment
Share on other sites

The reason it works in eclipse is because it runs the game off of the source files, as you'd expect. Forge is a mod loader and does not edit base class files except where it needs to for its own purposes. That said, it will never compile base class changes. Those stay in eclipse and for good reason. If you have to change something in the vanilla code, you use reflection. If you don't know what reflection is, well you have more homework to do (Quite a bit. Reflection is an advanced topic, but there are tutorials you can copy/paste and modify to get it to work.) The short explanation is that reflection is a computer program going over its own code and changing its behavior run-time. This lets you change things that are otherwise inaccessible (private/protected classes, methods, and variables.) Reflection is very slow and should only be used to change/check things sparingly, so be careful.


For more advanced/heavy reflection, use the ASM provided by Minecraft Forge.

For lighter things like single variable edits/checks, you can use the ObfuscationReflectionHelper class, also provided in Minecraft Forge. An example of using one of its static methods in one of my mod's code is

ObfuscationReflectionHelper.setPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, 1f, "fovModifierHand", "field_78507_R");

Note that I haven't checked if that exact code is still valid since I ported my mod from 1.5.2 to 1.6.2, but the way you use it should still be, which is all that matters here.

width=336 height=83http://img836.imageshack.us/img836/1237/cooltext624963071.png[/img]

I make games, minecraft mods/plugins, and some graphic art.


Current Project: LoECraft - An industrial minecraft server with its own modpack and custom launcher.

Link to comment
Share on other sites

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.

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.


  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Another Minecraft Launcher https://multimc.org/#Download or https://atlauncher.com/downloads
    • Remove these mods and combine OptiFine HD U I6 with Forge 47.2.18 Start with Optifine - without any other mods - if this works, add the mods one by one or in groups until you find the mod, conflicting with Optifine
    • Ok yeah I think this might be where the problem starts. For starters, I think you can get rid of your RecipeType impl and make it a static constant instead. I'm not 100% sure this will fix it but it's posssible. RuneInscribingRecipe public class RuneInscribingRecipe implements Recipe<SimpleContainer> { public static final RecipeType<RuneInscribingRecipe> RECIPE_TYPE = new RecipeType<>(){}; // .... @Override public RecipeType<?> getType() { return RECIPE_TYPE; } // .... } RuneInscriberMenu private Optional<RecipeHolder<RuneInscribingRecipe>> getCurrentRecipe() { SimpleContainer inventory = new SimpleContainer(2); inventory.setItem(BASE_INPUT_SLOT, this.inventory.getStackInSlot(BASE_INPUT_SLOT)); inventory.setItem(TEMPLATE_INPUT_SLOT, this.inventory.getStackInSlot(TEMPLATE_INPUT_SLOT)); List<RecipeHolder<RuneInscribingRecipe>> list = this.blockEntity.getLevel().getRecipeManager().getRecipesFor(RuneInscribingRecipe.RECIPE_TYPE, inventory, this.blockEntity.getLevel()); if (list.isEmpty()) { return Optional.empty(); } return Optional.of(list.get(0)); }   Also, this here is a little suspicious where you're getting the `this.inventory.getStackInSlot` calls. I'd try and make sure those are what you expect they are with either a Debug line in IDE or print statement SimpleContainer inventory = new SimpleContainer(2); inventory.setItem(BASE_INPUT_SLOT, this.inventory.getStackInSlot(BASE_INPUT_SLOT)); System.out.printf("CHECKING BASE INPUT OF RECIPE: %s\n", this.inventory.getStackInSlot(BASE_INPUT_SLOT)); inventory.setItem(TEMPLATE_INPUT_SLOT, this.inventory.getStackInSlot(TEMPLATE_INPUT_SLOT)); System.out.printf("CHECKING TEMPLATE INPUT OF RECIPE: %s\n", this.inventory.getStackInSlot(TEMPLATE_INPUT_SLOT)); ^ See what the result of those print statements are, make sure they're right
    • Upon testing again after adding them, the game still doesn't crash however the resource packs are still unfortunately broken.
    • Hi! Can someone please point me to the correct FAQ or place? I'm not able do DuckDuckGo myself out of this one. As you can hopefully see, chunks are not rendered. I run a forge server, fresh install on a linux VM. Curseforge on the Win11 client with Embeddium, Oculus and Unbound shader. No mods. Forge 47.2.23 on server & client.  No errors, no crashes, no apparent CPU or RAM issues with the VM. This screenshot was captured while creative, but the same happens when flying in survival. Waiting (floating) for a few minutes sooner or (often) later, lets the missing chunks appear. Usually takes 5-10 minutes.  When on a local game, the chunks appear slowly, but they do appear without pause.   This must be something simple, obvious, but I can't find the correct "search words" to find my way out. "Chunks not loading / rendering" didn't help. Browsing several forums neither. 
  • Topics

  • Create New...

Important Information

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