add slabs
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
package appeng.core.api.definitions;
|
||||
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.Set;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
@@ -27,6 +28,7 @@ import appeng.api.definitions.IBlockDefinition;
|
||||
import appeng.api.definitions.IBlocks;
|
||||
import appeng.api.definitions.ITileDefinition;
|
||||
import appeng.api.util.IOrientableBlock;
|
||||
import appeng.block.AEBaseSlabBlock;
|
||||
import appeng.block.crafting.BlockCraftingMonitor;
|
||||
import appeng.block.crafting.BlockCraftingStorage;
|
||||
import appeng.block.crafting.BlockCraftingUnit;
|
||||
@@ -79,6 +81,7 @@ import appeng.block.storage.BlockChest;
|
||||
import appeng.block.storage.BlockDrive;
|
||||
import appeng.block.storage.BlockIOPort;
|
||||
import appeng.block.storage.BlockSkyChest;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.core.features.WrappedDamageItemDefinition;
|
||||
import appeng.debug.BlockChunkloader;
|
||||
import appeng.debug.BlockCubeGenerator;
|
||||
@@ -147,6 +150,14 @@ public final class ApiBlocks implements IBlocks
|
||||
private final IBlockDefinition quartzStair;
|
||||
private final IBlockDefinition chiseledQuartzStair;
|
||||
private final IBlockDefinition quartzPillarStair;
|
||||
private final IBlockDefinition skyStoneSlab;
|
||||
private final IBlockDefinition skyStoneBlockSlab;
|
||||
private final IBlockDefinition skyStoneBrickSlab;
|
||||
private final IBlockDefinition skyStoneSmallBrickSlab;
|
||||
private final IBlockDefinition fluixSlab;
|
||||
private final IBlockDefinition quartzSlab;
|
||||
private final IBlockDefinition chiseledQuartzSlab;
|
||||
private final IBlockDefinition quartzPillarSlab;
|
||||
|
||||
private final IBlockDefinition itemGen;
|
||||
private final IBlockDefinition chunkLoader;
|
||||
@@ -230,6 +241,15 @@ public final class ApiBlocks implements IBlocks
|
||||
|
||||
this.quartzPillarStair = constructor.registerBlockDefinition( new QuartzPillarStairBlock( quartzPillar ) );
|
||||
|
||||
this.skyStoneSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( skyStone, 0, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "SkyStoneSlabBlock" ) );
|
||||
this.skyStoneBlockSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( skyStone, 1, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "SkyStoneBlockSlabBlock" ) );
|
||||
this.skyStoneBrickSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( skyStone, 2, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "SkyStoneBrickSlabBlock" ) );
|
||||
this.skyStoneSmallBrickSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( skyStone, 3, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "SkyStoneSmallBrickSlabBlock" ) );
|
||||
this.fluixSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( fluixBlock, 0, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "FluixSlabBlock" ) );
|
||||
this.quartzSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( quartzBlock, 0, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "QuartzSlabBlock" ) );
|
||||
this.chiseledQuartzSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( chiseledQuartz, 0, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "ChiseledQuartzSlabBlock" ) );;
|
||||
this.quartzPillarSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( quartzPillar, 0, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "QuartzPillarSlabBlock" ) );
|
||||
|
||||
this.itemGen = constructor.registerBlockDefinition( new BlockItemGen() );
|
||||
this.chunkLoader = constructor.registerBlockDefinition( new BlockChunkloader() );
|
||||
this.phantomNode = constructor.registerBlockDefinition( new BlockPhantomNode() );
|
||||
@@ -362,6 +382,54 @@ public final class ApiBlocks implements IBlocks
|
||||
return this.quartzPillarStair;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockDefinition skyStoneSlab()
|
||||
{
|
||||
return this.skyStoneSlab;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockDefinition skyStoneBlockSlab()
|
||||
{
|
||||
return this.skyStoneBlockSlab;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockDefinition skyStoneBrickSlab()
|
||||
{
|
||||
return this.skyStoneBrickSlab;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockDefinition skyStoneSmallBrickSlab()
|
||||
{
|
||||
return this.skyStoneSmallBrickSlab;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockDefinition fluixSlab()
|
||||
{
|
||||
return this.fluixSlab;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockDefinition quartzSlab()
|
||||
{
|
||||
return this.quartzSlab;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockDefinition chiseledQuartzSlab()
|
||||
{
|
||||
return this.chiseledQuartzSlab;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockDefinition quartzPillarSlab()
|
||||
{
|
||||
return this.quartzPillarSlab;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ITileDefinition grindStone()
|
||||
{
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* 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.core.features;
|
||||
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockSlab;
|
||||
import appeng.api.definitions.IBlockDefinition;
|
||||
import appeng.block.AEBaseItemBlockSlab;
|
||||
import appeng.block.AEBaseSlabBlock;
|
||||
import appeng.core.CreativeTab;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
|
||||
public class SlabBlockFeatureHandler implements IFeatureHandler
|
||||
{
|
||||
private final AEBaseSlabBlock slabs;
|
||||
private final FeatureNameExtractor extractor;
|
||||
private final boolean enabled;
|
||||
private final BlockDefinition definition;
|
||||
|
||||
public SlabBlockFeatureHandler( EnumSet<AEFeature> features, AEBaseSlabBlock slabs )
|
||||
{
|
||||
final ActivityState state = new FeaturedActiveChecker( features ).getActivityState();
|
||||
this.slabs = slabs;
|
||||
this.extractor = new FeatureNameExtractor( slabs.getClass(), Optional.<String>absent());
|
||||
this.enabled = state == ActivityState.Enabled;
|
||||
this.definition = new BlockDefinition( slabs, state );
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean isFeatureAvailable()
|
||||
{
|
||||
return this.enabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final IBlockDefinition getDefinition()
|
||||
{
|
||||
return this.definition;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void register()
|
||||
{
|
||||
if( this.enabled )
|
||||
{
|
||||
this.slabs.setCreativeTab( CreativeTab.instance );
|
||||
GameRegistry.registerBlock( slabs, AEBaseItemBlockSlab.class, "tile." + slabs.name(), slabs, slabs.doubleSlabs(), false);
|
||||
GameRegistry.registerBlock( slabs.doubleSlabs(), AEBaseItemBlockSlab.class, "tile." + slabs.name() + ".double", slabs, slabs.doubleSlabs(), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user