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

Rui

Members
  • Content Count

    49
  • Joined

  • Last visited

Community Reputation

1 Neutral

About Rui

  • Rank
    Tree Puncher

Converted

  • Gender
    Undisclosed
  • Personal Text
    Author of Lively Animals (Not Yet Released)
  1. I've done this before, but it's been awhile and I can't seem to figure out how I got it to work the first time. I'm trying to look through the Biomes o Plenty source files. I made a new project with it and imported the necessary files. However, it's acting a bit strangely. http://i61.tinypic.com/6o339j.png The folders do not cascade but are all bunched together like this, and of course, it can't find the minecraft and forge files because they are not in there. I believe there was some way to simply import a file like this and look at all its contents and be able to hop
  2. How do I set it to accessible if I can't access it in the first place? Edit: Nevermind, figured it out. I got the method to fire but unfortunately it didn't do anything. Thanks anyway, though.
  3. Still doesn't work. if (rider != null && rider.ridingEntity != null) { if (rider.getHeldItem() != null && rider.getHeldItem().isItemEqual(new ItemStack(Items.carrot_on_a_stick))) { System.out.println("Rider is holding carrot on a stick."); Class clazz = EntityPig.class; Method method = null; try { method = clazz.getMethod("updateAITasks"); } catch (NoSuchMethodException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (SecurityException e) { // TODO Auto-generated catch block e.printStackTrace();
  4. Trying reflection for the first time, and something which seemed very simple eludes me. if (rider != null && rider.ridingEntity != null) { if (rider.getHeldItem() != null && rider.getHeldItem().isItemEqual(new ItemStack(Items.carrot_on_a_stick))) { System.out.println("Rider is holding carrot on a stick."); Class clazz = EntityPig.class; Method method = null; try { method = clazz.getMethod("updateAITasks", (Class) null); } catch (NoSuchMethodException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (SecurityEx
  5. code is a mysterious thing that works in mysterious ways see OP for solution
  6. Makes sense. How do I cancel it?
  7. I am trying to make it so that when the player shift+right clicks the pig, the pig is unsaddled and the player gets the saddle back. This is my current code: @SubscribeEvent public void removeSaddle(EntityInteractEvent event) { if (event.target instanceof EntityPig && event.entity instanceof EntityPlayer) { EntityPig pig = (EntityPig) event.target; EntityPlayer player = (EntityPlayer) event.entity; if (pig.getSaddled() && player.getHeldItem() == null && player.isSneaking()) { player.inventory.setInventorySlotContents((player.inventory.currentItem), ne
  8. Alright, I'm an idiot. Of course you don't put a check for the server, because then the client has no idea that you've moved. A hurr durr. New problem: For some reason if you enter the world already mounted on a pig, the pig refuses to move. It can turn, but not move. Otherwise, when you mount a pig the pig's body jerks awkwardly as it moves. I tried doing setLocationAndAngles() for the pig, but then the render wouldn't update to reflect the pig's movement and yaw/pitch. Relevant class: http://pastebin.com/q3aNZ5wq
  9. Excellent, thank you! Well, with some more testing I found that the position of the player DOES change... but the render doesn't. I don't... <i>why doesn't the render update to reflect the position</i>. Guess that means I'll have to do it myself. Um... any ideas?
  10. On Techne: New Model -> Base Class: Pick whichever entity you'd like to mess with.
  11. While I'm at it, could someone tell me how to add mods to eclipse? I tried just shoving the mods into the "mods" folder, but it crashed because it couldn't find the appropriate classes.
  12. Ah, thank you for that first answer, I'll definitely change that. I can't override updateRiderPosition though. I'm kind of hacking the original pig entity with events and such, so unfortunately method overriding is unavailable for me.
  13. Made the change to check for EntityPlayerMP instead of EntityPlayer. It cuts it down to one call, but is it an acceptable way of dealing with that problem? Meanwhile, I'm having trouble actually updating the rider's position. Using setLocation and setLocationAndAngles don't seem to have any effect (other than making my computer's fans whirr). Not particularly happy about the position being coded in on the Player's side... who's wise idea was that? Anyway, if anyone can give me an idea for how to change the player's position, that would be great.
×
×
  • Create New...

Important Information

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