Implement ram and rambar commands

This commit is contained in:
BillyGalbreath
2025-01-12 16:29:51 -08:00
committed by granny
parent 0082c63345
commit e13b74d31e
8 changed files with 240 additions and 365 deletions

View File

@@ -1,31 +1,34 @@
--- a/net/minecraft/server/level/ServerPlayer.java
+++ b/net/minecraft/server/level/ServerPlayer.java
@@ -393,6 +_,9 @@
@@ -393,6 +_,10 @@
public com.destroystokyo.paper.event.entity.PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper - PlayerNaturallySpawnCreaturesEvent
public @Nullable String clientBrandName = null; // Paper - Brand support
public org.bukkit.event.player.PlayerQuitEvent.QuitReason quitReason = null; // Paper - Add API for quit reason; there are a lot of changes to do if we change all methods leading to the event
+ public boolean purpurClient = false; // Purpur - Purpur client support
+ private boolean tpsBar = false; // Purpur - Implement TPSBar
+ private boolean compassBar = false; // Purpur - Add compass command
+ private boolean ramBar = false; // Purpur - Implement rambar commands
// Paper start - rewrite chunk system
private ca.spottedleaf.moonrise.patches.chunk_system.player.RegionizedPlayerChunkLoader.PlayerChunkLoaderData chunkLoader;
@@ -561,6 +_,9 @@
@@ -561,6 +_,10 @@
if (tag != null) {
BlockPos.CODEC.parse(NbtOps.INSTANCE, tag).resultOrPartial(LOGGER::error).ifPresent(pos -> this.raidOmenPosition = pos);
}
+
+ if (compound.contains("Purpur.TPSBar")) { this.tpsBar = compound.getBoolean("Purpur.TPSBar"); } // Purpur - Implement TPSBar
+ if (compound.contains("Purpur.CompassBar")) { this.compassBar = compound.getBoolean("Purpur.CompassBar"); } // Purpur - Add compass command
+ if (compound.contains("Purpur.RamBar")) { this.ramBar = compound.getBoolean("Purpur.RamBar"); } // Purpur - Implement rambar command
}
@Override
@@ -605,6 +_,8 @@
@@ -605,6 +_,9 @@
}
this.saveEnderPearls(compound);
+ compound.putBoolean("Purpur.TPSBar", this.tpsBar); // Purpur - Implement TPSBar
+ compound.putBoolean("Purpur.CompassBar", this.compassBar); // Purpur - Add compass command
+ compound.putBoolean("Purpur.CompassBar", this.compassBar); // Purpur - Add rambar command
}
private void saveParentVehicle(CompoundTag tag) {
@@ -214,7 +217,7 @@
public ServerStatsCounter getStats() {
return this.stats;
@@ -3077,4 +_,46 @@
@@ -3077,4 +_,56 @@
return (org.bukkit.craftbukkit.entity.CraftPlayer) super.getBukkitEntity();
}
// CraftBukkit end
@@ -260,4 +263,14 @@
+ this.compassBar = compassBar;
+ }
+ // Purpur end - Add compass command
+
+ // Purpur start - Add rambar command
+ public boolean ramBar() {
+ return this.ramBar;
+ }
+
+ public void ramBar(boolean ramBar) {
+ this.ramBar = ramBar;
+ }
+ // Purpur end - Add rambar command
}