diff --git a/CHANGELOG.md b/CHANGELOG.md index daa10274e..1fd2e1387 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,9 +29,12 @@ Unless otherwise specified, any version comparison below is the comparison of se - (API) Added `BlockGrowEvent` which will be called when crops grow. - (API) Added two overloads `LightService#getInternalLight(Vector3ic)` and `LightService#getSkyLight(Vector3ic)`, they have the same functionality as `LightService#getXXXLight(int, int, int)`. -- (API) Implemented beacon block, and several related interfaces are added to api module. - (API) `BlockContainer#getBlockPos` and `BlockContainer#setBlockPos` now return/require `Position3ic` instead of `Vector3ic`, this enables us to get the dimension information of a `BlockContainer`. +- (API) Implemented brewing stand, and several related interfaces & objects including `BlockEntityBrewingStand`, `BrewingStandContainer`, + `Registries#POTION_MIX_RECIPES`, `PotionMixRecipe` are added to api module. See commit history for more details. +- (API) Implemented slab, and several related interfaces are added to api module. +- (API) Introduced `BlockBaseComponent#combine` method which is used by slab. For the details of this method, see the javadoc. - (API) Implemented brewing stand, and several related interfaces & objects including `BlockEntityBrewingStand`, `BrewingStandContainer`, `Registries#POTION_MIX_RECIPES`, `PotionMixRecipe` are added to api module. See commit history for more details. diff --git a/api/src/main/java/org/allaymc/api/block/component/BlockBaseComponent.java b/api/src/main/java/org/allaymc/api/block/component/BlockBaseComponent.java index 3fa1b4dfc..4c1905fe7 100644 --- a/api/src/main/java/org/allaymc/api/block/component/BlockBaseComponent.java +++ b/api/src/main/java/org/allaymc/api/block/component/BlockBaseComponent.java @@ -69,7 +69,10 @@ default boolean canRandomUpdate() { } /** - * Try to place a block. + * Try to place a block at the specified position and with optional placement info. + *

+ * When this method is called, the caller ensures that the current block in `placeBlockPos` + * is a block that has REPLACEABLE tag. * * @param dimension The dimension where the block is placed. * @param blockState The block that is being placed. @@ -80,6 +83,23 @@ default boolean canRandomUpdate() { */ boolean place(Dimension dimension, BlockState blockState, Vector3ic placeBlockPos, PlayerInteractInfo placementInfo); + /** + * Try to combine a block with another block which is already in the dimension and does not have REPLACEABLE tag. + *

+ * This method is used by slab blocks for example. Two slab blocks can be combined to one double slab blocks. + * In most cases two blocks cannot be combined, so the default implementation just return {@code false}. + * + * @param dimension The dimension where the block is placed. + * @param blockState The block that is going to be combined with another block which is already in the dimension. + * @param combineBlockPos The pos of the block that is being combined with. + * @param placementInfo The player placement info, can be {@code null}. + * + * @return {@code true} if the block is combined successfully, {@code false} if failed. + */ + default boolean combine(Dimension dimension, BlockState blockState, Vector3ic combineBlockPos, PlayerInteractInfo placementInfo) { + return false; + } + /** * Called when place a block. *

diff --git a/api/src/main/java/org/allaymc/api/block/component/BlockDoubleSlabBaseComponent.java b/api/src/main/java/org/allaymc/api/block/component/BlockDoubleSlabBaseComponent.java new file mode 100644 index 000000000..150b2afaf --- /dev/null +++ b/api/src/main/java/org/allaymc/api/block/component/BlockDoubleSlabBaseComponent.java @@ -0,0 +1,15 @@ +package org.allaymc.api.block.component; + +import org.allaymc.api.block.type.BlockType; + +/** + * @author daoge_cmd + */ +public interface BlockDoubleSlabBaseComponent extends BlockBaseComponent { + /** + * Get the single slab block type. + * + * @return the single slab block type. + */ + BlockType getSingleSlabBlockType(); +} diff --git a/api/src/main/java/org/allaymc/api/block/component/BlockSlabBaseComponent.java b/api/src/main/java/org/allaymc/api/block/component/BlockSlabBaseComponent.java new file mode 100644 index 000000000..0caccf7f4 --- /dev/null +++ b/api/src/main/java/org/allaymc/api/block/component/BlockSlabBaseComponent.java @@ -0,0 +1,15 @@ +package org.allaymc.api.block.component; + +import org.allaymc.api.block.type.BlockType; + +/** + * @author daoge_cmd + */ +public interface BlockSlabBaseComponent extends BlockBaseComponent { + /** + * Get the double slab block type. + * + * @return the double slab block type. + */ + BlockType getDoubleSlabBlockType(); +} diff --git a/api/src/main/java/org/allaymc/api/block/interfaces/BlockCopperSlabBehavior.java b/api/src/main/java/org/allaymc/api/block/interfaces/BlockCopperSlabBehavior.java new file mode 100644 index 000000000..1d69f417e --- /dev/null +++ b/api/src/main/java/org/allaymc/api/block/interfaces/BlockCopperSlabBehavior.java @@ -0,0 +1,6 @@ +package org.allaymc.api.block.interfaces; + +import org.allaymc.api.block.component.BlockOxidationComponent; + +public interface BlockCopperSlabBehavior extends BlockSlabBehavior, BlockOxidationComponent { +} diff --git a/api/src/main/java/org/allaymc/api/block/interfaces/BlockDoubleCopperSlabBehavior.java b/api/src/main/java/org/allaymc/api/block/interfaces/BlockDoubleCopperSlabBehavior.java new file mode 100644 index 000000000..4ba47524b --- /dev/null +++ b/api/src/main/java/org/allaymc/api/block/interfaces/BlockDoubleCopperSlabBehavior.java @@ -0,0 +1,6 @@ +package org.allaymc.api.block.interfaces; + +import org.allaymc.api.block.component.BlockOxidationComponent; + +public interface BlockDoubleCopperSlabBehavior extends BlockDoubleSlabBehavior, BlockOxidationComponent { +} diff --git a/api/src/main/java/org/allaymc/api/block/interfaces/BlockDoubleSlabBehavior.java b/api/src/main/java/org/allaymc/api/block/interfaces/BlockDoubleSlabBehavior.java new file mode 100644 index 000000000..6616d2e7c --- /dev/null +++ b/api/src/main/java/org/allaymc/api/block/interfaces/BlockDoubleSlabBehavior.java @@ -0,0 +1,7 @@ +package org.allaymc.api.block.interfaces; + +import org.allaymc.api.block.BlockBehavior; +import org.allaymc.api.block.component.BlockDoubleSlabBaseComponent; + +public interface BlockDoubleSlabBehavior extends BlockBehavior, BlockDoubleSlabBaseComponent { +} diff --git a/api/src/main/java/org/allaymc/api/block/interfaces/BlockSlabBehavior.java b/api/src/main/java/org/allaymc/api/block/interfaces/BlockSlabBehavior.java index 0bc8bb0d0..4e166ee84 100644 --- a/api/src/main/java/org/allaymc/api/block/interfaces/BlockSlabBehavior.java +++ b/api/src/main/java/org/allaymc/api/block/interfaces/BlockSlabBehavior.java @@ -1,6 +1,7 @@ package org.allaymc.api.block.interfaces; import org.allaymc.api.block.BlockBehavior; +import org.allaymc.api.block.component.BlockSlabBaseComponent; -public interface BlockSlabBehavior extends BlockBehavior { +public interface BlockSlabBehavior extends BlockBehavior, BlockSlabBaseComponent { } diff --git a/api/src/main/java/org/allaymc/api/block/type/BlockTypes.java b/api/src/main/java/org/allaymc/api/block/type/BlockTypes.java index 2285960fe..bc297bb3d 100644 --- a/api/src/main/java/org/allaymc/api/block/type/BlockTypes.java +++ b/api/src/main/java/org/allaymc/api/block/type/BlockTypes.java @@ -1,412 +1,7 @@ package org.allaymc.api.block.type; import org.allaymc.api.annotation.MinecraftVersionSensitive; -import org.allaymc.api.block.interfaces.BlockAcaciaPressurePlateBehavior; -import org.allaymc.api.block.interfaces.BlockActivatorRailBehavior; -import org.allaymc.api.block.interfaces.BlockAirBehavior; -import org.allaymc.api.block.interfaces.BlockAlliumBehavior; -import org.allaymc.api.block.interfaces.BlockAllowBehavior; -import org.allaymc.api.block.interfaces.BlockAmethystBlockBehavior; -import org.allaymc.api.block.interfaces.BlockAmethystClusterBehavior; -import org.allaymc.api.block.interfaces.BlockAncientDebrisBehavior; -import org.allaymc.api.block.interfaces.BlockAndesiteBehavior; -import org.allaymc.api.block.interfaces.BlockAnvilBehavior; -import org.allaymc.api.block.interfaces.BlockAzaleaBehavior; -import org.allaymc.api.block.interfaces.BlockAzureBluetBehavior; -import org.allaymc.api.block.interfaces.BlockBambooBehavior; -import org.allaymc.api.block.interfaces.BlockBambooMosaicBehavior; -import org.allaymc.api.block.interfaces.BlockBambooPressurePlateBehavior; -import org.allaymc.api.block.interfaces.BlockBarrelBehavior; -import org.allaymc.api.block.interfaces.BlockBarrierBehavior; -import org.allaymc.api.block.interfaces.BlockBasaltBehavior; -import org.allaymc.api.block.interfaces.BlockBeaconBehavior; -import org.allaymc.api.block.interfaces.BlockBedBehavior; -import org.allaymc.api.block.interfaces.BlockBedrockBehavior; -import org.allaymc.api.block.interfaces.BlockBeeNestBehavior; -import org.allaymc.api.block.interfaces.BlockBeehiveBehavior; -import org.allaymc.api.block.interfaces.BlockBeetrootBehavior; -import org.allaymc.api.block.interfaces.BlockBellBehavior; -import org.allaymc.api.block.interfaces.BlockBigDripleafBehavior; -import org.allaymc.api.block.interfaces.BlockBirchPressurePlateBehavior; -import org.allaymc.api.block.interfaces.BlockBlackstoneBehavior; -import org.allaymc.api.block.interfaces.BlockBlastFurnaceBehavior; -import org.allaymc.api.block.interfaces.BlockBlueIceBehavior; -import org.allaymc.api.block.interfaces.BlockBlueOrchidBehavior; -import org.allaymc.api.block.interfaces.BlockBoneBlockBehavior; -import org.allaymc.api.block.interfaces.BlockBookshelfBehavior; -import org.allaymc.api.block.interfaces.BlockBorderBlockBehavior; -import org.allaymc.api.block.interfaces.BlockBrewingStandBehavior; -import org.allaymc.api.block.interfaces.BlockBrickBlockBehavior; -import org.allaymc.api.block.interfaces.BlockBricksBehavior; -import org.allaymc.api.block.interfaces.BlockBrownMushroomBehavior; -import org.allaymc.api.block.interfaces.BlockBrownMushroomBlockBehavior; -import org.allaymc.api.block.interfaces.BlockBubbleColumnBehavior; -import org.allaymc.api.block.interfaces.BlockBuddingAmethystBehavior; -import org.allaymc.api.block.interfaces.BlockButtonBehavior; -import org.allaymc.api.block.interfaces.BlockCactusBehavior; -import org.allaymc.api.block.interfaces.BlockCakeBehavior; -import org.allaymc.api.block.interfaces.BlockCalciteBehavior; -import org.allaymc.api.block.interfaces.BlockCalibratedSculkSensorBehavior; -import org.allaymc.api.block.interfaces.BlockCameraBehavior; -import org.allaymc.api.block.interfaces.BlockCampfireBehavior; -import org.allaymc.api.block.interfaces.BlockCandleBehavior; -import org.allaymc.api.block.interfaces.BlockCandleCakeBehavior; -import org.allaymc.api.block.interfaces.BlockCarpetBehavior; -import org.allaymc.api.block.interfaces.BlockCarrotsBehavior; -import org.allaymc.api.block.interfaces.BlockCartographyTableBehavior; -import org.allaymc.api.block.interfaces.BlockCarvedPumpkinBehavior; -import org.allaymc.api.block.interfaces.BlockCauldronBehavior; -import org.allaymc.api.block.interfaces.BlockCaveVinesBehavior; -import org.allaymc.api.block.interfaces.BlockCaveVinesBodyWithBerriesBehavior; -import org.allaymc.api.block.interfaces.BlockCaveVinesHeadWithBerriesBehavior; -import org.allaymc.api.block.interfaces.BlockChainBehavior; -import org.allaymc.api.block.interfaces.BlockChainCommandBlockBehavior; -import org.allaymc.api.block.interfaces.BlockChalkboardBehavior; -import org.allaymc.api.block.interfaces.BlockChemicalHeatBehavior; -import org.allaymc.api.block.interfaces.BlockCherryPressurePlateBehavior; -import org.allaymc.api.block.interfaces.BlockChestBehavior; -import org.allaymc.api.block.interfaces.BlockChiseledBookshelfBehavior; -import org.allaymc.api.block.interfaces.BlockChiseledDeepslateBehavior; -import org.allaymc.api.block.interfaces.BlockChiseledPolishedBlackstoneBehavior; -import org.allaymc.api.block.interfaces.BlockChiseledQuartzBlockBehavior; -import org.allaymc.api.block.interfaces.BlockChiseledTuffBehavior; -import org.allaymc.api.block.interfaces.BlockChorusFlowerBehavior; -import org.allaymc.api.block.interfaces.BlockChorusPlantBehavior; -import org.allaymc.api.block.interfaces.BlockClayBehavior; -import org.allaymc.api.block.interfaces.BlockClientRequestPlaceholderBlockBehavior; -import org.allaymc.api.block.interfaces.BlockClosedEyeblossomBehavior; -import org.allaymc.api.block.interfaces.BlockCoalBlockBehavior; -import org.allaymc.api.block.interfaces.BlockCoalOreBehavior; -import org.allaymc.api.block.interfaces.BlockCoarseDirtBehavior; -import org.allaymc.api.block.interfaces.BlockCobbledDeepslateBehavior; -import org.allaymc.api.block.interfaces.BlockCobblestoneBehavior; -import org.allaymc.api.block.interfaces.BlockCocoaBehavior; -import org.allaymc.api.block.interfaces.BlockColoredTorchBehavior; -import org.allaymc.api.block.interfaces.BlockCommandBlockBehavior; -import org.allaymc.api.block.interfaces.BlockComposterBehavior; -import org.allaymc.api.block.interfaces.BlockCompoundCreatorBehavior; -import org.allaymc.api.block.interfaces.BlockConcreteBehavior; -import org.allaymc.api.block.interfaces.BlockConcretePowderBehavior; -import org.allaymc.api.block.interfaces.BlockConduitBehavior; -import org.allaymc.api.block.interfaces.BlockCopperBehavior; -import org.allaymc.api.block.interfaces.BlockCopperBulbBehavior; -import org.allaymc.api.block.interfaces.BlockCopperDoorBehavior; -import org.allaymc.api.block.interfaces.BlockCopperGrateBehavior; -import org.allaymc.api.block.interfaces.BlockCopperOreBehavior; -import org.allaymc.api.block.interfaces.BlockCopperStairsBehavior; -import org.allaymc.api.block.interfaces.BlockCopperTrapdoorBehavior; -import org.allaymc.api.block.interfaces.BlockCoralBehavior; -import org.allaymc.api.block.interfaces.BlockCoralBlockBehavior; -import org.allaymc.api.block.interfaces.BlockCoralFanBehavior; -import org.allaymc.api.block.interfaces.BlockCoralWallFanBehavior; -import org.allaymc.api.block.interfaces.BlockCornflowerBehavior; -import org.allaymc.api.block.interfaces.BlockCrackedDeepslateTilesBehavior; -import org.allaymc.api.block.interfaces.BlockCrafterBehavior; -import org.allaymc.api.block.interfaces.BlockCraftingTableBehavior; -import org.allaymc.api.block.interfaces.BlockCreakingHeartBehavior; -import org.allaymc.api.block.interfaces.BlockCrimsonFungusBehavior; -import org.allaymc.api.block.interfaces.BlockCrimsonNyliumBehavior; -import org.allaymc.api.block.interfaces.BlockCrimsonPressurePlateBehavior; -import org.allaymc.api.block.interfaces.BlockCrimsonRootsBehavior; -import org.allaymc.api.block.interfaces.BlockCryingObsidianBehavior; -import org.allaymc.api.block.interfaces.BlockDandelionBehavior; -import org.allaymc.api.block.interfaces.BlockDarkOakPressurePlateBehavior; -import org.allaymc.api.block.interfaces.BlockDarkPrismarineBehavior; -import org.allaymc.api.block.interfaces.BlockDaylightDetectorBehavior; -import org.allaymc.api.block.interfaces.BlockDaylightDetectorInvertedBehavior; -import org.allaymc.api.block.interfaces.BlockDeadbushBehavior; -import org.allaymc.api.block.interfaces.BlockDecoratedPotBehavior; -import org.allaymc.api.block.interfaces.BlockDeepslateBehavior; -import org.allaymc.api.block.interfaces.BlockDeepslateCoalOreBehavior; -import org.allaymc.api.block.interfaces.BlockDeepslateCopperOreBehavior; -import org.allaymc.api.block.interfaces.BlockDeepslateDiamondOreBehavior; -import org.allaymc.api.block.interfaces.BlockDeepslateEmeraldOreBehavior; -import org.allaymc.api.block.interfaces.BlockDeepslateGoldOreBehavior; -import org.allaymc.api.block.interfaces.BlockDeepslateIronOreBehavior; -import org.allaymc.api.block.interfaces.BlockDeepslateLapisOreBehavior; -import org.allaymc.api.block.interfaces.BlockDeepslateRedstoneOreBehavior; -import org.allaymc.api.block.interfaces.BlockDeepslateTilesBehavior; -import org.allaymc.api.block.interfaces.BlockDenyBehavior; -import org.allaymc.api.block.interfaces.BlockDeprecatedPurpurBlock1Behavior; -import org.allaymc.api.block.interfaces.BlockDeprecatedPurpurBlock2Behavior; -import org.allaymc.api.block.interfaces.BlockDetectorRailBehavior; -import org.allaymc.api.block.interfaces.BlockDiamondBlockBehavior; -import org.allaymc.api.block.interfaces.BlockDiamondOreBehavior; -import org.allaymc.api.block.interfaces.BlockDioriteBehavior; -import org.allaymc.api.block.interfaces.BlockDirtBehavior; -import org.allaymc.api.block.interfaces.BlockDirtWithRootsBehavior; -import org.allaymc.api.block.interfaces.BlockDispenserBehavior; -import org.allaymc.api.block.interfaces.BlockDoorBehavior; -import org.allaymc.api.block.interfaces.BlockDragonEggBehavior; -import org.allaymc.api.block.interfaces.BlockDriedKelpBlockBehavior; -import org.allaymc.api.block.interfaces.BlockDripstoneBlockBehavior; -import org.allaymc.api.block.interfaces.BlockDropperBehavior; -import org.allaymc.api.block.interfaces.BlockElementBehavior; -import org.allaymc.api.block.interfaces.BlockEmeraldBlockBehavior; -import org.allaymc.api.block.interfaces.BlockEmeraldOreBehavior; -import org.allaymc.api.block.interfaces.BlockEnchantingTableBehavior; -import org.allaymc.api.block.interfaces.BlockEndGatewayBehavior; -import org.allaymc.api.block.interfaces.BlockEndPortalBehavior; -import org.allaymc.api.block.interfaces.BlockEndPortalFrameBehavior; -import org.allaymc.api.block.interfaces.BlockEndRodBehavior; -import org.allaymc.api.block.interfaces.BlockEndStoneBehavior; -import org.allaymc.api.block.interfaces.BlockEnderChestBehavior; -import org.allaymc.api.block.interfaces.BlockFarmlandBehavior; -import org.allaymc.api.block.interfaces.BlockFenceBehavior; -import org.allaymc.api.block.interfaces.BlockFenceGateBehavior; -import org.allaymc.api.block.interfaces.BlockFernBehavior; -import org.allaymc.api.block.interfaces.BlockFireBehavior; -import org.allaymc.api.block.interfaces.BlockFletchingTableBehavior; -import org.allaymc.api.block.interfaces.BlockFlowerPotBehavior; -import org.allaymc.api.block.interfaces.BlockFloweringAzaleaBehavior; -import org.allaymc.api.block.interfaces.BlockFrameBehavior; -import org.allaymc.api.block.interfaces.BlockFrogSpawnBehavior; -import org.allaymc.api.block.interfaces.BlockFrostedIceBehavior; -import org.allaymc.api.block.interfaces.BlockFurnaceBehavior; -import org.allaymc.api.block.interfaces.BlockGildedBlackstoneBehavior; -import org.allaymc.api.block.interfaces.BlockGlassBehavior; -import org.allaymc.api.block.interfaces.BlockGlassPaneBehavior; -import org.allaymc.api.block.interfaces.BlockGlowFrameBehavior; -import org.allaymc.api.block.interfaces.BlockGlowLichenBehavior; -import org.allaymc.api.block.interfaces.BlockGlowingobsidianBehavior; -import org.allaymc.api.block.interfaces.BlockGlowstoneBehavior; -import org.allaymc.api.block.interfaces.BlockGoldBlockBehavior; -import org.allaymc.api.block.interfaces.BlockGoldOreBehavior; -import org.allaymc.api.block.interfaces.BlockGoldenRailBehavior; -import org.allaymc.api.block.interfaces.BlockGraniteBehavior; -import org.allaymc.api.block.interfaces.BlockGrassBlockBehavior; -import org.allaymc.api.block.interfaces.BlockGrassPathBehavior; -import org.allaymc.api.block.interfaces.BlockGravelBehavior; -import org.allaymc.api.block.interfaces.BlockGrindstoneBehavior; -import org.allaymc.api.block.interfaces.BlockHangingRootsBehavior; -import org.allaymc.api.block.interfaces.BlockHangingSignBehavior; -import org.allaymc.api.block.interfaces.BlockHardenedClayBehavior; -import org.allaymc.api.block.interfaces.BlockHayBlockBehavior; -import org.allaymc.api.block.interfaces.BlockHeadBehavior; -import org.allaymc.api.block.interfaces.BlockHeavyCoreBehavior; -import org.allaymc.api.block.interfaces.BlockHeavyWeightedPressurePlateBehavior; -import org.allaymc.api.block.interfaces.BlockHoneyBlockBehavior; -import org.allaymc.api.block.interfaces.BlockHoneycombBlockBehavior; -import org.allaymc.api.block.interfaces.BlockHopperBehavior; -import org.allaymc.api.block.interfaces.BlockIceBehavior; -import org.allaymc.api.block.interfaces.BlockInfestedCobblestoneBehavior; -import org.allaymc.api.block.interfaces.BlockInfestedDeepslateBehavior; -import org.allaymc.api.block.interfaces.BlockInfestedStoneBehavior; -import org.allaymc.api.block.interfaces.BlockInfoUpdate2Behavior; -import org.allaymc.api.block.interfaces.BlockInfoUpdateBehavior; -import org.allaymc.api.block.interfaces.BlockInvisibleBedrockBehavior; -import org.allaymc.api.block.interfaces.BlockIronBarsBehavior; -import org.allaymc.api.block.interfaces.BlockIronBlockBehavior; -import org.allaymc.api.block.interfaces.BlockIronDoorBehavior; -import org.allaymc.api.block.interfaces.BlockIronOreBehavior; -import org.allaymc.api.block.interfaces.BlockIronTrapdoorBehavior; -import org.allaymc.api.block.interfaces.BlockJigsawBehavior; -import org.allaymc.api.block.interfaces.BlockJukeboxBehavior; -import org.allaymc.api.block.interfaces.BlockJunglePressurePlateBehavior; -import org.allaymc.api.block.interfaces.BlockKelpBehavior; -import org.allaymc.api.block.interfaces.BlockLabTableBehavior; -import org.allaymc.api.block.interfaces.BlockLadderBehavior; -import org.allaymc.api.block.interfaces.BlockLanternBehavior; -import org.allaymc.api.block.interfaces.BlockLapisBlockBehavior; -import org.allaymc.api.block.interfaces.BlockLapisOreBehavior; -import org.allaymc.api.block.interfaces.BlockLargeAmethystBudBehavior; -import org.allaymc.api.block.interfaces.BlockLargeFernBehavior; -import org.allaymc.api.block.interfaces.BlockLeavesBehavior; -import org.allaymc.api.block.interfaces.BlockLecternBehavior; -import org.allaymc.api.block.interfaces.BlockLeverBehavior; -import org.allaymc.api.block.interfaces.BlockLightBlockBehavior; -import org.allaymc.api.block.interfaces.BlockLightWeightedPressurePlateBehavior; -import org.allaymc.api.block.interfaces.BlockLightningRodBehavior; -import org.allaymc.api.block.interfaces.BlockLilacBehavior; -import org.allaymc.api.block.interfaces.BlockLilyOfTheValleyBehavior; -import org.allaymc.api.block.interfaces.BlockLiquidBehavior; -import org.allaymc.api.block.interfaces.BlockLitDeepslateRedstoneOreBehavior; -import org.allaymc.api.block.interfaces.BlockLitPumpkinBehavior; -import org.allaymc.api.block.interfaces.BlockLitRedstoneLampBehavior; -import org.allaymc.api.block.interfaces.BlockLitRedstoneOreBehavior; -import org.allaymc.api.block.interfaces.BlockLodestoneBehavior; -import org.allaymc.api.block.interfaces.BlockLoomBehavior; -import org.allaymc.api.block.interfaces.BlockMagmaBehavior; -import org.allaymc.api.block.interfaces.BlockMangrovePressurePlateBehavior; -import org.allaymc.api.block.interfaces.BlockMangrovePropaguleBehavior; -import org.allaymc.api.block.interfaces.BlockMangroveRootsBehavior; -import org.allaymc.api.block.interfaces.BlockMaterialReducerBehavior; -import org.allaymc.api.block.interfaces.BlockMediumAmethystBudBehavior; -import org.allaymc.api.block.interfaces.BlockMelonBlockBehavior; -import org.allaymc.api.block.interfaces.BlockMelonStemBehavior; -import org.allaymc.api.block.interfaces.BlockMobSpawnerBehavior; -import org.allaymc.api.block.interfaces.BlockMossBlockBehavior; -import org.allaymc.api.block.interfaces.BlockMossyCobblestoneBehavior; -import org.allaymc.api.block.interfaces.BlockMovingBlockBehavior; -import org.allaymc.api.block.interfaces.BlockMudBehavior; -import org.allaymc.api.block.interfaces.BlockMuddyMangroveRootsBehavior; -import org.allaymc.api.block.interfaces.BlockMushroomStemBehavior; -import org.allaymc.api.block.interfaces.BlockMyceliumBehavior; -import org.allaymc.api.block.interfaces.BlockNetherBrickBehavior; -import org.allaymc.api.block.interfaces.BlockNetherGoldOreBehavior; -import org.allaymc.api.block.interfaces.BlockNetherSproutsBehavior; -import org.allaymc.api.block.interfaces.BlockNetherWartBehavior; -import org.allaymc.api.block.interfaces.BlockNetherWartBlockBehavior; -import org.allaymc.api.block.interfaces.BlockNetheriteBlockBehavior; -import org.allaymc.api.block.interfaces.BlockNetherrackBehavior; -import org.allaymc.api.block.interfaces.BlockNetherreactorBehavior; -import org.allaymc.api.block.interfaces.BlockNoteblockBehavior; -import org.allaymc.api.block.interfaces.BlockObserverBehavior; -import org.allaymc.api.block.interfaces.BlockObsidianBehavior; -import org.allaymc.api.block.interfaces.BlockOchreFroglightBehavior; -import org.allaymc.api.block.interfaces.BlockOpenEyeblossomBehavior; -import org.allaymc.api.block.interfaces.BlockOrangeTulipBehavior; -import org.allaymc.api.block.interfaces.BlockOxeyeDaisyBehavior; -import org.allaymc.api.block.interfaces.BlockPackedIceBehavior; -import org.allaymc.api.block.interfaces.BlockPackedMudBehavior; -import org.allaymc.api.block.interfaces.BlockPaleHangingMossBehavior; -import org.allaymc.api.block.interfaces.BlockPaleMossBlockBehavior; -import org.allaymc.api.block.interfaces.BlockPaleOakPressurePlateBehavior; -import org.allaymc.api.block.interfaces.BlockPearlescentFroglightBehavior; -import org.allaymc.api.block.interfaces.BlockPeonyBehavior; -import org.allaymc.api.block.interfaces.BlockPinkPetalsBehavior; -import org.allaymc.api.block.interfaces.BlockPinkTulipBehavior; -import org.allaymc.api.block.interfaces.BlockPistonArmCollisionBehavior; -import org.allaymc.api.block.interfaces.BlockPistonBehavior; -import org.allaymc.api.block.interfaces.BlockPitcherCropBehavior; -import org.allaymc.api.block.interfaces.BlockPitcherPlantBehavior; -import org.allaymc.api.block.interfaces.BlockPlanksBehavior; -import org.allaymc.api.block.interfaces.BlockPodzolBehavior; -import org.allaymc.api.block.interfaces.BlockPointedDripstoneBehavior; -import org.allaymc.api.block.interfaces.BlockPolishedAndesiteBehavior; -import org.allaymc.api.block.interfaces.BlockPolishedBasaltBehavior; -import org.allaymc.api.block.interfaces.BlockPolishedBlackstoneBehavior; -import org.allaymc.api.block.interfaces.BlockPolishedBlackstonePressurePlateBehavior; -import org.allaymc.api.block.interfaces.BlockPolishedDeepslateBehavior; -import org.allaymc.api.block.interfaces.BlockPolishedDioriteBehavior; -import org.allaymc.api.block.interfaces.BlockPolishedGraniteBehavior; -import org.allaymc.api.block.interfaces.BlockPolishedTuffBehavior; -import org.allaymc.api.block.interfaces.BlockPoppyBehavior; -import org.allaymc.api.block.interfaces.BlockPortalBehavior; -import org.allaymc.api.block.interfaces.BlockPotatoesBehavior; -import org.allaymc.api.block.interfaces.BlockPowderSnowBehavior; -import org.allaymc.api.block.interfaces.BlockPoweredComparatorBehavior; -import org.allaymc.api.block.interfaces.BlockPoweredRepeaterBehavior; -import org.allaymc.api.block.interfaces.BlockPrismarineBehavior; -import org.allaymc.api.block.interfaces.BlockPumpkinBehavior; -import org.allaymc.api.block.interfaces.BlockPumpkinStemBehavior; -import org.allaymc.api.block.interfaces.BlockPurpurBlockBehavior; -import org.allaymc.api.block.interfaces.BlockPurpurPillarBehavior; -import org.allaymc.api.block.interfaces.BlockQuartzBlockBehavior; -import org.allaymc.api.block.interfaces.BlockQuartzOreBehavior; -import org.allaymc.api.block.interfaces.BlockQuartzPillarBehavior; -import org.allaymc.api.block.interfaces.BlockRailBehavior; -import org.allaymc.api.block.interfaces.BlockRawCopperBlockBehavior; -import org.allaymc.api.block.interfaces.BlockRawGoldBlockBehavior; -import org.allaymc.api.block.interfaces.BlockRawIronBlockBehavior; -import org.allaymc.api.block.interfaces.BlockRedMushroomBehavior; -import org.allaymc.api.block.interfaces.BlockRedMushroomBlockBehavior; -import org.allaymc.api.block.interfaces.BlockRedNetherBrickBehavior; -import org.allaymc.api.block.interfaces.BlockRedSandBehavior; -import org.allaymc.api.block.interfaces.BlockRedTulipBehavior; -import org.allaymc.api.block.interfaces.BlockRedstoneBlockBehavior; -import org.allaymc.api.block.interfaces.BlockRedstoneLampBehavior; -import org.allaymc.api.block.interfaces.BlockRedstoneOreBehavior; -import org.allaymc.api.block.interfaces.BlockRedstoneTorchBehavior; -import org.allaymc.api.block.interfaces.BlockRedstoneWireBehavior; -import org.allaymc.api.block.interfaces.BlockReedsBehavior; -import org.allaymc.api.block.interfaces.BlockReinforcedDeepslateBehavior; -import org.allaymc.api.block.interfaces.BlockRepeatingCommandBlockBehavior; -import org.allaymc.api.block.interfaces.BlockReserved6Behavior; -import org.allaymc.api.block.interfaces.BlockResinBlockBehavior; -import org.allaymc.api.block.interfaces.BlockResinClumpBehavior; -import org.allaymc.api.block.interfaces.BlockRespawnAnchorBehavior; -import org.allaymc.api.block.interfaces.BlockRoseBushBehavior; -import org.allaymc.api.block.interfaces.BlockSandBehavior; -import org.allaymc.api.block.interfaces.BlockSandstoneBehavior; -import org.allaymc.api.block.interfaces.BlockSaplingBehavior; -import org.allaymc.api.block.interfaces.BlockScaffoldingBehavior; -import org.allaymc.api.block.interfaces.BlockSculkBehavior; -import org.allaymc.api.block.interfaces.BlockSculkCatalystBehavior; -import org.allaymc.api.block.interfaces.BlockSculkSensorBehavior; -import org.allaymc.api.block.interfaces.BlockSculkShriekerBehavior; -import org.allaymc.api.block.interfaces.BlockSculkVeinBehavior; -import org.allaymc.api.block.interfaces.BlockSeaLanternBehavior; -import org.allaymc.api.block.interfaces.BlockSeaPickleBehavior; -import org.allaymc.api.block.interfaces.BlockSeagrassBehavior; -import org.allaymc.api.block.interfaces.BlockShortGrassBehavior; -import org.allaymc.api.block.interfaces.BlockShroomlightBehavior; -import org.allaymc.api.block.interfaces.BlockShulkerBoxBehavior; -import org.allaymc.api.block.interfaces.BlockSignBehavior; -import org.allaymc.api.block.interfaces.BlockSlabBehavior; -import org.allaymc.api.block.interfaces.BlockSlimeBehavior; -import org.allaymc.api.block.interfaces.BlockSmallAmethystBudBehavior; -import org.allaymc.api.block.interfaces.BlockSmallDripleafBlockBehavior; -import org.allaymc.api.block.interfaces.BlockSmithingTableBehavior; -import org.allaymc.api.block.interfaces.BlockSmokerBehavior; -import org.allaymc.api.block.interfaces.BlockSmoothBasaltBehavior; -import org.allaymc.api.block.interfaces.BlockSmoothQuartzBehavior; -import org.allaymc.api.block.interfaces.BlockSmoothStoneBehavior; -import org.allaymc.api.block.interfaces.BlockSnifferEggBehavior; -import org.allaymc.api.block.interfaces.BlockSnowBehavior; -import org.allaymc.api.block.interfaces.BlockSnowLayerBehavior; -import org.allaymc.api.block.interfaces.BlockSoulCampfireBehavior; -import org.allaymc.api.block.interfaces.BlockSoulLanternBehavior; -import org.allaymc.api.block.interfaces.BlockSoulSandBehavior; -import org.allaymc.api.block.interfaces.BlockSoulSoilBehavior; -import org.allaymc.api.block.interfaces.BlockSoulTorchBehavior; -import org.allaymc.api.block.interfaces.BlockSpongeBehavior; -import org.allaymc.api.block.interfaces.BlockSporeBlossomBehavior; -import org.allaymc.api.block.interfaces.BlockSprucePressurePlateBehavior; -import org.allaymc.api.block.interfaces.BlockStairsBehavior; -import org.allaymc.api.block.interfaces.BlockStandingBannerBehavior; -import org.allaymc.api.block.interfaces.BlockStickyPistonArmCollisionBehavior; -import org.allaymc.api.block.interfaces.BlockStickyPistonBehavior; -import org.allaymc.api.block.interfaces.BlockStoneBehavior; -import org.allaymc.api.block.interfaces.BlockStonePressurePlateBehavior; -import org.allaymc.api.block.interfaces.BlockStonecutterBehavior; -import org.allaymc.api.block.interfaces.BlockStonecutterBlockBehavior; -import org.allaymc.api.block.interfaces.BlockStructureBlockBehavior; -import org.allaymc.api.block.interfaces.BlockStructureVoidBehavior; -import org.allaymc.api.block.interfaces.BlockSunflowerBehavior; -import org.allaymc.api.block.interfaces.BlockSuspiciousGravelBehavior; -import org.allaymc.api.block.interfaces.BlockSuspiciousSandBehavior; -import org.allaymc.api.block.interfaces.BlockSweetBerryBushBehavior; -import org.allaymc.api.block.interfaces.BlockTallGrassBehavior; -import org.allaymc.api.block.interfaces.BlockTargetBehavior; -import org.allaymc.api.block.interfaces.BlockTerracottaBehavior; -import org.allaymc.api.block.interfaces.BlockTntBehavior; -import org.allaymc.api.block.interfaces.BlockTorchBehavior; -import org.allaymc.api.block.interfaces.BlockTorchflowerBehavior; -import org.allaymc.api.block.interfaces.BlockTorchflowerCropBehavior; -import org.allaymc.api.block.interfaces.BlockTrapdoorBehavior; -import org.allaymc.api.block.interfaces.BlockTrappedChestBehavior; -import org.allaymc.api.block.interfaces.BlockTrialSpawnerBehavior; -import org.allaymc.api.block.interfaces.BlockTripWireBehavior; -import org.allaymc.api.block.interfaces.BlockTripwireHookBehavior; -import org.allaymc.api.block.interfaces.BlockTuffBehavior; -import org.allaymc.api.block.interfaces.BlockTurtleEggBehavior; -import org.allaymc.api.block.interfaces.BlockTwistingVinesBehavior; -import org.allaymc.api.block.interfaces.BlockUnderwaterTntBehavior; -import org.allaymc.api.block.interfaces.BlockUnderwaterTorchBehavior; -import org.allaymc.api.block.interfaces.BlockUnknownBehavior; -import org.allaymc.api.block.interfaces.BlockUnpoweredComparatorBehavior; -import org.allaymc.api.block.interfaces.BlockUnpoweredRepeaterBehavior; -import org.allaymc.api.block.interfaces.BlockVaultBehavior; -import org.allaymc.api.block.interfaces.BlockVerdantFroglightBehavior; -import org.allaymc.api.block.interfaces.BlockVineBehavior; -import org.allaymc.api.block.interfaces.BlockWallBannerBehavior; -import org.allaymc.api.block.interfaces.BlockWallBehavior; -import org.allaymc.api.block.interfaces.BlockWarpedFungusBehavior; -import org.allaymc.api.block.interfaces.BlockWarpedNyliumBehavior; -import org.allaymc.api.block.interfaces.BlockWarpedPressurePlateBehavior; -import org.allaymc.api.block.interfaces.BlockWarpedRootsBehavior; -import org.allaymc.api.block.interfaces.BlockWarpedWartBlockBehavior; -import org.allaymc.api.block.interfaces.BlockWaterlilyBehavior; -import org.allaymc.api.block.interfaces.BlockWebBehavior; -import org.allaymc.api.block.interfaces.BlockWeepingVinesBehavior; -import org.allaymc.api.block.interfaces.BlockWetSpongeBehavior; -import org.allaymc.api.block.interfaces.BlockWheatBehavior; -import org.allaymc.api.block.interfaces.BlockWhiteTulipBehavior; -import org.allaymc.api.block.interfaces.BlockWitherRoseBehavior; -import org.allaymc.api.block.interfaces.BlockWoodBehavior; -import org.allaymc.api.block.interfaces.BlockWoodenPressurePlateBehavior; -import org.allaymc.api.block.interfaces.BlockWoolBehavior; +import org.allaymc.api.block.interfaces.*; /** * Automatically generated by {@code org.allaymc.codegen.BlockClassGen} @@ -417,7 +12,7 @@ public final class BlockTypes { public static BlockType ACACIA_DOOR; - public static BlockType ACACIA_DOUBLE_SLAB; + public static BlockType ACACIA_DOUBLE_SLAB; public static BlockType ACACIA_FENCE; @@ -463,7 +58,7 @@ public final class BlockTypes { public static BlockType ANDESITE; - public static BlockType ANDESITE_DOUBLE_SLAB; + public static BlockType ANDESITE_DOUBLE_SLAB; public static BlockType ANDESITE_SLAB; @@ -489,7 +84,7 @@ public final class BlockTypes { public static BlockType BAMBOO_DOOR; - public static BlockType BAMBOO_DOUBLE_SLAB; + public static BlockType BAMBOO_DOUBLE_SLAB; public static BlockType BAMBOO_FENCE; @@ -499,7 +94,7 @@ public final class BlockTypes { public static BlockType BAMBOO_MOSAIC; - public static BlockType BAMBOO_MOSAIC_DOUBLE_SLAB; + public static BlockType BAMBOO_MOSAIC_DOUBLE_SLAB; public static BlockType BAMBOO_MOSAIC_SLAB; @@ -547,7 +142,7 @@ public final class BlockTypes { public static BlockType BIRCH_DOOR; - public static BlockType BIRCH_DOUBLE_SLAB; + public static BlockType BIRCH_DOUBLE_SLAB; public static BlockType BIRCH_FENCE; @@ -601,7 +196,7 @@ public final class BlockTypes { public static BlockType BLACKSTONE; - public static BlockType BLACKSTONE_DOUBLE_SLAB; + public static BlockType BLACKSTONE_DOUBLE_SLAB; public static BlockType BLACKSTONE_SLAB; @@ -655,7 +250,7 @@ public final class BlockTypes { public static BlockType BRICK_BLOCK; - public static BlockType BRICK_DOUBLE_SLAB; + public static BlockType BRICK_DOUBLE_SLAB; public static BlockType BRICK_SLAB; @@ -743,7 +338,7 @@ public final class BlockTypes { public static BlockType CHERRY_DOOR; - public static BlockType CHERRY_DOUBLE_SLAB; + public static BlockType CHERRY_DOUBLE_SLAB; public static BlockType CHERRY_FENCE; @@ -819,7 +414,7 @@ public final class BlockTypes { public static BlockType COBBLED_DEEPSLATE; - public static BlockType COBBLED_DEEPSLATE_DOUBLE_SLAB; + public static BlockType COBBLED_DEEPSLATE_DOUBLE_SLAB; public static BlockType COBBLED_DEEPSLATE_SLAB; @@ -829,7 +424,7 @@ public final class BlockTypes { public static BlockType COBBLESTONE; - public static BlockType COBBLESTONE_DOUBLE_SLAB; + public static BlockType COBBLESTONE_DOUBLE_SLAB; public static BlockType COBBLESTONE_SLAB; @@ -889,7 +484,7 @@ public final class BlockTypes { public static BlockType CRIMSON_DOOR; - public static BlockType CRIMSON_DOUBLE_SLAB; + public static BlockType CRIMSON_DOUBLE_SLAB; public static BlockType CRIMSON_FENCE; @@ -925,19 +520,19 @@ public final class BlockTypes { public static BlockType CUT_COPPER; - public static BlockType CUT_COPPER_SLAB; + public static BlockType CUT_COPPER_SLAB; public static BlockType CUT_COPPER_STAIRS; public static BlockType CUT_RED_SANDSTONE; - public static BlockType CUT_RED_SANDSTONE_DOUBLE_SLAB; + public static BlockType CUT_RED_SANDSTONE_DOUBLE_SLAB; public static BlockType CUT_RED_SANDSTONE_SLAB; public static BlockType CUT_SANDSTONE; - public static BlockType CUT_SANDSTONE_DOUBLE_SLAB; + public static BlockType CUT_SANDSTONE_DOUBLE_SLAB; public static BlockType CUT_SANDSTONE_SLAB; @@ -971,7 +566,7 @@ public final class BlockTypes { public static BlockType DARK_OAK_DOOR; - public static BlockType DARK_OAK_DOUBLE_SLAB; + public static BlockType DARK_OAK_DOUBLE_SLAB; public static BlockType DARK_OAK_FENCE; @@ -999,7 +594,7 @@ public final class BlockTypes { public static BlockType DARK_PRISMARINE; - public static BlockType DARK_PRISMARINE_DOUBLE_SLAB; + public static BlockType DARK_PRISMARINE_DOUBLE_SLAB; public static BlockType DARK_PRISMARINE_SLAB; @@ -1059,7 +654,7 @@ public final class BlockTypes { public static BlockType DEEPSLATE; - public static BlockType DEEPSLATE_BRICK_DOUBLE_SLAB; + public static BlockType DEEPSLATE_BRICK_DOUBLE_SLAB; public static BlockType DEEPSLATE_BRICK_SLAB; @@ -1085,7 +680,7 @@ public final class BlockTypes { public static BlockType DEEPSLATE_REDSTONE_ORE; - public static BlockType DEEPSLATE_TILE_DOUBLE_SLAB; + public static BlockType DEEPSLATE_TILE_DOUBLE_SLAB; public static BlockType DEEPSLATE_TILE_SLAB; @@ -1111,7 +706,7 @@ public final class BlockTypes { public static BlockType DIORITE; - public static BlockType DIORITE_DOUBLE_SLAB; + public static BlockType DIORITE_DOUBLE_SLAB; public static BlockType DIORITE_SLAB; @@ -1125,7 +720,7 @@ public final class BlockTypes { public static BlockType DISPENSER; - public static BlockType DOUBLE_CUT_COPPER_SLAB; + public static BlockType DOUBLE_CUT_COPPER_SLAB; public static BlockType DRAGON_EGG; @@ -1397,7 +992,7 @@ public final class BlockTypes { public static BlockType END_STONE; - public static BlockType END_STONE_BRICK_DOUBLE_SLAB; + public static BlockType END_STONE_BRICK_DOUBLE_SLAB; public static BlockType END_STONE_BRICK_SLAB; @@ -1419,11 +1014,11 @@ public final class BlockTypes { public static BlockType EXPOSED_CUT_COPPER; - public static BlockType EXPOSED_CUT_COPPER_SLAB; + public static BlockType EXPOSED_CUT_COPPER_SLAB; public static BlockType EXPOSED_CUT_COPPER_STAIRS; - public static BlockType EXPOSED_DOUBLE_CUT_COPPER_SLAB; + public static BlockType EXPOSED_DOUBLE_CUT_COPPER_SLAB; public static BlockType FARMLAND; @@ -1481,7 +1076,7 @@ public final class BlockTypes { public static BlockType GRANITE; - public static BlockType GRANITE_DOUBLE_SLAB; + public static BlockType GRANITE_DOUBLE_SLAB; public static BlockType GRANITE_SLAB; @@ -1673,7 +1268,7 @@ public final class BlockTypes { public static BlockType JUNGLE_DOOR; - public static BlockType JUNGLE_DOUBLE_SLAB; + public static BlockType JUNGLE_DOUBLE_SLAB; public static BlockType JUNGLE_FENCE; @@ -1875,7 +1470,7 @@ public final class BlockTypes { public static BlockType MANGROVE_DOOR; - public static BlockType MANGROVE_DOUBLE_SLAB; + public static BlockType MANGROVE_DOUBLE_SLAB; public static BlockType MANGROVE_FENCE; @@ -1923,7 +1518,7 @@ public final class BlockTypes { public static BlockType MOSSY_COBBLESTONE; - public static BlockType MOSSY_COBBLESTONE_DOUBLE_SLAB; + public static BlockType MOSSY_COBBLESTONE_DOUBLE_SLAB; public static BlockType MOSSY_COBBLESTONE_SLAB; @@ -1931,7 +1526,7 @@ public final class BlockTypes { public static BlockType MOSSY_COBBLESTONE_WALL; - public static BlockType MOSSY_STONE_BRICK_DOUBLE_SLAB; + public static BlockType MOSSY_STONE_BRICK_DOUBLE_SLAB; public static BlockType MOSSY_STONE_BRICK_SLAB; @@ -1945,7 +1540,7 @@ public final class BlockTypes { public static BlockType MUD; - public static BlockType MUD_BRICK_DOUBLE_SLAB; + public static BlockType MUD_BRICK_DOUBLE_SLAB; public static BlockType MUD_BRICK_SLAB; @@ -1963,7 +1558,7 @@ public final class BlockTypes { public static BlockType NETHER_BRICK; - public static BlockType NETHER_BRICK_DOUBLE_SLAB; + public static BlockType NETHER_BRICK_DOUBLE_SLAB; public static BlockType NETHER_BRICK_FENCE; @@ -1987,7 +1582,7 @@ public final class BlockTypes { public static BlockType NETHERREACTOR; - public static BlockType NORMAL_STONE_DOUBLE_SLAB; + public static BlockType NORMAL_STONE_DOUBLE_SLAB; public static BlockType NORMAL_STONE_SLAB; @@ -1995,7 +1590,7 @@ public final class BlockTypes { public static BlockType NOTEBLOCK; - public static BlockType OAK_DOUBLE_SLAB; + public static BlockType OAK_DOUBLE_SLAB; public static BlockType OAK_FENCE; @@ -2063,11 +1658,11 @@ public final class BlockTypes { public static BlockType OXIDIZED_CUT_COPPER; - public static BlockType OXIDIZED_CUT_COPPER_SLAB; + public static BlockType OXIDIZED_CUT_COPPER_SLAB; public static BlockType OXIDIZED_CUT_COPPER_STAIRS; - public static BlockType OXIDIZED_DOUBLE_CUT_COPPER_SLAB; + public static BlockType OXIDIZED_DOUBLE_CUT_COPPER_SLAB; public static BlockType PACKED_ICE; @@ -2083,7 +1678,7 @@ public final class BlockTypes { public static BlockType PALE_OAK_DOOR; - public static BlockType PALE_OAK_DOUBLE_SLAB; + public static BlockType PALE_OAK_DOUBLE_SLAB; public static BlockType PALE_OAK_FENCE; @@ -2117,7 +1712,7 @@ public final class BlockTypes { public static BlockType PEONY; - public static BlockType PETRIFIED_OAK_DOUBLE_SLAB; + public static BlockType PETRIFIED_OAK_DOUBLE_SLAB; public static BlockType PETRIFIED_OAK_SLAB; @@ -2165,7 +1760,7 @@ public final class BlockTypes { public static BlockType POLISHED_ANDESITE; - public static BlockType POLISHED_ANDESITE_DOUBLE_SLAB; + public static BlockType POLISHED_ANDESITE_DOUBLE_SLAB; public static BlockType POLISHED_ANDESITE_SLAB; @@ -2175,7 +1770,7 @@ public final class BlockTypes { public static BlockType POLISHED_BLACKSTONE; - public static BlockType POLISHED_BLACKSTONE_BRICK_DOUBLE_SLAB; + public static BlockType POLISHED_BLACKSTONE_BRICK_DOUBLE_SLAB; public static BlockType POLISHED_BLACKSTONE_BRICK_SLAB; @@ -2187,7 +1782,7 @@ public final class BlockTypes { public static BlockType POLISHED_BLACKSTONE_BUTTON; - public static BlockType POLISHED_BLACKSTONE_DOUBLE_SLAB; + public static BlockType POLISHED_BLACKSTONE_DOUBLE_SLAB; public static BlockType POLISHED_BLACKSTONE_PRESSURE_PLATE; @@ -2199,7 +1794,7 @@ public final class BlockTypes { public static BlockType POLISHED_DEEPSLATE; - public static BlockType POLISHED_DEEPSLATE_DOUBLE_SLAB; + public static BlockType POLISHED_DEEPSLATE_DOUBLE_SLAB; public static BlockType POLISHED_DEEPSLATE_SLAB; @@ -2209,7 +1804,7 @@ public final class BlockTypes { public static BlockType POLISHED_DIORITE; - public static BlockType POLISHED_DIORITE_DOUBLE_SLAB; + public static BlockType POLISHED_DIORITE_DOUBLE_SLAB; public static BlockType POLISHED_DIORITE_SLAB; @@ -2217,7 +1812,7 @@ public final class BlockTypes { public static BlockType POLISHED_GRANITE; - public static BlockType POLISHED_GRANITE_DOUBLE_SLAB; + public static BlockType POLISHED_GRANITE_DOUBLE_SLAB; public static BlockType POLISHED_GRANITE_SLAB; @@ -2225,7 +1820,7 @@ public final class BlockTypes { public static BlockType POLISHED_TUFF; - public static BlockType POLISHED_TUFF_DOUBLE_SLAB; + public static BlockType POLISHED_TUFF_DOUBLE_SLAB; public static BlockType POLISHED_TUFF_SLAB; @@ -2247,7 +1842,7 @@ public final class BlockTypes { public static BlockType PRISMARINE; - public static BlockType PRISMARINE_BRICK_DOUBLE_SLAB; + public static BlockType PRISMARINE_BRICK_DOUBLE_SLAB; public static BlockType PRISMARINE_BRICK_SLAB; @@ -2255,7 +1850,7 @@ public final class BlockTypes { public static BlockType PRISMARINE_BRICKS_STAIRS; - public static BlockType PRISMARINE_DOUBLE_SLAB; + public static BlockType PRISMARINE_DOUBLE_SLAB; public static BlockType PRISMARINE_SLAB; @@ -2291,7 +1886,7 @@ public final class BlockTypes { public static BlockType PURPUR_BLOCK; - public static BlockType PURPUR_DOUBLE_SLAB; + public static BlockType PURPUR_DOUBLE_SLAB; public static BlockType PURPUR_PILLAR; @@ -2303,7 +1898,7 @@ public final class BlockTypes { public static BlockType QUARTZ_BRICKS; - public static BlockType QUARTZ_DOUBLE_SLAB; + public static BlockType QUARTZ_DOUBLE_SLAB; public static BlockType QUARTZ_ORE; @@ -2339,7 +1934,7 @@ public final class BlockTypes { public static BlockType RED_NETHER_BRICK; - public static BlockType RED_NETHER_BRICK_DOUBLE_SLAB; + public static BlockType RED_NETHER_BRICK_DOUBLE_SLAB; public static BlockType RED_NETHER_BRICK_SLAB; @@ -2351,7 +1946,7 @@ public final class BlockTypes { public static BlockType RED_SANDSTONE; - public static BlockType RED_SANDSTONE_DOUBLE_SLAB; + public static BlockType RED_SANDSTONE_DOUBLE_SLAB; public static BlockType RED_SANDSTONE_SLAB; @@ -2391,7 +1986,7 @@ public final class BlockTypes { public static BlockType RESIN_BLOCK; - public static BlockType RESIN_BRICK_DOUBLE_SLAB; + public static BlockType RESIN_BRICK_DOUBLE_SLAB; public static BlockType RESIN_BRICK_SLAB; @@ -2411,7 +2006,7 @@ public final class BlockTypes { public static BlockType SANDSTONE; - public static BlockType SANDSTONE_DOUBLE_SLAB; + public static BlockType SANDSTONE_DOUBLE_SLAB; public static BlockType SANDSTONE_SLAB; @@ -2459,7 +2054,7 @@ public final class BlockTypes { public static BlockType SMOOTH_QUARTZ; - public static BlockType SMOOTH_QUARTZ_DOUBLE_SLAB; + public static BlockType SMOOTH_QUARTZ_DOUBLE_SLAB; public static BlockType SMOOTH_QUARTZ_SLAB; @@ -2467,7 +2062,7 @@ public final class BlockTypes { public static BlockType SMOOTH_RED_SANDSTONE; - public static BlockType SMOOTH_RED_SANDSTONE_DOUBLE_SLAB; + public static BlockType SMOOTH_RED_SANDSTONE_DOUBLE_SLAB; public static BlockType SMOOTH_RED_SANDSTONE_SLAB; @@ -2475,7 +2070,7 @@ public final class BlockTypes { public static BlockType SMOOTH_SANDSTONE; - public static BlockType SMOOTH_SANDSTONE_DOUBLE_SLAB; + public static BlockType SMOOTH_SANDSTONE_DOUBLE_SLAB; public static BlockType SMOOTH_SANDSTONE_SLAB; @@ -2483,7 +2078,7 @@ public final class BlockTypes { public static BlockType SMOOTH_STONE; - public static BlockType SMOOTH_STONE_DOUBLE_SLAB; + public static BlockType SMOOTH_STONE_DOUBLE_SLAB; public static BlockType SMOOTH_STONE_SLAB; @@ -2513,7 +2108,7 @@ public final class BlockTypes { public static BlockType SPRUCE_DOOR; - public static BlockType SPRUCE_DOUBLE_SLAB; + public static BlockType SPRUCE_DOUBLE_SLAB; public static BlockType SPRUCE_FENCE; @@ -2553,7 +2148,7 @@ public final class BlockTypes { public static BlockType STONE; - public static BlockType STONE_BRICK_DOUBLE_SLAB; + public static BlockType STONE_BRICK_DOUBLE_SLAB; public static BlockType STONE_BRICK_SLAB; @@ -2665,7 +2260,7 @@ public final class BlockTypes { public static BlockType TUFF; - public static BlockType TUFF_BRICK_DOUBLE_SLAB; + public static BlockType TUFF_BRICK_DOUBLE_SLAB; public static BlockType TUFF_BRICK_SLAB; @@ -2675,7 +2270,7 @@ public final class BlockTypes { public static BlockType TUFF_BRICKS; - public static BlockType TUFF_DOUBLE_SLAB; + public static BlockType TUFF_DOUBLE_SLAB; public static BlockType TUFF_SLAB; @@ -2715,7 +2310,7 @@ public final class BlockTypes { public static BlockType WARPED_DOOR; - public static BlockType WARPED_DOUBLE_SLAB; + public static BlockType WARPED_DOUBLE_SLAB; public static BlockType WARPED_FENCE; @@ -2767,11 +2362,11 @@ public final class BlockTypes { public static BlockType WAXED_CUT_COPPER; - public static BlockType WAXED_CUT_COPPER_SLAB; + public static BlockType WAXED_CUT_COPPER_SLAB; public static BlockType WAXED_CUT_COPPER_STAIRS; - public static BlockType WAXED_DOUBLE_CUT_COPPER_SLAB; + public static BlockType WAXED_DOUBLE_CUT_COPPER_SLAB; public static BlockType WAXED_EXPOSED_CHISELED_COPPER; @@ -2787,11 +2382,11 @@ public final class BlockTypes { public static BlockType WAXED_EXPOSED_CUT_COPPER; - public static BlockType WAXED_EXPOSED_CUT_COPPER_SLAB; + public static BlockType WAXED_EXPOSED_CUT_COPPER_SLAB; public static BlockType WAXED_EXPOSED_CUT_COPPER_STAIRS; - public static BlockType WAXED_EXPOSED_DOUBLE_CUT_COPPER_SLAB; + public static BlockType WAXED_EXPOSED_DOUBLE_CUT_COPPER_SLAB; public static BlockType WAXED_OXIDIZED_CHISELED_COPPER; @@ -2807,11 +2402,11 @@ public final class BlockTypes { public static BlockType WAXED_OXIDIZED_CUT_COPPER; - public static BlockType WAXED_OXIDIZED_CUT_COPPER_SLAB; + public static BlockType WAXED_OXIDIZED_CUT_COPPER_SLAB; public static BlockType WAXED_OXIDIZED_CUT_COPPER_STAIRS; - public static BlockType WAXED_OXIDIZED_DOUBLE_CUT_COPPER_SLAB; + public static BlockType WAXED_OXIDIZED_DOUBLE_CUT_COPPER_SLAB; public static BlockType WAXED_WEATHERED_CHISELED_COPPER; @@ -2827,11 +2422,11 @@ public final class BlockTypes { public static BlockType WAXED_WEATHERED_CUT_COPPER; - public static BlockType WAXED_WEATHERED_CUT_COPPER_SLAB; + public static BlockType WAXED_WEATHERED_CUT_COPPER_SLAB; public static BlockType WAXED_WEATHERED_CUT_COPPER_STAIRS; - public static BlockType WAXED_WEATHERED_DOUBLE_CUT_COPPER_SLAB; + public static BlockType WAXED_WEATHERED_DOUBLE_CUT_COPPER_SLAB; public static BlockType WEATHERED_CHISELED_COPPER; @@ -2847,11 +2442,11 @@ public final class BlockTypes { public static BlockType WEATHERED_CUT_COPPER; - public static BlockType WEATHERED_CUT_COPPER_SLAB; + public static BlockType WEATHERED_CUT_COPPER_SLAB; public static BlockType WEATHERED_CUT_COPPER_STAIRS; - public static BlockType WEATHERED_DOUBLE_CUT_COPPER_SLAB; + public static BlockType WEATHERED_DOUBLE_CUT_COPPER_SLAB; public static BlockType WEB; diff --git a/codegen/src/main/java/org/allaymc/codegen/BlockClassGen.java b/codegen/src/main/java/org/allaymc/codegen/BlockClassGen.java index 554f69f78..3f1d0b6ff 100644 --- a/codegen/src/main/java/org/allaymc/codegen/BlockClassGen.java +++ b/codegen/src/main/java/org/allaymc/codegen/BlockClassGen.java @@ -220,6 +220,10 @@ private static void registerMergedBlocks() { registerMergedBlock(Pattern.compile(".*ShulkerBoxBehavior"), "BlockShulkerBoxBehavior"); registerMergedBlock(Pattern.compile("Block(?!.*Copper).*?StairsBehavior"), "BlockStairsBehavior"); registerMergedBlock(Pattern.compile("Block(?=.*Copper).*?StairsBehavior"), "BlockCopperStairsBehavior"); + registerMergedBlock(Pattern.compile("Block(?!.*Copper).*?DoubleSlabBehavior"), "BlockDoubleSlabBehavior"); + registerMergedBlock(Pattern.compile("Block.*?(?=.*Double).*?(?=.*Copper).*?SlabBehavior"), "BlockDoubleCopperSlabBehavior"); + registerMergedBlock(Pattern.compile("Block(?!.*Copper).*?SlabBehavior"), "BlockSlabBehavior"); + registerMergedBlock(Pattern.compile("Block(?=.*Copper).*?SlabBehavior"), "BlockCopperSlabBehavior"); registerMergedBlock(Pattern.compile(".*ColoredTorch.*Behavior"), "BlockColoredTorchBehavior"); registerMergedBlock(Pattern.compile(".*RedstoneTorchBehavior"), "BlockRedstoneTorchBehavior"); registerMergedBlock(Pattern.compile(".*BlastFurnaceBehavior"), "BlockBlastFurnaceBehavior"); @@ -254,7 +258,6 @@ private static void registerMergedBlocks() { registerMergedBlock(Pattern.compile(".*CandleCakeBehavior"), "BlockCandleCakeBehavior"); registerMergedBlock(Pattern.compile(".*LightBlock.*Behavior"), "BlockLightBlockBehavior"); registerMergedBlock(Pattern.compile(".*CarpetBehavior"), "BlockCarpetBehavior"); - registerMergedBlock(Pattern.compile(".*Slab\\d?Behavior"), "BlockSlabBehavior"); registerMergedBlock(Pattern.compile(".*SaplingBehavior"), "BlockSaplingBehavior"); registerMergedBlock(Pattern.compile(".*CoralFan.*"), "BlockCoralFanBehavior"); registerMergedBlock(Pattern.compile(".*CoralWallFanBehavior"), "BlockCoralWallFanBehavior"); diff --git a/server/src/main/java/org/allaymc/server/block/component/BlockDoubleSlabBaseComponentImpl.java b/server/src/main/java/org/allaymc/server/block/component/BlockDoubleSlabBaseComponentImpl.java new file mode 100644 index 000000000..d6e2a8f39 --- /dev/null +++ b/server/src/main/java/org/allaymc/server/block/component/BlockDoubleSlabBaseComponentImpl.java @@ -0,0 +1,33 @@ +package org.allaymc.server.block.component; + +import org.allaymc.api.block.BlockBehavior; +import org.allaymc.api.block.component.BlockDoubleSlabBaseComponent; +import org.allaymc.api.block.data.BlockId; +import org.allaymc.api.block.dto.BlockStateWithPos; +import org.allaymc.api.block.type.BlockType; +import org.allaymc.api.entity.Entity; +import org.allaymc.api.item.ItemStack; + +import java.util.Set; + +/** + * @author daoge_cmd + */ +public class BlockDoubleSlabBaseComponentImpl extends BlockBaseComponentImpl implements BlockDoubleSlabBaseComponent { + protected BlockId singleSlabId; + + public BlockDoubleSlabBaseComponentImpl(BlockType blockType, BlockId singleSlabId) { + super(blockType); + this.singleSlabId = singleSlabId; + } + + @Override + public BlockType getSingleSlabBlockType() { + return singleSlabId.getBlockType(); + } + + @Override + public Set getDrops(BlockStateWithPos blockState, ItemStack usedItem, Entity entity) { + return Set.of(getSingleSlabBlockType().getItemType().createItemStack(2)); + } +} diff --git a/server/src/main/java/org/allaymc/server/block/component/BlockSlabBaseComponentImpl.java b/server/src/main/java/org/allaymc/server/block/component/BlockSlabBaseComponentImpl.java new file mode 100644 index 000000000..f3e1a088a --- /dev/null +++ b/server/src/main/java/org/allaymc/server/block/component/BlockSlabBaseComponentImpl.java @@ -0,0 +1,85 @@ +package org.allaymc.server.block.component; + +import org.allaymc.api.block.BlockBehavior; +import org.allaymc.api.block.component.BlockSlabBaseComponent; +import org.allaymc.api.block.data.BlockFace; +import org.allaymc.api.block.data.BlockId; +import org.allaymc.api.block.dto.PlayerInteractInfo; +import org.allaymc.api.block.property.enums.MinecraftVerticalHalf; +import org.allaymc.api.block.property.type.BlockPropertyTypes; +import org.allaymc.api.block.type.BlockState; +import org.allaymc.api.block.type.BlockType; +import org.allaymc.api.world.Dimension; +import org.joml.Vector3ic; + +/** + * @author daoge_cmd + */ +public class BlockSlabBaseComponentImpl extends BlockBaseComponentImpl implements BlockSlabBaseComponent { + protected BlockId doubleSlabId; + + public BlockSlabBaseComponentImpl(BlockType blockType, BlockId doubleSlabId) { + super(blockType); + this.doubleSlabId = doubleSlabId; + } + + @Override + public boolean place(Dimension dimension, BlockState blockState, Vector3ic placeBlockPos, PlayerInteractInfo placementInfo) { + if (placementInfo == null) { + dimension.setBlockState(placeBlockPos.x(), placeBlockPos.y(), placeBlockPos.z(), blockState); + return true; + } + + var face = placementInfo.blockFace(); + var clickedBlockPos = placementInfo.clickedBlockPos(); + var clickedPos = placementInfo.clickedPos(); + var clickedBlock = placementInfo.getClickedBlockState(); + switch (face) { + case UP -> { + if (clickedBlock.getBlockType() == this.blockType && clickedBlock.getPropertyValue(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) == MinecraftVerticalHalf.BOTTOM) { + dimension.setBlockState(clickedBlockPos, getDoubleSlabBlockType().getDefaultState()); + } else { + dimension.setBlockState(placeBlockPos, blockState.setProperty(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF, MinecraftVerticalHalf.BOTTOM)); + } + } + case DOWN -> { + if (clickedBlock.getBlockType() == this.blockType && clickedBlock.getPropertyValue(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) == MinecraftVerticalHalf.TOP) { + dimension.setBlockState(clickedBlockPos, getDoubleSlabBlockType().getDefaultState()); + } else { + dimension.setBlockState(placeBlockPos, blockState.setProperty(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF, MinecraftVerticalHalf.TOP)); + } + } + default -> { + dimension.setBlockState(placeBlockPos, blockState.setProperty(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF, clickedPos.y() > 0.5f ? MinecraftVerticalHalf.TOP : MinecraftVerticalHalf.BOTTOM)); + } + } + return true; + } + + @Override + public boolean combine(Dimension dimension, BlockState blockState, Vector3ic combineBlockPos, PlayerInteractInfo placementInfo) { + var combineBlock = dimension.getBlockState(combineBlockPos); + if (combineBlock.getBlockType() != this.blockType) { + return false; + } + + var value = combineBlock.getPropertyValue(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF); + if (value != (placementInfo.clickedPos().y() > 0.5f ? MinecraftVerticalHalf.TOP : MinecraftVerticalHalf.BOTTOM)) { + // They are complementary + dimension.setBlockState(combineBlockPos, getDoubleSlabBlockType().getDefaultState()); + return true; + } + + return false; + } + + @Override + public boolean canLiquidFlowIntoSide(BlockState blockState, BlockFace blockFace) { + return !blockState.getBlockStateData().collisionShape().isFull(blockFace); + } + + @Override + public BlockType getDoubleSlabBlockType() { + return doubleSlabId.getBlockType(); + } +} diff --git a/server/src/main/java/org/allaymc/server/block/component/BlockStairsBaseComponentImpl.java b/server/src/main/java/org/allaymc/server/block/component/BlockStairsBaseComponentImpl.java index 2671ed757..71bfa2ff6 100644 --- a/server/src/main/java/org/allaymc/server/block/component/BlockStairsBaseComponentImpl.java +++ b/server/src/main/java/org/allaymc/server/block/component/BlockStairsBaseComponentImpl.java @@ -34,6 +34,11 @@ public boolean place(Dimension dimension, BlockState blockState, Vector3ic place return true; } + @Override + public boolean canLiquidFlowIntoSide(BlockState blockState, BlockFace blockFace) { + return !blockState.getBlockStateData().collisionShape().isFull(blockFace); + } + /** * Get the stair direction value which represents this block face. * diff --git a/server/src/main/java/org/allaymc/server/block/component/copper/BlockCopperDoubleSlabBaseComponentImpl.java b/server/src/main/java/org/allaymc/server/block/component/copper/BlockCopperDoubleSlabBaseComponentImpl.java new file mode 100644 index 000000000..5a4a45a56 --- /dev/null +++ b/server/src/main/java/org/allaymc/server/block/component/copper/BlockCopperDoubleSlabBaseComponentImpl.java @@ -0,0 +1,25 @@ +package org.allaymc.server.block.component.copper; + +import org.allaymc.api.block.BlockBehavior; +import org.allaymc.api.block.component.BlockOxidationComponent; +import org.allaymc.api.block.data.BlockId; +import org.allaymc.api.block.type.BlockType; +import org.allaymc.server.block.component.BlockDoubleSlabBaseComponentImpl; +import org.allaymc.server.component.annotation.Dependency; + +/** + * @author daoge_cmd + */ +public class BlockCopperDoubleSlabBaseComponentImpl extends BlockDoubleSlabBaseComponentImpl { + @Dependency + protected BlockOxidationComponent oxidationComponent; + + public BlockCopperDoubleSlabBaseComponentImpl(BlockType blockType, BlockId doubleSlabId) { + super(blockType, doubleSlabId); + } + + @Override + public boolean canRandomUpdate() { + return oxidationComponent.canOxidate(); + } +} diff --git a/server/src/main/java/org/allaymc/server/block/component/copper/BlockCopperSlabBaseComponentImpl.java b/server/src/main/java/org/allaymc/server/block/component/copper/BlockCopperSlabBaseComponentImpl.java new file mode 100644 index 000000000..0d9ecd1c3 --- /dev/null +++ b/server/src/main/java/org/allaymc/server/block/component/copper/BlockCopperSlabBaseComponentImpl.java @@ -0,0 +1,25 @@ +package org.allaymc.server.block.component.copper; + +import org.allaymc.api.block.BlockBehavior; +import org.allaymc.api.block.component.BlockOxidationComponent; +import org.allaymc.api.block.data.BlockId; +import org.allaymc.api.block.type.BlockType; +import org.allaymc.server.block.component.BlockSlabBaseComponentImpl; +import org.allaymc.server.component.annotation.Dependency; + +/** + * @author daoge_cmd + */ +public class BlockCopperSlabBaseComponentImpl extends BlockSlabBaseComponentImpl { + @Dependency + protected BlockOxidationComponent oxidationComponent; + + public BlockCopperSlabBaseComponentImpl(BlockType blockType, BlockId doubleSlabId) { + super(blockType, doubleSlabId); + } + + @Override + public boolean canRandomUpdate() { + return oxidationComponent.canOxidate(); + } +} diff --git a/server/src/main/java/org/allaymc/server/block/impl/BlockCopperSlabBehaviorImpl.java b/server/src/main/java/org/allaymc/server/block/impl/BlockCopperSlabBehaviorImpl.java new file mode 100644 index 000000000..6857c976f --- /dev/null +++ b/server/src/main/java/org/allaymc/server/block/impl/BlockCopperSlabBehaviorImpl.java @@ -0,0 +1,19 @@ +package org.allaymc.server.block.impl; + +import lombok.experimental.Delegate; +import org.allaymc.api.block.component.BlockOxidationComponent; +import org.allaymc.api.block.interfaces.BlockCopperSlabBehavior; +import org.allaymc.api.component.interfaces.Component; +import org.allaymc.server.component.interfaces.ComponentProvider; + +import java.util.List; + +public class BlockCopperSlabBehaviorImpl extends BlockSlabBehaviorImpl implements BlockCopperSlabBehavior { + @Delegate + protected BlockOxidationComponent oxidationComponent; + + public BlockCopperSlabBehaviorImpl( + List> componentProviders) { + super(componentProviders); + } +} diff --git a/server/src/main/java/org/allaymc/server/block/impl/BlockDoubleCopperSlabBehaviorImpl.java b/server/src/main/java/org/allaymc/server/block/impl/BlockDoubleCopperSlabBehaviorImpl.java new file mode 100644 index 000000000..8925323cf --- /dev/null +++ b/server/src/main/java/org/allaymc/server/block/impl/BlockDoubleCopperSlabBehaviorImpl.java @@ -0,0 +1,19 @@ +package org.allaymc.server.block.impl; + +import lombok.experimental.Delegate; +import org.allaymc.api.block.component.BlockOxidationComponent; +import org.allaymc.api.block.interfaces.BlockDoubleCopperSlabBehavior; +import org.allaymc.api.component.interfaces.Component; +import org.allaymc.server.component.interfaces.ComponentProvider; + +import java.util.List; + +public class BlockDoubleCopperSlabBehaviorImpl extends BlockDoubleSlabBehaviorImpl implements BlockDoubleCopperSlabBehavior { + @Delegate + protected BlockOxidationComponent oxidationComponent; + + public BlockDoubleCopperSlabBehaviorImpl( + List> componentProviders) { + super(componentProviders); + } +} diff --git a/server/src/main/java/org/allaymc/server/block/impl/BlockDoubleSlabBehaviorImpl.java b/server/src/main/java/org/allaymc/server/block/impl/BlockDoubleSlabBehaviorImpl.java new file mode 100644 index 000000000..2492846d6 --- /dev/null +++ b/server/src/main/java/org/allaymc/server/block/impl/BlockDoubleSlabBehaviorImpl.java @@ -0,0 +1,22 @@ +package org.allaymc.server.block.impl; + +import lombok.experimental.Delegate; +import org.allaymc.api.block.component.BlockDoubleSlabBaseComponent; +import org.allaymc.api.block.interfaces.BlockDoubleSlabBehavior; +import org.allaymc.api.component.interfaces.Component; +import org.allaymc.server.component.interfaces.ComponentProvider; + +import java.util.List; + +public class BlockDoubleSlabBehaviorImpl extends BlockBehaviorImpl implements BlockDoubleSlabBehavior { + public BlockDoubleSlabBehaviorImpl( + List> componentProviders) { + super(componentProviders); + } + + @Delegate + @Override + public BlockDoubleSlabBaseComponent getBaseComponent() { + return (BlockDoubleSlabBaseComponent) super.getBaseComponent(); + } +} diff --git a/server/src/main/java/org/allaymc/server/block/impl/BlockSlabBehaviorImpl.java b/server/src/main/java/org/allaymc/server/block/impl/BlockSlabBehaviorImpl.java index 98e74a9cd..d5155b75e 100644 --- a/server/src/main/java/org/allaymc/server/block/impl/BlockSlabBehaviorImpl.java +++ b/server/src/main/java/org/allaymc/server/block/impl/BlockSlabBehaviorImpl.java @@ -1,5 +1,7 @@ package org.allaymc.server.block.impl; +import lombok.experimental.Delegate; +import org.allaymc.api.block.component.BlockSlabBaseComponent; import org.allaymc.api.block.interfaces.BlockSlabBehavior; import org.allaymc.api.component.interfaces.Component; import org.allaymc.server.component.interfaces.ComponentProvider; @@ -10,4 +12,10 @@ public class BlockSlabBehaviorImpl extends BlockBehaviorImpl implements BlockSla public BlockSlabBehaviorImpl(List> componentProviders) { super(componentProviders); } + + @Delegate + @Override + public BlockSlabBaseComponent getBaseComponent() { + return (BlockSlabBaseComponent) super.getBaseComponent(); + } } diff --git a/server/src/main/java/org/allaymc/server/block/type/BlockTypeDefaultInitializer.java b/server/src/main/java/org/allaymc/server/block/type/BlockTypeDefaultInitializer.java index 723705549..84efa866e 100644 --- a/server/src/main/java/org/allaymc/server/block/type/BlockTypeDefaultInitializer.java +++ b/server/src/main/java/org/allaymc/server/block/type/BlockTypeDefaultInitializer.java @@ -26,7 +26,7 @@ public static void init() { } if (BlockTypes.ACACIA_DOUBLE_SLAB == null) { BlockTypes.ACACIA_DOUBLE_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleSlabBehaviorImpl.class) .vanillaBlock(BlockId.ACACIA_DOUBLE_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -179,7 +179,7 @@ public static void init() { } if (BlockTypes.ANDESITE_DOUBLE_SLAB == null) { BlockTypes.ANDESITE_DOUBLE_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleSlabBehaviorImpl.class) .vanillaBlock(BlockId.ANDESITE_DOUBLE_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -268,7 +268,7 @@ public static void init() { } if (BlockTypes.BAMBOO_DOUBLE_SLAB == null) { BlockTypes.BAMBOO_DOUBLE_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleSlabBehaviorImpl.class) .vanillaBlock(BlockId.BAMBOO_DOUBLE_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -301,7 +301,7 @@ public static void init() { } if (BlockTypes.BAMBOO_MOSAIC_DOUBLE_SLAB == null) { BlockTypes.BAMBOO_MOSAIC_DOUBLE_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleSlabBehaviorImpl.class) .vanillaBlock(BlockId.BAMBOO_MOSAIC_DOUBLE_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -466,7 +466,7 @@ public static void init() { } if (BlockTypes.BIRCH_DOUBLE_SLAB == null) { BlockTypes.BIRCH_DOUBLE_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleSlabBehaviorImpl.class) .vanillaBlock(BlockId.BIRCH_DOUBLE_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -644,7 +644,7 @@ public static void init() { } if (BlockTypes.BLACKSTONE_DOUBLE_SLAB == null) { BlockTypes.BLACKSTONE_DOUBLE_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleSlabBehaviorImpl.class) .vanillaBlock(BlockId.BLACKSTONE_DOUBLE_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -819,7 +819,7 @@ public static void init() { } if (BlockTypes.BRICK_DOUBLE_SLAB == null) { BlockTypes.BRICK_DOUBLE_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleSlabBehaviorImpl.class) .vanillaBlock(BlockId.BRICK_DOUBLE_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -1111,7 +1111,7 @@ public static void init() { } if (BlockTypes.CHERRY_DOUBLE_SLAB == null) { BlockTypes.CHERRY_DOUBLE_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleSlabBehaviorImpl.class) .vanillaBlock(BlockId.CHERRY_DOUBLE_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -1357,7 +1357,7 @@ public static void init() { } if (BlockTypes.COBBLED_DEEPSLATE_DOUBLE_SLAB == null) { BlockTypes.COBBLED_DEEPSLATE_DOUBLE_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleSlabBehaviorImpl.class) .vanillaBlock(BlockId.COBBLED_DEEPSLATE_DOUBLE_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -1391,7 +1391,7 @@ public static void init() { } if (BlockTypes.COBBLESTONE_DOUBLE_SLAB == null) { BlockTypes.COBBLESTONE_DOUBLE_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleSlabBehaviorImpl.class) .vanillaBlock(BlockId.COBBLESTONE_DOUBLE_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -1590,7 +1590,7 @@ public static void init() { } if (BlockTypes.CRIMSON_DOUBLE_SLAB == null) { BlockTypes.CRIMSON_DOUBLE_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleSlabBehaviorImpl.class) .vanillaBlock(BlockId.CRIMSON_DOUBLE_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -1709,7 +1709,7 @@ public static void init() { } if (BlockTypes.CUT_COPPER_SLAB == null) { BlockTypes.CUT_COPPER_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockCopperSlabBehaviorImpl.class) .vanillaBlock(BlockId.CUT_COPPER_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -1729,7 +1729,7 @@ public static void init() { } if (BlockTypes.CUT_RED_SANDSTONE_DOUBLE_SLAB == null) { BlockTypes.CUT_RED_SANDSTONE_DOUBLE_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleSlabBehaviorImpl.class) .vanillaBlock(BlockId.CUT_RED_SANDSTONE_DOUBLE_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -1749,7 +1749,7 @@ public static void init() { } if (BlockTypes.CUT_SANDSTONE_DOUBLE_SLAB == null) { BlockTypes.CUT_SANDSTONE_DOUBLE_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleSlabBehaviorImpl.class) .vanillaBlock(BlockId.CUT_SANDSTONE_DOUBLE_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -1859,7 +1859,7 @@ public static void init() { } if (BlockTypes.DARK_OAK_DOUBLE_SLAB == null) { BlockTypes.DARK_OAK_DOUBLE_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleSlabBehaviorImpl.class) .vanillaBlock(BlockId.DARK_OAK_DOUBLE_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -1954,7 +1954,7 @@ public static void init() { } if (BlockTypes.DARK_PRISMARINE_DOUBLE_SLAB == null) { BlockTypes.DARK_PRISMARINE_DOUBLE_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleSlabBehaviorImpl.class) .vanillaBlock(BlockId.DARK_PRISMARINE_DOUBLE_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -2153,7 +2153,7 @@ public static void init() { } if (BlockTypes.DEEPSLATE_BRICK_DOUBLE_SLAB == null) { BlockTypes.DEEPSLATE_BRICK_DOUBLE_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleSlabBehaviorImpl.class) .vanillaBlock(BlockId.DEEPSLATE_BRICK_DOUBLE_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -2235,7 +2235,7 @@ public static void init() { } if (BlockTypes.DEEPSLATE_TILE_DOUBLE_SLAB == null) { BlockTypes.DEEPSLATE_TILE_DOUBLE_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleSlabBehaviorImpl.class) .vanillaBlock(BlockId.DEEPSLATE_TILE_DOUBLE_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -2321,7 +2321,7 @@ public static void init() { } if (BlockTypes.DIORITE_DOUBLE_SLAB == null) { BlockTypes.DIORITE_DOUBLE_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleSlabBehaviorImpl.class) .vanillaBlock(BlockId.DIORITE_DOUBLE_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -2368,7 +2368,7 @@ public static void init() { } if (BlockTypes.DOUBLE_CUT_COPPER_SLAB == null) { BlockTypes.DOUBLE_CUT_COPPER_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleCopperSlabBehaviorImpl.class) .vanillaBlock(BlockId.DOUBLE_CUT_COPPER_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -3191,7 +3191,7 @@ public static void init() { } if (BlockTypes.END_STONE_BRICK_DOUBLE_SLAB == null) { BlockTypes.END_STONE_BRICK_DOUBLE_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleSlabBehaviorImpl.class) .vanillaBlock(BlockId.END_STONE_BRICK_DOUBLE_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -3264,7 +3264,7 @@ public static void init() { } if (BlockTypes.EXPOSED_CUT_COPPER_SLAB == null) { BlockTypes.EXPOSED_CUT_COPPER_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockCopperSlabBehaviorImpl.class) .vanillaBlock(BlockId.EXPOSED_CUT_COPPER_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -3278,7 +3278,7 @@ public static void init() { } if (BlockTypes.EXPOSED_DOUBLE_CUT_COPPER_SLAB == null) { BlockTypes.EXPOSED_DOUBLE_CUT_COPPER_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleCopperSlabBehaviorImpl.class) .vanillaBlock(BlockId.EXPOSED_DOUBLE_CUT_COPPER_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -3467,7 +3467,7 @@ public static void init() { } if (BlockTypes.GRANITE_DOUBLE_SLAB == null) { BlockTypes.GRANITE_DOUBLE_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleSlabBehaviorImpl.class) .vanillaBlock(BlockId.GRANITE_DOUBLE_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -4065,7 +4065,7 @@ public static void init() { } if (BlockTypes.JUNGLE_DOUBLE_SLAB == null) { BlockTypes.JUNGLE_DOUBLE_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleSlabBehaviorImpl.class) .vanillaBlock(BlockId.JUNGLE_DOUBLE_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -4714,7 +4714,7 @@ public static void init() { } if (BlockTypes.MANGROVE_DOUBLE_SLAB == null) { BlockTypes.MANGROVE_DOUBLE_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleSlabBehaviorImpl.class) .vanillaBlock(BlockId.MANGROVE_DOUBLE_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -4874,7 +4874,7 @@ public static void init() { } if (BlockTypes.MOSSY_COBBLESTONE_DOUBLE_SLAB == null) { BlockTypes.MOSSY_COBBLESTONE_DOUBLE_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleSlabBehaviorImpl.class) .vanillaBlock(BlockId.MOSSY_COBBLESTONE_DOUBLE_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -4902,7 +4902,7 @@ public static void init() { } if (BlockTypes.MOSSY_STONE_BRICK_DOUBLE_SLAB == null) { BlockTypes.MOSSY_STONE_BRICK_DOUBLE_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleSlabBehaviorImpl.class) .vanillaBlock(BlockId.MOSSY_STONE_BRICK_DOUBLE_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -4948,7 +4948,7 @@ public static void init() { } if (BlockTypes.MUD_BRICK_DOUBLE_SLAB == null) { BlockTypes.MUD_BRICK_DOUBLE_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleSlabBehaviorImpl.class) .vanillaBlock(BlockId.MUD_BRICK_DOUBLE_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -5008,7 +5008,7 @@ public static void init() { } if (BlockTypes.NETHER_BRICK_DOUBLE_SLAB == null) { BlockTypes.NETHER_BRICK_DOUBLE_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleSlabBehaviorImpl.class) .vanillaBlock(BlockId.NETHER_BRICK_DOUBLE_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -5085,7 +5085,7 @@ public static void init() { } if (BlockTypes.NORMAL_STONE_DOUBLE_SLAB == null) { BlockTypes.NORMAL_STONE_DOUBLE_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleSlabBehaviorImpl.class) .vanillaBlock(BlockId.NORMAL_STONE_DOUBLE_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -5112,7 +5112,7 @@ public static void init() { } if (BlockTypes.OAK_DOUBLE_SLAB == null) { BlockTypes.OAK_DOUBLE_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleSlabBehaviorImpl.class) .vanillaBlock(BlockId.OAK_DOUBLE_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -5332,7 +5332,7 @@ public static void init() { } if (BlockTypes.OXIDIZED_CUT_COPPER_SLAB == null) { BlockTypes.OXIDIZED_CUT_COPPER_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockCopperSlabBehaviorImpl.class) .vanillaBlock(BlockId.OXIDIZED_CUT_COPPER_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -5346,7 +5346,7 @@ public static void init() { } if (BlockTypes.OXIDIZED_DOUBLE_CUT_COPPER_SLAB == null) { BlockTypes.OXIDIZED_DOUBLE_CUT_COPPER_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleCopperSlabBehaviorImpl.class) .vanillaBlock(BlockId.OXIDIZED_DOUBLE_CUT_COPPER_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -5399,7 +5399,7 @@ public static void init() { } if (BlockTypes.PALE_OAK_DOUBLE_SLAB == null) { BlockTypes.PALE_OAK_DOUBLE_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleSlabBehaviorImpl.class) .vanillaBlock(BlockId.PALE_OAK_DOUBLE_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -5516,7 +5516,7 @@ public static void init() { } if (BlockTypes.PETRIFIED_OAK_DOUBLE_SLAB == null) { BlockTypes.PETRIFIED_OAK_DOUBLE_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleSlabBehaviorImpl.class) .vanillaBlock(BlockId.PETRIFIED_OAK_DOUBLE_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -5673,7 +5673,7 @@ public static void init() { } if (BlockTypes.POLISHED_ANDESITE_DOUBLE_SLAB == null) { BlockTypes.POLISHED_ANDESITE_DOUBLE_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleSlabBehaviorImpl.class) .vanillaBlock(BlockId.POLISHED_ANDESITE_DOUBLE_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -5707,7 +5707,7 @@ public static void init() { } if (BlockTypes.POLISHED_BLACKSTONE_BRICK_DOUBLE_SLAB == null) { BlockTypes.POLISHED_BLACKSTONE_BRICK_DOUBLE_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleSlabBehaviorImpl.class) .vanillaBlock(BlockId.POLISHED_BLACKSTONE_BRICK_DOUBLE_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -5748,7 +5748,7 @@ public static void init() { } if (BlockTypes.POLISHED_BLACKSTONE_DOUBLE_SLAB == null) { BlockTypes.POLISHED_BLACKSTONE_DOUBLE_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleSlabBehaviorImpl.class) .vanillaBlock(BlockId.POLISHED_BLACKSTONE_DOUBLE_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -5789,7 +5789,7 @@ public static void init() { } if (BlockTypes.POLISHED_DEEPSLATE_DOUBLE_SLAB == null) { BlockTypes.POLISHED_DEEPSLATE_DOUBLE_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleSlabBehaviorImpl.class) .vanillaBlock(BlockId.POLISHED_DEEPSLATE_DOUBLE_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -5823,7 +5823,7 @@ public static void init() { } if (BlockTypes.POLISHED_DIORITE_DOUBLE_SLAB == null) { BlockTypes.POLISHED_DIORITE_DOUBLE_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleSlabBehaviorImpl.class) .vanillaBlock(BlockId.POLISHED_DIORITE_DOUBLE_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -5850,7 +5850,7 @@ public static void init() { } if (BlockTypes.POLISHED_GRANITE_DOUBLE_SLAB == null) { BlockTypes.POLISHED_GRANITE_DOUBLE_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleSlabBehaviorImpl.class) .vanillaBlock(BlockId.POLISHED_GRANITE_DOUBLE_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -5877,7 +5877,7 @@ public static void init() { } if (BlockTypes.POLISHED_TUFF_DOUBLE_SLAB == null) { BlockTypes.POLISHED_TUFF_DOUBLE_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleSlabBehaviorImpl.class) .vanillaBlock(BlockId.POLISHED_TUFF_DOUBLE_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -5951,7 +5951,7 @@ public static void init() { } if (BlockTypes.PRISMARINE_BRICK_DOUBLE_SLAB == null) { BlockTypes.PRISMARINE_BRICK_DOUBLE_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleSlabBehaviorImpl.class) .vanillaBlock(BlockId.PRISMARINE_BRICK_DOUBLE_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -5978,7 +5978,7 @@ public static void init() { } if (BlockTypes.PRISMARINE_DOUBLE_SLAB == null) { BlockTypes.PRISMARINE_DOUBLE_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleSlabBehaviorImpl.class) .vanillaBlock(BlockId.PRISMARINE_DOUBLE_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -6096,7 +6096,7 @@ public static void init() { } if (BlockTypes.PURPUR_DOUBLE_SLAB == null) { BlockTypes.PURPUR_DOUBLE_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleSlabBehaviorImpl.class) .vanillaBlock(BlockId.PURPUR_DOUBLE_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -6137,7 +6137,7 @@ public static void init() { } if (BlockTypes.QUARTZ_DOUBLE_SLAB == null) { BlockTypes.QUARTZ_DOUBLE_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleSlabBehaviorImpl.class) .vanillaBlock(BlockId.QUARTZ_DOUBLE_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -6254,7 +6254,7 @@ public static void init() { } if (BlockTypes.RED_NETHER_BRICK_DOUBLE_SLAB == null) { BlockTypes.RED_NETHER_BRICK_DOUBLE_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleSlabBehaviorImpl.class) .vanillaBlock(BlockId.RED_NETHER_BRICK_DOUBLE_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -6294,7 +6294,7 @@ public static void init() { } if (BlockTypes.RED_SANDSTONE_DOUBLE_SLAB == null) { BlockTypes.RED_SANDSTONE_DOUBLE_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleSlabBehaviorImpl.class) .vanillaBlock(BlockId.RED_SANDSTONE_DOUBLE_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -6422,7 +6422,7 @@ public static void init() { } if (BlockTypes.RESIN_BRICK_DOUBLE_SLAB == null) { BlockTypes.RESIN_BRICK_DOUBLE_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleSlabBehaviorImpl.class) .vanillaBlock(BlockId.RESIN_BRICK_DOUBLE_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -6489,7 +6489,7 @@ public static void init() { } if (BlockTypes.SANDSTONE_DOUBLE_SLAB == null) { BlockTypes.SANDSTONE_DOUBLE_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleSlabBehaviorImpl.class) .vanillaBlock(BlockId.SANDSTONE_DOUBLE_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -6650,7 +6650,7 @@ public static void init() { } if (BlockTypes.SMOOTH_QUARTZ_DOUBLE_SLAB == null) { BlockTypes.SMOOTH_QUARTZ_DOUBLE_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleSlabBehaviorImpl.class) .vanillaBlock(BlockId.SMOOTH_QUARTZ_DOUBLE_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -6677,7 +6677,7 @@ public static void init() { } if (BlockTypes.SMOOTH_RED_SANDSTONE_DOUBLE_SLAB == null) { BlockTypes.SMOOTH_RED_SANDSTONE_DOUBLE_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleSlabBehaviorImpl.class) .vanillaBlock(BlockId.SMOOTH_RED_SANDSTONE_DOUBLE_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -6704,7 +6704,7 @@ public static void init() { } if (BlockTypes.SMOOTH_SANDSTONE_DOUBLE_SLAB == null) { BlockTypes.SMOOTH_SANDSTONE_DOUBLE_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleSlabBehaviorImpl.class) .vanillaBlock(BlockId.SMOOTH_SANDSTONE_DOUBLE_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -6731,7 +6731,7 @@ public static void init() { } if (BlockTypes.SMOOTH_STONE_DOUBLE_SLAB == null) { BlockTypes.SMOOTH_STONE_DOUBLE_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleSlabBehaviorImpl.class) .vanillaBlock(BlockId.SMOOTH_STONE_DOUBLE_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -6831,7 +6831,7 @@ public static void init() { } if (BlockTypes.SPRUCE_DOUBLE_SLAB == null) { BlockTypes.SPRUCE_DOUBLE_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleSlabBehaviorImpl.class) .vanillaBlock(BlockId.SPRUCE_DOUBLE_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -6968,7 +6968,7 @@ public static void init() { } if (BlockTypes.STONE_BRICK_DOUBLE_SLAB == null) { BlockTypes.STONE_BRICK_DOUBLE_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleSlabBehaviorImpl.class) .vanillaBlock(BlockId.STONE_BRICK_DOUBLE_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -7351,7 +7351,7 @@ public static void init() { } if (BlockTypes.TUFF_BRICK_DOUBLE_SLAB == null) { BlockTypes.TUFF_BRICK_DOUBLE_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleSlabBehaviorImpl.class) .vanillaBlock(BlockId.TUFF_BRICK_DOUBLE_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -7385,7 +7385,7 @@ public static void init() { } if (BlockTypes.TUFF_DOUBLE_SLAB == null) { BlockTypes.TUFF_DOUBLE_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleSlabBehaviorImpl.class) .vanillaBlock(BlockId.TUFF_DOUBLE_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -7523,7 +7523,7 @@ public static void init() { } if (BlockTypes.WARPED_DOUBLE_SLAB == null) { BlockTypes.WARPED_DOUBLE_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleSlabBehaviorImpl.class) .vanillaBlock(BlockId.WARPED_DOUBLE_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -7694,7 +7694,7 @@ public static void init() { } if (BlockTypes.WAXED_CUT_COPPER_SLAB == null) { BlockTypes.WAXED_CUT_COPPER_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockCopperSlabBehaviorImpl.class) .vanillaBlock(BlockId.WAXED_CUT_COPPER_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -7708,7 +7708,7 @@ public static void init() { } if (BlockTypes.WAXED_DOUBLE_CUT_COPPER_SLAB == null) { BlockTypes.WAXED_DOUBLE_CUT_COPPER_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleCopperSlabBehaviorImpl.class) .vanillaBlock(BlockId.WAXED_DOUBLE_CUT_COPPER_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -7760,7 +7760,7 @@ public static void init() { } if (BlockTypes.WAXED_EXPOSED_CUT_COPPER_SLAB == null) { BlockTypes.WAXED_EXPOSED_CUT_COPPER_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockCopperSlabBehaviorImpl.class) .vanillaBlock(BlockId.WAXED_EXPOSED_CUT_COPPER_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -7774,7 +7774,7 @@ public static void init() { } if (BlockTypes.WAXED_EXPOSED_DOUBLE_CUT_COPPER_SLAB == null) { BlockTypes.WAXED_EXPOSED_DOUBLE_CUT_COPPER_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleCopperSlabBehaviorImpl.class) .vanillaBlock(BlockId.WAXED_EXPOSED_DOUBLE_CUT_COPPER_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -7826,7 +7826,7 @@ public static void init() { } if (BlockTypes.WAXED_OXIDIZED_CUT_COPPER_SLAB == null) { BlockTypes.WAXED_OXIDIZED_CUT_COPPER_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockCopperSlabBehaviorImpl.class) .vanillaBlock(BlockId.WAXED_OXIDIZED_CUT_COPPER_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -7840,7 +7840,7 @@ public static void init() { } if (BlockTypes.WAXED_OXIDIZED_DOUBLE_CUT_COPPER_SLAB == null) { BlockTypes.WAXED_OXIDIZED_DOUBLE_CUT_COPPER_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleCopperSlabBehaviorImpl.class) .vanillaBlock(BlockId.WAXED_OXIDIZED_DOUBLE_CUT_COPPER_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -7892,7 +7892,7 @@ public static void init() { } if (BlockTypes.WAXED_WEATHERED_CUT_COPPER_SLAB == null) { BlockTypes.WAXED_WEATHERED_CUT_COPPER_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockCopperSlabBehaviorImpl.class) .vanillaBlock(BlockId.WAXED_WEATHERED_CUT_COPPER_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -7906,7 +7906,7 @@ public static void init() { } if (BlockTypes.WAXED_WEATHERED_DOUBLE_CUT_COPPER_SLAB == null) { BlockTypes.WAXED_WEATHERED_DOUBLE_CUT_COPPER_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleCopperSlabBehaviorImpl.class) .vanillaBlock(BlockId.WAXED_WEATHERED_DOUBLE_CUT_COPPER_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -7958,7 +7958,7 @@ public static void init() { } if (BlockTypes.WEATHERED_CUT_COPPER_SLAB == null) { BlockTypes.WEATHERED_CUT_COPPER_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockCopperSlabBehaviorImpl.class) .vanillaBlock(BlockId.WEATHERED_CUT_COPPER_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); @@ -7972,7 +7972,7 @@ public static void init() { } if (BlockTypes.WEATHERED_DOUBLE_CUT_COPPER_SLAB == null) { BlockTypes.WEATHERED_DOUBLE_CUT_COPPER_SLAB = AllayBlockType - .builder(BlockSlabBehaviorImpl.class) + .builder(BlockDoubleCopperSlabBehaviorImpl.class) .vanillaBlock(BlockId.WEATHERED_DOUBLE_CUT_COPPER_SLAB) .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF) .build(); diff --git a/server/src/main/java/org/allaymc/server/block/type/BlockTypeInitializer.java b/server/src/main/java/org/allaymc/server/block/type/BlockTypeInitializer.java index 30f7b5e19..4e0de26a0 100644 --- a/server/src/main/java/org/allaymc/server/block/type/BlockTypeInitializer.java +++ b/server/src/main/java/org/allaymc/server/block/type/BlockTypeInitializer.java @@ -18,6 +18,8 @@ import org.allaymc.server.block.component.button.BlockButtonBaseComponentImpl; import org.allaymc.server.block.component.button.BlockWoodenButtonBaseComponentImpl; import org.allaymc.server.block.component.copper.BlockCopperBaseComponentImpl; +import org.allaymc.server.block.component.copper.BlockCopperDoubleSlabBaseComponentImpl; +import org.allaymc.server.block.component.copper.BlockCopperSlabBaseComponentImpl; import org.allaymc.server.block.component.copper.BlockCopperStairsBaseComponentImpl; import org.allaymc.server.block.component.crops.*; import org.allaymc.server.block.component.door.BlockDoorBaseComponentImpl; @@ -478,17 +480,17 @@ public static void initStairs() { } private static BlockType buildStairs(BlockId id) { - return builderStairs(BlockStairsBehaviorImpl.class, id).setBaseComponentSupplier(BlockStairsBaseComponentImpl::new).build(); + return stairsBuilder(BlockStairsBehaviorImpl.class, id).setBaseComponentSupplier(BlockStairsBaseComponentImpl::new).build(); } private static BlockType buildCopperStairs(BlockId id, OxidationLevel oxidationLevel, BiFunction> blockTypeFunction) { - return builderStairs(BlockCopperStairsBehaviorImpl.class, id) + return stairsBuilder(BlockCopperStairsBehaviorImpl.class, id) .setBaseComponentSupplier(BlockCopperStairsBaseComponentImpl::new) .addComponent(new BlockOxidationComponentImpl(oxidationLevel, blockTypeFunction)) .build(); } - private static AllayBlockType.Builder builderStairs(Class clazz, BlockId id) { + private static AllayBlockType.Builder stairsBuilder(Class clazz, BlockId id) { return AllayBlockType .builder(clazz) .vanillaBlock(id) @@ -496,6 +498,187 @@ private static AllayBlockType.Builder builderStairs(Cl .addComponent(BlockStateDataComponentImpl.ofRedefinedCollisionShape(VoxelShapes::buildStairShape)); } + public static void initSlab() { + BlockTypes.ACACIA_SLAB = buildSlab(BlockId.ACACIA_SLAB, BlockId.ACACIA_DOUBLE_SLAB); + BlockTypes.ANDESITE_SLAB = buildSlab(BlockId.ANDESITE_SLAB, BlockId.ANDESITE_DOUBLE_SLAB); + BlockTypes.BAMBOO_MOSAIC_SLAB = buildSlab(BlockId.BAMBOO_MOSAIC_SLAB, BlockId.BAMBOO_MOSAIC_DOUBLE_SLAB); + BlockTypes.BAMBOO_SLAB = buildSlab(BlockId.BAMBOO_SLAB, BlockId.BAMBOO_DOUBLE_SLAB); + BlockTypes.BIRCH_SLAB = buildSlab(BlockId.BIRCH_SLAB, BlockId.BIRCH_DOUBLE_SLAB); + BlockTypes.BLACKSTONE_SLAB = buildSlab(BlockId.BLACKSTONE_SLAB, BlockId.BLACKSTONE_DOUBLE_SLAB); + BlockTypes.BRICK_SLAB = buildSlab(BlockId.BRICK_SLAB, BlockId.BRICK_DOUBLE_SLAB); + BlockTypes.CHERRY_SLAB = buildSlab(BlockId.CHERRY_SLAB, BlockId.CHERRY_DOUBLE_SLAB); + BlockTypes.COBBLED_DEEPSLATE_SLAB = buildSlab(BlockId.COBBLED_DEEPSLATE_SLAB, BlockId.COBBLED_DEEPSLATE_DOUBLE_SLAB); + BlockTypes.COBBLESTONE_SLAB = buildSlab(BlockId.COBBLESTONE_SLAB, BlockId.COBBLESTONE_DOUBLE_SLAB); + BlockTypes.CRIMSON_SLAB = buildSlab(BlockId.CRIMSON_SLAB, BlockId.CRIMSON_DOUBLE_SLAB); + BlockTypes.CUT_RED_SANDSTONE_SLAB = buildSlab(BlockId.CUT_RED_SANDSTONE_SLAB, BlockId.CUT_RED_SANDSTONE_DOUBLE_SLAB); + BlockTypes.CUT_SANDSTONE_SLAB = buildSlab(BlockId.CUT_SANDSTONE_SLAB, BlockId.CUT_SANDSTONE_DOUBLE_SLAB); + BlockTypes.DARK_OAK_SLAB = buildSlab(BlockId.DARK_OAK_SLAB, BlockId.DARK_OAK_DOUBLE_SLAB); + BlockTypes.DARK_PRISMARINE_SLAB = buildSlab(BlockId.DARK_PRISMARINE_SLAB, BlockId.DARK_PRISMARINE_DOUBLE_SLAB); + BlockTypes.DEEPSLATE_BRICK_SLAB = buildSlab(BlockId.DEEPSLATE_BRICK_SLAB, BlockId.DEEPSLATE_BRICK_DOUBLE_SLAB); + BlockTypes.DEEPSLATE_TILE_SLAB = buildSlab(BlockId.DEEPSLATE_TILE_SLAB, BlockId.DEEPSLATE_TILE_DOUBLE_SLAB); + BlockTypes.DIORITE_SLAB = buildSlab(BlockId.DIORITE_SLAB, BlockId.DIORITE_DOUBLE_SLAB); + BlockTypes.END_STONE_BRICK_SLAB = buildSlab(BlockId.END_STONE_BRICK_SLAB, BlockId.END_STONE_BRICK_DOUBLE_SLAB); + BlockTypes.GRANITE_SLAB = buildSlab(BlockId.GRANITE_SLAB, BlockId.GRANITE_DOUBLE_SLAB); + BlockTypes.JUNGLE_SLAB = buildSlab(BlockId.JUNGLE_SLAB, BlockId.JUNGLE_DOUBLE_SLAB); + BlockTypes.MANGROVE_SLAB = buildSlab(BlockId.MANGROVE_SLAB, BlockId.MANGROVE_DOUBLE_SLAB); + BlockTypes.MOSSY_COBBLESTONE_SLAB = buildSlab(BlockId.MOSSY_COBBLESTONE_SLAB, BlockId.MOSSY_COBBLESTONE_DOUBLE_SLAB); + BlockTypes.MOSSY_STONE_BRICK_SLAB = buildSlab(BlockId.MOSSY_STONE_BRICK_SLAB, BlockId.MOSSY_STONE_BRICK_DOUBLE_SLAB); + BlockTypes.MUD_BRICK_SLAB = buildSlab(BlockId.MUD_BRICK_SLAB, BlockId.MUD_BRICK_DOUBLE_SLAB); + BlockTypes.NETHER_BRICK_SLAB = buildSlab(BlockId.NETHER_BRICK_SLAB, BlockId.NETHER_BRICK_DOUBLE_SLAB); + BlockTypes.NORMAL_STONE_SLAB = buildSlab(BlockId.NORMAL_STONE_SLAB, BlockId.NORMAL_STONE_DOUBLE_SLAB); + BlockTypes.OAK_SLAB = buildSlab(BlockId.OAK_SLAB, BlockId.OAK_DOUBLE_SLAB); + BlockTypes.PALE_OAK_SLAB = buildSlab(BlockId.PALE_OAK_SLAB, BlockId.PALE_OAK_DOUBLE_SLAB); + BlockTypes.PETRIFIED_OAK_SLAB = buildSlab(BlockId.PETRIFIED_OAK_SLAB, BlockId.PETRIFIED_OAK_DOUBLE_SLAB); + BlockTypes.POLISHED_ANDESITE_SLAB = buildSlab(BlockId.POLISHED_ANDESITE_SLAB, BlockId.POLISHED_ANDESITE_DOUBLE_SLAB); + BlockTypes.POLISHED_BLACKSTONE_BRICK_SLAB = buildSlab(BlockId.POLISHED_BLACKSTONE_BRICK_SLAB, BlockId.POLISHED_BLACKSTONE_BRICK_DOUBLE_SLAB); + BlockTypes.POLISHED_BLACKSTONE_SLAB = buildSlab(BlockId.POLISHED_BLACKSTONE_SLAB, BlockId.POLISHED_BLACKSTONE_DOUBLE_SLAB); + BlockTypes.POLISHED_DEEPSLATE_SLAB = buildSlab(BlockId.POLISHED_DEEPSLATE_SLAB, BlockId.POLISHED_DEEPSLATE_DOUBLE_SLAB); + BlockTypes.POLISHED_DIORITE_SLAB = buildSlab(BlockId.POLISHED_DIORITE_SLAB, BlockId.POLISHED_DIORITE_DOUBLE_SLAB); + BlockTypes.POLISHED_GRANITE_SLAB = buildSlab(BlockId.POLISHED_GRANITE_SLAB, BlockId.POLISHED_GRANITE_DOUBLE_SLAB); + BlockTypes.POLISHED_TUFF_SLAB = buildSlab(BlockId.POLISHED_TUFF_SLAB, BlockId.POLISHED_TUFF_DOUBLE_SLAB); + BlockTypes.PRISMARINE_BRICK_SLAB = buildSlab(BlockId.PRISMARINE_BRICK_SLAB, BlockId.PRISMARINE_BRICK_DOUBLE_SLAB); + BlockTypes.PRISMARINE_SLAB = buildSlab(BlockId.PRISMARINE_SLAB, BlockId.PRISMARINE_DOUBLE_SLAB); + BlockTypes.PURPUR_SLAB = buildSlab(BlockId.PURPUR_SLAB, BlockId.PURPUR_DOUBLE_SLAB); + BlockTypes.QUARTZ_SLAB = buildSlab(BlockId.QUARTZ_SLAB, BlockId.QUARTZ_DOUBLE_SLAB); + BlockTypes.RED_NETHER_BRICK_SLAB = buildSlab(BlockId.RED_NETHER_BRICK_SLAB, BlockId.RED_NETHER_BRICK_DOUBLE_SLAB); + BlockTypes.RED_SANDSTONE_SLAB = buildSlab(BlockId.RED_SANDSTONE_SLAB, BlockId.RED_SANDSTONE_DOUBLE_SLAB); + BlockTypes.RESIN_BRICK_SLAB = buildSlab(BlockId.RESIN_BRICK_SLAB, BlockId.RESIN_BRICK_DOUBLE_SLAB); + BlockTypes.SANDSTONE_SLAB = buildSlab(BlockId.SANDSTONE_SLAB, BlockId.SANDSTONE_DOUBLE_SLAB); + BlockTypes.SMOOTH_QUARTZ_SLAB = buildSlab(BlockId.SMOOTH_QUARTZ_SLAB, BlockId.SMOOTH_QUARTZ_DOUBLE_SLAB); + BlockTypes.SMOOTH_RED_SANDSTONE_SLAB = buildSlab(BlockId.SMOOTH_RED_SANDSTONE_SLAB, BlockId.SMOOTH_RED_SANDSTONE_DOUBLE_SLAB); + BlockTypes.SMOOTH_SANDSTONE_SLAB = buildSlab(BlockId.SMOOTH_SANDSTONE_SLAB, BlockId.SMOOTH_SANDSTONE_DOUBLE_SLAB); + BlockTypes.SMOOTH_STONE_SLAB = buildSlab(BlockId.SMOOTH_STONE_SLAB, BlockId.SMOOTH_STONE_DOUBLE_SLAB); + BlockTypes.SPRUCE_SLAB = buildSlab(BlockId.SPRUCE_SLAB, BlockId.SPRUCE_DOUBLE_SLAB); + BlockTypes.STONE_BRICK_SLAB = buildSlab(BlockId.STONE_BRICK_SLAB, BlockId.STONE_BRICK_DOUBLE_SLAB); + BlockTypes.TUFF_BRICK_SLAB = buildSlab(BlockId.TUFF_BRICK_SLAB, BlockId.TUFF_BRICK_DOUBLE_SLAB); + BlockTypes.TUFF_SLAB = buildSlab(BlockId.TUFF_SLAB, BlockId.TUFF_DOUBLE_SLAB); + BlockTypes.WARPED_SLAB = buildSlab(BlockId.WARPED_SLAB, BlockId.WARPED_DOUBLE_SLAB); + + BiFunction> cutCopperSlab = (level, waxed) -> switch (level) { + case UNAFFECTED -> waxed ? BlockTypes.WAXED_CUT_COPPER_SLAB : BlockTypes.CUT_COPPER_SLAB; + case EXPOSED -> waxed ? BlockTypes.WAXED_EXPOSED_CUT_COPPER_SLAB : BlockTypes.EXPOSED_CUT_COPPER_SLAB; + case WEATHERED -> waxed ? BlockTypes.WAXED_WEATHERED_CUT_COPPER_SLAB : BlockTypes.WEATHERED_CUT_COPPER_SLAB; + case OXIDIZED -> waxed ? BlockTypes.WAXED_OXIDIZED_CUT_COPPER_SLAB : BlockTypes.OXIDIZED_CUT_COPPER_SLAB; + }; + BlockTypes.CUT_COPPER_SLAB = buildCopperSlab(BlockId.CUT_COPPER_SLAB, BlockId.DOUBLE_CUT_COPPER_SLAB, OxidationLevel.UNAFFECTED, cutCopperSlab); + BlockTypes.EXPOSED_CUT_COPPER_SLAB = buildCopperSlab(BlockId.EXPOSED_CUT_COPPER_SLAB, BlockId.EXPOSED_DOUBLE_CUT_COPPER_SLAB, OxidationLevel.EXPOSED, cutCopperSlab); + BlockTypes.WEATHERED_CUT_COPPER_SLAB = buildCopperSlab(BlockId.WEATHERED_CUT_COPPER_SLAB, BlockId.WEATHERED_DOUBLE_CUT_COPPER_SLAB, OxidationLevel.WEATHERED, cutCopperSlab); + BlockTypes.OXIDIZED_CUT_COPPER_SLAB = buildCopperSlab(BlockId.OXIDIZED_CUT_COPPER_SLAB, BlockId.OXIDIZED_DOUBLE_CUT_COPPER_SLAB, OxidationLevel.OXIDIZED, cutCopperSlab); + BlockTypes.WAXED_CUT_COPPER_SLAB = buildCopperSlab(BlockId.WAXED_CUT_COPPER_SLAB, BlockId.WAXED_DOUBLE_CUT_COPPER_SLAB, OxidationLevel.UNAFFECTED, cutCopperSlab); + BlockTypes.WAXED_EXPOSED_CUT_COPPER_SLAB = buildCopperSlab(BlockId.WAXED_EXPOSED_CUT_COPPER_SLAB, BlockId.WAXED_EXPOSED_DOUBLE_CUT_COPPER_SLAB, OxidationLevel.EXPOSED, cutCopperSlab); + BlockTypes.WAXED_WEATHERED_CUT_COPPER_SLAB = buildCopperSlab(BlockId.WAXED_WEATHERED_CUT_COPPER_SLAB, BlockId.WAXED_WEATHERED_DOUBLE_CUT_COPPER_SLAB, OxidationLevel.WEATHERED, cutCopperSlab); + BlockTypes.WAXED_OXIDIZED_CUT_COPPER_SLAB = buildCopperSlab(BlockId.WAXED_OXIDIZED_CUT_COPPER_SLAB, BlockId.WAXED_OXIDIZED_DOUBLE_CUT_COPPER_SLAB, OxidationLevel.OXIDIZED, cutCopperSlab); + } + + public static void initDoubleSlab() { + BlockTypes.ACACIA_DOUBLE_SLAB = buildDoubleSlab(BlockId.ACACIA_DOUBLE_SLAB, BlockId.ACACIA_SLAB); + BlockTypes.ANDESITE_DOUBLE_SLAB = buildDoubleSlab(BlockId.ANDESITE_DOUBLE_SLAB, BlockId.ANDESITE_SLAB); + BlockTypes.BAMBOO_DOUBLE_SLAB = buildDoubleSlab(BlockId.BAMBOO_DOUBLE_SLAB, BlockId.BAMBOO_SLAB); + BlockTypes.BAMBOO_MOSAIC_DOUBLE_SLAB = buildDoubleSlab(BlockId.BAMBOO_MOSAIC_DOUBLE_SLAB, BlockId.BAMBOO_MOSAIC_SLAB); + BlockTypes.BIRCH_DOUBLE_SLAB = buildDoubleSlab(BlockId.BIRCH_DOUBLE_SLAB, BlockId.BIRCH_SLAB); + BlockTypes.BLACKSTONE_DOUBLE_SLAB = buildDoubleSlab(BlockId.BLACKSTONE_DOUBLE_SLAB, BlockId.BLACKSTONE_SLAB); + BlockTypes.BRICK_DOUBLE_SLAB = buildDoubleSlab(BlockId.BRICK_DOUBLE_SLAB, BlockId.BRICK_SLAB); + BlockTypes.CHERRY_DOUBLE_SLAB = buildDoubleSlab(BlockId.CHERRY_DOUBLE_SLAB, BlockId.CHERRY_SLAB); + BlockTypes.COBBLED_DEEPSLATE_DOUBLE_SLAB = buildDoubleSlab(BlockId.COBBLED_DEEPSLATE_DOUBLE_SLAB, BlockId.COBBLED_DEEPSLATE_SLAB); + BlockTypes.COBBLESTONE_DOUBLE_SLAB = buildDoubleSlab(BlockId.COBBLESTONE_DOUBLE_SLAB, BlockId.COBBLESTONE_SLAB); + BlockTypes.CRIMSON_DOUBLE_SLAB = buildDoubleSlab(BlockId.CRIMSON_DOUBLE_SLAB, BlockId.CRIMSON_SLAB); + BlockTypes.CUT_RED_SANDSTONE_DOUBLE_SLAB = buildDoubleSlab(BlockId.CUT_RED_SANDSTONE_DOUBLE_SLAB, BlockId.CUT_RED_SANDSTONE_SLAB); + BlockTypes.CUT_SANDSTONE_DOUBLE_SLAB = buildDoubleSlab(BlockId.CUT_SANDSTONE_DOUBLE_SLAB, BlockId.CUT_SANDSTONE_SLAB); + BlockTypes.DARK_OAK_DOUBLE_SLAB = buildDoubleSlab(BlockId.DARK_OAK_DOUBLE_SLAB, BlockId.DARK_OAK_SLAB); + BlockTypes.DARK_PRISMARINE_DOUBLE_SLAB = buildDoubleSlab(BlockId.DARK_PRISMARINE_DOUBLE_SLAB, BlockId.DARK_PRISMARINE_SLAB); + BlockTypes.DEEPSLATE_BRICK_DOUBLE_SLAB = buildDoubleSlab(BlockId.DEEPSLATE_BRICK_DOUBLE_SLAB, BlockId.DEEPSLATE_BRICK_SLAB); + BlockTypes.DEEPSLATE_TILE_DOUBLE_SLAB = buildDoubleSlab(BlockId.DEEPSLATE_TILE_DOUBLE_SLAB, BlockId.DEEPSLATE_TILE_SLAB); + BlockTypes.DIORITE_DOUBLE_SLAB = buildDoubleSlab(BlockId.DIORITE_DOUBLE_SLAB, BlockId.DIORITE_SLAB); + BlockTypes.END_STONE_BRICK_DOUBLE_SLAB = buildDoubleSlab(BlockId.END_STONE_BRICK_DOUBLE_SLAB, BlockId.END_STONE_BRICK_SLAB); + BlockTypes.GRANITE_DOUBLE_SLAB = buildDoubleSlab(BlockId.GRANITE_DOUBLE_SLAB, BlockId.GRANITE_SLAB); + BlockTypes.JUNGLE_DOUBLE_SLAB = buildDoubleSlab(BlockId.JUNGLE_DOUBLE_SLAB, BlockId.JUNGLE_SLAB); + BlockTypes.MANGROVE_DOUBLE_SLAB = buildDoubleSlab(BlockId.MANGROVE_DOUBLE_SLAB, BlockId.MANGROVE_SLAB); + BlockTypes.MOSSY_COBBLESTONE_DOUBLE_SLAB = buildDoubleSlab(BlockId.MOSSY_COBBLESTONE_DOUBLE_SLAB, BlockId.MOSSY_COBBLESTONE_SLAB); + BlockTypes.MOSSY_STONE_BRICK_DOUBLE_SLAB = buildDoubleSlab(BlockId.MOSSY_STONE_BRICK_DOUBLE_SLAB, BlockId.MOSSY_STONE_BRICK_SLAB); + BlockTypes.MUD_BRICK_DOUBLE_SLAB = buildDoubleSlab(BlockId.MUD_BRICK_DOUBLE_SLAB, BlockId.MUD_BRICK_SLAB); + BlockTypes.NETHER_BRICK_DOUBLE_SLAB = buildDoubleSlab(BlockId.NETHER_BRICK_DOUBLE_SLAB, BlockId.NETHER_BRICK_SLAB); + BlockTypes.NORMAL_STONE_DOUBLE_SLAB = buildDoubleSlab(BlockId.NORMAL_STONE_DOUBLE_SLAB, BlockId.NORMAL_STONE_SLAB); + BlockTypes.OAK_DOUBLE_SLAB = buildDoubleSlab(BlockId.OAK_DOUBLE_SLAB, BlockId.OAK_SLAB); + BlockTypes.PALE_OAK_DOUBLE_SLAB = buildDoubleSlab(BlockId.PALE_OAK_DOUBLE_SLAB, BlockId.PALE_OAK_SLAB); + BlockTypes.PETRIFIED_OAK_DOUBLE_SLAB = buildDoubleSlab(BlockId.PETRIFIED_OAK_DOUBLE_SLAB, BlockId.PETRIFIED_OAK_SLAB); + BlockTypes.POLISHED_ANDESITE_DOUBLE_SLAB = buildDoubleSlab(BlockId.POLISHED_ANDESITE_DOUBLE_SLAB, BlockId.POLISHED_ANDESITE_SLAB); + BlockTypes.POLISHED_BLACKSTONE_BRICK_DOUBLE_SLAB = buildDoubleSlab(BlockId.POLISHED_BLACKSTONE_BRICK_DOUBLE_SLAB, BlockId.POLISHED_BLACKSTONE_BRICK_SLAB); + BlockTypes.POLISHED_BLACKSTONE_DOUBLE_SLAB = buildDoubleSlab(BlockId.POLISHED_BLACKSTONE_DOUBLE_SLAB, BlockId.POLISHED_BLACKSTONE_SLAB); + BlockTypes.POLISHED_DEEPSLATE_DOUBLE_SLAB = buildDoubleSlab(BlockId.POLISHED_DEEPSLATE_DOUBLE_SLAB, BlockId.POLISHED_DEEPSLATE_SLAB); + BlockTypes.POLISHED_DIORITE_DOUBLE_SLAB = buildDoubleSlab(BlockId.POLISHED_DIORITE_DOUBLE_SLAB, BlockId.POLISHED_DIORITE_SLAB); + BlockTypes.POLISHED_GRANITE_DOUBLE_SLAB = buildDoubleSlab(BlockId.POLISHED_GRANITE_DOUBLE_SLAB, BlockId.POLISHED_GRANITE_SLAB); + BlockTypes.POLISHED_TUFF_DOUBLE_SLAB = buildDoubleSlab(BlockId.POLISHED_TUFF_DOUBLE_SLAB, BlockId.POLISHED_TUFF_SLAB); + BlockTypes.PRISMARINE_BRICK_DOUBLE_SLAB = buildDoubleSlab(BlockId.PRISMARINE_BRICK_DOUBLE_SLAB, BlockId.PRISMARINE_BRICK_SLAB); + BlockTypes.PRISMARINE_DOUBLE_SLAB = buildDoubleSlab(BlockId.PRISMARINE_DOUBLE_SLAB, BlockId.PRISMARINE_SLAB); + BlockTypes.PURPUR_DOUBLE_SLAB = buildDoubleSlab(BlockId.PURPUR_DOUBLE_SLAB, BlockId.PURPUR_SLAB); + BlockTypes.QUARTZ_DOUBLE_SLAB = buildDoubleSlab(BlockId.QUARTZ_DOUBLE_SLAB, BlockId.QUARTZ_SLAB); + BlockTypes.RED_NETHER_BRICK_DOUBLE_SLAB = buildDoubleSlab(BlockId.RED_NETHER_BRICK_DOUBLE_SLAB, BlockId.RED_NETHER_BRICK_SLAB); + BlockTypes.RED_SANDSTONE_DOUBLE_SLAB = buildDoubleSlab(BlockId.RED_SANDSTONE_DOUBLE_SLAB, BlockId.RED_SANDSTONE_SLAB); + BlockTypes.RESIN_BRICK_DOUBLE_SLAB = buildDoubleSlab(BlockId.RESIN_BRICK_DOUBLE_SLAB, BlockId.RESIN_BRICK_SLAB); + BlockTypes.SANDSTONE_DOUBLE_SLAB = buildDoubleSlab(BlockId.SANDSTONE_DOUBLE_SLAB, BlockId.SANDSTONE_SLAB); + BlockTypes.SMOOTH_QUARTZ_DOUBLE_SLAB = buildDoubleSlab(BlockId.SMOOTH_QUARTZ_DOUBLE_SLAB, BlockId.SMOOTH_QUARTZ_SLAB); + BlockTypes.SMOOTH_RED_SANDSTONE_DOUBLE_SLAB = buildDoubleSlab(BlockId.SMOOTH_RED_SANDSTONE_DOUBLE_SLAB, BlockId.SMOOTH_RED_SANDSTONE_SLAB); + BlockTypes.SMOOTH_SANDSTONE_DOUBLE_SLAB = buildDoubleSlab(BlockId.SMOOTH_SANDSTONE_DOUBLE_SLAB, BlockId.SMOOTH_SANDSTONE_SLAB); + BlockTypes.SMOOTH_STONE_DOUBLE_SLAB = buildDoubleSlab(BlockId.SMOOTH_STONE_DOUBLE_SLAB, BlockId.SMOOTH_STONE_SLAB); + BlockTypes.SPRUCE_DOUBLE_SLAB = buildDoubleSlab(BlockId.SPRUCE_DOUBLE_SLAB, BlockId.SPRUCE_SLAB); + BlockTypes.STONE_BRICK_DOUBLE_SLAB = buildDoubleSlab(BlockId.STONE_BRICK_DOUBLE_SLAB, BlockId.STONE_BRICK_SLAB); + BlockTypes.TUFF_BRICK_DOUBLE_SLAB = buildDoubleSlab(BlockId.TUFF_BRICK_DOUBLE_SLAB, BlockId.TUFF_BRICK_SLAB); + BlockTypes.TUFF_DOUBLE_SLAB = buildDoubleSlab(BlockId.TUFF_DOUBLE_SLAB, BlockId.TUFF_SLAB); + BlockTypes.WARPED_DOUBLE_SLAB = buildDoubleSlab(BlockId.WARPED_DOUBLE_SLAB, BlockId.WARPED_SLAB); + + BiFunction> cutCopperSlab = (level, waxed) -> switch (level) { + case UNAFFECTED -> waxed ? BlockTypes.WAXED_DOUBLE_CUT_COPPER_SLAB : BlockTypes.DOUBLE_CUT_COPPER_SLAB; + case EXPOSED -> + waxed ? BlockTypes.WAXED_EXPOSED_DOUBLE_CUT_COPPER_SLAB : BlockTypes.EXPOSED_DOUBLE_CUT_COPPER_SLAB; + case WEATHERED -> + waxed ? BlockTypes.WAXED_WEATHERED_DOUBLE_CUT_COPPER_SLAB : BlockTypes.WEATHERED_DOUBLE_CUT_COPPER_SLAB; + case OXIDIZED -> + waxed ? BlockTypes.WAXED_OXIDIZED_DOUBLE_CUT_COPPER_SLAB : BlockTypes.OXIDIZED_DOUBLE_CUT_COPPER_SLAB; + }; + BlockTypes.DOUBLE_CUT_COPPER_SLAB = buildCopperDoubleSlab(BlockId.DOUBLE_CUT_COPPER_SLAB, BlockId.CUT_COPPER_SLAB, OxidationLevel.UNAFFECTED, cutCopperSlab); + BlockTypes.EXPOSED_DOUBLE_CUT_COPPER_SLAB = buildCopperDoubleSlab(BlockId.EXPOSED_DOUBLE_CUT_COPPER_SLAB, BlockId.EXPOSED_CUT_COPPER_SLAB, OxidationLevel.EXPOSED, cutCopperSlab); + BlockTypes.WEATHERED_DOUBLE_CUT_COPPER_SLAB = buildCopperDoubleSlab(BlockId.WEATHERED_DOUBLE_CUT_COPPER_SLAB, BlockId.WEATHERED_CUT_COPPER_SLAB, OxidationLevel.WEATHERED, cutCopperSlab); + BlockTypes.OXIDIZED_DOUBLE_CUT_COPPER_SLAB = buildCopperDoubleSlab(BlockId.OXIDIZED_DOUBLE_CUT_COPPER_SLAB, BlockId.OXIDIZED_CUT_COPPER_SLAB, OxidationLevel.OXIDIZED, cutCopperSlab); + BlockTypes.WAXED_DOUBLE_CUT_COPPER_SLAB = buildCopperDoubleSlab(BlockId.WAXED_DOUBLE_CUT_COPPER_SLAB, BlockId.WAXED_CUT_COPPER_SLAB, OxidationLevel.UNAFFECTED, cutCopperSlab); + BlockTypes.WAXED_EXPOSED_DOUBLE_CUT_COPPER_SLAB = buildCopperDoubleSlab(BlockId.WAXED_EXPOSED_DOUBLE_CUT_COPPER_SLAB, BlockId.WAXED_EXPOSED_CUT_COPPER_SLAB, OxidationLevel.EXPOSED, cutCopperSlab); + BlockTypes.WAXED_WEATHERED_DOUBLE_CUT_COPPER_SLAB = buildCopperDoubleSlab(BlockId.WAXED_WEATHERED_DOUBLE_CUT_COPPER_SLAB, BlockId.WAXED_WEATHERED_CUT_COPPER_SLAB, OxidationLevel.WEATHERED, cutCopperSlab); + BlockTypes.WAXED_OXIDIZED_DOUBLE_CUT_COPPER_SLAB = buildCopperDoubleSlab(BlockId.WAXED_OXIDIZED_DOUBLE_CUT_COPPER_SLAB, BlockId.WAXED_OXIDIZED_CUT_COPPER_SLAB, OxidationLevel.OXIDIZED, cutCopperSlab); + } + + public static BlockType buildSlab(BlockId id, BlockId doubleSlabId) { + return slabBuilder(BlockSlabBehaviorImpl.class, id) + .setBaseComponentSupplier(blockType -> new BlockSlabBaseComponentImpl(blockType, doubleSlabId)) + .build(); + } + + public static BlockType buildCopperSlab(BlockId id, BlockId doubleSlabId, OxidationLevel oxidationLevel, BiFunction> blockTypeFunction) { + return slabBuilder(BlockCopperSlabBehaviorImpl.class, id) + .setBaseComponentSupplier(blockType -> new BlockCopperSlabBaseComponentImpl(blockType, doubleSlabId)) + .addComponent(new BlockOxidationComponentImpl(oxidationLevel, blockTypeFunction)) + .build(); + } + + public static BlockType buildDoubleSlab(BlockId id, BlockId singleSlabId) { + return slabBuilder(BlockDoubleSlabBehaviorImpl.class, id) + .setBaseComponentSupplier(blockType -> new BlockDoubleSlabBaseComponentImpl(blockType, singleSlabId)) + .build(); + } + + public static BlockType buildCopperDoubleSlab(BlockId id, BlockId singleSlabId, OxidationLevel oxidationLevel, BiFunction> blockTypeFunction) { + return slabBuilder(BlockDoubleCopperSlabBehaviorImpl.class, id) + .setBaseComponentSupplier(blockType -> new BlockCopperDoubleSlabBaseComponentImpl(blockType, singleSlabId)) + .addComponent(new BlockOxidationComponentImpl(oxidationLevel, blockTypeFunction)) + .build(); + } + + public static AllayBlockType.Builder slabBuilder(Class clazz, BlockId id) { + // Both slab and double slab have MINECRAFT_VERTICAL_HALF property + return AllayBlockType + .builder(clazz) + .vanillaBlock(id) + .setProperties(BlockPropertyTypes.MINECRAFT_VERTICAL_HALF); + } + public static void initColoredTorch() { BlockTypes.COLORED_TORCH_RED = buildColoredTorch(BlockId.COLORED_TORCH_RED); BlockTypes.COLORED_TORCH_BLUE = buildColoredTorch(BlockId.COLORED_TORCH_BLUE); @@ -685,7 +868,7 @@ public static void initDoors() { BlockTypes.WARPED_DOOR = buildDoor(BlockId.WARPED_DOOR); BlockTypes.PALE_OAK_DOOR = buildDoor(BlockId.PALE_OAK_DOOR); - BlockTypes.IRON_DOOR = builderDoor(BlockIronDoorBehaviorImpl.class, BlockId.IRON_DOOR, BlockIronDoorBaseComponentImpl::new).build(); + BlockTypes.IRON_DOOR = doorBuilder(BlockIronDoorBehaviorImpl.class, BlockId.IRON_DOOR, BlockIronDoorBaseComponentImpl::new).build(); // TODO: fix base door behavior // BiFunction> copperDoor = (level, waxed) -> switch (level) { @@ -705,7 +888,7 @@ public static void initDoors() { } private static BlockType buildDoor(BlockId blockId) { - return builderDoor(BlockDoorBehaviorImpl.class, blockId, BlockDoorBaseComponentImpl::new).build(); + return doorBuilder(BlockDoorBehaviorImpl.class, blockId, BlockDoorBaseComponentImpl::new).build(); } // private static BlockType buildCopperDoor(BlockId blockId, OxidationLevel oxidationLevel, BiFunction> blockTypeFunction) { @@ -714,7 +897,7 @@ private static BlockType buildDoor(BlockId blockId) // .build(); // } - private static AllayBlockType.Builder builderDoor(Class clazz, BlockId blockId, Function, BlockBaseComponent> blockBaseComponentSupplier) { + private static AllayBlockType.Builder doorBuilder(Class clazz, BlockId blockId, Function, BlockBaseComponent> blockBaseComponentSupplier) { return AllayBlockType .builder(clazz) .vanillaBlock(blockId) diff --git a/server/src/main/java/org/allaymc/server/item/component/ItemBaseComponentImpl.java b/server/src/main/java/org/allaymc/server/item/component/ItemBaseComponentImpl.java index becb43b00..ffe0e79c8 100644 --- a/server/src/main/java/org/allaymc/server/item/component/ItemBaseComponentImpl.java +++ b/server/src/main/java/org/allaymc/server/item/component/ItemBaseComponentImpl.java @@ -301,13 +301,12 @@ protected boolean tryPlaceBlockState(Dimension dimension, BlockState blockState, player = placementInfo.player(); } + var blockType = blockState.getBlockType(); var oldBlockState = dimension.getBlockState(placeBlockPos); if (!oldBlockState.getBlockType().hasBlockTag(BlockCustomTags.REPLACEABLE)) { - return false; + return blockType.getBlockBehavior().combine(dimension, blockState, placeBlockPos, placementInfo); } - var blockType = blockState.getBlockType(); - var event = new BlockPlaceEvent( new BlockStateWithPos(blockState, new Position3i(placeBlockPos, dimension), 0), oldBlockState, thisItemStack, player, placementInfo