Add Sky stone, Block, Brick, Small Brick, and Sky Stone Block Chest.
Add All Sky Stone Crafting Recipes.
This commit is contained in:
+17
-5
@@ -57,6 +57,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
||||
private Class<? extends TileEntity> tileEntityType = null;
|
||||
protected boolean isOpaque = true;
|
||||
protected boolean isFullSize = true;
|
||||
protected boolean hasSubtypes = false;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon renderIcon;
|
||||
@@ -155,7 +156,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
||||
@Override
|
||||
public IIcon getIcon(IBlockAccess w, int x, int y, int z, int s)
|
||||
{
|
||||
return getIcon( mapRotation( w, x, y, z, s ), 0 );
|
||||
return getIcon( mapRotation( w, x, y, z, s ), w.getBlockMetadata( x, y, z ) );
|
||||
}
|
||||
|
||||
protected void setTileEntiy(Class<? extends TileEntity> c)
|
||||
@@ -235,6 +236,12 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
||||
return tileEntityType;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void setRenderStateByMeta(int itemDamage)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public BlockRenderInfo getRendererInstance()
|
||||
{
|
||||
@@ -680,10 +687,10 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
||||
return true;
|
||||
}
|
||||
|
||||
public String getUnlocalizedName(ItemStack is)
|
||||
{
|
||||
return getUnlocalizedName();
|
||||
}
|
||||
public String getUnlocalizedName(ItemStack is)
|
||||
{
|
||||
return getUnlocalizedName();
|
||||
}
|
||||
|
||||
public void addInformation(ItemStack is, EntityPlayer player, List<?> lines, boolean advancedItemTooltips)
|
||||
{
|
||||
@@ -701,4 +708,9 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
||||
// override!
|
||||
}
|
||||
|
||||
public boolean hasSubtypes()
|
||||
{
|
||||
return hasSubtypes;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -26,15 +26,25 @@ public class AEBaseItemBlock extends ItemBlock
|
||||
public AEBaseItemBlock(Block id) {
|
||||
super( id );
|
||||
blockType = (AEBaseBlock) id;
|
||||
hasSubtypes = blockType.hasSubtypes;
|
||||
|
||||
if ( Platform.isClient() )
|
||||
MinecraftForgeClient.registerItemRenderer( this, ItemRenderer.instance );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack is)
|
||||
{
|
||||
return blockType.getUnlocalizedName(is);
|
||||
}
|
||||
public int getMetadata(int dmg)
|
||||
{
|
||||
if ( hasSubtypes )
|
||||
return dmg;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack is)
|
||||
{
|
||||
return blockType.getUnlocalizedName( is );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack is, EntityPlayer player, List lines, boolean advancedItemTooltips)
|
||||
|
||||
@@ -3,72 +3,111 @@ package appeng.block.solids;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import appeng.api.util.IOrientable;
|
||||
import appeng.api.util.IOrientableBlock;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.helpers.LocationRotation;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
|
||||
{
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
IIcon Smooth;
|
||||
|
||||
IIcon Block;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
IIcon Brick;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
IIcon SmallBrick;
|
||||
|
||||
public BlockSkyStone() {
|
||||
super( BlockSkyStone.class, Material.rock );
|
||||
setfeature( EnumSet.of( AEFeature.Core ) );
|
||||
setHardness( 50 );
|
||||
hasSubtypes = true;
|
||||
blockResistance = 150.0f;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack is) {
|
||||
|
||||
public String getUnlocalizedName(ItemStack is)
|
||||
{
|
||||
if ( is.getItemDamage() == 1 )
|
||||
return getUnlocalizedName()+".smooth";
|
||||
|
||||
return getUnlocalizedName() + ".Block";
|
||||
|
||||
if ( is.getItemDamage() == 2 )
|
||||
return getUnlocalizedName() + ".Brick";
|
||||
|
||||
if ( is.getItemDamage() == 3 )
|
||||
return getUnlocalizedName() + ".SmallBrick";
|
||||
|
||||
return getUnlocalizedName();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IOrientable getOrientable(final IBlockAccess w, final int x, final int y, final int z)
|
||||
{
|
||||
if ( w.getBlockMetadata(x, y, z) == 0 )
|
||||
if ( w.getBlockMetadata( x, y, z ) == 0 )
|
||||
return new LocationRotation( w, x, y, z );
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister ir) {
|
||||
super.registerBlockIcons(ir);
|
||||
Smooth = ir.registerIcon(getTextureName()+".Smooth");
|
||||
public void registerBlockIcons(IIconRegister ir)
|
||||
{
|
||||
super.registerBlockIcons( ir );
|
||||
Block = ir.registerIcon( getTextureName() + ".Block" );
|
||||
Brick = ir.registerIcon( getTextureName() + ".Brick" );
|
||||
SmallBrick = ir.registerIcon( getTextureName() + ".SmallBrick" );
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int direction, int metadata) {
|
||||
public IIcon getIcon(int direction, int metadata)
|
||||
{
|
||||
if ( metadata == 1 )
|
||||
return Smooth;
|
||||
return super.getIcon(direction, metadata);
|
||||
return Block;
|
||||
if ( metadata == 2 )
|
||||
return Brick;
|
||||
if ( metadata == 3 )
|
||||
return SmallBrick;
|
||||
return super.getIcon( direction, metadata );
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setRenderStateByMeta(int metadata)
|
||||
{
|
||||
getRendererInstance().setTemporaryRenderIcon( getIcon( 0, metadata ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
|
||||
{
|
||||
ItemStack is = super.getPickBlock( target, world, x, y, z );
|
||||
is.setItemDamage( world.getBlockMetadata( x, y, z ) );
|
||||
return is;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item i, CreativeTabs ct, List l) {
|
||||
super.getSubBlocks(i, ct, l);
|
||||
public void getSubBlocks(Item i, CreativeTabs ct, List l)
|
||||
{
|
||||
super.getSubBlocks( i, ct, l );
|
||||
l.add( new ItemStack( i, 1, 1 ) );
|
||||
l.add( new ItemStack( i, 1, 2 ) );
|
||||
l.add( new ItemStack( i, 1, 3 ) );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -6,10 +6,14 @@ import java.util.List;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.api.AEApi;
|
||||
@@ -21,6 +25,8 @@ import appeng.core.sync.GuiBridge;
|
||||
import appeng.helpers.ICustomCollision;
|
||||
import appeng.tile.storage.TileSkyChest;
|
||||
import appeng.util.Platform;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockSkyChest extends AEBaseBlock implements ICustomCollision
|
||||
{
|
||||
@@ -31,10 +37,45 @@ public class BlockSkyChest extends AEBaseBlock implements ICustomCollision
|
||||
setTileEntiy( TileSkyChest.class );
|
||||
isOpaque = isFullSize = false;
|
||||
lightOpacity = 0;
|
||||
hasSubtypes = true;
|
||||
setHardness( 50 );
|
||||
blockResistance = 150.0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack is)
|
||||
{
|
||||
if ( is.getItemDamage() == 1 )
|
||||
return getUnlocalizedName() + ".Block";
|
||||
|
||||
return getUnlocalizedName();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int direction, int metadata)
|
||||
{
|
||||
if ( metadata == 1 )
|
||||
return AEApi.instance().blocks().blockSkyStone.block().getIcon( direction, 1 );
|
||||
return AEApi.instance().blocks().blockSkyStone.block().getIcon( direction, metadata );
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
|
||||
{
|
||||
ItemStack is = super.getPickBlock( target, world, x, y, z );
|
||||
is.setItemDamage( world.getBlockMetadata( x, y, z ) );
|
||||
return is;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item i, CreativeTabs ct, List l)
|
||||
{
|
||||
super.getSubBlocks( i, ct, l );
|
||||
l.add( new ItemStack( i, 1, 1 ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onActivated(World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
@@ -62,12 +103,6 @@ public class BlockSkyChest extends AEBaseBlock implements ICustomCollision
|
||||
out.add( AxisAlignedBB.getAABBPool().getAABB( 0.05, 0.05, 0.05, 0.95, 0.95, 0.95 ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int direction, int metadata)
|
||||
{
|
||||
return AEApi.instance().blocks().blockSkyStone.block().getIcon( direction, metadata );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister iconRegistry)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user