Compare commits

4 Commits
2.0 ... main

4 changed files with 100 additions and 113 deletions

View File

@@ -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() {
@@ -37,15 +38,18 @@ public class CheckList {
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();

View File

@@ -70,18 +70,16 @@ 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");
String teleportCMD = Main.getInstance().getConfig().getString("teleportCMD", "teleport $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())));
.replace("$world", block.getWorld().getName())));
sendFormatedMessageToPlayer(p, textComponent);
}
}
}
}
}
@@ -125,9 +123,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 +137,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;
}

View File

@@ -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:

91
pom.xml
View File

@@ -1,36 +1,26 @@
<?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">
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>
<packaging>pom</packaging>
<name>AntiRedstoneClock</name>
<url>https://www.spigotmc.org/resources/antiredstoneclock.18557</url>
</parent>
<packaging>jar</packaging>
<artifactId>MAIN</artifactId>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<module.info>-parent</module.info>
<spigot.version>1.21.4-R0.1-SNAPSHOT</spigot.version>
<module.info>-IGNORE</module.info>
</properties>
<modules>
<module>MAIN</module>
<module>DIST</module>
</modules>
<repositories>
<repository>
<id>central</id>
<url>https://repo.maven.apache.org/maven2</url>
</repository>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
@@ -45,52 +35,51 @@
</repository>
<repository>
<id>plotsquared</id>
<url>https://repo1.maven.org/maven2/</url>
<url>https://plotsquared.com/mvn/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>${spigot.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sk89q.worldguard</groupId>
<artifactId>worldguard-bukkit</artifactId>
<version>7.0.14</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.intellectualsites.plotsquared</groupId>
<artifactId>plotsquared-bukkit</artifactId>
<version>7.5.6</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-platform-bukkit</artifactId>
<version>4.4.1</version>
<scope>provided</scope>
<groupId>org.bstats</groupId>
<artifactId>bstats-bukkit</artifactId>
<version>3.0.2</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<defaultGoal>clean install</defaultGoal>
<finalName>${project.parent.artifactId}${module.info}</finalName>
<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-compiler-plugin</artifactId>
<version>3.8.1</version>
<artifactId>maven-shade-plugin</artifactId>
<version>3.6.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<source>17</source>
<target>17</target>
<relocations>
<relocation>
<pattern>org.bstats</pattern>
<shadedPattern>com.trafalcraft.anti_redstone_clock.libs.bstats</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>