3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-11-05 02:50:05 +01:00

Use a fixed entity spawn cause of PLUGIN type for creating entities

Dieser Commit ist enthalten in:
Wyatt Childers 2016-05-17 00:58:07 -04:00
Ursprung d1e9446d47
Commit 03819a2342

Datei anzeigen

@ -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);
}
}