Posted March 8, 201312 yr I have another topic up currently concerning suppressing xp orbs from mobs (without supressing them from potions, mining, smelting, etc), without core mods. That isn't looking promising, so my next question is, if I do end up modifying EntityLiving.java from the net.minecraft.entity package (as below), what are the risks (or the downsides)? I assume that coremods replace core files with their own. If that is the case, I assume that any other mods that modify EntityLiving.java will be incompatible, and it will also be effecting any mods that inherit from EntityLiving. I hate the idea of making my mod a core, but the xp orb suppression is a pretty big part of the mod. EDIT: Sorry. I forgot to add the code. Probably not necessary for some of you guys, but this is it. The code that I may have to modify is around line 690 of the net.minecraft.entity.EntityLiving class, in the onDeathUpdate Method. Originally it was... while (var1 > 0) { int var2 = EntityXPOrb.getXPSplit(var1); var1 -= var2; this.worldObj.spawnEntityInWorld(new EntityXPOrb(this.worldObj, this.posX, this.posY, this.posZ, var2)); } I am basically testing with pigs, so I am just wrapping the loop with a conditional if(!(this.getEntityName().equals("Pig") so that pigs will not drop xp orbs. if(!(this.getEntityName().equals("Pig"))){ while (var1 > 0) { int var2 = EntityXPOrb.getXPSplit(var1); var1 -= var2; this.worldObj.spawnEntityInWorld(new EntityXPOrb(this.worldObj, this.posX, this.posY, this.posZ, var2)); } }
March 8, 201312 yr I assume that coremods replace core files with their own. no, they do not. they "just" modify its bytecode on-the-fly using ASM library. http://asm.ow2.org/ mnn.getNativeLang() != English If I helped you please click on the "thank you" button.
March 8, 201312 yr Author Thank you both. It looks like turning my mod into a coremod for this one simple function is a bit much (not that I know what is required), so I'm going to look into some more round-about ways to achieve this. And thanks for the pointer. I hadn't considered my mods being public, but that is a better way to do the check anyway. Java and Strings are not the best company as resources go.
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.