diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache index 8e657704f..91511dbdb 100644 --- a/src/generated/resources/.cache/cache +++ b/src/generated/resources/.cache/cache @@ -395,13 +395,13 @@ a033fbac3129bba9211c6c4a0e16c905643afa39 assets\create\models\block\andesite_cob 0ed983628e8868f77301bea1111570d3631f24fb assets\create\models\block\andesite_cobblestone_wall_side.json 9febbf6fb88e726a89573c3788bd8348ba805b6d assets\create\models\block\andesite_funnel.json b1d0bb538fc8285b7d3fd77a977d78a104b83b62 assets\create\models\block\andesite_pillar.json -cb644bda777d361ddf1255644641086d82df8480 assets\create\models\block\andesite_tunnel\cross.json -99e33c403e907dc3febdb6a0a8b183fe454c2448 assets\create\models\block\andesite_tunnel\fullshade.json -c1d4392677fe3871fd6948f29bdf427abc9910ed assets\create\models\block\andesite_tunnel\halfshade.json -8e5c47a028ec674048c208e380152bb4f817a406 assets\create\models\block\andesite_tunnel\straight.json -a814c9aaa2cd44c8035124cd8f87ea4ad368701e assets\create\models\block\andesite_tunnel\t_left.json -64f63d63b7682c4237bf04faf51f68b3d0122de9 assets\create\models\block\andesite_tunnel\t_right.json -b121b55494785695b03bf7971fb0cc77503d857f assets\create\models\block\andesite_tunnel\window.json +01ad35140f53b2c7d3c36ce148629351ab91412b assets\create\models\block\andesite_tunnel\cross.json +cdfd39b052f0f606abfd34d9330d536d7f0f1281 assets\create\models\block\andesite_tunnel\fullshade.json +4425b48e65cc855cee37abd6c7ec1356c703e87c assets\create\models\block\andesite_tunnel\halfshade.json +1ee32dacef1840d526579ac93560f85869053e6d assets\create\models\block\andesite_tunnel\straight.json +4cf6628da4d000ef84497781853f8df31ac91d93 assets\create\models\block\andesite_tunnel\t_left.json +fc94e50b17588232db29f917e90f9659e36ec967 assets\create\models\block\andesite_tunnel\t_right.json +1405be1d4ca1aeced9a287f0d1fca5ba3cc722d2 assets\create\models\block\andesite_tunnel\window.json e8bfb63e0a4426f9d95cd111640169b218dead1b assets\create\models\block\belt_observer\detect.json a2e63810eceb028484b193ddf4315e1811950dc8 assets\create\models\block\belt_observer\detect_belt.json 034c308d46def892e6638ac0b3374849a6a88a26 assets\create\models\block\belt_observer\detect_belt_powered.json @@ -440,13 +440,13 @@ ee79efc65b05d953784b00e573d37602629eb9e8 assets\create\models\block\brass_belt_f 7edf6b5c95f61071d8a9243a63e786765d6104a3 assets\create\models\block\brass_chute_funnel_push_powered.json 6c617fc504cb2259263d24fc56c4735e455aac6d assets\create\models\block\brass_funnel.json 2f152b82291b7fc994191b1ffb8ec6d65aec748b assets\create\models\block\brass_funnel_powered.json -5544ab512bdfe6acb9b14f8e6576ffcca097f18f assets\create\models\block\brass_tunnel\cross.json -fd2fec2a7699b54516c79d3e554c4fc10c331be1 assets\create\models\block\brass_tunnel\fullshade.json -816aa7593ce220dd7c0dab9eef48eef13be289e3 assets\create\models\block\brass_tunnel\halfshade.json -e65fac8652f201891b25067b922efdd2d9309cc7 assets\create\models\block\brass_tunnel\straight.json -7a85b21c40c659c93c2c41f5edd2227e4ee56614 assets\create\models\block\brass_tunnel\t_left.json -881d97c0b7ee57695dea157bfeeaad212c98766a assets\create\models\block\brass_tunnel\t_right.json -fddfb12eae701af4b84b6e9c1a4cdaceb848fb43 assets\create\models\block\brass_tunnel\window.json +eed69194b5b53e285d39bf2d794e67300497bf6f assets\create\models\block\brass_tunnel\cross.json +06efb094dd1ca296614d2a15c74d2aca63503b97 assets\create\models\block\brass_tunnel\fullshade.json +da066edd238414610a14fd092f7e06705d36fd9e assets\create\models\block\brass_tunnel\halfshade.json +77fc3e676e25d84d88dc2b452b2263b366a408f6 assets\create\models\block\brass_tunnel\straight.json +11bfe6b44bbf5f5af88295317f20a91dbf6ebfcd assets\create\models\block\brass_tunnel\t_left.json +fb1a38ee7e4a58711f2f2d90edc13c8a5aedd31c assets\create\models\block\brass_tunnel\t_right.json +67d96d75e9c2b3d9e0c781c514efb85486fce0ad assets\create\models\block\brass_tunnel\window.json 028a07b49c05fe8a93f1d8c229d81e73d887c2df assets\create\models\block\chiseled_dark_scoria.json b1f9ee4867373dd8f976625bab744a1c72c7fd16 assets\create\models\block\chiseled_dolomite.json cd7751090cf3d55296b8e415d0af9b6f18d69770 assets\create\models\block\chiseled_gabbro.json @@ -991,7 +991,7 @@ b0f664dd6de3d0ee9afcb6223fbcd53b97fa0d65 assets\create\models\item\andesite_cobb 4856d13a72ec0af9f10226b4a4bf0567eb580b9a assets\create\models\item\andesite_cobblestone_wall.json 0a9f5f6d552813029474dbbfa31e8443ed91adcd assets\create\models\item\andesite_funnel.json 75b8b00c2418b9660d35a7fabd0774925cf1c02f assets\create\models\item\andesite_pillar.json -c259e28f971a736af10b1fd7393118d5d31c51b2 assets\create\models\item\andesite_tunnel.json +5889a1d445c576dc23cef8ab42c76f1d6cc4bfd3 assets\create\models\item\andesite_tunnel.json bf1fc6bdf7fca6f1958a2d3e96202c1cecb50669 assets\create\models\item\basin.json 1da382e7e58eaa9788f5b1d92221ccac573e068f assets\create\models\item\belt_connector.json 695a69d5854e2eb134b55d855bd2b7b18808a01d assets\create\models\item\belt_observer.json @@ -1004,7 +1004,7 @@ ab045c951352806c3f632dda7b71573f93f60ac4 assets\create\models\item\brass_funnel. 1786bdffa2ab5a07c88d2797db3d7b54461323c4 assets\create\models\item\brass_ingot.json a37be4a0ec9bf6c381527403c57ced4f81abd67c assets\create\models\item\brass_nugget.json 14ea6ee4db6e7e76446e331a70b6b6bec31e8eb7 assets\create\models\item\brass_sheet.json -2c71c36d0b987d5a5e07da4f23f3eaa88f806edf assets\create\models\item\brass_tunnel.json +7b231b9401ff151fa6b0e1361b64774b3a2051cf assets\create\models\item\brass_tunnel.json 3e232a103f7f916fc11edb4d541ca99fe7b44181 assets\create\models\item\cart_assembler.json 99d64b76b3baa84c3bd4b96ccd3376ca12425950 assets\create\models\item\chiseled_dark_scoria.json 83d3571eacde52568786802b268f24c6578c1e5d assets\create\models\item\chiseled_dolomite.json diff --git a/src/generated/resources/assets/create/models/block/andesite_tunnel/cross.json b/src/generated/resources/assets/create/models/block/andesite_tunnel/cross.json index 358403aca..c36f22472 100644 --- a/src/generated/resources/assets/create/models/block/andesite_tunnel/cross.json +++ b/src/generated/resources/assets/create/models/block/andesite_tunnel/cross.json @@ -2,6 +2,7 @@ "parent": "create:block/belt_tunnel/cross", "textures": { "0": "create:block/andesite_tunnel", + "1": "create:block/andesite_tunnel_top", "particle": "block/polished_andesite" } } \ No newline at end of file diff --git a/src/generated/resources/assets/create/models/block/andesite_tunnel/fullshade.json b/src/generated/resources/assets/create/models/block/andesite_tunnel/fullshade.json index b1656f6c8..ea791f982 100644 --- a/src/generated/resources/assets/create/models/block/andesite_tunnel/fullshade.json +++ b/src/generated/resources/assets/create/models/block/andesite_tunnel/fullshade.json @@ -2,6 +2,7 @@ "parent": "create:block/belt_tunnel/fullshade", "textures": { "0": "create:block/andesite_tunnel", + "1": "create:block/andesite_tunnel_top", "particle": "block/polished_andesite" } } \ No newline at end of file diff --git a/src/generated/resources/assets/create/models/block/andesite_tunnel/halfshade.json b/src/generated/resources/assets/create/models/block/andesite_tunnel/halfshade.json index c679c0a88..9729bac79 100644 --- a/src/generated/resources/assets/create/models/block/andesite_tunnel/halfshade.json +++ b/src/generated/resources/assets/create/models/block/andesite_tunnel/halfshade.json @@ -2,6 +2,7 @@ "parent": "create:block/belt_tunnel/halfshade", "textures": { "0": "create:block/andesite_tunnel", + "1": "create:block/andesite_tunnel_top", "particle": "block/polished_andesite" } } \ No newline at end of file diff --git a/src/generated/resources/assets/create/models/block/andesite_tunnel/straight.json b/src/generated/resources/assets/create/models/block/andesite_tunnel/straight.json index 53fc1627a..6b6d059ef 100644 --- a/src/generated/resources/assets/create/models/block/andesite_tunnel/straight.json +++ b/src/generated/resources/assets/create/models/block/andesite_tunnel/straight.json @@ -2,6 +2,7 @@ "parent": "create:block/belt_tunnel/straight", "textures": { "0": "create:block/andesite_tunnel", + "1": "create:block/andesite_tunnel_top", "particle": "block/polished_andesite" } } \ No newline at end of file diff --git a/src/generated/resources/assets/create/models/block/andesite_tunnel/t_left.json b/src/generated/resources/assets/create/models/block/andesite_tunnel/t_left.json index 12beb7306..fabcf7ce3 100644 --- a/src/generated/resources/assets/create/models/block/andesite_tunnel/t_left.json +++ b/src/generated/resources/assets/create/models/block/andesite_tunnel/t_left.json @@ -2,6 +2,7 @@ "parent": "create:block/belt_tunnel/t_left", "textures": { "0": "create:block/andesite_tunnel", + "1": "create:block/andesite_tunnel_top", "particle": "block/polished_andesite" } } \ No newline at end of file diff --git a/src/generated/resources/assets/create/models/block/andesite_tunnel/t_right.json b/src/generated/resources/assets/create/models/block/andesite_tunnel/t_right.json index a5b30e322..b785de8e9 100644 --- a/src/generated/resources/assets/create/models/block/andesite_tunnel/t_right.json +++ b/src/generated/resources/assets/create/models/block/andesite_tunnel/t_right.json @@ -2,6 +2,7 @@ "parent": "create:block/belt_tunnel/t_right", "textures": { "0": "create:block/andesite_tunnel", + "1": "create:block/andesite_tunnel_top", "particle": "block/polished_andesite" } } \ No newline at end of file diff --git a/src/generated/resources/assets/create/models/block/andesite_tunnel/window.json b/src/generated/resources/assets/create/models/block/andesite_tunnel/window.json index a2cef9213..bb22e06ca 100644 --- a/src/generated/resources/assets/create/models/block/andesite_tunnel/window.json +++ b/src/generated/resources/assets/create/models/block/andesite_tunnel/window.json @@ -2,6 +2,7 @@ "parent": "create:block/belt_tunnel/window", "textures": { "0": "create:block/andesite_tunnel", + "1": "create:block/andesite_tunnel_top", "particle": "block/polished_andesite" } } \ No newline at end of file diff --git a/src/generated/resources/assets/create/models/block/brass_tunnel/cross.json b/src/generated/resources/assets/create/models/block/brass_tunnel/cross.json index ddd59b92b..e69d8638e 100644 --- a/src/generated/resources/assets/create/models/block/brass_tunnel/cross.json +++ b/src/generated/resources/assets/create/models/block/brass_tunnel/cross.json @@ -2,6 +2,7 @@ "parent": "create:block/belt_tunnel/cross", "textures": { "0": "create:block/brass_tunnel", + "1": "create:block/brass_tunnel_top", "particle": "create:block/brass_block" } } \ No newline at end of file diff --git a/src/generated/resources/assets/create/models/block/brass_tunnel/fullshade.json b/src/generated/resources/assets/create/models/block/brass_tunnel/fullshade.json index 40d276e2b..62ebfc72e 100644 --- a/src/generated/resources/assets/create/models/block/brass_tunnel/fullshade.json +++ b/src/generated/resources/assets/create/models/block/brass_tunnel/fullshade.json @@ -2,6 +2,7 @@ "parent": "create:block/belt_tunnel/fullshade", "textures": { "0": "create:block/brass_tunnel", + "1": "create:block/brass_tunnel_top", "particle": "create:block/brass_block" } } \ No newline at end of file diff --git a/src/generated/resources/assets/create/models/block/brass_tunnel/halfshade.json b/src/generated/resources/assets/create/models/block/brass_tunnel/halfshade.json index 60b51a330..73f30d68c 100644 --- a/src/generated/resources/assets/create/models/block/brass_tunnel/halfshade.json +++ b/src/generated/resources/assets/create/models/block/brass_tunnel/halfshade.json @@ -2,6 +2,7 @@ "parent": "create:block/belt_tunnel/halfshade", "textures": { "0": "create:block/brass_tunnel", + "1": "create:block/brass_tunnel_top", "particle": "create:block/brass_block" } } \ No newline at end of file diff --git a/src/generated/resources/assets/create/models/block/brass_tunnel/straight.json b/src/generated/resources/assets/create/models/block/brass_tunnel/straight.json index dd6fd9f1f..c9453afcf 100644 --- a/src/generated/resources/assets/create/models/block/brass_tunnel/straight.json +++ b/src/generated/resources/assets/create/models/block/brass_tunnel/straight.json @@ -2,6 +2,7 @@ "parent": "create:block/belt_tunnel/straight", "textures": { "0": "create:block/brass_tunnel", + "1": "create:block/brass_tunnel_top", "particle": "create:block/brass_block" } } \ No newline at end of file diff --git a/src/generated/resources/assets/create/models/block/brass_tunnel/t_left.json b/src/generated/resources/assets/create/models/block/brass_tunnel/t_left.json index 38ff1c45c..6aaa5a249 100644 --- a/src/generated/resources/assets/create/models/block/brass_tunnel/t_left.json +++ b/src/generated/resources/assets/create/models/block/brass_tunnel/t_left.json @@ -2,6 +2,7 @@ "parent": "create:block/belt_tunnel/t_left", "textures": { "0": "create:block/brass_tunnel", + "1": "create:block/brass_tunnel_top", "particle": "create:block/brass_block" } } \ No newline at end of file diff --git a/src/generated/resources/assets/create/models/block/brass_tunnel/t_right.json b/src/generated/resources/assets/create/models/block/brass_tunnel/t_right.json index 39ffb1a04..3747c79b2 100644 --- a/src/generated/resources/assets/create/models/block/brass_tunnel/t_right.json +++ b/src/generated/resources/assets/create/models/block/brass_tunnel/t_right.json @@ -2,6 +2,7 @@ "parent": "create:block/belt_tunnel/t_right", "textures": { "0": "create:block/brass_tunnel", + "1": "create:block/brass_tunnel_top", "particle": "create:block/brass_block" } } \ No newline at end of file diff --git a/src/generated/resources/assets/create/models/block/brass_tunnel/window.json b/src/generated/resources/assets/create/models/block/brass_tunnel/window.json index b01232551..de9a58ab9 100644 --- a/src/generated/resources/assets/create/models/block/brass_tunnel/window.json +++ b/src/generated/resources/assets/create/models/block/brass_tunnel/window.json @@ -2,6 +2,7 @@ "parent": "create:block/belt_tunnel/window", "textures": { "0": "create:block/brass_tunnel", + "1": "create:block/brass_tunnel_top", "particle": "create:block/brass_block" } } \ No newline at end of file diff --git a/src/generated/resources/assets/create/models/item/andesite_tunnel.json b/src/generated/resources/assets/create/models/item/andesite_tunnel.json index 602fd4968..36f34ac32 100644 --- a/src/generated/resources/assets/create/models/item/andesite_tunnel.json +++ b/src/generated/resources/assets/create/models/item/andesite_tunnel.json @@ -2,6 +2,7 @@ "parent": "create:block/belt_tunnel/item", "textures": { "0": "create:block/andesite_tunnel", + "1": "create:block/andesite_tunnel_top", "particle": "block/polished_andesite" } } \ No newline at end of file diff --git a/src/generated/resources/assets/create/models/item/brass_tunnel.json b/src/generated/resources/assets/create/models/item/brass_tunnel.json index faa128867..567f8dd77 100644 --- a/src/generated/resources/assets/create/models/item/brass_tunnel.json +++ b/src/generated/resources/assets/create/models/item/brass_tunnel.json @@ -2,6 +2,7 @@ "parent": "create:block/belt_tunnel/item", "textures": { "0": "create:block/brass_tunnel", + "1": "create:block/brass_tunnel_top", "particle": "create:block/brass_block" } } \ No newline at end of file diff --git a/src/main/java/com/simibubi/create/AllBlockPartials.java b/src/main/java/com/simibubi/create/AllBlockPartials.java index b2ad31f85..b2ccfbad5 100644 --- a/src/main/java/com/simibubi/create/AllBlockPartials.java +++ b/src/main/java/com/simibubi/create/AllBlockPartials.java @@ -60,7 +60,6 @@ public class AllBlockPartials { ANALOG_LEVER_INDICATOR = get("analog_lever/indicator"), BELT_FUNNEL_FLAP = get("belt_funnel/flap"), BELT_TUNNEL_FLAP = get("belt_tunnel/flap"), - BELT_TUNNEL_INDICATOR = get("belt_tunnel/indicator"), FLEXPEATER_INDICATOR = get("diodes/indicator"), FLYWHEEL = get("flywheel/wheel"), FLYWHEEL_UPPER_ROTATING = get("flywheel/upper_rotating_connector"), diff --git a/src/main/java/com/simibubi/create/AllBlocks.java b/src/main/java/com/simibubi/create/AllBlocks.java index 67b0fd927..564009be0 100644 --- a/src/main/java/com/simibubi/create/AllBlocks.java +++ b/src/main/java/com/simibubi/create/AllBlocks.java @@ -77,6 +77,8 @@ import com.simibubi.create.content.contraptions.relays.gauge.GaugeGenerator; import com.simibubi.create.content.contraptions.relays.gearbox.GearboxBlock; import com.simibubi.create.content.logistics.block.belts.observer.BeltObserverBlock; import com.simibubi.create.content.logistics.block.belts.tunnel.BeltTunnelBlock; +import com.simibubi.create.content.logistics.block.belts.tunnel.BrassTunnelBlock; +import com.simibubi.create.content.logistics.block.belts.tunnel.BrassTunnelCTBehaviour; import com.simibubi.create.content.logistics.block.chute.ChuteBlock; import com.simibubi.create.content.logistics.block.chute.ChuteGenerator; import com.simibubi.create.content.logistics.block.chute.ChuteItem; @@ -749,9 +751,10 @@ public class AllBlocks { .transform(BuilderTransformers.beltTunnel("andesite", new ResourceLocation("block/polished_andesite"))) .register(); - public static final BlockEntry BRASS_TUNNEL = - REGISTRATE.block("brass_tunnel", BeltTunnelBlock::new) + public static final BlockEntry BRASS_TUNNEL = + REGISTRATE.block("brass_tunnel", BrassTunnelBlock::new) .transform(BuilderTransformers.beltTunnel("brass", Create.asResource("block/brass_block"))) + .onRegister(connectedTextures(new BrassTunnelCTBehaviour())) .register(); public static final BlockEntry REDSTONE_CONTACT = diff --git a/src/main/java/com/simibubi/create/AllSpriteShifts.java b/src/main/java/com/simibubi/create/AllSpriteShifts.java index 6ff0d05fe..beeb4fa4e 100644 --- a/src/main/java/com/simibubi/create/AllSpriteShifts.java +++ b/src/main/java/com/simibubi/create/AllSpriteShifts.java @@ -47,6 +47,7 @@ public class AllSpriteShifts { CHASSIS_STICKY = getCT(CTType.OMNIDIRECTIONAL, "linear_chassis_end_sticky"); public static final CTSpriteShiftEntry + BRASS_TUNNEL_TOP = vertical("brass_tunnel_top"), FLUID_TANK = getCT(CTType.OMNIDIRECTIONAL, "fluid_tank"); public static final SpriteShiftEntry diff --git a/src/main/java/com/simibubi/create/AllTileEntities.java b/src/main/java/com/simibubi/create/AllTileEntities.java index f7b0b865f..5e67ace79 100644 --- a/src/main/java/com/simibubi/create/AllTileEntities.java +++ b/src/main/java/com/simibubi/create/AllTileEntities.java @@ -72,6 +72,7 @@ import com.simibubi.create.content.logistics.block.belts.observer.BeltObserverRe import com.simibubi.create.content.logistics.block.belts.observer.BeltObserverTileEntity; import com.simibubi.create.content.logistics.block.belts.tunnel.BeltTunnelRenderer; import com.simibubi.create.content.logistics.block.belts.tunnel.BeltTunnelTileEntity; +import com.simibubi.create.content.logistics.block.belts.tunnel.BrassTunnelTileEntity; import com.simibubi.create.content.logistics.block.chute.ChuteRenderer; import com.simibubi.create.content.logistics.block.chute.ChuteTileEntity; import com.simibubi.create.content.logistics.block.depot.DepotRenderer; @@ -157,8 +158,10 @@ public class AllTileEntities { public static final TileEntityEntry BELT = register("belt", BeltTileEntity::new, AllBlocks.BELT); public static final TileEntityEntry CHUTE = register("chute", ChuteTileEntity::new, AllBlocks.CHUTE); - public static final TileEntityEntry BELT_TUNNEL = - register("belt_tunnel", BeltTunnelTileEntity::new, AllBlocks.ANDESITE_TUNNEL, AllBlocks.BRASS_TUNNEL); + public static final TileEntityEntry ANDESITE_TUNNEL = + register("andesite_tunnel", BeltTunnelTileEntity::new, AllBlocks.ANDESITE_TUNNEL); + public static final TileEntityEntry BRASS_TUNNEL = + register("brass_tunnel", BrassTunnelTileEntity::new, AllBlocks.BRASS_TUNNEL); public static final TileEntityEntry MECHANICAL_ARM = register("mechanical_arm", ArmTileEntity::new, AllBlocks.MECHANICAL_ARM); public static final TileEntityEntry MECHANICAL_PISTON = register("mechanical_piston", @@ -227,9 +230,9 @@ public class AllTileEntities { public static final TileEntityEntry DEPOT = register("depot", DepotTileEntity::new, AllBlocks.DEPOT); - public static final TileEntityEntry FUNNEL = register("funnel", - FunnelTileEntity::new, AllBlocks.BRASS_FUNNEL, AllBlocks.BRASS_BELT_FUNNEL, AllBlocks.BRASS_CHUTE_FUNNEL, - AllBlocks.ANDESITE_FUNNEL, AllBlocks.ANDESITE_BELT_FUNNEL, AllBlocks.ANDESITE_CHUTE_FUNNEL); + public static final TileEntityEntry FUNNEL = register("funnel", FunnelTileEntity::new, + AllBlocks.BRASS_FUNNEL, AllBlocks.BRASS_BELT_FUNNEL, AllBlocks.BRASS_CHUTE_FUNNEL, AllBlocks.ANDESITE_FUNNEL, + AllBlocks.ANDESITE_BELT_FUNNEL, AllBlocks.ANDESITE_CHUTE_FUNNEL); public static final TileEntityEntry PACKAGER = register("packager", PackagerTileEntity::new, AllBlocks.PACKAGER); @@ -313,7 +316,8 @@ public class AllTileEntities { bind(TRANSPOSER, SmartTileEntityRenderer::new); bind(LINKED_TRANSPOSER, SmartTileEntityRenderer::new); bind(FUNNEL, FunnelRenderer::new); - bind(BELT_TUNNEL, BeltTunnelRenderer::new); + bind(ANDESITE_TUNNEL, BeltTunnelRenderer::new); + bind(BRASS_TUNNEL, BeltTunnelRenderer::new); bind(MECHANICAL_ARM, ArmRenderer::new); bind(BELT_OBSERVER, BeltObserverRenderer::new); bind(ADJUSTABLE_REPEATER, AdjustableRepeaterRenderer::new); diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/transport/BeltTunnelInteractionHandler.java b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/transport/BeltTunnelInteractionHandler.java index 7e6102ef9..4fa3cca53 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/transport/BeltTunnelInteractionHandler.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/transport/BeltTunnelInteractionHandler.java @@ -6,6 +6,8 @@ import com.simibubi.create.content.contraptions.relays.belt.BeltHelper; import com.simibubi.create.content.contraptions.relays.belt.BeltTileEntity; import com.simibubi.create.content.logistics.block.belts.tunnel.BeltTunnelBlock; import com.simibubi.create.content.logistics.block.belts.tunnel.BeltTunnelTileEntity; +import com.simibubi.create.content.logistics.block.belts.tunnel.BrassTunnelBlock; +import com.simibubi.create.content.logistics.block.belts.tunnel.BrassTunnelTileEntity; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; @@ -45,16 +47,14 @@ public class BeltTunnelInteractionHandler { .up(); if (!(belt.getWorld() .getBlockState(pos) - .getBlock() instanceof BeltTunnelBlock)) + .getBlock() instanceof BrassTunnelBlock)) return false; TileEntity te = belt.getWorld() .getTileEntity(pos); - if (te == null || !(te instanceof BeltTunnelTileEntity)) + if (te == null || !(te instanceof BrassTunnelTileEntity)) return false; - - // TODO: ask TE if item can be inserted - - return false; + BrassTunnelTileEntity tunnel = (BrassTunnelTileEntity) te; + return !tunnel.canInsert(movementDirection.getOpposite(), stack); } public static void flapTunnel(BeltInventory beltInventory, int offset, Direction side, boolean inward) { diff --git a/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BeltTunnelBlock.java b/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BeltTunnelBlock.java index b5deacd05..f3ef9e2a6 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BeltTunnelBlock.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BeltTunnelBlock.java @@ -63,7 +63,7 @@ public class BeltTunnelBlock extends Block implements ITE, @Override public TileEntity createTileEntity(BlockState state, IBlockReader world) { - return AllTileEntities.BELT_TUNNEL.create(); + return AllTileEntities.ANDESITE_TUNNEL.create(); } @Override @@ -75,7 +75,7 @@ public class BeltTunnelBlock extends Block implements ITE, return false; return true; } - + public boolean isValidPositionForPlacement(BlockState state, IWorldReader worldIn, BlockPos pos) { BlockState blockState = worldIn.getBlockState(pos.down()); if (!AllBlocks.BELT.has(blockState)) @@ -99,14 +99,20 @@ public class BeltTunnelBlock extends Block implements ITE, return getTunnelState(context.getWorld(), context.getPos()); } + @Override + public void onBlockAdded(BlockState state, World world, BlockPos pos, BlockState p_220082_4_, boolean p_220082_5_) { + if (!(world instanceof WrappedWorld) && !world.isRemote()) + withTileEntityDo(world, pos, BeltTunnelTileEntity::updateTunnelConnections); + } + @Override public BlockState updatePostPlacement(BlockState state, Direction facing, BlockState facingState, IWorld worldIn, BlockPos currentPos, BlockPos facingPos) { if (facing.getAxis() .isVertical()) return state; - if (!(worldIn instanceof WrappedWorld)) - withTileEntityDo(worldIn, currentPos, BeltTunnelTileEntity::initFlaps); + if (!(worldIn instanceof WrappedWorld) && !worldIn.isRemote()) + withTileEntityDo(worldIn, currentPos, BeltTunnelTileEntity::updateTunnelConnections); BlockState tunnelState = getTunnelState(worldIn, currentPos); if (tunnelState.get(HORIZONTAL_AXIS) == state.get(HORIZONTAL_AXIS)) { if (hasWindow(tunnelState) == hasWindow(state)) @@ -123,7 +129,7 @@ public class BeltTunnelBlock extends Block implements ITE, world.setBlockState(pos, newTunnel, 3); TileEntity te = world.getTileEntity(pos); if (te != null && (te instanceof BeltTunnelTileEntity)) - ((BeltTunnelTileEntity) te).initFlaps(); + ((BeltTunnelTileEntity) te).updateTunnelConnections(); } } @@ -158,13 +164,14 @@ public class BeltTunnelBlock extends Block implements ITE, Direction fw = Direction.getFacingFromAxis(AxisDirection.POSITIVE, axis); BlockState blockState1 = reader.getBlockState(pos.offset(fw)); BlockState blockState2 = reader.getBlockState(pos.offset(fw.getOpposite())); - boolean valid1 = - blockState1.getBlock() instanceof BeltTunnelBlock || blockState1.getBlock() instanceof BeltFunnelBlock - && blockState1.get(BeltFunnelBlock.HORIZONTAL_FACING) == fw.getOpposite(); - boolean valid2 = - blockState2.getBlock() instanceof BeltTunnelBlock || blockState2.getBlock() instanceof BeltFunnelBlock - && blockState2.get(BeltFunnelBlock.HORIZONTAL_FACING) == fw; - if (valid1 && valid2) + boolean funnel1 = blockState1.getBlock() instanceof BeltFunnelBlock + && blockState1.get(BeltFunnelBlock.HORIZONTAL_FACING) == fw.getOpposite(); + boolean funnel2 = blockState2.getBlock() instanceof BeltFunnelBlock + && blockState2.get(BeltFunnelBlock.HORIZONTAL_FACING) == fw; + boolean valid1 = blockState1.getBlock() instanceof BeltTunnelBlock || funnel1; + boolean valid2 = blockState2.getBlock() instanceof BeltTunnelBlock || funnel2; + + if (valid1 && valid2 && !(funnel1 && funnel2)) state = state.with(SHAPE, Shape.WINDOW); } @@ -173,10 +180,10 @@ public class BeltTunnelBlock extends Block implements ITE, @Override public ActionResultType onWrenched(BlockState state, ItemUseContext context) { + if (!hasWindow(state)) + return ActionResultType.PASS; // Toggle windows - if (!hasWindow(state)) - return IWrenchable.super.onWrenched(state, context); Shape next = state.get(SHAPE); switch (state.get(SHAPE)) { case FULLSHADE: diff --git a/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BeltTunnelRenderer.java b/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BeltTunnelRenderer.java index e87dbc1da..8a7b11b11 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BeltTunnelRenderer.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BeltTunnelRenderer.java @@ -3,7 +3,7 @@ package com.simibubi.create.content.logistics.block.belts.tunnel; import com.mojang.blaze3d.matrix.MatrixStack; import com.mojang.blaze3d.vertex.IVertexBuilder; import com.simibubi.create.AllBlockPartials; -import com.simibubi.create.foundation.tileEntity.renderer.SafeTileEntityRenderer; +import com.simibubi.create.foundation.tileEntity.renderer.SmartTileEntityRenderer; import com.simibubi.create.foundation.utility.SuperByteBuffer; import net.minecraft.client.renderer.IRenderTypeBuffer; @@ -16,7 +16,7 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; import net.minecraft.world.World; -public class BeltTunnelRenderer extends SafeTileEntityRenderer { +public class BeltTunnelRenderer extends SmartTileEntityRenderer { public BeltTunnelRenderer(TileEntityRendererDispatcher dispatcher) { super(dispatcher); @@ -25,6 +25,7 @@ public class BeltTunnelRenderer extends SafeTileEntityRenderer flaps; - private LazyOptional cap = LazyOptional.empty(); - private List> flapsToSend; + protected LazyOptional cap = LazyOptional.empty(); + protected List> flapsToSend; public BeltTunnelTileEntity(TileEntityType type) { super(type); @@ -48,11 +52,29 @@ public class BeltTunnelTileEntity extends SmartTileEntity { @Override public CompoundNBT write(CompoundNBT compound) { + ListNBT flapsNBT = new ListNBT(); + for (Direction direction : flaps.keySet()) + flapsNBT.add(IntNBT.of(direction.getIndex())); + compound.put("Flaps", flapsNBT); return super.write(compound); } @Override public void read(CompoundNBT compound) { + Set newFlaps = new HashSet<>(6); + ListNBT flapsNBT = compound.getList("Flaps", NBT.TAG_INT); + for (INBT inbt : flapsNBT) + if (inbt instanceof IntNBT) + newFlaps.add(Direction.byIndex(((IntNBT) inbt).getInt())); + + for (Direction d : Iterate.directions) + if (!newFlaps.contains(d)) + flaps.remove(d); + else if (!flaps.containsKey(d)) + flaps.put(d, new InterpolatedChasingValue().start(.25f) + .target(0) + .withSpeed(.05f)); + super.read(compound); } @@ -68,7 +90,7 @@ public class BeltTunnelTileEntity extends SmartTileEntity { flap.putBoolean("FlapInward", pair.getValue()); flapsNBT.add(flap); } - writeToClient.put("Flaps", flapsNBT); + writeToClient.put("TriggerFlaps", flapsNBT); flapsToSend.clear(); } return writeToClient; @@ -77,21 +99,17 @@ public class BeltTunnelTileEntity extends SmartTileEntity { @Override public void readClientUpdate(CompoundNBT tag) { super.readClientUpdate(tag); - if (tag.contains("Flaps")) { - ListNBT flapsNBT = tag.getList("Flaps", NBT.TAG_COMPOUND); + if (tag.contains("TriggerFlaps")) { + ListNBT flapsNBT = tag.getList("TriggerFlaps", NBT.TAG_COMPOUND); for (INBT inbt : flapsNBT) { CompoundNBT flap = (CompoundNBT) inbt; Direction side = Direction.byIndex(flap.getInt("Flap")); flap(side, flap.getBoolean("FlapInward")); } - } else { - initFlaps(); } } - public void initFlaps() { - if (!world.isRemote) - sendData(); + public void updateTunnelConnections() { flaps.clear(); BlockState tunnelState = getBlockState(); for (Direction direction : Direction.values()) { @@ -116,6 +134,7 @@ public class BeltTunnelTileEntity extends SmartTileEntity { .target(0) .withSpeed(.05f)); } + sendData(); } public void flap(Direction side, boolean inward) { @@ -132,7 +151,7 @@ public class BeltTunnelTileEntity extends SmartTileEntity { @Override public void initialize() { super.initialize(); - initFlaps(); +// updateTunnelConnections(); } @Override diff --git a/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BrassTunnelBlock.java b/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BrassTunnelBlock.java new file mode 100644 index 000000000..034f2f73f --- /dev/null +++ b/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BrassTunnelBlock.java @@ -0,0 +1,42 @@ +package com.simibubi.create.content.logistics.block.belts.tunnel; + +import com.simibubi.create.AllTileEntities; +import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; +import com.simibubi.create.foundation.tileEntity.behaviour.filtering.FilteringBehaviour; + +import net.minecraft.block.BlockState; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.Direction; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockReader; +import net.minecraft.world.IWorld; +import net.minecraft.world.World; + +public class BrassTunnelBlock extends BeltTunnelBlock { + + public BrassTunnelBlock(Properties properties) { + super(properties); + } + + @Override + public TileEntity createTileEntity(BlockState state, IBlockReader world) { + return AllTileEntities.BRASS_TUNNEL.create(); + } + + @Override + public BlockState updatePostPlacement(BlockState state, Direction facing, BlockState facingState, IWorld worldIn, + BlockPos currentPos, BlockPos facingPos) { + return super.updatePostPlacement(state, facing, facingState, worldIn, currentPos, facingPos); + } + + @Override + public void onReplaced(BlockState p_196243_1_, World p_196243_2_, BlockPos p_196243_3_, BlockState p_196243_4_, + boolean p_196243_5_) { + if (p_196243_1_.hasTileEntity() + && (p_196243_1_.getBlock() != p_196243_4_.getBlock() || !p_196243_4_.hasTileEntity())) { + TileEntityBehaviour.destroy(p_196243_2_, p_196243_3_, FilteringBehaviour.TYPE); + p_196243_2_.removeTileEntity(p_196243_3_); + } + } + +} diff --git a/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BrassTunnelCTBehaviour.java b/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BrassTunnelCTBehaviour.java new file mode 100644 index 000000000..34b36e171 --- /dev/null +++ b/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BrassTunnelCTBehaviour.java @@ -0,0 +1,56 @@ +package com.simibubi.create.content.logistics.block.belts.tunnel; + +import com.simibubi.create.AllSpriteShifts; +import com.simibubi.create.foundation.block.connected.CTSpriteShiftEntry; +import com.simibubi.create.foundation.block.connected.ConnectedTextureBehaviour; + +import net.minecraft.block.BlockState; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.Direction; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.ILightReader; + +public class BrassTunnelCTBehaviour extends ConnectedTextureBehaviour { + + @Override + public CTSpriteShiftEntry get(BlockState state, Direction direction) { + return direction == Direction.UP ? AllSpriteShifts.BRASS_TUNNEL_TOP : null; + } + + @Override + public boolean connectsTo(BlockState state, BlockState other, ILightReader reader, BlockPos pos, BlockPos otherPos, + Direction face) { + int yDiff = otherPos.getY() - pos.getY(); + int zDiff = otherPos.getZ() - pos.getZ(); + if (yDiff != 0) + return false; + + TileEntity te = reader.getTileEntity(pos); + if (!(te instanceof BrassTunnelTileEntity)) + return false; + BrassTunnelTileEntity tunnelTE = (BrassTunnelTileEntity) te; + boolean leftSide = zDiff > 0; + return tunnelTE.isConnected(leftSide); + } + + @Override + public CTContext buildContext(ILightReader reader, BlockPos pos, BlockState state, Direction face) { + return super.buildContext(reader, pos, state, face); + } + + @Override + protected boolean reverseUVs(BlockState state, Direction face) { + return super.reverseUVs(state, face); + } + + @Override + protected boolean reverseUVsHorizontally(BlockState state, Direction face) { + return super.reverseUVsHorizontally(state, face); + } + + @Override + protected boolean reverseUVsVertically(BlockState state, Direction face) { + return super.reverseUVsVertically(state, face); + } + +} diff --git a/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BrassTunnelFilterSlot.java b/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BrassTunnelFilterSlot.java new file mode 100644 index 000000000..874747623 --- /dev/null +++ b/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BrassTunnelFilterSlot.java @@ -0,0 +1,15 @@ +package com.simibubi.create.content.logistics.block.belts.tunnel; + +import com.simibubi.create.foundation.tileEntity.behaviour.ValueBoxTransform; +import com.simibubi.create.foundation.utility.VecHelper; + +import net.minecraft.util.math.Vec3d; + +public class BrassTunnelFilterSlot extends ValueBoxTransform.Sided { + + @Override + protected Vec3d getSouthLocation() { + return VecHelper.voxelSpace(8, 12, 15.5f); + } + +} diff --git a/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BrassTunnelTileEntity.java b/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BrassTunnelTileEntity.java new file mode 100644 index 000000000..e5bda8728 --- /dev/null +++ b/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BrassTunnelTileEntity.java @@ -0,0 +1,201 @@ +package com.simibubi.create.content.logistics.block.belts.tunnel; + +import java.util.ArrayList; +import java.util.List; + +import javax.annotation.Nullable; + +import org.apache.commons.lang3.tuple.Pair; + +import com.simibubi.create.AllBlocks; +import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; +import com.simibubi.create.foundation.tileEntity.behaviour.filtering.FilteringBehaviour; +import com.simibubi.create.foundation.tileEntity.behaviour.filtering.SidedFilteringBehaviour; +import com.simibubi.create.foundation.utility.NBTHelper; + +import net.minecraft.block.BlockState; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.nbt.NBTUtil; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityType; +import net.minecraft.util.Direction; +import net.minecraft.util.Direction.Axis; +import net.minecraft.util.Direction.AxisDirection; +import net.minecraft.util.math.BlockPos; +import net.minecraftforge.common.util.Constants.NBT; + +public class BrassTunnelTileEntity extends BeltTunnelTileEntity { + + SidedFilteringBehaviour filtering; + + boolean connectedLeft; + boolean connectedRight; + + ItemStack stackToDistribute; + float distributionProgress; + List> distributionTargets; + int distributionDistanceLeft; + int distributionDistanceRight; + + public BrassTunnelTileEntity(TileEntityType type) { + super(type); + distributionTargets = new ArrayList<>(); + stackToDistribute = ItemStack.EMPTY; + } + + @Override + public void initialize() { + if (filtering == null) { + filtering = createSidedFilter(); + putBehaviour(filtering); + } + super.initialize(); + } + + public boolean canInsert(Direction side, ItemStack stack) { + if (filtering != null && !filtering.test(side, stack)) + return false; + if (!connectedLeft && !connectedRight) + return true; + if (!stackToDistribute.isEmpty()) + return false; + return true; + } + + @Override + public void addBehavioursDeferred(List behaviours) { + super.addBehavioursDeferred(behaviours); + filtering = createSidedFilter(); + behaviours.add(filtering); + } + + protected SidedFilteringBehaviour createSidedFilter() { + return new SidedFilteringBehaviour(this, new BrassTunnelFilterSlot(), this::makeFilter, + this::isValidFaceForFilter); + } + + private FilteringBehaviour makeFilter(Direction side, FilteringBehaviour filter) { + return filter; + } + + private boolean isValidFaceForFilter(Direction side) { + return flaps.containsKey(side); + } + + @Override + public CompoundNBT write(CompoundNBT compound) { + compound.putBoolean("ConnectedLeft", connectedLeft); + compound.putBoolean("ConnectedRight", connectedRight); + + compound.put("StackToDistribute", stackToDistribute.serializeNBT()); + compound.putFloat("DistributionProgress", distributionProgress); + compound.putInt("DistanceLeft", distributionDistanceLeft); + compound.putInt("DistanceRight", distributionDistanceRight); + compound.put("Targets", NBTHelper.writeCompoundList(distributionTargets, pair -> { + CompoundNBT nbt = new CompoundNBT(); + nbt.put("Pos", NBTUtil.writeBlockPos(pair.getKey())); + nbt.putInt("Face", pair.getValue() + .getIndex()); + return nbt; + })); + + return super.write(compound); + } + + @Override + public void read(CompoundNBT compound) { + connectedLeft = compound.getBoolean("ConnectedLeft"); + connectedRight = compound.getBoolean("ConnectedRight"); + + stackToDistribute = ItemStack.read(compound.getCompound("StackToDistribute")); + distributionProgress = compound.getFloat("DistributionProgress"); + distributionDistanceLeft = compound.getInt("DistanceLeft"); + distributionDistanceRight = compound.getInt("DistanceRight"); + distributionTargets = NBTHelper.readCompoundList(compound.getList("Targets", NBT.TAG_COMPOUND), nbt -> { + BlockPos pos = NBTUtil.readBlockPos(nbt.getCompound("Pos")); + Direction face = Direction.byIndex(nbt.getInt("Face")); + return Pair.of(pos, face); + }); + + super.read(compound); + } + + @Override + public void readClientUpdate(CompoundNBT tag) { + boolean wasConnectedLeft = connectedLeft; + boolean wasConnectedRight = connectedRight; + super.readClientUpdate(tag); + if (wasConnectedLeft != connectedLeft || wasConnectedRight != connectedRight) { + requestModelDataUpdate(); + if (hasWorld()) + world.notifyBlockUpdate(getPos(), getBlockState(), getBlockState(), 16); + } + filtering.updateFilterPresence(); + } + + public boolean isConnected(boolean leftSide) { + return leftSide ? connectedLeft : connectedRight; + } + + @Override + public void updateTunnelConnections() { + super.updateTunnelConnections(); + boolean connectivityChanged = false; + boolean nowConnectedLeft = determineIfConnected(true); + boolean nowConnectedRight = determineIfConnected(false); + + if (connectedLeft != nowConnectedLeft) { + connectedLeft = nowConnectedLeft; + connectivityChanged = true; + BrassTunnelTileEntity adjacent = getAdjacent(true); + if (adjacent != null && !world.isRemote) + adjacent.updateTunnelConnections(); + } + if (connectedRight != nowConnectedRight) { + connectedRight = nowConnectedRight; + connectivityChanged = true; + BrassTunnelTileEntity adjacent = getAdjacent(false); + if (adjacent != null && !world.isRemote) + adjacent.updateTunnelConnections(); + } + + if (filtering != null) + filtering.updateFilterPresence(); + if (connectivityChanged) + sendData(); + } + + protected boolean determineIfConnected(boolean leftSide) { + if (flaps.isEmpty()) + return false; + BrassTunnelTileEntity adjacentTunnelTE = getAdjacent(leftSide); + return adjacentTunnelTE != null && !adjacentTunnelTE.flaps.isEmpty(); + } + + @Nullable + protected BrassTunnelTileEntity getAdjacent(boolean leftSide) { + if (!hasWorld()) + return null; + + BlockState blockState = getBlockState(); + if (!AllBlocks.BRASS_TUNNEL.has(blockState)) + return null; + + Axis axis = blockState.get(BrassTunnelBlock.HORIZONTAL_AXIS); + Direction baseDirection = Direction.getFacingFromAxis(AxisDirection.POSITIVE, axis); + Direction direction = leftSide ? baseDirection.rotateYCCW() : baseDirection.rotateY(); + + BlockPos adjacentPos = pos.offset(direction); + BlockState adjacentBlockState = world.getBlockState(adjacentPos); + if (!AllBlocks.BRASS_TUNNEL.has(adjacentBlockState)) + return null; + if (adjacentBlockState.get(BrassTunnelBlock.HORIZONTAL_AXIS) != axis) + return null; + TileEntity adjacentTE = world.getTileEntity(adjacentPos); + if (!(adjacentTE instanceof BrassTunnelTileEntity)) + return null; + return (BrassTunnelTileEntity) adjacentTE; + } + +} diff --git a/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelBlock.java b/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelBlock.java index 31684566b..f9df8a5c0 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelBlock.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelBlock.java @@ -62,7 +62,7 @@ public abstract class FunnelBlock extends ProperDirectionalBlock implements ITE< ItemStack heldItem = player.getHeldItem(handIn); boolean shouldntInsertItem = AllBlocks.MECHANICAL_ARM.isIn(heldItem); - + if (hit.getFace() == getFunnelFacing(state) && !shouldntInsertItem) { if (!worldIn.isRemote) withTileEntityDo(worldIn, pos, te -> { @@ -188,6 +188,7 @@ public abstract class FunnelBlock extends ProperDirectionalBlock implements ITE< boolean p_196243_5_) { if (p_196243_1_.hasTileEntity() && (p_196243_1_.getBlock() != p_196243_4_.getBlock() && !isFunnel(p_196243_4_) || !p_196243_4_.hasTileEntity())) { + TileEntityBehaviour.destroy(p_196243_2_, p_196243_3_, FilteringBehaviour.TYPE); p_196243_2_.removeTileEntity(p_196243_3_); } } diff --git a/src/main/java/com/simibubi/create/foundation/block/connected/ConnectedTextureBehaviour.java b/src/main/java/com/simibubi/create/foundation/block/connected/ConnectedTextureBehaviour.java index 2f7045fd5..ffea6e247 100644 --- a/src/main/java/com/simibubi/create/foundation/block/connected/ConnectedTextureBehaviour.java +++ b/src/main/java/com/simibubi/create/foundation/block/connected/ConnectedTextureBehaviour.java @@ -11,7 +11,7 @@ import net.minecraft.world.ILightReader; public abstract class ConnectedTextureBehaviour { - class CTContext { + public class CTContext { boolean up, down, left, right; boolean topLeft, topRight, bottomLeft, bottomRight; } @@ -47,7 +47,7 @@ public abstract class ConnectedTextureBehaviour { return state.getBlock() == other.getBlock(); } - CTContext buildContext(ILightReader reader, BlockPos pos, BlockState state, Direction face) { + public CTContext buildContext(ILightReader reader, BlockPos pos, BlockState state, Direction face) { CTContext context = new CTContext(); CTSpriteShiftEntry textureEntry = get(state, face); diff --git a/src/main/java/com/simibubi/create/foundation/data/BuilderTransformers.java b/src/main/java/com/simibubi/create/foundation/data/BuilderTransformers.java index 04288cb73..ad37336ba 100644 --- a/src/main/java/com/simibubi/create/foundation/data/BuilderTransformers.java +++ b/src/main/java/com/simibubi/create/foundation/data/BuilderTransformers.java @@ -92,6 +92,7 @@ public class BuilderTransformers { .modelFile(p.models() .withExistingParent(id + "/" + shapeName, p.modLoc("block/belt_tunnel/" + shapeName)) .texture("0", p.modLoc(id)) + .texture("1", p.modLoc(id + "_top")) .texture("particle", particleTexture)) .rotationY(state.get(BeltTunnelBlock.HORIZONTAL_AXIS) == Axis.X ? 0 : 90) .build(); @@ -101,6 +102,7 @@ public class BuilderTransformers { String id = type + "_tunnel"; p.withExistingParent("item/" + id, p.modLoc("block/belt_tunnel/item")) .texture("0", p.modLoc("block/" + id)) + .texture("1", p.modLoc("block/" + id + "_top")) .texture("particle", particleTexture); }) .build(); diff --git a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/filtering/FilteringBehaviour.java b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/filtering/FilteringBehaviour.java index 1abae30c6..9dbffb81a 100644 --- a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/filtering/FilteringBehaviour.java +++ b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/filtering/FilteringBehaviour.java @@ -15,6 +15,7 @@ import net.minecraft.block.BlockState; import net.minecraft.entity.item.ItemEntity; import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompoundNBT; +import net.minecraft.util.Direction; import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; @@ -125,6 +126,10 @@ public class FilteringBehaviour extends TileEntityBehaviour { scrollableValue = count; } + public void setFilter(Direction face, ItemStack stack) { + setFilter(stack); + } + public void setFilter(ItemStack stack) { filter = stack.copy(); callback.accept(filter); @@ -146,6 +151,10 @@ public class FilteringBehaviour extends TileEntityBehaviour { super.destroy(); } + public ItemStack getFilter(Direction side) { + return getFilter(); + } + public ItemStack getFilter() { return filter.copy(); } diff --git a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/filtering/FilteringHandler.java b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/filtering/FilteringHandler.java index 1128431b9..c911e8680 100644 --- a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/filtering/FilteringHandler.java +++ b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/filtering/FilteringHandler.java @@ -43,12 +43,17 @@ public class FilteringHandler { FilteringBehaviour behaviour = TileEntityBehaviour.get(world, pos, FilteringBehaviour.TYPE); if (behaviour == null) return; - if (!behaviour.isActive()) - return; BlockRayTraceResult ray = RaycastHelper.rayTraceRange(world, player, 10); if (ray == null) return; + if (behaviour instanceof SidedFilteringBehaviour) { + behaviour = ((SidedFilteringBehaviour) behaviour).get(ray.getFace()); + if (behaviour == null) + return; + } + if (!behaviour.isActive()) + return; if (behaviour.slotPositioning instanceof ValueBoxTransform.Sided) ((Sided) behaviour.slotPositioning).fromSide(ray.getFace()); diff --git a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/filtering/FilteringRenderer.java b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/filtering/FilteringRenderer.java index fdafeb1d3..790e06234 100644 --- a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/filtering/FilteringRenderer.java +++ b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/filtering/FilteringRenderer.java @@ -40,12 +40,17 @@ public class FilteringRenderer { BlockState state = world.getBlockState(pos); FilteringBehaviour behaviour = TileEntityBehaviour.get(world, pos, FilteringBehaviour.TYPE); + if (mc.player.isSneaking()) + return; if (behaviour == null) return; + if (behaviour instanceof SidedFilteringBehaviour) { + behaviour = ((SidedFilteringBehaviour) behaviour).get(result.getFace()); + if (behaviour == null) + return; + } if (!behaviour.isActive()) return; - if (mc.player.isSneaking()) - return; if (behaviour.slotPositioning instanceof ValueBoxTransform.Sided) ((Sided) behaviour.slotPositioning).fromSide(result.getFace()); if (!behaviour.slotPositioning.shouldRender(state)) @@ -86,7 +91,7 @@ public class FilteringRenderer { if (!behaviour.isActive()) return; if (behaviour.getFilter() - .isEmpty()) + .isEmpty() && !(behaviour instanceof SidedFilteringBehaviour)) return; ValueBoxTransform slotPositioning = behaviour.slotPositioning; @@ -96,13 +101,17 @@ public class FilteringRenderer { ValueBoxTransform.Sided sided = (ValueBoxTransform.Sided) slotPositioning; Direction side = sided.getSide(); for (Direction d : Iterate.directions) { + ItemStack filter = behaviour.getFilter(d); + if (filter.isEmpty()) + continue; + sided.fromSide(d); if (!slotPositioning.shouldRender(blockState)) continue; ms.push(); slotPositioning.transform(blockState, ms); - ValueBoxRenderer.renderItemIntoValueBox(behaviour.getFilter(), ms, buffer, light, overlay); + ValueBoxRenderer.renderItemIntoValueBox(filter, ms, buffer, light, overlay); ms.pop(); } sided.fromSide(side); diff --git a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/filtering/SidedFilteringBehaviour.java b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/filtering/SidedFilteringBehaviour.java new file mode 100644 index 000000000..7dc6bf4e3 --- /dev/null +++ b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/filtering/SidedFilteringBehaviour.java @@ -0,0 +1,150 @@ +package com.simibubi.create.foundation.tileEntity.behaviour.filtering; + +import java.util.HashSet; +import java.util.IdentityHashMap; +import java.util.Map; +import java.util.Set; +import java.util.function.BiFunction; +import java.util.function.Predicate; + +import com.simibubi.create.foundation.tileEntity.SmartTileEntity; +import com.simibubi.create.foundation.tileEntity.behaviour.ValueBoxTransform; +import com.simibubi.create.foundation.tileEntity.behaviour.ValueBoxTransform.Sided; +import com.simibubi.create.foundation.utility.Iterate; +import com.simibubi.create.foundation.utility.NBTHelper; + +import net.minecraft.block.BlockState; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.util.Direction; +import net.minecraft.util.math.Vec3d; +import net.minecraftforge.common.util.Constants.NBT; + +public class SidedFilteringBehaviour extends FilteringBehaviour { + + Map sidedFilters; + private BiFunction filterFactory; + private Predicate validDirections; + + public SidedFilteringBehaviour(SmartTileEntity te, ValueBoxTransform.Sided sidedSlot, + BiFunction filterFactory, + Predicate validDirections) { + super(te, sidedSlot); + this.filterFactory = filterFactory; + this.validDirections = validDirections; + sidedFilters = new IdentityHashMap<>(); + updateFilterPresence(); + } + + @Override + public void initialize() { + super.initialize(); + } + + public FilteringBehaviour get(Direction side) { + return sidedFilters.get(side); + } + + public void updateFilterPresence() { + Set valid = new HashSet<>(); + for (Direction d : Iterate.directions) + if (validDirections.test(d)) + valid.add(d); + for (Direction d : Iterate.directions) + if (valid.contains(d)) { + if (!sidedFilters.containsKey(d)) + sidedFilters.put(d, filterFactory.apply(d, new FilteringBehaviour(tileEntity, slotPositioning))); + } else if (sidedFilters.containsKey(d)) + removeFilter(d); + } + + @Override + public void writeNBT(CompoundNBT nbt) { + nbt.put("Filters", NBTHelper.writeCompoundList(sidedFilters.entrySet(), entry -> { + CompoundNBT compound = new CompoundNBT(); + compound.putInt("Side", entry.getKey() + .getIndex()); + entry.getValue() + .writeNBT(compound); + return compound; + })); + super.writeNBT(nbt); + } + + @Override + public void readNBT(CompoundNBT nbt) { + NBTHelper.iterateCompoundList(nbt.getList("Filters", NBT.TAG_COMPOUND), compound -> { + Direction face = Direction.byIndex(compound.getInt("Side")); + if (sidedFilters.containsKey(face)) + sidedFilters.get(face) + .readNBT(compound); + }); + super.readNBT(nbt); + } + + @Override + public CompoundNBT writeToClient(CompoundNBT nbt) { + nbt.put("Filters", NBTHelper.writeCompoundList(sidedFilters.entrySet(), entry -> { + CompoundNBT compound = new CompoundNBT(); + compound.putInt("Side", entry.getKey() + .getIndex()); + entry.getValue() + .writeToClient(compound); + return compound; + })); + return super.writeToClient(nbt); + } + + @Override + public void tick() { + super.tick(); + sidedFilters.values() + .forEach(FilteringBehaviour::tick); + } + + @Override + public void setFilter(Direction side, ItemStack stack) { + if (!sidedFilters.containsKey(side)) + return; + sidedFilters.get(side) + .setFilter(stack); + } + + @Override + public ItemStack getFilter(Direction side) { + if (!sidedFilters.containsKey(side)) + return ItemStack.EMPTY; + return sidedFilters.get(side) + .getFilter(); + } + + public boolean test(Direction side, ItemStack stack) { + if (!sidedFilters.containsKey(side)) + return true; + return sidedFilters.get(side) + .test(stack); + } + + @Override + public void destroy() { + sidedFilters.values() + .forEach(FilteringBehaviour::destroy); + super.destroy(); + } + + public void removeFilter(Direction side) { + if (!sidedFilters.containsKey(side)) + return; + sidedFilters.remove(side) + .destroy(); + } + + public boolean testHit(Direction direction, Vec3d hit) { + ValueBoxTransform.Sided sidedPositioning = (Sided) slotPositioning; + BlockState state = tileEntity.getBlockState(); + Vec3d localHit = hit.subtract(new Vec3d(tileEntity.getPos())); + return sidedPositioning.fromSide(direction) + .testHit(state, localHit); + } + +} diff --git a/src/main/java/com/simibubi/create/foundation/utility/NBTHelper.java b/src/main/java/com/simibubi/create/foundation/utility/NBTHelper.java index 6a08a3c62..cdb413a78 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/NBTHelper.java +++ b/src/main/java/com/simibubi/create/foundation/utility/NBTHelper.java @@ -2,6 +2,7 @@ package com.simibubi.create.foundation.utility; import java.util.ArrayList; import java.util.List; +import java.util.function.Consumer; import java.util.function.Function; import net.minecraft.item.ItemStack; @@ -28,7 +29,7 @@ public class NBTHelper { nbt.putString(key, enumConstant.name()); } - public static ListNBT writeCompoundList(List list, Function serializer) { + public static ListNBT writeCompoundList(Iterable list, Function serializer) { ListNBT listNBT = new ListNBT(); list.forEach(t -> listNBT.add(serializer.apply(t))); return listNBT; @@ -40,6 +41,10 @@ public class NBTHelper { return list; } + public static void iterateCompoundList(ListNBT listNBT, Consumer consumer) { + listNBT.forEach(inbt -> consumer.accept((CompoundNBT) inbt)); + } + public static ListNBT writeItemList(List stacks) { return writeCompoundList(stacks, ItemStack::serializeNBT); } diff --git a/src/main/resources/assets/create/models/block/belt_tunnel/cross.json b/src/main/resources/assets/create/models/block/belt_tunnel/cross.json index ebc0f82f0..8e83eda53 100644 --- a/src/main/resources/assets/create/models/block/belt_tunnel/cross.json +++ b/src/main/resources/assets/create/models/block/belt_tunnel/cross.json @@ -3,6 +3,7 @@ "parent": "block/block", "textures": { "0": "create:block/brass_tunnel", + "1": "create:block/brass_tunnel_top", "particle": "create:block/brass_tunnel" }, "elements": [ @@ -16,7 +17,7 @@ "east": {"uv": [3.5, 4, 4, 6], "texture": "#0"}, "south": {"uv": [0.5, 6, 3.5, 8], "texture": "#0"}, "west": {"uv": [0, 4, 0.5, 6], "texture": "#0"}, - "up": {"uv": [0.5, 3.5, 3.5, 4], "rotation": 180, "texture": "#0"}, + "up": {"uv": [2, 14, 14, 16], "rotation": 180, "texture": "#1"}, "down": {"uv": [0.75, 4, 3.5, 4.5], "texture": "#0"} } }, @@ -26,8 +27,8 @@ "to": [14, 16, 14], "rotation": {"angle": 0, "axis": "y", "origin": [7, -24, 8]}, "faces": { - "up": {"uv": [0.5, 0.5, 3.5, 3.5], "rotation": 180, "texture": "#0"}, - "down": {"uv": [0.5, 0.5, 3.5, 3.5], "rotation": 270, "texture": "#0"} + "up": {"uv": [2, 2, 14, 14], "rotation": 180, "texture": "#1"}, + "down": {"uv": [2, 2, 14, 14], "rotation": 270, "texture": "#1"} } }, { @@ -40,7 +41,7 @@ "east": {"uv": [0, 4, 0.5, 8.75], "texture": "#0"}, "south": {"uv": [0, 4, 0.5, 8.75], "texture": "#0"}, "west": {"uv": [3.5, 4, 4, 8.75], "texture": "#0"}, - "up": {"uv": [0, 3.5, 0.5, 4], "texture": "#0"} + "up": {"uv": [14, 0, 16, 2], "rotation": 180, "texture": "#1"} } }, { @@ -53,7 +54,7 @@ "east": {"uv": [3.5, 4, 4, 8.75], "texture": "#0"}, "south": {"uv": [0, 4, 0.5, 8.75], "texture": "#0"}, "west": {"uv": [0, 4, 0.5, 8.75], "texture": "#0"}, - "up": {"uv": [0, 3.5, 0.5, 4], "texture": "#0"} + "up": {"uv": [14, 14, 16, 16], "rotation": 180, "texture": "#1"} } }, { @@ -66,7 +67,7 @@ "east": {"uv": [0, 4, 0.5, 8.75], "texture": "#0"}, "south": {"uv": [3.5, 4, 4, 8.75], "texture": "#0"}, "west": {"uv": [3.5, 4, 4, 8.75], "texture": "#0"}, - "up": {"uv": [3.5, 3.5, 4, 4], "texture": "#0"} + "up": {"uv": [0, 0, 2, 2], "rotation": 180, "texture": "#1"} } }, { @@ -79,7 +80,7 @@ "east": {"uv": [3.5, 4, 4, 8.75], "texture": "#0"}, "south": {"uv": [3.5, 4, 4, 8.75], "texture": "#0"}, "west": {"uv": [0, 4, 0.5, 8.75], "texture": "#0"}, - "up": {"uv": [3.5, 3.5, 4, 4], "texture": "#0"} + "up": {"uv": [0, 14, 2, 16], "rotation": 180, "texture": "#1"} } }, { @@ -138,7 +139,7 @@ "faces": { "east": {"uv": [0.5, 6, 3.5, 8], "texture": "#0"}, "west": {"uv": [0.5, 4, 3.5, 6], "texture": "#0"}, - "up": {"uv": [3.5, 0.5, 4, 3.5], "rotation": 180, "texture": "#0"}, + "up": {"uv": [14, 2, 16, 14], "rotation": 180, "texture": "#1"}, "down": {"uv": [0.5, 5.5, 3.5, 6], "rotation": 270, "texture": "#0"} } }, @@ -150,7 +151,7 @@ "faces": { "north": {"uv": [0.5, 6, 3.5, 8], "texture": "#0"}, "south": {"uv": [0.5, 4, 3.5, 6], "texture": "#0"}, - "up": {"uv": [0.5, 3.5, 3.5, 4], "texture": "#0"}, + "up": {"uv": [2, 0, 14, 2], "rotation": 180, "texture": "#1"}, "down": {"uv": [0.5, 5.5, 3.5, 6], "texture": "#0"} } }, @@ -162,7 +163,7 @@ "faces": { "east": {"uv": [0.5, 4, 3.5, 6], "texture": "#0"}, "west": {"uv": [0.5, 6, 3.5, 8], "texture": "#0"}, - "up": {"uv": [0, 0.5, 0.5, 3.5], "rotation": 180, "texture": "#0"}, + "up": {"uv": [0, 2, 2, 14], "rotation": 180, "texture": "#1"}, "down": {"uv": [0.5, 4, 3.5, 4.5], "rotation": 270, "texture": "#0"} } } diff --git a/src/main/resources/assets/create/models/block/belt_tunnel/fullshade.json b/src/main/resources/assets/create/models/block/belt_tunnel/fullshade.json index 4b5217f11..ac691ace7 100644 --- a/src/main/resources/assets/create/models/block/belt_tunnel/fullshade.json +++ b/src/main/resources/assets/create/models/block/belt_tunnel/fullshade.json @@ -3,6 +3,7 @@ "parent": "block/block", "textures": { "0": "create:block/brass_tunnel", + "1": "create:block/brass_tunnel_top", "particle": "create:block/brass_tunnel" }, "elements": [ @@ -16,7 +17,7 @@ "east": {"uv": [3.5, 4, 4, 8.75], "texture": "#0"}, "south": {"uv": [12, 8.25, 16, 13], "texture": "#0"}, "west": {"uv": [0, 4, 0.5, 8.75], "texture": "#0"}, - "up": {"uv": [0, 3.5, 4, 4], "rotation": 180, "texture": "#0"} + "up": {"uv": [0, 14, 16, 16], "rotation": 180, "texture": "#1"} } }, { @@ -25,8 +26,8 @@ "to": [14, 16, 14], "rotation": {"angle": 0, "axis": "y", "origin": [7, -24, 8]}, "faces": { - "up": {"uv": [8.5, 0.25, 11.5, 3.25], "rotation": 180, "texture": "#0"}, - "down": {"uv": [0.5, 0.5, 3.5, 3.5], "rotation": 270, "texture": "#0"} + "up": {"uv": [12.5, 0.25, 15.5, 3.25], "rotation": 180, "texture": "#0"}, + "down": {"uv": [12.5, 0.25, 15.5, 3.25], "rotation": 180, "texture": "#0"} } }, { @@ -39,7 +40,7 @@ "east": {"uv": [0, 4, 0.5, 8.75], "texture": "#0"}, "south": {"uv": [12, 8.25, 16, 13], "texture": "#0"}, "west": {"uv": [3.5, 4, 4, 8.75], "texture": "#0"}, - "up": {"uv": [0, 0, 4, 0.5], "rotation": 180, "texture": "#0"} + "up": {"uv": [0, 0, 16, 2], "rotation": 180, "texture": "#1"} } }, { @@ -74,7 +75,7 @@ "faces": { "east": {"uv": [0.5, 6, 3.5, 8], "texture": "#0"}, "west": {"uv": [0.5, 4, 3.5, 6], "texture": "#0"}, - "up": {"uv": [3.5, 0.5, 4, 3.5], "rotation": 180, "texture": "#0"}, + "up": {"uv": [14, 2, 16, 14], "rotation": 180, "texture": "#1"}, "down": {"uv": [0.5, 5.5, 3.5, 6], "rotation": 270, "texture": "#0"} } }, @@ -86,7 +87,7 @@ "faces": { "east": {"uv": [0.5, 4, 3.5, 6], "texture": "#0"}, "west": {"uv": [0.5, 6, 3.5, 8], "texture": "#0"}, - "up": {"uv": [0, 0.5, 0.5, 3.5], "rotation": 180, "texture": "#0"}, + "up": {"uv": [0, 2, 2, 14], "rotation": 180, "texture": "#1"}, "down": {"uv": [0.5, 4, 3.5, 4.5], "rotation": 270, "texture": "#0"} } } diff --git a/src/main/resources/assets/create/models/block/belt_tunnel/halfshade.json b/src/main/resources/assets/create/models/block/belt_tunnel/halfshade.json index bc5fe4c68..80896ef75 100644 --- a/src/main/resources/assets/create/models/block/belt_tunnel/halfshade.json +++ b/src/main/resources/assets/create/models/block/belt_tunnel/halfshade.json @@ -3,6 +3,7 @@ "parent": "block/block", "textures": { "0": "create:block/brass_tunnel", + "1": "create:block/brass_tunnel_top", "particle": "create:block/brass_tunnel" }, "elements": [ @@ -16,7 +17,7 @@ "east": {"uv": [3.5, 4, 4, 8.75], "texture": "#0"}, "south": {"uv": [8, 3.5, 12, 8.25], "texture": "#0"}, "west": {"uv": [0, 4, 0.5, 8.75], "texture": "#0"}, - "up": {"uv": [0, 3.5, 4, 4], "rotation": 180, "texture": "#0"} + "up": {"uv": [0, 14, 16, 16], "rotation": 180, "texture": "#1"} } }, { @@ -26,7 +27,7 @@ "rotation": {"angle": 0, "axis": "y", "origin": [7, -24, 8]}, "faces": { "up": {"uv": [8.5, 0.25, 11.5, 3.25], "rotation": 180, "texture": "#0"}, - "down": {"uv": [0.5, 0.5, 3.5, 3.5], "rotation": 270, "texture": "#0"} + "down": {"uv": [8.5, 0.25, 11.5, 3.25], "rotation": 270, "texture": "#0"} } }, { @@ -39,7 +40,7 @@ "east": {"uv": [0, 4, 0.5, 8.75], "texture": "#0"}, "south": {"uv": [8, 3.5, 12, 8.25], "texture": "#0"}, "west": {"uv": [3.5, 4, 4, 8.75], "texture": "#0"}, - "up": {"uv": [0, 0, 4, 0.5], "rotation": 180, "texture": "#0"} + "up": {"uv": [0, 0, 16, 2], "rotation": 180, "texture": "#1"} } }, { @@ -74,7 +75,7 @@ "faces": { "east": {"uv": [0.5, 6, 3.5, 8], "texture": "#0"}, "west": {"uv": [0.5, 4, 3.5, 6], "texture": "#0"}, - "up": {"uv": [3.5, 0.5, 4, 3.5], "rotation": 180, "texture": "#0"}, + "up": {"uv": [14, 2, 16, 14], "rotation": 180, "texture": "#1"}, "down": {"uv": [0.5, 5.5, 3.5, 6], "rotation": 270, "texture": "#0"} } }, @@ -86,7 +87,7 @@ "faces": { "east": {"uv": [0.5, 4, 3.5, 6], "texture": "#0"}, "west": {"uv": [0.5, 6, 3.5, 8], "texture": "#0"}, - "up": {"uv": [0, 0.5, 0.5, 3.5], "rotation": 180, "texture": "#0"}, + "up": {"uv": [0, 2, 2, 14], "rotation": 180, "texture": "#1"}, "down": {"uv": [0.5, 4, 3.5, 4.5], "rotation": 270, "texture": "#0"} } } diff --git a/src/main/resources/assets/create/models/block/belt_tunnel/indicator.json b/src/main/resources/assets/create/models/block/belt_tunnel/indicator.json deleted file mode 100644 index 0b0a2e788..000000000 --- a/src/main/resources/assets/create/models/block/belt_tunnel/indicator.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "credit": "Made with Blockbench", - "parent": "block/block", - "textures": { - "0": "create:block/brass_tunnel", - "particle": "create:block/brass_tunnel" - }, - "elements": [ - { - "from": [6, 10, 16], - "to": [10, 14, 17], - "faces": { - "north": {"uv": [4.75, 0, 5.75, 1], "texture": "#0"}, - "east": {"uv": [5.5, 0, 5.75, 1], "texture": "#0"}, - "south": {"uv": [4.75, 0, 5.75, 1], "texture": "#0"}, - "west": {"uv": [4.75, 0, 5, 1], "texture": "#0"}, - "up": {"uv": [4.75, 0, 5, 1], "rotation": 270, "texture": "#0"}, - "down": {"uv": [4.75, 0, 5, 1], "rotation": 90, "texture": "#0"} - } - } - ] -} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/belt_tunnel/item.json b/src/main/resources/assets/create/models/block/belt_tunnel/item.json index fdde3f3a9..9ff7c583a 100644 --- a/src/main/resources/assets/create/models/block/belt_tunnel/item.json +++ b/src/main/resources/assets/create/models/block/belt_tunnel/item.json @@ -3,6 +3,7 @@ "parent": "block/block", "textures": { "0": "create:block/brass_tunnel", + "1": "create:block/brass_tunnel_top", "particle": "create:block/brass_tunnel" }, "elements": [ @@ -16,7 +17,7 @@ "east": {"uv": [3.5, 4, 4, 8.75], "texture": "#0"}, "south": {"uv": [4, 3.5, 8, 8.25], "texture": "#0"}, "west": {"uv": [0, 4, 0.5, 8.75], "texture": "#0"}, - "up": {"uv": [0, 3.5, 4, 4], "rotation": 180, "texture": "#0"} + "up": {"uv": [0, 14, 16, 16], "rotation": 180, "texture": "#1"} } }, { @@ -25,8 +26,8 @@ "to": [14, 16, 14], "rotation": {"angle": 0, "axis": "y", "origin": [7, -24, 8]}, "faces": { - "up": {"uv": [0.5, 0.5, 3.5, 3.5], "rotation": 180, "texture": "#0"}, - "down": {"uv": [0.5, 0.5, 3.5, 3.5], "rotation": 270, "texture": "#0"} + "up": {"uv": [2, 2, 14, 14], "rotation": 180, "texture": "#1"}, + "down": {"uv": [2, 2, 14, 14], "rotation": 270, "texture": "#1"} } }, { @@ -39,7 +40,7 @@ "east": {"uv": [0, 4, 0.5, 8.75], "texture": "#0"}, "south": {"uv": [4, 3.5, 8, 8.25], "texture": "#0"}, "west": {"uv": [3.5, 4, 4, 8.75], "texture": "#0"}, - "up": {"uv": [0, 0, 4, 0.5], "rotation": 180, "texture": "#0"} + "up": {"uv": [0, 0, 16, 2], "rotation": 180, "texture": "#1"} } }, { @@ -74,7 +75,7 @@ "faces": { "east": {"uv": [0.5, 6, 3.5, 8], "texture": "#0"}, "west": {"uv": [0.5, 4, 3.5, 6], "texture": "#0"}, - "up": {"uv": [3.5, 0.5, 4, 3.5], "rotation": 180, "texture": "#0"}, + "up": {"uv": [14, 2, 16, 14], "rotation": 180, "texture": "#1"}, "down": {"uv": [0.5, 5.5, 3.5, 6], "rotation": 270, "texture": "#0"} } }, @@ -86,7 +87,7 @@ "faces": { "east": {"uv": [0.5, 4, 3.5, 6], "texture": "#0"}, "west": {"uv": [0.5, 6, 3.5, 8], "texture": "#0"}, - "up": {"uv": [0, 0.5, 0.5, 3.5], "rotation": 180, "texture": "#0"}, + "up": {"uv": [0, 2, 2, 14], "rotation": 180, "texture": "#1"}, "down": {"uv": [0.5, 4, 3.5, 4.5], "rotation": 270, "texture": "#0"} } }, diff --git a/src/main/resources/assets/create/models/block/belt_tunnel/straight.json b/src/main/resources/assets/create/models/block/belt_tunnel/straight.json index 2de43a1e2..ad748b321 100644 --- a/src/main/resources/assets/create/models/block/belt_tunnel/straight.json +++ b/src/main/resources/assets/create/models/block/belt_tunnel/straight.json @@ -3,7 +3,8 @@ "parent": "block/block", "textures": { "0": "create:block/brass_tunnel", - "particle": "create:block/brass_tunnel" + "1": "create:block/brass_tunnel_top", + "particle": "create:block/brass_tunnel_top" }, "elements": [ { @@ -16,7 +17,7 @@ "east": {"uv": [3.5, 4, 4, 8.75], "texture": "#0"}, "south": {"uv": [4, 3.5, 8, 8.25], "texture": "#0"}, "west": {"uv": [0, 4, 0.5, 8.75], "texture": "#0"}, - "up": {"uv": [0, 3.5, 4, 4], "rotation": 180, "texture": "#0"} + "up": {"uv": [0, 14, 16, 16], "rotation": 180, "texture": "#1"} } }, { @@ -25,8 +26,8 @@ "to": [14, 16, 14], "rotation": {"angle": 0, "axis": "y", "origin": [7, -24, 8]}, "faces": { - "up": {"uv": [0.5, 0.5, 3.5, 3.5], "rotation": 180, "texture": "#0"}, - "down": {"uv": [0.5, 0.5, 3.5, 3.5], "rotation": 270, "texture": "#0"} + "up": {"uv": [2, 2, 14, 14], "rotation": 180, "texture": "#1"}, + "down": {"uv": [2, 2, 14, 14], "rotation": 270, "texture": "#1"} } }, { @@ -39,7 +40,7 @@ "east": {"uv": [0, 4, 0.5, 8.75], "texture": "#0"}, "south": {"uv": [4, 3.5, 8, 8.25], "texture": "#0"}, "west": {"uv": [3.5, 4, 4, 8.75], "texture": "#0"}, - "up": {"uv": [0, 0, 4, 0.5], "rotation": 180, "texture": "#0"} + "up": {"uv": [0, 0, 16, 2], "rotation": 180, "texture": "#1"} } }, { @@ -74,7 +75,7 @@ "faces": { "east": {"uv": [0.5, 6, 3.5, 8], "texture": "#0"}, "west": {"uv": [0.5, 4, 3.5, 6], "texture": "#0"}, - "up": {"uv": [3.5, 0.5, 4, 3.5], "rotation": 180, "texture": "#0"}, + "up": {"uv": [14, 2, 16, 14], "rotation": 180, "texture": "#1"}, "down": {"uv": [0.5, 5.5, 3.5, 6], "rotation": 270, "texture": "#0"} } }, @@ -86,7 +87,7 @@ "faces": { "east": {"uv": [0.5, 4, 3.5, 6], "texture": "#0"}, "west": {"uv": [0.5, 6, 3.5, 8], "texture": "#0"}, - "up": {"uv": [0, 0.5, 0.5, 3.5], "rotation": 180, "texture": "#0"}, + "up": {"uv": [0, 2, 2, 14], "rotation": 180, "texture": "#1"}, "down": {"uv": [0.5, 4, 3.5, 4.5], "rotation": 270, "texture": "#0"} } } diff --git a/src/main/resources/assets/create/models/block/belt_tunnel/t_left.json b/src/main/resources/assets/create/models/block/belt_tunnel/t_left.json index b2c3f760f..09187e938 100644 --- a/src/main/resources/assets/create/models/block/belt_tunnel/t_left.json +++ b/src/main/resources/assets/create/models/block/belt_tunnel/t_left.json @@ -3,6 +3,7 @@ "parent": "block/block", "textures": { "0": "create:block/brass_tunnel", + "1": "create:block/brass_tunnel_top", "particle": "create:block/brass_tunnel" }, "elements": [ @@ -16,7 +17,7 @@ "east": {"uv": [3.5, 4, 4, 8.75], "texture": "#0"}, "south": {"uv": [4, 3.5, 8, 8.25], "texture": "#0"}, "west": {"uv": [0, 4, 0.5, 8.75], "texture": "#0"}, - "up": {"uv": [0, 3.5, 4, 4], "rotation": 180, "texture": "#0"} + "up": {"uv": [0, 14, 16, 16], "rotation": 180, "texture": "#1"} } }, { @@ -25,8 +26,8 @@ "to": [14, 16, 14], "rotation": {"angle": 0, "axis": "y", "origin": [7, -24, 8]}, "faces": { - "up": {"uv": [0.5, 0.5, 3.5, 3.5], "rotation": 180, "texture": "#0"}, - "down": {"uv": [0.5, 0.5, 3.5, 3.5], "rotation": 270, "texture": "#0"} + "up": {"uv": [2, 2, 14, 14], "rotation": 180, "texture": "#1"}, + "down": {"uv": [2, 2, 14, 14], "rotation": 270, "texture": "#1"} } }, { @@ -39,7 +40,7 @@ "east": {"uv": [0, 4, 0.5, 8.75], "texture": "#0"}, "south": {"uv": [0, 4, 0.5, 8.75], "texture": "#0"}, "west": {"uv": [3.5, 4, 4, 8.75], "texture": "#0"}, - "up": {"uv": [0, 3.5, 0.5, 4], "texture": "#0"} + "up": {"uv": [14, 0, 16, 2], "rotation": 180, "texture": "#1"} } }, { @@ -52,7 +53,7 @@ "east": {"uv": [0, 4, 0.5, 8.75], "texture": "#0"}, "south": {"uv": [3.5, 4, 4, 8.75], "texture": "#0"}, "west": {"uv": [3.5, 4, 4, 8.75], "texture": "#0"}, - "up": {"uv": [3.5, 3.5, 4, 4], "texture": "#0"} + "up": {"uv": [0, 0, 2, 2], "rotation": 180, "texture": "#1"} } }, { @@ -99,7 +100,7 @@ "faces": { "east": {"uv": [0.5, 6, 3.5, 8], "texture": "#0"}, "west": {"uv": [0.5, 4, 3.5, 6], "texture": "#0"}, - "up": {"uv": [3.5, 0.5, 4, 3.5], "rotation": 180, "texture": "#0"}, + "up": {"uv": [14, 2, 16, 14], "rotation": 180, "texture": "#1"}, "down": {"uv": [0.5, 5.5, 3.5, 6], "rotation": 270, "texture": "#0"} } }, @@ -111,7 +112,7 @@ "faces": { "north": {"uv": [0.5, 6, 3.5, 8], "texture": "#0"}, "south": {"uv": [0.5, 4, 3.5, 6], "texture": "#0"}, - "up": {"uv": [0.5, 3.5, 3.5, 4], "texture": "#0"}, + "up": {"uv": [2, 0, 14, 2], "rotation": 180, "texture": "#1"}, "down": {"uv": [0.5, 5.5, 3.5, 6], "texture": "#0"} } }, @@ -123,7 +124,7 @@ "faces": { "east": {"uv": [0.5, 4, 3.5, 6], "texture": "#0"}, "west": {"uv": [0.5, 6, 3.5, 8], "texture": "#0"}, - "up": {"uv": [0, 0.5, 0.5, 3.5], "rotation": 180, "texture": "#0"}, + "up": {"uv": [0, 2, 2, 14], "rotation": 180, "texture": "#1"}, "down": {"uv": [0.5, 4, 3.5, 4.5], "rotation": 270, "texture": "#0"} } } diff --git a/src/main/resources/assets/create/models/block/belt_tunnel/t_right.json b/src/main/resources/assets/create/models/block/belt_tunnel/t_right.json index 15d6fdcbd..070464014 100644 --- a/src/main/resources/assets/create/models/block/belt_tunnel/t_right.json +++ b/src/main/resources/assets/create/models/block/belt_tunnel/t_right.json @@ -3,6 +3,7 @@ "parent": "block/block", "textures": { "0": "create:block/brass_tunnel", + "1": "create:block/brass_tunnel_top", "particle": "create:block/brass_tunnel" }, "elements": [ @@ -16,7 +17,7 @@ "east": {"uv": [0, 4, 0.5, 8.75], "texture": "#0"}, "south": {"uv": [4, 3.5, 8, 8.25], "texture": "#0"}, "west": {"uv": [3.5, 4, 4, 8.75], "texture": "#0"}, - "up": {"uv": [0, 3.5, 4, 4], "texture": "#0"} + "up": {"uv": [0, 0, 16, 2], "rotation": 180, "texture": "#1"} } }, { @@ -25,8 +26,8 @@ "to": [14, 16, 14], "rotation": {"angle": 0, "axis": "y", "origin": [9, -24, 8]}, "faces": { - "up": {"uv": [0.5, 0.5, 3.5, 3.5], "texture": "#0"}, - "down": {"uv": [0.5, 0.5, 3.5, 3.5], "rotation": 90, "texture": "#0"} + "up": {"uv": [2, 2, 14, 14], "rotation": 180, "texture": "#1"}, + "down": {"uv": [2, 2, 14, 14], "rotation": 90, "texture": "#1"} } }, { @@ -39,7 +40,7 @@ "east": {"uv": [3.5, 4, 4, 8.75], "texture": "#0"}, "south": {"uv": [7.5, 3.5, 8, 8.25], "texture": "#0"}, "west": {"uv": [0, 4, 0.5, 8.75], "texture": "#0"}, - "up": {"uv": [0, 3.5, 0.5, 4], "rotation": 180, "texture": "#0"} + "up": {"uv": [0, 14, 2, 16], "rotation": 180, "texture": "#1"} } }, { @@ -52,7 +53,7 @@ "east": {"uv": [3.5, 4, 4, 8.75], "texture": "#0"}, "south": {"uv": [4, 3.5, 4.5, 8.25], "texture": "#0"}, "west": {"uv": [0, 4, 0.5, 8.75], "texture": "#0"}, - "up": {"uv": [3.5, 3.5, 4, 4], "rotation": 180, "texture": "#0"} + "up": {"uv": [14, 14, 16, 16], "rotation": 180, "texture": "#1"} } }, { @@ -99,7 +100,7 @@ "faces": { "east": {"uv": [0.5, 4, 3.5, 6], "texture": "#0"}, "west": {"uv": [0.5, 6, 3.5, 8], "texture": "#0"}, - "up": {"uv": [3.5, 0.5, 4, 3.5], "texture": "#0"}, + "up": {"uv": [0, 2, 2, 14], "rotation": 180, "texture": "#1"}, "down": {"uv": [0.5, 5.5, 3.5, 6], "rotation": 90, "texture": "#0"} } }, @@ -111,7 +112,7 @@ "faces": { "north": {"uv": [0.5, 4, 3.5, 6], "texture": "#0"}, "south": {"uv": [0.5, 6, 3.5, 8], "texture": "#0"}, - "up": {"uv": [0.5, 3.5, 3.5, 4], "rotation": 180, "texture": "#0"}, + "up": {"uv": [2, 14, 14, 16], "rotation": 180, "texture": "#1"}, "down": {"uv": [0.5, 5.5, 3.5, 6], "rotation": 180, "texture": "#0"} } }, @@ -123,7 +124,7 @@ "faces": { "east": {"uv": [0.5, 6, 3.5, 8], "texture": "#0"}, "west": {"uv": [0.5, 4, 3.5, 6], "texture": "#0"}, - "up": {"uv": [0, 0.5, 0.5, 3.5], "texture": "#0"}, + "up": {"uv": [14, 2, 16, 14], "rotation": 180, "texture": "#1"}, "down": {"uv": [0.5, 4, 3.5, 4.5], "rotation": 90, "texture": "#0"} } } diff --git a/src/main/resources/assets/create/models/block/belt_tunnel/window.json b/src/main/resources/assets/create/models/block/belt_tunnel/window.json index 38de43720..3fd4275f9 100644 --- a/src/main/resources/assets/create/models/block/belt_tunnel/window.json +++ b/src/main/resources/assets/create/models/block/belt_tunnel/window.json @@ -3,6 +3,7 @@ "parent": "block/block", "textures": { "0": "create:block/brass_tunnel", + "1": "create:block/brass_tunnel_top", "particle": "create:block/brass_tunnel" }, "elements": [ @@ -16,7 +17,7 @@ "east": {"uv": [3.5, 4, 4, 8.75], "texture": "#0"}, "south": {"uv": [12, 3.5, 16, 8.25], "texture": "#0"}, "west": {"uv": [0, 4, 0.5, 8.75], "texture": "#0"}, - "up": {"uv": [0, 3.5, 4, 4], "rotation": 180, "texture": "#0"} + "up": {"uv": [0, 14, 16, 16], "rotation": 180, "texture": "#1"} } }, { @@ -26,7 +27,7 @@ "rotation": {"angle": 0, "axis": "y", "origin": [7, -24, 8]}, "faces": { "up": {"uv": [8.5, 0.25, 11.5, 3.25], "rotation": 180, "texture": "#0"}, - "down": {"uv": [0.5, 0.5, 3.5, 3.5], "rotation": 270, "texture": "#0"} + "down": {"uv": [8.5, 0.25, 11.5, 3.25], "rotation": 270, "texture": "#0"} } }, { @@ -39,7 +40,7 @@ "east": {"uv": [0, 4, 0.5, 8.75], "texture": "#0"}, "south": {"uv": [12, 3.5, 16, 8.25], "texture": "#0"}, "west": {"uv": [3.5, 4, 4, 8.75], "texture": "#0"}, - "up": {"uv": [0, 0, 4, 0.5], "rotation": 180, "texture": "#0"} + "up": {"uv": [0, 0, 16, 2], "rotation": 180, "texture": "#1"} } }, { @@ -74,7 +75,7 @@ "faces": { "east": {"uv": [0.5, 6, 3.5, 8], "texture": "#0"}, "west": {"uv": [0.5, 4, 3.5, 6], "texture": "#0"}, - "up": {"uv": [3.5, 0.5, 4, 3.5], "rotation": 180, "texture": "#0"}, + "up": {"uv": [14, 2, 16, 14], "rotation": 180, "texture": "#1"}, "down": {"uv": [0.5, 5.5, 3.5, 6], "rotation": 270, "texture": "#0"} } }, @@ -86,7 +87,7 @@ "faces": { "east": {"uv": [0.5, 4, 3.5, 6], "texture": "#0"}, "west": {"uv": [0.5, 6, 3.5, 8], "texture": "#0"}, - "up": {"uv": [0, 0.5, 0.5, 3.5], "rotation": 180, "texture": "#0"}, + "up": {"uv": [0, 2, 2, 14], "rotation": 180, "texture": "#1"}, "down": {"uv": [0.5, 4, 3.5, 4.5], "rotation": 270, "texture": "#0"} } } diff --git a/src/main/resources/assets/create/textures/block/andesite_tunnel.png b/src/main/resources/assets/create/textures/block/andesite_tunnel.png index 6c6c41b10..398c50661 100644 Binary files a/src/main/resources/assets/create/textures/block/andesite_tunnel.png and b/src/main/resources/assets/create/textures/block/andesite_tunnel.png differ diff --git a/src/main/resources/assets/create/textures/block/andesite_tunnel_top.png b/src/main/resources/assets/create/textures/block/andesite_tunnel_top.png new file mode 100644 index 000000000..272c1cf07 Binary files /dev/null and b/src/main/resources/assets/create/textures/block/andesite_tunnel_top.png differ diff --git a/src/main/resources/assets/create/textures/block/brass_tunnel.png b/src/main/resources/assets/create/textures/block/brass_tunnel.png index 2631e8c8d..acc1814cd 100644 Binary files a/src/main/resources/assets/create/textures/block/brass_tunnel.png and b/src/main/resources/assets/create/textures/block/brass_tunnel.png differ diff --git a/src/main/resources/assets/create/textures/block/brass_tunnel_top.png b/src/main/resources/assets/create/textures/block/brass_tunnel_top.png new file mode 100644 index 000000000..508d6c0aa Binary files /dev/null and b/src/main/resources/assets/create/textures/block/brass_tunnel_top.png differ diff --git a/src/main/resources/assets/create/textures/block/brass_tunnel_top_connected.png b/src/main/resources/assets/create/textures/block/brass_tunnel_top_connected.png new file mode 100644 index 000000000..deeb28a42 Binary files /dev/null and b/src/main/resources/assets/create/textures/block/brass_tunnel_top_connected.png differ