@@ -13,12 +13,12 @@
|
||||
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
@@ -20,6 +25,7 @@
|
||||
public static <T extends PacketListener> void ensureMainThread(Packet<T> packet, T t0, IAsyncTaskHandler<?> iasynctaskhandler) throws CancelledPacketHandleException {
|
||||
if (!iasynctaskhandler.isMainThread()) {
|
||||
public static <T extends PacketListener> void ensureRunningOnSameThread(Packet<T> packet, T t0, IAsyncTaskHandler<?> iasynctaskhandler) throws CancelledPacketHandleException {
|
||||
if (!iasynctaskhandler.isSameThread()) {
|
||||
iasynctaskhandler.execute(() -> {
|
||||
+ if (MinecraftServer.getServer().hasStopped() || (t0 instanceof PlayerConnection && ((PlayerConnection) t0).processedDisconnect)) return; // CraftBukkit, MC-142590
|
||||
if (t0.a().isConnected()) {
|
||||
packet.a(t0);
|
||||
if (t0.getConnection().isConnected()) {
|
||||
packet.handle(t0);
|
||||
} else {
|
||||
@@ -28,6 +34,10 @@
|
||||
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
- this.newCenterX = worldborder.getCenterX();
|
||||
- this.newCenterZ = worldborder.getCenterZ();
|
||||
+ // CraftBukkit start - multiply out nether border
|
||||
+ this.newCenterX = worldborder.getCenterX() * worldborder.world.getDimensionManager().getCoordinateScale();
|
||||
+ this.newCenterZ = worldborder.getCenterZ() * worldborder.world.getDimensionManager().getCoordinateScale();
|
||||
+ this.newCenterX = worldborder.getCenterX() * worldborder.world.dimensionType().coordinateScale();
|
||||
+ this.newCenterZ = worldborder.getCenterZ() * worldborder.world.dimensionType().coordinateScale();
|
||||
+ // CraftBukkit end
|
||||
this.oldSize = worldborder.getSize();
|
||||
this.newSize = worldborder.k();
|
||||
this.lerpTime = worldborder.j();
|
||||
this.newSize = worldborder.getLerpTarget();
|
||||
this.lerpTime = worldborder.getLerpRemainingTime();
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
- this.newCenterX = worldborder.getCenterX();
|
||||
- this.newCenterZ = worldborder.getCenterZ();
|
||||
+ // CraftBukkit start - multiply out nether border
|
||||
+ this.newCenterX = worldborder.getCenterX() * worldborder.world.getDimensionManager().getCoordinateScale();
|
||||
+ this.newCenterZ = worldborder.getCenterZ() * worldborder.world.getDimensionManager().getCoordinateScale();
|
||||
+ this.newCenterX = worldborder.getCenterX() * worldborder.world.dimensionType().coordinateScale();
|
||||
+ this.newCenterZ = worldborder.getCenterZ() * worldborder.world.dimensionType().coordinateScale();
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
}
|
||||
|
||||
public PacketPlayInChat(PacketDataSerializer packetdataserializer) {
|
||||
- this.message = packetdataserializer.e(256);
|
||||
+ this.message = org.apache.commons.lang3.StringUtils.normalizeSpace(packetdataserializer.e(256)); // CraftBukkit - see PlayerConnection
|
||||
- this.message = packetdataserializer.readUtf(256);
|
||||
+ this.message = org.apache.commons.lang3.StringUtils.normalizeSpace(packetdataserializer.readUtf(256)); // CraftBukkit - see PlayerConnection
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
short short0 = (Short) shortiterator.next();
|
||||
|
||||
this.positions[j] = short0;
|
||||
- this.states[j] = chunksection.getType(SectionPosition.a(short0), SectionPosition.b(short0), SectionPosition.c(short0));
|
||||
+ this.states[j] = (chunksection != null) ? chunksection.getType(SectionPosition.a(short0), SectionPosition.b(short0), SectionPosition.c(short0)) : net.minecraft.world.level.block.Blocks.AIR.getBlockData(); // CraftBukkit - SPIGOT-6076, Mojang bug when empty chunk section notified
|
||||
- this.states[j] = chunksection.getBlockState(SectionPosition.sectionRelativeX(short0), SectionPosition.sectionRelativeY(short0), SectionPosition.sectionRelativeZ(short0));
|
||||
+ this.states[j] = (chunksection != null) ? chunksection.getBlockState(SectionPosition.sectionRelativeX(short0), SectionPosition.sectionRelativeY(short0), SectionPosition.sectionRelativeZ(short0)) : net.minecraft.world.level.block.Blocks.AIR.defaultBlockState(); // CraftBukkit - SPIGOT-6076, Mojang bug when empty chunk section notified
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user