Created
January 23, 2019 19:56
-
-
Save Zamion101/939e5656d7a27e38871f12d785f07761 to your computer and use it in GitHub Desktop.
My BlockBase
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package me.Zamion101.HMM.blocks.impl; | |
import me.Zamion101.HMM.HMM; | |
import me.Zamion101.HMM.hud.CreativeTabs; | |
import me.Zamion101.HMM.utils.Dyes; | |
import net.minecraft.block.Block; | |
import net.minecraft.block.material.MapColor; | |
import net.minecraft.block.material.Material; | |
import net.minecraft.block.state.IBlockState; | |
import net.minecraft.util.math.BlockPos; | |
import net.minecraft.world.IBlockAccess; | |
import javax.annotation.Nullable; | |
public class HBlock extends Block implements IHBlock<HBlock> { | |
private Dyes[] colorPalette; | |
private String name; | |
private boolean isColored = false; | |
public HBlock(Material materialIn, String name, CreativeTabs tabs, MapColor mapColor) { | |
super(materialIn,mapColor); | |
this.colorPalette = new Dyes[0]; | |
setUnlocalizedName(name); | |
setRegistryName(name); | |
setCreativeTab((tabs == null) ? HMM.TABS[0] : tabs.getTab()); | |
this.name = name; | |
} | |
public HBlock(Material materialIn, String name, MapColor mapColor) { | |
this(materialIn,name,null,mapColor); | |
} | |
@Override | |
public String getName() { | |
return this.name; | |
} | |
@Override | |
public boolean isColored() { | |
return this.isColored; | |
} | |
@Override | |
public Dyes[] getColorPalette() { | |
return this.colorPalette; | |
} | |
@Override | |
public HBlock setColorPalette(Dyes[] colorPalette) { | |
this.colorPalette = colorPalette; | |
return this; | |
} | |
@Override | |
public HBlock addColor(Dyes color) { | |
this.colorPalette = Dyes.addColor(color,getColorPalette()); | |
return this; | |
} | |
@Override | |
public int colorMultiplier(IBlockState state, @Nullable IBlockAccess worldIn, @Nullable BlockPos pos, int tintIndex) { | |
return -1; | |
} | |
@Override | |
public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos) { | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment