Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package yesodmod.general.block;
- import java.io.IOException;
- import yesodmod.general.Generic;
- import net.minecraft.block.material.Material;
- import net.minecraft.client.renderer.texture.IIconRegister;
- import net.minecraft.creativetab.CreativeTabs;
- import net.minecraft.util.IIcon;
- import net.minecraft.world.IBlockAccess;
- import net.minecraft.world.World;
- import net.minecraftforge.fluids.BlockFluidClassic;
- import net.minecraftforge.fluids.Fluid;
- import cpw.mods.fml.common.Mod.EventHandler;
- import cpw.mods.fml.common.event.FMLPreInitializationEvent;
- import cpw.mods.fml.relauncher.Side;
- import cpw.mods.fml.relauncher.SideOnly;
- public class LiquidGlowstoneBlock extends BlockFluidClassic
- {
- @SideOnly(Side.CLIENT)
- public static IIcon blockIcon;
- @SideOnly(Side.CLIENT)
- public static IIcon flowingIcon;
- @SideOnly(Side.CLIENT)
- public static IIcon stillIcon;
- public LiquidGlowstoneBlock(Fluid fluid, Material material)
- {
- super(fluid, material);
- setCreativeTab(CreativeTabs.tabMisc);
- }
- @EventHandler // used in 1.6.2
- public void preInit(FMLPreInitializationEvent event) throws IOException{
- Generic.liquidGlowstone.setIcons(blockIcon).setBlock(Generic.LiquidGlowstoneBlock);
- }
- @Override
- public IIcon getIcon(int side, int meta) {
- return (side == 0 || side == 1)? stillIcon : flowingIcon;
- }
- @SideOnly(Side.CLIENT)
- @Override
- public void registerBlockIcons(IIconRegister iconRegister) {
- this.blockIcon = iconRegister.registerIcon("yesodmod:liquidglowstone");
- this.stillIcon = iconRegister.registerIcon("yesodmod:liquidglowstonestill");
- this.flowingIcon = iconRegister.registerIcon("yesodmod:liquidglowstoneflow");
- }
- @Override
- public boolean canDisplace(IBlockAccess world, int x, int y, int z) {
- if (world.getBlock(x, y, z).getMaterial().isLiquid()) return true;
- return super.canDisplace(world, x, y, z);
- }
- @Override
- public boolean displaceIfPossible(World world, int x, int y, int z) {
- if (world.getBlock(x, y, z).getMaterial().isLiquid()) return true;
- return super.displaceIfPossible(world, x, y, z);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment