Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
a9d9fedb1f | |||
c6bde6e962 | |||
3c48a2b5e8 | |||
905a21787a |
@@ -16,6 +16,7 @@ import net.md_5.bungee.api.chat.TextComponent;
|
|||||||
import net.md_5.bungee.api.chat.hover.content.Text;
|
import net.md_5.bungee.api.chat.hover.content.Text;
|
||||||
|
|
||||||
public class CheckList {
|
public class CheckList {
|
||||||
|
|
||||||
private static final CheckList ourInstance = new CheckList();
|
private static final CheckList ourInstance = new CheckList();
|
||||||
|
|
||||||
public static CheckList getInstance() {
|
public static CheckList getInstance() {
|
||||||
@@ -37,23 +38,26 @@ public class CheckList {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Collection<Location> allLocation = RedstoneClockController.getAllLoc();
|
Collection<Location> allLocation = RedstoneClockController.getAllLoc();
|
||||||
int totalPage = (int) Math.ceil(allLocation.size() / 5.0);
|
int totalPage = (int) Math.ceil(allLocation.size() / 5.0);
|
||||||
sender.sendMessage(Msg.RED_STONE_CLOCK_LIST_HEADER.toString().replace("$page",
|
sender.sendMessage(Msg.RED_STONE_CLOCK_LIST_HEADER.toString().replace("$page",
|
||||||
"(" + page + "/" + totalPage + ")"));
|
"(" + page + "/" + totalPage + ")"));
|
||||||
|
|
||||||
int i = 1;
|
int i = 1;
|
||||||
int minElements = 5 * (page - 1);
|
int minElements = 5 * (page - 1);
|
||||||
int maxElements = 5 * page;
|
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");
|
int maxPulses = Main.getInstance().getConfig().getInt("MaxPulses");
|
||||||
|
|
||||||
for (Location loc : allLocation) {
|
for (Location loc : allLocation) {
|
||||||
if (i > minElements && i <= maxElements) {
|
if (i > minElements && i <= maxElements) {
|
||||||
int clock = RedstoneClockController.getRedstoneClock(loc).getNumberOfClock();
|
int clock = RedstoneClockController.getRedstoneClock(loc).getNumberOfClock();
|
||||||
String color = "§2"; //Dark_Green
|
String color = "§2"; // Dark_Green
|
||||||
if (clock > maxPulses * 0.75) {
|
if (clock > maxPulses * 0.75) {
|
||||||
color = "§4"; //Dark_Red
|
color = "§4"; // Dark_Red
|
||||||
} else if (clock > maxPulses * 0.5) {
|
} else if (clock > maxPulses * 0.5) {
|
||||||
color = "§e"; //yellow
|
color = "§e"; // yellow
|
||||||
} else if (clock > maxPulses * 0.250) {
|
} else if (clock > maxPulses * 0.250) {
|
||||||
color = "§a"; // green
|
color = "§a"; // green
|
||||||
}
|
}
|
||||||
|
@@ -70,18 +70,16 @@ class Util {
|
|||||||
for (Player p : Bukkit.getOnlinePlayers()) {
|
for (Player p : Bukkit.getOnlinePlayers()) {
|
||||||
if (p.isOp() || p.hasPermission("antiRedstoneClock.NotifyAdmin")) {
|
if (p.isOp() || p.hasPermission("antiRedstoneClock.NotifyAdmin")) {
|
||||||
TextComponent textComponent = getFormatedStringForMsgToAdmin(block);
|
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
|
textComponent.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/" + teleportCMD
|
||||||
.replace("$x", Integer.toString(block.getX()))
|
.replace("$x", Integer.toString(block.getX()))
|
||||||
.replace("$y", Integer.toString(block.getY()))
|
.replace("$y", Integer.toString(block.getY()))
|
||||||
.replace("$z", Integer.toString(block.getZ()))
|
.replace("$z", Integer.toString(block.getZ()))
|
||||||
.replace("$world", block.getWorld().getName())
|
.replace("$world", block.getWorld().getName())));
|
||||||
.replace("$player", p.getName())));
|
|
||||||
sendFormatedMessageToPlayer(p, textComponent);
|
sendFormatedMessageToPlayer(p, textComponent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -125,9 +123,9 @@ class Util {
|
|||||||
sign.setLine(3, Main.getInstance().getConfig().getString("Sign.Line4").replace("&", "§"));
|
sign.setLine(3, Main.getInstance().getConfig().getString("Sign.Line4").replace("&", "§"));
|
||||||
sign.update(false, false);
|
sign.update(false, false);
|
||||||
} catch (ClassCastException error) {
|
} catch (ClassCastException error) {
|
||||||
Bukkit.getLogger().warning(Msg.PREFIX + "No valid sign found for this minecraft version!!!"
|
Bukkit.getLogger().warning(Msg.PREFIX + "Kein gültiges Schild für diese Minecraft-Version gefunden!!!"
|
||||||
+"\nplease disable CreateSignWhenClockIsBreak in config file"
|
+ "\nBitte deaktivieren Sie CreateSignWhenClockIsBreak in der Config-Datei"
|
||||||
+"\nMore infos: " + block.getType());
|
+ "\nMehr Infos: " + block.getType());
|
||||||
}
|
}
|
||||||
block.getDrops().clear();
|
block.getDrops().clear();
|
||||||
}
|
}
|
||||||
@@ -139,7 +137,7 @@ class Util {
|
|||||||
.replace("$Z", block.getZ() + "")
|
.replace("$Z", block.getZ() + "")
|
||||||
.replace("$World", block.getWorld().getName()));
|
.replace("$World", block.getWorld().getName()));
|
||||||
textComponent.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT,
|
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;
|
return textComponent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -45,10 +45,6 @@ Wenn du Unterstützung für ältere Versionen brauchst, teile mir bitte deine Ve
|
|||||||
## Beispiel für die config.yml
|
## Beispiel für die config.yml
|
||||||
(Enthält Einstellungen zur Anpassung der Clock-Erkennung, Notifications, Teleport-Befehle etc.)
|
(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
|
## Wie checkTPS funktioniert
|
||||||
Es prüft 3 Fälle:
|
Es prüft 3 Fälle:
|
||||||
|
|
||||||
|
91
pom.xml
91
pom.xml
@@ -1,36 +1,26 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<parent>
|
||||||
<groupId>com.trafalcraft.antiRedstoneClock</groupId>
|
<groupId>com.trafalcraft.antiRedstoneClock</groupId>
|
||||||
<artifactId>AntiRedstoneClock-Reborn</artifactId>
|
<artifactId>AntiRedstoneClock-Reborn</artifactId>
|
||||||
<version>2.0</version>
|
<version>2.0</version>
|
||||||
<packaging>pom</packaging>
|
</parent>
|
||||||
<name>AntiRedstoneClock</name>
|
<packaging>jar</packaging>
|
||||||
<url>https://www.spigotmc.org/resources/antiredstoneclock.18557</url>
|
|
||||||
|
<artifactId>MAIN</artifactId>
|
||||||
|
|
||||||
<properties>
|
<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>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<maven.compiler.source>17</maven.compiler.source>
|
<module.info>-IGNORE</module.info>
|
||||||
<maven.compiler.target>17</maven.compiler.target>
|
|
||||||
<module.info>-parent</module.info>
|
|
||||||
<spigot.version>1.21.4-R0.1-SNAPSHOT</spigot.version>
|
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<modules>
|
|
||||||
<module>MAIN</module>
|
|
||||||
<module>DIST</module>
|
|
||||||
</modules>
|
|
||||||
|
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>
|
|
||||||
<id>central</id>
|
|
||||||
<url>https://repo.maven.apache.org/maven2</url>
|
|
||||||
</repository>
|
|
||||||
<repository>
|
<repository>
|
||||||
<id>spigot-repo</id>
|
<id>spigot-repo</id>
|
||||||
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
|
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
|
||||||
@@ -45,52 +35,51 @@
|
|||||||
</repository>
|
</repository>
|
||||||
<repository>
|
<repository>
|
||||||
<id>plotsquared</id>
|
<id>plotsquared</id>
|
||||||
<url>https://repo1.maven.org/maven2/</url>
|
<url>https://plotsquared.com/mvn/</url>
|
||||||
</repository>
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.spigotmc</groupId>
|
<groupId>org.bstats</groupId>
|
||||||
<artifactId>spigot-api</artifactId>
|
<artifactId>bstats-bukkit</artifactId>
|
||||||
<version>${spigot.version}</version>
|
<version>3.0.2</version>
|
||||||
<scope>provided</scope>
|
<scope>compile</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>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<defaultGoal>clean install</defaultGoal>
|
<sourceDirectory>${project.basedir}/src/main/java</sourceDirectory>
|
||||||
<finalName>${project.parent.artifactId}${module.info}</finalName>
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<directory>${project.basedir}/src/main/resources</directory>
|
||||||
|
<includes>
|
||||||
|
<include>plugin.yml</include>
|
||||||
|
<include>config.yml</include>
|
||||||
|
</includes>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-shade-plugin</artifactId>
|
||||||
<version>3.8.1</version>
|
<version>3.6.0</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>shade</goal>
|
||||||
|
</goals>
|
||||||
<configuration>
|
<configuration>
|
||||||
<source>17</source>
|
<relocations>
|
||||||
<target>17</target>
|
<relocation>
|
||||||
|
<pattern>org.bstats</pattern>
|
||||||
|
<shadedPattern>com.trafalcraft.anti_redstone_clock.libs.bstats</shadedPattern>
|
||||||
|
</relocation>
|
||||||
|
</relocations>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
Reference in New Issue
Block a user