3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-18 12:30:06 +01:00
Dieser Commit ist enthalten in:
Taylor Kelly 2011-01-26 16:13:27 -05:00
Ursprung 7a898bdba8
Commit f11e575a72

Datei anzeigen

@ -7,6 +7,7 @@ import org.bukkit.event.block.BlockIgniteEvent;
import org.bukkit.event.block.BlockIgniteEvent.IgniteCause; import org.bukkit.event.block.BlockIgniteEvent.IgniteCause;
import org.bukkit.craftbukkit.CraftWorld; import org.bukkit.craftbukkit.CraftWorld;
import java.util.Random; import java.util.Random;
import org.bukkit.event.block.BlockBurnEvent;
// CraftBukkit end // CraftBukkit end
public class BlockFire extends Block { public class BlockFire extends Block {
@ -116,13 +117,16 @@ public class BlockFire extends Block {
if (random.nextInt(l) < i1) { if (random.nextInt(l) < i1) {
boolean flag = world.a(i, j, k) == Block.am.bi; boolean flag = world.a(i, j, k) == Block.am.bi;
// CraftBukkit start: BlockBurnEvent
if (random.nextInt(2) == 0) {
// CraftBukkit start: Call to stop very slow spread of fire.
Server server = ((WorldServer)world).getServer(); Server server = ((WorldServer)world).getServer();
CraftWorld cworld = ((WorldServer)world).getWorld(); CraftWorld cworld = ((WorldServer)world).getWorld();
org.bukkit.block.Block theBlock = (cworld.getBlockAt(i, j, k)); org.bukkit.block.Block theBlock = (cworld.getBlockAt(i, j, k));
BlockBurnEvent burnEvent = new BlockBurnEvent(theBlock);
server.getPluginManager().callEvent(burnEvent);
if(!burnEvent.isCancelled()) {
if (random.nextInt(2) == 0) {
// CraftBukkit start: Call to stop very slow spread of fire.
IgniteCause igniteCause = BlockIgniteEvent.IgniteCause.SLOW_SPREAD; IgniteCause igniteCause = BlockIgniteEvent.IgniteCause.SLOW_SPREAD;
Player thePlayer = null; Player thePlayer = null;
@ -142,6 +146,8 @@ public class BlockFire extends Block {
Block.am.a(world, i, j, k, 0); Block.am.a(world, i, j, k, 0);
} }
} }
// CraftBukkit end: BlockBurnEvent
}
} }
private boolean g(World world, int i, int j, int k) { private boolean g(World world, int i, int j, int k) {