13
0
geforkt von Mirrors/Paper

Changed it so we store both the block and the face for speed

By: durron597 <martin.jared@gmail.com>
Dieser Commit ist enthalten in:
Bukkit/Spigot 2010-12-31 09:07:12 -05:00
Ursprung fe393aa73d
Commit a0acf45461

Datei anzeigen

@ -8,11 +8,13 @@ import org.bukkit.event.Event;
* Holds information for events with a source block and a destination block * Holds information for events with a source block and a destination block
*/ */
public class BlockFromToEvent extends BlockEvent { public class BlockFromToEvent extends BlockEvent {
protected BlockFace face; protected Block from;
protected BlockFace face;
public BlockFromToEvent(final Event.Type type, final Block block, final BlockFace face) { public BlockFromToEvent(final Event.Type type, final Block block, final BlockFace face) {
super(type, block); super(type, block);
this.face = face; this.face = face;
this.from = block.getRelative(face.getModX(), face.getModY(), face.getModZ());
} }
/** /**
@ -29,7 +31,7 @@ public class BlockFromToEvent extends BlockEvent {
* *
* @return Block the faced block * @return Block the faced block
*/ */
public Block getFacedBlock() { public Block getFromBlock() {
return block.getRelative(face.getModX(), face.getModY(), face.getModZ()); return from;
} }
} }