Cat has luckily since stopped singing

This commit is contained in:
Nassim Jahnke
2024-12-18 10:27:19 +01:00
parent e97bf6933c
commit 9d837fe4b6
2 changed files with 9 additions and 16 deletions

View File

@@ -1,10 +1,7 @@
--- a/net/minecraft/world/entity/item/FallingBlockEntity.java
+++ b/net/minecraft/world/entity/item/FallingBlockEntity.java
@@ -47,8 +_,14 @@
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.HitResult;
@@ -49,6 +_,11 @@
import net.minecraft.world.phys.Vec3;
+import org.bukkit.event.entity.CreatureSpawnEvent;
import org.slf4j.Logger;
+// CraftBukkit start;
@@ -28,20 +25,23 @@
public static FallingBlockEntity fall(Level level, BlockPos pos, BlockState blockState) {
+ // CraftBukkit start
+ return FallingBlockEntity.fall(level, pos, blockState, CreatureSpawnEvent.SpawnReason.DEFAULT);
+ return FallingBlockEntity.fall(level, pos, blockState, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.DEFAULT);
+ }
+ public static FallingBlockEntity fall(Level level, BlockPos pos, BlockState blockState, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason spawnReason) {
+ public static FallingBlockEntity fall(Level level, BlockPos pos, BlockState blockState, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason creatureSpawnReason) {
FallingBlockEntity fallingBlockEntity = new FallingBlockEntity(
level,
pos.getX() + 0.5,
@@ -89,6 +_,7 @@
@@ -89,8 +_,9 @@
? blockState.setValue(BlockStateProperties.WATERLOGGED, Boolean.valueOf(false))
: blockState
);
+ if (!CraftEventFactory.callEntityChangeBlockEvent(fallingBlockEntity, pos, blockState.getFluidState().createLegacyBlock())) return fallingBlockEntity; // CraftBukkit
level.setBlock(pos, blockState.getFluidState().createLegacyBlock(), 3);
level.addFreshEntity(fallingBlockEntity);
- level.addFreshEntity(fallingBlockEntity);
+ level.addFreshEntity(fallingBlockEntity, creatureSpawnReason); // CraftBukkit
return fallingBlockEntity;
}
@@ -139,13 +_,22 @@
@Override
public void tick() {