mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-26 23:03:18 +00:00
1 parent
04bcdfd8b0
commit
db20469cb7
7 files changed
+131
-2
No files matched your search
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -63,6 +63,6 @@ public class ModelButterflyItem extends BlankItemModel {
|
||||
ImmutableMap.Builder<String, String> 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);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user