mirror of
https://github.com/dmulloy2/ProtocolLib.git
synced 2024-12-29 04:27:38 +01:00
Ignore log files generated by Log4J, fix an error with MCPC
This commit is contained in:
parent
b32d0d5fcd
commit
47632e1fb1
9
.gitignore
vendored
9
.gitignore
vendored
@ -161,11 +161,14 @@ pip-log.txt
|
||||
.coverage
|
||||
.tox
|
||||
|
||||
#Translations
|
||||
# Translations
|
||||
*.mo
|
||||
|
||||
#Mr Developer
|
||||
# Mr Developer
|
||||
.mr.developer.cfg
|
||||
|
||||
# Mac crap
|
||||
.DS_Store
|
||||
.DS_Store
|
||||
|
||||
# Log4J files
|
||||
logs/
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user