Update to 1.18.2 (#1521)

This commit is contained in:
Pasqual Koschmieder 2022-02-28 19:36:20 +01:00 committed by GitHub
parent 55f7b67f9d
commit 9487c42985
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 27 additions and 25 deletions

View File

@ -19,7 +19,7 @@
<junit.version>5.8.2</junit.version>
<mockito.version>4.3.1</mockito.version>
<netty.version>4.1.74.Final</netty.version>
<spigot.version>1.18.1-R0.1-SNAPSHOT</spigot.version>
<spigot.version>1.18.2-R0.1-SNAPSHOT</spigot.version>
</properties>
<build>

View File

@ -38,12 +38,12 @@ public class ProtocolLibrary {
/**
* The maximum version ProtocolLib has been tested with.
*/
public static final String MAXIMUM_MINECRAFT_VERSION = "1.18";
public static final String MAXIMUM_MINECRAFT_VERSION = "1.18.2";
/**
* The date (with ISO 8601 or YYYY-MM-DD) when the most recent version (1.18) was released.
* The date (with ISO 8601 or YYYY-MM-DD) when the most recent version (1.18.2) was released.
*/
public static final String MINECRAFT_LAST_RELEASE_DATE = "2021-11-30";
public static final String MINECRAFT_LAST_RELEASE_DATE = "2022-02-28";
/**
* Plugins that are currently incompatible with ProtocolLib.

View File

@ -21,7 +21,7 @@ package com.comphenix.protocol.utility;
*/
public final class Constants {
public static final String PACKAGE_VERSION = "v1_18_R1";
public static final String PACKAGE_VERSION = "v1_18_R2";
public static final String NMS = "net.minecraft";
public static final String OBC = "org.bukkit.craftbukkit." + PACKAGE_VERSION;
public static final MinecraftVersion CURRENT_VERSION = MinecraftVersion.CAVES_CLIFFS_2;

View File

@ -79,6 +79,8 @@ public class MinecraftProtocolVersion {
map.put(new MinecraftVersion(1, 18, 0), 757);
map.put(new MinecraftVersion(1, 18, 1), 757);
map.put(new MinecraftVersion(1, 18, 2), 758);
return map;
}

View File

@ -15,10 +15,10 @@ import org.apache.logging.log4j.LogManager;
import org.bukkit.Bukkit;
import org.bukkit.Server;
import org.bukkit.World;
import org.bukkit.craftbukkit.v1_18_R1.CraftServer;
import org.bukkit.craftbukkit.v1_18_R1.CraftWorld;
import org.bukkit.craftbukkit.v1_18_R1.inventory.CraftItemFactory;
import org.bukkit.craftbukkit.v1_18_R1.util.Versioning;
import org.bukkit.craftbukkit.v1_18_R2.CraftServer;
import org.bukkit.craftbukkit.v1_18_R2.CraftWorld;
import org.bukkit.craftbukkit.v1_18_R2.inventory.CraftItemFactory;
import org.bukkit.craftbukkit.v1_18_R2.util.Versioning;
import org.spigotmc.SpigotWorldConfig;
/**

View File

@ -287,7 +287,7 @@ public class PacketTypeTest {
Map<EnumProtocolDirection, Object> map = (Map<EnumProtocolDirection, Object>) field.get(protocol);
for (Entry<EnumProtocolDirection, Object> entry : map.entrySet()) {
Field mapField = entry.getValue().getClass().getDeclaredField("a");
Field mapField = entry.getValue().getClass().getDeclaredField("b");
mapField.setAccessible(true);
Map<Class<?>, Integer> reverseMap = (Map<Class<?>, Integer>) mapField.get(entry.getValue());

View File

@ -429,7 +429,7 @@ public class PacketContainerTest {
// are inner classes (which is ultimately pointless because AttributeSnapshots don't access any
// members of the packet itself)
PacketPlayOutUpdateAttributes packet = (PacketPlayOutUpdateAttributes) attribute.getHandle();
AttributeBase base = IRegistry.am.a(MinecraftKey.a("generic.max_health"));
AttributeBase base = IRegistry.aj.a(MinecraftKey.a("generic.max_health"));
AttributeSnapshot snapshot = new AttributeSnapshot(base, 20.0D, modifiers);
attribute.getSpecificModifier(List.class).write(0, Lists.newArrayList(snapshot));
@ -489,10 +489,10 @@ public class PacketContainerTest {
PacketType.Play.Server.ENTITY_EFFECT, new Class<?>[]{int.class, MobEffect.class});
PacketContainer packet = creator.createPacket(entityId, mobEffect);
assertEquals(entityId, (int) packet.getIntegers().read(0));
assertEquals(effect.getType().getId(), (byte) packet.getBytes().read(0));
assertEquals(effect.getAmplifier(), (byte) packet.getBytes().read(1));
assertEquals(effect.getDuration(), (int) packet.getIntegers().read(1));
assertEquals(entityId, packet.getIntegers().read(0));
assertEquals(effect.getType().getId(), packet.getIntegers().read(1));
assertEquals(effect.getAmplifier(), (byte) packet.getBytes().read(0));
assertEquals(effect.getDuration(), packet.getIntegers().read(2));
int e = 0;
if (effect.isAmbient()) {
@ -505,7 +505,7 @@ public class PacketContainerTest {
e |= 4;
}
assertEquals(e, (byte) packet.getBytes().read(2));
assertEquals(e, (byte) packet.getBytes().read(1));
}
@Test

View File

@ -16,8 +16,8 @@ import net.minecraft.server.level.PlayerChunkMap;
import net.minecraft.server.level.PlayerChunkMap.EntityTracker;
import net.minecraft.server.level.WorldServer;
import net.minecraft.world.entity.Entity;
import org.bukkit.craftbukkit.v1_18_R1.CraftWorld;
import org.bukkit.craftbukkit.v1_18_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_18_R2.CraftWorld;
import org.bukkit.craftbukkit.v1_18_R2.entity.CraftEntity;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;

View File

@ -22,7 +22,7 @@ import net.minecraft.world.level.ChunkCoordIntPair;
import net.minecraft.world.level.block.state.IBlockData;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.craftbukkit.v1_18_R1.inventory.CraftItemStack;
import org.bukkit.craftbukkit.v1_18_R2.inventory.CraftItemStack;
import org.bukkit.entity.Entity;
import org.bukkit.inventory.ItemStack;
import org.junit.jupiter.api.AfterAll;

View File

@ -91,7 +91,7 @@ public class WrappedAttributeTest {
modifiers.add((AttributeModifier) wrapper.getHandle());
}
AttributeBase base = IRegistry.am.a(MinecraftKey.a(attribute.getAttributeKey()));
AttributeBase base = IRegistry.aj.a(MinecraftKey.a(attribute.getAttributeKey()));
return new AttributeSnapshot(base, attribute.getBaseValue(), modifiers);
}

View File

@ -21,9 +21,9 @@ import net.minecraft.world.level.block.state.IBlockData;
import org.bukkit.Material;
import org.bukkit.block.BlockFace;
import org.bukkit.block.data.type.GlassPane;
import org.bukkit.craftbukkit.v1_18_R1.block.data.CraftBlockData;
import org.bukkit.craftbukkit.v1_18_R1.block.impl.CraftStainedGlassPane;
import org.bukkit.craftbukkit.v1_18_R1.util.CraftMagicNumbers;
import org.bukkit.craftbukkit.v1_18_R2.block.data.CraftBlockData;
import org.bukkit.craftbukkit.v1_18_R2.block.impl.CraftStainedGlassPane;
import org.bukkit.craftbukkit.v1_18_R2.util.CraftMagicNumbers;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;

View File

@ -26,8 +26,8 @@ import com.comphenix.protocol.wrappers.WrappedDataWatcher.Serializer;
import com.comphenix.protocol.wrappers.WrappedDataWatcher.WrappedDataWatcherObject;
import java.util.UUID;
import net.minecraft.world.entity.projectile.EntityEgg;
import org.bukkit.craftbukkit.v1_18_R1.entity.CraftEgg;
import org.bukkit.craftbukkit.v1_18_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_18_R2.entity.CraftEgg;
import org.bukkit.craftbukkit.v1_18_R2.entity.CraftEntity;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;