SPIGOT-7068: SKULK and SKULK_VEIN BlockSpreadEvents Still do not reference the correct source (SKULK_CATALYST)
By: DerFrZocker <derrieple@gmail.com>
This commit is contained in:
@@ -768,6 +768,7 @@ public class CraftEventFactory {
|
||||
return handleBlockSpreadEvent(world, source, target, block, 2);
|
||||
}
|
||||
|
||||
public static BlockPosition sourceBlockOverride = null; // SPIGOT-7068: Add source block override, not the most elegant way but better than passing down a BlockPosition up to five methods deep.
|
||||
public static boolean handleBlockSpreadEvent(GeneratorAccess world, BlockPosition source, BlockPosition target, IBlockData block, int flag) {
|
||||
// Suppress during worldgen
|
||||
if (!(world instanceof World)) {
|
||||
@@ -778,7 +779,7 @@ public class CraftEventFactory {
|
||||
CraftBlockState state = CraftBlockStates.getBlockState(world, target, flag);
|
||||
state.setData(block);
|
||||
|
||||
BlockSpreadEvent event = new BlockSpreadEvent(state.getBlock(), CraftBlock.at(world, source), state);
|
||||
BlockSpreadEvent event = new BlockSpreadEvent(state.getBlock(), CraftBlock.at(world, sourceBlockOverride != null ? sourceBlockOverride : source), state);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
|
||||
if (!event.isCancelled()) {
|
||||
|
||||
Reference in New Issue
Block a user