use of com.denizenscript.denizen.objects.MaterialTag in project Denizen-For-Bukkit by DenizenScript.
the class EntityChangesBlockScriptEvent method onEntityChangesBlock.
@EventHandler
public void onEntityChangesBlock(EntityChangeBlockEvent event) {
entity = new EntityTag(event.getEntity());
location = new LocationTag(event.getBlock().getLocation());
old_material = new MaterialTag(location.getBlock());
new_material = new MaterialTag(event.getTo());
this.event = event;
fire(event);
}
use of com.denizenscript.denizen.objects.MaterialTag in project Denizen-For-Bukkit by DenizenScript.
the class BlockBurnsScriptEvent method onBlockBurns.
@EventHandler
public void onBlockBurns(BlockBurnEvent event) {
location = new LocationTag(event.getBlock().getLocation());
material = new MaterialTag(event.getBlock());
this.event = event;
fire(event);
}
use of com.denizenscript.denizen.objects.MaterialTag in project Denizen-For-Bukkit by DenizenScript.
the class BlockFallsScriptEvent method onBlockFalls.
@EventHandler
public void onBlockFalls(EntityChangeBlockEvent event) {
if (event.getEntityType() != EntityType.FALLING_BLOCK) {
return;
}
location = new LocationTag(event.getBlock().getLocation());
material = new MaterialTag(event.getBlock());
this.event = event;
fire(event);
}
use of com.denizenscript.denizen.objects.MaterialTag in project Denizen-For-Bukkit by DenizenScript.
the class BlockFormsScriptEvent method onBlockForms.
@EventHandler
public void onBlockForms(BlockFormEvent event) {
location = new LocationTag(event.getBlock().getLocation());
material = new MaterialTag(event.getNewState());
this.event = event;
fire(event);
}
use of com.denizenscript.denizen.objects.MaterialTag in project Denizen-For-Bukkit by DenizenScript.
the class PacketHelperImpl method showSignEditor.
@Override
public boolean showSignEditor(Player player, Location location) {
if (location == null) {
LocationTag fakeSign = new LocationTag(player.getLocation());
fakeSign.setY(0);
FakeBlock.showFakeBlockTo(Collections.singletonList(new PlayerTag(player)), fakeSign, new MaterialTag(org.bukkit.Material.OAK_WALL_SIGN), new DurationTag(1), true);
BlockPosition pos = new BlockPosition(fakeSign.getX(), 0, fakeSign.getZ());
((DenizenNetworkManagerImpl) ((CraftPlayer) player).getHandle().playerConnection.networkManager).packetListener.fakeSignExpected = pos;
sendPacket(player, new PacketPlayOutOpenSignEditor(pos));
return true;
}
TileEntity tileEntity = ((CraftWorld) location.getWorld()).getHandle().getTileEntity(new BlockPosition(location.getBlockX(), location.getBlockY(), location.getBlockZ()));
if (tileEntity instanceof TileEntitySign) {
TileEntitySign sign = (TileEntitySign) tileEntity;
// Prevent client crashing by sending current state of the sign
sendPacket(player, sign.getUpdatePacket());
sign.isEditable = true;
sign.a((EntityHuman) ((CraftPlayer) player).getHandle());
sendPacket(player, new PacketPlayOutOpenSignEditor(sign.getPosition()));
return true;
} else {
return false;
}
}
Aggregations