Compare commits

..

1 Commits

Author SHA1 Message Date
6ee0e5c4b1 fix: skip valid location check for world plots
- Checking location on teleport to a single plot means the bukkit world is attempted to be accessed before it is loaded
 - we can just skip this check because we know the player will teleport to a reasonable location
2024-04-05 10:00:33 +01:00
9 changed files with 13 additions and 24 deletions

View File

@ -154,7 +154,7 @@ public class EntitySpawnListener implements Listener {
if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) {
event.setCancelled(true);
}
if (type == EntityType.ENDER_CRYSTAL || type == EntityType.ARMOR_STAND) {
if (type == EntityType.ENDER_CRYSTAL) {
if (BukkitEntityUtil.checkEntity(entity, plot)) {
event.setCancelled(true);
}

View File

@ -1936,9 +1936,7 @@ public class PlayerEventListener implements Listener {
@EventHandler
public void onPlayerTakeLecternBook(PlayerTakeLecternBookEvent event) {
Player player = event.getPlayer();
BukkitPlayer pp = BukkitUtil.adapt(player);
Location location = pp.getLocation();
Location location = BukkitUtil.adapt(event.getPlayer().getLocation());
PlotArea area = location.getPlotArea();
if (area == null) {
return;
@ -1950,12 +1948,10 @@ public class PlayerEventListener implements Listener {
}
return;
}
if (!plot.isAdded(pp.getUUID())) {
if (plot.getFlag(LecternReadBookFlag.class)) {
plot.debug(event.getPlayer().getName() + " could not take the book because of lectern-read-book = true");
event.setCancelled(true);
}
}
}
}

View File

@ -326,7 +326,7 @@ public class BukkitPlayer extends PlotPlayer<Player> {
return;
}
this.player.playSound(BukkitUtil.adapt(location), Sound.valueOf(BukkitAdapter.adapt(id).name()),
SoundCategory.MUSIC, Float.MAX_VALUE, 1f
SoundCategory.MUSIC, 1f, 1f
);
}

View File

@ -2574,7 +2574,7 @@ public class Plot {
*/
public void teleportPlayer(final PlotPlayer<?> player, TeleportCause cause, Consumer<Boolean> resultConsumer) {
Plot plot = this.getBasePlot(false);
if (!WorldUtil.isValidLocation(plot.getBottomAbs())) {
if ((getArea() == null || !(getArea() instanceof SinglePlotArea)) && !WorldUtil.isValidLocation(plot.getBottomAbs())) {
// prevent from teleporting into unsafe regions
player.sendMessage(TranslatableCaption.of("border.denied"));
resultConsumer.accept(false);

View File

@ -23,7 +23,7 @@ import com.plotsquared.core.plot.flag.types.BooleanFlag;
import org.checkerframework.checker.nullness.qual.NonNull;
/**
* @since 7.3.7
* @since TODO
*/
public class TileDropFlag extends BooleanFlag<TileDropFlag> {

View File

@ -37,7 +37,7 @@ import java.util.List;
public class SinglePlotManager extends PlotManager {
private static final int MAX_COORDINATE = 30000000;
private static final int MAX_COORDINATE = 20000000;
public SinglePlotManager(final @NonNull PlotArea plotArea) {
super(plotArea);

View File

@ -27,8 +27,6 @@ import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.configuration.caption.LocaleHolder;
import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.player.MetaDataAccess;
import com.plotsquared.core.player.PlayerMetaDataKeys;
import com.plotsquared.core.player.PlotPlayer;
import com.plotsquared.core.plot.Plot;
import com.plotsquared.core.plot.flag.GlobalFlagContainer;
@ -199,11 +197,6 @@ public final class PlaceholderRegistry {
});
this.createPlaceholder("currentplot_biome", (player, plot) -> plot.getBiomeSynchronous().toString());
this.createPlaceholder("currentplot_size", (player, plot) -> String.valueOf(plot.getConnectedPlots().size()));
this.createPlaceholder("total_grants", player -> {
try (final MetaDataAccess<Integer> metaDataAccess = player.accessPersistentMetaData(PlayerMetaDataKeys.PERSISTENT_GRANTED_PLOTS)) {
return Integer.toString(metaDataAccess.get().orElse(0));
}
});
}
/**

View File

@ -22,7 +22,7 @@ plugins {
}
group = "com.intellectualsites.plotsquared"
version = "7.3.8-SNAPSHOT"
version = "7.3.7-SNAPSHOT"
if (!File("$rootDir/.git").exists()) {
logger.lifecycle("""

View File

@ -2,7 +2,7 @@
# Platform expectations
paper = "1.20.2-R0.1-SNAPSHOT"
guice = "7.0.0"
spotbugs = "4.8.4"
spotbugs = "4.8.3"
checkerqual = "3.42.0"
gson = "2.10"
guava = "31.1-jre"
@ -13,7 +13,7 @@ log4j = "2.19.0"
# Plugins
worldedit = "7.2.20"
fawe = "2.9.2"
fawe = "2.9.1"
placeholderapi = "2.11.5"
luckperms = "5.4"
essentialsx = "2.20.1"
@ -36,7 +36,7 @@ serverlib = "2.3.4"
shadow = "8.1.1"
grgit = "4.1.1"
spotless = "6.25.0"
nexus = "2.0.0"
nexus = "1.3.0"
runPaper = "2.2.3"
[libraries]