From d876580ddf5cf8d0393997f8afdfc8a534b9f6dc Mon Sep 17 00:00:00 2001 From: 0x277F <0x277F@gmail.com> Date: Thu, 12 May 2016 16:30:49 -0600 Subject: [PATCH] Update to 1.9.4 --- .gitignore | 4 +++ modules/API/pom.xml | 4 +-- .../com/comphenix/protocol/PacketType.java | 7 +++++- .../comphenix/protocol/utility/Constants.java | 2 +- modules/ProtocolLib/pom.xml | 4 +-- .../protocol/BukkitInitialization.java | 8 +++--- .../protocol/events/PacketContainerTest.java | 25 +++++++------------ .../utility/MinecraftReflectionTest.java | 24 +++++++++--------- .../utility/StreamSerializerTest.java | 2 +- .../wrappers/ChunkCoordIntPairTest.java | 8 +++--- .../protocol/wrappers/EnumWrappersTest.java | 12 ++++----- .../wrappers/WrappedAttributeTest.java | 6 ++--- .../wrappers/WrappedDataWatcherTest.java | 10 ++++---- .../protocol/wrappers/nbt/NbtFactoryTest.java | 4 +-- 14 files changed, 61 insertions(+), 59 deletions(-) diff --git a/.gitignore b/.gitignore index 5e6d0edf..fdc3677e 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,10 @@ .classpath .settings/ bin/ +.idea/ +.iml +.ipr +.iws *.pydevproject .metadata diff --git a/modules/API/pom.xml b/modules/API/pom.xml index c4d05d51..2d1b55bf 100644 --- a/modules/API/pom.xml +++ b/modules/API/pom.xml @@ -196,13 +196,13 @@ org.spigotmc spigot-api - 1.9.2-R0.1-SNAPSHOT + 1.9.4-R0.1-SNAPSHOT provided org.spigotmc spigot - 1.9.2-R0.1-SNAPSHOT + 1.9.4-R0.1-SNAPSHOT provided diff --git a/modules/API/src/main/java/com/comphenix/protocol/PacketType.java b/modules/API/src/main/java/com/comphenix/protocol/PacketType.java index 499f4629..2e4cccc7 100644 --- a/modules/API/src/main/java/com/comphenix/protocol/PacketType.java +++ b/modules/API/src/main/java/com/comphenix/protocol/PacketType.java @@ -175,7 +175,6 @@ public class PacketType implements Serializable, Comparable { public static final PacketType SPAWN_POSITION = new PacketType(PROTOCOL, SENDER, 0x43, 0x05, "SpawnPosition"); public static final PacketType UPDATE_TIME = new PacketType(PROTOCOL, SENDER, 0x44, 0x03, "UpdateTime"); public static final PacketType TITLE = new PacketType(PROTOCOL, SENDER, 0x45, 0x45, "Title"); - public static final PacketType UPDATE_SIGN = new PacketType(PROTOCOL, SENDER, 0x46, 0x33, "UpdateSign"); public static final PacketType NAMED_SOUND_EFFECT = new PacketType(PROTOCOL, SENDER, 0x47, 0x29, "NamedSoundEffect"); public static final PacketType PLAYER_LIST_HEADER_FOOTER = new PacketType(PROTOCOL, SENDER, 0x48, 0x47, "PlayerListHeaderFooter"); public static final PacketType COLLECT = new PacketType(PROTOCOL, SENDER, 0x49, 0x0D, "Collect"); @@ -201,6 +200,12 @@ public class PacketType implements Serializable, Comparable { @Deprecated public static final PacketType STATISTICS = STATISTIC; + /** + * @deprecated Replaced by {@link TILE_ENTITY_DATA} + */ + @Deprecated + public static final PacketType UPDATE_SIGN = TILE_ENTITY_DATA; + // The instance must private final static Server INSTANCE = new Server(); diff --git a/modules/API/src/main/java/com/comphenix/protocol/utility/Constants.java b/modules/API/src/main/java/com/comphenix/protocol/utility/Constants.java index f6e40b5f..38d1e9d7 100644 --- a/modules/API/src/main/java/com/comphenix/protocol/utility/Constants.java +++ b/modules/API/src/main/java/com/comphenix/protocol/utility/Constants.java @@ -21,7 +21,7 @@ package com.comphenix.protocol.utility; */ public final class Constants { - public static final String PACKAGE_VERSION = "v1_9_R1"; + public static final String PACKAGE_VERSION = "v1_9_R2"; public static final String NMS = "net.minecraft.server." + PACKAGE_VERSION; public static final String OBC = "org.bukkit.craftbukkit." + PACKAGE_VERSION; } \ No newline at end of file diff --git a/modules/ProtocolLib/pom.xml b/modules/ProtocolLib/pom.xml index e0d21ede..93e81e76 100644 --- a/modules/ProtocolLib/pom.xml +++ b/modules/ProtocolLib/pom.xml @@ -234,13 +234,13 @@ org.spigotmc spigot-api - 1.9.2-R0.1-SNAPSHOT + 1.9.4-R0.1-SNAPSHOT provided org.spigotmc spigot - 1.9.2-R0.1-SNAPSHOT + 1.9.4-R0.1-SNAPSHOT provided diff --git a/modules/ProtocolLib/src/test/java/com/comphenix/protocol/BukkitInitialization.java b/modules/ProtocolLib/src/test/java/com/comphenix/protocol/BukkitInitialization.java index fb775fd6..e69d7a1b 100644 --- a/modules/ProtocolLib/src/test/java/com/comphenix/protocol/BukkitInitialization.java +++ b/modules/ProtocolLib/src/test/java/com/comphenix/protocol/BukkitInitialization.java @@ -5,13 +5,13 @@ import static org.mockito.Mockito.when; import java.util.logging.Logger; -import net.minecraft.server.v1_9_R1.DispenserRegistry; +import net.minecraft.server.v1_9_R2.DispenserRegistry; import org.bukkit.Bukkit; import org.bukkit.Server; -import org.bukkit.craftbukkit.v1_9_R1.CraftServer; -import org.bukkit.craftbukkit.v1_9_R1.inventory.CraftItemFactory; -import org.bukkit.craftbukkit.v1_9_R1.util.Versioning; +import org.bukkit.craftbukkit.v1_9_R2.CraftServer; +import org.bukkit.craftbukkit.v1_9_R2.inventory.CraftItemFactory; +import org.bukkit.craftbukkit.v1_9_R2.util.Versioning; import com.comphenix.protocol.utility.Constants; import com.comphenix.protocol.utility.MinecraftReflection; diff --git a/modules/ProtocolLib/src/test/java/com/comphenix/protocol/events/PacketContainerTest.java b/modules/ProtocolLib/src/test/java/com/comphenix/protocol/events/PacketContainerTest.java index ec691395..abc964be 100644 --- a/modules/ProtocolLib/src/test/java/com/comphenix/protocol/events/PacketContainerTest.java +++ b/modules/ProtocolLib/src/test/java/com/comphenix/protocol/events/PacketContainerTest.java @@ -28,15 +28,15 @@ import java.util.List; import java.util.Objects; import java.util.UUID; -import net.minecraft.server.v1_9_R1.AttributeModifier; -import net.minecraft.server.v1_9_R1.DataWatcher; -import net.minecraft.server.v1_9_R1.Entity; -import net.minecraft.server.v1_9_R1.EntityLightning; -import net.minecraft.server.v1_9_R1.MobEffect; -import net.minecraft.server.v1_9_R1.MobEffectList; -import net.minecraft.server.v1_9_R1.PacketPlayOutBoss; -import net.minecraft.server.v1_9_R1.PacketPlayOutUpdateAttributes; -import net.minecraft.server.v1_9_R1.PacketPlayOutUpdateAttributes.AttributeSnapshot; +import net.minecraft.server.v1_9_R2.AttributeModifier; +import net.minecraft.server.v1_9_R2.DataWatcher; +import net.minecraft.server.v1_9_R2.Entity; +import net.minecraft.server.v1_9_R2.EntityLightning; +import net.minecraft.server.v1_9_R2.MobEffect; +import net.minecraft.server.v1_9_R2.MobEffectList; +import net.minecraft.server.v1_9_R2.PacketPlayOutBoss; +import net.minecraft.server.v1_9_R2.PacketPlayOutUpdateAttributes; +import net.minecraft.server.v1_9_R2.PacketPlayOutUpdateAttributes.AttributeSnapshot; import org.apache.commons.lang.SerializationUtils; import org.apache.commons.lang3.builder.EqualsBuilder; @@ -180,13 +180,6 @@ public class PacketContainerTest { testObjectArray(tabComplete.getStringArrays(), 0, new String[0], new String[] { "hello", "world" }); } - @Test - public void testGetChatComponentArrays() { - PacketContainer signChange = new PacketContainer(PacketType.Play.Server.UPDATE_SIGN); - testObjectArray(signChange.getChatComponentArrays(), 0, new WrappedChatComponent[0], - WrappedChatComponent.fromChatMessage("hello world")); - } - @Test public void testGetIntegerArrays() { // Contains a byte array we will test diff --git a/modules/ProtocolLib/src/test/java/com/comphenix/protocol/utility/MinecraftReflectionTest.java b/modules/ProtocolLib/src/test/java/com/comphenix/protocol/utility/MinecraftReflectionTest.java index bb35f0d0..83f781ec 100644 --- a/modules/ProtocolLib/src/test/java/com/comphenix/protocol/utility/MinecraftReflectionTest.java +++ b/modules/ProtocolLib/src/test/java/com/comphenix/protocol/utility/MinecraftReflectionTest.java @@ -4,18 +4,18 @@ import static org.junit.Assert.assertEquals; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; -import net.minecraft.server.v1_9_R1.ChatComponentText; -import net.minecraft.server.v1_9_R1.ChunkCoordIntPair; -import net.minecraft.server.v1_9_R1.DataWatcher; -import net.minecraft.server.v1_9_R1.IBlockData; -import net.minecraft.server.v1_9_R1.IChatBaseComponent; -import net.minecraft.server.v1_9_R1.IChatBaseComponent.ChatSerializer; -import net.minecraft.server.v1_9_R1.NBTCompressedStreamTools; -import net.minecraft.server.v1_9_R1.PacketPlayOutUpdateAttributes.AttributeSnapshot; -import net.minecraft.server.v1_9_R1.PlayerConnection; -import net.minecraft.server.v1_9_R1.ServerPing; -import net.minecraft.server.v1_9_R1.ServerPing.ServerData; -import net.minecraft.server.v1_9_R1.ServerPing.ServerPingPlayerSample; +import net.minecraft.server.v1_9_R2.ChatComponentText; +import net.minecraft.server.v1_9_R2.ChunkCoordIntPair; +import net.minecraft.server.v1_9_R2.DataWatcher; +import net.minecraft.server.v1_9_R2.IBlockData; +import net.minecraft.server.v1_9_R2.IChatBaseComponent; +import net.minecraft.server.v1_9_R2.IChatBaseComponent.ChatSerializer; +import net.minecraft.server.v1_9_R2.NBTCompressedStreamTools; +import net.minecraft.server.v1_9_R2.PacketPlayOutUpdateAttributes.AttributeSnapshot; +import net.minecraft.server.v1_9_R2.PlayerConnection; +import net.minecraft.server.v1_9_R2.ServerPing; +import net.minecraft.server.v1_9_R2.ServerPing.ServerData; +import net.minecraft.server.v1_9_R2.ServerPing.ServerPingPlayerSample; import org.bukkit.Material; import org.bukkit.block.Block; diff --git a/modules/ProtocolLib/src/test/java/com/comphenix/protocol/utility/StreamSerializerTest.java b/modules/ProtocolLib/src/test/java/com/comphenix/protocol/utility/StreamSerializerTest.java index 4b60d64b..0addfde6 100644 --- a/modules/ProtocolLib/src/test/java/com/comphenix/protocol/utility/StreamSerializerTest.java +++ b/modules/ProtocolLib/src/test/java/com/comphenix/protocol/utility/StreamSerializerTest.java @@ -8,7 +8,7 @@ import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; -import net.minecraft.server.v1_9_R1.IntHashMap; +import net.minecraft.server.v1_9_R2.IntHashMap; import org.bukkit.ChatColor; import org.bukkit.DyeColor; diff --git a/modules/ProtocolLib/src/test/java/com/comphenix/protocol/wrappers/ChunkCoordIntPairTest.java b/modules/ProtocolLib/src/test/java/com/comphenix/protocol/wrappers/ChunkCoordIntPairTest.java index 5aac6e79..c9d759bb 100644 --- a/modules/ProtocolLib/src/test/java/com/comphenix/protocol/wrappers/ChunkCoordIntPairTest.java +++ b/modules/ProtocolLib/src/test/java/com/comphenix/protocol/wrappers/ChunkCoordIntPairTest.java @@ -16,15 +16,15 @@ public class ChunkCoordIntPairTest { @Test public void test() { - net.minecraft.server.v1_9_R1.ChunkCoordIntPair pair = new net.minecraft.server.v1_9_R1.ChunkCoordIntPair(1, 2); + net.minecraft.server.v1_9_R2.ChunkCoordIntPair pair = new net.minecraft.server.v1_9_R2.ChunkCoordIntPair(1, 2); ChunkCoordIntPair specific = ChunkCoordIntPair.getConverter().getSpecific(pair); assertEquals(1, specific.getChunkX()); assertEquals(2, specific.getChunkZ()); - net.minecraft.server.v1_9_R1.ChunkCoordIntPair roundtrip = - (net.minecraft.server.v1_9_R1.ChunkCoordIntPair) ChunkCoordIntPair.getConverter(). - getGeneric(net.minecraft.server.v1_9_R1.ChunkCoordIntPair.class, specific); + net.minecraft.server.v1_9_R2.ChunkCoordIntPair roundtrip = + (net.minecraft.server.v1_9_R2.ChunkCoordIntPair) ChunkCoordIntPair.getConverter(). + getGeneric(net.minecraft.server.v1_9_R2.ChunkCoordIntPair.class, specific); assertEquals(1, roundtrip.x); assertEquals(2, roundtrip.z); diff --git a/modules/ProtocolLib/src/test/java/com/comphenix/protocol/wrappers/EnumWrappersTest.java b/modules/ProtocolLib/src/test/java/com/comphenix/protocol/wrappers/EnumWrappersTest.java index 3097223d..ea6f5fac 100644 --- a/modules/ProtocolLib/src/test/java/com/comphenix/protocol/wrappers/EnumWrappersTest.java +++ b/modules/ProtocolLib/src/test/java/com/comphenix/protocol/wrappers/EnumWrappersTest.java @@ -1,12 +1,12 @@ package com.comphenix.protocol.wrappers; import static org.junit.Assert.assertEquals; -import net.minecraft.server.v1_9_R1.EntityHuman.EnumChatVisibility; -import net.minecraft.server.v1_9_R1.EnumDifficulty; -import net.minecraft.server.v1_9_R1.EnumProtocol; -import net.minecraft.server.v1_9_R1.PacketPlayInClientCommand.EnumClientCommand; -import net.minecraft.server.v1_9_R1.PacketPlayInUseEntity.EnumEntityUseAction; -import net.minecraft.server.v1_9_R1.WorldSettings.EnumGamemode; +import net.minecraft.server.v1_9_R2.EntityHuman.EnumChatVisibility; +import net.minecraft.server.v1_9_R2.EnumDifficulty; +import net.minecraft.server.v1_9_R2.EnumProtocol; +import net.minecraft.server.v1_9_R2.PacketPlayInClientCommand.EnumClientCommand; +import net.minecraft.server.v1_9_R2.PacketPlayInUseEntity.EnumEntityUseAction; +import net.minecraft.server.v1_9_R2.WorldSettings.EnumGamemode; import org.junit.BeforeClass; import org.junit.Test; diff --git a/modules/ProtocolLib/src/test/java/com/comphenix/protocol/wrappers/WrappedAttributeTest.java b/modules/ProtocolLib/src/test/java/com/comphenix/protocol/wrappers/WrappedAttributeTest.java index 3a11e149..a193ce75 100644 --- a/modules/ProtocolLib/src/test/java/com/comphenix/protocol/wrappers/WrappedAttributeTest.java +++ b/modules/ProtocolLib/src/test/java/com/comphenix/protocol/wrappers/WrappedAttributeTest.java @@ -6,9 +6,9 @@ import static org.junit.Assert.assertTrue; import java.util.List; -import net.minecraft.server.v1_9_R1.AttributeModifier; -import net.minecraft.server.v1_9_R1.PacketPlayOutUpdateAttributes; -import net.minecraft.server.v1_9_R1.PacketPlayOutUpdateAttributes.AttributeSnapshot; +import net.minecraft.server.v1_9_R2.AttributeModifier; +import net.minecraft.server.v1_9_R2.PacketPlayOutUpdateAttributes; +import net.minecraft.server.v1_9_R2.PacketPlayOutUpdateAttributes.AttributeSnapshot; import org.junit.Before; import org.junit.BeforeClass; diff --git a/modules/ProtocolLib/src/test/java/com/comphenix/protocol/wrappers/WrappedDataWatcherTest.java b/modules/ProtocolLib/src/test/java/com/comphenix/protocol/wrappers/WrappedDataWatcherTest.java index 47bbd6fc..cf9ac97d 100644 --- a/modules/ProtocolLib/src/test/java/com/comphenix/protocol/wrappers/WrappedDataWatcherTest.java +++ b/modules/ProtocolLib/src/test/java/com/comphenix/protocol/wrappers/WrappedDataWatcherTest.java @@ -24,10 +24,10 @@ import static org.junit.Assert.assertTrue; import java.util.UUID; -import net.minecraft.server.v1_9_R1.EntityLightning; -import net.minecraft.server.v1_9_R1.ItemStack; +import net.minecraft.server.v1_9_R2.EntityLightning; +import net.minecraft.server.v1_9_R2.ItemStack; -import org.bukkit.craftbukkit.v1_9_R1.entity.CraftLightningStrike; +import org.bukkit.craftbukkit.v1_9_R2.entity.CraftLightningStrike; import org.bukkit.entity.Entity; import org.junit.BeforeClass; import org.junit.Test; @@ -92,8 +92,8 @@ public class WrappedDataWatcherTest { @Test public void testSerializers() { - Serializer blockPos = Registry.get(net.minecraft.server.v1_9_R1.BlockPosition.class, false); - Serializer optionalBlockPos = Registry.get(net.minecraft.server.v1_9_R1.BlockPosition.class, true); + Serializer blockPos = Registry.get(net.minecraft.server.v1_9_R2.BlockPosition.class, false); + Serializer optionalBlockPos = Registry.get(net.minecraft.server.v1_9_R2.BlockPosition.class, true); assertNotSame(blockPos, optionalBlockPos); assertNull(Registry.get(ItemStack.class, false)); diff --git a/modules/ProtocolLib/src/test/java/com/comphenix/protocol/wrappers/nbt/NbtFactoryTest.java b/modules/ProtocolLib/src/test/java/com/comphenix/protocol/wrappers/nbt/NbtFactoryTest.java index 5067f4fb..a4ba8019 100644 --- a/modules/ProtocolLib/src/test/java/com/comphenix/protocol/wrappers/nbt/NbtFactoryTest.java +++ b/modules/ProtocolLib/src/test/java/com/comphenix/protocol/wrappers/nbt/NbtFactoryTest.java @@ -26,8 +26,8 @@ import java.io.DataInputStream; import java.io.DataOutput; import java.io.DataOutputStream; -import net.minecraft.server.v1_9_R1.ItemStack; -import net.minecraft.server.v1_9_R1.Items; +import net.minecraft.server.v1_9_R2.ItemStack; +import net.minecraft.server.v1_9_R2.Items; import org.junit.BeforeClass; import org.junit.Test;