Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Goz3rr

Members
  • Posts

    8
  • Joined

  • Last visited

Everything posted by Goz3rr

  1. int x = (width - xSize) / 2; int y = (height - ySize) / 2; this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); What are the values of width, height, xSize and ySize?
  2. Very interesting, hadn't thought of that. Will look into it!
  3. So, i'm working on making a grappling hook. The actual hook itself is a EntityHook, like the fishing rod uses a EntityFishHook. The problem is, i need some way to store the EntityHook after i spawn it. Looking at the fishing rod, it uses the EntityPlayer.fishEntity field, which i can't since i'm using a EntityHook, not a EntityFishHook. Adding a field to the actual item won't work either, since that means it's shared across all instances of that item, and would probably glitch out. I looked into saving it to the player NBT thing, but i don't think you can write entities to it. Another possibility would be using ASM to add a new field to EntityPlayer, similar to fishEntity. What would be the best approach here?
  4. It would probably be better to switch between metadata in this case, unless you change stuff like light level. It'll save a block id for something else
  5. Wondering about the same. And what would be the best way to edit a function of a baseclass, say, the breeding function of an EntitySheep?
  6. I've read the sticky, but a console log doesn't really seem needed here. I'm using MC1.3.2, Forge 4.1.4.272 and FML 3.1.15.378 To reproduce this: Make a class subscribed to LivingDropsEvent, run this code on that event: ModLoader.getMinecraftInstance().thePlayer.addChatMessage(event.source.getSourceOfDamage().getClass().toString()); ModLoader.getMinecraftInstance().thePlayer.addChatMessage(event.source.getEntity().getClass().toString()); Kill an animal, chat will show "class net.minecraft.src.EntityPlayerMP" twice, which is the player. Shouldn't getEntity() return the entity that died? The wiki says: And when looking at DamageSource.java: public Entity getSourceOfDamage() { return this.getEntity(); } public Entity getEntity() { return null; } what.
  7. You do realize that the second if statement shouldn't even be in the server code right?
  8. Hi there! Currently i'm in the progress of porting my mods over to multiplayer, and my 'weapon' of choice was the Forge Modloader. While working on said task, to be precise my LambChop mod, i found out that Forge does infact change the EntitySheep class, but does nothing with dropFewItems, the function that decides what item should be dropped by the sheep. The current code that i'm adding right now isn't that huge: int var3 = this.rand.nextInt(2) + 1 + this.rand.nextInt(1 + par2); for (int i = 0; i < var3; i++) { if (this.isBurning()) { this.dropItem(mod_LambChop.LambChopCooked.shiftedIndex, 1); } else { this.dropItem(mod_LambChop.LambChopRaw.shiftedIndex, 1); } } But it seems to me it would be a better option if forge added a hook for this, and i'd just use that to do my item dropping! Now i'm very new to Forge, and i have no idea if i'm totally missing a hook that already exists, or no one really cares about a hook like this existing, but atleast it would give me a peace of mind that pretty much any mod using forge is going to be compatible with the mods i'm making since i no longer need to fiddle around in this baseclass!
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.