mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-13 16:54:22 +00:00
Add new PlayerEvent.Clone called when an EntityPlayer is cloned via dimension travil or respawn.
This commit is contained in:
1 parent
8145de123e
commit
dc10db1d90
2 files changed
+29
-4
No files matched your search
@@ -68,4 +68,28 @@ public class PlayerEvent extends LivingEvent
|
||||
this.displayname = username;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fired when the EntityPlayer is cloned, typically caused by the network sending a RESPAWN_PLAYER event.
|
||||
* Either caused by death, or by traveling from the End to the overworld.
|
||||
*/
|
||||
public static class Clone extends PlayerEvent
|
||||
{
|
||||
/**
|
||||
* The old EntityPlayer that this new entity is a clone of.
|
||||
*/
|
||||
public final EntityPlayer original;
|
||||
/**
|
||||
* True if this event was fired because the player died.
|
||||
* False if it was fired because the entity switched dimensions.
|
||||
*/
|
||||
public final boolean wasDeath;
|
||||
|
||||
public Clone(EntityPlayer _new, EntityPlayer oldPlayer, boolean wasDeath)
|
||||
{
|
||||
super(_new);
|
||||
this.original = oldPlayer;
|
||||
this.wasDeath = wasDeath;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user