parent
961e4bc375
commit
ddd100f493
6 changed files with 48 additions and 3 deletions
2
pom.xml
2
pom.xml
|
@ -11,6 +11,8 @@
|
|||
<properties>
|
||||
<maven.compiler.source>21</maven.compiler.source>
|
||||
<maven.compiler.target>21</maven.compiler.target>
|
||||
<timestamp>${maven.build.timestamp}</timestamp>
|
||||
<maven.build.timestamp.format>dd-MM-yyyy</maven.build.timestamp.format>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.spigot.version>1.21.1-R0.1-SNAPSHOT</project.spigot.version>
|
||||
</properties>
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
package eu.m724.tweaks.playtime;
|
||||
|
||||
public class PlaytimeListener {
|
||||
|
||||
}
|
|
@ -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
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
name: Tweaks724
|
||||
version: ${project.version}
|
||||
version: ${project.version}+${timestamp}
|
||||
|
||||
main: eu.m724.tweaks.TweaksPlugin
|
||||
api-version: 1.21.1
|
||||
|
|
Loading…
Reference in a new issue