Minecraft 1.20

This commit is contained in:
LOOHP 2023-06-07 22:11:02 +01:00
parent 0159361eec
commit 1f021007a1
9 changed files with 173730 additions and 169436 deletions

14
pom.xml
View File

@ -24,7 +24,7 @@
<groupId>com.loohp</groupId> <groupId>com.loohp</groupId>
<artifactId>Limbo</artifactId> <artifactId>Limbo</artifactId>
<name>Limbo</name> <name>Limbo</name>
<version>0.7.4-ALPHA</version> <version>0.7.5-ALPHA</version>
<description>Standalone Limbo Minecraft Server.</description> <description>Standalone Limbo Minecraft Server.</description>
<url>https://github.com/LOOHP/Limbo</url> <url>https://github.com/LOOHP/Limbo</url>
@ -136,7 +136,7 @@
</executions> </executions>
</plugin> </plugin>
</plugins> </plugins>
<finalName>${project.artifactId}-${project.version}-1.19.4</finalName> <finalName>${project.artifactId}-${project.version}-1.20</finalName>
</build> </build>
<profiles> <profiles>
@ -256,31 +256,31 @@
<dependency> <dependency>
<groupId>net.kyori</groupId> <groupId>net.kyori</groupId>
<artifactId>adventure-text-serializer-gson</artifactId> <artifactId>adventure-text-serializer-gson</artifactId>
<version>4.13.0</version> <version>4.14.0</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.kyori</groupId> <groupId>net.kyori</groupId>
<artifactId>adventure-text-serializer-legacy</artifactId> <artifactId>adventure-text-serializer-legacy</artifactId>
<version>4.13.0</version> <version>4.14.0</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.kyori</groupId> <groupId>net.kyori</groupId>
<artifactId>adventure-text-serializer-plain</artifactId> <artifactId>adventure-text-serializer-plain</artifactId>
<version>4.13.0</version> <version>4.14.0</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.kyori</groupId> <groupId>net.kyori</groupId>
<artifactId>adventure-api</artifactId> <artifactId>adventure-api</artifactId>
<version>4.13.0</version> <version>4.14.0</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.kyori</groupId> <groupId>net.kyori</groupId>
<artifactId>adventure-nbt</artifactId> <artifactId>adventure-nbt</artifactId>
<version>4.13.0</version> <version>4.14.0</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>

View File

@ -139,8 +139,8 @@ public final class Limbo {
//=========================== //===========================
public final String SERVER_IMPLEMENTATION_VERSION = "1.19.4"; public final String SERVER_IMPLEMENTATION_VERSION = "1.20";
public final int SERVER_IMPLEMENTATION_PROTOCOL = 762; public final int SERVER_IMPLEMENTATION_PROTOCOL = 763;
public final String LIMBO_IMPLEMENTATION_VERSION; public final String LIMBO_IMPLEMENTATION_VERSION;
private final AtomicBoolean isRunning; private final AtomicBoolean isRunning;

View File

@ -572,11 +572,11 @@ public class ClientConnection extends Thread {
PlayerSpawnEvent spawnEvent = Limbo.getInstance().getEventsManager().callEvent(new PlayerSpawnEvent(player, worldSpawn)); PlayerSpawnEvent spawnEvent = Limbo.getInstance().getEventsManager().callEvent(new PlayerSpawnEvent(player, worldSpawn));
worldSpawn = spawnEvent.getSpawnLocation(); worldSpawn = spawnEvent.getSpawnLocation();
World world = worldSpawn.getWorld(); World world = worldSpawn.getWorld();
PacketPlayOutLogin join = new PacketPlayOutLogin(player.getEntityId(), false, properties.getDefaultGamemode(), Limbo.getInstance().getWorlds(), Limbo.getInstance().getDimensionRegistry().getCodec(), world, 0, (byte) properties.getMaxPlayers(), 8, 8, properties.isReducedDebugInfo(), true, false, true); PacketPlayOutLogin join = new PacketPlayOutLogin(player.getEntityId(), false, properties.getDefaultGamemode(), Limbo.getInstance().getWorlds(), Limbo.getInstance().getDimensionRegistry().getCodec(), world, 0, (byte) properties.getMaxPlayers(), 8, 8, properties.isReducedDebugInfo(), true, false, true, 0);
sendPacket(join); sendPacket(join);
Limbo.getInstance().getUnsafe().a(player, properties.getDefaultGamemode()); Limbo.getInstance().getUnsafe().a(player, properties.getDefaultGamemode());
ByteArrayOutputStream brandOut = new ByteArrayOutputStream(); ByteArrayOutputStream brandOut = new ByteArrayOutputStream();
DataTypeIO.writeString(new DataOutputStream(brandOut), properties.getServerModName(), StandardCharsets.UTF_8); DataTypeIO.writeString(new DataOutputStream(brandOut), properties.getServerModName(), StandardCharsets.UTF_8);
sendPluginMessage(BRAND_ANNOUNCE_CHANNEL, brandOut.toByteArray()); sendPluginMessage(BRAND_ANNOUNCE_CHANNEL, brandOut.toByteArray());
@ -598,9 +598,9 @@ public class ClientConnection extends Thread {
String str = (properties.isLogPlayerIPAddresses() ? inetAddress.getHostName() : "<ip address withheld>") + ":" + clientSocket.getPort() + "|" + player.getName() + "(" + player.getUniqueId() + ")"; String str = (properties.isLogPlayerIPAddresses() ? inetAddress.getHostName() : "<ip address withheld>") + ":" + clientSocket.getPort() + "|" + player.getName() + "(" + player.getUniqueId() + ")";
Limbo.getInstance().getConsole().sendMessage("[/" + str + "] <-> Player had connected to the Limbo server!"); Limbo.getInstance().getConsole().sendMessage("[/" + str + "] <-> Player had connected to the Limbo server!");
player.playerInteractManager.update(); player.playerInteractManager.update();
PacketPlayOutDeclareCommands declare = DeclareCommands.getDeclareCommandsPacket(player); PacketPlayOutDeclareCommands declare = DeclareCommands.getDeclareCommandsPacket(player);
if (declare != null) { if (declare != null) {
sendPacket(declare); sendPacket(declare);

View File

@ -44,7 +44,6 @@ public class ClientboundLevelChunkWithLightPacket extends PacketOut {
private int chunkZ; private int chunkZ;
private Chunk chunk; private Chunk chunk;
private Environment environment; private Environment environment;
private boolean trustEdges;
private long[] skyLightBitMasks; private long[] skyLightBitMasks;
private long[] blockLightBitMasks; private long[] blockLightBitMasks;
private long[] skyLightBitMasksEmpty; private long[] skyLightBitMasksEmpty;
@ -52,12 +51,11 @@ public class ClientboundLevelChunkWithLightPacket extends PacketOut {
private List<Byte[]> skylightArrays; private List<Byte[]> skylightArrays;
private List<Byte[]> blocklightArrays; private List<Byte[]> blocklightArrays;
public ClientboundLevelChunkWithLightPacket(int chunkX, int chunkZ, Chunk chunk, Environment environment, boolean trustEdges, List<Byte[]> skylightArrays, List<Byte[]> blocklightArrays) { public ClientboundLevelChunkWithLightPacket(int chunkX, int chunkZ, Chunk chunk, Environment environment, List<Byte[]> skylightArrays, List<Byte[]> blocklightArrays) {
this.chunkX = chunkX; this.chunkX = chunkX;
this.chunkZ = chunkZ; this.chunkZ = chunkZ;
this.chunk = chunk; this.chunk = chunk;
this.environment = environment; this.environment = environment;
this.trustEdges = trustEdges;
this.skylightArrays = skylightArrays; this.skylightArrays = skylightArrays;
this.blocklightArrays = blocklightArrays; this.blocklightArrays = blocklightArrays;
@ -96,10 +94,6 @@ public class ClientboundLevelChunkWithLightPacket extends PacketOut {
return environment; return environment;
} }
public boolean isTrustEdges() {
return trustEdges;
}
public long[] getSkyLightBitMasks() { public long[] getSkyLightBitMasks() {
return skyLightBitMasks; return skyLightBitMasks;
} }
@ -258,7 +252,6 @@ public class ClientboundLevelChunkWithLightPacket extends PacketOut {
DataTypeIO.writeCompoundTag(output, each); DataTypeIO.writeCompoundTag(output, each);
} }
output.writeBoolean(trustEdges);
DataTypeIO.writeVarInt(output, skyLightBitMasks.length); DataTypeIO.writeVarInt(output, skyLightBitMasks.length);
for (long l : skyLightBitMasks) { for (long l : skyLightBitMasks) {
output.writeLong(l); output.writeLong(l);

View File

@ -49,8 +49,9 @@ public class PacketPlayOutLogin extends PacketOut {
private boolean enableRespawnScreen; private boolean enableRespawnScreen;
private boolean isDebug; private boolean isDebug;
private boolean isFlat; private boolean isFlat;
private int portalCooldown;
public PacketPlayOutLogin(int entityId, boolean isHardcore, GameMode gamemode, List<World> worlds, CompoundTag dimensionCodec, World world, long hashedSeed, byte maxPlayers, int viewDistance, int simulationDistance, boolean reducedDebugInfo, boolean enableRespawnScreen, boolean isDebug, boolean isFlat) { public PacketPlayOutLogin(int entityId, boolean isHardcore, GameMode gamemode, List<World> worlds, CompoundTag dimensionCodec, World world, long hashedSeed, byte maxPlayers, int viewDistance, int simulationDistance, boolean reducedDebugInfo, boolean enableRespawnScreen, boolean isDebug, boolean isFlat, int portalCooldown) {
this.entityId = entityId; this.entityId = entityId;
this.isHardcore = isHardcore; this.isHardcore = isHardcore;
this.gamemode = gamemode; this.gamemode = gamemode;
@ -66,6 +67,7 @@ public class PacketPlayOutLogin extends PacketOut {
this.enableRespawnScreen = enableRespawnScreen; this.enableRespawnScreen = enableRespawnScreen;
this.isDebug = isDebug; this.isDebug = isDebug;
this.isFlat = isFlat; this.isFlat = isFlat;
this.portalCooldown = portalCooldown;
} }
public int getEntityId() { public int getEntityId() {
@ -154,6 +156,7 @@ public class PacketPlayOutLogin extends PacketOut {
output.writeBoolean(isDebug); output.writeBoolean(isDebug);
output.writeBoolean(isFlat); output.writeBoolean(isFlat);
output.writeBoolean(false); output.writeBoolean(false);
DataTypeIO.writeVarInt(output, portalCooldown);
return buffer.toByteArray(); return buffer.toByteArray();
} }

View File

@ -33,6 +33,7 @@ import net.querz.mca.Chunk;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
@ -123,7 +124,7 @@ public class PlayerInteractManager {
if (!currentViewing.containsKey(chunkPos)) { if (!currentViewing.containsKey(chunkPos)) {
Chunk chunk = chunkPos.getWorld().getChunkAt(chunkPos.getChunkX(), chunkPos.getChunkZ()); Chunk chunk = chunkPos.getWorld().getChunkAt(chunkPos.getChunkX(), chunkPos.getChunkZ());
if (chunk == null) { if (chunk == null) {
ClientboundLevelChunkWithLightPacket chunkdata = new ClientboundLevelChunkWithLightPacket(chunkPos.getChunkX(), chunkPos.getChunkZ(), entry.getValue(), world.getEnvironment(), true, new ArrayList<>(), new ArrayList<>()); ClientboundLevelChunkWithLightPacket chunkdata = new ClientboundLevelChunkWithLightPacket(chunkPos.getChunkX(), chunkPos.getChunkZ(), entry.getValue(), world.getEnvironment(), Collections.emptyList(), Collections.emptyList());
player.clientConnection.sendPacket(chunkdata); player.clientConnection.sendPacket(chunkdata);
} else { } else {
List<Byte[]> blockChunk = world.getLightEngineBlock().getBlockLightBitMask(chunkPos.getChunkX(), chunkPos.getChunkZ()); List<Byte[]> blockChunk = world.getLightEngineBlock().getBlockLightBitMask(chunkPos.getChunkX(), chunkPos.getChunkZ());
@ -137,7 +138,7 @@ public class PlayerInteractManager {
if (skyChunk == null) { if (skyChunk == null) {
skyChunk = new ArrayList<>(); skyChunk = new ArrayList<>();
} }
ClientboundLevelChunkWithLightPacket chunkdata = new ClientboundLevelChunkWithLightPacket(chunkPos.getChunkX(), chunkPos.getChunkZ(), chunk, world.getEnvironment(), true, skyChunk, blockChunk); ClientboundLevelChunkWithLightPacket chunkdata = new ClientboundLevelChunkWithLightPacket(chunkPos.getChunkX(), chunkPos.getChunkZ(), chunk, world.getEnvironment(), skyChunk, blockChunk);
player.clientConnection.sendPacket(chunkdata); player.clientConnection.sendPacket(chunkdata);
} }
} }

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff