2
Some checks failed
/ deploy (push) Failing after 2m28s

This commit is contained in:
Minecon724 2024-11-20 20:17:26 +01:00
parent 961e4bc375
commit ddd100f493
Signed by: Minecon724
GPG key ID: 3CCC4D267742C8E8
6 changed files with 48 additions and 3 deletions

View file

@ -11,6 +11,8 @@
<properties> <properties>
<maven.compiler.source>21</maven.compiler.source> <maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target> <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.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.spigot.version>1.21.1-R0.1-SNAPSHOT</project.spigot.version> <project.spigot.version>1.21.1-R0.1-SNAPSHOT</project.spigot.version>
</properties> </properties>

View file

@ -8,6 +8,7 @@ import eu.m724.tweaks.ping.F3NameListener;
import eu.m724.tweaks.ping.PingChecker; import eu.m724.tweaks.ping.PingChecker;
import eu.m724.tweaks.ping.PingCommands; import eu.m724.tweaks.ping.PingCommands;
import eu.m724.tweaks.player.MusicPlayer; import eu.m724.tweaks.player.MusicPlayer;
import eu.m724.tweaks.worldborder.WorldBorderManager;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
import java.io.IOException; import java.io.IOException;
@ -42,5 +43,7 @@ public class TweaksPlugin extends JavaPlugin {
getLogger().severe("Failed to initialize MOTD extension"); getLogger().severe("Failed to initialize MOTD extension");
throw new RuntimeException(e); throw new RuntimeException(e);
} }
new WorldBorderManager().init(this);
} }
} }

View file

@ -29,9 +29,9 @@ public class F3NameListener {
brand = "wait"; brand = "wait";
} else { } else {
if (showMspt) { if (showMspt) {
brand = "%.2f mspt | %.2f ms".formatted(mspt, PlayerPing.getPingMillis(player)); brand = "%.2f mspt | Ping: %.2f ms".formatted(mspt, PlayerPing.getPingMillis(player));
} else { } else {
brand = "%.2f ms".formatted(PlayerPing.getPingMillis(player)); brand = "Ping: %.2f ms".formatted(PlayerPing.getPingMillis(player));
} }
} }
changeBrand(player, brand); changeBrand(player, brand);

View file

@ -0,0 +1,5 @@
package eu.m724.tweaks.playtime;
public class PlaytimeListener {
}

View file

@ -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
);
}
});
}
}

View file

@ -1,5 +1,5 @@
name: Tweaks724 name: Tweaks724
version: ${project.version} version: ${project.version}+${timestamp}
main: eu.m724.tweaks.TweaksPlugin main: eu.m724.tweaks.TweaksPlugin
api-version: 1.21.1 api-version: 1.21.1