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: a4f066cc Fix method profiler inbalance introduced in a2a9ffe (#3132) c65dcad3 Don't delay chunk unloads during entity ticking bc17ce69 Delay unsafe actions until after entity ticking is done - Fixes #3114 5553e6b3 Disable Sync Events firing Async errors during shutdown e12c51d9 Use better variable for isStopping() API 586ee2bb Remove patch for MC-111480, fixed in 1.14 09a94215 Remove streams from Mob AI System bb5c294e Fix Disabling Asynchronous Chunks 089d8356 Implement Chunk Priority / Urgency System for World Gen fce69af7 Use dedicated thread for main thread blocking chunk loads 588b62e4 Add tick times API and /mspt command (#3102) 11de41c7 Add API MinecraftServer#isStopping (#3129) 942ff3c2 My patches are under MIT (#3130)
90 lines
4.2 KiB
Diff
90 lines
4.2 KiB
Diff
From d5c2ca13c73fb5250a39e89858e7dc0c9d0dc8c6 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 777f167293..392f4f8771 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
|
@@ -6,6 +6,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;
|
|
@@ -157,8 +158,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 4f43f87cd4..9f05b76ff7 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
|
|
|