mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-05-27 08:23:50 +00:00
blockstate, more block events, command preprocess event.
This commit is contained in:
parent
21b5accc69
commit
18a673bd46
34 changed files with 1359 additions and 58 deletions
|
|
@ -0,0 +1,30 @@
|
|||
namespace Minecraft.Server.FourKit.Event.Block;
|
||||
|
||||
using Minecraft.Server.FourKit.Block;
|
||||
|
||||
/// <summary>
|
||||
/// Called when a piston retracts.
|
||||
/// </summary>
|
||||
public class BlockPistonRetractEvent : BlockPistonEvent
|
||||
{
|
||||
internal BlockPistonRetractEvent(Block block, BlockFace direction)
|
||||
: base(block, direction)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the location where the possible moving block might be if the
|
||||
/// retracting piston is sticky.
|
||||
/// </summary>
|
||||
/// <returns>The possible location of the possibly moving block.</returns>
|
||||
public Location getRetractLocation()
|
||||
{
|
||||
var block = getBlock();
|
||||
var dir = getDirection();
|
||||
return new Location(
|
||||
block.getWorld(),
|
||||
block.getX() + dir.getModX() * 2,
|
||||
block.getY() + dir.getModY() * 2,
|
||||
block.getZ() + dir.getModZ() * 2);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue