mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-28 07:56:01 +00:00
Add more models
This commit is contained in:
1 parent
6f42dfdef9
commit
fff40b966d
59 files changed
+419
-231
No files matched your search
@@ -7,6 +7,8 @@ import binnie.core.block.BlockMetadata;
|
||||
import binnie.core.block.IBlockMetadata;
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
import binnie.core.util.TileUtil;
|
||||
import forestry.api.core.IItemModelRegister;
|
||||
import forestry.api.core.IModelManager;
|
||||
import forestry.core.blocks.IColoredBlock;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
@@ -30,7 +32,7 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockStainedGlass extends Block implements IBlockMetadata, IColoredBlock {
|
||||
public class BlockStainedGlass extends Block implements IBlockMetadata, IColoredBlock, IItemModelRegister {
|
||||
public BlockStainedGlass() {
|
||||
super(Material.GLASS);
|
||||
this.setCreativeTab(CreativeTabBotany.instance);
|
||||
@@ -50,7 +52,15 @@ public class BlockStainedGlass extends Block implements IBlockMetadata, IColored
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public BlockRenderLayer getBlockLayer() {
|
||||
return BlockRenderLayer.CUTOUT_MIPPED;
|
||||
return BlockRenderLayer.TRANSLUCENT;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerModel(Item item, IModelManager manager) {
|
||||
for (EnumFlowerColor color : EnumFlowerColor.values()) {
|
||||
manager.registerItemModel(item, color.getID());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -108,7 +118,6 @@ public class BlockStainedGlass extends Block implements IBlockMetadata, IColored
|
||||
|
||||
@Override
|
||||
public boolean eventReceived(IBlockState state, World worldIn, BlockPos pos, int id, int param) {
|
||||
super.eventReceived(state, worldIn, pos, id, param);
|
||||
TileEntity tileentity = worldIn.getTileEntity(pos);
|
||||
return tileentity == null ? false : tileentity.receiveClientEvent(id, param);
|
||||
}
|
||||
@@ -136,27 +145,6 @@ public class BlockStainedGlass extends Block implements IBlockMetadata, IColored
|
||||
}
|
||||
}
|
||||
|
||||
// @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, "stained");
|
||||
// }
|
||||
|
||||
@Override
|
||||
public boolean isWood(IBlockAccess world, BlockPos pos) {
|
||||
return true;
|
||||
@@ -184,6 +172,9 @@ public class BlockStainedGlass extends Block implements IBlockMetadata, IColored
|
||||
|
||||
@Override
|
||||
public int colorMultiplier(IBlockState state, IBlockAccess worldIn, BlockPos pos, int tintIndex) {
|
||||
return EnumFlowerColor.get(getMetaFromState(state)).getColor(false);
|
||||
if(worldIn == null || pos == null){
|
||||
return 0;
|
||||
}
|
||||
return EnumFlowerColor.get(TileEntityMetadata.getTileMetadata(worldIn, pos)).getColor(false);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package binnie.botany.ceramic;
|
||||
|
||||
import binnie.botany.genetics.EnumFlowerColor;
|
||||
import binnie.core.block.ItemMetadata;
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
import forestry.core.items.IColoredItem;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemStainedGlass extends ItemMetadata implements IColoredItem {
|
||||
|
||||
public ItemStainedGlass(Block block) {
|
||||
super(block);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public int getColorFromItemstack(ItemStack stack, int tintIndex) {
|
||||
return EnumFlowerColor.get(TileEntityMetadata.getItemDamage(stack)).getColor(false);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -10,6 +10,7 @@ import binnie.botany.ceramic.BlockCeramicPatterned;
|
||||
import binnie.botany.ceramic.BlockStainedGlass;
|
||||
import binnie.botany.ceramic.CeramicTileRecipe;
|
||||
import binnie.botany.ceramic.ItemCeramic;
|
||||
import binnie.botany.ceramic.ItemStainedGlass;
|
||||
import binnie.botany.ceramic.PigmentRecipe;
|
||||
import binnie.botany.ceramic.TileCeramic;
|
||||
import binnie.botany.ceramic.brick.BlockCeramicBrick;
|
||||
@@ -87,7 +88,7 @@ public class ModuleGardening implements IInitializable {
|
||||
BinnieCore.proxy.registerTileEntity(TileCeramic.class, "botany.tile.ceramic");
|
||||
// BinnieCore.proxy.registerCustomItemRenderer(Item.getItemFromBlock(Botany.ceramic), new ItemMetadataRenderer());
|
||||
Botany.stained = new BlockStainedGlass();
|
||||
Botany.proxy.registerBlock(Botany.stained, new ItemMetadata(Botany.stained));
|
||||
Botany.proxy.registerBlock(Botany.stained, new ItemStainedGlass(Botany.stained));
|
||||
// BinnieCore.proxy.registerCustomItemRenderer(Item.getItemFromBlock(Botany.stained), new ItemMetadataRenderer());
|
||||
Botany.ceramicTile = new BlockCeramicPatterned();
|
||||
Botany.proxy.registerBlock(Botany.ceramicTile, new ItemDesign(Botany.ceramicTile));
|
||||
|
||||
Reference in new issue
Block a user