mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 01:37:37 +00:00
fix: remove synchronisation on chunk GET when sending packet
This commit is contained in:
parent
15c6027958
commit
a14bb7ed2c
@ -350,27 +350,23 @@ public final class PaperweightPlatformAdapter extends NMSAdapter {
|
|||||||
MinecraftServer.getServer().execute(() -> {
|
MinecraftServer.getServer().execute(() -> {
|
||||||
ClientboundLevelChunkWithLightPacket packet;
|
ClientboundLevelChunkWithLightPacket packet;
|
||||||
if (PaperLib.isPaper()) {
|
if (PaperLib.isPaper()) {
|
||||||
synchronized (chunk) {
|
packet = new ClientboundLevelChunkWithLightPacket(
|
||||||
packet = new ClientboundLevelChunkWithLightPacket(
|
levelChunk,
|
||||||
levelChunk,
|
nmsWorld.getChunkSource().getLightEngine(),
|
||||||
nmsWorld.getChunkSource().getLightEngine(),
|
null,
|
||||||
null,
|
null,
|
||||||
null,
|
true,
|
||||||
true,
|
false // last false is to not bother with x-ray
|
||||||
false // last false is to not bother with x-ray
|
);
|
||||||
);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
synchronized (chunk) {
|
// deprecated on paper - deprecation suppressed
|
||||||
// deprecated on paper - deprecation suppressed
|
packet = new ClientboundLevelChunkWithLightPacket(
|
||||||
packet = new ClientboundLevelChunkWithLightPacket(
|
levelChunk,
|
||||||
levelChunk,
|
nmsWorld.getChunkSource().getLightEngine(),
|
||||||
nmsWorld.getChunkSource().getLightEngine(),
|
null,
|
||||||
null,
|
null,
|
||||||
null,
|
true
|
||||||
true
|
);
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
nearbyPlayers(nmsWorld, coordIntPair).forEach(p -> p.connection.send(packet));
|
nearbyPlayers(nmsWorld, coordIntPair).forEach(p -> p.connection.send(packet));
|
||||||
});
|
});
|
||||||
|
@ -364,25 +364,21 @@ public final class PaperweightPlatformAdapter extends NMSAdapter {
|
|||||||
MinecraftServer.getServer().execute(() -> {
|
MinecraftServer.getServer().execute(() -> {
|
||||||
ClientboundLevelChunkWithLightPacket packet;
|
ClientboundLevelChunkWithLightPacket packet;
|
||||||
if (PaperLib.isPaper()) {
|
if (PaperLib.isPaper()) {
|
||||||
synchronized (chunk) {
|
packet = new ClientboundLevelChunkWithLightPacket(
|
||||||
packet = new ClientboundLevelChunkWithLightPacket(
|
levelChunk,
|
||||||
levelChunk,
|
nmsWorld.getChunkSource().getLightEngine(),
|
||||||
nmsWorld.getChunkSource().getLightEngine(),
|
null,
|
||||||
null,
|
null,
|
||||||
null,
|
false // last false is to not bother with x-ray
|
||||||
false // last false is to not bother with x-ray
|
);
|
||||||
);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
synchronized (chunk) {
|
// deprecated on paper - deprecation suppressed
|
||||||
// deprecated on paper - deprecation suppressed
|
packet = new ClientboundLevelChunkWithLightPacket(
|
||||||
packet = new ClientboundLevelChunkWithLightPacket(
|
levelChunk,
|
||||||
levelChunk,
|
nmsWorld.getChunkSource().getLightEngine(),
|
||||||
nmsWorld.getChunkSource().getLightEngine(),
|
null,
|
||||||
null,
|
null
|
||||||
null
|
);
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
nearbyPlayers(nmsWorld, coordIntPair).forEach(p -> p.connection.send(packet));
|
nearbyPlayers(nmsWorld, coordIntPair).forEach(p -> p.connection.send(packet));
|
||||||
});
|
});
|
||||||
|
@ -364,25 +364,21 @@ public final class PaperweightPlatformAdapter extends NMSAdapter {
|
|||||||
MinecraftServer.getServer().execute(() -> {
|
MinecraftServer.getServer().execute(() -> {
|
||||||
ClientboundLevelChunkWithLightPacket packet;
|
ClientboundLevelChunkWithLightPacket packet;
|
||||||
if (PaperLib.isPaper()) {
|
if (PaperLib.isPaper()) {
|
||||||
synchronized (chunk) {
|
packet = new ClientboundLevelChunkWithLightPacket(
|
||||||
packet = new ClientboundLevelChunkWithLightPacket(
|
levelChunk,
|
||||||
levelChunk,
|
nmsWorld.getChunkSource().getLightEngine(),
|
||||||
nmsWorld.getChunkSource().getLightEngine(),
|
null,
|
||||||
null,
|
null,
|
||||||
null,
|
false // last false is to not bother with x-ray
|
||||||
false // last false is to not bother with x-ray
|
);
|
||||||
);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
synchronized (chunk) {
|
// deprecated on paper - deprecation suppressed
|
||||||
// deprecated on paper - deprecation suppressed
|
packet = new ClientboundLevelChunkWithLightPacket(
|
||||||
packet = new ClientboundLevelChunkWithLightPacket(
|
levelChunk,
|
||||||
levelChunk,
|
nmsWorld.getChunkSource().getLightEngine(),
|
||||||
nmsWorld.getChunkSource().getLightEngine(),
|
null,
|
||||||
null,
|
null
|
||||||
null
|
);
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
nearbyPlayers(nmsWorld, coordIntPair).forEach(p -> p.connection.send(packet));
|
nearbyPlayers(nmsWorld, coordIntPair).forEach(p -> p.connection.send(packet));
|
||||||
});
|
});
|
||||||
|
@ -353,25 +353,21 @@ public final class PaperweightPlatformAdapter extends NMSAdapter {
|
|||||||
MinecraftServer.getServer().execute(() -> {
|
MinecraftServer.getServer().execute(() -> {
|
||||||
ClientboundLevelChunkWithLightPacket packet;
|
ClientboundLevelChunkWithLightPacket packet;
|
||||||
if (PaperLib.isPaper()) {
|
if (PaperLib.isPaper()) {
|
||||||
synchronized (chunk) {
|
packet = new ClientboundLevelChunkWithLightPacket(
|
||||||
packet = new ClientboundLevelChunkWithLightPacket(
|
levelChunk,
|
||||||
levelChunk,
|
nmsWorld.getChunkSource().getLightEngine(),
|
||||||
nmsWorld.getChunkSource().getLightEngine(),
|
null,
|
||||||
null,
|
null,
|
||||||
null,
|
false // last false is to not bother with x-ray
|
||||||
false // last false is to not bother with x-ray
|
);
|
||||||
);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
synchronized (chunk) {
|
// deprecated on paper - deprecation suppressed
|
||||||
// deprecated on paper - deprecation suppressed
|
packet = new ClientboundLevelChunkWithLightPacket(
|
||||||
packet = new ClientboundLevelChunkWithLightPacket(
|
levelChunk,
|
||||||
levelChunk,
|
nmsWorld.getChunkSource().getLightEngine(),
|
||||||
nmsWorld.getChunkSource().getLightEngine(),
|
null,
|
||||||
null,
|
null
|
||||||
null
|
);
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
nearbyPlayers(nmsWorld, coordIntPair).forEach(p -> p.connection.send(packet));
|
nearbyPlayers(nmsWorld, coordIntPair).forEach(p -> p.connection.send(packet));
|
||||||
});
|
});
|
||||||
|
@ -361,25 +361,21 @@ public final class PaperweightPlatformAdapter extends NMSAdapter {
|
|||||||
MinecraftServer.getServer().execute(() -> {
|
MinecraftServer.getServer().execute(() -> {
|
||||||
ClientboundLevelChunkWithLightPacket packet;
|
ClientboundLevelChunkWithLightPacket packet;
|
||||||
if (PaperLib.isPaper()) {
|
if (PaperLib.isPaper()) {
|
||||||
synchronized (chunk) {
|
packet = new ClientboundLevelChunkWithLightPacket(
|
||||||
packet = new ClientboundLevelChunkWithLightPacket(
|
levelChunk,
|
||||||
levelChunk,
|
nmsWorld.getChunkSource().getLightEngine(),
|
||||||
nmsWorld.getChunkSource().getLightEngine(),
|
null,
|
||||||
null,
|
null,
|
||||||
null,
|
false // last false is to not bother with x-ray
|
||||||
false // last false is to not bother with x-ray
|
);
|
||||||
);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
synchronized (chunk) {
|
// deprecated on paper - deprecation suppressed
|
||||||
// deprecated on paper - deprecation suppressed
|
packet = new ClientboundLevelChunkWithLightPacket(
|
||||||
packet = new ClientboundLevelChunkWithLightPacket(
|
levelChunk,
|
||||||
levelChunk,
|
nmsWorld.getChunkSource().getLightEngine(),
|
||||||
nmsWorld.getChunkSource().getLightEngine(),
|
null,
|
||||||
null,
|
null
|
||||||
null
|
);
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
nearbyPlayers(nmsWorld, coordIntPair).forEach(p -> p.connection.send(packet));
|
nearbyPlayers(nmsWorld, coordIntPair).forEach(p -> p.connection.send(packet));
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user