mirror of
https://github.com/PaperMC/Paper.git
synced 2025-03-19 21:48:48 +01:00
SPIGOT-4783: CreatureSpawnEvent causes crash when getting block type
By: md_5 <git@md-5.net>
This commit is contained in:
parent
fb196561cb
commit
1e60258bfd
1 changed files with 8 additions and 20 deletions
|
@ -81,19 +81,7 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -454,7 +471,10 @@
|
@@ -476,7 +493,7 @@
|
||||||
while (iterator.hasNext()) {
|
|
||||||
Entity entity = (Entity) iterator.next();
|
|
||||||
|
|
||||||
- if (!(entity instanceof EntityHuman) && !this.world.addEntityChunk(entity)) {
|
|
||||||
+ // CraftBukkit start
|
|
||||||
+ boolean addEntity = !chunk.needsDecoration || CraftEventFactory.doEntityAddEventCalling(this.world, entity, CreatureSpawnEvent.SpawnReason.CHUNK_GEN); // Only call for new chunks
|
|
||||||
+ if (addEntity && !(entity instanceof EntityHuman) && !this.world.addEntityChunk(entity)) {
|
|
||||||
+ // CraftBukkit end
|
|
||||||
if (list == null) {
|
|
||||||
list = Lists.newArrayList(new Entity[] { entity});
|
|
||||||
} else {
|
|
||||||
@@ -476,7 +496,7 @@
|
|
||||||
long i = playerchunk.h().pair();
|
long i = playerchunk.h().pair();
|
||||||
|
|
||||||
playerchunk.getClass();
|
playerchunk.getClass();
|
||||||
|
@ -102,7 +90,7 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -493,7 +513,7 @@
|
@@ -493,7 +510,7 @@
|
||||||
return Either.left(chunk);
|
return Either.left(chunk);
|
||||||
});
|
});
|
||||||
}, (runnable) -> {
|
}, (runnable) -> {
|
||||||
|
@ -111,7 +99,7 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
completablefuture1.thenAcceptAsync((either) -> {
|
completablefuture1.thenAcceptAsync((either) -> {
|
||||||
@@ -507,7 +527,7 @@
|
@@ -507,7 +524,7 @@
|
||||||
return Either.left(chunk);
|
return Either.left(chunk);
|
||||||
});
|
});
|
||||||
}, (runnable) -> {
|
}, (runnable) -> {
|
||||||
|
@ -120,7 +108,7 @@
|
||||||
});
|
});
|
||||||
return completablefuture1;
|
return completablefuture1;
|
||||||
}
|
}
|
||||||
@@ -517,8 +537,14 @@
|
@@ -517,8 +534,14 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public void saveChunk(IChunkAccess ichunkaccess) {
|
public void saveChunk(IChunkAccess ichunkaccess) {
|
||||||
|
@ -136,7 +124,7 @@
|
||||||
try {
|
try {
|
||||||
this.world.checkSession();
|
this.world.checkSession();
|
||||||
} catch (ExceptionWorldConflict exceptionworldconflict) {
|
} catch (ExceptionWorldConflict exceptionworldconflict) {
|
||||||
@@ -569,9 +595,10 @@
|
@@ -569,9 +592,10 @@
|
||||||
ChunkCoordIntPair chunkcoordintpair = playerchunk.h();
|
ChunkCoordIntPair chunkcoordintpair = playerchunk.h();
|
||||||
Packet<?>[] apacket = new Packet[2];
|
Packet<?>[] apacket = new Packet[2];
|
||||||
|
|
||||||
|
@ -148,7 +136,7 @@
|
||||||
boolean flag1 = i1 <= this.A;
|
boolean flag1 = i1 <= this.A;
|
||||||
|
|
||||||
this.sendChunk(entityplayer, chunkcoordintpair, apacket, flag, flag1);
|
this.sendChunk(entityplayer, chunkcoordintpair, apacket, flag, flag1);
|
||||||
@@ -626,7 +653,7 @@
|
@@ -626,7 +650,7 @@
|
||||||
private NBTTagCompound f(ChunkCoordIntPair chunkcoordintpair) throws IOException {
|
private NBTTagCompound f(ChunkCoordIntPair chunkcoordintpair) throws IOException {
|
||||||
NBTTagCompound nbttagcompound = this.read(chunkcoordintpair);
|
NBTTagCompound nbttagcompound = this.read(chunkcoordintpair);
|
||||||
|
|
||||||
|
@ -157,7 +145,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean d(ChunkCoordIntPair chunkcoordintpair) {
|
boolean d(ChunkCoordIntPair chunkcoordintpair) {
|
||||||
@@ -946,7 +973,7 @@
|
@@ -946,7 +970,7 @@
|
||||||
public final Set<EntityPlayer> trackedPlayers = Sets.newHashSet();
|
public final Set<EntityPlayer> trackedPlayers = Sets.newHashSet();
|
||||||
|
|
||||||
public EntityTracker(Entity entity, int i, int j, boolean flag) {
|
public EntityTracker(Entity entity, int i, int j, boolean flag) {
|
||||||
|
@ -166,7 +154,7 @@
|
||||||
this.tracker = entity;
|
this.tracker = entity;
|
||||||
this.trackingDistance = i;
|
this.trackingDistance = i;
|
||||||
this.e = SectionPosition.a(entity);
|
this.e = SectionPosition.a(entity);
|
||||||
@@ -1015,6 +1042,17 @@
|
@@ -1015,6 +1039,17 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue