mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
now you're thinking with OOP
This commit is contained in:
parent
0aeeda9113
commit
395acea899
@ -2811,8 +2811,8 @@ public class ModBlocks {
|
|||||||
GameRegistry.registerBlock(deco_pipe_quad_green_rusted, ItemBlockBase.class, deco_pipe_quad_green_rusted.getUnlocalizedName());
|
GameRegistry.registerBlock(deco_pipe_quad_green_rusted, ItemBlockBase.class, deco_pipe_quad_green_rusted.getUnlocalizedName());
|
||||||
GameRegistry.registerBlock(deco_pipe_quad_red, ItemBlockBase.class, deco_pipe_quad_red.getUnlocalizedName());
|
GameRegistry.registerBlock(deco_pipe_quad_red, ItemBlockBase.class, deco_pipe_quad_red.getUnlocalizedName());
|
||||||
GameRegistry.registerBlock(deco_pipe_quad_marked, ItemBlockBase.class, deco_pipe_quad_marked.getUnlocalizedName());
|
GameRegistry.registerBlock(deco_pipe_quad_marked, ItemBlockBase.class, deco_pipe_quad_marked.getUnlocalizedName());
|
||||||
GameRegistry.registerBlock(plant_flower, ItemBlockBaseColored.class, plant_flower.getUnlocalizedName());
|
register(plant_flower);
|
||||||
GameRegistry.registerBlock(plant_tall, ItemBlockBaseColored.class, plant_tall.getUnlocalizedName());
|
register(plant_tall);
|
||||||
register(plant_dead);
|
register(plant_dead);
|
||||||
register(reeds);
|
register(reeds);
|
||||||
register(vine_phosphor);
|
register(vine_phosphor);
|
||||||
|
|||||||
@ -20,9 +20,12 @@ import net.minecraft.util.IIcon;
|
|||||||
import net.minecraft.util.StatCollector;
|
import net.minecraft.util.StatCollector;
|
||||||
|
|
||||||
public class ItemBlockBase extends ItemBlock {
|
public class ItemBlockBase extends ItemBlock {
|
||||||
|
|
||||||
|
private Block block;
|
||||||
|
|
||||||
public ItemBlockBase(Block block) {
|
public ItemBlockBase(Block block) {
|
||||||
super(block);
|
super(block);
|
||||||
|
this.block = block;
|
||||||
|
|
||||||
if(block instanceof IBlockMulti) {
|
if(block instanceof IBlockMulti) {
|
||||||
this.setMaxDamage(0);
|
this.setMaxDamage(0);
|
||||||
@ -88,4 +91,10 @@ public class ItemBlockBase extends ItemBlock {
|
|||||||
|
|
||||||
return EnumRarity.common;
|
return EnumRarity.common;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public int getColorFromItemStack(ItemStack stack, int pass)
|
||||||
|
{
|
||||||
|
return this.block.getRenderColor(stack.getItemDamage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,23 +0,0 @@
|
|||||||
package com.hbm.items.block;
|
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
|
|
||||||
public class ItemBlockBaseColored extends ItemBlockBase {
|
|
||||||
|
|
||||||
private Block block;
|
|
||||||
|
|
||||||
public ItemBlockBaseColored(Block block) {
|
|
||||||
super(block);
|
|
||||||
this.block = block;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public int getColorFromItemStack(ItemStack stack, int p_82790_2_)
|
|
||||||
{
|
|
||||||
return this.block.getRenderColor(stack.getItemDamage());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
Loading…
x
Reference in New Issue
Block a user