diff --git a/.gitignore b/.gitignore index df02d1e5..5e6d0edf 100644 --- a/.gitignore +++ b/.gitignore @@ -161,11 +161,14 @@ pip-log.txt .coverage .tox -#Translations +# Translations *.mo -#Mr Developer +# Mr Developer .mr.developer.cfg # Mac crap -.DS_Store \ No newline at end of file +.DS_Store + +# Log4J files +logs/ \ No newline at end of file diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/utility/RemappedClassSource.java b/ProtocolLib/src/main/java/com/comphenix/protocol/utility/RemappedClassSource.java index 9ea34480..1b5e92a9 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/utility/RemappedClassSource.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/utility/RemappedClassSource.java @@ -63,7 +63,7 @@ class RemappedClassSource extends ClassSource { } String version = server.getVersion(); - if (!server.getVersion().contains("MCPC-Plus") && !version.contains("Cauldron")) { + if (!version.contains("MCPC") && !version.contains("Cauldron")) { throw new RemapperUnavaibleException(Reason.MCPC_NOT_PRESENT); } diff --git a/ProtocolLib/src/test/java/com/comphenix/protocol/BukkitInitialization.java b/ProtocolLib/src/test/java/com/comphenix/protocol/BukkitInitialization.java index 6afc4699..66ecddf9 100644 --- a/ProtocolLib/src/test/java/com/comphenix/protocol/BukkitInitialization.java +++ b/ProtocolLib/src/test/java/com/comphenix/protocol/BukkitInitialization.java @@ -6,6 +6,7 @@ import net.minecraft.server.v1_8_R3.DispenserRegistry; import org.bukkit.Bukkit; import org.bukkit.Server; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; import org.bukkit.inventory.ItemFactory; import org.bukkit.inventory.meta.ItemMeta; @@ -32,8 +33,6 @@ public class BukkitInitialization { // Denote that we're done initialized = true; - initializePackage(); - DispenserRegistry.c(); // Basically registers everything // Mock the server object @@ -41,20 +40,14 @@ public class BukkitInitialization { ItemMeta mockedMeta = mock(ItemMeta.class); ItemFactory mockedFactory = new ItemFactoryDelegate(mockedMeta); + when(mockedServer.getVersion()).thenReturn(CraftServer.class.getPackage().getImplementationVersion()); when(mockedServer.getItemFactory()).thenReturn(mockedFactory); when(mockedServer.isPrimaryThread()).thenReturn(true); - // when(mockedFactory.getItemMeta(any(Material.class))).thenReturn(mockedMeta); // Inject this fake server FieldUtils.writeStaticField(Bukkit.class, "server", mockedServer, true); - // TODO Figure this out - /* try { - FieldUtils.writeStaticFinalField(CraftItemFactory.class, "instance", mockedFactory, true); - } catch (Exception ex) { - System.err.println("Failed to inject fake item factory: "); - ex.printStackTrace(); - } */ + initializePackage(); } }