mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-07-17 21:04:42 +02:00
Compare commits
1 Commits
feature/en
...
fix/v7/ref
Author | SHA1 | Date | |
---|---|---|---|
21a94104be |
2
.github/renovate.json
vendored
2
.github/renovate.json
vendored
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||||
"extends": [
|
"extends": [
|
||||||
"config:recommended",
|
"config:base",
|
||||||
":semanticCommitsDisabled"
|
":semanticCommitsDisabled"
|
||||||
],
|
],
|
||||||
"automerge": true,
|
"automerge": true,
|
||||||
|
@ -47,7 +47,6 @@ import com.plotsquared.core.plot.flag.implementations.TileDropFlag;
|
|||||||
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;
|
||||||
import com.plotsquared.core.util.PlotFlagUtil;
|
import com.plotsquared.core.util.PlotFlagUtil;
|
||||||
import io.papermc.paper.event.entity.EntityMoveEvent;
|
|
||||||
import net.kyori.adventure.text.Component;
|
import net.kyori.adventure.text.Component;
|
||||||
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;
|
||||||
@ -59,7 +58,6 @@ import org.bukkit.entity.EntityType;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.entity.Projectile;
|
import org.bukkit.entity.Projectile;
|
||||||
import org.bukkit.entity.Slime;
|
import org.bukkit.entity.Slime;
|
||||||
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;
|
||||||
@ -106,38 +104,8 @@ public class PaperListener implements Listener {
|
|||||||
if (!Settings.Paper_Components.ENTITY_PATHING) {
|
if (!Settings.Paper_Components.ENTITY_PATHING) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
handleEntityMovement(event, event.getEntity().getLocation(), event.getLoc());
|
Location toLoc = BukkitUtil.adapt(event.getLoc());
|
||||||
}
|
Location fromLoc = BukkitUtil.adapt(event.getEntity().getLocation());
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void onEntityPathfind(SlimePathfindEvent event) {
|
|
||||||
if (!Settings.Paper_Components.ENTITY_PATHING) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Slime slime = event.getEntity();
|
|
||||||
|
|
||||||
Block b = slime.getTargetBlockExact(4);
|
|
||||||
if (b == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
handleEntityMovement(event, event.getEntity().getLocation(), b.getLocation());
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void onEntityMove(EntityMoveEvent event) {
|
|
||||||
if (!Settings.Paper_Components.ENTITY_MOVEMENT) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!event.hasExplicitlyChangedBlock()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
handleEntityMovement(event, event.getFrom(), event.getTo());
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void handleEntityMovement(Cancellable event, org.bukkit.Location from, org.bukkit.Location target) {
|
|
||||||
Location toLoc = BukkitUtil.adapt(target);
|
|
||||||
Location fromLoc = BukkitUtil.adapt(from);
|
|
||||||
PlotArea tarea = toLoc.getPlotArea();
|
PlotArea tarea = toLoc.getPlotArea();
|
||||||
if (tarea == null) {
|
if (tarea == null) {
|
||||||
return;
|
return;
|
||||||
@ -156,10 +124,52 @@ public class PaperListener implements Listener {
|
|||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (tplot == null || tplot.getId().equals(fplot.getId())) {
|
if (tplot == null || tplot.getId().hashCode() == fplot.getId().hashCode()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (fplot.isMerged() && fplot.getConnectedPlots().contains(tplot)) {
|
if (fplot.isMerged() && fplot.getConnectedPlots().contains(fplot)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onEntityPathfind(SlimePathfindEvent event) {
|
||||||
|
if (!Settings.Paper_Components.ENTITY_PATHING) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Slime slime = event.getEntity();
|
||||||
|
|
||||||
|
Block b = slime.getTargetBlockExact(4);
|
||||||
|
if (b == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Location toLoc = BukkitUtil.adapt(b.getLocation());
|
||||||
|
Location fromLoc = BukkitUtil.adapt(event.getEntity().getLocation());
|
||||||
|
PlotArea tarea = toLoc.getPlotArea();
|
||||||
|
if (tarea == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
PlotArea farea = fromLoc.getPlotArea();
|
||||||
|
if (farea == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tarea != farea) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Plot tplot = toLoc.getPlot();
|
||||||
|
Plot fplot = fromLoc.getPlot();
|
||||||
|
if (tplot == null ^ fplot == null) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (tplot == null || tplot.getId().hashCode() == fplot.getId().hashCode()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (fplot.isMerged() && fplot.getConnectedPlots().contains(fplot)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
@ -56,8 +56,7 @@ public class Music extends SubCommand {
|
|||||||
.asList("music_disc_13", "music_disc_cat", "music_disc_blocks", "music_disc_chirp",
|
.asList("music_disc_13", "music_disc_cat", "music_disc_blocks", "music_disc_chirp",
|
||||||
"music_disc_far", "music_disc_mall", "music_disc_mellohi", "music_disc_stal",
|
"music_disc_far", "music_disc_mall", "music_disc_mellohi", "music_disc_stal",
|
||||||
"music_disc_strad", "music_disc_ward", "music_disc_11", "music_disc_wait", "music_disc_otherside",
|
"music_disc_strad", "music_disc_ward", "music_disc_11", "music_disc_wait", "music_disc_otherside",
|
||||||
"music_disc_pigstep", "music_disc_5", "music_disc_relic", "music_disc_creator",
|
"music_disc_pigstep", "music_disc_5", "music_disc_relic"
|
||||||
"music_disc_creator_music_box", "music_disc_precipice"
|
|
||||||
);
|
);
|
||||||
|
|
||||||
private final InventoryUtil inventoryUtil;
|
private final InventoryUtil inventoryUtil;
|
||||||
|
@ -26,7 +26,6 @@ import org.apache.logging.log4j.Logger;
|
|||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
import java.lang.annotation.Documented;
|
|
||||||
import java.lang.annotation.ElementType;
|
import java.lang.annotation.ElementType;
|
||||||
import java.lang.annotation.Retention;
|
import java.lang.annotation.Retention;
|
||||||
import java.lang.annotation.RetentionPolicy;
|
import java.lang.annotation.RetentionPolicy;
|
||||||
@ -373,7 +372,6 @@ public class Config {
|
|||||||
*/
|
*/
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
@Target({ElementType.FIELD, ElementType.TYPE})
|
@Target({ElementType.FIELD, ElementType.TYPE})
|
||||||
@Documented
|
|
||||||
public @interface Comment {
|
public @interface Comment {
|
||||||
|
|
||||||
String[] value();
|
String[] value();
|
||||||
|
@ -651,8 +651,6 @@ public class Settings extends Config {
|
|||||||
public static boolean PAPER_LISTENERS = true;
|
public static boolean PAPER_LISTENERS = true;
|
||||||
@Comment("Prevent entities from leaving plots")
|
@Comment("Prevent entities from leaving plots")
|
||||||
public static boolean ENTITY_PATHING = true;
|
public static boolean ENTITY_PATHING = true;
|
||||||
@Comment("Prevent entities from leaving plots, even by pushing or pulling")
|
|
||||||
public static boolean ENTITY_MOVEMENT = false;
|
|
||||||
@Comment(
|
@Comment(
|
||||||
"Cancel entity spawns when the chunk is loaded if the PlotArea's mob spawning is off")
|
"Cancel entity spawns when the chunk is loaded if the PlotArea's mob spawning is off")
|
||||||
public static boolean CANCEL_CHUNK_SPAWN = true;
|
public static boolean CANCEL_CHUNK_SPAWN = true;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
paper = "1.20.4-R0.1-SNAPSHOT"
|
paper = "1.20.4-R0.1-SNAPSHOT"
|
||||||
guice = "7.0.0"
|
guice = "7.0.0"
|
||||||
spotbugs = "4.8.6"
|
spotbugs = "4.8.6"
|
||||||
checkerqual = "3.48.3"
|
checkerqual = "3.48.2"
|
||||||
gson = "2.10"
|
gson = "2.10"
|
||||||
guava = "31.1-jre"
|
guava = "31.1-jre"
|
||||||
snakeyaml = "2.0"
|
snakeyaml = "2.0"
|
||||||
@ -13,7 +13,7 @@ log4j = "2.19.0"
|
|||||||
|
|
||||||
# Plugins
|
# Plugins
|
||||||
worldedit = "7.2.20"
|
worldedit = "7.2.20"
|
||||||
fawe = "2.12.2"
|
fawe = "2.12.1"
|
||||||
placeholderapi = "2.11.6"
|
placeholderapi = "2.11.6"
|
||||||
luckperms = "5.4"
|
luckperms = "5.4"
|
||||||
essentialsx = "2.20.1"
|
essentialsx = "2.20.1"
|
||||||
|
Reference in New Issue
Block a user