mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-21 02:17:42 +01:00
Updated Upstream (Paper & Airplane)
Upstream has released updates that appear to apply and compile correctly Paper Changes: 3db3aaf39 [Auto] Updated Upstream (CraftBukkit) c953e51dd [Auto] Updated Upstream (CraftBukkit/Spigot) dc529c7a9 Fix PlayerEditBookEvent (#5463) 3fea87edb [Auto] Updated Upstream (CraftBukkit) a111b1365 Send post ChatEvent messages as MessageType.CHAT d15161114 [Auto] Updated Upstream (Spigot) e8889e96a [Auto] Updated Upstream (CraftBukkit) 3bc888ba6 [Auto] Updated Upstream (CraftBukkit) 211f8e041 Prevent light queue overfill when no players are online Airplane Changes: 3ed988c05 Use AIR library for configuration parsing
This commit is contained in:
61
patches/server/0186-Sneak-to-bulk-process-composter.patch
Normal file
61
patches/server/0186-Sneak-to-bulk-process-composter.patch
Normal file
@@ -0,0 +1,61 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: BillyGalbreath <blake.galbreath@gmail.com>
|
||||
Date: Sun, 21 Mar 2021 15:49:15 -0500
|
||||
Subject: [PATCH] Sneak to bulk process composter
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/BlockComposter.java b/src/main/java/net/minecraft/world/level/block/BlockComposter.java
|
||||
index e4e519ba773388b8d26a8f794a6eff51e3d8f72e..c0b235d5edf3cd14021696d1b4f76ce3de41f5d5 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/BlockComposter.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/BlockComposter.java
|
||||
@@ -44,7 +44,7 @@ import org.bukkit.craftbukkit.util.DummyGeneratorAccess;
|
||||
|
||||
public class BlockComposter extends Block implements IInventoryHolder {
|
||||
|
||||
- public static final BlockStateInteger a = BlockProperties.as;
|
||||
+ public static final BlockStateInteger a = BlockProperties.as; public static BlockStateInteger level() { return BlockComposter.a; } // Purpur - OBFHELPER
|
||||
public static final Object2FloatMap<IMaterial> b = new Object2FloatOpenHashMap();
|
||||
private static final VoxelShape c = VoxelShapes.b();
|
||||
private static final VoxelShape[] d = (VoxelShape[]) SystemUtils.a((new VoxelShape[9]), (avoxelshape) -> { // CraftBukkit - decompile error
|
||||
@@ -203,6 +203,25 @@ public class BlockComposter extends Block implements IInventoryHolder {
|
||||
public static IBlockData a(IBlockData iblockdata, WorldServer worldserver, ItemStack itemstack, BlockPosition blockposition, Entity entity) { // CraftBukkit
|
||||
int i = (Integer) iblockdata.get(BlockComposter.a);
|
||||
|
||||
+ // Purpur start
|
||||
+ IBlockData newState = process(i, iblockdata, worldserver, itemstack, blockposition, entity);
|
||||
+
|
||||
+ if (worldserver.purpurConfig.composterBulkProcess && entity.isSneaking()) {
|
||||
+ IBlockData oldState;
|
||||
+ int oldCount, newCount, oldLevel, newLevel;
|
||||
+ do {
|
||||
+ oldState = newState;
|
||||
+ oldCount = itemstack.getCount();
|
||||
+ oldLevel = oldState.get(BlockComposter.level());
|
||||
+ newState = process(oldLevel, oldState, worldserver, itemstack, blockposition, entity);
|
||||
+ newCount = itemstack.getCount();
|
||||
+ newLevel = newState.get(BlockComposter.level());
|
||||
+ } while (newCount > 0 && (newCount != oldCount || newLevel != oldLevel || newState != oldState));
|
||||
+ }
|
||||
+ return newState;
|
||||
+ }
|
||||
+ private static IBlockData process(int i, IBlockData iblockdata, WorldServer worldserver, ItemStack itemstack, BlockPosition blockposition, Entity entity) {
|
||||
+ // Purpur end
|
||||
if (i < 7 && BlockComposter.b.containsKey(itemstack.getItem())) {
|
||||
// CraftBukkit start
|
||||
double rand = worldserver.getRandom().nextDouble();
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 58f2440498039bfa0af030f34372d0b1e6e82bed..0e1f6e0bda27547a59c2116f9eec3e29be9f36eb 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -456,6 +456,11 @@ public class PurpurWorldConfig {
|
||||
chestOpenWithBlockOnTop = getBoolean("blocks.chest.open-with-solid-block-on-top", chestOpenWithBlockOnTop);
|
||||
}
|
||||
|
||||
+ public boolean composterBulkProcess = false;
|
||||
+ private void composterSettings() {
|
||||
+ composterBulkProcess = getBoolean("blocks.composter.sneak-to-bulk-process", composterBulkProcess);
|
||||
+ }
|
||||
+
|
||||
public boolean dispenserApplyCursedArmor = true;
|
||||
public boolean dispenserPlaceAnvils = false;
|
||||
private void dispenserSettings() {
|
||||
Reference in New Issue
Block a user