mirror of
https://github.com/GTNewHorizons/CraftTweaker.git
synced 2026-11-24 22:04:23 +00:00
Does not mean the added functions are implemented in the prior versions, but it means they all compile against the same API and ZS version
88 lines
1.7 KiB
Java
88 lines
1.7 KiB
Java
package minetweaker.api.event;
|
|
|
|
import minetweaker.api.block.IBlock;
|
|
import minetweaker.api.player.IPlayer;
|
|
import minetweaker.api.world.*;
|
|
import stanhebben.zenscript.annotations.*;
|
|
|
|
/**
|
|
* @author Stan
|
|
*/
|
|
@ZenClass("minetweaker.event.PlayerBonemealEvent")
|
|
public class PlayerBonemealEvent {
|
|
|
|
private final IPlayer player;
|
|
private final IBlockGroup blocks;
|
|
private final int x;
|
|
private final int y;
|
|
private final int z;
|
|
private boolean canceled;
|
|
private boolean processed;
|
|
|
|
public PlayerBonemealEvent(IPlayer player, IBlockGroup blocks, int x, int y, int z) {
|
|
this.player = player;
|
|
this.blocks = blocks;
|
|
this.x = x;
|
|
this.y = y;
|
|
this.z = z;
|
|
|
|
canceled = false;
|
|
processed = false;
|
|
}
|
|
|
|
@ZenMethod
|
|
public void cancel() {
|
|
canceled = true;
|
|
}
|
|
|
|
@ZenMethod
|
|
public void process() {
|
|
processed = true;
|
|
}
|
|
|
|
@ZenGetter("canceled")
|
|
public boolean isCanceled() {
|
|
return canceled;
|
|
}
|
|
|
|
@ZenGetter("processed")
|
|
public boolean isProcessed() {
|
|
return processed;
|
|
}
|
|
|
|
@ZenGetter("player")
|
|
public IPlayer getPlayer() {
|
|
return player;
|
|
}
|
|
|
|
@ZenGetter("blocks")
|
|
public IBlockGroup getBlocks() {
|
|
return blocks;
|
|
}
|
|
|
|
@ZenGetter("x")
|
|
public int getX() {
|
|
return x;
|
|
}
|
|
|
|
@ZenGetter("y")
|
|
public int getY() {
|
|
return y;
|
|
}
|
|
|
|
@ZenGetter("z")
|
|
public int getZ() {
|
|
return z;
|
|
}
|
|
|
|
@ZenGetter("block")
|
|
public IBlock getBlock() {
|
|
return blocks.getBlock(x, y, z);
|
|
}
|
|
|
|
@ZenGetter("dimension")
|
|
public IDimension getDimension() {
|
|
return blocks.getDimension();
|
|
}
|
|
}
|