Compare commits

...

6 Commits

Author SHA1 Message Date
Jordan
defb84e7c4 Disable not saving single world chunks
- addresses #4413
2024-05-02 11:28:48 +09:00
renovate[bot]
d7d884ad6d Update dependency org.checkerframework:checker-qual to v3.43.0 2024-05-02 02:13:16 +00:00
renovate[bot]
1c45e01a14 Update dependency xyz.jpenilla.run-paper to v2.3.0 2024-05-02 02:12:54 +00:00
Vrganj
6ef1163325 perf: get rid of guice overhead when accessing the player & world manager (#4409)
Return already injected fields to skip slow Injector access
2024-05-01 18:45:15 +02:00
renovate[bot]
c57d784df7 Update dependency xyz.jpenilla.run-paper to v2.2.4 2024-04-23 02:10:41 +00:00
Pierre Maurice Schwang
c239908aa3 Don't heal dead players (#4407)
fix: don't heal dead players
2024-04-21 13:03:00 +02:00
4 changed files with 10 additions and 9 deletions

View File

@@ -24,7 +24,6 @@ import com.google.inject.Injector;
import com.google.inject.Key; import com.google.inject.Key;
import com.google.inject.Singleton; import com.google.inject.Singleton;
import com.google.inject.Stage; import com.google.inject.Stage;
import com.google.inject.TypeLiteral;
import com.plotsquared.bukkit.generator.BukkitPlotGenerator; import com.plotsquared.bukkit.generator.BukkitPlotGenerator;
import com.plotsquared.bukkit.inject.BackupModule; import com.plotsquared.bukkit.inject.BackupModule;
import com.plotsquared.bukkit.inject.BukkitModule; import com.plotsquared.bukkit.inject.BukkitModule;
@@ -45,7 +44,6 @@ import com.plotsquared.bukkit.listener.SpigotListener;
import com.plotsquared.bukkit.listener.WorldEvents; import com.plotsquared.bukkit.listener.WorldEvents;
import com.plotsquared.bukkit.placeholder.PAPIPlaceholders; import com.plotsquared.bukkit.placeholder.PAPIPlaceholders;
import com.plotsquared.bukkit.placeholder.PlaceholderFormatter; import com.plotsquared.bukkit.placeholder.PlaceholderFormatter;
import com.plotsquared.bukkit.player.BukkitPlayer;
import com.plotsquared.bukkit.player.BukkitPlayerManager; import com.plotsquared.bukkit.player.BukkitPlayerManager;
import com.plotsquared.bukkit.util.BukkitUtil; import com.plotsquared.bukkit.util.BukkitUtil;
import com.plotsquared.bukkit.util.BukkitWorld; import com.plotsquared.bukkit.util.BukkitWorld;
@@ -1271,15 +1269,13 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
@Override @Override
public @NonNull PlatformWorldManager<?> worldManager() { public @NonNull PlatformWorldManager<?> worldManager() {
return injector().getInstance(Key.get(new TypeLiteral<PlatformWorldManager<World>>() { return this.worldManager;
}));
} }
@Override @Override
@NonNull @NonNull
@SuppressWarnings("unchecked")
public PlayerManager<? extends PlotPlayer<Player>, ? extends Player> playerManager() { public PlayerManager<? extends PlotPlayer<Player>, ? extends Player> playerManager() {
return (PlayerManager<BukkitPlayer, Player>) injector().getInstance(PlayerManager.class); return this.playerManager;
} }
@Override @Override

View File

@@ -95,7 +95,8 @@ public class SingleWorldListener implements Listener {
@EventHandler(priority = EventPriority.LOWEST) @EventHandler(priority = EventPriority.LOWEST)
public void onChunkLoad(ChunkLoadEvent event) { public void onChunkLoad(ChunkLoadEvent event) {
handle(event); // disable this for now, should address https://github.com/IntellectualSites/PlotSquared/issues/4413
// handle(event);
} }
} }

View File

@@ -106,6 +106,10 @@ public class PlotListener {
iterator.remove(); iterator.remove();
continue; continue;
} }
// Don't attempt to heal dead players - they will get stuck in the abyss (#4406)
if (PlotSquared.platform().worldUtil().getHealth(player) <= 0) {
continue;
}
double level = PlotSquared.platform().worldUtil().getHealth(player); double level = PlotSquared.platform().worldUtil().getHealth(player);
if (level != value.max) { if (level != value.max) {
PlotSquared.platform().worldUtil().setHealth(player, Math.min(level + value.amount, value.max)); PlotSquared.platform().worldUtil().setHealth(player, Math.min(level + value.amount, value.max));

View File

@@ -3,7 +3,7 @@
paper = "1.20.2-R0.1-SNAPSHOT" paper = "1.20.2-R0.1-SNAPSHOT"
guice = "7.0.0" guice = "7.0.0"
spotbugs = "4.8.4" spotbugs = "4.8.4"
checkerqual = "3.42.0" checkerqual = "3.43.0"
gson = "2.10" gson = "2.10"
guava = "31.1-jre" guava = "31.1-jre"
snakeyaml = "2.0" snakeyaml = "2.0"
@@ -37,7 +37,7 @@ shadow = "8.1.1"
grgit = "4.1.1" grgit = "4.1.1"
spotless = "6.25.0" spotless = "6.25.0"
nexus = "2.0.0" nexus = "2.0.0"
runPaper = "2.2.3" runPaper = "2.3.0"
[libraries] [libraries]
# Platform expectations # Platform expectations