Move difficulty detect to slack service
This commit is contained in:
@@ -2,10 +2,12 @@ package io.akarin.server.core;
|
||||
|
||||
import io.akarin.api.internal.Akari;
|
||||
import net.minecraft.server.EntityPlayer;
|
||||
import net.minecraft.server.EnumDifficulty;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.PacketPlayOutKeepAlive;
|
||||
import net.minecraft.server.PacketPlayOutUpdateTime;
|
||||
import net.minecraft.server.PlayerConnection;
|
||||
import net.minecraft.server.WorldServer;
|
||||
|
||||
public class AkarinSlackScheduler extends Thread {
|
||||
public static AkarinSlackScheduler get() {
|
||||
@@ -63,6 +65,12 @@ public class AkarinSlackScheduler extends Thread {
|
||||
}
|
||||
}
|
||||
|
||||
for (WorldServer world : server.worlds) {
|
||||
if (world.getWorldData().isHardcore() && world.getDifficulty() != EnumDifficulty.HARD) {
|
||||
world.getWorldData().setDifficulty(EnumDifficulty.HARD);
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
Thread.sleep(100);
|
||||
} catch (InterruptedException ex) {
|
||||
|
||||
@@ -47,7 +47,7 @@ public class WorldData {
|
||||
private boolean z;
|
||||
private boolean A;
|
||||
private boolean B;
|
||||
private EnumDifficulty C;
|
||||
private volatile EnumDifficulty C; // Akarin - volatile
|
||||
private boolean D;
|
||||
private double E;
|
||||
private double F;
|
||||
|
||||
@@ -277,9 +277,10 @@ public class WorldServer extends World implements IAsyncTaskHandler {
|
||||
@Override
|
||||
public void doTick() {
|
||||
super.doTick();
|
||||
if (this.getWorldData().isHardcore() && this.getDifficulty() != EnumDifficulty.HARD) {
|
||||
// Akarin start - goes to slack service
|
||||
/* if (this.getWorldData().isHardcore() && this.getDifficulty() != EnumDifficulty.HARD) {
|
||||
this.getWorldData().setDifficulty(EnumDifficulty.HARD);
|
||||
}
|
||||
} */ // Akarin end
|
||||
|
||||
this.worldProvider.k().b();
|
||||
if (this.everyoneDeeplySleeping()) {
|
||||
|
||||
Reference in New Issue
Block a user