mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-10-06 10:27:26 +02:00
Log all exceptions if setting MCAccess fails.
This commit is contained in:
parent
3d773c6944
commit
f1e2781c81
@ -1,8 +1,12 @@
|
||||
package fr.neatmonster.nocheatplus.compat;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import fr.neatmonster.nocheatplus.compat.cb2511.MCAccessCB2511;
|
||||
import fr.neatmonster.nocheatplus.compat.cb2512.MCAccessCB2512;
|
||||
import fr.neatmonster.nocheatplus.compat.cb2512.MCAccessMC1_4_6;
|
||||
import fr.neatmonster.nocheatplus.utilities.LogUtil;
|
||||
|
||||
/**
|
||||
* Factory class to hide potentially dirty stuff.
|
||||
@ -16,19 +20,30 @@ public class MCAccessFactory {
|
||||
* @return
|
||||
*/
|
||||
public MCAccess getMCAccess(){
|
||||
final List<Throwable> throwables = new ArrayList<Throwable>();
|
||||
try{
|
||||
return new MCAccessCB2511();
|
||||
}
|
||||
catch(Throwable t){};
|
||||
catch(Throwable t){
|
||||
throwables.add(t);
|
||||
};
|
||||
|
||||
try{
|
||||
return new MCAccessCB2512();
|
||||
}
|
||||
catch(Throwable t){};
|
||||
catch(Throwable t){
|
||||
throwables.add(t);
|
||||
};
|
||||
try{
|
||||
return new MCAccessMC1_4_6();
|
||||
}
|
||||
catch(Throwable t){};
|
||||
catch(Throwable t){
|
||||
throwables.add(t);
|
||||
};
|
||||
LogUtil.logSevere("[NoCheatPlus] Could not set up MC version specific access.");
|
||||
for (Throwable t : throwables ){
|
||||
LogUtil.logSevere(t);
|
||||
}
|
||||
throw new RuntimeException("Could not set up access to Minecraft API.");
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user