Ignore log files generated by Log4J, fix an error with MCPC

This commit is contained in:
Dan Mulloy 2015-06-25 17:34:34 -04:00
parent b32d0d5fcd
commit 47632e1fb1
3 changed files with 10 additions and 14 deletions

9
.gitignore vendored
View File

@ -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/

View File

@ -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);
}

View File

@ -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();
}
}