Search in sources :

Example 1 with BlockFence

use of net.glowstone.block.blocktype.BlockFence in project Glowstone by GlowstoneMC.

the class ItemTable method registerBuiltins.

// //////////////////////////////////////////////////////////////////////////
// Registration
private void registerBuiltins() {
    // TODO: Some new materials in 1.13 may be missing, although most are covered as part of
    // MaterialUtil sets.
    // Blocks:
    reg(Material.FLOWER_POT, new BlockFlowerPot());
    reg(Material.JUKEBOX, new BlockJukebox());
    reg(Material.NOTE_BLOCK, new BlockNote());
    reg(Material.SPAWNER, new BlockMobSpawner());
    regAll(MaterialTags.INFESTED_BLOCKS, new BlockMonsterEgg());
    reg(Material.DRAGON_EGG, new BlockFalling(Material.DRAGON_EGG));
    regAll(Tag.SIGNS, BlockSign::new, Sound.BLOCK_WOOD_BREAK);
    regAll(Tag.WALL_SIGNS, BlockSign::new, Sound.BLOCK_WOOD_BREAK);
    reg(Material.CRAFTING_TABLE, new BlockWorkbench(), Sound.BLOCK_WOOD_BREAK);
    reg(Material.ENDER_CHEST, new BlockEnderChest());
    reg(Material.CHEST, new BlockChest(), Sound.BLOCK_WOOD_BREAK);
    reg(Material.TRAPPED_CHEST, new BlockChest(true), Sound.BLOCK_WOOD_BREAK);
    reg(Material.DISPENSER, new BlockDispenser());
    reg(Material.DROPPER, new BlockDropper());
    reg(Material.BOOKSHELF, new BlockDirectDrops(Material.BOOK, 3), Sound.BLOCK_WOOD_BREAK);
    reg(Material.CLAY, new BlockDirectDrops(Material.CLAY_BALL, 4), Sound.BLOCK_GRAVEL_BREAK);
    regAll(MaterialTags.STAINED_TERRACOTTA, new BlockDirectDrops(ToolType.PICKAXE));
    regAll(MaterialTags.GLAZED_TERRACOTTA, new BlockDirectDrops(ToolType.PICKAXE));
    regAll(Tag.WOODEN_DOORS, BlockDoor::new, Sound.BLOCK_WOOD_BREAK);
    reg(Material.IRON_DOOR, new BlockDoor(Material.IRON_DOOR));
    reg(Material.FARMLAND, new BlockFarmland(), Sound.BLOCK_GRAVEL_BREAK);
    reg(Material.GLASS, new BlockDropless());
    reg(Material.GLASS_PANE, new BlockDropless());
    regAll(MaterialTags.STAINED_GLASS, new BlockDropless());
    regAll(MaterialTags.STAINED_GLASS_PANES, new BlockDropless());
    reg(Material.GLOWSTONE, new BlockRandomDrops(Material.GLOWSTONE_DUST, 2, 4));
    reg(Material.MYCELIUM, new BlockMycel(), Sound.BLOCK_GRAVEL_BREAK);
    reg(Material.GRASS, new BlockGrass(), Sound.BLOCK_GRASS_BREAK);
    reg(Material.DIRT, new BlockDirt(), Sound.BLOCK_GRAVEL_BREAK);
    reg(Material.GRAVEL, new BlockGravel(), Sound.BLOCK_GRAVEL_BREAK);
    reg(Material.SAND, new BlockFalling(Material.SAND), Sound.BLOCK_SAND_BREAK);
    reg(Material.ANVIL, new BlockAnvil());
    reg(Material.ICE, new BlockIce());
    reg(Material.PACKED_ICE, new BlockDropless());
    reg(Material.SNOW, new BlockSnow(), Sound.BLOCK_SNOW_BREAK);
    reg(Material.SNOW_BLOCK, new BlockSnowBlock(), Sound.BLOCK_SNOW_BREAK);
    reg(Material.PRISMARINE, new BlockDirectDrops(ToolType.PICKAXE));
    reg(Material.RED_SANDSTONE, new BlockDirectDrops(ToolType.PICKAXE));
    reg(Material.SANDSTONE, new BlockDirectDrops(ToolType.PICKAXE));
    reg(Material.NETHER_BRICK, new BlockDirectDrops(ToolType.PICKAXE));
    reg(Material.NETHER_BRICK_FENCE, new BlockFence(Material.NETHER_BRICK_FENCE, ToolType.PICKAXE));
    regAll(Tag.WOODEN_FENCES, BlockFence::new);
    reg(Material.NETHERRACK, new BlockDirectDrops(ToolType.PICKAXE));
    // TODO: Convert
    reg(Material.IRON_BARS, new BlockDirectDrops(ToolType.PICKAXE));
    reg(Material.BRICK, new BlockDirectDrops(ToolType.PICKAXE));
    // TODO: Convert
    reg(Material.LEGACY_SMOOTH_BRICK, new BlockDirectDrops(ToolType.PICKAXE));
    reg(Material.END_STONE, new BlockDirectDrops(ToolType.PICKAXE));
    reg(Material.COBBLESTONE, new BlockDirectDrops(ToolType.PICKAXE));
    reg(Material.COBBLESTONE_WALL, new BlockDirectDrops(ToolType.PICKAXE));
    reg(Material.MOSSY_COBBLESTONE, new BlockDirectDrops(ToolType.PICKAXE));
    reg(Material.STONE, new BlockStone());
    reg(Material.OBSIDIAN, new BlockDirectDrops(ToolType.DIAMOND_PICKAXE));
    reg(Material.COAL_ORE, new BlockOre(Material.COAL, ToolType.PICKAXE));
    reg(Material.COAL_BLOCK, new BlockDirectDrops(ToolType.PICKAXE));
    reg(Material.IRON_ORE, new BlockDirectDrops(ToolType.STONE_PICKAXE));
    reg(Material.IRON_BLOCK, new BlockDirectDrops(ToolType.STONE_PICKAXE));
    reg(Material.GOLD_ORE, new BlockDirectDrops(ToolType.IRON_PICKAXE));
    reg(Material.GOLD_BLOCK, new BlockDirectDrops(ToolType.IRON_PICKAXE));
    reg(Material.DIAMOND_ORE, new BlockOre(Material.DIAMOND, ToolType.IRON_PICKAXE));
    reg(Material.DIAMOND_BLOCK, new BlockDirectDrops(ToolType.IRON_PICKAXE));
    reg(Material.EMERALD_ORE, new BlockOre(Material.EMERALD, ToolType.IRON_PICKAXE));
    reg(Material.EMERALD_BLOCK, new BlockDirectDrops(ToolType.PICKAXE));
    reg(Material.LAPIS_ORE, new BlockOre(Material.LAPIS_LAZULI, ToolType.STONE_PICKAXE, 4, 4, 8));
    reg(Material.LAPIS_BLOCK, new BlockDirectDrops(ToolType.STONE_PICKAXE));
    reg(Material.NETHER_QUARTZ_ORE, new BlockOre(Material.QUARTZ, ToolType.PICKAXE));
    reg(Material.REDSTONE_ORE, new BlockRedstoneOre());
    reg(Material.REDSTONE_BLOCK, new BlockDirectDrops(ToolType.PICKAXE));
    reg(Material.CARROT, new BlockCarrot(), Sound.BLOCK_GRASS_BREAK);
    reg(Material.COCOA, new BlockCocoa(), Sound.BLOCK_WOOD_BREAK);
    reg(Material.DEAD_BUSH, new BlockDeadBush(), Sound.BLOCK_GRASS_BREAK);
    reg(Material.TALL_GRASS, new BlockTallGrass(), Sound.BLOCK_GRASS_BREAK);
    reg(Material.RED_MUSHROOM_BLOCK, new BlockHugeMushroom(true), Sound.BLOCK_WOOD_BREAK);
    reg(Material.BROWN_MUSHROOM_BLOCK, new BlockHugeMushroom(false), Sound.BLOCK_WOOD_BREAK);
    regAll(Tag.LEAVES, new BlockLeaves(), Sound.BLOCK_GRASS_BREAK);
    reg(Material.MELON, new BlockMelon(), Sound.BLOCK_WOOD_BREAK);
    reg(Material.MELON_STEM, new BlockStem(Material.MELON_STEM), Sound.BLOCK_GRASS_BREAK);
    reg(Material.NETHER_WART, new BlockNetherWart(), Sound.BLOCK_GRASS_BREAK);
    reg(Material.POTATO, new BlockPotato(), Sound.BLOCK_GRASS_BREAK);
    reg(Material.PUMPKIN_STEM, new BlockStem(Material.PUMPKIN_STEM), Sound.BLOCK_GRASS_BREAK);
    reg(Material.WHEAT, new BlockCrops(), Sound.BLOCK_GRASS_BREAK);
    reg(Material.CAKE, new BlockDropless(), Sound.BLOCK_WOOL_BREAK);
    reg(Material.COBWEB, new BlockWeb());
    reg(Material.FIRE, new BlockFire());
    reg(Material.END_PORTAL_FRAME, new BlockEnderPortalFrame());
    regAll(MaterialTags.WOODEN_GATES, new BlockFenceGate());
    regAll(Tag.TRAPDOORS, new BlockWoodenTrapDoor(), Sound.BLOCK_WOOD_BREAK);
    reg(Material.IRON_TRAPDOOR, new BlockIronTrapDoor());
    reg(Material.FURNACE, new BlockFurnace());
    reg(Material.LEVER, new BlockLever());
    reg(Material.HOPPER, new BlockHopper());
    reg(Material.PISTON, new BlockPiston(false));
    reg(Material.STICKY_PISTON, new BlockPiston(true));
    regAll(Tag.WOODEN_STAIRS, new BlockStairs(), Sound.BLOCK_WOOD_BREAK);
    regAll(Sets.difference(Tag.STAIRS.getValues(), Tag.WOODEN_STAIRS.getValues()), new BlockStairs());
    regAll(Tag.WOODEN_SLABS, new BlockSlab(), Sound.BLOCK_WOOD_BREAK);
    regAll(Sets.difference(Tag.SLABS.getValues(), Tag.WOODEN_SLABS.getValues()), new BlockSlab());
    reg(Material.HAY_BLOCK, new BlockHay());
    reg(Material.QUARTZ_BLOCK, new BlockQuartz());
    regAll(Tag.LOGS, new BlockLog(), Sound.BLOCK_WOOD_BREAK);
    reg(Material.LADDER, new BlockLadder(), Sound.BLOCK_WOOD_BREAK);
    reg(Material.VINE, new BlockVine());
    reg(Material.STONE_BUTTON, new BlockButton(Material.STONE_BUTTON));
    regAll(Tag.WOODEN_BUTTONS, BlockButton::new, Sound.BLOCK_WOOD_BREAK);
    regAll(MaterialTags.BEDS, new BlockBed());
    regAll(MaterialTags.SKULLS, new BlockSkull());
    reg(Material.TORCH, new BlockTorch());
    reg(Material.LIGHT_WEIGHTED_PRESSURE_PLATE, new BlockDirectDrops(Material.LIGHT_WEIGHTED_PRESSURE_PLATE, ToolType.PICKAXE));
    reg(Material.HEAVY_WEIGHTED_PRESSURE_PLATE, new BlockDirectDrops(Material.HEAVY_WEIGHTED_PRESSURE_PLATE, ToolType.PICKAXE));
    reg(Material.STONE_PRESSURE_PLATE, new BlockDirectDrops(Material.STONE_PRESSURE_PLATE, ToolType.PICKAXE));
    reg(Material.DAYLIGHT_DETECTOR, new BlockDaylightDetector());
    regAll(Tag.FLOWERS, new BlockNeedsAttached());
    reg(Material.BROWN_MUSHROOM, new BlockMushroom(Material.BROWN_MUSHROOM));
    reg(Material.RED_MUSHROOM, new BlockMushroom(Material.RED_MUSHROOM));
    reg(Material.SUGAR_CANE, new BlockSugarCane(), Sound.BLOCK_GRASS_BREAK);
    regAll(Tag.SAPLINGS, new BlockSapling());
    reg(Material.RAIL, new BlockRails());
    reg(Material.ACTIVATOR_RAIL, new BlockRails());
    reg(Material.DETECTOR_RAIL, new BlockRails());
    reg(Material.POWERED_RAIL, new BlockRails());
    regAll(Tag.CARPETS, new BlockCarpet(), Sound.BLOCK_WOOL_BREAK);
    reg(Material.ENCHANTING_TABLE, new BlockEnchantmentTable());
    reg(Material.BREWING_STAND, new BlockBrewingStand());
    reg(Material.CACTUS, new BlockCactus());
    reg(Material.WATER, new BlockWater());
    reg(Material.LAVA, new BlockLava());
    reg(Material.CAULDRON, new BlockCauldron());
    reg(Material.SPONGE, new BlockSponge());
    reg(Material.TNT, new BlockTnt());
    // TODO: Convert
    reg(Material.LEGACY_DOUBLE_PLANT, new BlockDoublePlant());
    reg(Material.PUMPKIN, new BlockPumpkin());
    reg(Material.JACK_O_LANTERN, new BlockPumpkinBase(Material.JACK_O_LANTERN));
    reg(Material.SEA_LANTERN, new BlockRandomDrops(Material.PRISMARINE_CRYSTALS, 2, 3));
    reg(Material.REDSTONE_LAMP, new BlockLamp());
    reg(Material.REDSTONE_WIRE, new BlockRedstone());
    reg(Material.REDSTONE_TORCH, new BlockRedstoneTorch());
    reg(Material.REPEATER, new BlockRedstoneRepeater());
    reg(Material.MAGMA_BLOCK, new BlockMagma());
    reg(Material.NETHER_WART_BLOCK, new BlockDirectDrops(Material.NETHER_WART_BLOCK, ToolType.AXE));
    reg(Material.RED_NETHER_BRICKS, new BlockDirectDrops(Material.RED_NETHER_BRICKS, ToolType.PICKAXE));
    reg(Material.BONE_BLOCK, new BlockDirectDrops(Material.BONE_BLOCK, ToolType.PICKAXE));
    reg(Material.OBSERVER, new BlockObserver());
    reg(Material.COMPARATOR, new BlockRedstoneComparator());
    reg(Material.BEACON, new BlockBeacon());
    reg(Material.PURPUR_PILLAR, new BlockPurpurPillar());
    reg(Material.PURPUR_BLOCK, new BlockDirectDrops(Material.PURPUR_BLOCK, ToolType.PICKAXE));
    reg(Material.END_ROD, new BlockEndRod());
    regAll(MaterialTags.CONCRETES, BlockDirectDrops::new);
    regAll(MaterialTags.CONCRETE_POWDER, new BlockConcretePowder());
    regAll(MaterialTags.GLAZED_TERRACOTTA, BlockDirectDrops::new);
    reg(Material.CHORUS_FLOWER, new BlockChorusFlower());
    reg(Material.CHORUS_PLANT, new BlockChorusPlant());
    reg(Material.GRASS_PATH, new BlockGrassPath(), Sound.BLOCK_GRASS_BREAK);
    // Non-block and ItemPlaceAs items:
    reg(Material.FLINT_AND_STEEL, new ItemFlintAndSteel());
    regAll(Tag.SIGNS, new ItemSign());
    reg(Material.REDSTONE, new ItemPlaceAs(Material.REDSTONE_WIRE));
    reg(Material.BREWING_STAND, new ItemPlaceAs(Material.BREWING_STAND));
    reg(Material.CAULDRON, new ItemPlaceAs(Material.CAULDRON));
    reg(Material.FLOWER_POT, new ItemPlaceAs(Material.FLOWER_POT));
    regAll(MaterialTags.SKULLS, ItemPlaceAs::new);
    reg(Material.BUCKET, new ItemBucket());
    reg(Material.WATER_BUCKET, new ItemFilledBucket(Material.WATER));
    reg(Material.LAVA_BUCKET, new ItemFilledBucket(Material.LAVA));
    reg(Material.WOODEN_HOE, new ItemHoe());
    reg(Material.STONE_HOE, new ItemHoe());
    reg(Material.IRON_HOE, new ItemHoe());
    reg(Material.GOLDEN_HOE, new ItemHoe());
    reg(Material.DIAMOND_HOE, new ItemHoe());
    reg(Material.WOODEN_SHOVEL, new ItemShovel());
    reg(Material.STONE_SHOVEL, new ItemShovel());
    reg(Material.IRON_SHOVEL, new ItemShovel());
    reg(Material.GOLDEN_SHOVEL, new ItemShovel());
    reg(Material.DIAMOND_SHOVEL, new ItemShovel());
    regAll(MaterialTags.SPAWN_EGGS, new ItemSpawn());
    reg(Material.WHEAT_SEEDS, new ItemSeeds(Material.WHEAT, Material.FARMLAND));
    reg(Material.MELON_SEEDS, new ItemSeeds(Material.MELON_STEM, Material.FARMLAND));
    reg(Material.PUMPKIN_SEEDS, new ItemSeeds(Material.PUMPKIN_STEM, Material.FARMLAND));
    reg(Material.NETHER_WART, new ItemSeeds(Material.NETHER_WART, Material.SOUL_SAND));
    reg(Material.CARROT, new ItemFoodSeeds(Material.CARROT, Material.FARMLAND, 3, 3.6f));
    reg(Material.POTATO, new ItemFoodSeeds(Material.POTATO, Material.FARMLAND, 1, 0.6f));
    reg(Material.INK_SAC, new ItemDye());
    regAll(Tag.BANNERS, new ItemBanner());
    reg(Material.IRON_DOOR, new ItemPlaceAs(Material.IRON_DOOR));
    reg(Material.WRITTEN_BOOK, new ItemWrittenBook());
    reg(Material.ITEM_FRAME, new ItemItemFrame());
    reg(Material.APPLE, new ItemFood(4, 2.4f));
    reg(Material.BAKED_POTATO, new ItemFood(5, 6f));
    reg(Material.BREAD, new ItemFood(5, 6f));
    reg(Material.COOKED_CHICKEN, new ItemFood(6, 7.2f));
    reg(Material.COOKED_COD, new ItemFishCooked());
    reg(Material.COOKED_SALMON, new ItemFishCooked());
    reg(Material.COOKED_MUTTON, new ItemFood(6, 9.6f));
    reg(Material.COOKED_BEEF, new ItemFood(8, 12.8f));
    reg(Material.COOKED_RABBIT, new ItemFood(5, 6f));
    reg(Material.COOKIE, new ItemFood(2, 0.4f));
    reg(Material.GOLDEN_APPLE, new ItemGoldenApple());
    reg(Material.GOLDEN_CARROT, new ItemFood(6, 14.4f));
    reg(Material.COOKED_PORKCHOP, new ItemFood(8, 12.8f));
    reg(Material.MELON, new ItemFood(2, 1.2f));
    reg(Material.BEETROOT, new ItemFood(1, 1.2f));
    reg(Material.BEETROOT_SOUP, new ItemSoup(6, 7.2f));
    reg(Material.MUSHROOM_STEW, new ItemSoup(6, 7.2f));
    reg(Material.POISONOUS_POTATO, new ItemPoisonousPotato());
    reg(Material.PUMPKIN_PIE, new ItemFood(8, 4.8f));
    reg(Material.RABBIT_STEW, new ItemSoup(10, 12f));
    reg(Material.BEEF, new ItemFood(3, 1.8f));
    reg(Material.CHICKEN, new ItemRawChicken());
    reg(Material.COD, new ItemFishRaw());
    reg(Material.SALMON, new ItemFishRaw());
    reg(Material.MUTTON, new ItemFood(2, 1.2f));
    reg(Material.PORKCHOP, new ItemFood(3, 1.8f));
    reg(Material.RABBIT, new ItemFood(3, 1.8f));
    reg(Material.ROTTEN_FLESH, new ItemRottenFlesh());
    reg(Material.SPIDER_EYE, new ItemSpiderEye());
    reg(Material.CHORUS_FRUIT, new ItemChorusFruit());
    reg(Material.ARMOR_STAND, new ItemArmorStand());
    reg(Material.MILK_BUCKET, new ItemMilk());
    reg(Material.MINECART, new ItemMinecart(GlowMinecart.MinecartType.RIDEABLE));
    reg(Material.COMMAND_BLOCK_MINECART, new ItemMinecart(GlowMinecart.MinecartType.COMMAND));
    reg(Material.TNT_MINECART, new ItemMinecart(GlowMinecart.MinecartType.TNT));
    reg(Material.HOPPER_MINECART, new ItemMinecart(GlowMinecart.MinecartType.HOPPER));
    reg(Material.FURNACE_MINECART, new ItemMinecart(GlowMinecart.MinecartType.FURNACE));
    reg(Material.CHEST_MINECART, new ItemMinecart(GlowMinecart.MinecartType.CHEST));
    reg(Material.SNOWBALL, new ItemSnowball());
    reg(Material.EGG, new ItemEgg());
    reg(Material.BOW, new ItemBow());
    reg(Material.EXPERIENCE_BOTTLE, new ItemExperienceBottle());
    reg(Material.END_CRYSTAL, new ItemEndCrystal());
    reg(Material.OAK_BOAT, new ItemBoat(TreeSpecies.GENERIC));
    reg(Material.SPRUCE_BOAT, new ItemBoat(TreeSpecies.REDWOOD));
    reg(Material.BIRCH_BOAT, new ItemBoat(TreeSpecies.BIRCH));
    reg(Material.JUNGLE_BOAT, new ItemBoat(TreeSpecies.JUNGLE));
    reg(Material.ACACIA_BOAT, new ItemBoat(TreeSpecies.ACACIA));
    reg(Material.DARK_OAK_BOAT, new ItemBoat(TreeSpecies.DARK_OAK));
    reg(Material.PAINTING, new ItemPainting());
    reg(Material.FIREWORK_ROCKET, new ItemFirework());
    reg(Material.ENDER_PEARL, new ItemEnderPearl());
    reg(Material.KNOWLEDGE_BOOK, new ItemKnowledgeBook());
    reg(Material.FISHING_ROD, new ItemFishingRod());
}
Also used : BlockChorusFlower(net.glowstone.block.blocktype.BlockChorusFlower) BlockOre(net.glowstone.block.blocktype.BlockOre) BlockStairs(net.glowstone.block.blocktype.BlockStairs) BlockRedstone(net.glowstone.block.blocktype.BlockRedstone) BlockFalling(net.glowstone.block.blocktype.BlockFalling) BlockDoublePlant(net.glowstone.block.blocktype.BlockDoublePlant) BlockMobSpawner(net.glowstone.block.blocktype.BlockMobSpawner) BlockDirectDrops(net.glowstone.block.blocktype.BlockDirectDrops) ItemBoat(net.glowstone.block.itemtype.ItemBoat) BlockDropper(net.glowstone.block.blocktype.BlockDropper) BlockFenceGate(net.glowstone.block.blocktype.BlockFenceGate) BlockHugeMushroom(net.glowstone.block.blocktype.BlockHugeMushroom) BlockWoodenTrapDoor(net.glowstone.block.blocktype.BlockWoodenTrapDoor) BlockHopper(net.glowstone.block.blocktype.BlockHopper) BlockConcretePowder(net.glowstone.block.blocktype.BlockConcretePowder) BlockSkull(net.glowstone.block.blocktype.BlockSkull) ItemFishingRod(net.glowstone.block.itemtype.ItemFishingRod) BlockPiston(net.glowstone.block.blocktype.BlockPiston) BlockPumpkinBase(net.glowstone.block.blocktype.BlockPumpkinBase) ItemSnowball(net.glowstone.block.itemtype.ItemSnowball) ItemFirework(net.glowstone.block.itemtype.ItemFirework) BlockStone(net.glowstone.block.blocktype.BlockStone) BlockFire(net.glowstone.block.blocktype.BlockFire) ItemSpawn(net.glowstone.block.itemtype.ItemSpawn) ItemFilledBucket(net.glowstone.block.itemtype.ItemFilledBucket) ItemFood(net.glowstone.block.itemtype.ItemFood) BlockLeaves(net.glowstone.block.blocktype.BlockLeaves) BlockMycel(net.glowstone.block.blocktype.BlockMycel) BlockSlab(net.glowstone.block.blocktype.BlockSlab) BlockPotato(net.glowstone.block.blocktype.BlockPotato) BlockMelon(net.glowstone.block.blocktype.BlockMelon) BlockCactus(net.glowstone.block.blocktype.BlockCactus) BlockNeedsAttached(net.glowstone.block.blocktype.BlockNeedsAttached) BlockRedstoneComparator(net.glowstone.block.blocktype.BlockRedstoneComparator) ItemMinecart(net.glowstone.block.itemtype.ItemMinecart) BlockDeadBush(net.glowstone.block.blocktype.BlockDeadBush) BlockSponge(net.glowstone.block.blocktype.BlockSponge) ItemGoldenApple(net.glowstone.block.itemtype.ItemGoldenApple) BlockChorusPlant(net.glowstone.block.blocktype.BlockChorusPlant) BlockRedstoneTorch(net.glowstone.block.blocktype.BlockRedstoneTorch) BlockEndRod(net.glowstone.block.blocktype.BlockEndRod) ItemHoe(net.glowstone.block.itemtype.ItemHoe) ItemChorusFruit(net.glowstone.block.itemtype.ItemChorusFruit) BlockCarpet(net.glowstone.block.blocktype.BlockCarpet) BlockBeacon(net.glowstone.block.blocktype.BlockBeacon) ItemRottenFlesh(net.glowstone.block.itemtype.ItemRottenFlesh) BlockGravel(net.glowstone.block.blocktype.BlockGravel) ItemArmorStand(net.glowstone.block.itemtype.ItemArmorStand) BlockDaylightDetector(net.glowstone.block.blocktype.BlockDaylightDetector) BlockBrewingStand(net.glowstone.block.blocktype.BlockBrewingStand) BlockChest(net.glowstone.block.blocktype.BlockChest) BlockGrass(net.glowstone.block.blocktype.BlockGrass) ItemExperienceBottle(net.glowstone.block.itemtype.ItemExperienceBottle) BlockJukebox(net.glowstone.block.blocktype.BlockJukebox) ItemPainting(net.glowstone.block.itemtype.ItemPainting) ItemDye(net.glowstone.block.itemtype.ItemDye) BlockTorch(net.glowstone.block.blocktype.BlockTorch) BlockLever(net.glowstone.block.blocktype.BlockLever) BlockEnderPortalFrame(net.glowstone.block.blocktype.BlockEnderPortalFrame) BlockRails(net.glowstone.block.blocktype.BlockRails) BlockRedstoneOre(net.glowstone.block.blocktype.BlockRedstoneOre) BlockRedstoneRepeater(net.glowstone.block.blocktype.BlockRedstoneRepeater) ItemFlintAndSteel(net.glowstone.block.itemtype.ItemFlintAndSteel) ItemFishCooked(net.glowstone.block.itemtype.ItemFishCooked) BlockEnchantmentTable(net.glowstone.block.blocktype.BlockEnchantmentTable) BlockCrops(net.glowstone.block.blocktype.BlockCrops) BlockLava(net.glowstone.block.blocktype.BlockLava) BlockAnvil(net.glowstone.block.blocktype.BlockAnvil) ItemEgg(net.glowstone.block.itemtype.ItemEgg) BlockIronTrapDoor(net.glowstone.block.blocktype.BlockIronTrapDoor) BlockLamp(net.glowstone.block.blocktype.BlockLamp) ItemEndCrystal(net.glowstone.block.itemtype.ItemEndCrystal) ItemSeeds(net.glowstone.block.itemtype.ItemSeeds) BlockNote(net.glowstone.block.blocktype.BlockNote) BlockDropless(net.glowstone.block.blocktype.BlockDropless) BlockSnowBlock(net.glowstone.block.blocktype.BlockSnowBlock) BlockSapling(net.glowstone.block.blocktype.BlockSapling) ItemSign(net.glowstone.block.itemtype.ItemSign) BlockWeb(net.glowstone.block.blocktype.BlockWeb) ItemFoodSeeds(net.glowstone.block.itemtype.ItemFoodSeeds) BlockCarrot(net.glowstone.block.blocktype.BlockCarrot) BlockStem(net.glowstone.block.blocktype.BlockStem) BlockNetherWart(net.glowstone.block.blocktype.BlockNetherWart) BlockLog(net.glowstone.block.blocktype.BlockLog) BlockPurpurPillar(net.glowstone.block.blocktype.BlockPurpurPillar) ItemWrittenBook(net.glowstone.block.itemtype.ItemWrittenBook) BlockQuartz(net.glowstone.block.blocktype.BlockQuartz) BlockWater(net.glowstone.block.blocktype.BlockWater) BlockTnt(net.glowstone.block.blocktype.BlockTnt) ItemKnowledgeBook(net.glowstone.block.itemtype.ItemKnowledgeBook) BlockSign(net.glowstone.block.blocktype.BlockSign) BlockSugarCane(net.glowstone.block.blocktype.BlockSugarCane) BlockCauldron(net.glowstone.block.blocktype.BlockCauldron) BlockPumpkin(net.glowstone.block.blocktype.BlockPumpkin) BlockDispenser(net.glowstone.block.blocktype.BlockDispenser) ItemPoisonousPotato(net.glowstone.block.itemtype.ItemPoisonousPotato) BlockMagma(net.glowstone.block.blocktype.BlockMagma) ItemEnderPearl(net.glowstone.block.itemtype.ItemEnderPearl) BlockFarmland(net.glowstone.block.blocktype.BlockFarmland) ItemSoup(net.glowstone.block.itemtype.ItemSoup) BlockVine(net.glowstone.block.blocktype.BlockVine) ItemBanner(net.glowstone.block.itemtype.ItemBanner) BlockEnderChest(net.glowstone.block.blocktype.BlockEnderChest) ItemPlaceAs(net.glowstone.block.itemtype.ItemPlaceAs) BlockRandomDrops(net.glowstone.block.blocktype.BlockRandomDrops) BlockButton(net.glowstone.block.blocktype.BlockButton) BlockLadder(net.glowstone.block.blocktype.BlockLadder) ItemBow(net.glowstone.block.itemtype.ItemBow) BlockHay(net.glowstone.block.blocktype.BlockHay) BlockDoor(net.glowstone.block.blocktype.BlockDoor) ItemShovel(net.glowstone.block.itemtype.ItemShovel) BlockFence(net.glowstone.block.blocktype.BlockFence) BlockGrassPath(net.glowstone.block.blocktype.BlockGrassPath) BlockMushroom(net.glowstone.block.blocktype.BlockMushroom) BlockSnow(net.glowstone.block.blocktype.BlockSnow) BlockFurnace(net.glowstone.block.blocktype.BlockFurnace) BlockIce(net.glowstone.block.blocktype.BlockIce) ItemRawChicken(net.glowstone.block.itemtype.ItemRawChicken) BlockWorkbench(net.glowstone.block.blocktype.BlockWorkbench) BlockObserver(net.glowstone.block.blocktype.BlockObserver) BlockCocoa(net.glowstone.block.blocktype.BlockCocoa) ItemMilk(net.glowstone.block.itemtype.ItemMilk) BlockBed(net.glowstone.block.blocktype.BlockBed) ItemItemFrame(net.glowstone.block.itemtype.ItemItemFrame) ItemBucket(net.glowstone.block.itemtype.ItemBucket) BlockFlowerPot(net.glowstone.block.blocktype.BlockFlowerPot) BlockTallGrass(net.glowstone.block.blocktype.BlockTallGrass) ItemFishRaw(net.glowstone.block.itemtype.ItemFishRaw) BlockMonsterEgg(net.glowstone.block.blocktype.BlockMonsterEgg) BlockDirt(net.glowstone.block.blocktype.BlockDirt) ItemSpiderEye(net.glowstone.block.itemtype.ItemSpiderEye)

Example 2 with BlockFence

use of net.glowstone.block.blocktype.BlockFence in project Glowstone by GlowstoneMC.

the class GlowLeashHitch method pulse.

@Override
public void pulse() {
    super.pulse();
    // seems like every hanging entity only checks every 5 Seconds if it can still survive
    if (ticksLived % (5 * 20) == 0) {
        Block block = location.getBlock();
        BlockType blockType = ItemTable.instance().getBlock(block.getType());
        if (!(blockType instanceof BlockFence)) {
            getExistingLeashHitches(block).forEach(Entity::remove);
        }
    }
}
Also used : Entity(org.bukkit.entity.Entity) GlowEntity(net.glowstone.entity.GlowEntity) GlowHangingEntity(net.glowstone.entity.GlowHangingEntity) BlockType(net.glowstone.block.blocktype.BlockType) Block(org.bukkit.block.Block) BlockFence(net.glowstone.block.blocktype.BlockFence)

Aggregations

BlockFence (net.glowstone.block.blocktype.BlockFence)2 BlockAnvil (net.glowstone.block.blocktype.BlockAnvil)1 BlockBeacon (net.glowstone.block.blocktype.BlockBeacon)1 BlockBed (net.glowstone.block.blocktype.BlockBed)1 BlockBrewingStand (net.glowstone.block.blocktype.BlockBrewingStand)1 BlockButton (net.glowstone.block.blocktype.BlockButton)1 BlockCactus (net.glowstone.block.blocktype.BlockCactus)1 BlockCarpet (net.glowstone.block.blocktype.BlockCarpet)1 BlockCarrot (net.glowstone.block.blocktype.BlockCarrot)1 BlockCauldron (net.glowstone.block.blocktype.BlockCauldron)1 BlockChest (net.glowstone.block.blocktype.BlockChest)1 BlockChorusFlower (net.glowstone.block.blocktype.BlockChorusFlower)1 BlockChorusPlant (net.glowstone.block.blocktype.BlockChorusPlant)1 BlockCocoa (net.glowstone.block.blocktype.BlockCocoa)1 BlockConcretePowder (net.glowstone.block.blocktype.BlockConcretePowder)1 BlockCrops (net.glowstone.block.blocktype.BlockCrops)1 BlockDaylightDetector (net.glowstone.block.blocktype.BlockDaylightDetector)1 BlockDeadBush (net.glowstone.block.blocktype.BlockDeadBush)1 BlockDirectDrops (net.glowstone.block.blocktype.BlockDirectDrops)1 BlockDirt (net.glowstone.block.blocktype.BlockDirt)1