diff --git a/pom.xml b/pom.xml index 9136b71..f39e19d 100644 --- a/pom.xml +++ b/pom.xml @@ -11,6 +11,8 @@ 21 21 + ${maven.build.timestamp} + dd-MM-yyyy UTF-8 1.21.1-R0.1-SNAPSHOT diff --git a/src/main/java/eu/m724/tweaks/TweaksPlugin.java b/src/main/java/eu/m724/tweaks/TweaksPlugin.java index b268f52..ffe2080 100644 --- a/src/main/java/eu/m724/tweaks/TweaksPlugin.java +++ b/src/main/java/eu/m724/tweaks/TweaksPlugin.java @@ -8,6 +8,7 @@ import eu.m724.tweaks.ping.F3NameListener; import eu.m724.tweaks.ping.PingChecker; import eu.m724.tweaks.ping.PingCommands; import eu.m724.tweaks.player.MusicPlayer; +import eu.m724.tweaks.worldborder.WorldBorderManager; import org.bukkit.plugin.java.JavaPlugin; import java.io.IOException; @@ -42,5 +43,7 @@ public class TweaksPlugin extends JavaPlugin { getLogger().severe("Failed to initialize MOTD extension"); throw new RuntimeException(e); } + + new WorldBorderManager().init(this); } } diff --git a/src/main/java/eu/m724/tweaks/ping/F3NameListener.java b/src/main/java/eu/m724/tweaks/ping/F3NameListener.java index b53a0f9..8cd17f6 100644 --- a/src/main/java/eu/m724/tweaks/ping/F3NameListener.java +++ b/src/main/java/eu/m724/tweaks/ping/F3NameListener.java @@ -29,9 +29,9 @@ public class F3NameListener { brand = "wait"; } else { if (showMspt) { - brand = "%.2f mspt | %.2f ms".formatted(mspt, PlayerPing.getPingMillis(player)); + brand = "%.2f mspt | Ping: %.2f ms".formatted(mspt, PlayerPing.getPingMillis(player)); } else { - brand = "%.2f ms".formatted(PlayerPing.getPingMillis(player)); + brand = "Ping: %.2f ms".formatted(PlayerPing.getPingMillis(player)); } } changeBrand(player, brand); diff --git a/src/main/java/eu/m724/tweaks/playtime/PlaytimeListener.java b/src/main/java/eu/m724/tweaks/playtime/PlaytimeListener.java new file mode 100644 index 0000000..d51e399 --- /dev/null +++ b/src/main/java/eu/m724/tweaks/playtime/PlaytimeListener.java @@ -0,0 +1,5 @@ +package eu.m724.tweaks.playtime; + +public class PlaytimeListener { + +} diff --git a/src/main/java/eu/m724/tweaks/worldborder/WorldBorderManager.java b/src/main/java/eu/m724/tweaks/worldborder/WorldBorderManager.java new file mode 100644 index 0000000..4e20789 --- /dev/null +++ b/src/main/java/eu/m724/tweaks/worldborder/WorldBorderManager.java @@ -0,0 +1,35 @@ +package eu.m724.tweaks.worldborder; + +import com.comphenix.protocol.PacketType; +import com.comphenix.protocol.ProtocolLibrary; +import com.comphenix.protocol.events.*; +import com.comphenix.protocol.reflect.StructureModifier; +import net.minecraft.SharedConstants; +import net.minecraft.network.chat.Component; +import net.minecraft.network.protocol.game.ClientboundInitializeBorderPacket; +import net.minecraft.network.protocol.status.ServerStatus; +import org.bukkit.plugin.Plugin; + +import java.util.Optional; +import java.util.concurrent.ThreadLocalRandom; + +public class WorldBorderManager { + public void init(Plugin plugin) { + ProtocolLibrary.getProtocolManager().addPacketListener(new PacketAdapter( + plugin, + ListenerPriority.NORMAL, + PacketType.Play.Server.INITIALIZE_BORDER + ) { + @Override + public void onPacketSending(PacketEvent event) { + PacketContainer packet = event.getPacket(); + event.getPacket().getDoubles().write(2, 60000000.0); + event.getPacket().getDoubles().write(3, 60000000.0); + + System.out.println( + packet + ); + } + }); + } +} diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 7a0d297..9721320 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,5 +1,5 @@ name: Tweaks724 -version: ${project.version} +version: ${project.version}+${timestamp} main: eu.m724.tweaks.TweaksPlugin api-version: 1.21.1