2021-08-10 05:45:46 +02:00
--- a/net/minecraft/world/effect/WeavingMobEffect.java
+++ b/net/minecraft/world/effect/WeavingMobEffect.java
2024-12-14 22:12:42 +01:00
@@ -25,11 +_,11 @@
2021-08-10 05:45:46 +02:00
@Override
2024-12-14 22:12:42 +01:00
public void onMobRemoved(ServerLevel level, LivingEntity entity, int amplifier, Entity.RemovalReason reason) {
if (reason == Entity.RemovalReason.KILLED && (entity instanceof Player || level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING))) {
- this.spawnCobwebsRandomlyAround(level, entity.getRandom(), entity.blockPosition());
+ this.spawnCobwebsRandomlyAround(level, entity.getRandom(), entity.blockPosition(), entity); // Paper - Fire EntityChangeBlockEvent in more places
2021-08-10 05:45:46 +02:00
}
}
2024-12-14 22:12:42 +01:00
- private void spawnCobwebsRandomlyAround(ServerLevel level, RandomSource random, BlockPos pos) {
+ private void spawnCobwebsRandomlyAround(ServerLevel level, RandomSource random, BlockPos pos, LivingEntity entity) { // Paper - Fire EntityChangeBlockEvent in more places
2021-08-10 05:45:46 +02:00
Set<BlockPos> set = Sets.newHashSet();
int i = this.maxCobwebs.applyAsInt(random);
2024-12-14 22:12:42 +01:00
@@ -46,6 +_,7 @@
2021-08-10 05:45:46 +02:00
}
2024-12-14 22:12:42 +01:00
for (BlockPos blockPosx : set) {
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(entity, blockPosx, Blocks.COBWEB.defaultBlockState())) continue; // Paper - Fire EntityChangeBlockEvent in more places
level.setBlock(blockPosx, Blocks.COBWEB.defaultBlockState(), 3);
level.levelEvent(3018, blockPosx, 0);
2021-08-10 05:45:46 +02:00
}