mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-13 16:54:06 +00:00
60 lines
2.0 KiB
Java
60 lines
2.0 KiB
Java
/**
|
|||
|
|
* This class was created by <Vazkii>. It's distributed as
|
||
|
|
* part of the Botania Mod. Get the Source Code in github:
|
||
|
|
* https://github.com/Vazkii/Botania
|
||
|
|
*
|
||
|
|
* Botania is Open Source and distributed under a
|
||
|
|
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||
|
|
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||
|
|
*
|
||
|
|
* File Created @ [Nov 14, 2014, 4:43:14 PM (GMT)]
|
||
|
|
*/
|
||
|
|
package vazkii.botania.common.block.string;
|
||
|
|
|
||
|
|
import net.minecraft.block.BlockPistonBase;
|
||
|
|
import net.minecraft.block.material.Material;
|
||
|
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||
|
|
import net.minecraft.entity.EntityLivingBase;
|
||
|
|
import net.minecraft.item.ItemStack;
|
||
|
|
import net.minecraft.util.IIcon;
|
||
|
|
import net.minecraft.world.World;
|
||
|
|
import vazkii.botania.client.core.helper.IconHelper;
|
||
|
|
import vazkii.botania.common.block.BlockModContainer;
|
||
|
|
import vazkii.botania.common.block.tile.mana.TileSpreader;
|
||
|
|
import vazkii.botania.common.block.tile.string.TileRedString;
|
||
|
|
|
||
|
|
public abstract class BlockRedString extends BlockModContainer<TileRedString> {
|
||
|
|
|
||
|
|
IIcon senderIcon;
|
||
|
|
IIcon sideIcon;
|
||
|
|
|
||
|
|
public BlockRedString(String name) {
|
||
|
|
super(Material.rock);
|
||
|
|
setHardness(2.0F);
|
||
|
|
setResistance(10.0F);
|
||
|
|
setStepSound(soundTypeStone);
|
||
|
|
setBlockName(name);
|
||
|
|
}
|
||
|
|
|
||
|
|
@Override
|
||
|
|
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) {
|
||
|
|
int orientation = BlockPistonBase.determineOrientation(par1World, par2, par3, par4, par5EntityLivingBase);
|
||
|
|
par1World.setBlockMetadataWithNotify(par2, par3, par4, orientation, 1 | 2);
|
||
|
|
}
|
||
|
|
|
||
|
|
@Override
|
||
|
|
public void registerBlockIcons(IIconRegister par1IconRegister) {
|
||
|
|
senderIcon = IconHelper.forName(par1IconRegister, "redStringSender");
|
||
|
|
sideIcon = registerSideIcon(par1IconRegister);
|
||
|
|
}
|
||
|
|
|
||
|
|
public IIcon registerSideIcon(IIconRegister register) {
|
||
|
|
return IconHelper.forBlock(register, this);
|
||
|
|
}
|
||
|
|
|
||
|
|
@Override
|
||
|
|
public IIcon getIcon(int side, int meta) {
|
||
|
|
return side == meta ? senderIcon : sideIcon;
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|