mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-01 13:57:35 +01:00
Fix drops for shearing bogged (#11628)
This commit is contained in:
parent
a8904bbf98
commit
1cc1ee1676
@ -257,7 +257,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ org.bukkit.event.player.PlayerShearEntityEvent event = CraftEventFactory.handlePlayerShearEntityEvent(player, this, itemstack, hand, drops);
|
+ org.bukkit.event.player.PlayerShearEntityEvent event = CraftEventFactory.handlePlayerShearEntityEvent(player, this, itemstack, hand, drops);
|
||||||
+ if (event != null) {
|
+ if (event != null) {
|
||||||
+ if (event.isCancelled()) {
|
+ if (event.isCancelled()) {
|
||||||
+ this.getEntityData().markDirty(Bogged.DATA_SHEARED); // CraftBukkit - mark dirty to restore sheared state to clients
|
+ // this.getEntityData().markDirty(Bogged.DATA_SHEARED); // CraftBukkit - mark dirty to restore sheared state to clients // Paper - no longer needed
|
||||||
+ return InteractionResult.PASS;
|
+ return InteractionResult.PASS;
|
||||||
+ }
|
+ }
|
||||||
+ drops = org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(event.getDrops());
|
+ drops = org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(event.getDrops());
|
||||||
@ -296,15 +296,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
}
|
}
|
||||||
|
|
||||||
- private void spawnShearedMushrooms(ServerLevel world, ItemStack shears) {
|
- private void spawnShearedMushrooms(ServerLevel world, ItemStack shears) {
|
||||||
- this.dropFromShearingLootTable(world, BuiltInLootTables.BOGGED_SHEAR, shears, (worldserver1, itemstack1) -> {
|
|
||||||
+ // Paper start - custom shear drops
|
+ // Paper start - custom shear drops
|
||||||
+ private void spawnShearedMushrooms(ServerLevel world, ItemStack shears, java.util.List<ItemStack> drops) {
|
+ private void spawnShearedMushrooms(ServerLevel world, ItemStack shears, java.util.List<ItemStack> drops) {
|
||||||
+ final ServerLevel worldserver1 = world; // Named for lambda consumption
|
+ final ServerLevel worldserver1 = world; // Named for lambda consumption
|
||||||
|
this.forceDrops = true; // Paper - Add missing forceDrop toggles
|
||||||
|
- this.dropFromShearingLootTable(world, BuiltInLootTables.BOGGED_SHEAR, shears, (worldserver1, itemstack1) -> {
|
||||||
+ drops.forEach(itemstack1 -> {
|
+ drops.forEach(itemstack1 -> {
|
||||||
+ // Paper end - custom shear drops
|
+ // Paper end - custom shear drops
|
||||||
this.spawnAtLocation(worldserver1, itemstack1, this.getBbHeight());
|
this.spawnAtLocation(worldserver1, itemstack1, this.getBbHeight());
|
||||||
});
|
});
|
||||||
}
|
this.forceDrops = false; // Paper - Add missing forceDrop toggles
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||||
|
@ -52,6 +52,22 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
Panda.this.setItemSlot(EquipmentSlot.MAINHAND, ItemStack.EMPTY);
|
Panda.this.setItemSlot(EquipmentSlot.MAINHAND, ItemStack.EMPTY);
|
||||||
int i = Panda.this.isLazy() ? Panda.this.random.nextInt(50) + 10 : Panda.this.random.nextInt(150) + 10;
|
int i = Panda.this.isLazy() ? Panda.this.random.nextInt(50) + 10 : Panda.this.random.nextInt(150) + 10;
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/entity/monster/Bogged.java b/src/main/java/net/minecraft/world/entity/monster/Bogged.java
|
||||||
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/entity/monster/Bogged.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/entity/monster/Bogged.java
|
||||||
|
@@ -0,0 +0,0 @@ public class Bogged extends AbstractSkeleton implements Shearable {
|
||||||
|
}
|
||||||
|
|
||||||
|
private void spawnShearedMushrooms(ServerLevel world, ItemStack shears) {
|
||||||
|
+ this.forceDrops = true; // Paper - Add missing forceDrop toggles
|
||||||
|
this.dropFromShearingLootTable(world, BuiltInLootTables.BOGGED_SHEAR, shears, (worldserver1, itemstack1) -> {
|
||||||
|
this.spawnAtLocation(worldserver1, itemstack1, this.getBbHeight());
|
||||||
|
});
|
||||||
|
+ this.forceDrops = false; // Paper - Add missing forceDrop toggles
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java b/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java
|
diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java b/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java
|
--- a/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java
|
||||||
|
Loading…
Reference in New Issue
Block a user