mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 08:57:44 +01:00
90 lines
4.2 KiB
Diff
90 lines
4.2 KiB
Diff
From ab494bc1eda2af20f615c0834599d80c855c7cc2 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 1e27abbea..ca3b6c9aa 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 ed2a31277..581e8eebe 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 454ec3c76..d295821c5 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
|
|
|