#1522: Call BlockFormEvent when an Eyeblossom opens or closes
This commit is contained in:
parent
665900b914
commit
a7eb3fdfd8
@ -0,0 +1,21 @@
|
||||
--- a/net/minecraft/world/level/block/BlockFlowerPot.java
|
||||
+++ b/net/minecraft/world/level/block/BlockFlowerPot.java
|
||||
@@ -137,11 +137,14 @@
|
||||
boolean flag1 = CreakingHeartBlock.isNaturalNight(worldserver);
|
||||
|
||||
if (flag != flag1) {
|
||||
- worldserver.setBlock(blockposition, this.opposite(iblockdata), 3);
|
||||
- EyeblossomBlock.a eyeblossomblock_a = EyeblossomBlock.a.fromBoolean(flag).transform();
|
||||
+ // CraftBukkit start - BlockFormEvent
|
||||
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(worldserver, blockposition, this.opposite(iblockdata), 3)) {
|
||||
+ EyeblossomBlock.a eyeblossomblock_a = EyeblossomBlock.a.fromBoolean(flag).transform();
|
||||
|
||||
- eyeblossomblock_a.spawnTransformParticle(worldserver, blockposition, randomsource);
|
||||
- worldserver.playSound((EntityHuman) null, blockposition, eyeblossomblock_a.longSwitchSound(), SoundCategory.BLOCKS, 1.0F, 1.0F);
|
||||
+ eyeblossomblock_a.spawnTransformParticle(worldserver, blockposition, randomsource);
|
||||
+ worldserver.playSound((EntityHuman) null, blockposition, eyeblossomblock_a.longSwitchSound(), SoundCategory.BLOCKS, 1.0F, 1.0F);
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,15 @@
|
||||
--- a/net/minecraft/world/level/block/EyeblossomBlock.java
|
||||
+++ b/net/minecraft/world/level/block/EyeblossomBlock.java
|
||||
@@ -88,7 +88,11 @@
|
||||
} else {
|
||||
EyeblossomBlock.a eyeblossomblock_a = this.type.transform();
|
||||
|
||||
- worldserver.setBlock(blockposition, eyeblossomblock_a.state(), 3);
|
||||
+ // CraftBukkit start - BlockFormEvent
|
||||
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(worldserver, blockposition, eyeblossomblock_a.state(), 3)) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
worldserver.gameEvent((Holder) GameEvent.BLOCK_CHANGE, blockposition, GameEvent.a.of(iblockdata));
|
||||
eyeblossomblock_a.spawnTransformParticle(worldserver, blockposition, randomsource);
|
||||
BlockPosition.betweenClosed(blockposition.offset(-3, -2, -3), blockposition.offset(3, 2, 3)).forEach((blockposition1) -> {
|
Loading…
x
Reference in New Issue
Block a user