id
int64
22
34.9k
comment_id
int64
0
328
comment
stringlengths
2
2.55k
code
stringlengths
31
107k
classification
stringclasses
6 values
isFinished
bool
1 class
code_context_2
stringlengths
21
27.3k
code_context_10
stringlengths
29
27.3k
code_context_20
stringlengths
29
27.3k
16,343
28
///////////////////// /// Dead Bush /// /////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED)
facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7))
.withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; });
16,343
29
// TODO: 33 // TODO: 34 /////////////////// /// Wool /// ///////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
IMPLEMENTATION
true
.translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder
///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// /////////////////////////
.selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN)
16,343
30
// TODO: 36 ///////////////////////// /// Yellow Flower /// /////////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
IMPLEMENTATION
true
.build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE)
// TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN)
register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state
16,343
31
////////////////////// /// Red Flower /// //////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED)
facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7))
.withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; });
16,343
32
////////////////////////// /// Brown Mushroom /// //////////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
.build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush())
.itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom ///
.translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block ///
16,343
33
//////////////////////// /// Red Mushroom /// ////////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED)
.add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7))
register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; });
16,343
34
////////////////////// /// Gold Block /// //////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED)
facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7))
.withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; });
16,343
35
////////////////////// /// Iron Block /// //////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED)
facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7))
.withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; });
16,343
36
/////////////////////////// /// Double Stone Slab 1 /// ///////////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
.translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name")
////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB)
////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder
16,343
37
//////////////////////// /// Stone Slab 1 /// ////////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED)
.add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7))
register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; });
16,343
38
/////////////////////// /// Brick Block /// ///////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED)
.add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7))
register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; });
16,343
39
/////////////// /// TNT /// ///////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS)
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get())
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"),
16,343
40
///////////////////// /// Bookshelf /// /////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED)
facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7))
.withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; });
16,343
41
///////////////////////////// /// Mossy Cobblestone /// /////////////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
.translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType()
///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// ////////////////////
register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// /////////////////
16,343
42
//////////////////// /// Obsidian /// ////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
.build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE)
) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) )
.build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type);
16,343
43
///////////////// /// Torch /// /////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS)
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get())
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"),
16,343
44
////////////// /// Fire /// //////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS)
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get())
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"),
16,343
45
///////////////////// /// Mob Spawner /// /////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED)
facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7))
.withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; });
16,343
46
// TODO: Oak Stairs //////////////////// /// Chest /// ////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
IMPLEMENTATION
true
.translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name")
.build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections
////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore ///
16,343
47
/////////////////////////// /// Redstone Wire /// ///////////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
.translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name")
////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB)
////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder
16,343
48
// TODO: Based on connections
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
DESIGN
true
register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE)
//////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore ///
///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block ///
16,343
49
/////////////////////// /// Diamond Ore /// ///////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED)
.add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7))
register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; });
16,343
50
///////////////////////// /// Diamond Block /// /////////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE)
/////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN)
.properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state
16,343
51
////////////////////////// /// Crafting Table /// //////////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
.build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush())
.itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom ///
.translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block ///
16,343
52
// TODO: Wheat //////////////////// /// Farmland /// ////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
IMPLEMENTATION
true
.add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland())
////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"),
///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); ////////////////////
16,343
53
//////////////////// /// Furnace /// ////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
.build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE)
) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) )
.build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type);
16,343
54
//////////////////// /// Lit Furnace /// ////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
.build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE)
) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) )
.build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type);
16,343
55
//////////////////////////// /// Stone Pressure Plate /// ////////////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
.translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType()
///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// ////////////////////
register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// /////////////////
16,343
56
///////////////////////////// /// Wooden Pressure Plate /// /////////////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
.translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType()
///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// ////////////////////
register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// /////////////////
16,343
57
//////////////////// /// Jukebox /// ////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
.build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE)
) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) )
.build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type);
16,343
58
//////////////////// /// Pumpkin /// ////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
.build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE)
) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) )
.build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type);
16,343
59
////////////////////// /// Netherrack /// //////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED)
facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7))
.withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; });
16,343
60
//////////////////// /// Lit Pumpkin /// ////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
.build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE)
) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) )
.build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type);
16,343
61
///////////////////// /// Stained Glass /// /////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED)
facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7))
.withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; });
16,343
62
/////////////////// /// Iron Bars /// ///////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS)
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get())
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"),
16,343
63
// TODO
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
.build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel ///
.keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel"));
.add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name")
16,343
64
///////////////////// /// End Stone /// /////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED)
facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7))
.withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; });
16,343
65
////////////////////////// /// Double Wooden Slab /// //////////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
.build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush())
.itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom ///
.translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block ///
16,343
66
////////////////////////// /// Wooden Slab /// //////////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
.build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush())
.itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom ///
.translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block ///
16,343
67
///////////////////// /// Ender Chest /// /////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED)
facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7))
.withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; });
16,343
68
///////////////////// /// Trapped Chest /// /////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED)
facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7))
.withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; });
16,343
69
/////////////////////////////////////// /// Weighted Pressure Plate (Light) /// ///////////////////////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
.build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name")
.add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"),
.itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name")
16,343
70
/////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// ///////////////////////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
.build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name")
.add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"),
.itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name")
16,343
71
/////////////////////// /// Redstone Block /// ///////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED)
.add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7))
register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; });
16,343
72
//////////////////// /// Quartz Ore /// ////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
.build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE)
) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) )
.build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type);
16,343
73
//////////////////// /// Hopper /// ////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
.build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE)
) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) )
.build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type);
16,343
74
////////////////////// /// Quartz Block /// //////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED)
facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7))
.withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; });
16,343
75
//////////////////// /// Dropper /// ////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
.build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE)
) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) )
.build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type);
16,343
76
// .tileEntityType(() -> TileEntityTypes.DROPPER)
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
.add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline
//////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data;
.properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData);
16,343
77
////////////////////////////// /// Stained Hardended Clay /// //////////////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
.build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name")
.add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"),
.itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name")
16,343
78
////////////////////////// /// Stained Glass Pane /// //////////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
.build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush())
.itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom ///
.translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block ///
16,343
79
//////////////////// /// Leaves 2 /// ////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
.build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE)
) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) )
.build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type);
16,343
80
//////////////////// /// Log 2 /// ////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
.build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE)
) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) )
.build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type);
16,343
81
//////////////////// /// Barrier /// ////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
.build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE)
) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) )
.build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type);
16,343
82
///////////////////// /// Carpet /// /////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED)
facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7))
.withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; });
16,343
83
///////////////////// /// Red Sandstone /// /////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED)
facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7))
.withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; });
16,343
84
/////////////////////////// /// Double Stone Slab 2 /// ///////////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
.translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name")
////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB)
////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder
16,343
85
//////////////////////// /// Stone Slab 2 /// ////////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED)
.add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7))
register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; });
16,343
86
/////////////////// /// End Rod /// ///////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS)
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get())
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"),
16,343
87
/////////////////////////// /// White Shulker Box /// ///////////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
.translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name")
////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB)
////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder
16,343
88
/////////////////////////// /// Orange Shulker Box /// ///////////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
.translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name")
////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB)
////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder
16,343
89
//////////////////////////// /// Magenta Shulker Box /// ////////////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
.translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType()
///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// ////////////////////
register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// /////////////////
16,343
90
/////////////////////////////// /// Light Blue Shulker Box /// ///////////////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
.build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name")
.add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"),
.itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name")
16,343
91
/////////////////////////// /// Yellow Shulker Box /// ///////////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
.translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name")
////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB)
////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder
16,343
92
///////////////////////// /// Lime Shulker Box /// /////////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE)
/////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN)
.properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state
16,343
93
///////////////////////// /// Pink Shulker Box /// /////////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE)
/////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN)
.properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state
16,343
94
///////////////////////// /// Gray Shulker Box /// /////////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE)
/////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN)
.properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state
16,343
95
///////////////////////// /// Gray Shulker Box /// /////////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE)
/////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN)
.properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state
16,343
96
///////////////////////// /// Cyan Shulker Box /// /////////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE)
/////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN)
.properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state
16,343
97
/////////////////////////// /// Purple Shulker Box /// ///////////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
.translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name")
////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB)
////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder
16,343
98
///////////////////////// /// Blue Shulker Box /// /////////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE)
/////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN)
.properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state
16,343
99
////////////////////////// /// Brown Shulker Box /// //////////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
.build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush())
.itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom ///
.translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block ///
16,343
100
////////////////////////// /// Green Shulker Box /// //////////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
.build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush())
.itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom ///
.translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block ///
16,343
101
//////////////////////// /// Red Shulker Box /// ////////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED)
.add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7))
register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; });
16,343
102
////////////////////////// /// Black Shulker Box /// //////////////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
.build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush())
.itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom ///
.translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block ///
16,343
103
////////////// /// Sign /// //////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS)
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get())
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"),
16,343
104
//////////////// /// Banner /// ////////////////
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS)
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get())
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"),
16,343
105
// @formatter:on
@Override public void registerDefaults() { // @formatter:off /////////////////// /// Air /// /////////////////// register(0, builder() .properties(PropertyProviderCollections.DEFAULT_GAS) .translation("tile.air.name") .build("minecraft", "air")); /////////////////// /// Stone /// /////////////////// register(1, simpleBuilder() .trait(LanternEnumTraits.STONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.STONE_TYPE, LanternStoneType.STONE).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.STONE_TYPE, LanternStoneType.STONE) ) ) .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(30.0))) .translation(TranslationProvider.of(LanternEnumTraits.STONE_TYPE)) .build("minecraft", "stone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.STONE_TYPE).get().getInternalId()); /////////////////// /// Grass /// /////////////////// register(2, simpleBuilder() .trait(LanternBooleanTraits.SNOWY) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .defaultState(state -> state.withTrait(LanternBooleanTraits.SNOWY, false).get()) .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.grass.name") .build("minecraft", "grass")); /////////////////// /// Dirt /// /////////////////// register(3, simpleBuilder() .traits(LanternEnumTraits.DIRT_TYPE, LanternBooleanTraits.SNOWY) .defaultState(state -> state .withTrait(LanternEnumTraits.DIRT_TYPE, LanternDirtType.DIRT).get() .withTrait(LanternBooleanTraits.SNOWY, false).get()) .extendedStateProvider(new SnowyExtendedBlockStateProvider()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.DIRT_TYPE, LanternDirtType.DIRT) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.DIRT_TYPE)) .build("minecraft", "dirt"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.DIRT_TYPE).get().getInternalId()); /////////////////// /// Cobblestone /// /////////////////// register(4, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(3.0))) .translation("tile.stonebrick.name") .build("minecraft", "cobblestone")); /////////////////// /// Planks /// /////////////////// register(5, simpleBuilder() .trait(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0)) .add(flammableInfo(5, 20))) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.planks." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "planks"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); //////////////////// /// Sapling /// //////////////////// register(6, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE, LanternIntegerTraits.SAPLING_GROWTH_STAGE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get() .withTrait(LanternIntegerTraits.SAPLING_GROWTH_STAGE, 0).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.sapling." + type.getTranslationKeyBase() + ".name"))) .build("minecraft", "sapling"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int stage = blockState.getTraitValue(LanternIntegerTraits.SAPLING_GROWTH_STAGE).get(); return (byte) (stage << 3 | type); }); //////////////////// /// Bedrock /// //////////////////// register(7, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.bedrock.name") .build("minecraft", "bedrock")); //////////////////// /// Sand /// //////////////////// register(12, simpleBuilder() .trait(LanternEnumTraits.SAND_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SAND_TYPE, LanternSandType.NORMAL).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SAND_TYPE, LanternSandType.NORMAL) ) ) .properties(builder -> builder .add(hardness(0.5)) .add(blastResistance(2.5))) .translation(TranslationProvider.of(LanternEnumTraits.SAND_TYPE)) .build("minecraft", "sand"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SAND_TYPE).get().getInternalId()); // TODO: Sand physics behavior //////////////////// /// Gravel /// //////////////////// register(13, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation("tile.gravel.name") .build("minecraft", "gravel")); // TODO: Gravel physics behavior //////////////////// /// Gold Ore /// //////////////////// register(14, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreGold.name") .build("minecraft", "gold_ore")); //////////////////// /// Iron Ore /// //////////////////// register(15, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreIron.name") .build("minecraft", "iron_ore")); //////////////////// /// Coal Ore /// //////////////////// register(16, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreCoal.name") .build("minecraft", "coal_ore")); //////////////////// /// Log 1 /// //////////////////// register(17, logBuilder(LanternEnumTraits.LOG1_TYPE, LanternTreeType.OAK) .build("minecraft", "log"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG1_TYPE).get().getInternalId())); //////////////////// /// Leaves 1 /// //////////////////// register(18, leavesBuilder(LanternEnumTraits.LEAVES1_TYPE, LanternTreeType.OAK) .build("minecraft", "leaves"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES1_TYPE).get().getInternalId())); //////////////////// /// Sponge /// //////////////////// register(19, simpleBuilder() .trait(LanternBooleanTraits.IS_WET) .defaultState(state -> state.withTrait(LanternBooleanTraits.IS_WET, false).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.IS_WET, false) ) ) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .translation(new SpongeTranslationProvider()) .build("minecraft", "sponge"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.IS_WET).get() ? 1 : 0)); //////////////////// /// Glass /// //////////////////// register(20, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .translation("tile.glass.name") .build("minecraft", "glass")); //////////////////// /// Lapis Ore /// //////////////////// register(21, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.oreLapis.name") .build("minecraft", "lapis_ore")); //////////////////// /// Lapis Block /// //////////////////// register(22, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.blockLapis.name") .build("minecraft", "lapis_block")); //////////////////// /// Dispenser /// //////////////////// register(23, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DISPENSER) .translation("tile.dispenser.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dispenser"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); //////////////////// /// Sandstone /// //////////////////// register(24, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); //////////////////// /// Noteblock /// //////////////////// register(25, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation("tile.musicBlock.name") .tileEntityType(() -> TileEntityTypes.NOTE) .behaviors(pipeline -> pipeline .add(new NoteBlockInteractionBehavior())) .build("minecraft", "noteblock")); //////////////////// /// Bed /// //////////////////// register(26, simpleBuilder() .traits(LanternEnumTraits.HORIZONTAL_FACING, LanternEnumTraits.BED_PART, LanternBooleanTraits.OCCUPIED) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get() .withTrait(LanternEnumTraits.BED_PART, LanternBedPart.FOOT).get() .withTrait(LanternBooleanTraits.OCCUPIED, false).get()) .properties(builder -> builder .add(hardness(0.2)) .add(blastResistance(1.0))) .translation("tile.bed.name") .build("minecraft", "bed"), blockState -> { final Direction facing = blockState.getTraitValue(LanternEnumTraits.HORIZONTAL_FACING).get(); int type = facing == Direction.SOUTH ? 0 : facing == Direction.WEST ? 1 : facing == Direction.NORTH ? 2 : facing == Direction.EAST ? 3 : -1; checkArgument(type != -1); if (blockState.getTraitValue(LanternBooleanTraits.OCCUPIED).get()) { type |= 0x4; } if (blockState.getTraitValue(LanternEnumTraits.BED_PART).get() == LanternBedPart.HEAD) { type |= 0x8; } return (byte) type; }); ////////////////////// /// Golden Rail /// ////////////////////// register(27, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.goldenRail.name") .build("minecraft", "golden_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); //////////////////////// /// Detector Rail /// //////////////////////// register(28, simpleBuilder() .traits(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternBooleanTraits.POWERED) .defaultState(state -> state .withTrait(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION, LanternRailDirection.NORTH_SOUTH).get() .withTrait(LanternBooleanTraits.POWERED, false).get()) .itemType() .selectionBox(BoundingBoxes::rail) .properties(builder -> builder .add(PASSABLE) .add(hardness(0.7)) .add(blastResistance(3.5))) .translation("tile.detectorRail.name") .build("minecraft", "detector_rail"), blockState -> { int type = blockState.getTraitValue(LanternEnumTraits.STRAIGHT_RAIL_DIRECTION).get().getInternalId(); if (blockState.getTraitValue(LanternBooleanTraits.POWERED).get()) { type |= 0x8; } return (byte) type; }); // TODO: 29 /////////////// /// Web /// /////////////// register(30, simpleBuilder() .itemType() .properties(builder -> builder .add(PASSABLE) .add(hardness(4.0)) .add(blastResistance(20.0))) .translation("tile.web.name") .build("minecraft", "web")); ////////////////////// /// Tall Grass /// ////////////////////// register(31, simpleBuilder() .traits(LanternEnumTraits.SHRUB_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.SHRUB_TYPE, LanternShrubType.DEAD_BUSH).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SHRUB_TYPE, LanternShrubType.DEAD_BUSH))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .translation("tile.tallgrass.name") .build("minecraft", "tallgrass"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SHRUB_TYPE).get().getInternalId()); ///////////////////// /// Dead Bush /// ///////////////////// register(32, simpleBuilder() .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(replaceable(true))) .selectionBox(BoundingBoxes.bush()) .itemType() .translation("tile.deadbush.name") .build("minecraft", "deadbush")); // TODO: 33 // TODO: 34 /////////////////// /// Wool /// /////////////////// register(35, dyedBuilder("tile.wool.%s.name") .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .build("minecraft", "wool"), this::dyedData); // TODO: 36 ///////////////////////// /// Yellow Flower /// ///////////////////////// register(37, simpleBuilder() .traits(LanternEnumTraits.YELLOW_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.YELLOW_FLOWER_TYPE, LanternPlantType.DANDELION).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.DANDELION))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.YELLOW_FLOWER_TYPE)) .build("minecraft", "yellow_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.YELLOW_FLOWER_TYPE).get().getInternalId()); ////////////////////// /// Red Flower /// ////////////////////// register(38, simpleBuilder() .traits(LanternEnumTraits.RED_FLOWER_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.RED_FLOWER_TYPE, LanternPlantType.POPPY).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.PLANT_TYPE, LanternPlantType.POPPY))) .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation(TranslationProvider.of(LanternEnumTraits.RED_FLOWER_TYPE)) .build("minecraft", "red_flower"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.RED_FLOWER_TYPE).get().getInternalId()); ////////////////////////// /// Brown Mushroom /// ////////////////////////// register(39, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE) .add(lightEmission(1))) .translation("tile.mushroom.name") .build("minecraft", "brown_mushroom")); //////////////////////// /// Red Mushroom /// //////////////////////// register(40, simpleBuilder() .selectionBox(BoundingBoxes.bush()) .properties(builder -> builder .add(INSTANT_BROKEN) .add(PASSABLE)) .translation("tile.mushroom.name") .build("minecraft", "red_mushroom")); ////////////////////// /// Gold Block /// ////////////////////// register(41, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(10.0))) .translation("tile.blockGold.name") .build("minecraft", "gold_block")); ////////////////////// /// Iron Block /// ////////////////////// register(42, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockIron.name") .build("minecraft", "iron_block")); /////////////////////////// /// Double Stone Slab 1 /// /////////////////////////// register(43, doubleStoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE) .translation("tile.stoneSlab.name") .build("minecraft", "double_stone_slab"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); //////////////////////// /// Stone Slab 1 /// //////////////////////// register(44, stoneSlab(LanternEnumTraits.STONE_SLAB1_TYPE, LanternSlabType.STONE, () -> BlockTypes.STONE_SLAB, () -> BlockTypes.DOUBLE_STONE_SLAB) .translation("tile.stoneSlab.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB1_TYPE).get().getInternalId())); /////////////////////// /// Brick Block /// /////////////////////// register(45, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.brick.name") .build("minecraft", "brick_block")); /////////////// /// TNT /// /////////////// register(46, simpleBuilder() .trait(LanternBooleanTraits.EXPLODE) .defaultState(state -> state .withTrait(LanternBooleanTraits.EXPLODE, false).get()) .itemType() .properties(builder -> builder .add(INSTANT_BROKEN)) .translation("tile.tnt.name") .build("minecraft", "tnt"), blockState -> (byte) (blockState.getTraitValue(LanternBooleanTraits.EXPLODE).get() ? 1 : 0)); ///////////////////// /// Bookshelf /// ///////////////////// register(47, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(1.5)) .add(blastResistance(7.5))) .translation("tile.bookshelf.name") .build("minecraft", "bookshelf")); ///////////////////////////// /// Mossy Cobblestone /// ///////////////////////////// register(48, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .translation("tile.stoneMoss.name") .build("minecraft", "mossy_cobblestone")); //////////////////// /// Obsidian /// //////////////////// register(49, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(50.0)) .add(blastResistance(2000.0))) .translation("tile.obsidian.name") .build("minecraft", "obsidian")); ///////////////// /// Torch /// ///////////////// register(50, builder() .trait(LanternEnumTraits.TORCH_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.TORCH_FACING, Direction.UP).get()) .itemType() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .translation("tile.torch.name") .selectionBox(BoundingBoxes::torch) .behaviors(pipeline -> pipeline .add(new BlockSnapshotProviderPlaceBehavior()) .add(new TorchPlacementBehavior()) .add(new SimpleBreakBehavior())) .build("minecraft", "torch"), blockState -> { final Direction direction = blockState.getTraitValue(LanternEnumTraits.TORCH_FACING).get(); switch (direction) { case EAST: return (byte) 1; case WEST: return (byte) 2; case SOUTH: return (byte) 3; case NORTH: return (byte) 4; case UP: return (byte) 5; default: throw new IllegalArgumentException(); } }); ////////////// /// Fire /// ////////////// register(51, simpleBuilder() .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN) .add(lightEmission(15))) .collisionBox(BoundingBoxes.NULL) .translation("tile.fire.name") .build("minecraft", "fire")); ///////////////////// /// Mob Spawner /// ///////////////////// register(52, simpleBuilder() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(25.0))) .translation("tile.mobSpawner.name") .build("minecraft", "mob_spawner")); // TODO: Oak Stairs //////////////////// /// Chest /// //////////////////// register(54, chestBuilder() .translation("tile.chest.name") .build("minecraft", "chest"), this::horizontalFacingData); /////////////////////////// /// Redstone Wire /// /////////////////////////// register(55, simpleBuilder() .traits(LanternIntegerTraits.POWER) .selectionBox(new AABB(0, 0, 0, 1.0, 0.0625, 1.0)) // TODO: Based on connections .properties(builder -> builder .add(PASSABLE) .add(INSTANT_BROKEN)) .defaultState(state -> state .withTrait(LanternIntegerTraits.POWER, 0).get()) .translation("tile.redstoneDust.name") .build("minecraft", "redstone_wire"), state -> state.get(Keys.POWER).get().byteValue()); /////////////////////// /// Diamond Ore /// /////////////////////// register(56, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(5.0))) .translation("tile.oreDiamond.name") .build("minecraft", "diamond_ore")); ///////////////////////// /// Diamond Block /// ///////////////////////// register(57, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.blockDiamond.name") .build("minecraft", "diamond_block")); ////////////////////////// /// Crafting Table /// ////////////////////////// register(58, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(2.5)) .add(blastResistance(12.5))) .translation("tile.workbench.name") .behaviors(pipeline -> pipeline .add(new CraftingTableInteractionBehavior())) .build("minecraft", "crafting_table")); // TODO: Wheat //////////////////// /// Farmland /// //////////////////// register(60, simpleBuilder() .collisionBox(BoundingBoxes.farmland()) .trait(LanternIntegerTraits.MOISTURE) .properties(builder -> builder .add(hardness(0.6)) .add(blastResistance(3.0))) .defaultState(state -> state.withTrait(LanternIntegerTraits.MOISTURE, 0).get()) .translation("tile.farmland.name") .build("minecraft", "farmland"), state -> state.getTraitValue(LanternIntegerTraits.MOISTURE).get().byteValue()); //////////////////// /// Furnace /// //////////////////// register(61, furnaceBuilder() .itemType() .translation("tile.furnace.name") .build("minecraft", "furnace"), this::directionData); //////////////////// /// Lit Furnace /// //////////////////// register(62, furnaceBuilder() .properties(builder -> builder .add(lightEmission(13))) .translation("tile.furnace.name") .build("minecraft", "lit_furnace"), this::directionData); //////////////////////////// /// Stone Pressure Plate /// //////////////////////////// register(70, pressurePlateBuilder() .translation("tile.pressurePlateStone.name") .build("minecraft", "stone_pressure_plate"), this::pressurePlateData); ///////////////////////////// /// Wooden Pressure Plate /// ///////////////////////////// register(72, pressurePlateBuilder() .translation("tile.pressurePlateWood.name") .build("minecraft", "wooden_pressure_plate"), this::pressurePlateData); //////////////////// /// Jukebox /// //////////////////// register(84, simpleBuilder() .itemType() .traits(LanternBooleanTraits.HAS_RECORD) .defaultState(state -> state .withTrait(LanternBooleanTraits.HAS_RECORD, false).get()) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(10.0))) .tileEntityType(() -> TileEntityTypes.JUKEBOX) .translation("tile.jukebox.name") .behaviors(pipeline -> pipeline .add(new JukeboxInteractionBehavior())) .build("minecraft", "jukebox"), state -> (byte) (state.getTraitValue(LanternBooleanTraits.HAS_RECORD).get() ? 1 : 0)); //////////////////// /// Pumpkin /// //////////////////// register(86, pumpkinBuilder() .itemType(builder -> builder .properties(properties -> properties .add(equipmentType(EquipmentTypes.HEADWEAR)))) .translation("tile.pumpkin.name") .build("minecraft", "pumpkin"), this::horizontalDirectionData); ////////////////////// /// Netherrack /// ////////////////////// register(87, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.4)) .add(blastResistance(2.0))) .translation("tile.hellrock.name") .build("minecraft", "netherrack")); //////////////////// /// Lit Pumpkin /// //////////////////// register(91, pumpkinBuilder() .properties(builder -> builder .add(lightEmission(15))) .translation("tile.litpumpkin.name") .build("minecraft", "lit_pumpkin"), this::horizontalDirectionData); ///////////////////// /// Stained Glass /// ///////////////////// register(95, dyedBuilder("tile.stainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass"), this::dyedData); /////////////////// /// Iron Bars /// /////////////////// register(101, simpleBuilder() // TODO .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(10.0))) .translation("tile.fenceIron.name") .build("minecraft", "iron_bars")); ///////////////////// /// End Stone /// ///////////////////// register(121, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.whiteStone.name") .build("minecraft", "end_stone")); ////////////////////////// /// Double Wooden Slab /// ////////////////////////// register(125, simpleBuilder() .traits(LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "double_wooden_slab"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId()); ////////////////////////// /// Wooden Slab /// ////////////////////////// register(126, simpleBuilder() .traits(LanternEnumTraits.PORTION_TYPE, LanternEnumTraits.TREE_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.PORTION_TYPE, LanternPortionType.BOTTOM).get() .withTrait(LanternEnumTraits.TREE_TYPE, LanternTreeType.OAK).get()) .translation(TranslationProvider.of(LanternEnumTraits.TREE_TYPE, type -> tr("tile.woodSlab." + type.getTranslationKeyBase() + ".name"))) .itemType(builder -> builder .behaviors(pipeline -> pipeline .add(new SlabItemInteractionBehavior<>(LanternEnumTraits.TREE_TYPE, () -> BlockTypes.WOODEN_SLAB, () -> BlockTypes.DOUBLE_WOODEN_SLAB)) .add(new PlacementCollisionDetectionBehavior())) .keysProvider(collection -> collection .register(Keys.TREE_TYPE, LanternTreeType.OAK) ) ) .collisionBox(BoundingBoxes::slab) .properties(builder -> builder .add(hardness(2.0)) .add(blastResistance(5.0))) .build("minecraft", "wooden_slab"), blockState -> { final int type = blockState.getTraitValue(LanternEnumTraits.TREE_TYPE).get().getInternalId(); final int portion = (byte) blockState.getTraitValue(LanternEnumTraits.PORTION_TYPE).get().getInternalId(); return (byte) (portion << 3 | type); }); ///////////////////// /// Ender Chest /// ///////////////////// register(130, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state.withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .itemType() .tileEntityType(() -> TileEntityTypes.ENDER_CHEST) .properties(builder -> builder .add(hardness(22.5)) .add(blastResistance(3000.0)) .add(lightEmission(7))) .translation("tile.enderChest.name") .collisionBox(BoundingBoxes.chest()) .behaviors(pipeline -> pipeline .add(new HorizontalRotationPlacementBehavior()) .add(new EnderChestInteractionBehavior())) .build("minecraft", "ender_chest"), this::horizontalFacingData); ///////////////////// /// Trapped Chest /// ///////////////////// register(146, chestBuilder() .translation("tile.chestTrap.name") .build("minecraft", "trapped_chest"), this::horizontalFacingData); /////////////////////////////////////// /// Weighted Pressure Plate (Light) /// /////////////////////////////////////// register(147, weightedPressurePlateBuilder() .translation("tile.weightedPlate_light.name") .build("minecraft", "light_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////////////////////// /// Weighted Pressure Plate (Heavy) /// /////////////////////////////////////// register(148, weightedPressurePlateBuilder() .translation("tile.weightedPlate_heavy.name") .build("minecraft", "heavy_weighted_pressure_plate"), this::weightedPressurePlateData); /////////////////////// /// Redstone Block /// /////////////////////// register(152, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(5.0)) .add(blastResistance(30.0))) .translation("tile.blockRedstone.name") .build("minecraft", "redstone_block")); //////////////////// /// Quartz Ore /// //////////////////// register(153, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(15.0))) .translation("tile.netherquartz.name") .build("minecraft", "quartz_ore")); //////////////////// /// Hopper /// //////////////////// register(154, simpleBuilder() .traits(LanternEnumTraits.HOPPER_FACING, LanternBooleanTraits.ENABLED) .defaultState(state -> state .withTrait(LanternEnumTraits.HOPPER_FACING, Direction.DOWN).get() .withTrait(LanternBooleanTraits.ENABLED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.0)) .add(blastResistance(8.0))) .translation("tile.hopper.name") .behaviors(pipeline -> pipeline .add(new HopperPlacementBehavior())) .build("minecraft", "hopper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.HOPPER_FACING).get()); if (!blockState.getTraitValue(LanternBooleanTraits.ENABLED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////// /// Quartz Block /// ////////////////////// register(155, simpleBuilder() .trait(LanternEnumTraits.QUARTZ_TYPE) .defaultState(state -> state .withTrait(LanternEnumTraits.QUARTZ_TYPE, LanternQuartzType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.QUARTZ_TYPE, LanternQuartzType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(2.4))) .translation(TranslationProvider.of(LanternEnumTraits.QUARTZ_TYPE)) .behaviors(pipeline -> pipeline .add(new QuartzLinesRotationPlacementBehavior())) .build("minecraft", "quartz_block"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.QUARTZ_TYPE).get().getInternalId()); //////////////////// /// Dropper /// //////////////////// register(158, simpleBuilder() .traits(LanternEnumTraits.FACING, LanternBooleanTraits.TRIGGERED) .defaultState(state -> state .withTrait(LanternEnumTraits.FACING, Direction.NORTH).get() .withTrait(LanternBooleanTraits.TRIGGERED, false).get()) .itemType() .properties(builder -> builder .add(hardness(3.5)) .add(blastResistance(17.5))) // .tileEntityType(() -> TileEntityTypes.DROPPER) .translation("tile.dropper.name") .behaviors(pipeline -> pipeline .add(new RotationPlacementBehavior())) .build("minecraft", "dropper"), blockState -> { int data = directionData(blockState.getTraitValue(LanternEnumTraits.FACING).get()); if (blockState.getTraitValue(LanternBooleanTraits.TRIGGERED).get()) { data |= 0x8; } return (byte) data; }); ////////////////////////////// /// Stained Hardended Clay /// ////////////////////////////// register(159, dyedBuilder("tile.clayHardenedStained.%s.name") .properties(builder -> builder .add(hardness(1.25)) .add(blastResistance(7.0))) .build("minecraft", "stained_hardened_clay"), this::dyedData); ////////////////////////// /// Stained Glass Pane /// ////////////////////////// register(160, dyedBuilder("tile.thinStainedGlass.%s.name") .properties(builder -> builder .add(hardness(0.3)) .add(blastResistance(1.5))) .build("minecraft", "stained_glass_pane"), this::dyedData); //////////////////// /// Leaves 2 /// //////////////////// register(161, leavesBuilder(LanternEnumTraits.LEAVES2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "leaves2"), blockState -> leavesData(blockState, blockState.getTraitValue(LanternEnumTraits.LEAVES2_TYPE).get().getInternalId() - 4)); //////////////////// /// Log 2 /// //////////////////// register(162, logBuilder(LanternEnumTraits.LOG2_TYPE, LanternTreeType.ACACIA) .build("minecraft", "log2"), blockState -> logData(blockState, blockState.getTraitValue(LanternEnumTraits.LOG2_TYPE).get().getInternalId() - 4)); //////////////////// /// Barrier /// //////////////////// register(166, simpleBuilder() .itemType() .properties(builder -> builder .add(PropertyProviderCollections.UNBREAKABLE)) .translation("tile.barrier.name") .build("minecraft", "barrier")); ///////////////////// /// Carpet /// ///////////////////// register(171, dyedBuilder("tile.carpet.%s.name") .properties(builder -> builder .add(hardness(0.1)) .add(blastResistance(0.5)) .add(solidMaterial(false))) .collisionBox(BoundingBoxes.carpet()) .build("minecraft", "carpet"), this::dyedData); ///////////////////// /// Red Sandstone /// ///////////////////// register(179, simpleBuilder() .trait(LanternEnumTraits.SANDSTONE_TYPE) .defaultState(state -> state.withTrait(LanternEnumTraits.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT).get()) .itemType(builder -> builder .keysProvider(collection -> collection .register(Keys.SANDSTONE_TYPE, LanternSandstoneType.DEFAULT) ) ) .properties(builder -> builder .add(hardness(0.8)) .add(blastResistance(4.0))) .translation(TranslationProvider.of(LanternEnumTraits.SANDSTONE_TYPE)) .build("minecraft", "red_sandstone"), blockState -> (byte) blockState.getTraitValue(LanternEnumTraits.SANDSTONE_TYPE).get().getInternalId()); /////////////////////////// /// Double Stone Slab 2 /// /////////////////////////// register(181, doubleStoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND) .translation("tile.stoneSlab2.name") .build("minecraft", "double_stone_slab2"), blockState -> doubleStoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); //////////////////////// /// Stone Slab 2 /// //////////////////////// register(182, stoneSlab(LanternEnumTraits.STONE_SLAB2_TYPE, LanternSlabType.RED_SAND, () -> BlockTypes.STONE_SLAB2, () -> BlockTypes.DOUBLE_STONE_SLAB2) .translation("tile.stoneSlab2.name") .collisionBox(BoundingBoxes::slab) .build("minecraft", "stone_slab2"), blockState -> stoneSlabData(blockState, blockState.getTraitValue(LanternEnumTraits.STONE_SLAB2_TYPE).get().getInternalId() - 8)); /////////////////// /// End Rod /// /////////////////// register(198, simpleBuilder() .itemType() .properties(builder -> builder .add(hardness(0.0)) .add(blastResistance(0.0)) .add(lightEmission(14))) .translation("tile.endRod.name") .build("minecraft", "end_rod")); /////////////////////////// /// White Shulker Box /// /////////////////////////// register(219, shulkerBox() .translation("tile.shulkerBoxWhite.name") .build("minecraft", "white_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Orange Shulker Box /// /////////////////////////// register(220, shulkerBox() .translation("tile.shulkerBoxOrange.name") .build("minecraft", "orange_shulker_box"), this::shulkerBoxData); //////////////////////////// /// Magenta Shulker Box /// //////////////////////////// register(221, shulkerBox() .translation("tile.shulkerBoxMagenta.name") .build("minecraft", "magenta_shulker_box"), this::shulkerBoxData); /////////////////////////////// /// Light Blue Shulker Box /// /////////////////////////////// register(222, shulkerBox() .translation("tile.shulkerBoxLightBlue.name") .build("minecraft", "light_blue_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Yellow Shulker Box /// /////////////////////////// register(223, shulkerBox() .translation("tile.shulkerBoxYellow.name") .build("minecraft", "yellow_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Lime Shulker Box /// ///////////////////////// register(224, shulkerBox() .translation("tile.shulkerBoxLime.name") .build("minecraft", "lime_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Pink Shulker Box /// ///////////////////////// register(225, shulkerBox() .translation("tile.shulkerBoxPink.name") .build("minecraft", "pink_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(226, shulkerBox() .translation("tile.shulkerBoxGray.name") .build("minecraft", "gray_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Gray Shulker Box /// ///////////////////////// register(227, shulkerBox() .translation("tile.shulkerBoxSilver.name") .build("minecraft", "silver_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Cyan Shulker Box /// ///////////////////////// register(228, shulkerBox() .translation("tile.shulkerBoxCyan.name") .build("minecraft", "cyan_shulker_box"), this::shulkerBoxData); /////////////////////////// /// Purple Shulker Box /// /////////////////////////// register(229, shulkerBox() .translation("tile.shulkerBoxPurple.name") .build("minecraft", "purple_shulker_box"), this::shulkerBoxData); ///////////////////////// /// Blue Shulker Box /// ///////////////////////// register(230, shulkerBox() .translation("tile.shulkerBoxBlue.name") .build("minecraft", "blue_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Brown Shulker Box /// ////////////////////////// register(231, shulkerBox() .translation("tile.shulkerBoxBrown.name") .build("minecraft", "brown_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Green Shulker Box /// ////////////////////////// register(232, shulkerBox() .translation("tile.shulkerBoxGreen.name") .build("minecraft", "green_shulker_box"), this::shulkerBoxData); //////////////////////// /// Red Shulker Box /// //////////////////////// register(233, shulkerBox() .translation("tile.shulkerBoxRed.name") .build("minecraft", "red_shulker_box"), this::shulkerBoxData); ////////////////////////// /// Black Shulker Box /// ////////////////////////// register(234, shulkerBox() .translation("tile.shulkerBoxBlack.name") .build("minecraft", "black_shulker_box"), this::shulkerBoxData); ////////////// /// Sign /// ////////////// register(63, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "standing_sign"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(68, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.SIGN) .build("minecraft", "wall_sign"), this::horizontalFacingData); //////////////// /// Banner /// //////////////// register(176, simpleBuilder() .trait(LanternIntegerTraits.ROTATION) .defaultState(state -> state .withTrait(LanternIntegerTraits.ROTATION, 0).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
NONSATD
true
.build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
.defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
.properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "standing_banner"), blockState -> blockState.getTraitValue(LanternIntegerTraits.ROTATION).get().byteValue()); register(177, simpleBuilder() .trait(LanternEnumTraits.HORIZONTAL_FACING) .defaultState(state -> state .withTrait(LanternEnumTraits.HORIZONTAL_FACING, Direction.NORTH).get()) .properties(builder -> builder .add(hardness(1.0)) .add(blastResistance(5.0))) .behaviors(pipeline -> pipeline .add(new SignInteractionBehavior())) .tileEntityType(() -> TileEntityTypes.BANNER) .build("minecraft", "wall_banner"), this::horizontalFacingData); // @formatter:on }
16,350
0
//TODO: Next step Direction name should be dynamic too.
public PostSubmitCallbackResponse handle( Callback<AsylumCase> callback ) { if (!canHandle(callback)) { throw new IllegalStateException("Cannot handle callback"); } PostSubmitCallbackResponse postSubmitResponse = new PostSubmitCallbackResponse(); AsylumCase asylumCase = callback.getCaseDetails().getCaseData(); TimeExtensionDecision decision = getTimeExtensionDecision(asylumCase); String confirmationHeader = decision == GRANTED ? "# You have granted a time extension" : "# You have refused a time extension"; postSubmitResponse.setConfirmationHeader(confirmationHeader); //TODO: Next step Direction name should be dynamic too. postSubmitResponse.setConfirmationBody( "#### What happens next\n\n" + "The appellant has been notified that their request has been " + decision.toString() + " and that they must submit their Appeal Reasons by the new due date.<br>" + "You will be notified when it is ready to review.\n" ); return postSubmitResponse; }
IMPLEMENTATION
true
: "# You have refused a time extension"; postSubmitResponse.setConfirmationHeader(confirmationHeader); //TODO: Next step Direction name should be dynamic too. postSubmitResponse.setConfirmationBody( "#### What happens next\n\n"
throw new IllegalStateException("Cannot handle callback"); } PostSubmitCallbackResponse postSubmitResponse = new PostSubmitCallbackResponse(); AsylumCase asylumCase = callback.getCaseDetails().getCaseData(); TimeExtensionDecision decision = getTimeExtensionDecision(asylumCase); String confirmationHeader = decision == GRANTED ? "# You have granted a time extension" : "# You have refused a time extension"; postSubmitResponse.setConfirmationHeader(confirmationHeader); //TODO: Next step Direction name should be dynamic too. postSubmitResponse.setConfirmationBody( "#### What happens next\n\n" + "The appellant has been notified that their request has been " + decision.toString() + " and that they must submit their Appeal Reasons by the new due date.<br>" + "You will be notified when it is ready to review.\n" ); return postSubmitResponse; }
public PostSubmitCallbackResponse handle( Callback<AsylumCase> callback ) { if (!canHandle(callback)) { throw new IllegalStateException("Cannot handle callback"); } PostSubmitCallbackResponse postSubmitResponse = new PostSubmitCallbackResponse(); AsylumCase asylumCase = callback.getCaseDetails().getCaseData(); TimeExtensionDecision decision = getTimeExtensionDecision(asylumCase); String confirmationHeader = decision == GRANTED ? "# You have granted a time extension" : "# You have refused a time extension"; postSubmitResponse.setConfirmationHeader(confirmationHeader); //TODO: Next step Direction name should be dynamic too. postSubmitResponse.setConfirmationBody( "#### What happens next\n\n" + "The appellant has been notified that their request has been " + decision.toString() + " and that they must submit their Appeal Reasons by the new due date.<br>" + "You will be notified when it is ready to review.\n" ); return postSubmitResponse; }
24,543
0
/** * An internal method used to save the stream to the target. * * @param ref * @param fos * @throws JAXBException */
private void saveXML(Reference ref, FileOutputStream fos) throws JAXBException { JAXBContext ctx = JAXBContext.newInstance(com.digi_dmx.gen.Context.class); Marshaller m = ctx.createMarshaller(); m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); m.setProperty(Marshaller.JAXB_ENCODING, DEFAULT_ENCODING); com.digi_dmx.gen.Context save = new com.digi_dmx.gen.Context(); save.setFactory(ref.getFactoryClassName()); save.setClazz(ref.getClassName()); Enumeration<RefAddr> all = ref.getAll(); while (all.hasMoreElements()) { RefAddr refAddr = all.nextElement(); Attr attr = new Attr(); attr.setName(refAddr.getType()); Object content = refAddr.getContent(); if (content != null) { attr.setValue(content.toString()); } save.addAttr(attr); // this hurts my soul } m.marshal(save, fos); }
NONSATD
true
private void saveXML(Reference ref, FileOutputStream fos) throws JAXBException { JAXBContext ctx = JAXBContext.newInstance(com.digi_dmx.gen.Context.class); Marshaller m = ctx.createMarshaller(); m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); m.setProperty(Marshaller.JAXB_ENCODING, DEFAULT_ENCODING); com.digi_dmx.gen.Context save = new com.digi_dmx.gen.Context(); save.setFactory(ref.getFactoryClassName()); save.setClazz(ref.getClassName()); Enumeration<RefAddr> all = ref.getAll(); while (all.hasMoreElements()) { RefAddr refAddr = all.nextElement(); Attr attr = new Attr(); attr.setName(refAddr.getType()); Object content = refAddr.getContent(); if (content != null) { attr.setValue(content.toString()); } save.addAttr(attr); // this hurts my soul } m.marshal(save, fos); }
private void saveXML(Reference ref, FileOutputStream fos) throws JAXBException { JAXBContext ctx = JAXBContext.newInstance(com.digi_dmx.gen.Context.class); Marshaller m = ctx.createMarshaller(); m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); m.setProperty(Marshaller.JAXB_ENCODING, DEFAULT_ENCODING); com.digi_dmx.gen.Context save = new com.digi_dmx.gen.Context(); save.setFactory(ref.getFactoryClassName()); save.setClazz(ref.getClassName()); Enumeration<RefAddr> all = ref.getAll(); while (all.hasMoreElements()) { RefAddr refAddr = all.nextElement(); Attr attr = new Attr(); attr.setName(refAddr.getType()); Object content = refAddr.getContent(); if (content != null) { attr.setValue(content.toString()); } save.addAttr(attr); // this hurts my soul } m.marshal(save, fos); }
private void saveXML(Reference ref, FileOutputStream fos) throws JAXBException { JAXBContext ctx = JAXBContext.newInstance(com.digi_dmx.gen.Context.class); Marshaller m = ctx.createMarshaller(); m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); m.setProperty(Marshaller.JAXB_ENCODING, DEFAULT_ENCODING); com.digi_dmx.gen.Context save = new com.digi_dmx.gen.Context(); save.setFactory(ref.getFactoryClassName()); save.setClazz(ref.getClassName()); Enumeration<RefAddr> all = ref.getAll(); while (all.hasMoreElements()) { RefAddr refAddr = all.nextElement(); Attr attr = new Attr(); attr.setName(refAddr.getType()); Object content = refAddr.getContent(); if (content != null) { attr.setValue(content.toString()); } save.addAttr(attr); // this hurts my soul } m.marshal(save, fos); }
24,543
1
// this hurts my soul
private void saveXML(Reference ref, FileOutputStream fos) throws JAXBException { JAXBContext ctx = JAXBContext.newInstance(com.digi_dmx.gen.Context.class); Marshaller m = ctx.createMarshaller(); m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); m.setProperty(Marshaller.JAXB_ENCODING, DEFAULT_ENCODING); com.digi_dmx.gen.Context save = new com.digi_dmx.gen.Context(); save.setFactory(ref.getFactoryClassName()); save.setClazz(ref.getClassName()); Enumeration<RefAddr> all = ref.getAll(); while (all.hasMoreElements()) { RefAddr refAddr = all.nextElement(); Attr attr = new Attr(); attr.setName(refAddr.getType()); Object content = refAddr.getContent(); if (content != null) { attr.setValue(content.toString()); } save.addAttr(attr); // this hurts my soul } m.marshal(save, fos); }
DESIGN
true
attr.setValue(content.toString()); } save.addAttr(attr); // this hurts my soul } m.marshal(save, fos);
while (all.hasMoreElements()) { RefAddr refAddr = all.nextElement(); Attr attr = new Attr(); attr.setName(refAddr.getType()); Object content = refAddr.getContent(); if (content != null) { attr.setValue(content.toString()); } save.addAttr(attr); // this hurts my soul } m.marshal(save, fos); }
private void saveXML(Reference ref, FileOutputStream fos) throws JAXBException { JAXBContext ctx = JAXBContext.newInstance(com.digi_dmx.gen.Context.class); Marshaller m = ctx.createMarshaller(); m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); m.setProperty(Marshaller.JAXB_ENCODING, DEFAULT_ENCODING); com.digi_dmx.gen.Context save = new com.digi_dmx.gen.Context(); save.setFactory(ref.getFactoryClassName()); save.setClazz(ref.getClassName()); Enumeration<RefAddr> all = ref.getAll(); while (all.hasMoreElements()) { RefAddr refAddr = all.nextElement(); Attr attr = new Attr(); attr.setName(refAddr.getType()); Object content = refAddr.getContent(); if (content != null) { attr.setValue(content.toString()); } save.addAttr(attr); // this hurts my soul } m.marshal(save, fos); }