Jump to content

nosrick

Members
  • Posts

    45
  • Joined

  • Last visited

Posts posted by nosrick

  1. Oh, right! Now I get it. Thanks for clearing that up.

     

    I pretty much copied the way EntityAIFollowOwner does it, except I don't use data watchers because I am not familiar with them.

     

    A UUID is used in the Entity, because it is passed in from the egg it hatches from.

     

    An EntityPlayer is used in the AI, because otherwise I'd be calling worldObj.func_152378_a(UUID) all the time to get one for the information required to move towards it.

  2. I'll elaborate:

    I realise there's one renderer for all entities, yes.

    What I'm doing is saving the age within the entity, then when the entity changes life stages, it sets a static ModelBase in the renderer to the new model, then changes the model field at the start of every render call. Feels pretty hacky, but it gets the job done.

     

    ...I also get the feeling this shouldn't work. But it does, so yay!

  3. Sorry to bring up a slightly old topic, have been ill a few days.

     

    So I've got texture swapping working, but not model swapping.

     

    You are passing entity arguments into render method - save some field inside entity (age) and use it insdie render method to e.g scale model down, or even use different model.

     

    How would I go about that? RenderEntityLiving's mainModel is a protected non-static value, and as far as I know, that's what's used for rendering. (Or renderPassModel, one of the two)

  4. Is it possible to change an entity's model at runtime?

     

    I'm having some trouble with my tamagotchi mod, wherein my 'gotchi has to age up and change model. Now, I have two options; change the model at runtime, or instantiate a new class and delete the old instance.

     

    So if it's not possible to change an entity's model at runtime, how would I go about deleting the old instance?

  5. Above, and note: you can get player.getUUID() to save player to TileEntity's NBT (one UUID = one player).

    To retrieve: MinecraftServer#getEntityFromUuid(UUID uuid) // I think there is player-specific method, yet I don't remember

     

    Note: UUIDs are only working on server side.

     

    EDIT

    Yup, there is: World#getPlayerEntityByUUID(UUID uuid) - but it works per-world.

     

    I can only find World#getPlayerEntityByName(). Is it perhaps a 1.8 feature, or am I missing something?

  6. More questions!

     

    So I've got a shapeless recipe, of one dirt block and one poop, but it just doesn't work. What am I doing wrong? I apologise in advance if it's something glaringly obvious.

     

     

    GameRegistry.addShapelessRecipe(new ItemStack(gotchiFertiliser, 4), new ItemStack(Blocks.dirt), new ItemStack(BlockRegistry.poopBlock));

     

     

    EDIT: Just to add, the code is most certainly being executed. I have a print statement above it that triggers.

×
×
  • Create New...

Important Information

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