New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add an EntityMountEvent. #1723
Add an EntityMountEvent. #1723
Conversation
Yeah, the whole "? :" part was a bit unnecessary, I've fixed that. |
I like this. Also, I love your example mod. |
That's useful :) |
Sorry about that, I don't know why I made two separate if statements in Entity.... I'll be sure to clean that up a bit. |
I've fixed up some stuff, and added a world object to the event. @LexManos, I've also removed the world.isRemote checks in the if statements to make it cleaner, but I could re-add them if you want. |
@@ -332,6 +333,10 @@ public static boolean canInteractWith(EntityPlayer player, Entity entity) | |||
{ | |||
return !MinecraftForge.EVENT_BUS.post(new EntityInteractEvent(player, entity)); | |||
} | |||
|
|||
public static boolean canMountEntity(Entity entityMounting, Entity entityBeingMounted, boolean mounting){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new line, also should have better names.
@LexManos Did some more fixes. The mountEntity() method in EntityLivingBase calls Entity.mountEntity(), so the EntityLivingBase check prevents living entities from creating a second EntityMountEvent with the same data. |
Squash your commits |
@Parker8283 Hey Parker, sorry to bother you, but what do you mean by "squashing" my commits? |
Google is your friend :P |
@LexManos I've squashed everything into one commit, for your convenience. |
+ if(!net.minecraftforge.event.ForgeEventFactory.canMountEntity(this, p_70078_1_, true)){ return; } | ||
if (this.field_70154_o != null && p_70078_1_ == null) | ||
- { | ||
+ { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whitespace
Fixed that whitespace character. |
This event gets fired whenever a entity mounts/dismounts another entity, like when a players right-clicks an empty minecart, or right-clicks a horse with a saddle. It contains the entity mounting, and the entity that's being mounted. If it's canceled, the entity does not mount/dismount.
Here's the example mod:
http://pastebin.com/EbpHgvCJ