mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-05 18:27:17 +01:00
SPIGOT-7475: Don't fire SculkBloomEvent during world generation
By: DerFrZocker <derrieple@gmail.com>
This commit is contained in:
parent
2402d5edb4
commit
dc3bd245f7
1 changed files with 11 additions and 8 deletions
|
@ -41,24 +41,27 @@
|
|||
Logger logger = SculkSpreader.LOGGER;
|
||||
|
||||
Objects.requireNonNull(logger);
|
||||
@@ -146,6 +155,16 @@
|
||||
@@ -146,6 +155,19 @@
|
||||
|
||||
private void addCursor(SculkSpreader.a sculkspreader_a) {
|
||||
if (this.cursors.size() < 32) {
|
||||
+ // CraftBukkit start
|
||||
+ CraftBlock bukkitBlock = CraftBlock.at(level, sculkspreader_a.pos);
|
||||
+ SculkBloomEvent event = new SculkBloomEvent(bukkitBlock, sculkspreader_a.getCharge());
|
||||
+ Bukkit.getPluginManager().callEvent(event);
|
||||
+ if (event.isCancelled())
|
||||
+ return;
|
||||
+ if (!isWorldGeneration()) { // CraftBukkit - SPIGOT-7475: Don't call event during world generation
|
||||
+ CraftBlock bukkitBlock = CraftBlock.at(level, sculkspreader_a.pos);
|
||||
+ SculkBloomEvent event = new SculkBloomEvent(bukkitBlock, sculkspreader_a.getCharge());
|
||||
+ Bukkit.getPluginManager().callEvent(event);
|
||||
+ if (event.isCancelled()) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ sculkspreader_a.charge = event.getCharge();
|
||||
+ sculkspreader_a.charge = event.getCharge();
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
this.cursors.add(sculkspreader_a);
|
||||
}
|
||||
}
|
||||
@@ -241,7 +260,7 @@
|
||||
@@ -241,7 +263,7 @@
|
||||
this.charge = i;
|
||||
this.decayDelay = j;
|
||||
this.updateDelay = k;
|
||||
|
|
Loading…
Reference in a new issue