mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-22 17:27:38 +00:00
Use a fixed entity spawn cause of PLUGIN type for creating entities
This commit is contained in:
parent
d1e9446d47
commit
03819a2342
@ -44,6 +44,8 @@ import org.spongepowered.api.data.property.block.SkyLuminanceProperty;
|
||||
import org.spongepowered.api.entity.EntityType;
|
||||
import org.spongepowered.api.entity.EntityTypes;
|
||||
import org.spongepowered.api.event.cause.Cause;
|
||||
import org.spongepowered.api.event.cause.entity.spawn.SpawnCause;
|
||||
import org.spongepowered.api.event.cause.entity.spawn.SpawnTypes;
|
||||
import org.spongepowered.api.world.World;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
@ -262,6 +264,8 @@ public abstract class SpongeWorld extends AbstractWorld {
|
||||
|
||||
protected abstract void applyEntityData(org.spongepowered.api.entity.Entity entity, BaseEntity data);
|
||||
|
||||
private static final Cause ENTITY_SPAWN_CAUSE = Cause.source(SpawnCause.builder().type(SpawnTypes.PLUGIN).build()).build();
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Entity createEntity(Location location, BaseEntity entity) {
|
||||
@ -285,7 +289,7 @@ public abstract class SpongeWorld extends AbstractWorld {
|
||||
new Vector3d(dir.getX(), dir.getY(), dir.getZ())
|
||||
);
|
||||
|
||||
if (world.spawnEntity(newEnt, Cause.source(SpongeWorldEdit.container()).build())) {
|
||||
if (world.spawnEntity(newEnt, ENTITY_SPAWN_CAUSE)) {
|
||||
return new SpongeEntity(newEnt);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user