Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fd7baf3dc0 | |||
| c55c406929 | |||
| a982d14ac8 | |||
| 084510873b | |||
| a9d9fedb1f | |||
| c6bde6e962 | |||
| 3c48a2b5e8 | |||
| 905a21787a |
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>com.trafalcraft.antiRedstoneClock</groupId>
|
||||
<artifactId>AntiRedstoneClock-Reborn</artifactId>
|
||||
<version>2.0</version>
|
||||
<version>2.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>DIST</artifactId>
|
||||
|
||||
BIN
DIST/target/AntiRedstoneClock-Reborn.jar
Normal file
BIN
DIST/target/AntiRedstoneClock-Reborn.jar
Normal file
Binary file not shown.
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<artifactId>AntiRedstoneClock-Reborn</artifactId>
|
||||
<groupId>com.trafalcraft.antiRedstoneClock</groupId>
|
||||
<version>2.0</version>
|
||||
<version>2.1</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>MAIN</artifactId>
|
||||
@@ -21,13 +21,21 @@
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<version>3.6.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<relocations>
|
||||
<relocation>
|
||||
<pattern>org.bstats</pattern>
|
||||
<shadedPattern>com.trafalcraft.anti_redstone_clock.libs.bstats</shadedPattern>
|
||||
</relocation>
|
||||
</relocations>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
@@ -52,129 +60,35 @@
|
||||
</repository>
|
||||
</repositories>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.sk89q.worldguard</groupId>
|
||||
<artifactId>worldguard-bukkit</artifactId>
|
||||
<version>7.0.15</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.plotsquared</groupId>
|
||||
<artifactId>plotsquared-bukkit</artifactId>
|
||||
<version>7.5.12</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot-api</artifactId>
|
||||
<version>1.21.4-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>guava</artifactId>
|
||||
<groupId>com.google.guava</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>gson</artifactId>
|
||||
<groupId>com.google.code.gson</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>joml</artifactId>
|
||||
<groupId>org.joml</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>bungeecord-chat</artifactId>
|
||||
<groupId>net.md-5</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>snakeyaml</artifactId>
|
||||
<groupId>org.yaml</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sk89q.worldguard</groupId>
|
||||
<artifactId>worldguard-bukkit</artifactId>
|
||||
<version>7.0.14</version>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>worldguard-core</artifactId>
|
||||
<groupId>com.sk89q.worldguard</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>worldedit-bukkit</artifactId>
|
||||
<groupId>com.sk89q.worldedit</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>paperlib</artifactId>
|
||||
<groupId>io.papermc</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.intellectualsites.plotsquared</groupId>
|
||||
<artifactId>plotsquared-bukkit</artifactId>
|
||||
<version>7.5.6</version>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>plotsquared-core</artifactId>
|
||||
<groupId>com.intellectualsites.plotsquared</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>squirrelid</artifactId>
|
||||
<groupId>org.enginehub</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>ServerLib</artifactId>
|
||||
<groupId>dev.notmyfault.serverlib</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>Arkitektonika-Client</artifactId>
|
||||
<groupId>com.intellectualsites.arkitektonika</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>Paster</artifactId>
|
||||
<groupId>com.intellectualsites.paster</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>informative-annotations</artifactId>
|
||||
<groupId>com.intellectualsites.informative-annotations</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>paperlib</artifactId>
|
||||
<groupId>io.papermc</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.kyori</groupId>
|
||||
<artifactId>adventure-platform-bukkit</artifactId>
|
||||
<version>4.4.1</version>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>adventure-platform-api</artifactId>
|
||||
<groupId>net.kyori</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>adventure-text-serializer-bungeecord</artifactId>
|
||||
<groupId>net.kyori</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>adventure-text-serializer-legacy</artifactId>
|
||||
<groupId>net.kyori</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>adventure-nbt</artifactId>
|
||||
<groupId>net.kyori</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>adventure-text-serializer-gson</artifactId>
|
||||
<groupId>net.kyori</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>adventure-text-serializer-gson-legacy-impl</artifactId>
|
||||
<groupId>net.kyori</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>adventure-platform-facet</artifactId>
|
||||
<groupId>net.kyori</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>adventure-platform-viaversion</artifactId>
|
||||
<groupId>net.kyori</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<properties>
|
||||
@@ -184,4 +98,3 @@
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
</project>
|
||||
|
||||
|
||||
88
MAIN/pom.xml
88
MAIN/pom.xml
@@ -1,11 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>com.trafalcraft.antiRedstoneClock</groupId>
|
||||
<artifactId>AntiRedstoneClock-Reborn</artifactId>
|
||||
<version>2.0</version>
|
||||
<version>2.1</version>
|
||||
</parent>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
@@ -32,8 +34,8 @@
|
||||
<url>https://maven.enginehub.org/repo/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>plotsquared</id>
|
||||
<url>https://plotsquared.com/mvn/</url>
|
||||
<id>plotsquared</id>
|
||||
<url>https://plotsquared.com/mvn/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
@@ -41,36 +43,56 @@
|
||||
<dependency>
|
||||
<groupId>org.bstats</groupId>
|
||||
<artifactId>bstats-bukkit</artifactId>
|
||||
<version>2.2.1</version>
|
||||
<version>3.0.2</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sk89q.worldguard</groupId>
|
||||
<artifactId>worldguard-bukkit</artifactId>
|
||||
<version>7.0.15</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.plotsquared</groupId>
|
||||
<artifactId>plotsquared-bukkit</artifactId>
|
||||
<version>7.5.12</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<sourceDirectory>${project.basedir}/src/main/java</sourceDirectory>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>${project.basedir}/src/main/resources</directory>
|
||||
<includes>
|
||||
<include>plugin.yml</include>
|
||||
<include>config.yml</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<build>
|
||||
<sourceDirectory>${project.basedir}/src/main/java</sourceDirectory>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>${project.basedir}/src/main/resources</directory>
|
||||
<includes>
|
||||
<include>plugin.yml</include>
|
||||
<include>config.yml</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>3.6.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<relocations>
|
||||
<relocation>
|
||||
<pattern>org.bstats</pattern>
|
||||
<shadedPattern>com.trafalcraft.anti_redstone_clock.libs.bstats</shadedPattern>
|
||||
</relocation>
|
||||
</relocations>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
||||
@@ -65,6 +65,9 @@ public class Main extends JavaPlugin {
|
||||
public void onEnable() {
|
||||
long startTime = System.currentTimeMillis();
|
||||
|
||||
// Registriere eigenen Teleport-Command
|
||||
this.getCommand("arc_tp").setExecutor(new com.trafalcraft.anti_redstone_clock.commands.ArcTpCommand());
|
||||
|
||||
if (instance.getConfig().getBoolean("metrics")) {
|
||||
this.getLogger().info("Enabling Metrics");
|
||||
try {
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.trafalcraft.anti_redstone_clock.commands;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class ArcTpCommand implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (!(sender instanceof Player)) {
|
||||
sender.sendMessage("Nur Spieler können diesen Befehl nutzen.");
|
||||
return true;
|
||||
}
|
||||
if (args.length < 4) {
|
||||
sender.sendMessage("Verwendung: /arc_tp <x> <y> <z> <world>");
|
||||
return true;
|
||||
}
|
||||
Player player = (Player) sender;
|
||||
try {
|
||||
double x = Double.parseDouble(args[0]);
|
||||
double y = Double.parseDouble(args[1]);
|
||||
double z = Double.parseDouble(args[2]);
|
||||
World world = Bukkit.getWorld(args[3]);
|
||||
if (world == null) {
|
||||
player.sendMessage("Welt nicht gefunden: " + args[3]);
|
||||
return true;
|
||||
}
|
||||
Location loc = new Location(world, x, y, z);
|
||||
player.teleport(loc);
|
||||
player.sendMessage("§aTeleportiert zu: " + x + ", " + y + ", " + z + " in Welt " + world.getName());
|
||||
} catch (NumberFormatException e) {
|
||||
player.sendMessage("Ungültige Koordinaten!");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,7 @@ import net.md_5.bungee.api.chat.TextComponent;
|
||||
import net.md_5.bungee.api.chat.hover.content.Text;
|
||||
|
||||
public class CheckList {
|
||||
|
||||
private static final CheckList ourInstance = new CheckList();
|
||||
|
||||
public static CheckList getInstance() {
|
||||
@@ -31,48 +32,51 @@ public class CheckList {
|
||||
if (args.length > 1) {
|
||||
page = Integer.parseInt(args[1]);
|
||||
if (page == -1) {
|
||||
sender.sendMessage("§2TPS is " + CheckTPS.isTpsOK() + " §4TPS:" + CheckTPS.getTPS()
|
||||
+ " §emin" + Main.getInstance().getConfig().getInt("checkTPS.minimumTPS")
|
||||
+ " §amax" + Main.getInstance().getConfig().getInt("checkTPS.maximumTPS"));
|
||||
sender.sendMessage("§2TPS is " + CheckTPS.isTpsOK() + " §4TPS:" + CheckTPS.getTPS()
|
||||
+ " §emin" + Main.getInstance().getConfig().getInt("checkTPS.minimumTPS")
|
||||
+ " §amax" + Main.getInstance().getConfig().getInt("checkTPS.maximumTPS"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Collection<Location> allLocation = RedstoneClockController.getAllLoc();
|
||||
int totalPage = (int) Math.ceil(allLocation.size() / 5.0);
|
||||
sender.sendMessage(Msg.RED_STONE_CLOCK_LIST_HEADER.toString().replace("$page",
|
||||
"(" + page + "/" + totalPage + ")"));
|
||||
|
||||
int i = 1;
|
||||
int minElements = 5 * (page - 1);
|
||||
int maxElements = 5 * page;
|
||||
String teleportCMD = Main.getInstance().getConfig().getString("teleportCMD", "tp $x $y $z");
|
||||
String teleportCMD = Main.getInstance().getConfig().getString("teleportCMD", "teleport $x $y $z");
|
||||
|
||||
int maxPulses = Main.getInstance().getConfig().getInt("MaxPulses");
|
||||
|
||||
for (Location loc : allLocation) {
|
||||
if (i > minElements && i <= maxElements) {
|
||||
int clock = RedstoneClockController.getRedstoneClock(loc).getNumberOfClock();
|
||||
String color = "§2"; //Dark_Green
|
||||
String color = "§2"; // Dark_Green
|
||||
if (clock > maxPulses * 0.75) {
|
||||
color = "§4"; //Dark_Red
|
||||
color = "§4"; // Dark_Red
|
||||
} else if (clock > maxPulses * 0.5) {
|
||||
color = "§e"; //yellow
|
||||
color = "§e"; // yellow
|
||||
} else if (clock > maxPulses * 0.250) {
|
||||
color = "§a"; // green
|
||||
color = "§a"; // green
|
||||
}
|
||||
TextComponent textComponent = new TextComponent(color + "RedStoneClock> §fWorld:" + loc.getWorld().getName()
|
||||
+ ",X:" + loc.getX()
|
||||
+ ",Y:" + loc.getY()
|
||||
+ ",Z:" + loc.getZ()
|
||||
+ " b:" + clock + "/" + maxPulses);
|
||||
textComponent.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/" + teleportCMD
|
||||
.replace("$x", String.format("%.0f", loc.getX()))
|
||||
.replace("$y", String.format("%.0f", loc.getY()))
|
||||
.replace("$z", String.format("%.0f", loc.getZ()))
|
||||
.replace("$world", loc.getWorld().getName())
|
||||
.replace("$player", sender.getName())));
|
||||
textComponent.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/arc_tp "
|
||||
+ String.format("%.0f", loc.getX()) + " "
|
||||
+ String.format("%.0f", loc.getY()) + " "
|
||||
+ String.format("%.0f", loc.getZ()) + " "
|
||||
+ loc.getWorld().getName()));
|
||||
textComponent.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT,
|
||||
new Text("Click to teleport you to the redstoneclock")));
|
||||
sendFormatedMessageToPlayer(sender, textComponent);
|
||||
}
|
||||
i++;
|
||||
i++;
|
||||
}
|
||||
sender.sendMessage(Msg.RED_STONE_CLOCK_LIST_FOOTER.toString());
|
||||
} catch (NumberFormatException e) {
|
||||
|
||||
@@ -70,18 +70,15 @@ class Util {
|
||||
for (Player p : Bukkit.getOnlinePlayers()) {
|
||||
if (p.isOp() || p.hasPermission("antiRedstoneClock.NotifyAdmin")) {
|
||||
TextComponent textComponent = getFormatedStringForMsgToAdmin(block);
|
||||
String teleportCMD = Main.getInstance().getConfig().getString("teleportCMD", "tp $x $y $z");
|
||||
textComponent.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/" + teleportCMD
|
||||
.replace("$x", Integer.toString(block.getX()))
|
||||
.replace("$y", Integer.toString(block.getY()))
|
||||
.replace("$z", Integer.toString(block.getZ()))
|
||||
.replace("$world", block.getWorld().getName())
|
||||
.replace("$player", p.getName())));
|
||||
textComponent.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/arc_tp "
|
||||
+ block.getX() + " "
|
||||
+ block.getY() + " "
|
||||
+ block.getZ() + " "
|
||||
+ block.getWorld().getName()));
|
||||
sendFormatedMessageToPlayer(p, textComponent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,9 +122,9 @@ class Util {
|
||||
sign.setLine(3, Main.getInstance().getConfig().getString("Sign.Line4").replace("&", "§"));
|
||||
sign.update(false, false);
|
||||
} catch (ClassCastException error) {
|
||||
Bukkit.getLogger().warning(Msg.PREFIX + "No valid sign found for this minecraft version!!!"
|
||||
+"\nplease disable CreateSignWhenClockIsBreak in config file"
|
||||
+"\nMore infos: " + block.getType());
|
||||
Bukkit.getLogger().warning(Msg.PREFIX + "Kein gültiges Schild für diese Minecraft-Version gefunden!!!"
|
||||
+ "\nBitte deaktivieren Sie CreateSignWhenClockIsBreak in der Config-Datei"
|
||||
+ "\nMehr Infos: " + block.getType());
|
||||
}
|
||||
block.getDrops().clear();
|
||||
}
|
||||
@@ -139,7 +136,7 @@ class Util {
|
||||
.replace("$Z", block.getZ() + "")
|
||||
.replace("$World", block.getWorld().getName()));
|
||||
textComponent.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT,
|
||||
new Text("Click to teleport you to the redstoneclock")));
|
||||
new Text("Klicke, um dich zur RedstoneClock zu teleportieren")));
|
||||
return textComponent;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.trafalcraft.anti_redstone_clock.util.plotSquared;
|
||||
|
||||
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.Location;
|
||||
import com.plotsquared.core.PlotAPI;
|
||||
import com.plotsquared.core.plot.Plot;
|
||||
import com.plotsquared.bukkit.util.BukkitUtil;
|
||||
|
||||
public class PlotSquared_7 implements IPlotSquared {
|
||||
private PlotAPI api;
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
api = new PlotAPI();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAllowedPlot(Location location) {
|
||||
if (api == null) api = new PlotAPI();
|
||||
if (location == null || location.getWorld() == null) return false;
|
||||
com.plotsquared.core.location.Location plotLoc = BukkitUtil.adapt(location);
|
||||
if (plotLoc == null) return false;
|
||||
com.plotsquared.core.plot.PlotArea area = plotLoc.getPlotArea();
|
||||
if (area == null) return false;
|
||||
com.plotsquared.core.plot.Plot plot = area.getPlot(plotLoc);
|
||||
if (plot == null) return false;
|
||||
// Prüfe das redstone-Setting per Reflection
|
||||
try {
|
||||
if (plot.getSettings() != null) {
|
||||
Object settings = plot.getSettings();
|
||||
java.lang.reflect.Method m = settings.getClass().getMethod("isRedstone");
|
||||
Object result = m.invoke(settings);
|
||||
if (result instanceof Boolean && !((Boolean) result)) {
|
||||
return false; // Redstone ist auf diesem Plot verboten
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// Wenn Setting nicht abfragbar, Redstone erlauben
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVersion() {
|
||||
return "7.x";
|
||||
}
|
||||
}
|
||||
@@ -31,9 +31,10 @@ public class VersionPlotSquared {
|
||||
}
|
||||
String plotSquaredVersion = plugin.getDescription().getVersion().split("\\.")[0];
|
||||
try {
|
||||
String className = "com.trafalcraft.anti_redstone_clock.util.plotSquared.PlotSquared_" + plotSquaredVersion;
|
||||
ClassLoader classLoader = Main.class.getClassLoader();
|
||||
classLoader.loadClass("com.trafalcraft.antiRedstoneClock.util.plotSquared.PlotSquared_" + plotSquaredVersion);
|
||||
Class<?> aClass = Class.forName("com.trafalcraft.antiRedstoneClock.util.plotSquared.PlotSquared_" + plotSquaredVersion);
|
||||
classLoader.loadClass(className);
|
||||
Class<?> aClass = Class.forName(className);
|
||||
plotSquared = (IPlotSquared) aClass.getDeclaredConstructors()[0].newInstance();
|
||||
} catch (Exception e) {
|
||||
Main.getInstance().getLogger().warning("PlotSquared " + plotSquaredVersion + " is not supported");
|
||||
|
||||
@@ -31,9 +31,11 @@ public class VersionWG {
|
||||
}
|
||||
String wgVersion = plugin.getDescription().getVersion().split("\\.")[0];
|
||||
try {
|
||||
String basePackage = this.getClass().getPackage().getName();
|
||||
String className = basePackage + ".WorldGuard_" + wgVersion;
|
||||
ClassLoader classLoader = Main.class.getClassLoader();
|
||||
classLoader.loadClass("com.trafalcraft.antiRedstoneClock.util.worldGuard.WorldGuard_" + wgVersion);
|
||||
Class<?> aClass = Class.forName("com.trafalcraft.antiRedstoneClock.util.worldGuard.WorldGuard_" + wgVersion);
|
||||
classLoader.loadClass(className);
|
||||
Class<?> aClass = Class.forName(className);
|
||||
worldGuard = (IWorldGuard) aClass.getDeclaredConstructors()[0].newInstance();
|
||||
} catch (Exception e) {
|
||||
Main.getInstance().getLogger().warning("WorldGuard " + wgVersion + " is not supported");
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.trafalcraft.anti_redstone_clock.util.worldGuard;
|
||||
|
||||
|
||||
import com.sk89q.worldedit.bukkit.BukkitAdapter;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldguard.WorldGuard;
|
||||
import com.sk89q.worldguard.protection.ApplicableRegionSet;
|
||||
import com.sk89q.worldguard.protection.flags.Flag;
|
||||
import com.sk89q.worldguard.protection.flags.StateFlag;
|
||||
import com.sk89q.worldguard.protection.flags.registry.FlagRegistry;
|
||||
import com.sk89q.worldguard.protection.managers.RegionManager;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
|
||||
public class WorldGuard_7 implements IWorldGuard {
|
||||
@Override
|
||||
public boolean isAllowedRegion(Location loc) {
|
||||
World world = loc.getWorld();
|
||||
if (world == null) return false;
|
||||
com.sk89q.worldguard.protection.regions.RegionContainer container = WorldGuard.getInstance().getPlatform().getRegionContainer();
|
||||
RegionManager regionManager = container.get(BukkitAdapter.adapt(world));
|
||||
if (regionManager == null) return false;
|
||||
BlockVector3 bv = BukkitAdapter.asBlockVector(loc);
|
||||
ApplicableRegionSet regionSet = regionManager.getApplicableRegions(bv);
|
||||
// Prüfe das antiredstoneclock-Flag in allen Regionen an dieser Location
|
||||
StateFlag flag = (StateFlag) WorldGuard.getInstance().getFlagRegistry().get("antiredstoneclock");
|
||||
if (flag == null) return false;
|
||||
// testState gibt true zurück, wenn das Flag auf ALLOW steht (Schutz aktiv), false bei DENY (Schutz ignorieren)
|
||||
return !regionSet.testState(null, flag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVersion() {
|
||||
return "7.x";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean registerFlag() {
|
||||
try {
|
||||
FlagRegistry registry = WorldGuard.getInstance().getFlagRegistry();
|
||||
StateFlag flag = new StateFlag("antiredstoneclock", true);
|
||||
Flag<?> existing = registry.get("antiredstoneclock");
|
||||
if (existing == null) {
|
||||
registry.register(flag);
|
||||
}
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,12 @@ metrics: true
|
||||
# Maximale Anzahl der erlaubten Redstone-Impulse während der "Verzögerungs"-Periode (Zahl > 1)
|
||||
MaxPulses: 150
|
||||
|
||||
# Teleport-Befehl für Klick-Events (tp $player $x $y $z)
|
||||
# teleportCMD: "tp $player $x $y $z $world" # Vanilla/EssentialsX
|
||||
# teleportCMD: "tppos $player $x $y $z $world" # z.B. EssentialsX
|
||||
# teleportCMD: "minecraft:tp $player $x $y $z $world" # Vanilla erzwingen
|
||||
teleportCMD: "minecraft:tp $player $x $y $z $world"
|
||||
|
||||
# Zeit (in Sekunden) bis zum Zurücksetzen der "MaxImpuls"-Variable (Zahl > 1)
|
||||
Delay: 300
|
||||
|
||||
@@ -27,7 +33,7 @@ Sign:
|
||||
Line4: ''
|
||||
|
||||
# Liste der Welten, in denen das Plugin deaktiviert ist, getrennt durch "/", wenn keine, Namen wie "keine" eintragen
|
||||
IgnoreWorlds: world_redstone/überleben
|
||||
IgnoreWorlds: world_redstone/survival
|
||||
|
||||
# Liste der Regionen, in denen das Plugin deaktiviert ist, getrennt durch "/", wenn keine, Namen wie "keine" eintragen
|
||||
IgnoreRegions: redstone/admins
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
name: AntiRedstoneClock-Reborn
|
||||
version: 2.0
|
||||
version: 2.1
|
||||
description: Limit the redstoneClock
|
||||
author: M_Viper
|
||||
website: https://m-viper.de
|
||||
@@ -12,3 +12,6 @@ commands:
|
||||
antiRedstoneClock:
|
||||
description: Base command for the antiRedstoneClock plugin.
|
||||
aliases: [arc]
|
||||
arc_tp:
|
||||
description: Interner Teleport-Befehl für AntiRedstoneClock (nicht von anderen Plugins beeinflusst).
|
||||
usage: /arc_tp <x> <y> <z> <world>
|
||||
|
||||
BIN
MAIN/target/AntiRedstoneClock-Reborn-IGNORE.jar
Normal file
BIN
MAIN/target/AntiRedstoneClock-Reborn-IGNORE.jar
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
84
MAIN/target/classes/config.yml
Normal file
84
MAIN/target/classes/config.yml
Normal file
@@ -0,0 +1,84 @@
|
||||
# Version: Nicht an dieser Stelle verändern
|
||||
version: 0.9
|
||||
|
||||
# Metrics aktivieren (true/false)
|
||||
metrics: true
|
||||
|
||||
# Maximale Anzahl der erlaubten Redstone-Impulse während der "Verzögerungs"-Periode (Zahl > 1)
|
||||
MaxPulses: 150
|
||||
|
||||
# Teleport-Befehl für Klick-Events (tp $player $x $y $z)
|
||||
# teleportCMD: "tp $player $x $y $z $world" # Vanilla/EssentialsX
|
||||
# teleportCMD: "tppos $player $x $y $z $world" # z.B. EssentialsX
|
||||
# teleportCMD: "minecraft:tp $player $x $y $z $world" # Vanilla erzwingen
|
||||
teleportCMD: "minecraft:tp $player $x $y $z $world"
|
||||
|
||||
# Zeit (in Sekunden) bis zum Zurücksetzen der "MaxImpuls"-Variable (Zahl > 1)
|
||||
Delay: 300
|
||||
|
||||
# Soll ein Admin benachrichtigt werden? (true/false)
|
||||
NotifyAdmins: true
|
||||
|
||||
# Sollen Items (Redstone / Repeater) gedroppt werden, wenn eine Schleife zerstört wird? (true/false)
|
||||
DropItems: true
|
||||
|
||||
# Soll beim Zerstören einer Clock ein Schild erstellt werden? (true/false)
|
||||
CreateSignWhenClockIsBreak: true
|
||||
|
||||
# Text, der auf dem Schild stehen soll
|
||||
Sign:
|
||||
Line1: RedstoneClocks
|
||||
Line2: Sind
|
||||
Line3: '&4verboten'
|
||||
Line4: ''
|
||||
|
||||
# Liste der Welten, in denen das Plugin deaktiviert ist, getrennt durch "/", wenn keine, Namen wie "keine" eintragen
|
||||
IgnoreWorlds: world_redstone/survival
|
||||
|
||||
# Liste der Regionen, in denen das Plugin deaktiviert ist, getrennt durch "/", wenn keine, Namen wie "keine" eintragen
|
||||
IgnoreRegions: redstone/admins
|
||||
|
||||
# PlotSquared-Support aktivieren oder deaktivieren (true/false)
|
||||
plotSquaredSupport: true
|
||||
|
||||
# WorldGuard-Support aktivieren oder deaktivieren (true/false)
|
||||
worldGuardSupport: true
|
||||
|
||||
# Clock-Erkennung für verschiedene Redstone-Elemente aktivieren/deaktivieren (true/false)
|
||||
checkedClock:
|
||||
comparator: true
|
||||
observer: true
|
||||
piston: true
|
||||
redstoneAndRepeater: true
|
||||
|
||||
# Automatisches Zerstören erkannter Redstone-Schleifen (true/false)
|
||||
AutomaticallyBreakDetectedClock: true
|
||||
|
||||
# Blitz an der Position der Redstone-Schleife beschwören (true/false)
|
||||
SummonLigthningAtRedstoneLocation: true
|
||||
|
||||
# Plugin in „Standby“ versetzen, wenn die TPS des Servers im Bereich zwischen min und max liegen
|
||||
checkTPS:
|
||||
minimumTPS: -1
|
||||
maximumTPS: -1
|
||||
intervalInSecond: 15
|
||||
|
||||
# Überprüfung von Redstone-Schleifen oberhalb eines Y-Wertes deaktivieren
|
||||
disableRedstoneClockCheckAbove: 255
|
||||
|
||||
# Nachrichten
|
||||
Msg:
|
||||
default:
|
||||
prefix: '&bAntiRedstoneClock &9&l> &r&b '
|
||||
error: '&4AntiRedstoneClock &l> &r&c '
|
||||
no_permission: '&4Fehler &9&l> &r&bDu hast keine Berechtigung, dies zu tun!'
|
||||
command_use: '&4AntiRedstoneClock &l> &r&cBefehlsnutzung: &6/arc $command'
|
||||
message:
|
||||
MsgToAdmin: Redstone-Schleife deaktiviert bei x:$X y:$Y z:$Z. In der Welt $World
|
||||
unknownCmd: Unbekannter Befehl. Tippe "/help" für Hilfe.
|
||||
reloadSuccess: Neu laden erfolgreich! Redstone Listener und Drittanbieter-Plugins sind nicht betroffen!
|
||||
newValueInConfig: Neuer Wert von $setting ist $value
|
||||
RedStoneClockListHeader: 'RedstoneClockListe: Seite $page'
|
||||
RedStoneClockListFooter: ''
|
||||
Exception:
|
||||
duplicate_object: Diese Liste enthält bereits diesen Redstone-Block
|
||||
17
MAIN/target/classes/plugin.yml
Normal file
17
MAIN/target/classes/plugin.yml
Normal file
@@ -0,0 +1,17 @@
|
||||
name: AntiRedstoneClock-Reborn
|
||||
version: 2.1
|
||||
description: Limit the redstoneClock
|
||||
author: M_Viper
|
||||
website: https://m-viper.de
|
||||
api-version: 1.13
|
||||
softdepend: [WorldGuard, bstats, PlotSquared]
|
||||
|
||||
main: com.trafalcraft.anti_redstone_clock.Main
|
||||
|
||||
commands:
|
||||
antiRedstoneClock:
|
||||
description: Base command for the antiRedstoneClock plugin.
|
||||
aliases: [arc]
|
||||
arc_tp:
|
||||
description: Interner Teleport-Befehl für AntiRedstoneClock (nicht von anderen Plugins beeinflusst).
|
||||
usage: /arc_tp <x> <y> <z> <world>
|
||||
3
MAIN/target/maven-archiver/pom.properties
Normal file
3
MAIN/target/maven-archiver/pom.properties
Normal file
@@ -0,0 +1,3 @@
|
||||
artifactId=MAIN
|
||||
groupId=com.trafalcraft.antiRedstoneClock
|
||||
version=2.1
|
||||
@@ -0,0 +1,29 @@
|
||||
com\trafalcraft\anti_redstone_clock\commands\SetMaxPulses.class
|
||||
com\trafalcraft\anti_redstone_clock\commands\AutoRemoveDetectedClock.class
|
||||
com\trafalcraft\anti_redstone_clock\commands\CreateSignWhenClockIsBreak.class
|
||||
com\trafalcraft\anti_redstone_clock\commands\CheckList.class
|
||||
com\trafalcraft\anti_redstone_clock\listener\Util.class
|
||||
com\trafalcraft\anti_redstone_clock\Main.class
|
||||
com\trafalcraft\anti_redstone_clock\Main$1.class
|
||||
com\trafalcraft\anti_redstone_clock\util\plotSquared\PlotSquared_7.class
|
||||
com\trafalcraft\anti_redstone_clock\Main$2.class
|
||||
com\trafalcraft\anti_redstone_clock\PlayerListener.class
|
||||
com\trafalcraft\anti_redstone_clock\commands\SetDelay.class
|
||||
com\trafalcraft\anti_redstone_clock\commands\NotifyAdmin.class
|
||||
com\trafalcraft\anti_redstone_clock\util\CheckTPS.class
|
||||
com\trafalcraft\anti_redstone_clock\util\plotSquared\VersionPlotSquared.class
|
||||
com\trafalcraft\anti_redstone_clock\util\worldGuard\WorldGuard_7.class
|
||||
com\trafalcraft\anti_redstone_clock\object\RedstoneClockController.class
|
||||
com\trafalcraft\anti_redstone_clock\util\Msg.class
|
||||
com\trafalcraft\anti_redstone_clock\object\RedstoneClock.class
|
||||
com\trafalcraft\anti_redstone_clock\listener\PistonListener.class
|
||||
com\trafalcraft\anti_redstone_clock\listener\RedstoneListener.class
|
||||
com\trafalcraft\anti_redstone_clock\exception\DuplicateRedstoneClockObjectException.class
|
||||
com\trafalcraft\anti_redstone_clock\util\plotSquared\IPlotSquared.class
|
||||
com\trafalcraft\anti_redstone_clock\util\worldGuard\VersionWG.class
|
||||
com\trafalcraft\anti_redstone_clock\commands\Reload.class
|
||||
com\trafalcraft\anti_redstone_clock\commands\ArcTpCommand.class
|
||||
com\trafalcraft\anti_redstone_clock\util\worldGuard\IWorldGuard.class
|
||||
com\trafalcraft\anti_redstone_clock\commands\DisableRedstoneClockCheckAbove.class
|
||||
com\trafalcraft\anti_redstone_clock\listener\ComparatorListener.class
|
||||
com\trafalcraft\anti_redstone_clock\listener\ObserverListener.class
|
||||
@@ -0,0 +1,27 @@
|
||||
C:\Users\Viper\Desktop\antiRedstoneClock-Reborn\MAIN\src\main\java\com\trafalcraft\anti_redstone_clock\commands\CheckList.java
|
||||
C:\Users\Viper\Desktop\antiRedstoneClock-Reborn\MAIN\src\main\java\com\trafalcraft\anti_redstone_clock\listener\RedstoneListener.java
|
||||
C:\Users\Viper\Desktop\antiRedstoneClock-Reborn\MAIN\src\main\java\com\trafalcraft\anti_redstone_clock\commands\Reload.java
|
||||
C:\Users\Viper\Desktop\antiRedstoneClock-Reborn\MAIN\src\main\java\com\trafalcraft\anti_redstone_clock\util\worldGuard\IWorldGuard.java
|
||||
C:\Users\Viper\Desktop\antiRedstoneClock-Reborn\MAIN\src\main\java\com\trafalcraft\anti_redstone_clock\object\RedstoneClockController.java
|
||||
C:\Users\Viper\Desktop\antiRedstoneClock-Reborn\MAIN\src\main\java\com\trafalcraft\anti_redstone_clock\util\plotSquared\IPlotSquared.java
|
||||
C:\Users\Viper\Desktop\antiRedstoneClock-Reborn\MAIN\src\main\java\com\trafalcraft\anti_redstone_clock\commands\CreateSignWhenClockIsBreak.java
|
||||
C:\Users\Viper\Desktop\antiRedstoneClock-Reborn\MAIN\src\main\java\com\trafalcraft\anti_redstone_clock\listener\Util.java
|
||||
C:\Users\Viper\Desktop\antiRedstoneClock-Reborn\MAIN\src\main\java\com\trafalcraft\anti_redstone_clock\util\worldGuard\WorldGuard_7.java
|
||||
C:\Users\Viper\Desktop\antiRedstoneClock-Reborn\MAIN\src\main\java\com\trafalcraft\anti_redstone_clock\util\plotSquared\VersionPlotSquared.java
|
||||
C:\Users\Viper\Desktop\antiRedstoneClock-Reborn\MAIN\src\main\java\com\trafalcraft\anti_redstone_clock\util\worldGuard\VersionWG.java
|
||||
C:\Users\Viper\Desktop\antiRedstoneClock-Reborn\MAIN\src\main\java\com\trafalcraft\anti_redstone_clock\object\RedstoneClock.java
|
||||
C:\Users\Viper\Desktop\antiRedstoneClock-Reborn\MAIN\src\main\java\com\trafalcraft\anti_redstone_clock\util\CheckTPS.java
|
||||
C:\Users\Viper\Desktop\antiRedstoneClock-Reborn\MAIN\src\main\java\com\trafalcraft\anti_redstone_clock\commands\DisableRedstoneClockCheckAbove.java
|
||||
C:\Users\Viper\Desktop\antiRedstoneClock-Reborn\MAIN\src\main\java\com\trafalcraft\anti_redstone_clock\listener\ComparatorListener.java
|
||||
C:\Users\Viper\Desktop\antiRedstoneClock-Reborn\MAIN\src\main\java\com\trafalcraft\anti_redstone_clock\commands\NotifyAdmin.java
|
||||
C:\Users\Viper\Desktop\antiRedstoneClock-Reborn\MAIN\src\main\java\com\trafalcraft\anti_redstone_clock\listener\PistonListener.java
|
||||
C:\Users\Viper\Desktop\antiRedstoneClock-Reborn\MAIN\src\main\java\com\trafalcraft\anti_redstone_clock\commands\SetMaxPulses.java
|
||||
C:\Users\Viper\Desktop\antiRedstoneClock-Reborn\MAIN\src\main\java\com\trafalcraft\anti_redstone_clock\commands\AutoRemoveDetectedClock.java
|
||||
C:\Users\Viper\Desktop\antiRedstoneClock-Reborn\MAIN\src\main\java\com\trafalcraft\anti_redstone_clock\commands\SetDelay.java
|
||||
C:\Users\Viper\Desktop\antiRedstoneClock-Reborn\MAIN\src\main\java\com\trafalcraft\anti_redstone_clock\listener\ObserverListener.java
|
||||
C:\Users\Viper\Desktop\antiRedstoneClock-Reborn\MAIN\src\main\java\com\trafalcraft\anti_redstone_clock\util\plotSquared\PlotSquared_7.java
|
||||
C:\Users\Viper\Desktop\antiRedstoneClock-Reborn\MAIN\src\main\java\com\trafalcraft\anti_redstone_clock\util\Msg.java
|
||||
C:\Users\Viper\Desktop\antiRedstoneClock-Reborn\MAIN\src\main\java\com\trafalcraft\anti_redstone_clock\commands\ArcTpCommand.java
|
||||
C:\Users\Viper\Desktop\antiRedstoneClock-Reborn\MAIN\src\main\java\com\trafalcraft\anti_redstone_clock\exception\DuplicateRedstoneClockObjectException.java
|
||||
C:\Users\Viper\Desktop\antiRedstoneClock-Reborn\MAIN\src\main\java\com\trafalcraft\anti_redstone_clock\PlayerListener.java
|
||||
C:\Users\Viper\Desktop\antiRedstoneClock-Reborn\MAIN\src\main\java\com\trafalcraft\anti_redstone_clock\Main.java
|
||||
BIN
MAIN/target/original-AntiRedstoneClock-Reborn-IGNORE.jar
Normal file
BIN
MAIN/target/original-AntiRedstoneClock-Reborn-IGNORE.jar
Normal file
Binary file not shown.
@@ -45,10 +45,6 @@ Wenn du Unterstützung für ältere Versionen brauchst, teile mir bitte deine Ve
|
||||
## Beispiel für die config.yml
|
||||
(Enthält Einstellungen zur Anpassung der Clock-Erkennung, Notifications, Teleport-Befehle etc.)
|
||||
|
||||
## Unterstützung für Observer und Comparator mit Spigot 1.12.2
|
||||
[Hier auf GitLab](https://gitlab.com/Trafalcraft/antiRedstoneClock/-/tree/master/MAIN/nms-patches/1.12.2)
|
||||
Alternativ kannst du die 1.12.2er Paper-Version ab Build 1593 oder neuer nutzen: [https://papermc.io/legacy](https://papermc.io/legacy)
|
||||
|
||||
## Wie checkTPS funktioniert
|
||||
Es prüft 3 Fälle:
|
||||
|
||||
|
||||
BIN
lib/plotsquared-bukkit-7.5.12-Premium.jar
Normal file
BIN
lib/plotsquared-bukkit-7.5.12-Premium.jar
Normal file
Binary file not shown.
BIN
lib/worldguard-bukkit-7.0.15.jar
Normal file
BIN
lib/worldguard-bukkit-7.0.15.jar
Normal file
Binary file not shown.
2
pom.xml
2
pom.xml
@@ -8,7 +8,7 @@
|
||||
|
||||
<groupId>com.trafalcraft.antiRedstoneClock</groupId>
|
||||
<artifactId>AntiRedstoneClock-Reborn</artifactId>
|
||||
<version>2.0</version>
|
||||
<version>2.1</version>
|
||||
<packaging>pom</packaging>
|
||||
<name>AntiRedstoneClock</name>
|
||||
<url>https://www.spigotmc.org/resources/antiredstoneclock.18557</url>
|
||||
|
||||
Reference in New Issue
Block a user