
insane_gravy
Members-
Content Count
28 -
Joined
-
Last visited
Community Reputation
0 NeutralAbout insane_gravy
-
Rank
Tree Puncher
Converted
-
Gender
Undisclosed
-
Personal Text
I am new!
-
Urgent: Desperately Need Help With Update
insane_gravy replied to insane_gravy's topic in Modder Support
Unfortunately this was a bit of a complex mod. -
Urgent: Desperately Need Help With Update
insane_gravy replied to insane_gravy's topic in Modder Support
Thanks for that. I'll pass it along. -
insane_gravy started following Urgent: Desperately Need Help With Update
-
Hi everyone, I haven't done any modding work since Minecraft 1.7.10, so I'm more than a little rusty. Needless to say, I've been asked to update a mod that was created for Minecraft 1.5 by someone else. I've set everything up in Eclipse and made sure that the dependencies are all correct. When I open the mod up, I get hit with 2419 errors that all need fixing. I'm a bit over my head here because the modding environment looks so different from what I'm used to and really don't know where to start. Does anyone have any pointers on how to get this updated? I've attached an example of one of the files that needs fixing. BiologicalElement.java
-
I assume I need a VillageHandler to do that, right? What do I need to create a village component?
-
I'm trying to make a villager of my own, but it doesn't spawn naturally and I can only obtain it through a spawn egg. How do I get a villager to appear in the game?
-
How is it creating a TileEntity by default? It should only create a TileEntity if a block is added and it detects a valid combination. I tried removing removing references to the superclass, but that doesn't fix it.
-
Can you post the entire file?
-
Yeah, that works.
-
I previously had a boolean field which would be set to "true" if the block being placed was the master block (ie: it would only be true if it was the last block in the combination). The same problem was still present even with this field present. Additionally, the GUI can only open if a TileEntity exists at the location, so it's creating TileEntities multiple times for some reason. Try this version of the boolean check. It has more console statements and should show the method calls occuring more than once. private boolean isValidCombination(int x, int y, int z, World world) { System.out.println("checking for valid combinations"); if (getNextX(x, y, z, world) && getNextZ(x, y, z, world)) { return getTopRightDiag(x, y, z, world); } if (getNextX(x, y, z, world) && getPrevZ(x, y, z, world)) { return getTopLeftDiag(x, y, z, world); } if (getPrevX(x, y, z, world) && getNextZ(x, y, z, world)) { return getBottomRightDiag(x, y, z, world); } if (getPrevX(x, y, z, world) && getPrevZ(x, y, z, world)) { return getBottomLeftDiag(x, y, z, world); } System.out.println("no combinations found"); return false; } private boolean getNextX(int x, int y, int z, World world) { return world.getBlockId(x + 1, y, z) == modHerbcraft.BlockOvenBrick.blockID; } private boolean getPrevX(int x, int y, int z, World world) { return world.getBlockId(x - 1, y, z) == modHerbcraft.BlockOvenBrick.blockID; } private boolean getNextZ(int x, int y, int z, World world) { return world.getBlockId(x, y, z + 1) == modHerbcraft.BlockOvenBrick.blockID; } private boolean getPrevZ(int x, int y, int z, World world) { return world.getBlockId(x, y, z - 1) == modHerbcraft.BlockOvenBrick.blockID; } private boolean getTopLeftDiag(int x, int y, int z, World world) { return world.getBlockId(x + 1, y, z - 1) == modHerbcraft.BlockOvenBrick.blockID; } private boolean getTopRightDiag(int x, int y, int z, World world) { return world.getBlockId(x + 1, y, z + 1) == modHerbcraft.BlockOvenBrick.blockID; } private boolean getBottomLeftDiag(int x, int y, int z, World world) { return world.getBlockId(x - 1, y, z - 1) == modHerbcraft.BlockOvenBrick.blockID; } private boolean getBottomRightDiag(int x, int y, int z, World world) { return world.getBlockId(x - 1, y, z - 1) == modHerbcraft.BlockOvenBrick.blockID; }
-
Interesting. The TileEntity should only be called once, and that's when the last block is placed. I added a println statement at several points, and it's clear from console feedback that the method calls occur for all blocks when a new one is placed in close proximity to existing ones. The method calls should only happen once. What do I need to change to stop this from happening?
-
Generally speaking, field declarations have to be made on an individual basis.
-
This is the code that checks for valid combinations private boolean isValidCombination(int x, int y, int z, World world) { if (getNextX(x, y, z, world) && getNextZ(x, y, z, world)) { return getTopRightDiag(x, y, z, world); } if (getNextX(x, y, z, world) && getPrevZ(x, y, z, world)) { return getTopLeftDiag(x, y, z, world); } if (getPrevX(x, y, z, world) && getNextZ(x, y, z, world)) { return getBottomRightDiag(x, y, z, world); } if (getPrevX(x, y, z, world) && getPrevZ(x, y, z, world)) { return getBottomLeftDiag(x, y, z, world); } return false; } private boolean getNextX(int x, int y, int z, World world) { return world.getBlockId(x + 1, y, z) == modHerbcraft.BlockOvenBrick.blockID; } private boolean getPrevX(int x, int y, int z, World world) { return world.getBlockId(x - 1, y, z) == modHerbcraft.BlockOvenBrick.blockID; } private boolean getNextZ(int x, int y, int z, World world) { return world.getBlockId(x, y, z + 1) == modHerbcraft.BlockOvenBrick.blockID; } private boolean getPrevZ(int x, int y, int z, World world) { return world.getBlockId(x, y, z - 1) == modHerbcraft.BlockOvenBrick.blockID; } private boolean getTopLeftDiag(int x, int y, int z, World world) { return world.getBlockId(x + 1, y, z - 1) == modHerbcraft.BlockOvenBrick.blockID; } private boolean getTopRightDiag(int x, int y, int z, World world) { return world.getBlockId(x + 1, y, z + 1) == modHerbcraft.BlockOvenBrick.blockID; } private boolean getBottomLeftDiag(int x, int y, int z, World world) { return world.getBlockId(x - 1, y, z - 1) == modHerbcraft.BlockOvenBrick.blockID; } private boolean getBottomRightDiag(int x, int y, int z, World world) { return world.getBlockId(x + 1, y, z + 1) == modHerbcraft.BlockOvenBrick.blockID; } It's just a boolean check.
-
Here's some of the code I've been working with @Override public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { if (isValidCombination(par2, par3, par4, par1World)) { if (par1World.getBlockTileEntity(par2, par3, par4) != null) { System.out.println("This is the master block"); TileEntityFurnace tile = (TileEntityFurnace) par1World.getBlockTileEntity(par2, par3, par4); par5EntityPlayer.displayGUIFurnace(tile); return true; } } return false; } public void onBlockAdded(World world, int x, int y, int z) { if (isValidCombination(x, y, z, world)) { super.onBlockAdded(world, x, y, z); System.out.println("this is a valid combination"); } } For some reason, this code creates three seperate TileEntities when the last block is placed. Can anyone see why this is occuring?
-
Do those methods go in the TileEntity class or the Block class?
-
Where can I find the source?