diff --git a/bukkit0/src/main/java/com/boydti/fawe/bukkit/FaweBukkit.java b/bukkit0/src/main/java/com/boydti/fawe/bukkit/FaweBukkit.java index d90e1f3b..6890c8c8 100644 --- a/bukkit0/src/main/java/com/boydti/fawe/bukkit/FaweBukkit.java +++ b/bukkit0/src/main/java/com/boydti/fawe/bukkit/FaweBukkit.java @@ -35,7 +35,6 @@ import org.bukkit.command.ConsoleCommandSender; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; -import org.bukkit.event.player.PlayerChangedWorldEvent; import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.plugin.Plugin; import org.primesoft.blockshub.BlocksHubBukkit; @@ -299,12 +298,6 @@ public class FaweBukkit implements IFawe, Listener { Fawe.get().unregister(event.getPlayer().getName()); } - @EventHandler - public void onPlayerChangedWorld(PlayerChangedWorldEvent event) { - Player player = event.getPlayer(); - FawePlayer fp = FawePlayer.wrap(player); - } - @Override public String getPlatform() { return Bukkit.getVersion(); diff --git a/core/src/main/java/com/boydti/fawe/example/NMSRelighter.java b/core/src/main/java/com/boydti/fawe/example/NMSRelighter.java index df43cc28..28f00758 100644 --- a/core/src/main/java/com/boydti/fawe/example/NMSRelighter.java +++ b/core/src/main/java/com/boydti/fawe/example/NMSRelighter.java @@ -195,14 +195,14 @@ public class NMSRelighter { if (brightness > 1 && (brightness != 15 || opacity != 15)) { lightBlock(bx + x, y, bz + z, brightness); } - if (opacity != 0 && opacity >= value) { + if (opacity > 1 && opacity >= value) { mask[j] = 0; queue.setSkyLight(section, x, y, z, 0); continue; } switch (value) { case 0: - if (opacity != 0) { + if (opacity > 1) { queue.setSkyLight(section, x, y, z, 0); continue; } @@ -274,7 +274,7 @@ public class NMSRelighter { for (int j = 0; j < 256; j++) { int x = j & 15; int z = j >> 4; - if (mask[j] >= 14 || (mask[j] == 0 && queue.getOpacity(section, x, y, z) > 0)) { + if (mask[j] >= 14 || (mask[j] == 0 && queue.getOpacity(section, x, y, z) > 1)) { continue; } byte value = mask[j]; @@ -286,7 +286,7 @@ public class NMSRelighter { for (int j = 255; j >= 0; j--) { int x = j & 15; int z = j >> 4; - if (mask[j] >= 14 || (mask[j] == 0 && queue.getOpacity(section, x, y, z) > 0)) { + if (mask[j] >= 14 || (mask[j] == 0 && queue.getOpacity(section, x, y, z) > 1)) { continue; } byte value = mask[j]; diff --git a/nukkit/src/main/java/com/boydti/fawe/nukkit/optimization/FaweNukkit.java b/nukkit/src/main/java/com/boydti/fawe/nukkit/optimization/FaweNukkit.java index 86ad16ff..edf31537 100644 --- a/nukkit/src/main/java/com/boydti/fawe/nukkit/optimization/FaweNukkit.java +++ b/nukkit/src/main/java/com/boydti/fawe/nukkit/optimization/FaweNukkit.java @@ -1,8 +1,12 @@ package com.boydti.fawe.nukkit.optimization; import cn.nukkit.Player; +import cn.nukkit.event.EventHandler; +import cn.nukkit.event.Listener; +import cn.nukkit.event.player.PlayerQuitEvent; import com.boydti.fawe.Fawe; import com.boydti.fawe.IFawe; +import com.boydti.fawe.config.Settings; import com.boydti.fawe.nukkit.core.NukkitTaskManager; import com.boydti.fawe.nukkit.core.NukkitWorldEdit; import com.boydti.fawe.nukkit.optimization.queue.NukkitQueue; @@ -19,13 +23,25 @@ import java.util.Collection; import java.util.UUID; import java.util.logging.Level; -public class FaweNukkit implements IFawe { +public class FaweNukkit implements IFawe, Listener { private final NukkitWorldEdit plugin; public FaweNukkit(NukkitWorldEdit mod) { + Settings.HISTORY.USE_DISK = true; + Settings.CLIPBOARD.USE_DISK = true; + Settings.HISTORY.COMPRESSION_LEVEL = 9; this.plugin = mod; FaweChunk.HEIGHT = 128; + plugin.getServer().getPluginManager().registerEvents(this, plugin); + } + + @EventHandler + public void onPlayerQuit(PlayerQuitEvent event) { + Player player = event.getPlayer(); + FawePlayer fp = FawePlayer.wrap(player); + fp.unregister(); + Fawe.get().unregister(event.getPlayer().getName()); } @Override