Fix compat not loading for latest spigot versions.

This commit is contained in:
asofold 2015-05-26 03:13:03 +02:00
parent 83660b0c2b
commit cf9f119f67
5 changed files with 21 additions and 13 deletions

View File

@ -18,12 +18,12 @@ import org.bukkit.entity.Entity;
import fr.neatmonster.nocheatplus.utilities.BlockCache;
public class BlockCacheCBSpigot1_8_R2 extends BlockCache implements IBlockAccess{
public class BlockCacheSpigotCB1_8_R2 extends BlockCache implements IBlockAccess{
protected net.minecraft.server.v1_8_R2.WorldServer world;
protected World bukkitWorld; // WHACKS
public BlockCacheCBSpigot1_8_R2(World world) {
public BlockCacheSpigotCB1_8_R2(World world) {
setAccess(world);
}

View File

@ -23,12 +23,12 @@ import fr.neatmonster.nocheatplus.compat.MCAccess;
import fr.neatmonster.nocheatplus.utilities.BlockCache;
import fr.neatmonster.nocheatplus.utilities.ReflectionUtil;
public class MCAccessCBSpigot1_8_R2 implements MCAccess{
public class MCAccessSpigotCB1_8_R2 implements MCAccess{
/**
* Constructor to let it fail.
*/
public MCAccessCBSpigot1_8_R2() {
public MCAccessSpigotCB1_8_R2() {
getCommandMap();
ReflectionUtil.checkMembers("net.minecraft.server.v1_8_R2.", new String[] {"Entity" , "dead"});
// block bounds, original: minX, maxX, minY, maxY, minZ, maxZ
@ -55,7 +55,7 @@ public class MCAccessCBSpigot1_8_R2 implements MCAccess{
@Override
public BlockCache getBlockCache(final World world) {
return new BlockCacheCBSpigot1_8_R2(world);
return new BlockCacheSpigotCB1_8_R2(world);
}
@Override

View File

@ -18,12 +18,12 @@ import org.bukkit.entity.Entity;
import fr.neatmonster.nocheatplus.utilities.BlockCache;
public class BlockCacheCBSpigot1_8_R3 extends BlockCache implements IBlockAccess{
public class BlockCacheSpigotCB1_8_R3 extends BlockCache implements IBlockAccess{
protected net.minecraft.server.v1_8_R3.WorldServer world;
protected World bukkitWorld; // WHACKS
public BlockCacheCBSpigot1_8_R3(World world) {
public BlockCacheSpigotCB1_8_R3(World world) {
setAccess(world);
}

View File

@ -23,12 +23,12 @@ import fr.neatmonster.nocheatplus.compat.MCAccess;
import fr.neatmonster.nocheatplus.utilities.BlockCache;
import fr.neatmonster.nocheatplus.utilities.ReflectionUtil;
public class MCAccessCBSpigot1_8_R3 implements MCAccess{
public class MCAccessSpigotCB1_8_R3 implements MCAccess{
/**
* Constructor to let it fail.
*/
public MCAccessCBSpigot1_8_R3() {
public MCAccessSpigotCB1_8_R3() {
getCommandMap();
ReflectionUtil.checkMembers("net.minecraft.server.v1_8_R3.", new String[] {"Entity" , "dead"});
// block bounds, original: minX, maxX, minY, maxY, minZ, maxZ
@ -55,7 +55,7 @@ public class MCAccessCBSpigot1_8_R3 implements MCAccess{
@Override
public BlockCache getBlockCache(final World world) {
return new BlockCacheCBSpigot1_8_R3(world);
return new BlockCacheSpigotCB1_8_R3(world);
}
@Override

View File

@ -1,6 +1,7 @@
package fr.neatmonster.nocheatplus.compat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import org.bukkit.Bukkit;
@ -57,6 +58,9 @@ public class MCAccessFactory {
}
StaticLog.logWarning(msg);
final MCAccess mcAccess = new MCAccessBukkit();
// if (ConfigManager.getConfigFile().getBoolean(ConfPaths.LOGGING_EXTENDED_STATUS)) {
// log(throwables); // Maybe later activate with TRACE explicitly set
// }
StaticLog.logWarning("[NoCheatPlus] Bukkit-API-only access: Some features will likely not function properly, performance might suffer.");
return mcAccess;
}
@ -71,11 +75,15 @@ public class MCAccessFactory {
StaticLog.logSevere(msg);
}
StaticLog.logSevere("[NoCheatPlus] >>> Failed to set up MCAccess <<<");
log(throwables);
// TODO: Schedule disabling the plugin or running in circles.
throw new RuntimeException("Could not set up native access to the server mod, neither to the Bukkit-API.");
}
private static void log(Collection<Throwable> throwables) {
for (Throwable t : throwables ) {
StaticLog.logSevere(t);
}
// TODO: Schedule disabling the plugin or running in circles.
throw new RuntimeException("Could not set up native access to the server mod, neither to the Bukkit-API.");
}
/**
@ -89,7 +97,7 @@ public class MCAccessFactory {
final String[] classNames = new String[] {
// Current DEV / LATEST: CB (Spigot)
// "fr.neatmonster.nocheatplus.compat.cbdev.MCAccessCBDev", // future / tests.
// "fr.neatmonster.nocheatplus.compat.cbdev.MCAccessCBDev", // future / tests.
// Dedicated: CB (Spigot)
"fr.neatmonster.nocheatplus.compat.spigotcb1_8_R3.MCAccessSpigotCB1_8_R3", // 1.8.4|1.8.5 (1_8_R3)
"fr.neatmonster.nocheatplus.compat.spigotcb1_8_R2.MCAccessSpigotCB1_8_R2", // 1.8.3 (1_8_R2)