cn.nukkit.blockentity.BlockEntityBeacon Java Examples
The following examples show how to use
cn.nukkit.blockentity.BlockEntityBeacon.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Server.java From Jupiter with GNU General Public License v3.0 | 6 votes |
private void registerBlockEntities() { BlockEntity.registerBlockEntity(BlockEntity.FURNACE, BlockEntityFurnace.class); BlockEntity.registerBlockEntity(BlockEntity.CHEST, BlockEntityChest.class); BlockEntity.registerBlockEntity(BlockEntity.SIGN, BlockEntitySign.class); BlockEntity.registerBlockEntity(BlockEntity.ENCHANT_TABLE, BlockEntityEnchantTable.class); BlockEntity.registerBlockEntity(BlockEntity.SKULL, BlockEntitySkull.class); BlockEntity.registerBlockEntity(BlockEntity.FLOWER_POT, BlockEntityFlowerPot.class); BlockEntity.registerBlockEntity(BlockEntity.BREWING_STAND, BlockEntityBrewingStand.class); BlockEntity.registerBlockEntity(BlockEntity.ITEM_FRAME, BlockEntityItemFrame.class); BlockEntity.registerBlockEntity(BlockEntity.CAULDRON, BlockEntityCauldron.class); BlockEntity.registerBlockEntity(BlockEntity.ENDER_CHEST, BlockEntityEnderChest.class); BlockEntity.registerBlockEntity(BlockEntity.BEACON, BlockEntityBeacon.class); BlockEntity.registerBlockEntity(BlockEntity.SHULKER_BOX, BlockEntityShulkerBox.class); BlockEntity.registerBlockEntity(BlockEntity.MOB_SPAWNER, BlockEntityMobSpawner.class); BlockEntity.registerBlockEntity(BlockEntity.DISPENSER, BlockEntityDispenser.class); BlockEntity.registerBlockEntity(BlockEntity.DROPPER, BlockEntityDropper.class); BlockEntity.registerBlockEntity(BlockEntity.COMMAND_BLOCK, BlockEntityCommandBlock.class); BlockEntity.registerBlockEntity(BlockEntity.BANNER, BlockEntityBanner.class); }
Example #2
Source File: BlockBeacon.java From Nukkit with GNU General Public License v3.0 | 6 votes |
@Override public boolean place(Item item, Block block, Block target, BlockFace face, double fx, double fy, double fz, Player player) { boolean blockSuccess = super.place(item, block, target, face, fx, fy, fz, player); if (blockSuccess) { CompoundTag nbt = new CompoundTag("") .putString("id", BlockEntity.BEACON) .putInt("x", (int) this.x) .putInt("y", (int) this.y) .putInt("z", (int) this.z); BlockEntityBeacon beacon = (BlockEntityBeacon) BlockEntity.createBlockEntity(BlockEntity.BEACON, this.getLevel().getChunk((int) (this.x) >> 4, (int) (this.z) >> 4), nbt); if (beacon == null) { return false; } } return blockSuccess; }
Example #3
Source File: BlockBeacon.java From Jupiter with GNU General Public License v3.0 | 5 votes |
@Override public boolean place(Item item, Block block, Block target, BlockFace face, double fx, double fy, double fz, Player player) { boolean blockSuccess = super.place(item, block, target, face, fx, fy, fz, player); if (blockSuccess) { CompoundTag nbt = new CompoundTag("") .putString("id", BlockEntity.BEACON) .putInt("x", (int) this.x) .putInt("y", (int) this.y) .putInt("z", (int) this.z); new BlockEntityBeacon(this.level.getChunk((int) this.x >> 4, (int) this.z >> 4), nbt); } return blockSuccess; }
Example #4
Source File: BlockBeacon.java From Nukkit with GNU General Public License v3.0 | 5 votes |
@Override public boolean place(Item item, Block block, Block target, BlockFace face, double fx, double fy, double fz, Player player) { boolean blockSuccess = super.place(item, block, target, face, fx, fy, fz, player); if (blockSuccess) { CompoundTag nbt = new CompoundTag("") .putString("id", BlockEntity.BEACON) .putInt("x", (int) this.x) .putInt("y", (int) this.y) .putInt("z", (int) this.z); new BlockEntityBeacon(this.level.getChunk((int) this.x >> 4, (int) this.z >> 4), nbt); } return blockSuccess; }