diff --git a/src/main/java/appeng/core/api/definitions/ApiBlocks.java b/src/main/java/appeng/core/api/definitions/ApiBlocks.java index 721f8908e..15478c056 100644 --- a/src/main/java/appeng/core/api/definitions/ApiBlocks.java +++ b/src/main/java/appeng/core/api/definitions/ApiBlocks.java @@ -33,10 +33,7 @@ import appeng.core.features.registries.PartModels; import appeng.decorative.AEDecorativeBlock; import appeng.decorative.solid.*; import appeng.tile.storage.TileSkyChest; -import net.minecraft.block.Block; -import net.minecraft.block.Blocks; -import net.minecraft.block.SlabBlock; -import net.minecraft.block.SoundType; +import net.minecraft.block.*; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.RenderType; import net.minecraftforge.api.distmarker.Dist; @@ -131,6 +128,9 @@ public final class ApiBlocks implements IBlocks private static final Block.Properties QUARTZ_PROPERTIES = Block.Properties.create(Material.ROCK) .hardnessAndResistance(3, 5); + private static final Block.Properties SKYSTONE_PROPERTIES = Block.Properties.create( Material.ROCK ) + .hardnessAndResistance( 50, 150 ); + public ApiBlocks( FeatureFactory registry, PartModels partModels ) { this.quartzOre = registry.block( "quartz_ore", () -> new BlockQuartzOre(QUARTZ_PROPERTIES)) @@ -189,15 +189,12 @@ public final class ApiBlocks implements IBlocks .build(); this.smoothSkyStoneBlock = registry.features( AEFeature.SKY_STONE ) - .block( "smooth_sky_stone_block", () -> new BlockSkyStone( SkystoneType.BLOCK, Block.Properties.create(Material.ROCK) - .hardnessAndResistance(50, 150) ) ) + .block( "smooth_sky_stone_block", () -> new BlockSkyStone( SkystoneType.BLOCK, SKYSTONE_PROPERTIES ) ) .build(); - this.skyStoneBrick = deco.block( "sky_stone_brick", () -> new BlockSkyStone( SkystoneType.BRICK, Block.Properties.create(Material.ROCK) - .hardnessAndResistance(50, 150) ) ) + this.skyStoneBrick = deco.block( "sky_stone_brick", () -> new BlockSkyStone( SkystoneType.BRICK, SKYSTONE_PROPERTIES ) ) .addFeatures( AEFeature.SKY_STONE ) .build(); - this.skyStoneSmallBrick = deco.block( "sky_stone_small_brick", () -> new BlockSkyStone( SkystoneType.SMALL_BRICK, Block.Properties.create(Material.ROCK) - .hardnessAndResistance(50, 150) ) ) + this.skyStoneSmallBrick = deco.block( "sky_stone_small_brick", () -> new BlockSkyStone( SkystoneType.SMALL_BRICK, SKYSTONE_PROPERTIES ) ) .addFeatures( AEFeature.SKY_STONE ) .build(); @@ -424,14 +421,31 @@ public final class ApiBlocks implements IBlocks // .rendering( new PaintRendering() ) // .build(); // -// this.skyStoneStairs = makeStairs( "sky_stone_stairs", registry, this.skyStoneBlock() ); -// this.smoothSkyStoneStairs = makeStairs( "smooth_sky_stone_stairs", registry, this.smoothSkyStoneBlock() ); -// this.skyStoneBrickStairs = makeStairs( "sky_stone_brick_stairs", registry, this.skyStoneBrick() ); -// this.skyStoneSmallBrickStairs = makeStairs( "sky_stone_small_brick_stairs", registry, this.skyStoneSmallBrick() ); -// this.fluixStairs = makeStairs( "fluix_stairs", registry, this.fluixBlock() ); -// this.quartzStairs = makeStairs( "quartz_stairs", registry, this.quartzBlock() ); -// this.chiseledQuartzStairs = makeStairs( "chiseled_quartz_stairs", registry, this.chiseledQuartzBlock() ); -// this.quartzPillarStairs = makeStairs( "quartz_pillar_stairs", registry, this.quartzPillar() ); + this.skyStoneStairs = deco.block( "sky_stone_stairs", () -> new StairsBlock(this.skyStoneBlock().block()::getDefaultState, SKYSTONE_PROPERTIES ) ) + .addFeatures( AEFeature.SKY_STONE ) + .build(); + this.smoothSkyStoneStairs = deco.block( "smooth_sky_stone_stairs", () -> new StairsBlock(this.smoothSkyStoneBlock().block()::getDefaultState, SKYSTONE_PROPERTIES ) ) + .addFeatures( AEFeature.SKY_STONE ) + .build(); + this.skyStoneBrickStairs = deco.block( "sky_stone_brick_stairs", () -> new StairsBlock(this.skyStoneBrick().block()::getDefaultState, SKYSTONE_PROPERTIES) ) + .addFeatures( AEFeature.SKY_STONE ) + .build(); + this.skyStoneSmallBrickStairs = deco.block( "sky_stone_small_brick_stairs", () -> new StairsBlock(this.skyStoneSmallBrick().block()::getDefaultState, SKYSTONE_PROPERTIES) ) + .addFeatures( AEFeature.SKY_STONE ) + .build(); + + this.fluixStairs = deco.block( "fluix_stairs", () -> new StairsBlock(this.fluixBlock().block()::getDefaultState, QUARTZ_PROPERTIES) ) + .addFeatures( AEFeature.FLUIX ) + .build(); + this.quartzStairs = deco.block( "quartz_stairs", () -> new StairsBlock(this.quartzBlock().block()::getDefaultState, QUARTZ_PROPERTIES) ) + .addFeatures( AEFeature.CERTUS ) + .build(); + this.chiseledQuartzStairs = deco.block( "chiseled_quartz_stairs", () -> new StairsBlock(this.chiseledQuartzBlock().block()::getDefaultState, QUARTZ_PROPERTIES) ) + .addFeatures( AEFeature.CERTUS ) + .build(); + this.quartzPillarStairs = deco.block( "quartz_pillar_stairs", () -> new StairsBlock(this.quartzPillar().block()::getDefaultState, QUARTZ_PROPERTIES) ) + .addFeatures( AEFeature.CERTUS ) + .build(); // // this.multiPart = registry.block( "cable_bus", BlockCableBus::new ) // .rendering( new CableBusRendering( partModels ) ) @@ -441,35 +455,29 @@ public final class ApiBlocks implements IBlocks // .bootstrap( ( block, item ) -> (IPostInitComponent) side -> ( (BlockCableBus) block ).setupTile() ) // .build(); - Block.Properties skystoneSlabProperties = Block.Properties.create( Material.ROCK ) - .hardnessAndResistance( 50, 150 ); - - this.skyStoneSlab = deco.block( "sky_stone_slab", () -> new SlabBlock( skystoneSlabProperties ) ) + this.skyStoneSlab = deco.block( "sky_stone_slab", () -> new SlabBlock( SKYSTONE_PROPERTIES ) ) .addFeatures( AEFeature.SKY_STONE ) .build(); - this.smoothSkyStoneSlab = deco.block( "smooth_sky_stone_slab", () -> new SlabBlock( skystoneSlabProperties ) ) + this.smoothSkyStoneSlab = deco.block( "smooth_sky_stone_slab", () -> new SlabBlock( SKYSTONE_PROPERTIES ) ) .addFeatures( AEFeature.SKY_STONE ) .build(); - this.skyStoneBrickSlab = deco.block( "sky_stone_brick_slab", () -> new SlabBlock( skystoneSlabProperties ) ) + this.skyStoneBrickSlab = deco.block( "sky_stone_brick_slab", () -> new SlabBlock( SKYSTONE_PROPERTIES ) ) .addFeatures( AEFeature.SKY_STONE ) .build(); - this.skyStoneSmallBrickSlab = deco.block( "sky_stone_small_brick_slab", () -> new SlabBlock( skystoneSlabProperties ) ) + this.skyStoneSmallBrickSlab = deco.block( "sky_stone_small_brick_slab", () -> new SlabBlock( SKYSTONE_PROPERTIES ) ) .addFeatures( AEFeature.SKY_STONE ) .build(); - Block.Properties quartzSlabProperties = Block.Properties.create( Material.ROCK ) - .hardnessAndResistance( 2.0F, 6.0F ); - - this.fluixSlab = deco.block( "fluix_slab", () -> new SlabBlock( quartzSlabProperties ) ) + this.fluixSlab = deco.block( "fluix_slab", () -> new SlabBlock( QUARTZ_PROPERTIES ) ) .addFeatures( AEFeature.FLUIX ) .build(); - this.quartzSlab = deco.block( "quartz_slab", () -> new SlabBlock( quartzSlabProperties ) ) + this.quartzSlab = deco.block( "quartz_slab", () -> new SlabBlock( QUARTZ_PROPERTIES ) ) .addFeatures( AEFeature.CERTUS ) .build(); - this.chiseledQuartzSlab = deco.block( "chiseled_quartz_slab", () -> new SlabBlock( quartzSlabProperties ) ) + this.chiseledQuartzSlab = deco.block( "chiseled_quartz_slab", () -> new SlabBlock( QUARTZ_PROPERTIES ) ) .addFeatures( AEFeature.CERTUS ) .build(); - this.quartzPillarSlab = deco.block( "quartz_pillar_slab", () -> new SlabBlock( quartzSlabProperties ) ) + this.quartzPillarSlab = deco.block( "quartz_pillar_slab", () -> new SlabBlock( QUARTZ_PROPERTIES ) ) .addFeatures( AEFeature.CERTUS ) .build(); @@ -504,23 +512,6 @@ public final class ApiBlocks implements IBlocks return new BlockQuartzOre(Block.Properties.create(Material.ROCK).hardnessAndResistance(3, 5)); } -// private static IBlockDefinition makeStairs( String registryName, FeatureFactory registry, IBlockDefinition block ) -// { -// return registry.block( registryName, () -> new BlockStairCommon( block.maybeBlock().get(), block.identifier() ) ) -// .features( AEFeature.DECORATIVE_BLOCKS ) -// .rendering( new BlockRenderingCustomizer() -// { -// @Override -// @OnlyIn( Dist.CLIENT ) -// public void customize( IBlockRendering rendering, IItemRendering itemRendering ) -// { -// ModelResourceLocation model = new ModelResourceLocation( new ResourceLocation( AppEng.MOD_ID, registryName ), "facing=east,half=bottom,shape=straight" ); -// itemRendering.model( model ); -// } -// } ) -// .build(); -// } - @Override public IBlockDefinition quartzOre() { diff --git a/src/main/java/appeng/decorative/AEBaseStairBlock.java b/src/main/java/appeng/decorative/AEBaseStairBlock.java deleted file mode 100644 index d8710b926..000000000 --- a/src/main/java/appeng/decorative/AEBaseStairBlock.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . - */ - -package appeng.decorative; - - -import com.google.common.base.Preconditions; - -import net.minecraft.block.Block; -import net.minecraft.block.StairsBlock; - - -public abstract class AEBaseStairBlock extends StairsBlock -{ - - protected AEBaseStairBlock( final Block block, final String type ) - { - super( block.getDefaultState() ); - - Preconditions.checkNotNull( block ); - Preconditions.checkNotNull( block.getTranslationKey() ); - Preconditions.checkArgument( block.getTranslationKey().length() > 0 ); - - this.setUnlocalizedName( "stair." + type ); - this.setLightOpacity( 0 ); - } - - @Override - public String toString() - { - String regName = this.getRegistryName() != null ? this.getRegistryName().getResourcePath() : "unregistered"; - return this.getClass().getSimpleName() + "[" + regName + "]"; - } - -} diff --git a/src/main/java/appeng/decorative/stair/BlockStairCommon.java b/src/main/java/appeng/decorative/stair/BlockStairCommon.java deleted file mode 100644 index ed34524d1..000000000 --- a/src/main/java/appeng/decorative/stair/BlockStairCommon.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . - */ - -package appeng.decorative.stair; - - -import net.minecraft.block.Block; - -import appeng.decorative.AEBaseStairBlock; - - -public class BlockStairCommon extends AEBaseStairBlock -{ - public BlockStairCommon( final Block block, final String type ) - { - super( block, type ); - } -} diff --git a/src/main/resources/assets/appliedenergistics2/models/item/chiseled_quartz_stairs.json b/src/main/resources/assets/appliedenergistics2/models/item/chiseled_quartz_stairs.json index bddbfd3a0..ef90892e8 100644 --- a/src/main/resources/assets/appliedenergistics2/models/item/chiseled_quartz_stairs.json +++ b/src/main/resources/assets/appliedenergistics2/models/item/chiseled_quartz_stairs.json @@ -1,3 +1,3 @@ { - "parent": "MISSING" + "parent": "appliedenergistics2:block/stairs/chiseled_quartz" } \ No newline at end of file diff --git a/src/main/resources/assets/appliedenergistics2/models/item/fluix_stairs.json b/src/main/resources/assets/appliedenergistics2/models/item/fluix_stairs.json index bddbfd3a0..d4c6416dd 100644 --- a/src/main/resources/assets/appliedenergistics2/models/item/fluix_stairs.json +++ b/src/main/resources/assets/appliedenergistics2/models/item/fluix_stairs.json @@ -1,3 +1,3 @@ { - "parent": "MISSING" + "parent": "appliedenergistics2:block/stairs/fluix" } \ No newline at end of file diff --git a/src/main/resources/assets/appliedenergistics2/models/item/quartz_pillar_stairs.json b/src/main/resources/assets/appliedenergistics2/models/item/quartz_pillar_stairs.json index bddbfd3a0..b946cf632 100644 --- a/src/main/resources/assets/appliedenergistics2/models/item/quartz_pillar_stairs.json +++ b/src/main/resources/assets/appliedenergistics2/models/item/quartz_pillar_stairs.json @@ -1,3 +1,3 @@ { - "parent": "MISSING" + "parent": "appliedenergistics2:block/stairs/quartz_pillar" } \ No newline at end of file diff --git a/src/main/resources/assets/appliedenergistics2/models/item/quartz_stairs.json b/src/main/resources/assets/appliedenergistics2/models/item/quartz_stairs.json index bddbfd3a0..7078d6cbd 100644 --- a/src/main/resources/assets/appliedenergistics2/models/item/quartz_stairs.json +++ b/src/main/resources/assets/appliedenergistics2/models/item/quartz_stairs.json @@ -1,3 +1,3 @@ { - "parent": "MISSING" + "parent": "appliedenergistics2:block/stairs/quartz" } \ No newline at end of file diff --git a/src/main/resources/assets/appliedenergistics2/models/item/sky_stone_brick_stairs.json b/src/main/resources/assets/appliedenergistics2/models/item/sky_stone_brick_stairs.json index bddbfd3a0..51f641970 100644 --- a/src/main/resources/assets/appliedenergistics2/models/item/sky_stone_brick_stairs.json +++ b/src/main/resources/assets/appliedenergistics2/models/item/sky_stone_brick_stairs.json @@ -1,3 +1,3 @@ { - "parent": "MISSING" + "parent": "appliedenergistics2:block/stairs/sky_stone_brick" } \ No newline at end of file diff --git a/src/main/resources/assets/appliedenergistics2/models/item/sky_stone_small_brick_stairs.json b/src/main/resources/assets/appliedenergistics2/models/item/sky_stone_small_brick_stairs.json index bddbfd3a0..e8b45e5dc 100644 --- a/src/main/resources/assets/appliedenergistics2/models/item/sky_stone_small_brick_stairs.json +++ b/src/main/resources/assets/appliedenergistics2/models/item/sky_stone_small_brick_stairs.json @@ -1,3 +1,3 @@ { - "parent": "MISSING" + "parent": "appliedenergistics2:block/stairs/sky_stone_small_brick" } \ No newline at end of file diff --git a/src/main/resources/assets/appliedenergistics2/models/item/sky_stone_stairs.json b/src/main/resources/assets/appliedenergistics2/models/item/sky_stone_stairs.json index bddbfd3a0..b06ece7f8 100644 --- a/src/main/resources/assets/appliedenergistics2/models/item/sky_stone_stairs.json +++ b/src/main/resources/assets/appliedenergistics2/models/item/sky_stone_stairs.json @@ -1,3 +1,3 @@ { - "parent": "MISSING" + "parent": "appliedenergistics2:block/stairs/sky_stone" } \ No newline at end of file diff --git a/src/main/resources/assets/appliedenergistics2/models/item/smooth_sky_stone_stairs.json b/src/main/resources/assets/appliedenergistics2/models/item/smooth_sky_stone_stairs.json index bddbfd3a0..843cfabd1 100644 --- a/src/main/resources/assets/appliedenergistics2/models/item/smooth_sky_stone_stairs.json +++ b/src/main/resources/assets/appliedenergistics2/models/item/smooth_sky_stone_stairs.json @@ -1,3 +1,3 @@ { - "parent": "MISSING" + "parent": "appliedenergistics2:block/stairs/smooth_sky_stone" } \ No newline at end of file