mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-07-03 22:24:43 +02:00
Compare commits
1 Commits
fix-4306
...
fix/avoid-
Author | SHA1 | Date | |
---|---|---|---|
e33f534c33 |
@ -779,8 +779,7 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
|
|||||||
Iterator<Entity> iterator = entities.iterator();
|
Iterator<Entity> iterator = entities.iterator();
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
Entity entity = iterator.next();
|
Entity entity = iterator.next();
|
||||||
//noinspection ConstantValue - getEntitySpawnReason annotated as NotNull, but is not NotNull. lol.
|
if (PaperLib.isPaper() && "CUSTOM".equals(entity.getEntitySpawnReason().name())) {
|
||||||
if (PaperLib.isPaper() && entity.getEntitySpawnReason() != null && "CUSTOM".equals(entity.getEntitySpawnReason().name())) {
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// Fallback for Spigot not having Entity#getEntitySpawnReason
|
// Fallback for Spigot not having Entity#getEntitySpawnReason
|
||||||
|
@ -152,13 +152,13 @@ public class EntityEventListener implements Listener {
|
|||||||
}
|
}
|
||||||
case "REINFORCEMENTS", "NATURAL", "MOUNT", "PATROL", "RAID", "SHEARED", "SILVERFISH_BLOCK", "ENDER_PEARL",
|
case "REINFORCEMENTS", "NATURAL", "MOUNT", "PATROL", "RAID", "SHEARED", "SILVERFISH_BLOCK", "ENDER_PEARL",
|
||||||
"TRAP", "VILLAGE_DEFENSE", "VILLAGE_INVASION", "BEEHIVE", "CHUNK_GEN", "NETHER_PORTAL",
|
"TRAP", "VILLAGE_DEFENSE", "VILLAGE_INVASION", "BEEHIVE", "CHUNK_GEN", "NETHER_PORTAL",
|
||||||
"FROZEN", "SPELL", "DEFAULT" -> {
|
"DUPLICATION", "FROZEN", "SPELL", "DEFAULT" -> {
|
||||||
if (!area.isMobSpawning()) {
|
if (!area.isMobSpawning()) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case "BREEDING", "DUPLICATION" -> {
|
case "BREEDING" -> {
|
||||||
if (!area.isSpawnBreeding()) {
|
if (!area.isSpawnBreeding()) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
|
@ -124,8 +124,7 @@ public class EntitySpawnListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (PaperLib.isPaper()) {
|
if (PaperLib.isPaper()) {
|
||||||
//noinspection ConstantValue - getEntitySpawnReason annotated as NotNull, but is not NotNull. lol.
|
if (area.isSpawnCustom() && "CUSTOM".equals(entity.getEntitySpawnReason().name())) {
|
||||||
if (area.isSpawnCustom() && entity.getEntitySpawnReason() != null && "CUSTOM".equals(entity.getEntitySpawnReason().name())) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,8 +20,6 @@ package com.plotsquared.bukkit.placeholder;
|
|||||||
|
|
||||||
import com.plotsquared.core.PlotSquared;
|
import com.plotsquared.core.PlotSquared;
|
||||||
import com.plotsquared.core.player.PlotPlayer;
|
import com.plotsquared.core.player.PlotPlayer;
|
||||||
import com.plotsquared.core.plot.flag.implementations.DoneFlag;
|
|
||||||
import com.plotsquared.core.util.query.PlotQuery;
|
|
||||||
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
||||||
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -85,20 +83,6 @@ public class PAPIPlaceholders extends PlaceholderExpansion {
|
|||||||
return String.valueOf(pl.getPlotCount(identifier));
|
return String.valueOf(pl.getPlotCount(identifier));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (identifier.startsWith("base_plot_count_")) {
|
|
||||||
identifier = identifier.substring("base_plot_count_".length());
|
|
||||||
if (identifier.isEmpty()) {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
return String.valueOf(PlotQuery.newQuery()
|
|
||||||
.ownedBy(pl)
|
|
||||||
.inWorld(identifier)
|
|
||||||
.whereBasePlot()
|
|
||||||
.thatPasses(plot -> !DoneFlag.isDone(plot))
|
|
||||||
.count());
|
|
||||||
}
|
|
||||||
|
|
||||||
// PlotSquared placeholders
|
// PlotSquared placeholders
|
||||||
return PlotSquared.platform().placeholderRegistry().getPlaceholderValue(identifier, pl);
|
return PlotSquared.platform().placeholderRegistry().getPlaceholderValue(identifier, pl);
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,7 @@ package com.plotsquared.core.command;
|
|||||||
|
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
import com.plotsquared.core.configuration.Settings;
|
import com.plotsquared.core.configuration.Settings;
|
||||||
|
import com.plotsquared.core.configuration.caption.StaticCaption;
|
||||||
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.permissions.Permission;
|
import com.plotsquared.core.permissions.Permission;
|
||||||
import com.plotsquared.core.player.PlotPlayer;
|
import com.plotsquared.core.player.PlotPlayer;
|
||||||
@ -201,6 +202,7 @@ public class Download extends SubCommand {
|
|||||||
.tag("delete", Tag.preProcessParsed("Not available"))
|
.tag("delete", Tag.preProcessParsed("Not available"))
|
||||||
.build()
|
.build()
|
||||||
);
|
);
|
||||||
|
player.sendMessage(StaticCaption.of(value.toString()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
|
@ -1455,7 +1455,7 @@ public abstract class PlotArea implements ComponentLike {
|
|||||||
/**
|
/**
|
||||||
* Get the maximum height that changes to plot components (wall filling, air, all etc.) may operate to
|
* Get the maximum height that changes to plot components (wall filling, air, all etc.) may operate to
|
||||||
*
|
*
|
||||||
* @since 7.3.4
|
* @since TODO
|
||||||
*/
|
*/
|
||||||
public int getMaxComponentHeight() {
|
public int getMaxComponentHeight() {
|
||||||
return this.maxBuildHeight;
|
return this.maxBuildHeight;
|
||||||
@ -1464,7 +1464,7 @@ public abstract class PlotArea implements ComponentLike {
|
|||||||
/**
|
/**
|
||||||
* Get the minimum height that changes to plot components (wall filling, air, all etc.) may operate to
|
* Get the minimum height that changes to plot components (wall filling, air, all etc.) may operate to
|
||||||
*
|
*
|
||||||
* @since 7.3.4
|
* @since TODO
|
||||||
*/
|
*/
|
||||||
public int getMinComponentHeight() {
|
public int getMinComponentHeight() {
|
||||||
return this.minBuildHeight;
|
return this.minBuildHeight;
|
||||||
|
@ -31,11 +31,9 @@ import com.plotsquared.core.player.PlotPlayer;
|
|||||||
import com.plotsquared.core.plot.Plot;
|
import com.plotsquared.core.plot.Plot;
|
||||||
import com.plotsquared.core.plot.flag.GlobalFlagContainer;
|
import com.plotsquared.core.plot.flag.GlobalFlagContainer;
|
||||||
import com.plotsquared.core.plot.flag.PlotFlag;
|
import com.plotsquared.core.plot.flag.PlotFlag;
|
||||||
import com.plotsquared.core.plot.flag.implementations.DoneFlag;
|
|
||||||
import com.plotsquared.core.plot.flag.implementations.ServerPlotFlag;
|
import com.plotsquared.core.plot.flag.implementations.ServerPlotFlag;
|
||||||
import com.plotsquared.core.util.EventDispatcher;
|
import com.plotsquared.core.util.EventDispatcher;
|
||||||
import com.plotsquared.core.util.PlayerManager;
|
import com.plotsquared.core.util.PlayerManager;
|
||||||
import com.plotsquared.core.util.query.PlotQuery;
|
|
||||||
import net.kyori.adventure.text.Component;
|
import net.kyori.adventure.text.Component;
|
||||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||||
@ -97,12 +95,6 @@ public final class PlaceholderRegistry {
|
|||||||
}
|
}
|
||||||
return Integer.toString(player.getAllowedPlots());
|
return Integer.toString(player.getAllowedPlots());
|
||||||
});
|
});
|
||||||
this.createPlaceholder("base_plot_count", player -> Integer.toString(PlotQuery.newQuery()
|
|
||||||
.ownedBy(player)
|
|
||||||
.whereBasePlot()
|
|
||||||
.thatPasses(plot -> !DoneFlag.isDone(plot))
|
|
||||||
.count())
|
|
||||||
);
|
|
||||||
this.createPlaceholder("plot_count", player -> Integer.toString(player.getPlotCount()));
|
this.createPlaceholder("plot_count", player -> Integer.toString(player.getPlotCount()));
|
||||||
this.createPlaceholder("currentplot_alias", (player, plot) -> {
|
this.createPlaceholder("currentplot_alias", (player, plot) -> {
|
||||||
if (plot.getAlias().isEmpty()) {
|
if (plot.getAlias().isEmpty()) {
|
||||||
|
@ -22,7 +22,7 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group = "com.intellectualsites.plotsquared"
|
group = "com.intellectualsites.plotsquared"
|
||||||
version = "7.3.5-SNAPSHOT"
|
version = "7.3.4-SNAPSHOT"
|
||||||
|
|
||||||
if (!File("$rootDir/.git").exists()) {
|
if (!File("$rootDir/.git").exists()) {
|
||||||
logger.lifecycle("""
|
logger.lifecycle("""
|
||||||
|
@ -13,7 +13,7 @@ log4j = "2.19.0"
|
|||||||
|
|
||||||
# Plugins
|
# Plugins
|
||||||
worldedit = "7.2.18"
|
worldedit = "7.2.18"
|
||||||
fawe = "2.9.0"
|
fawe = "2.8.4"
|
||||||
placeholderapi = "2.11.5"
|
placeholderapi = "2.11.5"
|
||||||
luckperms = "5.4"
|
luckperms = "5.4"
|
||||||
essentialsx = "2.20.1"
|
essentialsx = "2.20.1"
|
||||||
|
Reference in New Issue
Block a user