Sky Stone Smooth :3
This commit is contained in:
parent
f1da7b1970
commit
768470512b
3 changed files with 59 additions and 3 deletions
|
@ -680,6 +680,11 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
|||
return true;
|
||||
}
|
||||
|
||||
public String getUnlocalizedName(ItemStack is)
|
||||
{
|
||||
return getUnlocalizedName();
|
||||
}
|
||||
|
||||
public void addInformation(ItemStack is, EntityPlayer player, List<?> lines, boolean advancedItemTooltips)
|
||||
{
|
||||
|
||||
|
|
|
@ -30,6 +30,12 @@ public class AEBaseItemBlock extends ItemBlock
|
|||
MinecraftForgeClient.registerItemRenderer( this, ItemRenderer.instance );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack is)
|
||||
{
|
||||
return blockType.getUnlocalizedName(is);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack is, EntityPlayer player, List lines, boolean advancedItemTooltips)
|
||||
{
|
||||
|
|
|
@ -1,8 +1,17 @@
|
|||
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.world.IBlockAccess;
|
||||
import appeng.api.util.IOrientable;
|
||||
import appeng.api.util.IOrientableBlock;
|
||||
|
@ -13,17 +22,53 @@ import appeng.helpers.LocationRotation;
|
|||
public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
|
||||
{
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
IIcon Smooth;
|
||||
|
||||
public BlockSkyStone() {
|
||||
super( BlockSkyStone.class, Material.rock );
|
||||
setfeature( EnumSet.of( AEFeature.Core ) );
|
||||
setHardness( 50 );
|
||||
blockResistance = 150.0f;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack is) {
|
||||
|
||||
if ( is.getItemDamage() == 1 )
|
||||
return getUnlocalizedName()+".smooth";
|
||||
|
||||
return getUnlocalizedName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IOrientable getOrientable(final IBlockAccess w, final int x, final int y, final int z)
|
||||
{
|
||||
return new LocationRotation( w, x, y, z );
|
||||
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");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int direction, int metadata) {
|
||||
if ( metadata == 1 )
|
||||
return Smooth;
|
||||
return super.getIcon(direction, metadata);
|
||||
}
|
||||
|
||||
@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 ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue