private static void updateServerHandler(EntityPlayerMP playerEntity) {
if(hasXCommands()) {
return;
}
NetServerHandler handler = playerEntity.playerNetServerHandler;
if(playerEntity.noClip) {
if(!(handler instanceof ONetServerHandler)) {
playerEntity.playerNetServerHandler = new ONetServerHandler(MinecraftServer.getServer(),
handler.netManager, handler.playerEntity, handler);
}
} else {
if(handler instanceof ONetServerHandler) {
NetServerHandler oldInstance = ((ONetServerHandler)handler).getOldInstance();
if(oldInstance != null) {
handler.netManager.setNetHandler(oldInstance);
playerEntity.playerNetServerHandler = oldInstance;
}
}