mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-27 15:00:13 +01:00
readd chunk pos long optimization
This commit is contained in:
parent
0895318159
commit
1d6c40afac
3 changed files with 12 additions and 4 deletions
|
@ -17,7 +17,7 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
- server.getCommands().performPrefixedCommand(commandSourceStack, this.command);
|
- server.getCommands().performPrefixedCommand(commandSourceStack, this.command);
|
||||||
+ server.getCommands().dispatchServerCommand(commandSourceStack, this.command); // CraftBukkit
|
+ server.getCommands().dispatchServerCommand(commandSourceStack, this.command); // CraftBukkit
|
||||||
} catch (Throwable var6) {
|
} catch (Throwable var6) {
|
||||||
CrashReport crashReport = CrashReport.forThrowable(var6, "Executing command block");
|
CrashReport crashReport = CrashReport.forThrowable(var6, "Executing command block");
|
||||||
CrashReportCategory crashReportCategory = crashReport.addCategory("Command to be executed");
|
CrashReportCategory crashReportCategory = crashReport.addCategory("Command to be executed");
|
||||||
|
|
|
@ -86,7 +86,7 @@
|
||||||
+ flag = true; // Paper
|
+ flag = true; // Paper
|
||||||
+ // CraftBukkit start
|
+ // CraftBukkit start
|
||||||
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callSpawnerSpawnEvent(entity, pos).isCancelled()) {
|
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callSpawnerSpawnEvent(entity, pos).isCancelled()) {
|
||||||
+ continue;
|
+ continue;
|
||||||
+ }
|
+ }
|
||||||
+ if (!serverLevel.tryAddFreshEntityWithPassengers(entity, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER)) {
|
+ if (!serverLevel.tryAddFreshEntityWithPassengers(entity, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER)) {
|
||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
|
@ -106,12 +106,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public void load(@Nullable Level level, BlockPos pos, CompoundTag tag) {
|
public void load(@Nullable Level level, BlockPos pos, CompoundTag tag) {
|
||||||
- this.spawnDelay = tag.getShort("Delay");
|
|
||||||
+ // Paper start - use larger int if set
|
+ // Paper start - use larger int if set
|
||||||
+ if (tag.contains("Paper.Delay")) {
|
+ if (tag.contains("Paper.Delay")) {
|
||||||
+ this.spawnDelay = tag.getInt("Paper.Delay");
|
+ this.spawnDelay = tag.getInt("Paper.Delay");
|
||||||
+ } else {
|
+ } else {
|
||||||
+ this.spawnDelay = tag.getShort("Delay");
|
this.spawnDelay = tag.getShort("Delay");
|
||||||
+ }
|
+ }
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
boolean flag = tag.contains("SpawnData", 10);
|
boolean flag = tag.contains("SpawnData", 10);
|
||||||
|
|
|
@ -28,3 +28,12 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ChunkPos minFromRegion(int chunkX, int chunkZ) {
|
public static ChunkPos minFromRegion(int chunkX, int chunkZ) {
|
||||||
|
@@ -74,7 +_,7 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
public long toLong() {
|
||||||
|
- return asLong(this.x, this.z);
|
||||||
|
+ return this.longKey; // Paper
|
||||||
|
}
|
||||||
|
|
||||||
|
public static long asLong(int x, int z) {
|
||||||
|
|
Loading…
Reference in a new issue