1.18.2 update (#714)

This commit is contained in:
TheMode 2022-03-01 00:40:19 +01:00 committed by GitHub
parent e23de98587
commit 98e6b23fdd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 9 additions and 11 deletions

View File

@ -7,7 +7,7 @@ adventure = "4.9.3"
kotlin = "1.6.10"
hydrazine = "1.7.2"
dependencyGetter = "v1.0.1"
minestomData = "eadcb99e14"
minestomData = "cb6bac3fbc"
hephaistos = "2.4.2"
jetbrainsAnnotations = "23.0.0"

View File

@ -46,8 +46,8 @@ public final class MinecraftServer {
public final static Logger LOGGER = LoggerFactory.getLogger(MinecraftServer.class);
public static final String VERSION_NAME = "1.18.1";
public static final int PROTOCOL_VERSION = 757;
public static final String VERSION_NAME = "1.18.2";
public static final int PROTOCOL_VERSION = 758;
// Threads
public static final String THREAD_NAME_BENCHMARK = "Ms-Benchmark";

View File

@ -33,9 +33,7 @@ public record JoinGamePacket(int entityId, boolean isHardcore, GameMode gameMode
writer.writeByte((byte) -1);
}
//array of worlds
writer.writeVarInt(1);
writer.writeSizedString("minestom:world");
writer.writeVarIntList(worlds, BinaryWriter::writeSizedString);
writer.writeNBT("", dimensionCodec);
writer.writeNBT("", dimension);

View File

@ -11,13 +11,13 @@ import java.util.Objects;
public record RemoveEntityEffectPacket(int entityId, @NotNull PotionEffect potionEffect) implements ServerPacket {
public RemoveEntityEffectPacket(BinaryReader reader) {
this(reader.readVarInt(), Objects.requireNonNull(PotionEffect.fromId(reader.readByte())));
this(reader.readVarInt(), Objects.requireNonNull(PotionEffect.fromId(reader.readVarInt())));
}
@Override
public void write(@NotNull BinaryWriter writer) {
writer.writeVarInt(entityId);
writer.writeByte((byte) potionEffect.id());
writer.writeVarInt(potionEffect.id());
}
@Override

View File

@ -109,7 +109,7 @@ public record Potion(@NotNull PotionEffect effect, byte amplifier,
@Override
public void write(@NotNull BinaryWriter writer) {
writer.writeByte((byte) effect.id());
writer.writeVarInt(effect.id());
writer.writeByte(amplifier);
writer.writeVarInt(duration);
writer.writeByte(flags);

View File

@ -94,7 +94,7 @@ public class DimensionType {
public static DimensionType fromNBT(NBTCompound nbt) {
return DimensionType.builder(NamespaceID.from(nbt.getString("name")))
.ambientLight(nbt.getFloat("ambient_light"))
.infiniburn(NamespaceID.from(nbt.getString("infiniburn")))
.infiniburn(NamespaceID.from(nbt.getString("infiniburn").replaceFirst("#", "")))
.natural(nbt.getByte("natural") != 0)
.ceilingEnabled(nbt.getByte("has_ceiling") != 0)
.skylightEnabled(nbt.getByte("has_skylight") != 0)
@ -121,7 +121,7 @@ public class DimensionType {
public NBTCompound toNBT() {
return NBT.Compound(nbt -> {
nbt.setFloat("ambient_light", ambientLight);
nbt.setString("infiniburn", infiniburn.toString());
nbt.setString("infiniburn", "#" + infiniburn.toString());
nbt.setByte("natural", (byte) (natural ? 0x01 : 0x00));
nbt.setByte("has_ceiling", (byte) (ceilingEnabled ? 0x01 : 0x00));
nbt.setByte("has_skylight", (byte) (skylightEnabled ? 0x01 : 0x00));