mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 08:17:35 +00:00
Fix EntityJoinWorldEvent not firing as expected: (#8033)
- Fix entities loaded from disk not getting the event. - Fix vehicles with passengers getting the event twice.
This commit is contained in:
1 parent
69136fce19
commit
b01a217f45
4 files changed
+39
-19
No files matched your search
@@ -42,15 +42,30 @@ public class EntityJoinWorldEvent extends EntityEvent
|
||||
{
|
||||
|
||||
private final Level world;
|
||||
private final boolean loadedFromDisk;
|
||||
|
||||
public EntityJoinWorldEvent(Entity entity, Level world)
|
||||
{
|
||||
this(entity, world, false);
|
||||
}
|
||||
|
||||
public EntityJoinWorldEvent(Entity entity, Level world, boolean loadedFromDisk)
|
||||
{
|
||||
super(entity);
|
||||
this.world = world;
|
||||
this.loadedFromDisk = loadedFromDisk;
|
||||
}
|
||||
|
||||
public Level getWorld()
|
||||
{
|
||||
return world;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@code true} if the entity was loaded from disk. On client entities, the info isn't available and this will always return {@code false}.
|
||||
*/
|
||||
public boolean loadedFromDisk()
|
||||
{
|
||||
return loadedFromDisk;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user