Updated Upstream (Paper)

Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@75280ef Fix cancelling EntityDeathEvent for Armor Stands killed by players (#6478)
PaperMC/Paper@6f57163 Add CompostItemEvent and EntityCompostItemEvent (#6356)
PaperMC/Paper@5cc78f2 Use configured log prefix for spigot library loading (#7934)
This commit is contained in:
granny
2023-03-06 00:32:14 -08:00
parent ade1ed1d98
commit ef4b73ced7
4 changed files with 28 additions and 16 deletions

View File

@@ -18,10 +18,10 @@ index 58b093bb1de78ee3b3b2ea364aa50474883f443a..2fd89736091bda7005ef27e42a2aad0d
if (enuminteractionresult.consumesAction()) {
diff --git a/src/main/java/net/minecraft/world/level/block/ComposterBlock.java b/src/main/java/net/minecraft/world/level/block/ComposterBlock.java
index 564822911c25238900b361d564c5db3103900fb3..5d1567f7413b4065b5587ae45ccf9a3e11355c20 100644
index f6268231e39f50bb6adedd85e3c18d746ae3792d..558563aed82adaa44d874a6cbb3e381819c2f638 100644
--- a/src/main/java/net/minecraft/world/level/block/ComposterBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/ComposterBlock.java
@@ -220,23 +220,21 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
@@ -220,26 +220,28 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
ItemStack itemstack = player.getItemInHand(hand);
if (i < 8 && ComposterBlock.COMPOSTABLES.containsKey(itemstack.getItem())) {
@@ -32,7 +32,10 @@ index 564822911c25238900b361d564c5db3103900fb3..5d1567f7413b4065b5587ae45ccf9a3e
- if (state != dummyBlockState && org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(player, pos, dummyBlockState).isCancelled()) { // if block state will change and event cancelled
- return InteractionResult.sidedSuccess(world.isClientSide);
- }
- BlockState iblockdata1 = ComposterBlock.addItem(state, world, pos, itemstack, rand);
- BlockState iblockdata1 = ComposterBlock.addItem(state, world, pos, itemstack, player);
- if (iblockdata1 == null) {
- return InteractionResult.PASS;
- }
- // Paper end
-
- world.levelEvent(1500, pos, state != iblockdata1 ? 1 : 0);
@@ -42,6 +45,10 @@ index 564822911c25238900b361d564c5db3103900fb3..5d1567f7413b4065b5587ae45ccf9a3e
- }
+ // Purpur start
+ BlockState newState = process(i, state, world, itemstack, pos, player);
+ if (newState == null) {
+ return InteractionResult.PASS;
}
+ if (world.purpurConfig.composterBulkProcess && player.isShiftKeyDown() && newState != state) {
+ BlockState oldState;
+ int oldCount, newCount, oldLevel, newLevel;
@@ -50,16 +57,18 @@ index 564822911c25238900b361d564c5db3103900fb3..5d1567f7413b4065b5587ae45ccf9a3e
+ oldCount = itemstack.getCount();
+ oldLevel = oldState.getValue(ComposterBlock.LEVEL);
+ newState = process(oldLevel, oldState, world, itemstack, pos, player);
+ if (newState == null) {
+ return InteractionResult.PASS;
+ }
+ newCount = itemstack.getCount();
+ newLevel = newState.getValue(ComposterBlock.LEVEL);
+ } while (newCount > 0 && (newCount != oldCount || newLevel != oldLevel || newState != oldState));
}
-
+ }
+ // Purpur end
return InteractionResult.sidedSuccess(world.isClientSide);
} else if (i == 8) {
ComposterBlock.extractProduce(state, world, pos, (Entity) null); // CraftBukkit - no event for players
@@ -246,6 +244,29 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
@@ -249,6 +251,32 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
}
}
@@ -72,7 +81,10 @@ index 564822911c25238900b361d564c5db3103900fb3..5d1567f7413b4065b5587ae45ccf9a3e
+ if (state != dummyBlockState && org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(player, pos, dummyBlockState).isCancelled()) { // if block state will change and event cancelled
+ return state;
+ }
+ BlockState iblockdata1 = ComposterBlock.addItem(state, world, pos, itemstack, rand);
+ BlockState iblockdata1 = ComposterBlock.addItem(state, world, pos, itemstack, player);
+ if (iblockdata1 == null) {
+ return iblockdata1;
+ }
+ // Paper end
+
+ world.levelEvent(1500, pos, state != iblockdata1 ? 1 : 0);
@@ -90,7 +102,7 @@ index 564822911c25238900b361d564c5db3103900fb3..5d1567f7413b4065b5587ae45ccf9a3e
int i = (Integer) iblockdata.getValue(ComposterBlock.LEVEL);
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index 026d84d19c1a9077b17846dea050f3048eefe9e5..528a12dea32ac2646fb2039aaa1edeb6bec0c94a 100644
index 83d7abde6a4da43d74fcf41910e00d7a32753567..ee3ef4ab817a8d7143ee34abb6beda4154ed1bfb 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -482,6 +482,11 @@ public class PurpurWorldConfig {