From 4f0b965f573e770ad2424961adf9ea06c0ff2f78 Mon Sep 17 00:00:00 2001 From: Mohammad-Ali Minaie Date: Sat, 7 Jan 2017 23:36:22 -0500 Subject: [PATCH] piston bellows is working with animations needs sounds updated rendering for 3rd persion and gui --- 1.11/To-Dos | 3 +- .../java/nmd/primal/forgecraft/ModInfo.java | 3 +- .../nmd/primal/forgecraft/blocks/Firebox.java | 3 - .../forgecraft/blocks/PistonBellows.java | 378 ++++++++++++------ .../nmd/primal/forgecraft/init/ModItems.java | 11 +- .../nmd/primal/forgecraft/init/ModTiles.java | 5 +- .../forgecraft/items/ItemBellowsHandle.java | 15 + .../nmd/primal/forgecraft/items/ItemTest.java | 1 - .../primal/forgecraft/proxy/ClientProxy.java | 3 + .../forgecraft/renders/TileFireboxRender.java | 1 - .../renders/TilePistonBellowsRender.java | 89 +++++ .../primal/forgecraft/tiles/TileFirebox.java | 2 +- .../forgecraft/tiles/TilePistonBellows.java | 87 ++-- 1.11/src/main/resources/assets/.DS_Store | Bin 6148 -> 8196 bytes .../forgecraft/armatures/block/pump_head.json | 24 ++ .../assets/forgecraft/asms/block/pump.json | 13 + .../forgecraft/blockstates/pistonbellows.json | 12 +- .../forgecraft/models/block/firebox.json | 16 +- .../models/block/pistonbellows.json | 59 +-- .../forgecraft/models/item/bellowshandle.json | 62 +++ .../forgecraft/models/item/firebox.json | 38 +- .../forgecraft/models/item/pistonbellows.json | 9 + 22 files changed, 576 insertions(+), 258 deletions(-) create mode 100644 1.11/src/main/java/nmd/primal/forgecraft/items/ItemBellowsHandle.java create mode 100644 1.11/src/main/java/nmd/primal/forgecraft/renders/TilePistonBellowsRender.java create mode 100644 1.11/src/main/resources/assets/forgecraft/armatures/block/pump_head.json create mode 100644 1.11/src/main/resources/assets/forgecraft/asms/block/pump.json create mode 100644 1.11/src/main/resources/assets/forgecraft/models/item/bellowshandle.json create mode 100644 1.11/src/main/resources/assets/forgecraft/models/item/pistonbellows.json diff --git a/1.11/To-Dos b/1.11/To-Dos index 6d7b4bc7..1e47aca1 100644 --- a/1.11/To-Dos +++ b/1.11/To-Dos @@ -1,7 +1,8 @@ To-Dos - [ ] Fix Firebox model to have more of a bowl shape and have the air inlet on the left - - [ ] Redo piston bellows if statements to match the new directional (should match the same directions) +- [x] Redo piston bellows if statements to match the new directional (should match the same directions) +- [ ] Fix PistonBellows Bounding Boxes to match the direction - [ ] Crucible - [ ] Model diff --git a/1.11/src/main/java/nmd/primal/forgecraft/ModInfo.java b/1.11/src/main/java/nmd/primal/forgecraft/ModInfo.java index efa6b133..bc0c24ac 100644 --- a/1.11/src/main/java/nmd/primal/forgecraft/ModInfo.java +++ b/1.11/src/main/java/nmd/primal/forgecraft/ModInfo.java @@ -32,7 +32,8 @@ public class ModInfo { //public static final String UPDATE_JSON = ""; public enum ForgecraftItems { - TEST("test", "ItemTest"); + TEST("test", "ItemTest"), + BELLOWSHANDLE("bellowshandle", "bellowshandle"); private String unlocalizedName; private String registryName; diff --git a/1.11/src/main/java/nmd/primal/forgecraft/blocks/Firebox.java b/1.11/src/main/java/nmd/primal/forgecraft/blocks/Firebox.java index aae27b2d..93310ec4 100644 --- a/1.11/src/main/java/nmd/primal/forgecraft/blocks/Firebox.java +++ b/1.11/src/main/java/nmd/primal/forgecraft/blocks/Firebox.java @@ -78,9 +78,6 @@ public class Firebox extends CustomContainerFacing implements ITileEntityProvide return boundBox; } - - - @Override public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { diff --git a/1.11/src/main/java/nmd/primal/forgecraft/blocks/PistonBellows.java b/1.11/src/main/java/nmd/primal/forgecraft/blocks/PistonBellows.java index 46bfd3cb..ced0a5a3 100644 --- a/1.11/src/main/java/nmd/primal/forgecraft/blocks/PistonBellows.java +++ b/1.11/src/main/java/nmd/primal/forgecraft/blocks/PistonBellows.java @@ -19,10 +19,15 @@ import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.TextComponentString; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import net.minecraftforge.common.property.ExtendedBlockState; +import net.minecraftforge.common.property.IUnlistedProperty; +import net.minecraftforge.common.property.Properties; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import nmd.primal.forgecraft.ModInfo; +import nmd.primal.forgecraft.init.ModBlocks; import nmd.primal.forgecraft.tiles.TileFirebox; +import nmd.primal.forgecraft.tiles.TilePistonBellows; import javax.annotation.Nullable; import java.util.Random; @@ -30,9 +35,9 @@ import java.util.Random; /** * Created by mminaie on 1/1/17. */ -public class PistonBellows extends CustomFacing { +public class PistonBellows extends CustomContainerFacing { - //public static final PropertyBool ACTIVE = PropertyBool.create("active"); + public static final PropertyBool ACTIVE = PropertyBool.create("active"); //protected static final AxisAlignedBB collideBox = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 0.99D, 1.0D); protected static final AxisAlignedBB boundBox = new AxisAlignedBB(0.1875D, 0.0D, 0.0D, 1.0D, 12 / 16D, 1.0D); @@ -42,136 +47,142 @@ public class PistonBellows extends CustomFacing { setUnlocalizedName(ModInfo.ForgecraftBlocks.PISTONBELLOWS.getUnlocalizedName()); setRegistryName(ModInfo.ForgecraftBlocks.PISTONBELLOWS.getRegistryName()); setCreativeTab(ModInfo.TAB_FORGECRAFT); - setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH)); + setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(ACTIVE, Boolean.valueOf(false))); setHardness(3.0f); } @Override - public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { - if(!world.isRemote){ - //System.out.println(state.getValue(PistonBellows.FACING)); - if(state.getValue(PistonBellows.FACING) == EnumFacing.NORTH){ - BlockPos tempPos = new BlockPos(pos.getX()+1, pos.getY(), pos.getZ()); - TileFirebox tile = (TileFirebox) world.getTileEntity(tempPos); - if((world.getBlockState(tempPos).getValue(Firebox.ACTIVE) == true) && (world.getBlockState(tempPos).getValue(Firebox.FACING) == EnumFacing.EAST)){ - if(tile != null){ - //System.out.println(world.getBlockState(tempPos).getValue(Firebox.FACING)); - tile.setHeat(tile.getHeat() + 25); - tile.updateBlock(); - tile.markDirty(); - return true; - } - } - } - if(state.getValue(PistonBellows.FACING) == EnumFacing.SOUTH){ - BlockPos tempPos = new BlockPos(pos.getX()-1, pos.getY(), pos.getZ()); - TileFirebox tile = (TileFirebox) world.getTileEntity(tempPos); - if((world.getBlockState(tempPos).getValue(Firebox.ACTIVE) == true) && (world.getBlockState(tempPos).getValue(Firebox.FACING) == EnumFacing.WEST)){ - if(tile != null){ - //System.out.println(world.getBlockState(tempPos).getValue(Firebox.FACING)); - tile.setHeat(tile.getHeat() + 25); - tile.updateBlock(); - tile.markDirty(); - return true; - } - } - } - if(state.getValue(PistonBellows.FACING) == EnumFacing.EAST){ - BlockPos tempPos = new BlockPos(pos.getX(), pos.getY(), pos.getZ()+1); - TileFirebox tile = (TileFirebox) world.getTileEntity(tempPos); - if((world.getBlockState(tempPos).getValue(Firebox.ACTIVE) == true) && (world.getBlockState(tempPos).getValue(Firebox.FACING) == EnumFacing.SOUTH)){ - if(tile != null){ - //System.out.println(world.getBlockState(tempPos).getValue(Firebox.FACING)); - tile.setHeat(tile.getHeat() + 25); - tile.updateBlock(); - tile.markDirty(); - return true; - } - } - } - if(state.getValue(PistonBellows.FACING) == EnumFacing.WEST){ - BlockPos tempPos = new BlockPos(pos.getX(), pos.getY(), pos.getZ()-1); - TileFirebox tile = (TileFirebox) world.getTileEntity(tempPos); - if((world.getBlockState(tempPos).getValue(Firebox.ACTIVE) == true) && (world.getBlockState(tempPos).getValue(Firebox.FACING) == EnumFacing.NORTH)){ - if(tile != null){ - //System.out.println(world.getBlockState(tempPos).getValue(Firebox.FACING)); - tile.setHeat(tile.getHeat() + 25); - tile.updateBlock(); - tile.markDirty(); - return true; - } - } - } - } - if(world.isRemote){ - if(state.getValue(PistonBellows.FACING) == EnumFacing.NORTH) { - BlockPos tempPos = new BlockPos(pos.getX() + 1, pos.getY(), pos.getZ()); - TileFirebox tile = (TileFirebox) world.getTileEntity(tempPos); - if((world.getBlockState(tempPos).getValue(Firebox.ACTIVE) == true) && (world.getBlockState(tempPos).getValue(Firebox.FACING) == EnumFacing.EAST)){ - makeEmbers(world, tempPos, world.rand); - } - } - if(state.getValue(PistonBellows.FACING) == EnumFacing.SOUTH) { - BlockPos tempPos = new BlockPos(pos.getX() - 1, pos.getY(), pos.getZ()); - TileFirebox tile = (TileFirebox) world.getTileEntity(tempPos); - if((world.getBlockState(tempPos).getValue(Firebox.ACTIVE) == true) && (world.getBlockState(tempPos).getValue(Firebox.FACING) == EnumFacing.WEST)){ - makeEmbers(world, tempPos, world.rand); - } - } - if(state.getValue(PistonBellows.FACING) == EnumFacing.EAST) { - BlockPos tempPos = new BlockPos(pos.getX(), pos.getY(), pos.getZ() + 1); - TileFirebox tile = (TileFirebox) world.getTileEntity(tempPos); - if((world.getBlockState(tempPos).getValue(Firebox.ACTIVE) == true) && (world.getBlockState(tempPos).getValue(Firebox.FACING) == EnumFacing.SOUTH)){ - makeEmbers(world, tempPos, world.rand); - } - } - if(state.getValue(PistonBellows.FACING) == EnumFacing.WEST) { - BlockPos tempPos = new BlockPos(pos.getX(), pos.getY(), pos.getZ() - 1); - TileFirebox tile = (TileFirebox) world.getTileEntity(tempPos); - if((world.getBlockState(tempPos).getValue(Firebox.ACTIVE) == true) && (world.getBlockState(tempPos).getValue(Firebox.FACING) == EnumFacing.NORTH)){ - makeEmbers(world, tempPos, world.rand); - } - } - } - return true; - } - - private void makeEmbers(World world, BlockPos pos, Random rand){ - double d0 = (double)pos.getX() + 0.5D; - double d1 = (double)pos.getY() + 0.65D; - double d2 = (double)pos.getZ() + 0.5D; - double d3 = 0.52D; - double d4 = rand.nextDouble() * 0.6D - 0.3D; - - if(rand.nextInt(3) == 0){ - world.spawnParticle(EnumParticleTypes.FLAME, d0+d4, d1, d2+d4, 0.0D, 0.1D, 0.0D, new int[0]); - world.spawnParticle(EnumParticleTypes.FLAME, d0+d4, d1, d2+d4, 0.0D, 0.1D, 0.0D, new int[0]); - } - if(rand.nextInt(3) == 1){ - world.spawnParticle(EnumParticleTypes.FLAME, d0+d4, d1, d2-d4, 0.0D, 0.1D, 0.0D, new int[0]); - world.spawnParticle(EnumParticleTypes.FLAME, d0+d4, d1, d2+d4, 0.0D, 0.1D, 0.0D, new int[0]); - } - if(rand.nextInt(3) == 2){ - world.spawnParticle(EnumParticleTypes.FLAME, d0-d4, d1, d2+d4, 0.0D, 0.1D, 0.0D, new int[0]); - world.spawnParticle(EnumParticleTypes.FLAME, d0+d4, d1, d2+d4, 0.0D, 0.1D, 0.0D, new int[0]); - } - if(rand.nextInt(3) == 3){ - world.spawnParticle(EnumParticleTypes.FLAME, d0-d4, d1, d2-d4, 0.0D, 0.1D, 0.0D, new int[0]); - world.spawnParticle(EnumParticleTypes.FLAME, d0+d4, d1, d2+d4, 0.0D, 0.1D, 0.0D, new int[0]); - } + public TileEntity createNewTileEntity(World worldIn, int meta) + { + return new TilePistonBellows(); } @Override public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) { - worldIn.setBlockState(pos, state.withProperty(FACING, placer.getHorizontalFacing()), 2); + + TilePistonBellows tile = (TilePistonBellows) worldIn.getTileEntity(pos); + if (tile != null) { + worldIn.setBlockState(pos, state.withProperty(FACING, placer.getHorizontalFacing()).withProperty(ACTIVE, Boolean.valueOf(false)), 2); + } + } - //@Override - //public TileEntity createNewTileEntity(World worldIn, int meta) - //{ - //return new TilePistonBellows(); - //} + @Override + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { + if(!world.isRemote){ + System.out.println(state.getValue(PistonBellows.FACING)); + if(state.getValue(this.ACTIVE) == false) { + world.setBlockState(pos, state.withProperty(ACTIVE, true), 2); + if (state.getValue(PistonBellows.FACING) == EnumFacing.NORTH) { + BlockPos tempPos = new BlockPos(pos.getX() + 1, pos.getY(), pos.getZ()); + if (world.getBlockState(tempPos).getBlock() == ModBlocks.firebox) { + TileFirebox tile = (TileFirebox) world.getTileEntity(tempPos); + if ((world.getBlockState(tempPos).getValue(Firebox.ACTIVE) == true) && (world.getBlockState(tempPos).getValue(Firebox.FACING) == EnumFacing.EAST)) { + if (tile != null) { + //System.out.println(world.getBlockState(tempPos).getValue(Firebox.FACING)); + tile.setHeat(tile.getHeat() + 25); + tile.updateBlock(); + tile.markDirty(); + return true; + } + } + } + } + if (state.getValue(PistonBellows.FACING) == EnumFacing.SOUTH) { + BlockPos tempPos = new BlockPos(pos.getX() - 1, pos.getY(), pos.getZ()); + if (world.getBlockState(tempPos).getBlock() == ModBlocks.firebox) { + TileFirebox tile = (TileFirebox) world.getTileEntity(tempPos); + if ((world.getBlockState(tempPos).getValue(Firebox.ACTIVE) == true) && (world.getBlockState(tempPos).getValue(Firebox.FACING) == EnumFacing.WEST)) { + if (tile != null) { + //System.out.println(world.getBlockState(tempPos).getValue(Firebox.FACING)); + tile.setHeat(tile.getHeat() + 25); + tile.updateBlock(); + tile.markDirty(); + return true; + } + } + } + } + if (state.getValue(PistonBellows.FACING) == EnumFacing.EAST) { + BlockPos tempPos = new BlockPos(pos.getX(), pos.getY(), pos.getZ() + 1); + if (world.getBlockState(tempPos).getBlock() == ModBlocks.firebox) { + TileFirebox tile = (TileFirebox) world.getTileEntity(tempPos); + if ((world.getBlockState(tempPos).getValue(Firebox.ACTIVE) == true) && (world.getBlockState(tempPos).getValue(Firebox.FACING) == EnumFacing.SOUTH)) { + if (tile != null) { + //System.out.println(world.getBlockState(tempPos).getValue(Firebox.FACING)); + tile.setHeat(tile.getHeat() + 25); + tile.updateBlock(); + tile.markDirty(); + return true; + } + } + } + } + if (state.getValue(PistonBellows.FACING) == EnumFacing.WEST) { + BlockPos tempPos = new BlockPos(pos.getX(), pos.getY(), pos.getZ() - 1); + if (world.getBlockState(tempPos).getBlock() == ModBlocks.firebox) { + TileFirebox tile = (TileFirebox) world.getTileEntity(tempPos); + if ((world.getBlockState(tempPos).getValue(Firebox.ACTIVE) == true) && (world.getBlockState(tempPos).getValue(Firebox.FACING) == EnumFacing.NORTH)) { + if (tile != null) { + //System.out.println(world.getBlockState(tempPos).getValue(Firebox.FACING)); + tile.setHeat(tile.getHeat() + 25); + tile.updateBlock(); + tile.markDirty(); + return true; + } + } + } + } + } + } + /*if(world.isRemote){ + if(state.getValue(PistonBellows.FACING) == EnumFacing.NORTH) { + BlockPos tempPos = new BlockPos(pos.getX() + 1, pos.getY(), pos.getZ()); + if(world.getBlockState(tempPos).getBlock() == ModBlocks.firebox){ + TileFirebox tile = (TileFirebox) world.getTileEntity(tempPos); + if((world.getBlockState(tempPos).getValue(Firebox.ACTIVE) == true) && (world.getBlockState(tempPos).getValue(Firebox.FACING) == EnumFacing.EAST)){ + makeEmbers(world, tempPos, world.rand); + } + } + + } + if(state.getValue(PistonBellows.FACING) == EnumFacing.SOUTH) { + BlockPos tempPos = new BlockPos(pos.getX() - 1, pos.getY(), pos.getZ()); + if(world.getBlockState(tempPos).getBlock() == ModBlocks.firebox){ + TileFirebox tile = (TileFirebox) world.getTileEntity(tempPos); + if((world.getBlockState(tempPos).getValue(Firebox.ACTIVE) == true) && (world.getBlockState(tempPos).getValue(Firebox.FACING) == EnumFacing.WEST)){ + makeEmbers(world, tempPos, world.rand); + } + } + + } + if(state.getValue(PistonBellows.FACING) == EnumFacing.EAST) { + BlockPos tempPos = new BlockPos(pos.getX(), pos.getY(), pos.getZ() + 1); + if(world.getBlockState(tempPos).getBlock() == ModBlocks.firebox){ + TileFirebox tile = (TileFirebox) world.getTileEntity(tempPos); + if((world.getBlockState(tempPos).getValue(Firebox.ACTIVE) == true) && (world.getBlockState(tempPos).getValue(Firebox.FACING) == EnumFacing.SOUTH)){ + makeEmbers(world, tempPos, world.rand); + } + } + + } + if(state.getValue(PistonBellows.FACING) == EnumFacing.WEST) { + BlockPos tempPos = new BlockPos(pos.getX(), pos.getY(), pos.getZ() - 1); + if(world.getBlockState(tempPos).getBlock() == ModBlocks.firebox){ + TileFirebox tile = (TileFirebox) world.getTileEntity(tempPos); + if((world.getBlockState(tempPos).getValue(Firebox.ACTIVE) == true) && (world.getBlockState(tempPos).getValue(Firebox.FACING) == EnumFacing.NORTH)){ + makeEmbers(world, tempPos, world.rand); + } + } + + } + }*/ + return true; + } + + + @Override public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) @@ -209,22 +220,38 @@ public class PistonBellows extends CustomFacing { public int getMetaFromState(IBlockState state) { int i = 0; - if( (state.getValue(FACING) == EnumFacing.EAST)){ + if( (state.getValue(FACING) == EnumFacing.EAST) && state.getValue(ACTIVE) == false){ i = 0; return i; } - if( (state.getValue(FACING) == EnumFacing.WEST)){ + if( (state.getValue(FACING) == EnumFacing.WEST) && state.getValue(ACTIVE) == false){ i = 1; return i; } - if( (state.getValue(FACING) == EnumFacing.SOUTH)){ + if( (state.getValue(FACING) == EnumFacing.SOUTH) && state.getValue(ACTIVE) == false){ i = 2; return i; } - if( (state.getValue(FACING) == EnumFacing.NORTH)){ + if( (state.getValue(FACING) == EnumFacing.NORTH) && state.getValue(ACTIVE) == false){ i = 3; return i; } + if( (state.getValue(FACING) == EnumFacing.EAST) && state.getValue(ACTIVE) == true){ + i = 4; + return i; + } + if( (state.getValue(FACING) == EnumFacing.WEST) && state.getValue(ACTIVE) == true){ + i = 5; + return i; + } + if( (state.getValue(FACING) == EnumFacing.SOUTH) && state.getValue(ACTIVE) == true){ + i = 6; + return i; + } + if( (state.getValue(FACING) == EnumFacing.NORTH) && state.getValue(ACTIVE) == true){ + i = 7; + return i; + } return i; } @@ -232,33 +259,59 @@ public class PistonBellows extends CustomFacing { @Override public IBlockState getStateFromMeta(int meta) { EnumFacing enumfacing; + Boolean active; + + switch (meta & 7) { case 0: enumfacing = EnumFacing.EAST; + active = false; break; case 1: enumfacing = EnumFacing.WEST; + active = false; break; case 2: enumfacing = EnumFacing.SOUTH; + active = false; break; case 3: enumfacing = EnumFacing.NORTH; + active = false; + break; + case 4: + enumfacing = EnumFacing.EAST; + active = true; + break; + case 5: + enumfacing = EnumFacing.WEST; + active = true; + break; + case 6: + enumfacing = EnumFacing.SOUTH; + active = true; + break; + case 7: + enumfacing = EnumFacing.NORTH; + active = true; break; default: enumfacing = EnumFacing.NORTH; + active = false; } - return this.getDefaultState().withProperty(FACING, enumfacing); + return this.getDefaultState().withProperty(FACING, enumfacing).withProperty(ACTIVE, Boolean.valueOf(active)); } @Override protected BlockStateContainer createBlockState() { - return new BlockStateContainer(this, new IProperty[] {FACING}); + return new BlockStateContainer(this, new IProperty[] {FACING, ACTIVE}); } + //return new ExtendedBlockState(this, new IProperty[] { BotaniaStateProps.CARDINALS, Properties.StaticProperty }, new IUnlistedProperty[] { Properties.AnimationProperty }); + @Override public boolean isFullCube(IBlockState state) { @@ -290,5 +343,74 @@ public class PistonBellows extends CustomFacing { return EnumBlockRenderType.MODEL; } + public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) + { + if(state.getValue(PistonBellows.ACTIVE) == Boolean.TRUE) { + if (state.getValue(PistonBellows.FACING) == EnumFacing.NORTH) { + BlockPos tempPos = new BlockPos(pos.getX() + 1, pos.getY(), pos.getZ()); + if (world.getBlockState(tempPos).getBlock() == ModBlocks.firebox) { + TileFirebox tile = (TileFirebox) world.getTileEntity(tempPos); + if ((world.getBlockState(tempPos).getValue(Firebox.ACTIVE) == true) && (world.getBlockState(tempPos).getValue(Firebox.FACING) == EnumFacing.EAST)) { + makeEmbers(world, tempPos, world.rand); + } + } -} + } + if (state.getValue(PistonBellows.FACING) == EnumFacing.SOUTH) { + BlockPos tempPos = new BlockPos(pos.getX() - 1, pos.getY(), pos.getZ()); + if (world.getBlockState(tempPos).getBlock() == ModBlocks.firebox) { + TileFirebox tile = (TileFirebox) world.getTileEntity(tempPos); + if ((world.getBlockState(tempPos).getValue(Firebox.ACTIVE) == true) && (world.getBlockState(tempPos).getValue(Firebox.FACING) == EnumFacing.WEST)) { + makeEmbers(world, tempPos, world.rand); + } + } + + } + if (state.getValue(PistonBellows.FACING) == EnumFacing.EAST) { + BlockPos tempPos = new BlockPos(pos.getX(), pos.getY(), pos.getZ() + 1); + if (world.getBlockState(tempPos).getBlock() == ModBlocks.firebox) { + TileFirebox tile = (TileFirebox) world.getTileEntity(tempPos); + if ((world.getBlockState(tempPos).getValue(Firebox.ACTIVE) == true) && (world.getBlockState(tempPos).getValue(Firebox.FACING) == EnumFacing.SOUTH)) { + makeEmbers(world, tempPos, world.rand); + } + } + + } + if (state.getValue(PistonBellows.FACING) == EnumFacing.WEST) { + BlockPos tempPos = new BlockPos(pos.getX(), pos.getY(), pos.getZ() - 1); + if (world.getBlockState(tempPos).getBlock() == ModBlocks.firebox) { + TileFirebox tile = (TileFirebox) world.getTileEntity(tempPos); + if ((world.getBlockState(tempPos).getValue(Firebox.ACTIVE) == true) && (world.getBlockState(tempPos).getValue(Firebox.FACING) == EnumFacing.NORTH)) { + makeEmbers(world, tempPos, world.rand); + } + } + } + } + } + private void makeEmbers(World world, BlockPos pos, Random rand){ + double d0 = (double)pos.getX() + 0.5D; + double d1 = (double)pos.getY() + 0.65D; + double d2 = (double)pos.getZ() + 0.5D; + double d3 = 0.52D; + double d4 = rand.nextDouble() * 0.6D - 0.3D; + + if(rand.nextInt(3) == 0){ + world.spawnParticle(EnumParticleTypes.FLAME, d0+d4, d1, d2+d4, 0.0D, 0.1D, 0.0D, new int[0]); + world.spawnParticle(EnumParticleTypes.FLAME, d0+d4, d1, d2+d4, 0.0D, 0.1D, 0.0D, new int[0]); + } + if(rand.nextInt(3) == 1){ + world.spawnParticle(EnumParticleTypes.FLAME, d0+d4, d1, d2-d4, 0.0D, 0.1D, 0.0D, new int[0]); + world.spawnParticle(EnumParticleTypes.FLAME, d0+d4, d1, d2+d4, 0.0D, 0.1D, 0.0D, new int[0]); + } + if(rand.nextInt(3) == 2){ + world.spawnParticle(EnumParticleTypes.FLAME, d0-d4, d1, d2+d4, 0.0D, 0.1D, 0.0D, new int[0]); + world.spawnParticle(EnumParticleTypes.FLAME, d0+d4, d1, d2+d4, 0.0D, 0.1D, 0.0D, new int[0]); + } + if(rand.nextInt(3) == 3){ + world.spawnParticle(EnumParticleTypes.FLAME, d0-d4, d1, d2-d4, 0.0D, 0.1D, 0.0D, new int[0]); + world.spawnParticle(EnumParticleTypes.FLAME, d0+d4, d1, d2+d4, 0.0D, 0.1D, 0.0D, new int[0]); + } + } + + +} \ No newline at end of file diff --git a/1.11/src/main/java/nmd/primal/forgecraft/init/ModItems.java b/1.11/src/main/java/nmd/primal/forgecraft/init/ModItems.java index 626821dd..aacb5982 100644 --- a/1.11/src/main/java/nmd/primal/forgecraft/init/ModItems.java +++ b/1.11/src/main/java/nmd/primal/forgecraft/init/ModItems.java @@ -4,6 +4,7 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.item.Item; import net.minecraftforge.fml.common.registry.GameRegistry; +import nmd.primal.forgecraft.items.ItemBellowsHandle; import nmd.primal.forgecraft.items.ItemTest; /** @@ -11,23 +12,21 @@ import nmd.primal.forgecraft.items.ItemTest; */ public class ModItems { + public static Item pistonbellows; public static Item test; - //public static Item cheese; public static void init() { - + pistonbellows = new ItemBellowsHandle(); //test = new ItemTest(); - //cheese = new ItemCheese(); } public static void register() { - + GameRegistry.register(pistonbellows); //GameRegistry.register(test); - //GameRegistry.register(cheese); } public static void registerRenders() { - //registerRender(cheese); + registerRender(pistonbellows); //registerRender(test); } diff --git a/1.11/src/main/java/nmd/primal/forgecraft/init/ModTiles.java b/1.11/src/main/java/nmd/primal/forgecraft/init/ModTiles.java index d1d27a31..6827c133 100644 --- a/1.11/src/main/java/nmd/primal/forgecraft/init/ModTiles.java +++ b/1.11/src/main/java/nmd/primal/forgecraft/init/ModTiles.java @@ -4,6 +4,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityNote; import net.minecraftforge.fml.common.registry.GameRegistry; import nmd.primal.forgecraft.tiles.TileFirebox; +import nmd.primal.forgecraft.tiles.TilePistonBellows; /** * Created by kitsu on 12/2/2016. @@ -12,10 +13,8 @@ public class ModTiles { public static void registerTileEntities () { registerTileEntity(TileFirebox.class, "firebox"); + registerTileEntity(TilePistonBellows.class, "pistonbellows"); } - //public static void registerTileEntities () { - // registerTileEntity(TilePistonBellows.class, "pistonbellows"); - //} private static void registerTileEntity(Class tile_class, String baseName) { GameRegistry.registerTileEntity(tile_class, "tile.forgecraft." + baseName); diff --git a/1.11/src/main/java/nmd/primal/forgecraft/items/ItemBellowsHandle.java b/1.11/src/main/java/nmd/primal/forgecraft/items/ItemBellowsHandle.java new file mode 100644 index 00000000..c884fe0c --- /dev/null +++ b/1.11/src/main/java/nmd/primal/forgecraft/items/ItemBellowsHandle.java @@ -0,0 +1,15 @@ +package nmd.primal.forgecraft.items; + +import nmd.primal.forgecraft.ModInfo; + +/** + * Created by mminaie on 1/7/17. + */ +public class ItemBellowsHandle extends BaseItem { + + public ItemBellowsHandle() { + setUnlocalizedName(ModInfo.ForgecraftItems.BELLOWSHANDLE.getUnlocalizedName()); + setRegistryName(ModInfo.ForgecraftItems.BELLOWSHANDLE.getRegistryName()); + } + +} diff --git a/1.11/src/main/java/nmd/primal/forgecraft/items/ItemTest.java b/1.11/src/main/java/nmd/primal/forgecraft/items/ItemTest.java index b54c2edf..0d793ed6 100644 --- a/1.11/src/main/java/nmd/primal/forgecraft/items/ItemTest.java +++ b/1.11/src/main/java/nmd/primal/forgecraft/items/ItemTest.java @@ -13,7 +13,6 @@ public class ItemTest extends BaseItem { public ItemTest() { setUnlocalizedName(ModInfo.ForgecraftItems.TEST.getUnlocalizedName()); setRegistryName(ModInfo.ForgecraftItems.TEST.getRegistryName()); - } } diff --git a/1.11/src/main/java/nmd/primal/forgecraft/proxy/ClientProxy.java b/1.11/src/main/java/nmd/primal/forgecraft/proxy/ClientProxy.java index 2ec41838..d327ecb4 100644 --- a/1.11/src/main/java/nmd/primal/forgecraft/proxy/ClientProxy.java +++ b/1.11/src/main/java/nmd/primal/forgecraft/proxy/ClientProxy.java @@ -4,7 +4,9 @@ import net.minecraftforge.fml.client.registry.ClientRegistry; import nmd.primal.forgecraft.init.ModBlocks; import nmd.primal.forgecraft.init.ModItems; import nmd.primal.forgecraft.renders.TileFireboxRender; +import nmd.primal.forgecraft.renders.TilePistonBellowsRender; import nmd.primal.forgecraft.tiles.TileFirebox; +import nmd.primal.forgecraft.tiles.TilePistonBellows; import static nmd.primal.forgecraft.init.ModItems.*; @@ -25,6 +27,7 @@ public class ClientProxy implements CommonProxy { public void registerTileRendering() { ClientRegistry.bindTileEntitySpecialRenderer(TileFirebox.class, new TileFireboxRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TilePistonBellows.class, new TilePistonBellowsRender()); } diff --git a/1.11/src/main/java/nmd/primal/forgecraft/renders/TileFireboxRender.java b/1.11/src/main/java/nmd/primal/forgecraft/renders/TileFireboxRender.java index 67f2e6a1..dae306ba 100644 --- a/1.11/src/main/java/nmd/primal/forgecraft/renders/TileFireboxRender.java +++ b/1.11/src/main/java/nmd/primal/forgecraft/renders/TileFireboxRender.java @@ -34,7 +34,6 @@ import scala.collection.parallel.ParIterableLike; public class TileFireboxRender extends TileEntitySpecialRenderer { private RenderItem renderItem = Minecraft.getMinecraft().getRenderItem(); - //private EntityItem entItem = null; @Override public void renderTileEntityAt(TileFirebox tile, double x, double y, double z, float partialTicks, int destroyStage) diff --git a/1.11/src/main/java/nmd/primal/forgecraft/renders/TilePistonBellowsRender.java b/1.11/src/main/java/nmd/primal/forgecraft/renders/TilePistonBellowsRender.java new file mode 100644 index 00000000..41faf2ab --- /dev/null +++ b/1.11/src/main/java/nmd/primal/forgecraft/renders/TilePistonBellowsRender.java @@ -0,0 +1,89 @@ +package nmd.primal.forgecraft.renders; + +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderItem; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; +import nmd.primal.forgecraft.blocks.PistonBellows; +import nmd.primal.forgecraft.init.ModItems; +import nmd.primal.forgecraft.tiles.TileFirebox; +import nmd.primal.forgecraft.tiles.TilePistonBellows; +import org.lwjgl.Sys; +import org.lwjgl.opengl.GL11; + +/** + * Created by mminaie on 1/7/17. + */ +public class TilePistonBellowsRender extends TileEntitySpecialRenderer { + + private RenderItem renderItem = Minecraft.getMinecraft().getRenderItem(); + + @Override + public void renderTileEntityAt(TilePistonBellows tile, double x, double y, double z, float partialTicks, int destroyStage) + { + GL11.glPushMatrix(); + GL11.glTranslated(x + 0.5D, y + 0.5D, z + 0.5D); + + Minecraft.getMinecraft().getTextureManager().bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); + float prevLGTX = OpenGlHelper.lastBrightnessX; + float prevLGTY = OpenGlHelper.lastBrightnessY; + BlockPos pos = tile.getPos(); + IBlockState state = this.getWorld().getBlockState(pos); + int bright = tile.getWorld().getCombinedLight(pos.up(), 0); + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, bright % 65536, bright / 65536); + GL11.glPushMatrix(); + if(state.getValue(PistonBellows.FACING) == EnumFacing.NORTH){ + + GL11.glRotated(0, 0.0F, 1.0F, 0.0F); + if(state.getValue(PistonBellows.ACTIVE) == Boolean.TRUE){ + //System.out.println(tile.getAnimation()); + GL11.glTranslated(0.0D, 0, (double) tile.getAnimation()/80); + } + ItemStack stackToRender = new ItemStack(ModItems.pistonbellows, 1); + renderItem.renderItem(stackToRender, renderItem.getItemModelMesher().getItemModel(stackToRender)); + } + if(state.getValue(PistonBellows.FACING) == EnumFacing.SOUTH){ + //GL11.glPushMatrix(); + GL11.glRotated(180, 0.0F, 1.0F, 0.0F); + if(state.getValue(PistonBellows.ACTIVE) == Boolean.TRUE){ + //System.out.println(tile.getAnimation()); + GL11.glTranslated(0.0D, 0, (double) tile.getAnimation()/80); + } + ItemStack stackToRender = new ItemStack(ModItems.pistonbellows, 1); + renderItem.renderItem(stackToRender, renderItem.getItemModelMesher().getItemModel(stackToRender)); + //GL11.glPopMatrix(); + } + if(state.getValue(PistonBellows.FACING) == EnumFacing.EAST){ + //GL11.glPushMatrix(); + GL11.glRotated(270, 0.0F, 1.0F, 0.0F); + if(state.getValue(PistonBellows.ACTIVE) == Boolean.TRUE){ + System.out.println(tile.getAnimation()); + GL11.glTranslated(0.0D, 0, (double) tile.getAnimation()/80); + } + ItemStack stackToRender = new ItemStack(ModItems.pistonbellows, 1); + renderItem.renderItem(stackToRender, renderItem.getItemModelMesher().getItemModel(stackToRender)); + //GL11.glPopMatrix(); + } + if(state.getValue(PistonBellows.FACING) == EnumFacing.WEST){ + //GL11.glPushMatrix(); + GL11.glRotated(90, 0.0F, 1.0F, 0.0F); + if(state.getValue(PistonBellows.ACTIVE) == Boolean.TRUE){ + System.out.println(tile.getAnimation()); + GL11.glTranslated(0.0D, 0, (double) tile.getAnimation()/80); + } + ItemStack stackToRender = new ItemStack(ModItems.pistonbellows, 1); + renderItem.renderItem(stackToRender, renderItem.getItemModelMesher().getItemModel(stackToRender)); + //GL11.glPopMatrix(); + } + GL11.glPopMatrix(); + + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, prevLGTX, prevLGTY); + GL11.glPopMatrix(); + } +} \ No newline at end of file diff --git a/1.11/src/main/java/nmd/primal/forgecraft/tiles/TileFirebox.java b/1.11/src/main/java/nmd/primal/forgecraft/tiles/TileFirebox.java index 87a1038c..c4c902f6 100644 --- a/1.11/src/main/java/nmd/primal/forgecraft/tiles/TileFirebox.java +++ b/1.11/src/main/java/nmd/primal/forgecraft/tiles/TileFirebox.java @@ -52,7 +52,7 @@ public class TileFirebox extends TileBaseSlot implements ITickable { if(!world.isRemote){ World world = this.getWorld(); this.iteration ++; - if(this.iteration == 200 ) { + if(this.iteration == 300 ) { this.iteration = 0; IBlockState state = world.getBlockState(this.pos); BlockPos abovePos = new BlockPos(this.getPos().getX(), this.getPos().getY()+1, this.getPos().getZ()); diff --git a/1.11/src/main/java/nmd/primal/forgecraft/tiles/TilePistonBellows.java b/1.11/src/main/java/nmd/primal/forgecraft/tiles/TilePistonBellows.java index 1aefdb5b..3089a2a9 100644 --- a/1.11/src/main/java/nmd/primal/forgecraft/tiles/TilePistonBellows.java +++ b/1.11/src/main/java/nmd/primal/forgecraft/tiles/TilePistonBellows.java @@ -1,8 +1,14 @@ package nmd.primal.forgecraft.tiles; import com.google.common.collect.ImmutableMap; +import net.minecraft.block.state.IBlockState; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumFacing; +import net.minecraft.util.ITickable; +import net.minecraft.util.NonNullList; import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; import net.minecraftforge.client.model.ModelLoaderRegistry; import net.minecraftforge.common.animation.TimeValues; import net.minecraftforge.common.capabilities.Capability; @@ -10,51 +16,74 @@ import net.minecraftforge.common.model.animation.CapabilityAnimation; import net.minecraftforge.common.model.animation.IAnimationStateMachine; import net.minecraftforge.fml.common.FMLCommonHandler; import net.minecraftforge.fml.relauncher.Side; +import nmd.primal.forgecraft.blocks.Firebox; +import nmd.primal.forgecraft.blocks.PistonBellows; import javax.annotation.Nonnull; /** * Created by mminaie on 1/5/17. */ -public class TilePistonBellows extends BaseTile { - private static final String TAG_ACTIVE = "active"; - public float innerRingPos; - public boolean active = false; - public boolean hasCart = false; - public boolean hasCartOnTop = false; - public float moving = 0F; +public class TilePistonBellows extends BaseTile implements ITickable{ - public int comparator; - public boolean hasRedstone = false; - private int lastComparator = 0; + private int iteration = 0; + private int animateIteration = 0; - private final TimeValues.VariableValue move; - private final IAnimationStateMachine asm; + @Override + public void update () { + if (!world.isRemote) { + World world = this.getWorld(); + IBlockState state = world.getBlockState(this.pos); + if (world.getBlockState(this.getPos()).getValue(PistonBellows.ACTIVE)) { + iteration++; + if(iteration <= 35){ + animateIteration++; + // + } + if(iteration > 35){ + animateIteration = 35 - (iteration - 35); + if(animateIteration < 0){ + animateIteration = 0; + } + // + } + if(iteration > 71){ + iteration = 0; + animateIteration = 0; + world.setBlockState(this.getPos(), state.withProperty(PistonBellows.ACTIVE, false), 3); + } - public TilePistonBellows() { - if (FMLCommonHandler.instance().getSide() == Side.CLIENT) { - move = new TimeValues.VariableValue(0); - asm = ModelLoaderRegistry.loadASM(new ResourceLocation("botania", "asms/block/pump.json"), ImmutableMap.of("move", move)); - } else { - move = null; - asm = null; + //System.out.println("Iterating"); + + this.updateBlock(); + this.markDirty(); + } } } - @Override - public boolean hasCapability(@Nonnull Capability cap, @Nonnull EnumFacing side) { - return cap == CapabilityAnimation.ANIMATION_CAPABILITY || super.hasCapability(cap, side); + public int getIteration(){ + return this.iteration; + } + public int getAnimation(){ + return this.animateIteration; } - @Nonnull - @Override - public T getCapability(@Nonnull Capability cap, @Nonnull EnumFacing side) { - if (cap == CapabilityAnimation.ANIMATION_CAPABILITY) { - return CapabilityAnimation.ANIMATION_CAPABILITY.cast(asm); - } - return super.getCapability(cap, side); + + public NBTTagCompound readNBT(NBTTagCompound nbt) + { + super.readNBT(nbt); + this.iteration = nbt.getInteger("iteration"); + this.animateIteration = nbt.getInteger("animate"); + return nbt; + } + + public NBTTagCompound writeNBT(NBTTagCompound nbt) + { + nbt.setInteger("iteration", this.iteration); + nbt.setInteger("animate", this.animateIteration); + return nbt; } } diff --git a/1.11/src/main/resources/assets/.DS_Store b/1.11/src/main/resources/assets/.DS_Store index 6aacf02d78fd5ce9bcf7ff84474f7e06ca1bb1b0..83d2160bc999c531fca8cf717d9c5eeeb237fa9c 100644 GIT binary patch literal 8196 zcmeHMU2GIp6h7b5!p!i~TjZy71vYIes72b^mLNZFe-Nt>8d_*ekutk8z{qr_?#y<9 zQmy(z4C)gqL|-&9G5CaH;*&AHh`))}h#DSzFebkFWPJ17xw8$F_7zN+o6P<0z2}^{ z_kQ==nLWEigwCSXOjJWe8ebB{Vy@;W(k`#tN-7?yWCX_(*_5XOnRJZ8+q{#3gn@*C zgn@*Cgn@*C{{sX3&Xz@+=e@72Nu4l|FmO*YAfFEzz9eR2oKhG)I=G5b0LBU)jtaLq z4~SwiF=k_&QW%BuJyrIAI23V;0Ts^njC5zr#yF)=g%eabA)Xm=hJt8zj>|;ugsj4( zP8diSxSau+yBnOZ`<%BQzd3);m4dOH>*v^hEjQ*mLDd*9@ z@JoH685V<1voIX>9Lvtd?S9{PXWC}&pktRt#ELH83r)wf3pcqR9&kL%FLnAw&kCaZ z^qS!bj*TW75j7JNt!-_MnMb#_Og3gFwl=pnX4;zCCMR`mbwl%xo};6u&rF=1eEy=^ zAL3^ORn6M(rTI2%1$j5e%awt1vf&2fU5bs=n`Jhx&#+-EPWL=z>=|_OzSrlRu}4Hz zz|{0`x3^%A^Tr4AzFQpif)P=jH{E>EHAB0@b)|DK7}}>o**X;Xg|I7f91)@z*!ykv zbH?p%_U6##@=p84LdW-lgLWZctj{*7J?fX2tXy07z{5>#k3HT!y>wZXFqRuD2F9Jh z$+`A{l4FG@hRh&udzRxJKg7r6h0Za@F6h+=^nTAAwWr0Z)irBs)9KmX<+}_PbIx-` zCp<0cHEmift6I8lecCu|@#^;amb{xKu4;N@sb8N?4@*l|!RFeE12$|-8~p+ARhY43 z<0ixCKgs7W0$qhRw;1UIu9>r4Vd-j~_AN$wU|elkJRJ{i+is)>^Zw{4ZzZTkV?3Pg zNT-j;nfI7MxNpq%cvWA@>3Mg%cvVBv)?rz4O&R_w)n(NZ09i`jh^qf0053DzOk%xF74V9vM7{Hnd|4ve<>) zcoIF>j{ywf5QbslS-2R5hZ0`Ei+Bky<2)|lEnLJUyoW3J7+3KLKEpM9g|G1qe!{Q# zO|3Ik*7jc2FW0!it@)%Ie~?p0=8|sh6T6M>yDHsZmPox;FTZca%60V{H??fp-Z68o zvrh76NkuwRLWu-a7D#lIx2SSj3ENm(R`P6xA7K62r!*-du}FDmYU?!CjnGuLp>~7D z;ufi>YdloTo~9-iDC=gUS!1z^N@Z;|+I5z*s8H6e#x{*rD;7?#SzWVg$4K504losx;uHU z`JT=)*Us>DlrLGN-;}~AgsUhWXN=Nu#+g41xt(EG8Iz51N+FMMx#K?s%=LXZdH*AM L|3`AXXR7}IplF>H?K HnZXPIFMAZM diff --git a/1.11/src/main/resources/assets/forgecraft/armatures/block/pump_head.json b/1.11/src/main/resources/assets/forgecraft/armatures/block/pump_head.json new file mode 100644 index 00000000..b3c9aba6 --- /dev/null +++ b/1.11/src/main/resources/assets/forgecraft/armatures/block/pump_head.json @@ -0,0 +1,24 @@ +{ + "joints": { + "head": { "0": [ 1.0 ], "1": [ 1.0 ], "2": [ 1.0 ], "3": [ 1.0 ] } + }, + "clips": { + "default": { + "loop": false, + "joint_clips": {}, + "events": {} + }, + "moving": { + "loop": false, + "joint_clips": { + "head": [{ + "variable": "offset_z", + "type": "uniform", + "interpolation": "linear", + "samples": [ 0, 0.5, 0 ] + }] + }, + "events": {} + } + } +} \ No newline at end of file diff --git a/1.11/src/main/resources/assets/forgecraft/asms/block/pump.json b/1.11/src/main/resources/assets/forgecraft/asms/block/pump.json new file mode 100644 index 00000000..13a18d67 --- /dev/null +++ b/1.11/src/main/resources/assets/forgecraft/asms/block/pump.json @@ -0,0 +1,13 @@ +{ + "parameters": {}, + "clips": { + "default": "forgecraft:block/pump_head@default", + "moving": [ "apply", "forgecraft:block/pump_head@moving", "#move" ] + }, + "states": [ "default", "moving" ], + "transitions": { + "default": "moving", + "moving": "default" + }, + "start_state": "default" +} \ No newline at end of file diff --git a/1.11/src/main/resources/assets/forgecraft/blockstates/pistonbellows.json b/1.11/src/main/resources/assets/forgecraft/blockstates/pistonbellows.json index 7be0cca5..343d3aef 100644 --- a/1.11/src/main/resources/assets/forgecraft/blockstates/pistonbellows.json +++ b/1.11/src/main/resources/assets/forgecraft/blockstates/pistonbellows.json @@ -1,8 +1,12 @@ { "variants": { - "facing=north": { "model": "forgecraft:pistonbellows" }, - "facing=east": { "model": "forgecraft:pistonbellows", "y": 90 }, - "facing=south": { "model": "forgecraft:pistonbellows", "y": 180 }, - "facing=west": { "model": "forgecraft:pistonbellows", "y": 270 } + "active=false,facing=north": { "model": "forgecraft:pistonbellows" }, + "active=true,facing=north": { "model": "forgecraft:pistonbellows" }, + "active=false,facing=east": { "model": "forgecraft:pistonbellows", "y": 90 }, + "active=true,facing=east": { "model": "forgecraft:pistonbellows", "y": 90 }, + "active=false,facing=south": { "model": "forgecraft:pistonbellows", "y": 180 }, + "active=true,facing=south": { "model": "forgecraft:pistonbellows", "y": 180 }, + "active=false,facing=west": { "model": "forgecraft:pistonbellows", "y": 270 }, + "active=true,facing=west": { "model": "forgecraft:pistonbellows", "y": 270 } } } \ No newline at end of file diff --git a/1.11/src/main/resources/assets/forgecraft/models/block/firebox.json b/1.11/src/main/resources/assets/forgecraft/models/block/firebox.json index 724acc00..63396bc9 100644 --- a/1.11/src/main/resources/assets/forgecraft/models/block/firebox.json +++ b/1.11/src/main/resources/assets/forgecraft/models/block/firebox.json @@ -96,5 +96,19 @@ "east": { "uv": [ 0, 0, 0, 8 ], "texture": "#texture" } } } - ] + ], + "display": { + "thirdperson_righthand": { + "rotation": [ 60, 45, 0 ], + "scale": [ 0.5, 0.6, 0.5 ] + }, + "firstperson_righthand": { + "rotation": [ 0, 45, 0 ], + "scale": [ 0.7, 0.7, 0.7 ] + }, + "gui": { + "rotation": [ 45, 45, 0 ], + "scale": [ 0.6, 0.6, 0.6 ] + } + } } \ No newline at end of file diff --git a/1.11/src/main/resources/assets/forgecraft/models/block/pistonbellows.json b/1.11/src/main/resources/assets/forgecraft/models/block/pistonbellows.json index ec3c0b8a..5a850692 100644 --- a/1.11/src/main/resources/assets/forgecraft/models/block/pistonbellows.json +++ b/1.11/src/main/resources/assets/forgecraft/models/block/pistonbellows.json @@ -1,8 +1,8 @@ { "__comment": "Designed by Kitsushadow with Cubik Studio - https://cubik.studio", "textures": { - "particle": "forgecraft:blocks/checker_test", - "texture_test": "forgecraft:blocks/checker_test", + "particle": "blocks/checker_test", + "texture_test": "blocks/checker_test", "texture": "blocks/planks_oak" }, "elements": [ @@ -32,32 +32,6 @@ "east": { "uv": [ 15, 5, 16, 15 ], "texture": "#texture" } } }, - { - "__comment": "piston_arm", - "from": [ 7.5, 3, 2 ], - "to": [ 8.5, 4, 15 ], - "faces": { - "down": { "uv": [ 7.5, 1, 8.5, 14 ], "texture": "#texture" }, - "up": { "uv": [ 7.5, 2, 8.5, 15 ], "texture": "#texture" }, - "north": { "uv": [ 7.5, 12, 8.5, 13 ], "texture": "#texture" }, - "south": { "uv": [ 7.5, 12, 8.5, 13 ], "texture": "#texture" }, - "west": { "uv": [ 2, 12, 15, 13 ], "texture": "#texture" }, - "east": { "uv": [ 1, 12, 14, 13 ], "texture": "#texture" } - } - }, - { - "__comment": "piston_arm1", - "from": [ 7.5, 8, 2 ], - "to": [ 8.5, 9, 15 ], - "faces": { - "down": { "uv": [ 7.5, 1, 8.5, 14 ], "texture": "#texture" }, - "up": { "uv": [ 7.5, 2, 8.5, 15 ], "texture": "#texture" }, - "north": { "uv": [ 7.5, 11, 8.5, 12 ], "texture": "#texture" }, - "south": { "uv": [ 7.5, 11, 8.5, 12 ], "texture": "#texture" }, - "west": { "uv": [ 2, 11, 15, 12 ], "texture": "#texture" }, - "east": { "uv": [ 1, 11, 14, 12 ], "texture": "#texture" } - } - }, { "__comment": "wall", "from": [ 3, 3, 13 ], @@ -162,19 +136,6 @@ "east": { "uv": [ 2, 13, 3, 15 ], "texture": "#texture" } } }, - { - "__comment": "piston_arm2", - "from": [ 7.5, 2, 15 ], - "to": [ 8.5, 10, 16 ], - "faces": { - "down": { "uv": [ 7.5, 0, 8.5, 1 ], "texture": "#texture" }, - "up": { "uv": [ 7.5, 15, 8.5, 16 ], "texture": "#texture" }, - "north": { "uv": [ 7.5, 6, 8.5, 14 ], "texture": "#texture" }, - "south": { "uv": [ 7.5, 6, 8.5, 14 ], "texture": "#texture" }, - "west": { "uv": [ 15, 6, 16, 14 ], "texture": "#texture" }, - "east": { "uv": [ 0, 6, 1, 14 ], "texture": "#texture" } - } - }, { "__comment": "wall8", "from": [ 3, 1, 1 ], @@ -266,5 +227,19 @@ "east": { "uv": [ 4, 5, 5, 15 ], "texture": "#texture" } } } - ] + ], + "display": { + "thirdperson_righthand": { + "rotation": [ 60, 45, 0 ], + "scale": [ 0.5, 0.6, 0.5 ] + }, + "firstperson_righthand": { + "rotation": [ 0, 45, 0 ], + "scale": [ 0.7, 0.7, 0.7 ] + }, + "gui": { + "rotation": [ 45, 45, 0 ], + "scale": [ 0.6, 0.6, 0.6 ] + } + } } \ No newline at end of file diff --git a/1.11/src/main/resources/assets/forgecraft/models/item/bellowshandle.json b/1.11/src/main/resources/assets/forgecraft/models/item/bellowshandle.json new file mode 100644 index 00000000..35f63a8b --- /dev/null +++ b/1.11/src/main/resources/assets/forgecraft/models/item/bellowshandle.json @@ -0,0 +1,62 @@ +{ + "__comment": "Designed by Kitsushadow with Cubik Studio - https://cubik.studio", + "textures": { + "particle": "blocks/checker_test", + "texture_test": "blocks/checker_test", + "texture": "blocks/planks_oak" + }, + "elements": [ + { + "__comment": "piston_arm", + "from": [ 7.5, 3, 2 ], + "to": [ 8.5, 4, 15 ], + "faces": { + "down": { "uv": [ 7.5, 1, 8.5, 14 ], "texture": "#texture" }, + "up": { "uv": [ 7.5, 2, 8.5, 15 ], "texture": "#texture" }, + "north": { "uv": [ 7.5, 12, 8.5, 13 ], "texture": "#texture" }, + "south": { "uv": [ 7.5, 12, 8.5, 13 ], "texture": "#texture" }, + "west": { "uv": [ 2, 12, 15, 13 ], "texture": "#texture" }, + "east": { "uv": [ 1, 12, 14, 13 ], "texture": "#texture" } + } + }, + { + "__comment": "piston_arm1", + "from": [ 7.5, 8, 2 ], + "to": [ 8.5, 9, 15 ], + "faces": { + "down": { "uv": [ 7.5, 1, 8.5, 14 ], "texture": "#texture" }, + "up": { "uv": [ 7.5, 2, 8.5, 15 ], "texture": "#texture" }, + "north": { "uv": [ 7.5, 11, 8.5, 12 ], "texture": "#texture" }, + "south": { "uv": [ 7.5, 11, 8.5, 12 ], "texture": "#texture" }, + "west": { "uv": [ 2, 11, 15, 12 ], "texture": "#texture" }, + "east": { "uv": [ 1, 11, 14, 12 ], "texture": "#texture" } + } + }, + { + "__comment": "piston_arm2", + "from": [ 7.5, 2, 15 ], + "to": [ 8.5, 10, 16 ], + "faces": { + "down": { "uv": [ 7.5, 0, 8.5, 1 ], "texture": "#texture" }, + "up": { "uv": [ 7.5, 15, 8.5, 16 ], "texture": "#texture" }, + "north": { "uv": [ 7.5, 6, 8.5, 14 ], "texture": "#texture" }, + "south": { "uv": [ 7.5, 6, 8.5, 14 ], "texture": "#texture" }, + "west": { "uv": [ 15, 6, 16, 14 ], "texture": "#texture" }, + "east": { "uv": [ 0, 6, 1, 14 ], "texture": "#texture" } + } + } + ], + "display": { + "thirdperson_righthand": { + "translation": [ 0, 0, -6.9 ] + }, + "gui": { + "rotation": [ 90, 0, -90 ], + "translation": [ 2, 1, 0 ] + }, + "fixed": { + "rotation": [ 90, 0, -90 ], + "translation": [ 2, 1, 0 ] + } + } +} \ No newline at end of file diff --git a/1.11/src/main/resources/assets/forgecraft/models/item/firebox.json b/1.11/src/main/resources/assets/forgecraft/models/item/firebox.json index 74839124..97bffee3 100644 --- a/1.11/src/main/resources/assets/forgecraft/models/item/firebox.json +++ b/1.11/src/main/resources/assets/forgecraft/models/item/firebox.json @@ -4,41 +4,5 @@ "particle": "forgecraft:blocks/brick", "texture": "forgecraft:blocks/brick" }, - "parent": "forgecraft:block/firebox", - "display": { - "thirdperson_": { - "rotation": [ - 0, - 0, - 0 - ], - "translation": [ - 0, - 0, - 0 - ], - "scale": [ - 0.1, - 0.1, - 0.1 - ] - }, - "firstperson": { - "rotation": [ - 0, - 0, - 0 - ], - "translation": [ - 0, - 0, - 0 - ], - "scale": [ - 0.1, - 0.1, - 0.1 - ] - } - } + "parent": "forgecraft:block/firebox" } \ No newline at end of file diff --git a/1.11/src/main/resources/assets/forgecraft/models/item/pistonbellows.json b/1.11/src/main/resources/assets/forgecraft/models/item/pistonbellows.json new file mode 100644 index 00000000..2ad79739 --- /dev/null +++ b/1.11/src/main/resources/assets/forgecraft/models/item/pistonbellows.json @@ -0,0 +1,9 @@ +{ + "forge_marker":1, + "textures": { + "particle": "blocks/checker_test", + "texture_test": "blocks/checker_test", + "texture": "blocks/planks_oak" + }, + "parent": "forgecraft:block/pistonbellows" +} \ No newline at end of file