Re-implement stairs.
This commit is contained in:
@@ -33,10 +33,7 @@ import appeng.core.features.registries.PartModels;
|
|||||||
import appeng.decorative.AEDecorativeBlock;
|
import appeng.decorative.AEDecorativeBlock;
|
||||||
import appeng.decorative.solid.*;
|
import appeng.decorative.solid.*;
|
||||||
import appeng.tile.storage.TileSkyChest;
|
import appeng.tile.storage.TileSkyChest;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.*;
|
||||||
import net.minecraft.block.Blocks;
|
|
||||||
import net.minecraft.block.SlabBlock;
|
|
||||||
import net.minecraft.block.SoundType;
|
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.client.renderer.RenderType;
|
import net.minecraft.client.renderer.RenderType;
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
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)
|
private static final Block.Properties QUARTZ_PROPERTIES = Block.Properties.create(Material.ROCK)
|
||||||
.hardnessAndResistance(3, 5);
|
.hardnessAndResistance(3, 5);
|
||||||
|
|
||||||
|
private static final Block.Properties SKYSTONE_PROPERTIES = Block.Properties.create( Material.ROCK )
|
||||||
|
.hardnessAndResistance( 50, 150 );
|
||||||
|
|
||||||
public ApiBlocks( FeatureFactory registry, PartModels partModels )
|
public ApiBlocks( FeatureFactory registry, PartModels partModels )
|
||||||
{
|
{
|
||||||
this.quartzOre = registry.block( "quartz_ore", () -> new BlockQuartzOre(QUARTZ_PROPERTIES))
|
this.quartzOre = registry.block( "quartz_ore", () -> new BlockQuartzOre(QUARTZ_PROPERTIES))
|
||||||
@@ -189,15 +189,12 @@ public final class ApiBlocks implements IBlocks
|
|||||||
.build();
|
.build();
|
||||||
|
|
||||||
this.smoothSkyStoneBlock = registry.features( AEFeature.SKY_STONE )
|
this.smoothSkyStoneBlock = registry.features( AEFeature.SKY_STONE )
|
||||||
.block( "smooth_sky_stone_block", () -> new BlockSkyStone( SkystoneType.BLOCK, Block.Properties.create(Material.ROCK)
|
.block( "smooth_sky_stone_block", () -> new BlockSkyStone( SkystoneType.BLOCK, SKYSTONE_PROPERTIES ) )
|
||||||
.hardnessAndResistance(50, 150) ) )
|
|
||||||
.build();
|
.build();
|
||||||
this.skyStoneBrick = deco.block( "sky_stone_brick", () -> new BlockSkyStone( SkystoneType.BRICK, Block.Properties.create(Material.ROCK)
|
this.skyStoneBrick = deco.block( "sky_stone_brick", () -> new BlockSkyStone( SkystoneType.BRICK, SKYSTONE_PROPERTIES ) )
|
||||||
.hardnessAndResistance(50, 150) ) )
|
|
||||||
.addFeatures( AEFeature.SKY_STONE )
|
.addFeatures( AEFeature.SKY_STONE )
|
||||||
.build();
|
.build();
|
||||||
this.skyStoneSmallBrick = deco.block( "sky_stone_small_brick", () -> new BlockSkyStone( SkystoneType.SMALL_BRICK, Block.Properties.create(Material.ROCK)
|
this.skyStoneSmallBrick = deco.block( "sky_stone_small_brick", () -> new BlockSkyStone( SkystoneType.SMALL_BRICK, SKYSTONE_PROPERTIES ) )
|
||||||
.hardnessAndResistance(50, 150) ) )
|
|
||||||
.addFeatures( AEFeature.SKY_STONE )
|
.addFeatures( AEFeature.SKY_STONE )
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
@@ -424,14 +421,31 @@ public final class ApiBlocks implements IBlocks
|
|||||||
// .rendering( new PaintRendering() )
|
// .rendering( new PaintRendering() )
|
||||||
// .build();
|
// .build();
|
||||||
//
|
//
|
||||||
// this.skyStoneStairs = makeStairs( "sky_stone_stairs", registry, this.skyStoneBlock() );
|
this.skyStoneStairs = deco.block( "sky_stone_stairs", () -> new StairsBlock(this.skyStoneBlock().block()::getDefaultState, SKYSTONE_PROPERTIES ) )
|
||||||
// this.smoothSkyStoneStairs = makeStairs( "smooth_sky_stone_stairs", registry, this.smoothSkyStoneBlock() );
|
.addFeatures( AEFeature.SKY_STONE )
|
||||||
// this.skyStoneBrickStairs = makeStairs( "sky_stone_brick_stairs", registry, this.skyStoneBrick() );
|
.build();
|
||||||
// this.skyStoneSmallBrickStairs = makeStairs( "sky_stone_small_brick_stairs", registry, this.skyStoneSmallBrick() );
|
this.smoothSkyStoneStairs = deco.block( "smooth_sky_stone_stairs", () -> new StairsBlock(this.smoothSkyStoneBlock().block()::getDefaultState, SKYSTONE_PROPERTIES ) )
|
||||||
// this.fluixStairs = makeStairs( "fluix_stairs", registry, this.fluixBlock() );
|
.addFeatures( AEFeature.SKY_STONE )
|
||||||
// this.quartzStairs = makeStairs( "quartz_stairs", registry, this.quartzBlock() );
|
.build();
|
||||||
// this.chiseledQuartzStairs = makeStairs( "chiseled_quartz_stairs", registry, this.chiseledQuartzBlock() );
|
this.skyStoneBrickStairs = deco.block( "sky_stone_brick_stairs", () -> new StairsBlock(this.skyStoneBrick().block()::getDefaultState, SKYSTONE_PROPERTIES) )
|
||||||
// this.quartzPillarStairs = makeStairs( "quartz_pillar_stairs", registry, this.quartzPillar() );
|
.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 )
|
// this.multiPart = registry.block( "cable_bus", BlockCableBus::new )
|
||||||
// .rendering( new CableBusRendering( partModels ) )
|
// .rendering( new CableBusRendering( partModels ) )
|
||||||
@@ -441,35 +455,29 @@ public final class ApiBlocks implements IBlocks
|
|||||||
// .bootstrap( ( block, item ) -> (IPostInitComponent) side -> ( (BlockCableBus) block ).setupTile() )
|
// .bootstrap( ( block, item ) -> (IPostInitComponent) side -> ( (BlockCableBus) block ).setupTile() )
|
||||||
// .build();
|
// .build();
|
||||||
|
|
||||||
Block.Properties skystoneSlabProperties = Block.Properties.create( Material.ROCK )
|
this.skyStoneSlab = deco.block( "sky_stone_slab", () -> new SlabBlock( SKYSTONE_PROPERTIES ) )
|
||||||
.hardnessAndResistance( 50, 150 );
|
|
||||||
|
|
||||||
this.skyStoneSlab = deco.block( "sky_stone_slab", () -> new SlabBlock( skystoneSlabProperties ) )
|
|
||||||
.addFeatures( AEFeature.SKY_STONE )
|
.addFeatures( AEFeature.SKY_STONE )
|
||||||
.build();
|
.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 )
|
.addFeatures( AEFeature.SKY_STONE )
|
||||||
.build();
|
.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 )
|
.addFeatures( AEFeature.SKY_STONE )
|
||||||
.build();
|
.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 )
|
.addFeatures( AEFeature.SKY_STONE )
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
Block.Properties quartzSlabProperties = Block.Properties.create( Material.ROCK )
|
this.fluixSlab = deco.block( "fluix_slab", () -> new SlabBlock( QUARTZ_PROPERTIES ) )
|
||||||
.hardnessAndResistance( 2.0F, 6.0F );
|
|
||||||
|
|
||||||
this.fluixSlab = deco.block( "fluix_slab", () -> new SlabBlock( quartzSlabProperties ) )
|
|
||||||
.addFeatures( AEFeature.FLUIX )
|
.addFeatures( AEFeature.FLUIX )
|
||||||
.build();
|
.build();
|
||||||
this.quartzSlab = deco.block( "quartz_slab", () -> new SlabBlock( quartzSlabProperties ) )
|
this.quartzSlab = deco.block( "quartz_slab", () -> new SlabBlock( QUARTZ_PROPERTIES ) )
|
||||||
.addFeatures( AEFeature.CERTUS )
|
.addFeatures( AEFeature.CERTUS )
|
||||||
.build();
|
.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 )
|
.addFeatures( AEFeature.CERTUS )
|
||||||
.build();
|
.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 )
|
.addFeatures( AEFeature.CERTUS )
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
@@ -504,23 +512,6 @@ public final class ApiBlocks implements IBlocks
|
|||||||
return new BlockQuartzOre(Block.Properties.create(Material.ROCK).hardnessAndResistance(3, 5));
|
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
|
@Override
|
||||||
public IBlockDefinition quartzOre()
|
public IBlockDefinition quartzOre()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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 <http://www.gnu.org/licenses/lgpl>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
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 + "]";
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -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 <http://www.gnu.org/licenses/lgpl>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
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 );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
"parent": "MISSING"
|
"parent": "appliedenergistics2:block/stairs/chiseled_quartz"
|
||||||
}
|
}
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
"parent": "MISSING"
|
"parent": "appliedenergistics2:block/stairs/fluix"
|
||||||
}
|
}
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
"parent": "MISSING"
|
"parent": "appliedenergistics2:block/stairs/quartz_pillar"
|
||||||
}
|
}
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
"parent": "MISSING"
|
"parent": "appliedenergistics2:block/stairs/quartz"
|
||||||
}
|
}
|
||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
"parent": "MISSING"
|
"parent": "appliedenergistics2:block/stairs/sky_stone_brick"
|
||||||
}
|
}
|
||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
"parent": "MISSING"
|
"parent": "appliedenergistics2:block/stairs/sky_stone_small_brick"
|
||||||
}
|
}
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
"parent": "MISSING"
|
"parent": "appliedenergistics2:block/stairs/sky_stone"
|
||||||
}
|
}
|
||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
"parent": "MISSING"
|
"parent": "appliedenergistics2:block/stairs/smooth_sky_stone"
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user