mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-19 17:37:42 +01:00
Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@178f035 Restore no-crash behaviour when read-only config file(s) (#8318) PaperMC/Paper@267dd18 Stop large look changes from crashing the server (#8326) PaperMC/Paper@36f0c1b Rebuild patches PaperMC/Paper@751d092 Properly close section storage managed files (#8364) PaperMC/Paper@f5f84ff Add custom destroyerIdentity parameter to the sendBlockBreak function (#5840) PaperMC/Paper@05f6a5c Limit size of Authenticator Cache Thread Pool (#8360) PaperMC/Paper@ef670eb EndDragonFight killed statuses should be false for newly created worlds (#8354) PaperMC/Paper@b826065 fire EntityChangeBlockEvent in more places (#6371) PaperMC/Paper@34777cd Missing eating regain reason (#8244) PaperMC/Paper@dbda887 Missing some effect cause (#8307) PaperMC/Paper@63cb747 Added byte array serialization/deserialization for PersistentDataContainers (#7505)
This commit is contained in:
@@ -5,10 +5,10 @@ Subject: [PATCH] Tool actionable options
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/item/AxeItem.java b/src/main/java/net/minecraft/world/item/AxeItem.java
|
||||
index 03a6a99dcc0c8fcc32776dd49cf6092b899bf6ed..33b162108bb088827101e9972b89390fb67feca8 100644
|
||||
index 9c49d8f696864d2aad23208422c4ab5b598a0cd9..22c8ef3d8d20c14d3b032d054827e074a4422ad6 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/AxeItem.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/AxeItem.java
|
||||
@@ -33,22 +33,22 @@ public class AxeItem extends DiggerItem {
|
||||
@@ -33,29 +33,31 @@ public class AxeItem extends DiggerItem {
|
||||
BlockPos blockPos = context.getClickedPos();
|
||||
Player player = context.getPlayer();
|
||||
BlockState blockState = level.getBlockState(blockPos);
|
||||
@@ -40,21 +40,30 @@ index 03a6a99dcc0c8fcc32776dd49cf6092b899bf6ed..33b162108bb088827101e9972b89390f
|
||||
level.levelEvent(player, 3004, blockPos, 0);
|
||||
optional4 = optional3;
|
||||
}
|
||||
@@ -58,15 +58,23 @@ public class AxeItem extends DiggerItem {
|
||||
|
||||
if (optional4.isPresent()) {
|
||||
+ org.purpurmc.purpur.tool.Actionable actionable = optional4.get();
|
||||
+ BlockState state = actionable.into().withPropertiesOf(blockState); // Purpur
|
||||
// Paper start - EntityChangeBlockEvent
|
||||
- if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(player, blockPos, optional4.get()).isCancelled()) {
|
||||
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(player, blockPos, state).isCancelled()) { // Purpur
|
||||
return InteractionResult.PASS;
|
||||
}
|
||||
// Paper end
|
||||
@@ -63,15 +65,22 @@ public class AxeItem extends DiggerItem {
|
||||
CriteriaTriggers.ITEM_USED_ON_BLOCK.trigger((ServerPlayer)player, blockPos, itemStack);
|
||||
}
|
||||
|
||||
- level.setBlock(blockPos, optional4.get(), 11);
|
||||
- level.gameEvent(GameEvent.BLOCK_CHANGE, blockPos, GameEvent.Context.of(player, optional4.get()));
|
||||
+ // Purpur start
|
||||
+ org.purpurmc.purpur.tool.Actionable actionable = optional4.get();
|
||||
+ level.setBlock(blockPos, actionable.into().withPropertiesOf(blockState), 11);
|
||||
+ level.setBlock(blockPos, state, 11);
|
||||
+ actionable.drops().forEach((drop, chance) -> {
|
||||
+ if (level.random.nextDouble() < chance) {
|
||||
+ Block.popResourceFromFace(level, blockPos, context.getClickedFace(), new ItemStack(drop));
|
||||
+ }
|
||||
+ });
|
||||
+ level.gameEvent(GameEvent.BLOCK_CHANGE, blockPos, GameEvent.Context.of(player, actionable.into().withPropertiesOf(blockState)));
|
||||
+ level.gameEvent(GameEvent.BLOCK_CHANGE, blockPos, GameEvent.Context.of(player, state));
|
||||
+ // Purpur end
|
||||
if (player != null) {
|
||||
itemStack.hurtAndBreak(1, player, (p) -> {
|
||||
@@ -111,7 +120,7 @@ index 180aec596110309aade13d2080f8824d152b07cb..bf0e1f481b4c81f0663366bbe597b066
|
||||
return InteractionResult.PASS;
|
||||
}
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
index 820ff330bd75b4ec67e64a8af32a22fc5e5af667..b60a0cb6230bbe238679814eb1ff0b8218fc285a 100644
|
||||
index 500a7eeb3532ee5c25ac5f7a14b2ff25c7a83cff..2f28c8eb9eb68bb44f245437c06388d8686e6572 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -522,6 +522,159 @@ public class PurpurWorldConfig {
|
||||
|
||||
Reference in New Issue
Block a user