mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-19 03:49:07 +00:00
Working on Ceramic
This commit is contained in:
1 parent
9884a13c6e
commit
f814808f20
15 files changed
+210
-210
No files matched your search
@@ -9,5 +9,5 @@ public interface IFlowerColour {
|
||||
|
||||
int getID();
|
||||
|
||||
String getName();
|
||||
String getColourName();
|
||||
}
|
||||
@@ -5,9 +5,15 @@ import binnie.botany.genetics.EnumFlowerColor;
|
||||
import binnie.core.block.BlockMetadata;
|
||||
import binnie.core.block.IBlockMetadata;
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
import forestry.api.core.IItemModelRegister;
|
||||
import forestry.api.core.IModelManager;
|
||||
import forestry.core.blocks.IColoredBlock;
|
||||
import forestry.core.items.IColoredItem;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -19,10 +25,13 @@ import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlockCeramic extends Block implements IBlockMetadata, IColoredBlock {
|
||||
public class BlockCeramic extends Block implements IBlockMetadata, IColoredBlock, IColoredItem, IItemModelRegister {
|
||||
public static final PropertyEnum<EnumFlowerColor> COLOUR = PropertyEnum.create("color", EnumFlowerColor.class);
|
||||
public BlockCeramic() {
|
||||
super(Material.ROCK);
|
||||
this.setHardness(1.0f);
|
||||
@@ -30,6 +39,29 @@ public class BlockCeramic extends Block implements IBlockMetadata, IColoredBlock
|
||||
this.setRegistryName("ceramic");
|
||||
this.setCreativeTab(CreativeTabBotany.instance);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerModel(Item item, IModelManager manager) {
|
||||
for (final EnumFlowerColor c : EnumFlowerColor.values()) {
|
||||
manager.registerItemModel(item, c.ordinal());
|
||||
}
|
||||
}
|
||||
|
||||
//TODO: Adding Meta
|
||||
/*@Override
|
||||
protected BlockStateContainer createBlockState() {
|
||||
return new BlockStateContainer(this, COLOUR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return state.getValue(COLOUR).ordinal();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
return getDefaultState().withProperty(COLOUR, EnumFlowerColor.values()[meta]);
|
||||
}*/
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
|
||||
@@ -84,38 +116,25 @@ public class BlockCeramic extends Block implements IBlockMetadata, IColoredBlock
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(final Item itemIn, final CreativeTabs par2CreativeTabs, final List<ItemStack> itemList) {
|
||||
for (final EnumFlowerColor c : EnumFlowerColor.values()) {
|
||||
itemList.add(TileEntityMetadata.getItemStack(this, c.ordinal()));
|
||||
}
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @SideOnly(Side.CLIENT)
|
||||
// public IIcon getIcon(final IBlockAccess world, final int x, final int y, final int z, final int side) {
|
||||
// final TileEntityMetadata tile = TileEntityMetadata.getTile(world, x, y, z);
|
||||
// if (tile != null) {
|
||||
// return this.getIcon(side, tile.getTileMetadata());
|
||||
// }
|
||||
// return super.getIcon(world, x, y, z, side);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public IIcon getIcon(final int side, final int meta) {
|
||||
// return this.blockIcon;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// @SideOnly(Side.CLIENT)
|
||||
// public void registerBlockIcons(final IIconRegister register) {
|
||||
// this.blockIcon = Botany.proxy.getIcon(register, "ceramic");
|
||||
// }
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) {
|
||||
return BlockMetadata.getPickBlock(world, pos);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public int getColorFromItemstack(ItemStack stack, int tintIndex) {
|
||||
return EnumFlowerColor.get(stack.getMetadata()).getColor(false);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public int colorMultiplier(IBlockState state, IBlockAccess worldIn, BlockPos pos, int tintIndex) {
|
||||
return EnumFlowerColor.get(getMetaFromState(state)).getColor(false);
|
||||
|
||||
@@ -1,23 +1,30 @@
|
||||
package binnie.botany.ceramic;
|
||||
|
||||
import binnie.Constants;
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.CreativeTabBotany;
|
||||
import binnie.botany.genetics.EnumFlowerColor;
|
||||
import binnie.botany.items.BotanyItems;
|
||||
import binnie.botany.ceramic.BlockCeramicBrick.BlockType;
|
||||
import binnie.core.block.BlockMetadata;
|
||||
import binnie.core.block.IBlockMetadata;
|
||||
import binnie.core.block.IMultipassBlock;
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
import forestry.api.core.ISpriteRegister;
|
||||
import forestry.api.core.ITextureManager;
|
||||
import forestry.core.blocks.IColoredBlock;
|
||||
import forestry.core.render.TextureManager;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
@@ -27,7 +34,7 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlockCeramicBrick extends Block implements IBlockMetadata, IColoredBlock {
|
||||
public class BlockCeramicBrick extends Block implements IBlockMetadata, IMultipassBlock<BlockType>, IColoredBlock, ISpriteRegister {
|
||||
public BlockCeramicBrick() {
|
||||
super(Material.ROCK);
|
||||
this.setHardness(1.0f);
|
||||
@@ -164,10 +171,10 @@ public class BlockCeramicBrick extends Block implements IBlockMetadata, IColored
|
||||
|
||||
String id;
|
||||
String name;
|
||||
//IIcon[] icons;
|
||||
TextureAtlasSprite[] sprites;
|
||||
|
||||
TileType(final String id, final String name) {
|
||||
//this.icons = new IIcon[3];
|
||||
this.sprites = new TextureAtlasSprite[3];
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
}
|
||||
@@ -180,7 +187,7 @@ public class BlockCeramicBrick extends Block implements IBlockMetadata, IColored
|
||||
return this != TileType.Tile;
|
||||
}
|
||||
|
||||
public ItemStack getRecipe(final List<ItemStack> stacks) {
|
||||
public ItemStack getRecipe(List<ItemStack> stacks) {
|
||||
switch (this) {
|
||||
case Tile: {
|
||||
if (stacks.size() != 4) {
|
||||
@@ -468,8 +475,42 @@ public class BlockCeramicBrick extends Block implements IBlockMetadata, IColored
|
||||
return this.color1.ordinal() + this.color2.ordinal() * 256 + this.type.ordinal() * 256 * 256;
|
||||
}
|
||||
|
||||
// public IIcon getIcon(final int layer) {
|
||||
// return this.type.icons[layer];
|
||||
// }
|
||||
public TextureAtlasSprite getSprite(int pass) {
|
||||
return this.type.sprites[pass];
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderPasses() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public BlockType getInventoryKey(ItemStack stack) {
|
||||
return getType(stack.getItemDamage());
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public BlockType getWorldKey(IBlockState state) {
|
||||
return getType(getMetaFromState(state));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public TextureAtlasSprite getSprite(BlockType type, int pass) {
|
||||
return type.getSprite(pass);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerSprites(ITextureManager manager) {
|
||||
for (final TileType type : TileType.values()) {
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
type.sprites[i] = TextureManager.registerSprite(new ResourceLocation(Constants.BOTANY_MOD_ID + ":blocks/ceramic." + type.id + "." + i));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,8 +4,9 @@ import binnie.botany.Botany;
|
||||
import binnie.botany.api.IFlowerColour;
|
||||
import binnie.botany.core.BotanyCore;
|
||||
import forestry.api.genetics.IAlleleInteger;
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
|
||||
public enum EnumFlowerColor implements IFlowerColour, IAlleleInteger {
|
||||
public enum EnumFlowerColor implements IFlowerColour, IAlleleInteger, IStringSerializable {
|
||||
Aquamarine("aquamarine", 8388564),
|
||||
Black("black", 2631720),
|
||||
Blue("blue", 255),
|
||||
@@ -2944,9 +2945,14 @@ public enum EnumFlowerColor implements IFlowerColour, IAlleleInteger {
|
||||
addMix(EnumFlowerColor.YellowGreen, EnumFlowerColor.Yellow, EnumFlowerColor.Khaki, 110);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getColourName() {
|
||||
return Botany.proxy.localise("colour." + getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return Botany.proxy.localise("colour." + this.name().toLowerCase());
|
||||
return name().toLowerCase();
|
||||
}
|
||||
|
||||
public static EnumFlowerColor get(final int i) {
|
||||
|
||||
@@ -1,7 +1,24 @@
|
||||
package binnie.core.block;
|
||||
|
||||
public interface IMultipassBlock {
|
||||
int getNumberOfPasses();
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
int colorMultiplier(final int p0);
|
||||
public interface IMultipassBlock<K> {
|
||||
@SideOnly(Side.CLIENT)
|
||||
int getRenderPasses();
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
K getInventoryKey(ItemStack stack);
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
K getWorldKey(IBlockState state);
|
||||
|
||||
/**
|
||||
* pass -1 = particle Sprite
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
TextureAtlasSprite getSprite(K key, int pass);
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package binnie.core.block;
|
||||
|
||||
import forestry.api.core.IModelBaker;
|
||||
import forestry.arboriculture.blocks.BlockForestryLeaves;
|
||||
import forestry.arboriculture.models.ModelLeaves;
|
||||
import forestry.core.models.ModelBlockCached;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ModelMutlipass<B extends Block & IMultipassBlock<K>, K> extends ModelBlockCached<B , K> {
|
||||
|
||||
public ModelMutlipass(Class<B> blockClass) {
|
||||
super(blockClass);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected K getInventoryKey(ItemStack stack) {
|
||||
return ((B)Block.getBlockFromItem(stack.getItem())).getInventoryKey(stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected K getWorldKey(IBlockState state) {
|
||||
return ((B)state.getBlock()).getWorldKey(state);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void bakeBlock(B block, K key, IModelBaker baker, boolean inventory) {
|
||||
for(int pass = 0;pass < block.getRenderPasses();pass++){
|
||||
baker.addBlockModel(block, Block.FULL_BLOCK_AABB, null, block.getSprite(key, pass), 0);
|
||||
}
|
||||
|
||||
// Set the particle sprite
|
||||
baker.setParticleSprite(block.getSprite(key, -1));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,97 +0,0 @@
|
||||
package binnie.core.block;
|
||||
|
||||
public class MultipassBlockRenderer //implements ISimpleBlockRenderingHandler
|
||||
{
|
||||
// public static MultipassBlockRenderer instance;
|
||||
// private static int layer;
|
||||
//
|
||||
// public MultipassBlockRenderer() {
|
||||
// MultipassBlockRenderer.instance = this;
|
||||
// }
|
||||
//
|
||||
// private void setColour(final Tessellator tess, final int colour) {
|
||||
// final float var6 = (colour >> 16 & 0xFF) / 255.0f;
|
||||
// final float var7 = (colour >> 8 & 0xFF) / 255.0f;
|
||||
// final float var8 = (colour & 0xFF) / 255.0f;
|
||||
// GL11.glColor3f(var6, var7, var8);
|
||||
// }
|
||||
//
|
||||
// public static int getLayer() {
|
||||
// return MultipassBlockRenderer.layer;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void renderInventoryBlock(final Block block, final int meta, final int modelID, final RenderBlocks renderer) {
|
||||
// block.setBlockBoundsForItemRender();
|
||||
// renderer.setRenderBoundsFromBlock(block);
|
||||
// GL11.glTranslatef(-0.5f, -0.5f, -0.5f);
|
||||
// MultipassBlockRenderer.layer = 0;
|
||||
// while (MultipassBlockRenderer.layer < ((IMultipassBlock) block).getNumberOfPasses()) {
|
||||
// this.renderItem(block, renderer, meta);
|
||||
// ++MultipassBlockRenderer.layer;
|
||||
// }
|
||||
// MultipassBlockRenderer.layer = 0;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean renderWorldBlock(final IBlockAccess world, final int x, final int y, final int z, final Block block, final int modelId, final RenderBlocks renderer) {
|
||||
// boolean r = true;
|
||||
// MultipassBlockRenderer.layer = 0;
|
||||
// while (MultipassBlockRenderer.layer < ((IMultipassBlock) block).getNumberOfPasses()) {
|
||||
// r = renderer.renderStandardBlock(block, x, y, z);
|
||||
// ++MultipassBlockRenderer.layer;
|
||||
// }
|
||||
// MultipassBlockRenderer.layer = 0;
|
||||
// return r;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean shouldRender3DInInventory(final int i) {
|
||||
// return true;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public int getRenderId() {
|
||||
// return BinnieCore.multipassRenderID;
|
||||
// }
|
||||
//
|
||||
// public void renderItem(final Block block, final RenderBlocks renderer, final int meta) {
|
||||
// this.setColor(((IMultipassBlock) block).colorMultiplier(meta));
|
||||
// final Tessellator tessellator = Tessellator.instance;
|
||||
// tessellator.startDrawingQuads();
|
||||
// tessellator.setNormal(0.0f, -1.0f, 0.0f);
|
||||
// renderer.renderFaceYNeg(block, 0.0, 0.0, 0.0, renderer.getBlockIconFromSideAndMetadata(block, 0, meta));
|
||||
// tessellator.draw();
|
||||
// tessellator.startDrawingQuads();
|
||||
// tessellator.setNormal(0.0f, 1.0f, 0.0f);
|
||||
// renderer.renderFaceYPos(block, 0.0, 0.0, 0.0, renderer.getBlockIconFromSideAndMetadata(block, 1, meta));
|
||||
// tessellator.draw();
|
||||
// tessellator.startDrawingQuads();
|
||||
// tessellator.setNormal(0.0f, 0.0f, -1.0f);
|
||||
// renderer.renderFaceZNeg(block, 0.0, 0.0, 0.0, renderer.getBlockIconFromSideAndMetadata(block, 2, meta));
|
||||
// tessellator.draw();
|
||||
// tessellator.startDrawingQuads();
|
||||
// tessellator.setNormal(0.0f, 0.0f, 1.0f);
|
||||
// renderer.renderFaceZPos(block, 0.0, 0.0, 0.0, renderer.getBlockIconFromSideAndMetadata(block, 3, meta));
|
||||
// tessellator.draw();
|
||||
// tessellator.startDrawingQuads();
|
||||
// tessellator.setNormal(-1.0f, 0.0f, 0.0f);
|
||||
// renderer.renderFaceXNeg(block, 0.0, 0.0, 0.0, renderer.getBlockIconFromSideAndMetadata(block, 4, meta));
|
||||
// tessellator.draw();
|
||||
// tessellator.startDrawingQuads();
|
||||
// tessellator.setNormal(1.0f, 0.0f, 0.0f);
|
||||
// renderer.renderFaceXPos(block, 0.0, 0.0, 0.0, renderer.getBlockIconFromSideAndMetadata(block, 5, meta));
|
||||
// tessellator.draw();
|
||||
// }
|
||||
//
|
||||
// public void setColor(final int l) {
|
||||
// final float f = (l >> 16 & 0xFF) / 255.0f;
|
||||
// final float f2 = (l >> 8 & 0xFF) / 255.0f;
|
||||
// final float f3 = (l & 0xFF) / 255.0f;
|
||||
// GL11.glColor3f(f, f2, f3);
|
||||
// }
|
||||
//
|
||||
// static {
|
||||
// MultipassBlockRenderer.layer = 0;
|
||||
// }
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
package binnie.core.block;
|
||||
|
||||
public class MultipassItemRenderer// implements IItemRenderer
|
||||
{
|
||||
// private void render(final RenderBlocks renderer, final ItemStack item, final float f, final float g, final float h) {
|
||||
// GL11.glTranslatef(f, g, h);
|
||||
// final Block block = ((ItemBlock) item.getItem()).field_150939_a;
|
||||
// GL11.glEnable(3008);
|
||||
// if (block.getRenderBlockPass() != 0) {
|
||||
// GL11.glAlphaFunc(516, 0.1f);
|
||||
// GL11.glEnable(3042);
|
||||
// OpenGlHelper.glBlendFunc(770, 771, 1, 0);
|
||||
// }
|
||||
// else {
|
||||
// GL11.glAlphaFunc(516, 0.5f);
|
||||
// GL11.glDisable(3042);
|
||||
// }
|
||||
// MultipassBlockRenderer.instance.renderInventoryBlock(block, TileEntityMetadata.getItemDamage(item), 0, renderer);
|
||||
// if (block.getRenderBlockPass() == 0) {
|
||||
// GL11.glAlphaFunc(516, 0.1f);
|
||||
// }
|
||||
// GL11.glTranslatef(-f, -g, -h);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean handleRenderType(final ItemStack item, final IItemRenderer.ItemRenderType type) {
|
||||
// switch (type) {
|
||||
// case ENTITY: {
|
||||
// return true;
|
||||
// }
|
||||
// case EQUIPPED: {
|
||||
// return true;
|
||||
// }
|
||||
// case INVENTORY: {
|
||||
// return true;
|
||||
// }
|
||||
// case EQUIPPED_FIRST_PERSON: {
|
||||
// return true;
|
||||
// }
|
||||
// default: {
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean shouldUseRenderHelper(final IItemRenderer.ItemRenderType type, final ItemStack item, final IItemRenderer.ItemRendererHelper helper) {
|
||||
// return true;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void renderItem(final IItemRenderer.ItemRenderType type, final ItemStack item, final Object... data) {
|
||||
// switch (type) {
|
||||
// case ENTITY: {
|
||||
// this.render((RenderBlocks) data[0], item, 0.0f, 0.0f, 0.0f);
|
||||
// break;
|
||||
// }
|
||||
// case EQUIPPED:
|
||||
// case EQUIPPED_FIRST_PERSON: {
|
||||
// this.render((RenderBlocks) data[0], item, 0.5f, 0.5f, 0.5f);
|
||||
// break;
|
||||
// }
|
||||
// case INVENTORY: {
|
||||
// this.render((RenderBlocks) data[0], item, 0.0f, 0.0f, 0.0f);
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
@@ -32,6 +32,6 @@ public class ControlColourDisplay extends Control implements IControlValue<IFlow
|
||||
@Override
|
||||
public void getTooltip(final Tooltip tooltip) {
|
||||
super.getTooltip(tooltip);
|
||||
tooltip.add(this.value.getName());
|
||||
tooltip.add(this.value.getColourName());
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@ public class ControlColourOption extends ControlTextOption<IFlowerColour> {
|
||||
IPoint boxPosition;
|
||||
|
||||
public ControlColourOption(final ControlList<IFlowerColour> controlList, final IFlowerColour option, final int y) {
|
||||
super(controlList, option, option.getName(), y);
|
||||
super(controlList, option, option.getColourName(), y);
|
||||
this.setSize(new IPoint(this.getSize().x(), 20.0f));
|
||||
(this.controlBee = new ControlColourDisplay(this, 2.0f, 2.0f)).setValue(option);
|
||||
this.addAttribute(Attribute.MouseOver);
|
||||
|
||||
@@ -7,6 +7,8 @@ import binnie.extratrees.block.PlankType;
|
||||
import forestry.api.core.Tabs;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class BlockCarpentry extends BlockDesign {
|
||||
@@ -28,5 +30,4 @@ public class BlockCarpentry extends BlockDesign {
|
||||
public String getBlockName(final DesignBlock design) {
|
||||
return Binnie.Language.localise(ExtraTrees.instance, "block.woodentile.name", design.getDesign().getName());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -9,6 +9,8 @@ import binnie.extratrees.api.IDesign;
|
||||
import binnie.extratrees.api.IDesignSystem;
|
||||
import binnie.extratrees.api.IToolHammer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
@@ -89,12 +91,12 @@ public abstract class BlockDesign extends BlockMetadata implements IMultipassBlo
|
||||
return ModuleCarpentry.getDesignBlock(this.getDesignSystem(), TileEntityMetadata.getTileMetadata(world, pos));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int colorMultiplier(int p0) {
|
||||
//@Override
|
||||
//public int colorMultiplier(int p0) {
|
||||
// final DesignBlock block = this.getCarpentryBlock(world, pos);
|
||||
// return (MultipassBlockRenderer.getLayer() > 0) ? block.getSecondaryColour() : block.getPrimaryColour();
|
||||
return 0;
|
||||
}
|
||||
// return 0;
|
||||
//}
|
||||
|
||||
|
||||
// @Override
|
||||
@@ -153,8 +155,27 @@ public abstract class BlockDesign extends BlockMetadata implements IMultipassBlo
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getNumberOfPasses() {
|
||||
public int getRenderPasses() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getInventoryKey(ItemStack stack) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getWorldKey(IBlockState state) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextureAtlasSprite getSprite(Object key, int pass) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -71,7 +71,7 @@ public class GlassType implements IDesignMaterial {
|
||||
GlassType.types.put(c.ordinal(), new GlassType(c.ordinal(), c.name, c.colour));
|
||||
}
|
||||
for (final EnumFlowerColor c2 : EnumFlowerColor.values()) {
|
||||
GlassType.types.put(128 + c2.ordinal(), new GlassType(128 + c2.ordinal(), c2.getName(), c2.getColor(false)));
|
||||
GlassType.types.put(128 + c2.ordinal(), new GlassType(128 + c2.ordinal(), c2.getColourName(), c2.getColor(false)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user