diff --git a/src/main/java/forestry/core/items/ItemLiquidContainer.java b/src/main/java/forestry/core/items/ItemLiquidContainer.java index 8128d551f..96a671909 100755 --- a/src/main/java/forestry/core/items/ItemLiquidContainer.java +++ b/src/main/java/forestry/core/items/ItemLiquidContainer.java @@ -133,7 +133,11 @@ public class ItemLiquidContainer extends ItemForestry { @SideOnly(Side.CLIENT) @Override public void registerModel(Item item, IModelManager manager) { - manager.registerItemModel(item, 0, "liquids/" + type.toString().toLowerCase(Locale.ENGLISH)); + if(color == 0){ + manager.registerItemModel(item, 0, "liquids/" + type.toString().toLowerCase(Locale.ENGLISH)+ "_empty"); + }else{ + manager.registerItemModel(item, 0, "liquids/" + type.toString().toLowerCase(Locale.ENGLISH)); + } } @Override diff --git a/src/main/java/forestry/lepidopterology/blocks/BlockCocoon.java b/src/main/java/forestry/lepidopterology/blocks/BlockCocoon.java index ea05e1806..ef0bbb8c1 100644 --- a/src/main/java/forestry/lepidopterology/blocks/BlockCocoon.java +++ b/src/main/java/forestry/lepidopterology/blocks/BlockCocoon.java @@ -24,6 +24,7 @@ import net.minecraft.block.ITileEntityProvider; import net.minecraft.block.state.IBlockState; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; @@ -100,4 +101,38 @@ public class BlockCocoon extends Block implements ITileEntityProvider, IStateMap return Collections.emptyList(); } + @Override + public AxisAlignedBB getSelectedBoundingBox(World world, BlockPos pos) { + TileCocoon cocoon = TileUtil.getTile(world, pos, TileCocoon.class); + if(cocoon != null){ + if(cocoon.getAge() == 0){ + setBlockBounds(0.375F, 0.5F, 0.4375F, 0.5625F, 1F, 0.6875F); + }else if(cocoon.getAge() == 1){ + setBlockBounds(0.34375F, 0.375F, 0.40625F, 0.59375F, 1F, 0.71875F); + }else if(cocoon.getAge() == 2){ + setBlockBounds(0.34375F, 0.25F, 0.28125F, 0.71875F, 1F, 0.71875F); + }else{ + setBlockBounds(0, 0, 0, 1, 1, 1); + } + } + return super.getSelectedBoundingBox(world, pos); + } + + @Override + public AxisAlignedBB getCollisionBoundingBox(World world, BlockPos pos, IBlockState state) { + TileCocoon cocoon = TileUtil.getTile(world, pos, TileCocoon.class); + if(cocoon != null){ + if(cocoon.getAge() == 0){ + setBlockBounds(0.375F, 0.5F, 0.4375F, 0.5625F, 1F, 0.6875F); + }else if(cocoon.getAge() == 1){ + setBlockBounds(0.34375F, 0.375F, 0.40625F, 0.59375F, 1F, 0.71875F); + }else if(cocoon.getAge() == 2){ + setBlockBounds(0.34375F, 0.25F, 0.28125F, 0.71875F, 1F, 0.71875F); + }else{ + setBlockBounds(0, 0, 0, 1, 1, 1); + } + } + return super.getCollisionBoundingBox(world, pos, state); + } + } diff --git a/src/main/java/forestry/lepidopterology/blocks/BlockSolidCocoon.java b/src/main/java/forestry/lepidopterology/blocks/BlockSolidCocoon.java index 3fc125872..7103a4ec7 100644 --- a/src/main/java/forestry/lepidopterology/blocks/BlockSolidCocoon.java +++ b/src/main/java/forestry/lepidopterology/blocks/BlockSolidCocoon.java @@ -15,6 +15,7 @@ import java.util.List; import forestry.api.core.IStateMapperRegister; import forestry.core.proxy.Proxies; import forestry.core.render.EmptyStateMapper; +import forestry.core.tiles.TileUtil; import forestry.core.utils.ItemStackUtil; import forestry.lepidopterology.tiles.TileCocoon; import net.minecraft.block.Block; @@ -23,6 +24,7 @@ import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; @@ -105,4 +107,38 @@ public class BlockSolidCocoon extends Block implements ITileEntityProvider, ISta return Collections.emptyList(); } + @Override + public AxisAlignedBB getSelectedBoundingBox(World world, BlockPos pos) { + TileCocoon cocoon = TileUtil.getTile(world, pos, TileCocoon.class); + if(cocoon != null){ + if(cocoon.getAge() == 0){ + setBlockBounds(0.375F, 0.5F, 0.4375F, 0.5625F, 1F, 0.6875F); + }else if(cocoon.getAge() == 1){ + setBlockBounds(0.34375F, 0.375F, 0.40625F, 0.59375F, 1F, 0.71875F); + }else if(cocoon.getAge() == 2){ + setBlockBounds(0.34375F, 0.25F, 0.28125F, 0.71875F, 1F, 0.71875F); + }else{ + setBlockBounds(0, 0, 0, 1, 1, 1); + } + } + return super.getSelectedBoundingBox(world, pos); + } + + @Override + public AxisAlignedBB getCollisionBoundingBox(World world, BlockPos pos, IBlockState state) { + TileCocoon cocoon = TileUtil.getTile(world, pos, TileCocoon.class); + if(cocoon != null){ + if(cocoon.getAge() == 0){ + setBlockBounds(0.375F, 0.5F, 0.4375F, 0.5625F, 1F, 0.6875F); + }else if(cocoon.getAge() == 1){ + setBlockBounds(0.34375F, 0.375F, 0.40625F, 0.59375F, 1F, 0.71875F); + }else if(cocoon.getAge() == 2){ + setBlockBounds(0.34375F, 0.25F, 0.28125F, 0.71875F, 1F, 0.71875F); + }else{ + setBlockBounds(0, 0, 0, 1, 1, 1); + } + } + return super.getCollisionBoundingBox(world, pos, state); + } + } diff --git a/src/main/java/forestry/lepidopterology/render/ModelButterflyItem.java b/src/main/java/forestry/lepidopterology/render/ModelButterflyItem.java index 9d8c28fb7..8a2f9c49b 100644 --- a/src/main/java/forestry/lepidopterology/render/ModelButterflyItem.java +++ b/src/main/java/forestry/lepidopterology/render/ModelButterflyItem.java @@ -63,6 +63,6 @@ public class ModelButterflyItem extends BlankItemModel { ImmutableMap.Builder textures = ImmutableMap.builder(); textures.put("butterfly", butterfly.getGenome().getSecondary().getItemTexture()); modelButterfly = (IRetexturableModel) modelButterfly.retexture(textures.build()); - return new TRSRBakedModel(modelButterfly.bake(ModelRotation.X0_Y0, DefaultVertexFormats.ITEM, textureGetter), 0.0F, 0.0F, 0.0F, butterfly.getSize()); + return new TRSRBakedModel(modelButterfly.bake(ModelRotation.X0_Y0, DefaultVertexFormats.ITEM, textureGetter), -0.03125F, 0.0F, -0.03125F, butterfly.getSize() * 1.5F); } } diff --git a/src/main/resources/assets/forestry/models/item/liquids/can_empty.json b/src/main/resources/assets/forestry/models/item/liquids/can_empty.json new file mode 100644 index 000000000..eed9e8ba9 --- /dev/null +++ b/src/main/resources/assets/forestry/models/item/liquids/can_empty.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "forestry:items/liquids/can.bottle" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/src/main/resources/assets/forestry/models/item/liquids/capsule_empty.json b/src/main/resources/assets/forestry/models/item/liquids/capsule_empty.json new file mode 100644 index 000000000..61dfdac22 --- /dev/null +++ b/src/main/resources/assets/forestry/models/item/liquids/capsule_empty.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "forestry:items/liquids/capsule.bottle" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/src/main/resources/assets/forestry/models/item/liquids/refractory_empty.json b/src/main/resources/assets/forestry/models/item/liquids/refractory_empty.json new file mode 100644 index 000000000..007c24e8b --- /dev/null +++ b/src/main/resources/assets/forestry/models/item/liquids/refractory_empty.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "forestry:items/liquids/refractory.bottle" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +}