use of net.minecraft.server.v1_13_R1.IBlockData in project RoseStacker by Rosewood-Development.
the class StackedSpawnerTileImpl method setSpawnData.
@Override
public void setSpawnData(MobSpawnerData var0) {
super.setSpawnData(var0);
if (this.a() != null) {
IBlockData var1 = this.a().getType(this.b());
this.a().notify(this.blockPos, var1, var1, 4);
}
}
use of net.minecraft.server.v1_13_R1.IBlockData in project RoseStacker by Rosewood-Development.
the class StackedSpawnerTileImpl method setSpawnData.
@Override
public void setSpawnData(MobSpawnerData var0) {
super.setSpawnData(var0);
if (this.a() != null) {
IBlockData var1 = this.a().getType(this.b());
this.a().notify(this.blockPos, var1, var1, 4);
}
}
use of net.minecraft.server.v1_13_R1.IBlockData in project SSB-OneBlock by BG-Software-LLC.
the class NMSAdapter_v1_12_R1 method setBlock.
@Override
public void setBlock(Location location, Material type, byte data, String nbt) {
assert location.getWorld() != null;
World worldServer = ((CraftWorld) location.getWorld()).getHandle();
BlockPosition blockPosition = new BlockPosition(location.getBlockX(), location.getBlockY(), location.getBlockZ());
worldServer.s(blockPosition);
org.bukkit.block.Block bukkitBlock = location.getBlock();
bukkitBlock.setType(type);
if (data > 0)
// noinspection deprecation
bukkitBlock.setData(data);
if (nbt != null) {
try {
Block block = worldServer.getType(blockPosition).getBlock();
IBlockData blockData = CommandAbstract.a(block, nbt);
worldServer.setTypeAndData(blockPosition, blockData, 2);
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
use of net.minecraft.server.v1_13_R1.IBlockData in project SSB-OneBlock by BG-Software-LLC.
the class NMSAdapter_v1_15_R1 method simulateToolBreak.
@Override
public void simulateToolBreak(Player bukkitPlayer, org.bukkit.block.Block bukkitBlock) {
EntityPlayer entityPlayer = ((CraftPlayer) bukkitPlayer).getHandle();
ItemStack itemStack = entityPlayer.getItemInMainHand();
WorldServer worldServer = ((CraftWorld) bukkitBlock.getWorld()).getHandle();
BlockPosition blockPosition = new BlockPosition(bukkitBlock.getX(), bukkitBlock.getY(), bukkitBlock.getZ());
IBlockData blockData = worldServer.getType(blockPosition);
assert itemStack != null;
itemStack.a(worldServer, blockData, blockPosition, entityPlayer);
}
use of net.minecraft.server.v1_13_R1.IBlockData in project SSB-OneBlock by BG-Software-LLC.
the class NMSAdapter_v1_8_R3 method setBlock.
@Override
public void setBlock(Location location, Material type, byte data, String nbt) {
assert location.getWorld() != null;
World worldServer = ((CraftWorld) location.getWorld()).getHandle();
BlockPosition blockPosition = new BlockPosition(location.getBlockX(), location.getBlockY(), location.getBlockZ());
worldServer.t(blockPosition);
org.bukkit.block.Block bukkitBlock = location.getBlock();
bukkitBlock.setType(type);
if (data > 0)
// noinspection deprecation
bukkitBlock.setData(data);
if (nbt != null) {
try {
Block block = worldServer.getType(blockPosition).getBlock();
IBlockData blockData = block.fromLegacyData(CommandAbstract.a(nbt, 0, 15));
worldServer.setTypeAndData(blockPosition, blockData, 2);
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
Aggregations