Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,17 @@ Subject: [PATCH] Barrels and enderchests 6 rows


diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
index 646e16b3d69b5516e8f7c401828fec731378979c..7a9a37a630ea68328512c1a80bdaaefdd2253b9c 100644
index 646e16b3d69b5516e8f7c401828fec731378979c..db1ad0ec29d529a57addfc5a33f3f2ff8349a38f 100644
--- a/net/minecraft/server/players/PlayerList.java
+++ b/net/minecraft/server/players/PlayerList.java
@@ -887,6 +887,27 @@ public abstract class PlayerList {
@@ -887,6 +887,14 @@ public abstract class PlayerList {
player.getBukkitEntity().recalculatePermissions(); // CraftBukkit
this.server.getCommands().sendCommands(player);
} // Paper - Add sendOpLevel API
+
+ // Purpur start - Barrels and enderchests 6 rows
+ if (org.purpurmc.purpur.PurpurConfig.enderChestSixRows && org.purpurmc.purpur.PurpurConfig.enderChestPermissionRows) {
+ org.bukkit.craftbukkit.entity.CraftHumanEntity bukkit = player.getBukkitEntity();
+ if (bukkit.hasPermission("purpur.enderchest.rows.six")) {
+ player.sixRowEnderchestSlotCount = 54;
+ } else if (bukkit.hasPermission("purpur.enderchest.rows.five")) {
+ player.sixRowEnderchestSlotCount = 45;
+ } else if (bukkit.hasPermission("purpur.enderchest.rows.four")) {
+ player.sixRowEnderchestSlotCount = 36;
+ } else if (bukkit.hasPermission("purpur.enderchest.rows.three")) {
+ player.sixRowEnderchestSlotCount = 27;
+ } else if (bukkit.hasPermission("purpur.enderchest.rows.two")) {
+ player.sixRowEnderchestSlotCount = 18;
+ } else if (bukkit.hasPermission("purpur.enderchest.rows.one")) {
+ player.sixRowEnderchestSlotCount = 9;
+ }
+ player.recalculateEnderchestRows();
+ } else {
+ player.sixRowEnderchestSlotCount = -1;
+ }
Expand All @@ -37,7 +24,7 @@ index 646e16b3d69b5516e8f7c401828fec731378979c..7a9a37a630ea68328512c1a80bdaaefd

// Paper start - whitelist verify event / login event
diff --git a/net/minecraft/world/entity/player/Player.java b/net/minecraft/world/entity/player/Player.java
index 3339cb1068ab162e36c410950e83e5f32dd9b705..9312a20c37329f2892e0b6231566bb1f96e1e7ac 100644
index 98078f38f4b24484f615fb02fe11618ad3b4a133..b0d2ddd2b2abf2e2980b9440f7109c32e8606c04 100644
--- a/net/minecraft/world/entity/player/Player.java
+++ b/net/minecraft/world/entity/player/Player.java
@@ -181,6 +181,7 @@ public abstract class Player extends Avatar implements ContainerUser {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@
this.setServerLevel(level);
this.connection.internalTeleport(PositionMoveRotation.of(teleportTransition), teleportTransition.relatives()); // CraftBukkit - use internal teleport without event
this.connection.resetPosition();
@@ -1569,6 +_,9 @@
this.stopUsingItem();
}
// Paper end - Reset shield blocking on dimension change
+ // Purpur start - Recalculate enderchest row count on world change
+ this.recalculateEnderchestRows();
+ // Purpur end - Recalculate enderchest row count on world change
return this;
}
}
@@ -1652,7 +_,7 @@
new AABB(vec3.x() - 8.0, vec3.y() - 5.0, vec3.z() - 8.0, vec3.x() + 8.0, vec3.y() + 5.0, vec3.z() + 8.0),
monster -> monster.isPreventingPlayerRest(this.level(), this)
Expand Down Expand Up @@ -215,7 +225,7 @@

public ServerStatsCounter getStats() {
return this.stats;
@@ -3126,4 +_,65 @@
@@ -3126,4 +_,90 @@
return (org.bukkit.craftbukkit.entity.CraftPlayer) super.getBukkitEntity();
}
// CraftBukkit end
Expand Down Expand Up @@ -280,4 +290,29 @@
+ this.ramBar = ramBar;
+ }
+ // Purpur end - Add rambar command
+
+ // Purpur start - Recalculate enderchest row count
+ public void recalculateEnderchestRows() {
+ if (!org.purpurmc.purpur.PurpurConfig.enderChestSixRows || !org.purpurmc.purpur.PurpurConfig.enderChestPermissionRows) {
+ this.sixRowEnderchestSlotCount = -1;
+ return;
+ }
+ org.bukkit.craftbukkit.entity.CraftHumanEntity bukkit = this.getBukkitEntity();
+ if (bukkit.hasPermission("purpur.enderchest.rows.six")) {
+ this.sixRowEnderchestSlotCount = 54;
+ } else if (bukkit.hasPermission("purpur.enderchest.rows.five")) {
+ this.sixRowEnderchestSlotCount = 45;
+ } else if (bukkit.hasPermission("purpur.enderchest.rows.four")) {
+ this.sixRowEnderchestSlotCount = 36;
+ } else if (bukkit.hasPermission("purpur.enderchest.rows.three")) {
+ this.sixRowEnderchestSlotCount = 27;
+ } else if (bukkit.hasPermission("purpur.enderchest.rows.two")) {
+ this.sixRowEnderchestSlotCount = 18;
+ } else if (bukkit.hasPermission("purpur.enderchest.rows.one")) {
+ this.sixRowEnderchestSlotCount = 9;
+ } else {
+ this.sixRowEnderchestSlotCount = -1;
+ }
+ }
+ // Purpur end - Recalculate enderchest row count
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
@@ -291,6 +_,7 @@
@@ -291,6 +_,8 @@
@Override
public void recalculatePermissions() {
this.perm.recalculatePermissions();
+ getHandle().canPortalInstant = hasPermission("purpur.portal.instant"); // Purpur - Add portal permission bypass
+ ((net.minecraft.server.level.ServerPlayer) getHandle()).recalculateEnderchestRows(); // Purpur - Recalculate enderchest rows on permission change
}

@Override