mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-18 03:25:07 +00:00
Add Flower Item Models and Flower Double Models
This commit is contained in:
1 parent
fb732b9398
commit
df17dccad7
103 files changed
+745
-21
No files matched your search
@@ -22,6 +22,7 @@ import forestry.api.core.IStateMapperRegister;
|
||||
import forestry.core.blocks.IColoredBlock;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.BlockDoublePlant;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.PropertyBool;
|
||||
@@ -44,7 +45,7 @@ import net.minecraftforge.client.model.ModelLoader;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockFlower extends BlockContainer implements IColoredBlock, IItemModelRegister, IStateMapperRegister {
|
||||
public class BlockFlower extends BlockContainer implements IColoredBlock, IStateMapperRegister {
|
||||
|
||||
public static final AxisAlignedBB FLOWER_BLOCK_AABB = new AxisAlignedBB(0.3D, 0.0D, 0.3D, 0.7D, 0.6D, 0.7D);
|
||||
/* PROPERTYS */
|
||||
@@ -66,16 +67,6 @@ public class BlockFlower extends BlockContainer implements IColoredBlock, IItemM
|
||||
return new TileEntityFlower();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerModel(Item item, IModelManager manager) {
|
||||
for(EnumFlowerStage type : EnumFlowerStage.VALUES){
|
||||
for (IFlowerType flowerType : (List<IFlowerType>)FLOWER.getAllowedValues()) {
|
||||
flowerType.registerModels(item, manager, type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerStateMapper() {
|
||||
@@ -89,12 +80,26 @@ public class BlockFlower extends BlockContainer implements IColoredBlock, IItemM
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) {
|
||||
TileEntity tile = source.getTileEntity(pos);
|
||||
if (tile instanceof TileEntityFlower) {
|
||||
TileEntityFlower flower = (TileEntityFlower) tile;
|
||||
if(flower.getType().getSections() > 1){
|
||||
return FULL_BLOCK_AABB;
|
||||
}
|
||||
}
|
||||
return FLOWER_BLOCK_AABB;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getSelectedBoundingBox(IBlockState state, World worldIn, BlockPos pos) {
|
||||
return FLOWER_BLOCK_AABB;
|
||||
public AxisAlignedBB getSelectedBoundingBox(IBlockState state, World world, BlockPos pos) {
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
if (tile instanceof TileEntityFlower) {
|
||||
TileEntityFlower flower = (TileEntityFlower) tile;
|
||||
if(flower.getType().getSections() > 1){
|
||||
return FULL_BLOCK_AABB.offset(pos);
|
||||
}
|
||||
}
|
||||
return FLOWER_BLOCK_AABB.offset(pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -161,6 +161,9 @@ public class ItemBotany extends Item implements IColoredItem, IItemModelRegister
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerModel(Item item, IModelManager manager) {
|
||||
for (IFlowerType flowerType : (List<IFlowerType>)BlockFlower.FLOWER.getAllowedValues()) {
|
||||
flowerType.registerModels(item, manager, type);
|
||||
}
|
||||
manager.registerItemModel(item, new BotanyMeshDefinition());
|
||||
}
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ public enum EnumFlowerType implements IFlowerType<EnumFlowerType> {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerModels(Item item, IModelManager manager, EnumFlowerStage type){
|
||||
String pre = (this.sections == 1) ? "" : "double/";
|
||||
flower = new ModelResourceLocation(Constants.BOTANY_MOD_ID + "flowers/" + pre + this.toString().toLowerCase(), "inventory");
|
||||
flower = new ModelResourceLocation(Constants.BOTANY_MOD_ID + ":flowers/" + pre + getName(), "inventory");
|
||||
seed = new ModelResourceLocation(Constants.BOTANY_MOD_ID + ":flowers/seed", "inventory");
|
||||
pollen = new ModelResourceLocation(Constants.BOTANY_MOD_ID + ":flowers/pollen", "inventory");
|
||||
ModelBakery.registerItemVariants(item, pollen, seed, flower);
|
||||
|
||||
+9
-3
@@ -1,4 +1,4 @@
|
||||
package binnie.core.genetics;
|
||||
package binnie.botany.genetics;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.botany.api.EnumFlowerChromosome;
|
||||
@@ -6,8 +6,14 @@ import binnie.botany.api.EnumFlowerStage;
|
||||
import binnie.botany.api.IBotanistTracker;
|
||||
import binnie.botany.api.IFlowerRoot;
|
||||
import binnie.botany.core.BotanyCore;
|
||||
import binnie.botany.genetics.EnumFlowerColor;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.genetics.BreedingSystem;
|
||||
import binnie.core.genetics.ForestryAllele;
|
||||
import binnie.core.genetics.Tolerance;
|
||||
import binnie.core.genetics.ForestryAllele.Fertility;
|
||||
import binnie.core.genetics.ForestryAllele.Lifespan;
|
||||
import binnie.core.genetics.ForestryAllele.Sappiness;
|
||||
import binnie.core.genetics.ForestryAllele.Territory;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import forestry.api.genetics.*;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -15,7 +21,7 @@ import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.TreeSet;
|
||||
|
||||
class FlowerBreedingSystem extends BreedingSystem {
|
||||
public class FlowerBreedingSystem extends BreedingSystem {
|
||||
public FlowerBreedingSystem() {
|
||||
this.iconUndiscovered = Binnie.Resource.getItemIcon(ExtraBees.instance, "icon/undiscoveredBee");
|
||||
this.iconDiscovered = Binnie.Resource.getItemIcon(ExtraBees.instance, "icon/discoveredBee");
|
||||
@@ -34,8 +34,6 @@ public class ModuleGenetics implements IInitializable {
|
||||
Botany.flower = new BlockFlower();
|
||||
Botany.proxy.registerBlock(Botany.flower);
|
||||
BinnieCore.proxy.registerTileEntity(TileEntityFlower.class, "botany.tile.flower", null);
|
||||
//Need we this ?
|
||||
Botany.proxy.registerItem(new ItemBlock(Botany.flower).setRegistryName(Botany.flower.getRegistryName()));
|
||||
|
||||
Botany.flowerItem = new ItemBotany("itemFlower", EnumFlowerStage.FLOWER, "");
|
||||
Botany.pollen = new ItemBotany("pollen", EnumFlowerStage.POLLEN, "Pollen");
|
||||
|
||||
@@ -3,6 +3,7 @@ package binnie.core.genetics;
|
||||
import binnie.Binnie;
|
||||
import binnie.botany.api.IFlowerRoot;
|
||||
import binnie.botany.genetics.EnumFlowerColor;
|
||||
import binnie.botany.genetics.FlowerBreedingSystem;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.ManagerBase;
|
||||
import forestry.api.apiculture.BeeManager;
|
||||
|
||||
Reference in new issue
Block a user