Fix entity create/remove

This commit is contained in:
Jesse Boyd 2016-05-20 04:43:28 +10:00
parent 54864b73d2
commit 9e128b8d0c
2 changed files with 3 additions and 8 deletions

View File

@ -421,7 +421,6 @@ public class BukkitQueue_1_9_R1 extends BukkitQueue_0<Chunk, ChunkSection[], Dat
}
int j = FaweCache.CACHE_J[y][x][z];
if (array[j] != 0) {
// System.out.println("REMOVE ENT (blocked): " + entity);
nmsWorld.removeEntity(entity);
}
}
@ -433,7 +432,6 @@ public class BukkitQueue_1_9_R1 extends BukkitQueue_0<Chunk, ChunkSection[], Dat
Collection<Entity> ents = new ArrayList<>(entities[i]);
for (Entity entity : ents) {
if (entsToRemove.contains(entity.getUniqueID())) {
// System.out.println("REMOVE ENT (action): " + entity);
nmsWorld.removeEntity(entity);
}
}
@ -472,7 +470,6 @@ public class BukkitQueue_1_9_R1 extends BukkitQueue_0<Chunk, ChunkSection[], Dat
entity.setLocation(x, y, z, yaw, pitch);
nmsWorld.addEntity(entity, CreatureSpawnEvent.SpawnReason.CUSTOM);
createdEntities.add(entity.getUniqueID());
// System.out.println("CREATE ENT (action): " + entity);
}
}
// Change task?

View File

@ -12,8 +12,6 @@ import com.sk89q.worldedit.entity.BaseEntity;
import com.sk89q.worldedit.entity.Entity;
import com.sk89q.worldedit.extent.AbstractDelegateExtent;
import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.history.change.EntityCreate;
import com.sk89q.worldedit.history.change.EntityRemove;
import com.sk89q.worldedit.history.changeset.ChangeSet;
import com.sk89q.worldedit.regions.Region;
import com.sk89q.worldedit.util.Location;
@ -87,8 +85,8 @@ public class HistoryExtent extends AbstractDelegateExtent {
@Override
public Entity createEntity(final Location location, final BaseEntity state) {
final Entity entity = super.createEntity(location, state);
if ((state != null) && (entity != null)) {
this.changeSet.add(new EntityCreate(location, state, entity));
if ((state != null)) {
this.changeSet.addEntityCreate(state.getNbtData());
}
return entity;
}
@ -139,7 +137,7 @@ public class HistoryExtent extends AbstractDelegateExtent {
final BaseEntity state = this.entity.getState();
final boolean success = this.entity.remove();
if ((state != null) && success) {
HistoryExtent.this.changeSet.add(new EntityRemove(location, state));
HistoryExtent.this.changeSet.addEntityRemove(state.getNbtData());
}
return success;
}