Update unit test to 1.5.1
Dieser Commit ist enthalten in:
Ursprung
bda4474d62
Commit
8e11a40662
@ -327,6 +327,7 @@ public class DefaultInstances implements InstanceProvider {
|
||||
try {
|
||||
return (T) constructor.newInstance(params);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
// Cannot create it
|
||||
return null;
|
||||
}
|
||||
|
@ -4,8 +4,10 @@ import static org.mockito.Matchers.any;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import net.minecraft.server.StatisticList;
|
||||
|
||||
// Will have to be updated for every version though
|
||||
import org.bukkit.craftbukkit.v1_4_R1.inventory.CraftItemFactory;
|
||||
import org.bukkit.craftbukkit.inventory.CraftItemFactory;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
@ -34,6 +36,12 @@ public class BukkitInitialization {
|
||||
|
||||
initializePackage();
|
||||
|
||||
try {
|
||||
StatisticList.b();
|
||||
} catch (Exception e) {
|
||||
// Swallow
|
||||
}
|
||||
|
||||
// Mock the server object
|
||||
Server mockedServer = mock(Server.class);
|
||||
ItemFactory mockedFactory = mock(CraftItemFactory.class);
|
||||
@ -55,6 +63,6 @@ public class BukkitInitialization {
|
||||
*/
|
||||
public static void initializePackage() {
|
||||
// Initialize reflection
|
||||
MinecraftReflection.setMinecraftPackage("net.minecraft.server.v1_4_R1", "org.bukkit.craftbukkit.v1_4_R1");
|
||||
MinecraftReflection.setMinecraftPackage("net.minecraft.server", "org.bukkit.craftbukkit");
|
||||
}
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ import java.lang.reflect.Array;
|
||||
import java.util.List;
|
||||
|
||||
// Will have to be updated for every version though
|
||||
import org.bukkit.craftbukkit.v1_4_R1.inventory.CraftItemFactory;
|
||||
import org.bukkit.craftbukkit.inventory.CraftItemFactory;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.WorldType;
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren