mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-07-04 14:44:43 +02:00
Compare commits
23 Commits
fix/avoid-
...
drop-1.17.
Author | SHA1 | Date | |
---|---|---|---|
e7123b1f55 | |||
b32137a650 | |||
17c41c0494 | |||
1ee76bf2d9 | |||
2321831044 | |||
25e98618b9 | |||
5344efd1b7 | |||
68701b6201 | |||
64c610ef37 | |||
931bb90600 | |||
1dfa3b4e66 | |||
8f236a56a6 | |||
e51121960d | |||
cc011de032 | |||
28298ffdd6 | |||
499d3c39bc | |||
3d56937f14 | |||
0f1c2cb4e4 | |||
7b233c944a | |||
d9537ee9df | |||
0de6887526 | |||
a2e3274215 | |||
b369683b9c |
7
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
7
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@ -30,14 +30,7 @@ body:
|
|||||||
- '1.20.4'
|
- '1.20.4'
|
||||||
- '1.20'
|
- '1.20'
|
||||||
- '1.19.4'
|
- '1.19.4'
|
||||||
- '1.19.3'
|
|
||||||
- '1.19.2'
|
|
||||||
- '1.19.1'
|
|
||||||
- '1.19'
|
|
||||||
- '1.18.2'
|
- '1.18.2'
|
||||||
- '1.18.1'
|
|
||||||
- '1.17.1'
|
|
||||||
- '1.16.5'
|
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
|
1
.github/renovate.json
vendored
1
.github/renovate.json
vendored
@ -9,7 +9,6 @@
|
|||||||
"dependencies"
|
"dependencies"
|
||||||
],
|
],
|
||||||
"rebaseWhen": "conflicted",
|
"rebaseWhen": "conflicted",
|
||||||
"schedule": ["on the first day of the month"],
|
|
||||||
"ignoreDeps": [
|
"ignoreDeps": [
|
||||||
"com.google.code.gson:gson",
|
"com.google.code.gson:gson",
|
||||||
"com.google.guava:guava",
|
"com.google.guava:guava",
|
||||||
|
@ -779,7 +779,8 @@ 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();
|
||||||
if (PaperLib.isPaper() && "CUSTOM".equals(entity.getEntitySpawnReason().name())) {
|
//noinspection ConstantValue - getEntitySpawnReason annotated as NotNull, but is not NotNull. lol.
|
||||||
|
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
|
||||||
|
@ -670,7 +670,11 @@ public class BlockEventListener implements Listener {
|
|||||||
BlockBreakEvent call = new BlockBreakEvent(block, player);
|
BlockBreakEvent call = new BlockBreakEvent(block, player);
|
||||||
Bukkit.getServer().getPluginManager().callEvent(call);
|
Bukkit.getServer().getPluginManager().callEvent(call);
|
||||||
if (!call.isCancelled()) {
|
if (!call.isCancelled()) {
|
||||||
event.getBlock().breakNaturally();
|
if (Settings.Flags.INSTABREAK_CONSIDER_TOOL) {
|
||||||
|
block.breakNaturally(event.getItemInHand());
|
||||||
|
} else {
|
||||||
|
block.breakNaturally();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// == rather than <= as we only care about the "ground level" not being destroyed
|
// == rather than <= as we only care about the "ground level" not being destroyed
|
||||||
|
@ -56,6 +56,7 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.entity.Projectile;
|
import org.bukkit.entity.Projectile;
|
||||||
import org.bukkit.entity.TNTPrimed;
|
import org.bukkit.entity.TNTPrimed;
|
||||||
import org.bukkit.entity.Vehicle;
|
import org.bukkit.entity.Vehicle;
|
||||||
|
import org.bukkit.event.Cancellable;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
@ -98,37 +99,25 @@ public class EntityEventListener implements Listener {
|
|||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGHEST)
|
@EventHandler(priority = EventPriority.HIGHEST)
|
||||||
public void onEntityCombustByEntity(EntityCombustByEntityEvent event) {
|
public void onEntityCombustByEntity(EntityCombustByEntityEvent event) {
|
||||||
EntityDamageByEntityEvent eventChange =
|
onEntityDamageByEntityCommon(event.getCombuster(), event.getEntity(), EntityDamageEvent.DamageCause.FIRE_TICK, event);
|
||||||
new EntityDamageByEntityEvent(
|
|
||||||
event.getCombuster(),
|
|
||||||
event.getEntity(),
|
|
||||||
EntityDamageEvent.DamageCause.FIRE_TICK,
|
|
||||||
event.getDuration()
|
|
||||||
);
|
|
||||||
onEntityDamageByEntityEvent(eventChange);
|
|
||||||
if (eventChange.isCancelled()) {
|
|
||||||
event.setCancelled(true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGHEST)
|
@EventHandler(priority = EventPriority.HIGHEST)
|
||||||
public void onEntityDamageByEntityEvent(EntityDamageByEntityEvent event) {
|
public void onEntityDamageByEntityEvent(EntityDamageByEntityEvent event) {
|
||||||
Entity damager = event.getDamager();
|
onEntityDamageByEntityCommon(event.getDamager(), event.getEntity(), event.getCause(), event);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void onEntityDamageByEntityCommon(
|
||||||
|
final Entity damager,
|
||||||
|
final Entity victim,
|
||||||
|
final EntityDamageEvent.DamageCause cause,
|
||||||
|
final Cancellable event
|
||||||
|
) {
|
||||||
Location location = BukkitUtil.adapt(damager.getLocation());
|
Location location = BukkitUtil.adapt(damager.getLocation());
|
||||||
if (!this.plotAreaManager.hasPlotArea(location.getWorldName())) {
|
if (!this.plotAreaManager.hasPlotArea(location.getWorldName())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Entity victim = event.getEntity();
|
if (!BukkitEntityUtil.entityDamage(damager, victim, cause)) {
|
||||||
/*
|
|
||||||
if (victim.getType().equals(EntityType.ITEM_FRAME)) {
|
|
||||||
Plot plot = BukkitUtil.getLocation(victim).getPlot();
|
|
||||||
if (plot != null && !plot.isAdded(damager.getUniqueId())) {
|
|
||||||
event.setCancelled(true);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
if (!BukkitEntityUtil.entityDamage(damager, victim, event.getCause())) {
|
|
||||||
if (event.isCancelled()) {
|
if (event.isCancelled()) {
|
||||||
if (victim instanceof Ageable ageable) {
|
if (victim instanceof Ageable ageable) {
|
||||||
if (ageable.getAge() == -24000) {
|
if (ageable.getAge() == -24000) {
|
||||||
@ -163,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",
|
||||||
"DUPLICATION", "FROZEN", "SPELL", "DEFAULT" -> {
|
"FROZEN", "SPELL", "DEFAULT" -> {
|
||||||
if (!area.isMobSpawning()) {
|
if (!area.isMobSpawning()) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case "BREEDING" -> {
|
case "BREEDING", "DUPLICATION" -> {
|
||||||
if (!area.isSpawnBreeding()) {
|
if (!area.isSpawnBreeding()) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
|
@ -124,7 +124,8 @@ public class EntitySpawnListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (PaperLib.isPaper()) {
|
if (PaperLib.isPaper()) {
|
||||||
if (area.isSpawnCustom() && "CUSTOM".equals(entity.getEntitySpawnReason().name())) {
|
//noinspection ConstantValue - getEntitySpawnReason annotated as NotNull, but is not NotNull. lol.
|
||||||
|
if (area.isSpawnCustom() && entity.getEntitySpawnReason() != null && "CUSTOM".equals(entity.getEntitySpawnReason().name())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -40,6 +40,7 @@ import com.plotsquared.core.plot.PlotArea;
|
|||||||
import com.plotsquared.core.plot.flag.FlagContainer;
|
import com.plotsquared.core.plot.flag.FlagContainer;
|
||||||
import com.plotsquared.core.plot.flag.implementations.BeaconEffectsFlag;
|
import com.plotsquared.core.plot.flag.implementations.BeaconEffectsFlag;
|
||||||
import com.plotsquared.core.plot.flag.implementations.DoneFlag;
|
import com.plotsquared.core.plot.flag.implementations.DoneFlag;
|
||||||
|
import com.plotsquared.core.plot.flag.implementations.FishingFlag;
|
||||||
import com.plotsquared.core.plot.flag.implementations.ProjectilesFlag;
|
import com.plotsquared.core.plot.flag.implementations.ProjectilesFlag;
|
||||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||||
import com.plotsquared.core.plot.world.PlotAreaManager;
|
import com.plotsquared.core.plot.world.PlotAreaManager;
|
||||||
@ -348,6 +349,11 @@ public class PaperListener implements Listener {
|
|||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
} else if (!plot.isAdded(pp.getUUID())) {
|
} else if (!plot.isAdded(pp.getUUID())) {
|
||||||
|
if (entity.getType().equals(EntityType.FISHING_HOOK)) {
|
||||||
|
if (plot.getFlag(FishingFlag.class)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (!plot.getFlag(ProjectilesFlag.class)) {
|
if (!plot.getFlag(ProjectilesFlag.class)) {
|
||||||
if (!pp.hasPermission(Permission.PERMISSION_ADMIN_PROJECTILE_OTHER)) {
|
if (!pp.hasPermission(Permission.PERMISSION_ADMIN_PROJECTILE_OTHER)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
|
@ -28,12 +28,14 @@ import com.plotsquared.core.player.PlotPlayer;
|
|||||||
import com.plotsquared.core.plot.Plot;
|
import com.plotsquared.core.plot.Plot;
|
||||||
import com.plotsquared.core.plot.PlotArea;
|
import com.plotsquared.core.plot.PlotArea;
|
||||||
import com.plotsquared.core.plot.PlotHandler;
|
import com.plotsquared.core.plot.PlotHandler;
|
||||||
|
import com.plotsquared.core.plot.flag.implementations.FishingFlag;
|
||||||
import com.plotsquared.core.plot.flag.implementations.ProjectilesFlag;
|
import com.plotsquared.core.plot.flag.implementations.ProjectilesFlag;
|
||||||
import com.plotsquared.core.plot.world.PlotAreaManager;
|
import com.plotsquared.core.plot.world.PlotAreaManager;
|
||||||
import com.plotsquared.core.util.PlotFlagUtil;
|
import com.plotsquared.core.util.PlotFlagUtil;
|
||||||
import net.kyori.adventure.text.minimessage.tag.Tag;
|
import net.kyori.adventure.text.minimessage.tag.Tag;
|
||||||
import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver;
|
import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
|
import org.bukkit.entity.EntityType;
|
||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.entity.Projectile;
|
import org.bukkit.entity.Projectile;
|
||||||
@ -132,6 +134,11 @@ public class ProjectileEventListener implements Listener {
|
|||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
} else if (!plot.isAdded(pp.getUUID())) {
|
} else if (!plot.isAdded(pp.getUUID())) {
|
||||||
|
if (entity.getType().equals(EntityType.FISHING_HOOK)) {
|
||||||
|
if (plot.getFlag(FishingFlag.class)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (!plot.getFlag(ProjectilesFlag.class)) {
|
if (!plot.getFlag(ProjectilesFlag.class)) {
|
||||||
if (!pp.hasPermission(Permission.PERMISSION_ADMIN_PROJECTILE_OTHER)) {
|
if (!pp.hasPermission(Permission.PERMISSION_ADMIN_PROJECTILE_OTHER)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
@ -187,7 +194,8 @@ public class ProjectileEventListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (plot.isAdded(pp.getUUID()) || pp.hasPermission(Permission.PERMISSION_ADMIN_PROJECTILE_OTHER) || plot.getFlag(
|
if (plot.isAdded(pp.getUUID()) || pp.hasPermission(Permission.PERMISSION_ADMIN_PROJECTILE_OTHER) || plot.getFlag(
|
||||||
ProjectilesFlag.class)) {
|
ProjectilesFlag.class) || (entity.getType().equals(EntityType.FISHING_HOOK) && plot.getFlag(
|
||||||
|
FishingFlag.class))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
entity.remove();
|
entity.remove();
|
||||||
|
@ -20,6 +20,8 @@ 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;
|
||||||
@ -83,6 +85,20 @@ 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);
|
||||||
}
|
}
|
||||||
|
@ -32,6 +32,7 @@ import com.plotsquared.core.plot.PlotWeather;
|
|||||||
import com.plotsquared.core.plot.world.PlotAreaManager;
|
import com.plotsquared.core.plot.world.PlotAreaManager;
|
||||||
import com.plotsquared.core.util.EventDispatcher;
|
import com.plotsquared.core.util.EventDispatcher;
|
||||||
import com.plotsquared.core.util.MathMan;
|
import com.plotsquared.core.util.MathMan;
|
||||||
|
import com.plotsquared.core.util.WorldUtil;
|
||||||
import com.sk89q.worldedit.bukkit.BukkitAdapter;
|
import com.sk89q.worldedit.bukkit.BukkitAdapter;
|
||||||
import com.sk89q.worldedit.extension.platform.Actor;
|
import com.sk89q.worldedit.extension.platform.Actor;
|
||||||
import com.sk89q.worldedit.world.item.ItemType;
|
import com.sk89q.worldedit.world.item.ItemType;
|
||||||
@ -120,6 +121,9 @@ public class BukkitPlayer extends PlotPlayer<Player> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canTeleport(final @NonNull Location location) {
|
public boolean canTeleport(final @NonNull Location location) {
|
||||||
|
if (!WorldUtil.isValidLocation(location)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
final org.bukkit.Location to = BukkitUtil.adapt(location);
|
final org.bukkit.Location to = BukkitUtil.adapt(location);
|
||||||
final org.bukkit.Location from = player.getLocation();
|
final org.bukkit.Location from = player.getLocation();
|
||||||
PlayerTeleportEvent event = new PlayerTeleportEvent(player, from, to);
|
PlayerTeleportEvent event = new PlayerTeleportEvent(player, from, to);
|
||||||
@ -221,7 +225,7 @@ public class BukkitPlayer extends PlotPlayer<Player> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void teleport(final @NonNull Location location, final @NonNull TeleportCause cause) {
|
public void teleport(final @NonNull Location location, final @NonNull TeleportCause cause) {
|
||||||
if (Math.abs(location.getX()) >= 30000000 || Math.abs(location.getZ()) >= 30000000) {
|
if (!WorldUtil.isValidLocation(location)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final org.bukkit.Location bukkitLocation =
|
final org.bukkit.Location bukkitLocation =
|
||||||
|
@ -20,7 +20,6 @@ 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;
|
||||||
@ -202,7 +201,6 @@ 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()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
|
@ -268,6 +268,7 @@ public class MainCommand extends Command {
|
|||||||
tp = true;
|
tp = true;
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(TranslatableCaption.of("border.denied"));
|
player.sendMessage(TranslatableCaption.of("border.denied"));
|
||||||
|
return CompletableFuture.completedFuture(false);
|
||||||
}
|
}
|
||||||
// Trim command
|
// Trim command
|
||||||
args = Arrays.copyOfRange(args, 1, args.length);
|
args = Arrays.copyOfRange(args, 1, args.length);
|
||||||
|
@ -723,6 +723,12 @@ public class Settings extends Config {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Comment("Settings related to flags")
|
||||||
|
public static final class Flags {
|
||||||
|
|
||||||
|
@Comment("If \"instabreak\" should consider the used tool.")
|
||||||
|
public static boolean INSTABREAK_CONSIDER_TOOL = false;
|
||||||
|
}
|
||||||
|
|
||||||
@Comment({"Enable or disable parts of the plugin",
|
@Comment({"Enable or disable parts of the plugin",
|
||||||
"Note: A cache will use some memory if enabled"})
|
"Note: A cache will use some memory if enabled"})
|
||||||
|
@ -2574,6 +2574,12 @@ public class Plot {
|
|||||||
*/
|
*/
|
||||||
public void teleportPlayer(final PlotPlayer<?> player, TeleportCause cause, Consumer<Boolean> resultConsumer) {
|
public void teleportPlayer(final PlotPlayer<?> player, TeleportCause cause, Consumer<Boolean> resultConsumer) {
|
||||||
Plot plot = this.getBasePlot(false);
|
Plot plot = this.getBasePlot(false);
|
||||||
|
if (!WorldUtil.isValidLocation(plot.getBottomAbs())) {
|
||||||
|
// prevent from teleporting into unsafe regions
|
||||||
|
player.sendMessage(TranslatableCaption.of("border.denied"));
|
||||||
|
resultConsumer.accept(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
PlayerTeleportToPlotEvent event = this.eventDispatcher.callTeleport(player, player.getLocation(), plot, cause);
|
PlayerTeleportToPlotEvent event = this.eventDispatcher.callTeleport(player, player.getLocation(), plot, cause);
|
||||||
if (event.getEventResult() == Result.DENY) {
|
if (event.getEventResult() == Result.DENY) {
|
||||||
|
@ -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 TODO
|
* @since 7.3.4
|
||||||
*/
|
*/
|
||||||
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 TODO
|
* @since 7.3.4
|
||||||
*/
|
*/
|
||||||
public int getMinComponentHeight() {
|
public int getMinComponentHeight() {
|
||||||
return this.minBuildHeight;
|
return this.minBuildHeight;
|
||||||
|
@ -48,6 +48,7 @@ import com.plotsquared.core.plot.flag.implementations.EntityChangeBlockFlag;
|
|||||||
import com.plotsquared.core.plot.flag.implementations.ExplosionFlag;
|
import com.plotsquared.core.plot.flag.implementations.ExplosionFlag;
|
||||||
import com.plotsquared.core.plot.flag.implementations.FarewellFlag;
|
import com.plotsquared.core.plot.flag.implementations.FarewellFlag;
|
||||||
import com.plotsquared.core.plot.flag.implementations.FeedFlag;
|
import com.plotsquared.core.plot.flag.implementations.FeedFlag;
|
||||||
|
import com.plotsquared.core.plot.flag.implementations.FishingFlag;
|
||||||
import com.plotsquared.core.plot.flag.implementations.FlyFlag;
|
import com.plotsquared.core.plot.flag.implementations.FlyFlag;
|
||||||
import com.plotsquared.core.plot.flag.implementations.ForcefieldFlag;
|
import com.plotsquared.core.plot.flag.implementations.ForcefieldFlag;
|
||||||
import com.plotsquared.core.plot.flag.implementations.GamemodeFlag;
|
import com.plotsquared.core.plot.flag.implementations.GamemodeFlag;
|
||||||
@ -158,6 +159,7 @@ public final class GlobalFlagContainer extends FlagContainer {
|
|||||||
this.addFlag(EditSignFlag.EDIT_SIGN_FALSE);
|
this.addFlag(EditSignFlag.EDIT_SIGN_FALSE);
|
||||||
this.addFlag(EntityChangeBlockFlag.ENTITY_CHANGE_BLOCK_FALSE);
|
this.addFlag(EntityChangeBlockFlag.ENTITY_CHANGE_BLOCK_FALSE);
|
||||||
this.addFlag(ExplosionFlag.EXPLOSION_FALSE);
|
this.addFlag(ExplosionFlag.EXPLOSION_FALSE);
|
||||||
|
this.addFlag(FishingFlag.FISHING_FALSE);
|
||||||
this.addFlag(ForcefieldFlag.FORCEFIELD_FALSE);
|
this.addFlag(ForcefieldFlag.FORCEFIELD_FALSE);
|
||||||
this.addFlag(GrassGrowFlag.GRASS_GROW_TRUE);
|
this.addFlag(GrassGrowFlag.GRASS_GROW_TRUE);
|
||||||
this.addFlag(HangingBreakFlag.HANGING_BREAK_FALSE);
|
this.addFlag(HangingBreakFlag.HANGING_BREAK_FALSE);
|
||||||
|
@ -0,0 +1,39 @@
|
|||||||
|
/*
|
||||||
|
* PlotSquared, a land and world management plugin for Minecraft.
|
||||||
|
* Copyright (C) IntellectualSites <https://intellectualsites.com>
|
||||||
|
* Copyright (C) IntellectualSites team and contributors
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
|
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||||
|
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||||
|
|
||||||
|
public class FishingFlag extends BooleanFlag<FishingFlag> {
|
||||||
|
|
||||||
|
public static final FishingFlag FISHING_TRUE = new FishingFlag(true);
|
||||||
|
public static final FishingFlag FISHING_FALSE = new FishingFlag(false);
|
||||||
|
|
||||||
|
private FishingFlag(boolean value) {
|
||||||
|
super(value, TranslatableCaption.of("flags.flag_description_fishing"));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected FishingFlag flagOf(@NonNull final Boolean value) {
|
||||||
|
return value ? FISHING_TRUE : FISHING_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -551,6 +551,7 @@ public class EventDispatcher {
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
default -> {
|
default -> {
|
||||||
}
|
}
|
||||||
|
@ -62,6 +62,15 @@ import java.util.zip.ZipOutputStream;
|
|||||||
|
|
||||||
public abstract class WorldUtil {
|
public abstract class WorldUtil {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@return whether the given location is valid in the world}
|
||||||
|
* @param location the location to check
|
||||||
|
* @since 7.3.6
|
||||||
|
*/
|
||||||
|
public static boolean isValidLocation(Location location) {
|
||||||
|
return Math.abs(location.getX()) < 30000000 && Math.abs(location.getZ()) < 30000000;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the biome in a region
|
* Set the biome in a region
|
||||||
*
|
*
|
||||||
|
@ -31,9 +31,11 @@ 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;
|
||||||
@ -95,6 +97,12 @@ 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()) {
|
||||||
|
@ -559,6 +559,7 @@
|
|||||||
"flags.flag_description_drop_protection": "<gray>Set to `true` to prevent dropped items from being picked up by non-members of the plot.</gray>",
|
"flags.flag_description_drop_protection": "<gray>Set to `true` to prevent dropped items from being picked up by non-members of the plot.</gray>",
|
||||||
"flags.flag_description_edit_sign": "<gray>Set to `true` to allow editing signs in the plot.</gray>",
|
"flags.flag_description_edit_sign": "<gray>Set to `true` to allow editing signs in the plot.</gray>",
|
||||||
"flags.flag_description_feed": "<gray>Specify an interval in seconds and an optional amount by which the players will be fed (amount is 1 by default).</gray>",
|
"flags.flag_description_feed": "<gray>Specify an interval in seconds and an optional amount by which the players will be fed (amount is 1 by default).</gray>",
|
||||||
|
"flags.flag_description_fishing": "<gray>Set to `true` to allow guests to use a fishing rod in the plot.</gray>",
|
||||||
"flags.flag_description_forcefield": "<gray>Set to `true` to enable member forcefield in the plot.</gray>",
|
"flags.flag_description_forcefield": "<gray>Set to `true` to enable member forcefield in the plot.</gray>",
|
||||||
"flags.flag_description_grass_grow": "<gray>Set to `false` to prevent grass from growing within the plot.</gray>",
|
"flags.flag_description_grass_grow": "<gray>Set to `false` to prevent grass from growing within the plot.</gray>",
|
||||||
"flags.flag_description_hanging_break": "<gray>Set to `true` to allow guests to break hanging objects in the plot.</gray>",
|
"flags.flag_description_hanging_break": "<gray>Set to `true` to allow guests to break hanging objects in the plot.</gray>",
|
||||||
|
@ -22,7 +22,7 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group = "com.intellectualsites.plotsquared"
|
group = "com.intellectualsites.plotsquared"
|
||||||
version = "7.3.4-SNAPSHOT"
|
version = "7.3.7-SNAPSHOT"
|
||||||
|
|
||||||
if (!File("$rootDir/.git").exists()) {
|
if (!File("$rootDir/.git").exists()) {
|
||||||
logger.lifecycle("""
|
logger.lifecycle("""
|
||||||
@ -225,7 +225,7 @@ tasks.getByName<Jar>("jar") {
|
|||||||
enabled = false
|
enabled = false
|
||||||
}
|
}
|
||||||
|
|
||||||
val supportedVersions = listOf("1.16.5", "1.17.1", "1.18.2", "1.19.4", "1.20.1", "1.20.4")
|
val supportedVersions = listOf("1.18.2", "1.19.4", "1.20.1", "1.20.4")
|
||||||
tasks {
|
tasks {
|
||||||
register("cacheLatestFaweArtifact") {
|
register("cacheLatestFaweArtifact") {
|
||||||
val lastSuccessfulBuildUrl = uri("https://ci.athion.net/job/FastAsyncWorldEdit/lastSuccessfulBuild/api/json").toURL()
|
val lastSuccessfulBuildUrl = uri("https://ci.athion.net/job/FastAsyncWorldEdit/lastSuccessfulBuild/api/json").toURL()
|
||||||
|
@ -7,13 +7,13 @@ checkerqual = "3.42.0"
|
|||||||
gson = "2.10"
|
gson = "2.10"
|
||||||
guava = "31.1-jre"
|
guava = "31.1-jre"
|
||||||
snakeyaml = "2.0"
|
snakeyaml = "2.0"
|
||||||
adventure = "4.15.0"
|
adventure = "4.16.0"
|
||||||
adventure-bukkit = "4.3.2"
|
adventure-bukkit = "4.3.2"
|
||||||
log4j = "2.19.0"
|
log4j = "2.19.0"
|
||||||
|
|
||||||
# Plugins
|
# Plugins
|
||||||
worldedit = "7.2.18"
|
worldedit = "7.2.20"
|
||||||
fawe = "2.8.4"
|
fawe = "2.9.1"
|
||||||
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