From 7486815f7b34625fefe461177c17e6cbe19a4bbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Beno=C3=AEt?= Date: Sun, 19 Jun 2016 18:20:32 +0200 Subject: [PATCH] Alloy furnace - Appearance + No longer requires a support --- .../mmm/tech/base/TBAlloyFurnaceBlock.java | 51 ++++++++++--- .../tech/base/alloy_furnace/active.json | 8 ++ .../tech/base/alloy_furnace/inactive.json | 8 ++ .../models/block/tech/base/alloy_furnace.json | 72 ++++++++++++++++++ .../block/tech/base/alloy_furnace/active.json | 8 ++ .../tech/base/alloy_furnace/inactive.json | 8 ++ .../models/item/tech/base/alloy_furnace.json | 25 ++++++ .../tech/base/alloy_furnace/active/front.png | Bin 0 -> 642 bytes .../tech/base/alloy_furnace/active/top.png | Bin 0 -> 552 bytes .../blocks/tech/base/alloy_furnace/bottom.png | Bin 0 -> 577 bytes .../base/alloy_furnace/inactive/front.png | Bin 0 -> 646 bytes .../tech/base/alloy_furnace/inactive/top.png | Bin 0 -> 547 bytes .../blocks/tech/base/alloy_furnace/side.png | Bin 0 -> 625 bytes 13 files changed, 168 insertions(+), 12 deletions(-) create mode 100644 src/resources/assets/mmm/blockstates/tech/base/alloy_furnace/active.json create mode 100644 src/resources/assets/mmm/blockstates/tech/base/alloy_furnace/inactive.json create mode 100644 src/resources/assets/mmm/models/block/tech/base/alloy_furnace.json create mode 100644 src/resources/assets/mmm/models/block/tech/base/alloy_furnace/active.json create mode 100644 src/resources/assets/mmm/models/block/tech/base/alloy_furnace/inactive.json create mode 100644 src/resources/assets/mmm/models/item/tech/base/alloy_furnace.json create mode 100644 src/resources/assets/mmm/textures/blocks/tech/base/alloy_furnace/active/front.png create mode 100644 src/resources/assets/mmm/textures/blocks/tech/base/alloy_furnace/active/top.png create mode 100644 src/resources/assets/mmm/textures/blocks/tech/base/alloy_furnace/bottom.png create mode 100644 src/resources/assets/mmm/textures/blocks/tech/base/alloy_furnace/inactive/front.png create mode 100644 src/resources/assets/mmm/textures/blocks/tech/base/alloy_furnace/inactive/top.png create mode 100644 src/resources/assets/mmm/textures/blocks/tech/base/alloy_furnace/side.png diff --git a/src/java/mmm/tech/base/TBAlloyFurnaceBlock.java b/src/java/mmm/tech/base/TBAlloyFurnaceBlock.java index 2f3a342..ff1745f 100644 --- a/src/java/mmm/tech/base/TBAlloyFurnaceBlock.java +++ b/src/java/mmm/tech/base/TBAlloyFurnaceBlock.java @@ -1,11 +1,12 @@ package mmm.tech.base; +import java.util.List; import java.util.Random; import javax.annotation.Nullable; -import mmm.utils.I_USupportBlock; +import mmm.utils.UMaths; import mmm.utils.URegistry; import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; @@ -16,17 +17,21 @@ import net.minecraft.block.properties.PropertyDirection; import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.init.SoundEvents; import net.minecraft.item.Item; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.BlockRenderLayer; +import net.minecraft.util.EnumBlockRenderType; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.Mirror; import net.minecraft.util.Rotation; import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -36,6 +41,9 @@ import net.minecraftforge.fml.relauncher.SideOnly; public class TBAlloyFurnaceBlock extends BlockContainer { + private static final AxisAlignedBB AABB_BOTTOM = UMaths.makeBlockAABB( 0 , 0 , 0 , 16 , 10 , 16 ); + private static final AxisAlignedBB AABB_TOP = UMaths.makeBlockAABB( 4 , 10 , 4 , 12 , 16 , 12 ); + public static final PropertyDirection FACING = BlockHorizontal.FACING; public final boolean active; @@ -49,6 +57,9 @@ public class TBAlloyFurnaceBlock this.setResistance( 17.5f ); this.setHardness( 3.5f ); this.setHarvestLevel( "pickaxe" , 0 ); + this.lightOpacity = 0; + this.translucent = false; + this.fullBlock = false; URegistry.setIdentifiers( this , "tech" , "base" , "alloy_furnace" , active ? "active" : "inactive" ); } @@ -65,7 +76,7 @@ public class TBAlloyFurnaceBlock // ************************************************************************************************* - // RENDERING + // RENDERING AND COLLISIONS // ************************************************************************************************* @Override @@ -82,6 +93,13 @@ public class TBAlloyFurnaceBlock } + @Override + public EnumBlockRenderType getRenderType( final IBlockState state ) + { + return EnumBlockRenderType.MODEL; + } + + @Override @SideOnly( Side.CLIENT ) public BlockRenderLayer getBlockLayer( ) @@ -141,6 +159,22 @@ public class TBAlloyFurnaceBlock } + @Override + public AxisAlignedBB getBoundingBox( final IBlockState state , final IBlockAccess source , final BlockPos pos ) + { + return Block.FULL_BLOCK_AABB; + } + + + @Override + public void addCollisionBoxToList( final IBlockState state , final World worldIn , final BlockPos pos , + final AxisAlignedBB entityBox , final List< AxisAlignedBB > collidingBoxes , final Entity entityIn ) + { + Block.addCollisionBoxToList( pos , entityBox , collidingBoxes , TBAlloyFurnaceBlock.AABB_TOP ); + Block.addCollisionBoxToList( pos , entityBox , collidingBoxes , TBAlloyFurnaceBlock.AABB_BOTTOM ); + } + + // ************************************************************************************************* // ITEM // ************************************************************************************************* @@ -215,17 +249,10 @@ public class TBAlloyFurnaceBlock // ************************************************************************************************* @Override - public void neighborChanged( final IBlockState state , final World worldIn , final BlockPos pos , - final Block blockIn ) + public boolean isSideSolid( final IBlockState base_state , final IBlockAccess world , final BlockPos pos , + final EnumFacing side ) { - I_USupportBlock.dropIfUnsupported( state , worldIn , pos , this ); - } - - - @Override - public boolean canPlaceBlockAt( final World worldIn , final BlockPos pos ) - { - return super.canPlaceBlockAt( worldIn , pos ) && I_USupportBlock.check( worldIn , pos ); + return side == EnumFacing.DOWN; } } diff --git a/src/resources/assets/mmm/blockstates/tech/base/alloy_furnace/active.json b/src/resources/assets/mmm/blockstates/tech/base/alloy_furnace/active.json new file mode 100644 index 0000000..058068e --- /dev/null +++ b/src/resources/assets/mmm/blockstates/tech/base/alloy_furnace/active.json @@ -0,0 +1,8 @@ +{ + "variants": { + "facing=north": { "model": "mmm:tech/base/alloy_furnace/active" }, + "facing=east": { "model": "mmm:tech/base/alloy_furnace/active", "y": 90 }, + "facing=south": { "model": "mmm:tech/base/alloy_furnace/active", "y": 180 }, + "facing=west": { "model": "mmm:tech/base/alloy_furnace/active", "y": 270 } + } +} \ No newline at end of file diff --git a/src/resources/assets/mmm/blockstates/tech/base/alloy_furnace/inactive.json b/src/resources/assets/mmm/blockstates/tech/base/alloy_furnace/inactive.json new file mode 100644 index 0000000..85abbcb --- /dev/null +++ b/src/resources/assets/mmm/blockstates/tech/base/alloy_furnace/inactive.json @@ -0,0 +1,8 @@ +{ + "variants": { + "facing=north": { "model": "mmm:tech/base/alloy_furnace/inactive" }, + "facing=east": { "model": "mmm:tech/base/alloy_furnace/inactive", "y": 90 }, + "facing=south": { "model": "mmm:tech/base/alloy_furnace/inactive", "y": 180 }, + "facing=west": { "model": "mmm:tech/base/alloy_furnace/inactive", "y": 270 } + } +} \ No newline at end of file diff --git a/src/resources/assets/mmm/models/block/tech/base/alloy_furnace.json b/src/resources/assets/mmm/models/block/tech/base/alloy_furnace.json new file mode 100644 index 0000000..068395d --- /dev/null +++ b/src/resources/assets/mmm/models/block/tech/base/alloy_furnace.json @@ -0,0 +1,72 @@ +{ + "textures": + { + "side": "mmm:blocks/tech/base/alloy_furnace/side", + "bottom": "mmm:blocks/tech/base/alloy_furnace/bottom", + "particle": "minecraft:blocks/brick" + }, + + "elements": + [ + { + "from": [0, 0, 0] , + "to": [16, 10, 16] , + "faces": { + "down": { "texture": "#bottom", "cullface": "down" }, + "up": { "texture": "#top" }, + "north": { "texture": "#front", "cullface": "north" } , + "south": { "texture": "#side", "cullface": "south" } , + "east": { "texture": "#side", "cullface": "east" } , + "west": { "texture": "#side", "cullface": "west" } + } + } , + + { + "from": [4, 10, 4], + "to": [5, 16, 12], + "faces": { + "up": { "texture": "#top", "cullface": "up" }, + "north": { "texture": "#front" } , + "south": { "texture": "#side" } , + "east": { "texture": "#side" } , + "west": { "texture": "#side" } + } + } , + { + "from": [11, 10, 4], + "to": [12, 16, 12], + "faces": { + "up": { "texture": "#top", "cullface": "up" }, + "north": { "texture": "#front" } , + "south": { "texture": "#side" } , + "east": { "texture": "#side" } , + "west": { "texture": "#side" } + } + } , + { + "from": [5, 10, 4], + "to": [11, 16, 5], + "faces": { + "up": { "texture": "#top", "cullface": "up" }, + "north": { "texture": "#front" } , + "south": { "texture": "#side" } + } + } , + { + "from": [5, 10, 11], + "to": [11, 16, 12], + "faces": { + "up": { "texture": "#top", "cullface": "up" }, + "north": { "texture": "#front" } , + "south": { "texture": "#side" } + } + } , + { + "from": [5, 15, 5] , + "to": [11, 15, 11] , + "faces": { + "up": { "texture": "#top", "cullface": "up" } + } + } + ] +} \ No newline at end of file diff --git a/src/resources/assets/mmm/models/block/tech/base/alloy_furnace/active.json b/src/resources/assets/mmm/models/block/tech/base/alloy_furnace/active.json new file mode 100644 index 0000000..3661526 --- /dev/null +++ b/src/resources/assets/mmm/models/block/tech/base/alloy_furnace/active.json @@ -0,0 +1,8 @@ +{ + "parent": "mmm:block/tech/base/alloy_furnace", + "textures": + { + "top": "mmm:blocks/tech/base/alloy_furnace/active/top", + "front": "mmm:blocks/tech/base/alloy_furnace/active/front" + } +} \ No newline at end of file diff --git a/src/resources/assets/mmm/models/block/tech/base/alloy_furnace/inactive.json b/src/resources/assets/mmm/models/block/tech/base/alloy_furnace/inactive.json new file mode 100644 index 0000000..47a1e81 --- /dev/null +++ b/src/resources/assets/mmm/models/block/tech/base/alloy_furnace/inactive.json @@ -0,0 +1,8 @@ +{ + "parent": "mmm:block/tech/base/alloy_furnace", + "textures": + { + "top": "mmm:blocks/tech/base/alloy_furnace/inactive/top", + "front": "mmm:blocks/tech/base/alloy_furnace/inactive/front" + } +} \ No newline at end of file diff --git a/src/resources/assets/mmm/models/item/tech/base/alloy_furnace.json b/src/resources/assets/mmm/models/item/tech/base/alloy_furnace.json new file mode 100644 index 0000000..7b52340 --- /dev/null +++ b/src/resources/assets/mmm/models/item/tech/base/alloy_furnace.json @@ -0,0 +1,25 @@ +{ + "parent": "mmm:block/tech/base/alloy_furnace/inactive", + "display": { + "thirdperson_righthand": { + "rotation": [ 10, -45, 10 ], + "translation": [ 0, 1.5, -1.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "firstperson_righthand": { + "rotation": [ 10, -45, 10 ], + "translation": [ 0, 1.5, -1.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "ground": { + "rotation": [ 0, 0, 0 ], + "translation": [ 0, 1, 0 ], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "gui": { + "rotation": [ 30, 45, 0 ], + "translation": [ 0, 0, 0 ], + "scale": [ 0.5, 0.5, 0.5 ] + } + } +} \ No newline at end of file diff --git a/src/resources/assets/mmm/textures/blocks/tech/base/alloy_furnace/active/front.png b/src/resources/assets/mmm/textures/blocks/tech/base/alloy_furnace/active/front.png new file mode 100644 index 0000000000000000000000000000000000000000..73def24bf833365b213bdc24f5c4ec1b60a81535 GIT binary patch literal 642 zcmV-|0)737P)Nklnbo}y zGCJ)8o|&D=**RzJz1Cilq<_|rRt+4pW>v(bQO2kyW2#p~URt;KQ13j5?`L}=+9z&w z;@jvZz0U*Ss#eMm`$H77k8$))-MG65VR{~T9)MjbpdN9c9DIe*#Ubu5Be>5Uz&iC{ zQZKCs=qlH!N1bTKcVMOc=p~2>QP2oxoeJ=Ht#sfKz)Je?b?XI&Rax*~wYLi9&otRgtcyVat%Pq0FmG$HN$qmr zC8i|cA4$TZ^AHPZxnDfyCJhyLU$Us5crfCz&W$>nZ}%`rdBJ)tq$d|wm!IUgi$Y)n zgIq*RNKk0Uc8L4yhZYs#{Snb&c^)rQHdm;BS-h>%LYt<=?HfryOeGJA(Z}zC`1L-78Tq|WR4N1@A35>+ zQw&W~y+a}!B$`f_y166B5hofnxv{1$0oXun8nf^XR`E&%3o2Ymhxq^Kk~4+LsN;V5 cR=hL)zq6qUm7SSA?EnA(07*qoM6N<$f};E=#Q*>R literal 0 HcmV?d00001 diff --git a/src/resources/assets/mmm/textures/blocks/tech/base/alloy_furnace/active/top.png b/src/resources/assets/mmm/textures/blocks/tech/base/alloy_furnace/active/top.png new file mode 100644 index 0000000000000000000000000000000000000000..a2e8e74fad0abab475f7a854c216538392b0ab97 GIT binary patch literal 552 zcmV+@0@wYCP)X7Nr`kCZM<={heK* zq{(D6JLj93Z@w8Z(&}UVVrpv-p82b1-#a?~sQvTSXxy1CelebYU-?f17hg;|O}DV& zm6O3~e)@gCSJ|?6*X>Vlt(`YsX%oL&+Ppr>O}?qYN&en71m$_SJlqaWcLtx|UmkpL zLNqwHn6P%&iCi7!{JpeS*`m1!TIc)>zbG9gPGLXnpl4UQ#e|t(lbPk@pqg=tl0}qI zgA$dnN8f@a?1N^FH=0upqo=Q?Fd|}XG$=!eG|)34W{#N6LUY6)A;{NraYKm%V_^9Y z2hiBWY(=;TDt#et+UNDu3oW}sLeTgj6X1ROwKP0dDDd1N`p!E6aa4wV8Q^0D?iCLISZpHAMkQ zJsM!{0MfHDBO8MiXCaWU^KliG*pxg3TVtJ1eV6#uY7+ruh5Lq*>>yQIIt2XdV`X$! zU@&$k)hi~9TnwKlhLpFodhtRLSqmrj4oq2>b qoPV4C?+{QLt(YEzJ)$p;JhHzae}KJTQ|B8100001r;P)2)M5cF3f5JK<(;*z)@xNih3$Qag+ov^2nvQiSlx!+ei)t<@bp=G<>Rb72qe}C^m zyL|WY=526%aB%tdfcvi}ocA7%!44+o_VW=ho{d)(!*}{D^Mk?XCs&^QHa_!CJNjGk zU4I1s3Fvs_b!L8>B=qr{YKRTFr}x{X%q?tDTQjNf_)K;R&5c;u9J1OTH$awpi-$w z<9y%8Znwj9Iz_Ek6T(CyfzKFAYEdsYg`y2qiI)V`88IGBcm_u>{+;aZy0lAC6J4 zCd*)uG4_DKR4OG6q#`aCeXr^shzl2qV^qg+)r>rrKf9HzE4Pyh`OZ6_nR4l4DV9iK zLzJEOu9|JQ)?6;}>qRq%bkdp4jeJaj1TU`ramF`Y)>UVcNqxG^yS~PMlOV8mG(Xrm P00000NkvXXu0mjffaeL2 literal 0 HcmV?d00001 diff --git a/src/resources/assets/mmm/textures/blocks/tech/base/alloy_furnace/inactive/front.png b/src/resources/assets/mmm/textures/blocks/tech/base/alloy_furnace/inactive/front.png new file mode 100644 index 0000000000000000000000000000000000000000..7bb102b5420c76841fcb31345e0a5284e1261504 GIT binary patch literal 646 zcmV;10(t$3P)h78Do*fyOJrsX|n3#Bgi6R_0b2JeHQxgL<5ljr!)I<~$15t3@ z*MhGZ_3+-E1dvh!AjU`x9%CI^YcAioss7Yk_Nn=^ zM@ZK#03l#f#AF%e`Kx=hdjKgVVh9veIm z+ex~P6cff6VhAK6DJD`%7;VtbVU0!U#DhDx5?W!5MJa_f#xQ^Jgct&?c+iTb?HC;x zB0x&uy~ipj32g2(98W`qQ}4s^JkCgLR zSFhi&zA@qR#sq-1I7#`9ft(k7_`=;-4E4TBO-WUb7R7i2)1imLJZ_u zF?({Ktg6_Yek0E_N~_70;mgm4ysQ}xhs-wCS*lAi=N2(q=NJxZ`bN?EKqGrNU`6ot=Iw29Bq^iLbpRIs%oNKs*mmchZ&8gEI{CccR%a+w+C#tfh`1rcLw;=A=b zOiD>jC;P`fd)C^QwYM1P)uC}dcJw>n`qgo6T?2p6Ji9h)H&%lu#;=FV;J)YKi&3lY z6_)+&WO$SxAAjnUR-LUS=i@tj^Q~W8!EYB=uJ&@H?^<}6zx7N(dVXB&ZiGjhz0YeG zU)J3T8l0yl?5!mtmwUNjC+(M3DK5gsDUbev(o*6i4ki_h>_S^jSot@Sxt;8lGp;JT zhzJ#0A`|vAu<4TS!+M2(6ek@<%|J_GM8wdnk%ka7&<7>;#q(!#PoH2oJmDL;xT(Z} zF|goG51_G;)riny@c}ug00GcyFx6V!)G+EhzzVR9WPQPA}6=n~iTYgU_UrV}wBG7RDZu*}? lKxwpMdW`N7eR|}P{RYf{ScW(zFZuug002ovPDHLkV1lsJ`l|o{ literal 0 HcmV?d00001 diff --git a/src/resources/assets/mmm/textures/blocks/tech/base/alloy_furnace/side.png b/src/resources/assets/mmm/textures/blocks/tech/base/alloy_furnace/side.png new file mode 100644 index 0000000000000000000000000000000000000000..adf1298c0e7dc65e9fbeebeebf177b8b078e327a GIT binary patch literal 625 zcmV-%0*?KOP)