Minor tweaks to previous commit.

This commit is contained in:
Olof Larsson 2016-08-20 11:02:57 +02:00
parent 30a4c20822
commit b0c74b0dd4
No known key found for this signature in database
GPG Key ID: BBEF14F97DA52474
2 changed files with 6 additions and 4 deletions

View File

@ -60,9 +60,11 @@ public class NmsItemStackCreate17R4P extends NmsItemStackCreate
{ {
return PackageType.MINECRAFT_ITEM.getClass("ItemStack"); return PackageType.MINECRAFT_ITEM.getClass("ItemStack");
} }
else
{
return PackageType.MINECRAFT_SERVER.getClass("ItemStack"); return PackageType.MINECRAFT_SERVER.getClass("ItemStack");
} }
}
public static Class<?> getClassCraftItemStackCatch() public static Class<?> getClassCraftItemStackCatch()
{ {

View File

@ -9,6 +9,7 @@ public enum ServerType
BUKKIT, BUKKIT,
FORGE, FORGE,
// END OF LIST
; ;
// -------------------------------------------- // // -------------------------------------------- //
@ -16,14 +17,13 @@ public enum ServerType
// -------------------------------------------- // // -------------------------------------------- //
private static final ServerType type = determineType(); private static final ServerType type = determineType();
public static ServerType get() { return type; } public static ServerType get() { return type; }
private static ServerType determineType() private static ServerType determineType()
{ {
try try
{ {
// this is a class used by ALL forge based servers // This is a class used by ALL forge based servers.
Class.forName("cpw.mods.fml.common.FMLCommonHandler"); Class.forName("cpw.mods.fml.common.FMLCommonHandler");
return FORGE; return FORGE;
} }