mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-22 10:57:43 +01:00
fix compilation issues
This commit is contained in:
@@ -13,7 +13,7 @@ index e693c5ef414dd77b684d0a393444a5d28b975bfd..d12896bb6f23bfdb1d22e1ecadd23c01
|
||||
this.server.getCommands().sendCommands(player);
|
||||
} // Paper - Add sendOpLevel API
|
||||
+
|
||||
+ // Purpur start
|
||||
+ // 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")) {
|
||||
@@ -32,19 +32,19 @@ index e693c5ef414dd77b684d0a393444a5d28b975bfd..d12896bb6f23bfdb1d22e1ecadd23c01
|
||||
+ } else {
|
||||
+ player.sixRowEnderchestSlotCount = -1;
|
||||
+ }
|
||||
+ //Purpur end
|
||||
+ // Purpur end - Barrels and enderchests 6 rows
|
||||
}
|
||||
|
||||
public boolean isWhiteListed(GameProfile profile) {
|
||||
diff --git a/net/minecraft/world/entity/player/Player.java b/net/minecraft/world/entity/player/Player.java
|
||||
index a65023d0929435785116682c1378428120340547..52bbe204bdcf08eb4ef0b4c91567bce4d6da3cb5 100644
|
||||
index 27a0cb04dd50974a96ed420ef811d9c9f3182e52..9b762d48c63ddc532c86e2982006eed42375ac1e 100644
|
||||
--- a/net/minecraft/world/entity/player/Player.java
|
||||
+++ b/net/minecraft/world/entity/player/Player.java
|
||||
@@ -200,6 +200,7 @@ public abstract class Player extends LivingEntity {
|
||||
private int currentImpulseContextResetGraceTime;
|
||||
public boolean affectsSpawning = true; // Paper - Affects Spawning API
|
||||
public net.kyori.adventure.util.TriState flyingFallDamage = net.kyori.adventure.util.TriState.NOT_SET; // Paper - flying fall damage
|
||||
+ public int sixRowEnderchestSlotCount = -1; // Purpur
|
||||
+ public int sixRowEnderchestSlotCount = -1; // Purpur - Barrels and enderchests 6 rows
|
||||
|
||||
// CraftBukkit start
|
||||
public boolean fauxSleeping;
|
||||
@@ -56,7 +56,7 @@ index cf5b99c1337a7eafa9f5e8b2062c32ab4ff78968..0582698825544267e65a427351e27101
|
||||
return new ChestMenu(MenuType.GENERIC_9x6, containerId, playerInventory, 6);
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ // Purpur start - Barrels and enderchests 6 rows
|
||||
+ public static ChestMenu oneRow(int syncId, Inventory playerInventory, Container inventory) {
|
||||
+ return new ChestMenu(MenuType.GENERIC_9x1, syncId, playerInventory, inventory, 1);
|
||||
+ }
|
||||
@@ -64,13 +64,13 @@ index cf5b99c1337a7eafa9f5e8b2062c32ab4ff78968..0582698825544267e65a427351e27101
|
||||
+ public static ChestMenu twoRows(int syncId, Inventory playerInventory, Container inventory) {
|
||||
+ return new ChestMenu(MenuType.GENERIC_9x2, syncId, playerInventory, inventory, 2);
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+ // Purpur end - Barrels and enderchests 6 rows
|
||||
+
|
||||
public static ChestMenu threeRows(int containerId, Inventory playerInventory, Container container) {
|
||||
return new ChestMenu(MenuType.GENERIC_9x3, containerId, playerInventory, container, 3);
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ // Purpur start - Barrels and enderchests 6 rows
|
||||
+ public static ChestMenu fourRows(int syncId, Inventory playerInventory, Container inventory) {
|
||||
+ return new ChestMenu(MenuType.GENERIC_9x4, syncId, playerInventory, inventory, 4);
|
||||
+ }
|
||||
@@ -78,7 +78,7 @@ index cf5b99c1337a7eafa9f5e8b2062c32ab4ff78968..0582698825544267e65a427351e27101
|
||||
+ public static ChestMenu fiveRows(int syncId, Inventory playerInventory, Container inventory) {
|
||||
+ return new ChestMenu(MenuType.GENERIC_9x5, syncId, playerInventory, inventory, 5);
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+ // Purpur end - Barrels and enderchests 6 rows
|
||||
+
|
||||
public static ChestMenu sixRows(int containerId, Inventory playerInventory, Container container) {
|
||||
return new ChestMenu(MenuType.GENERIC_9x6, containerId, playerInventory, container, 6);
|
||||
@@ -92,23 +92,23 @@ index a6a359bab2a727f4631b633a8bb370dd40decc75..4c48bdc2a4596b7b192e76974fa385c3
|
||||
|
||||
public PlayerEnderChestContainer(Player owner) {
|
||||
- super(27);
|
||||
+ super(org.purpurmc.purpur.PurpurConfig.enderChestSixRows ? 54 : 27); // Purpur
|
||||
+ super(org.purpurmc.purpur.PurpurConfig.enderChestSixRows ? 54 : 27); // Purpur - Barrels and enderchests 6 rows
|
||||
this.owner = owner;
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ // Purpur start - Barrels and enderchests 6 rows
|
||||
+ @Override
|
||||
+ public int getContainerSize() {
|
||||
+ return owner.sixRowEnderchestSlotCount < 0 ? super.getContainerSize() : owner.sixRowEnderchestSlotCount;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+ // Purpur end - Barrels and enderchests 6 rows
|
||||
+
|
||||
public void setActiveChest(EnderChestBlockEntity enderChestBlockEntity) {
|
||||
this.activeChest = enderChestBlockEntity;
|
||||
}
|
||||
diff --git a/net/minecraft/world/level/block/EnderChestBlock.java b/net/minecraft/world/level/block/EnderChestBlock.java
|
||||
index 2f60681c50e3656400e84fe9a7670e0412743853..5a60acf92acc77593aec95413c206317999e43ba 100644
|
||||
index 2f60681c50e3656400e84fe9a7670e0412743853..79dbafcfde314058bdf95f887fa7a1032433032c 100644
|
||||
--- a/net/minecraft/world/level/block/EnderChestBlock.java
|
||||
+++ b/net/minecraft/world/level/block/EnderChestBlock.java
|
||||
@@ -84,7 +84,7 @@ public class EnderChestBlock extends AbstractChestBlock<EnderChestBlockEntity> i
|
||||
@@ -116,7 +116,7 @@ index 2f60681c50e3656400e84fe9a7670e0412743853..5a60acf92acc77593aec95413c206317
|
||||
enderChestInventory.setActiveChest(enderChestBlockEntity); // Needs to happen before ChestMenu.threeRows as it is required for opening animations
|
||||
if (level instanceof ServerLevel serverLevel && player.openMenu(
|
||||
- new SimpleMenuProvider((i, inventory, playerx) -> ChestMenu.threeRows(i, inventory, enderChestInventory), CONTAINER_TITLE)
|
||||
+ new SimpleMenuProvider((i, inventory, playerx) -> org.purpurmc.purpur.PurpurConfig.enderChestSixRows ? getEnderChestSixRows(i, inventory, player, playerEnderChestContainer) : ChestMenu.threeRows(i, inventory, enderChestInventory), CONTAINER_TITLE) // Purpur
|
||||
+ new SimpleMenuProvider((i, inventory, playerx) -> org.purpurmc.purpur.PurpurConfig.enderChestSixRows ? getEnderChestSixRows(i, inventory, player, enderChestInventory) : ChestMenu.threeRows(i, inventory, enderChestInventory), CONTAINER_TITLE) // Purpur - Barrels and enderchests 6 rows
|
||||
).isPresent()) {
|
||||
// Paper end - Fix InventoryOpenEvent cancellation - moved up;
|
||||
player.awardStat(Stats.OPEN_ENDERCHEST);
|
||||
@@ -124,7 +124,7 @@ index 2f60681c50e3656400e84fe9a7670e0412743853..5a60acf92acc77593aec95413c206317
|
||||
}
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ // Purpur start - Barrels and enderchests 6 rows
|
||||
+ private ChestMenu getEnderChestSixRows(int syncId, net.minecraft.world.entity.player.Inventory inventory, Player player, PlayerEnderChestContainer playerEnderChestContainer) {
|
||||
+ if (org.purpurmc.purpur.PurpurConfig.enderChestPermissionRows) {
|
||||
+ org.bukkit.craftbukkit.entity.CraftHumanEntity bukkitPlayer = player.getBukkitEntity();
|
||||
@@ -151,7 +151,7 @@ index 2f60681c50e3656400e84fe9a7670e0412743853..5a60acf92acc77593aec95413c206317
|
||||
+ player.sixRowEnderchestSlotCount = -1;
|
||||
+ return ChestMenu.sixRows(syncId, inventory, playerEnderChestContainer);
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+ // Purpur end - Barrels and enderchests 6 rows
|
||||
+
|
||||
@Override
|
||||
public BlockEntity newBlockEntity(BlockPos pos, BlockState state) {
|
||||
@@ -165,7 +165,7 @@ index 0f808855f58281578c2758513787f0f7330c9291..7ea7032eae78726e6d4dcfda49b01a10
|
||||
}
|
||||
// CraftBukkit end
|
||||
- private NonNullList<ItemStack> items = NonNullList.withSize(27, ItemStack.EMPTY);
|
||||
+ // Purpur start
|
||||
+ // Purpur start - Barrels and enderchests 6 rows
|
||||
+ private NonNullList<ItemStack> items = NonNullList.withSize(switch (org.purpurmc.purpur.PurpurConfig.barrelRows) {
|
||||
+ case 6 -> 54;
|
||||
+ case 5 -> 45;
|
||||
@@ -174,7 +174,7 @@ index 0f808855f58281578c2758513787f0f7330c9291..7ea7032eae78726e6d4dcfda49b01a10
|
||||
+ case 1 -> 9;
|
||||
+ default -> 27;
|
||||
+ }, ItemStack.EMPTY);
|
||||
+ // Purpur end
|
||||
+ // Purpur end - Barrels and enderchests 6 rows
|
||||
+
|
||||
public final ContainerOpenersCounter openersCounter = new ContainerOpenersCounter() {
|
||||
@Override
|
||||
@@ -184,7 +184,7 @@ index 0f808855f58281578c2758513787f0f7330c9291..7ea7032eae78726e6d4dcfda49b01a10
|
||||
@Override
|
||||
public int getContainerSize() {
|
||||
- return 27;
|
||||
+ // Purpur start
|
||||
+ // Purpur start - Barrels and enderchests 6 rows
|
||||
+ return switch (org.purpurmc.purpur.PurpurConfig.barrelRows) {
|
||||
+ case 6 -> 54;
|
||||
+ case 5 -> 45;
|
||||
@@ -193,7 +193,7 @@ index 0f808855f58281578c2758513787f0f7330c9291..7ea7032eae78726e6d4dcfda49b01a10
|
||||
+ case 1 -> 9;
|
||||
+ default -> 27;
|
||||
+ };
|
||||
+ // Purpur end
|
||||
+ // Purpur end - Barrels and enderchests 6 rows
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -202,7 +202,7 @@ index 0f808855f58281578c2758513787f0f7330c9291..7ea7032eae78726e6d4dcfda49b01a10
|
||||
@Override
|
||||
protected AbstractContainerMenu createMenu(int id, Inventory player) {
|
||||
- return ChestMenu.threeRows(id, player, this);
|
||||
+ // Purpur start
|
||||
+ // Purpur start - Barrels and enderchests 6 rows
|
||||
+ return switch (org.purpurmc.purpur.PurpurConfig.barrelRows) {
|
||||
+ case 6 -> ChestMenu.sixRows(id, player, this);
|
||||
+ case 5 -> ChestMenu.fiveRows(id, player, this);
|
||||
@@ -211,7 +211,7 @@ index 0f808855f58281578c2758513787f0f7330c9291..7ea7032eae78726e6d4dcfda49b01a10
|
||||
+ case 1 -> ChestMenu.oneRow(id, player, this);
|
||||
+ default -> ChestMenu.threeRows(id, player, this);
|
||||
+ };
|
||||
+ // Purpur end
|
||||
+ // Purpur end - Barrels and enderchests 6 rows
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user