From 588b5d91cc117476cbd8fec258b64971c9bc3c5d Mon Sep 17 00:00:00 2001 From: elix-x Date: Sat, 20 Aug 2016 14:38:46 +0200 Subject: [PATCH] Reimplented connected textures with jsons - Reimplented connected glass textures using jsons. @shartte can't be done with jsons, huh? --- .../decorative/solid/BlockQuartzGlass.java | 42 +++++++++++++----- .../blockstates/quartz_glass.json | 34 +++++++++++--- .../models/block/quartz_glass.json | 6 --- .../models/block/quartz_glass_1.json | 6 +++ .../models/block/quartz_glass_2.json | 6 +++ .../models/block/quartz_glass_3.json | 6 +++ .../models/block/quartz_glass_4.json | 6 +++ .../models/block/quartz_glass_frame.json | 18 ++++++++ .../models/item/quartz_glass.json | 2 +- .../textures/blocks/quartz_glass.png | Bin 0 -> 3122 bytes .../textures/blocks/quartz_glass.png.mcmeta | 5 +++ .../textures/blocks/quartz_glass_1.png | Bin 0 -> 232 bytes .../textures/blocks/quartz_glass_2.png | Bin 0 -> 230 bytes .../textures/blocks/quartz_glass_3.png | Bin 0 -> 244 bytes .../textures/blocks/quartz_glass_4.png | Bin 0 -> 243 bytes .../textures/blocks/quartz_glass_frame.png | Bin 0 -> 247 bytes 16 files changed, 107 insertions(+), 24 deletions(-) delete mode 100644 src/main/resources/assets/appliedenergistics2/models/block/quartz_glass.json create mode 100644 src/main/resources/assets/appliedenergistics2/models/block/quartz_glass_1.json create mode 100644 src/main/resources/assets/appliedenergistics2/models/block/quartz_glass_2.json create mode 100644 src/main/resources/assets/appliedenergistics2/models/block/quartz_glass_3.json create mode 100644 src/main/resources/assets/appliedenergistics2/models/block/quartz_glass_4.json create mode 100644 src/main/resources/assets/appliedenergistics2/models/block/quartz_glass_frame.json create mode 100644 src/main/resources/assets/appliedenergistics2/textures/blocks/quartz_glass.png create mode 100644 src/main/resources/assets/appliedenergistics2/textures/blocks/quartz_glass.png.mcmeta create mode 100644 src/main/resources/assets/appliedenergistics2/textures/blocks/quartz_glass_1.png create mode 100644 src/main/resources/assets/appliedenergistics2/textures/blocks/quartz_glass_2.png create mode 100644 src/main/resources/assets/appliedenergistics2/textures/blocks/quartz_glass_3.png create mode 100644 src/main/resources/assets/appliedenergistics2/textures/blocks/quartz_glass_4.png create mode 100644 src/main/resources/assets/appliedenergistics2/textures/blocks/quartz_glass_frame.png diff --git a/src/main/java/appeng/decorative/solid/BlockQuartzGlass.java b/src/main/java/appeng/decorative/solid/BlockQuartzGlass.java index 2b315e834..bb3a47290 100644 --- a/src/main/java/appeng/decorative/solid/BlockQuartzGlass.java +++ b/src/main/java/appeng/decorative/solid/BlockQuartzGlass.java @@ -22,6 +22,8 @@ package appeng.decorative.solid; import java.util.EnumSet; import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyBool; import net.minecraft.block.state.IBlockState; import net.minecraft.util.BlockRenderLayer; import net.minecraft.util.EnumFacing; @@ -30,11 +32,18 @@ import net.minecraft.world.IBlockAccess; import appeng.block.AEBaseBlock; import appeng.core.features.AEFeature; -import appeng.helpers.AEGlassMaterial; public class BlockQuartzGlass extends AEBaseBlock { + + public static final PropertyBool[] props = { PropertyBool.create( "down" ), PropertyBool.create( "up" ), PropertyBool.create( "north" ), PropertyBool.create( "south" ), PropertyBool.create( "west" ), PropertyBool.create( "east" ) }; + + private static boolean isGlassBlock( IBlockAccess world, BlockPos pos, EnumFacing facing ) + { + return world.getBlockState( pos.offset( facing ) ).getBlock() instanceof BlockQuartzGlass; + } + public BlockQuartzGlass() { super( Material.GLASS ); @@ -43,9 +52,26 @@ public class BlockQuartzGlass extends AEBaseBlock this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) ); } - private static boolean isGlassBlock( IBlockAccess world, BlockPos pos, EnumFacing facing ) + @Override + protected IProperty[] getAEStates() { - return world.getBlockState( pos.offset( facing ) ).getBlock() instanceof BlockQuartzGlass; + return props; + } + + @Override + public int getMetaFromState( IBlockState state ) + { + return 0; + } + + @Override + public IBlockState getExtendedState( IBlockState state, IBlockAccess world, BlockPos pos ) + { + for( EnumFacing facing : EnumFacing.values() ) + { + state = state.withProperty( props[facing.ordinal()], isGlassBlock( world, pos, facing ) ); + } + return state; } @Override @@ -57,15 +83,7 @@ public class BlockQuartzGlass extends AEBaseBlock @Override public boolean shouldSideBeRendered( final IBlockState state, final IBlockAccess w, final BlockPos pos, final EnumFacing side ) { - final Material mat = w.getBlockState( pos ).getBlock().getMaterial( state ); - if( mat == Material.GLASS || mat == AEGlassMaterial.INSTANCE ) - { - if( w.getBlockState( pos ).getBlock().getRenderType( state ) == this.getRenderType( state ) ) - { - return false; - } - } - return super.shouldSideBeRendered( state, w, pos, side ); + return !isGlassBlock( w, pos, side ) && super.shouldSideBeRendered( state, w, pos, side ); } @Override diff --git a/src/main/resources/assets/appliedenergistics2/blockstates/quartz_glass.json b/src/main/resources/assets/appliedenergistics2/blockstates/quartz_glass.json index 57e34fa7e..a34ef0e1e 100644 --- a/src/main/resources/assets/appliedenergistics2/blockstates/quartz_glass.json +++ b/src/main/resources/assets/appliedenergistics2/blockstates/quartz_glass.json @@ -1,7 +1,31 @@ { - "variants": { - "normal": { - "model": "appliedenergistics2:quartz" + "multipart": [ + { + "apply": [{ "model": "appliedenergistics2:quartz_glass_1" }, { "model": "appliedenergistics2:quartz_glass_2" }, { "model": "appliedenergistics2:quartz_glass_3" }, { "model": "appliedenergistics2:quartz_glass_4" }] + }, + { + "when": { "down": "false" }, + "apply": { "model": "appliedenergistics2:quartz_glass_frame", "x": 90 } + }, + { + "when": { "up": "false" }, + "apply": { "model": "appliedenergistics2:quartz_glass_frame", "x": -90 } + }, + { + "when": { "north": "false" }, + "apply": { "model": "appliedenergistics2:quartz_glass_frame"} + }, + { + "when": { "south": "false" }, + "apply": { "model": "appliedenergistics2:quartz_glass_frame", "y": 180 } + }, + { + "when": { "west": "false" }, + "apply": { "model": "appliedenergistics2:quartz_glass_frame", "y": -90 } + }, + { + "when": { "east": "false" }, + "apply": { "model": "appliedenergistics2:quartz_glass_frame", "y": 90 } } - } -} \ No newline at end of file + ] +} diff --git a/src/main/resources/assets/appliedenergistics2/models/block/quartz_glass.json b/src/main/resources/assets/appliedenergistics2/models/block/quartz_glass.json deleted file mode 100644 index 594e770fd..000000000 --- a/src/main/resources/assets/appliedenergistics2/models/block/quartz_glass.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "appliedenergistics2:blocks/quartz_ore" - } -} \ No newline at end of file diff --git a/src/main/resources/assets/appliedenergistics2/models/block/quartz_glass_1.json b/src/main/resources/assets/appliedenergistics2/models/block/quartz_glass_1.json new file mode 100644 index 000000000..88c195a8a --- /dev/null +++ b/src/main/resources/assets/appliedenergistics2/models/block/quartz_glass_1.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "appliedenergistics2:blocks/quartz_glass_1" + } +} diff --git a/src/main/resources/assets/appliedenergistics2/models/block/quartz_glass_2.json b/src/main/resources/assets/appliedenergistics2/models/block/quartz_glass_2.json new file mode 100644 index 000000000..fde5e9940 --- /dev/null +++ b/src/main/resources/assets/appliedenergistics2/models/block/quartz_glass_2.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "appliedenergistics2:blocks/quartz_glass_2" + } +} diff --git a/src/main/resources/assets/appliedenergistics2/models/block/quartz_glass_3.json b/src/main/resources/assets/appliedenergistics2/models/block/quartz_glass_3.json new file mode 100644 index 000000000..e29a0c872 --- /dev/null +++ b/src/main/resources/assets/appliedenergistics2/models/block/quartz_glass_3.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "appliedenergistics2:blocks/quartz_glass_3" + } +} diff --git a/src/main/resources/assets/appliedenergistics2/models/block/quartz_glass_4.json b/src/main/resources/assets/appliedenergistics2/models/block/quartz_glass_4.json new file mode 100644 index 000000000..7d6895f68 --- /dev/null +++ b/src/main/resources/assets/appliedenergistics2/models/block/quartz_glass_4.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "appliedenergistics2:blocks/quartz_glass_4" + } +} diff --git a/src/main/resources/assets/appliedenergistics2/models/block/quartz_glass_frame.json b/src/main/resources/assets/appliedenergistics2/models/block/quartz_glass_frame.json new file mode 100644 index 000000000..594c4f379 --- /dev/null +++ b/src/main/resources/assets/appliedenergistics2/models/block/quartz_glass_frame.json @@ -0,0 +1,18 @@ +{ + "textures": { + "0": "appliedenergistics2:blocks/quartz_glass_frame" + }, + "elements": [ + { + "name": "Frame", + "from": [ 0.0, 0.0, 0.0 ], + "to": [ 16.0, 16.0, 1.0 ], + "faces": { + "east": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 16.0 ], "cullface": "east" }, + "west": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 16.0 ], "cullface": "west" }, + "up": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 1.0 ], "cullface": "up" }, + "down": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 1.0 ], "cullface": "down" } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/appliedenergistics2/models/item/quartz_glass.json b/src/main/resources/assets/appliedenergistics2/models/item/quartz_glass.json index cfe7da7de..ae7ee206b 100644 --- a/src/main/resources/assets/appliedenergistics2/models/item/quartz_glass.json +++ b/src/main/resources/assets/appliedenergistics2/models/item/quartz_glass.json @@ -1,6 +1,6 @@ { "parent": "block/cube_all", "textures": { - "all": "appliedenergistics2:items/quartz_glass" + "all": "appliedenergistics2:blocks/quartz_glass" } } \ No newline at end of file diff --git a/src/main/resources/assets/appliedenergistics2/textures/blocks/quartz_glass.png b/src/main/resources/assets/appliedenergistics2/textures/blocks/quartz_glass.png new file mode 100644 index 0000000000000000000000000000000000000000..334373ab218369827c49120aa43ac8361ccadff6 GIT binary patch literal 3122 zcmeAS@N?(olHy`uVBq!ia0y~yU=UznU~u4IV_;wquKhlZfq{Xuz$3Dlfr0N32s4Um zcr`FEaQSCCI|l@0&Ql|}l*f)3`szJ?yrKpmbgt{d!66c_b1 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y=rq^*cH#dYAthyNlOe-K+ZJep{Y@j)_fVrPt?>lbN?( zHeH^a{^@+r+^KVG>-2u!Nw~deTlMqgbN93O^WX0hD0z6v^?&zs>pj-zVm|FC`LyZw zQ{nI(;j`9T#pk{%d1do&@@40-a6iNzT1A)KKkFC8}IMb zXB{YC@cH5$_wQ`2&FBA3{Myg&%-TP*|8yH~+v|B2c9xcp?2G=s{IlHoe9C#XdE);T z{X4x*Tui_2$JN)@&t05xapCk&(u(=BbWCpF$qHk`xG!P9-yST# zQ!e{{@qK>(Cp8N78viqXZu}a2VfpXLl9MO@XJMZ4`A@R3?rjDJ28CpgAYTTCDpdxC zhGqtapZ^&c8eTFmlo~KFyh>nTu$sZZAf7)d{-_%R17obGi(^Q|tvAyTdL41#Y5Skj zHRY(efFOTpz=nt(C3qNz^bnrr*r01tY7A$vQFuttuVPEbQ9v+u756n(!{QQ>X ztf{&saKcx9cb7@`?${TE-F$ywG7p0mliIVLY6@Bg_Pezi)3cs5x#x;(xVmVa?3Y-N z!2Qn52cI9>;NLN~J>#oqSiM<=E_W(}p#4V%SC)m*_w|DvJD6DRZ8Z{9))FXxsAC{f zvSI6rYCnO7b+2~)i<-cGQm^7!`U%d-?7^#e{B~GvG*K{q)EIvHql3^|!^#IwA2o7^ zDxLEcUzNK!Rq33s+!@cZ&jv2m0g=ZOm2uFr;|8IEGmG-<`CPtHFSW_49xGmrwL9)Gj$anK>`5_``!~E!wTutdt&I73;d< zey281GiYM2{W@OPS53#5yRJxA=C&$rZB-I&f9cQXkzs!%an*&KMUJ5-Z+^NW6{7vc g-@wQIz#EoA?b93HxFyeFU|?YIboFyt=akR{0G{norvLx| literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/appliedenergistics2/textures/blocks/quartz_glass_2.png b/src/main/resources/assets/appliedenergistics2/textures/blocks/quartz_glass_2.png new file mode 100644 index 0000000000000000000000000000000000000000..51ce1f7d62ccd2347881d701f6ada967bd3694d8 GIT binary patch literal 230 zcmeAS@N?(olHy`uVBq!ia0y~yU=RRd4mJh`2Kmqb6B!s7SkfJR9T^xl_H+M9WMyDr z;4JWnEM{QfI|#yzJ0@noWnf^CDshb{3C>R|DNig)We7;j%q!9Ja}7}_GuAWJGc}1Zsz>wtW;uvD#e|DlFUxNY9kx&2ce`HeIci_eX9)+qM;hbVRm8)u;rT!}!TX$ZQ zvKQIhSbF<-;X}4*kuf_O!(S+5E_84`=N-JjZb!W^YgT*QET*qb`#PDfIyGi3bl4iO epiboxgHMmmq}?Yn3mF&~7(8A5T-G@yGywpjrA<@- literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/appliedenergistics2/textures/blocks/quartz_glass_3.png b/src/main/resources/assets/appliedenergistics2/textures/blocks/quartz_glass_3.png new file mode 100644 index 0000000000000000000000000000000000000000..640b0beac5d31ba6f604d984df6b9d413417037d GIT binary patch literal 244 zcmeAS@N?(olHy`uVBq!ia0y~yU=RRd4mJh`2Kmqb6B!s7SkfJR9T^xl_H+M9WMyDr z;4JWnEM{QfI|#yzJ0@noWnf^CDshb{3C>R|DNig)We7;j%q!9Ja}7}_GuAWJGc}1Zsz);}n;uvD#-`nHJ)!@K$F^P^IBDX$iuVLUm{c5d|Lc5iGQo5y@UE%rB5HNy!$m`$3~ItH@kddCLAf<*)M$k tshwZU^xqbRvD*rhZyxJaepJDbb70Z^AMe*4U|?Wi@O1TaS?83{1OTfTSdst$ literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/appliedenergistics2/textures/blocks/quartz_glass_4.png b/src/main/resources/assets/appliedenergistics2/textures/blocks/quartz_glass_4.png new file mode 100644 index 0000000000000000000000000000000000000000..7844580746086a86b8901d0f3c8dc0a98a711481 GIT binary patch literal 243 zcmeAS@N?(olHy`uVBq!ia0y~yU=RRd4mJh`2Kmqb6B!s7SkfJR9T^xl_H+M9WMyDr z;4JWnEM{QfI|#yzJ0@noWnf^CDshb{3C>R|DNig)We7;j%q!9Ja}7}_GuAWJGc}1Zsz>x3h;uvD#zqb1z=K%vA=FR`hWEW|Fku+a;;zr+Yez978PplP`o#{-3{QIoI)LZLcIGrtfI$dQ;CP(A?<5U^L@kNPKS&^O-M= zYypp$HpFc(KEaZ(S7bNC8-63kqlpf(`T;oy8jdmDXkhGReZ{h9+NwA86M}UbB&KY1 vkT}Ms$&fg~hNt;RZ;9fop06SQnHf%0$4CVq)6QUEU|{fc^>bP0l+XkK2M|%8 literal 0 HcmV?d00001