Right, so I would look for this problem, but I believe it's pretty specific. Whenever I use the code as shown below, it works completely fine, though for each item entity it spawns, it spawns a duplicate that cannot be picked up, though it renders the exact same way. This code worked fine for versions below 1.3.2, so what might be the problem?
public static boolean destroyBlock(int par1, int par2, int par3, World world, boolean smelt) {
int meta = world.getBlockMetadata(par1, par2, par3);
int var2 = world.getBlockId(par1, par2, par3);
if (var2 != 0 && var2 != 7 && var2 != 8 && var2 != 9 && var2 != 10 && var2 != 11 && var2 != 31 && var2 != 104 && var2 != 105 && var2 !=106) {
if (smelt = false) {
if (var2 == 2) {
var2 = 3;
}
if (var2 == 63 || var2 == 68) {
var2 = 323;
}
}
if (smelt = true) {
if (var2 == 14) {
var2 = 266;
}
if (var2 == 15) {
var2 = 265;
}
}
world.setBlockWithNotify(par1, par2, par3, 0);
EntityItem ei = new EntityItem(world, par1, par2, par3, new ItemStack(var2, 1, meta));
world.spawnEntityInWorld(ei);
}
return true;
}
Right, so I would look for this problem, but I believe it's pretty specific. Whenever I use the code as shown below, it works completely fine, though for each item entity it spawns, it spawns a duplicate that cannot be picked up, though it renders the exact same way. This code worked fine for versions below 1.3.2, so what might be the problem?
Note: I am not a coder, I've just heard about this a lot. It sounds like you are spawning it twice, once in the client process and once in the server process. I think an if World.isRemote() or something is what I've seen for the fix.
Note: I am not a coder, I've just heard about this a lot. It sounds like you are spawning it twice, once in the client process and once in the server process. I think an if World.isRemote() or something is what I've seen for the fix.
You're quite amazing for figuring that out... I forgot to add the
if(world.isRemote) {
return false;
}
into there. I've never EVER seen anyone figure out the fix that isn't a modder themselves. I tip my hat to you.
Well, do you plan on learning Java? You'd learn it VERY quick, I can tell.
Well, I mean, obviously you know some of it, but you should pursue it.
I learned Java many years ago, started my career as a developer, and quickly realized I didn't enjoy writing code all that much. So I became a sysadmin, and now I get to tell developers when they are doing it wrong.
I learned Java many years ago, started my career as a developer, and quickly realized I didn't enjoy writing code all that much. So I became a sysadmin, and now I get to tell developers when they are doing it wrong.
Oh.
Well in that case, you know a frak of a lot more than me about Java. Lol, you should say that you USED to code instead of you DON'T code
Note: I am not a coder, I've just heard about this a lot. It sounds like you are spawning it twice, once in the client process and once in the server process. I think an if World.isRemote() or something is what I've seen for the fix.
http://www.minecraft...ob-performance/
You're quite amazing for figuring that out... I forgot to add the
into there. I've never EVER seen anyone figure out the fix that isn't a modder themselves. I tip my hat to you.
http://www.minecraft...ob-performance/
Well, do you plan on learning Java? You'd learn it VERY quick, I can tell.
Well, I mean, obviously you know some of it, but you should pursue it.
I learned Java many years ago, started my career as a developer, and quickly realized I didn't enjoy writing code all that much. So I became a sysadmin, and now I get to tell developers when they are doing it wrong.
http://www.minecraft...ob-performance/
Oh.
Well in that case, you know a frak of a lot more than me about Java. Lol, you should say that you USED to code instead of you DON'T code