mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 17:07:43 +01:00
Upstream has released updates that appears to apply and compile correctly Paper Changes: b75eeca0 Boost light task priority to ensure it doesnt hold up chunk loads 3d2bc848 Ensure VillagerTrades doesn't load async - fixes #3495 e470f1ef Add more information to Timing Reports f4a47db6 Improve Thread Pool usage to allow single threads for single cpu servers a4fe910f Fix sounds when using worldedit regen command 70ad51a8 Updated Upstream (Bukkit/CraftBukkit) d7cfa4fa Improve legacy format serialization more
90 lines
4.2 KiB
Diff
90 lines
4.2 KiB
Diff
From d699dd8a2b720e6e0347e104b319cf7d071e6277 Mon Sep 17 00:00:00 2001
|
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
|
Date: Thu, 23 May 2019 21:50:37 -0500
|
|
Subject: [PATCH] Barrels have 6 rows
|
|
|
|
---
|
|
src/main/java/net/minecraft/server/TileEntityBarrel.java | 5 +++--
|
|
src/main/java/net/pl3x/purpur/PurpurConfig.java | 9 +++++++++
|
|
.../org/bukkit/craftbukkit/inventory/CraftContainer.java | 4 +++-
|
|
3 files changed, 15 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/TileEntityBarrel.java b/src/main/java/net/minecraft/server/TileEntityBarrel.java
|
|
index 1e27abbea0..ca3b6c9aae 100644
|
|
--- a/src/main/java/net/minecraft/server/TileEntityBarrel.java
|
|
+++ b/src/main/java/net/minecraft/server/TileEntityBarrel.java
|
|
@@ -54,7 +54,7 @@ public class TileEntityBarrel extends TileEntityLootable {
|
|
|
|
private TileEntityBarrel(TileEntityTypes<?> tileentitytypes) {
|
|
super(tileentitytypes);
|
|
- this.items = NonNullList.a(27, ItemStack.a);
|
|
+ this.items = NonNullList.a(net.pl3x.purpur.PurpurConfig.barrelSixRows ? 54 : 27, ItemStack.a); // Purpur
|
|
}
|
|
|
|
public TileEntityBarrel() {
|
|
@@ -83,7 +83,7 @@ public class TileEntityBarrel extends TileEntityLootable {
|
|
|
|
@Override
|
|
public int getSize() {
|
|
- return 27;
|
|
+ return net.pl3x.purpur.PurpurConfig.barrelSixRows ? 54 : 27; // Purpur
|
|
}
|
|
|
|
@Override
|
|
@@ -103,6 +103,7 @@ public class TileEntityBarrel extends TileEntityLootable {
|
|
|
|
@Override
|
|
protected Container createContainer(int i, PlayerInventory playerinventory) {
|
|
+ if (net.pl3x.purpur.PurpurConfig.barrelSixRows) return new ContainerChest(Containers.GENERIC_9X6, i, playerinventory, this, 6); // Purpur
|
|
return ContainerChest.a(i, playerinventory, this);
|
|
}
|
|
|
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
|
index ed2a312773..581e8eebe7 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
|
@@ -7,6 +7,7 @@ import org.bukkit.Bukkit;
|
|
import org.bukkit.command.Command;
|
|
import org.bukkit.configuration.InvalidConfigurationException;
|
|
import org.bukkit.configuration.file.YamlConfiguration;
|
|
+import org.bukkit.event.inventory.InventoryType;
|
|
|
|
import java.io.File;
|
|
import java.io.IOException;
|
|
@@ -154,8 +155,16 @@ public class PurpurConfig {
|
|
dontSendUselessEntityPackets = getBoolean("settings.dont-send-useless-entity-packets", dontSendUselessEntityPackets);
|
|
}
|
|
|
|
+ public static boolean barrelSixRows = false;
|
|
public static boolean slimeBlocksNotPushable = false;
|
|
private static void blockSettings() {
|
|
+ if (version < 3) {
|
|
+ boolean oldValue = getBoolean("settings.barrel.packed-barrels", true);
|
|
+ set("settings.blocks.barrel.six-rows", oldValue);
|
|
+ set("settings.packed-barrels", null);
|
|
+ }
|
|
+ barrelSixRows = getBoolean("settings.blocks.barrel.six-rows", barrelSixRows);
|
|
+ InventoryType.BARREL.setDefaultSize(barrelSixRows ? 54 : 27);
|
|
slimeBlocksNotPushable = getBoolean("settings.blocks.slime.not-movable-by-piston", slimeBlocksNotPushable);
|
|
}
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java
|
|
index 454ec3c76e..d295821c57 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java
|
|
@@ -195,8 +195,10 @@ public class CraftContainer extends Container {
|
|
case PLAYER:
|
|
case CHEST:
|
|
case ENDER_CHEST:
|
|
+ delegate = new ContainerChest(Containers.GENERIC_9X3, windowId, bottom, top, top.getSize() / 9); // Purpur
|
|
+ break; // Purpur
|
|
case BARREL:
|
|
- delegate = new ContainerChest(Containers.GENERIC_9X3, windowId, bottom, top, top.getSize() / 9);
|
|
+ delegate = new ContainerChest(net.pl3x.purpur.PurpurConfig.barrelSixRows ? Containers.GENERIC_9X6 : Containers.GENERIC_9X3, windowId, bottom, top, top.getSize() / 9); // Purpur
|
|
break;
|
|
case DISPENSER:
|
|
case DROPPER:
|
|
--
|
|
2.24.0
|
|
|