diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache index 9d0048b1d..e049ac862 100644 --- a/src/generated/resources/.cache/cache +++ b/src/generated/resources/.cache/cache @@ -426,20 +426,20 @@ a3a11524cd3515fc01d905767b4b7ea782adaf03 assets/create/blockstates/yellow_seat.j 7f39521b211441f5c3e06d60c5978cebe16cacfb assets/create/blockstates/zinc_block.json b7181bcd8182b2f17088e5aa881f374c9c65470c assets/create/blockstates/zinc_ore.json e1d3c02695cbd2ee7bbede97f72941835634a3a5 assets/create/lang/en_ud.json -7628f0328198a4100dc938de4c4ea8f792473a85 assets/create/lang/en_us.json -54c93de1ca876299fc34dc593580aeed5748aa15 assets/create/lang/unfinished/de_de.json -51ed1df10b8afcf27f9dcdae3bca80d05740d450 assets/create/lang/unfinished/es_es.json -72e1a89ef45c530eaab6f27b4d2dd447775b5d0a assets/create/lang/unfinished/es_mx.json -0da959961c4bde45bcef869bc9bd58eac1d3bd40 assets/create/lang/unfinished/fr_fr.json -ba963b9db50f0ea57dee1a93664aacf2dc44eec5 assets/create/lang/unfinished/it_it.json -caa45f4ae4e4e9b338999b7975767dc33e569881 assets/create/lang/unfinished/ja_jp.json -aaa8ecc84b853cc8a93f8d5812f22beefaf48266 assets/create/lang/unfinished/ko_kr.json -2046b5e7c9904f6ac07d7f9b94fd80a52a1f5721 assets/create/lang/unfinished/nl_nl.json -70f552fe3bd0365d9f1f339032bc598bc0ff9026 assets/create/lang/unfinished/pl_pl.json -427a0252a5f3d5282ab572c6b06638117ed68760 assets/create/lang/unfinished/pt_br.json -f12de6d61ff3f634e5af7485230032202ce0f9de assets/create/lang/unfinished/ru_ru.json -75c32bf33d907d0575d05ad575566d50bc78c1c9 assets/create/lang/unfinished/zh_cn.json -32a411bf248dae1eeb8a3e7d9450e5c1b9cd0b59 assets/create/lang/unfinished/zh_tw.json +f7ffc8417ea58584ecbe70ce0e9a6ec74e5ec463 assets/create/lang/en_us.json +cc3d964242bf7e777caa0edb5f62e00246a28993 assets/create/lang/unfinished/de_de.json +8e90f32c39e3a4d7e85b2db53100ffc90cc8eb67 assets/create/lang/unfinished/es_es.json +a01222895bd7e3d06d7ae3d34fa4caecbd86448d assets/create/lang/unfinished/es_mx.json +b05d56b0e9d724490ea143a3685b0bc9ebe6268a assets/create/lang/unfinished/fr_fr.json +1633b5a42865fba17572980560ad07a3015c1743 assets/create/lang/unfinished/it_it.json +5422e990c8075d4132d58287fa9ca858f9a0bc1f assets/create/lang/unfinished/ja_jp.json +05eac4946a1172cf32d171d23f4049a58654b43b assets/create/lang/unfinished/ko_kr.json +95828eb4fa2e1353f737dc909407af21d50be149 assets/create/lang/unfinished/nl_nl.json +d8ed3929f5d8f0e58f4bd4de34ab20395f8d2c55 assets/create/lang/unfinished/pl_pl.json +ae37d77d132f6fac4bc718273637a367959533a1 assets/create/lang/unfinished/pt_br.json +4710f5a451b522b1a99529f79c68674df5d7fc57 assets/create/lang/unfinished/ru_ru.json +9f2a382e23291db21f8e441eb6a14adbfdcf2d9f assets/create/lang/unfinished/zh_cn.json +9bb1d1a10e4d536ef629114516a9ccadea2da110 assets/create/lang/unfinished/zh_tw.json 487a511a01b2a4531fb672f917922312db78f958 assets/create/models/block/acacia_window.json b48060cba1a382f373a05bf0039054053eccf076 assets/create/models/block/acacia_window_pane_noside.json 3066db1bf03cffa1a9c7fbacf47ae586632f4eb3 assets/create/models/block/acacia_window_pane_noside_alt.json diff --git a/src/generated/resources/assets/create/lang/en_us.json b/src/generated/resources/assets/create/lang/en_us.json index 1164784c1..29a8c9a09 100644 --- a/src/generated/resources/assets/create/lang/en_us.json +++ b/src/generated/resources/assets/create/lang/en_us.json @@ -1164,6 +1164,9 @@ "create.tooltip.chute.fans_pull_up": "Fans pull from Above", "create.tooltip.chute.fans_pull_down": "Fans pull from Below", "create.tooltip.chute.contains": "Contains: %1$s x%2$s", + "create.tooltip.brass_tunnel.contains": "Currently distributing:", + "create.tooltip.brass_tunnel.contains_entry": "> %1$s x%2$s", + "create.tooltip.brass_tunnel.retrieve": "Right-Click to retrieve", "create.linked_controller.bind_mode": "Bind mode active", "create.linked_controller.press_keybind": "Press %1$s, %2$s, %3$s, %4$s, %5$s or %6$s, to bind this frequency to the respective key", diff --git a/src/generated/resources/assets/create/lang/unfinished/de_de.json b/src/generated/resources/assets/create/lang/unfinished/de_de.json index fe205fa5b..61a378803 100644 --- a/src/generated/resources/assets/create/lang/unfinished/de_de.json +++ b/src/generated/resources/assets/create/lang/unfinished/de_de.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 1126", + "_": "Missing Localizations: 1129", "_": "->------------------------] Game Elements [------------------------<-", @@ -1165,6 +1165,9 @@ "create.tooltip.chute.fans_pull_up": "Propeller ziehen von oberhalb", "create.tooltip.chute.fans_pull_down": "Propeller ziehen von unterhalb", "create.tooltip.chute.contains": "Enthält: %1$s x%2$s", + "create.tooltip.brass_tunnel.contains": "UNLOCALIZED: Currently distributing:", + "create.tooltip.brass_tunnel.contains_entry": "UNLOCALIZED: > %1$s x%2$s", + "create.tooltip.brass_tunnel.retrieve": "UNLOCALIZED: Right-Click to retrieve", "create.linked_controller.bind_mode": "UNLOCALIZED: Bind mode active", "create.linked_controller.press_keybind": "UNLOCALIZED: Press %1$s, %2$s, %3$s, %4$s, %5$s or %6$s, to bind this frequency to the respective key", diff --git a/src/generated/resources/assets/create/lang/unfinished/es_es.json b/src/generated/resources/assets/create/lang/unfinished/es_es.json index 87d851556..825c63f65 100644 --- a/src/generated/resources/assets/create/lang/unfinished/es_es.json +++ b/src/generated/resources/assets/create/lang/unfinished/es_es.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 49", + "_": "Missing Localizations: 52", "_": "->------------------------] Game Elements [------------------------<-", @@ -1165,6 +1165,9 @@ "create.tooltip.chute.fans_pull_up": "Los ventiladores tiran desde arriba", "create.tooltip.chute.fans_pull_down": "Los ventiladores tiran desde abajo", "create.tooltip.chute.contains": "Contiene: %1$s x%2$s", + "create.tooltip.brass_tunnel.contains": "UNLOCALIZED: Currently distributing:", + "create.tooltip.brass_tunnel.contains_entry": "UNLOCALIZED: > %1$s x%2$s", + "create.tooltip.brass_tunnel.retrieve": "UNLOCALIZED: Right-Click to retrieve", "create.linked_controller.bind_mode": "Modo de enlace activo", "create.linked_controller.press_keybind": "Presiona %1$s, %2$s, %3$s, %4$s, %5$s o %6$s, para vincular esta frecuencia a la tecla correspondiente", diff --git a/src/generated/resources/assets/create/lang/unfinished/es_mx.json b/src/generated/resources/assets/create/lang/unfinished/es_mx.json index 9806485df..9c1662f37 100644 --- a/src/generated/resources/assets/create/lang/unfinished/es_mx.json +++ b/src/generated/resources/assets/create/lang/unfinished/es_mx.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 1493", + "_": "Missing Localizations: 1496", "_": "->------------------------] Game Elements [------------------------<-", @@ -1165,6 +1165,9 @@ "create.tooltip.chute.fans_pull_up": "UNLOCALIZED: Fans pull from Above", "create.tooltip.chute.fans_pull_down": "UNLOCALIZED: Fans pull from Below", "create.tooltip.chute.contains": "UNLOCALIZED: Contains: %1$s x%2$s", + "create.tooltip.brass_tunnel.contains": "UNLOCALIZED: Currently distributing:", + "create.tooltip.brass_tunnel.contains_entry": "UNLOCALIZED: > %1$s x%2$s", + "create.tooltip.brass_tunnel.retrieve": "UNLOCALIZED: Right-Click to retrieve", "create.linked_controller.bind_mode": "UNLOCALIZED: Bind mode active", "create.linked_controller.press_keybind": "UNLOCALIZED: Press %1$s, %2$s, %3$s, %4$s, %5$s or %6$s, to bind this frequency to the respective key", diff --git a/src/generated/resources/assets/create/lang/unfinished/fr_fr.json b/src/generated/resources/assets/create/lang/unfinished/fr_fr.json index 561607ad2..284af00e8 100644 --- a/src/generated/resources/assets/create/lang/unfinished/fr_fr.json +++ b/src/generated/resources/assets/create/lang/unfinished/fr_fr.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 1378", + "_": "Missing Localizations: 1381", "_": "->------------------------] Game Elements [------------------------<-", @@ -1165,6 +1165,9 @@ "create.tooltip.chute.fans_pull_up": "UNLOCALIZED: Fans pull from Above", "create.tooltip.chute.fans_pull_down": "UNLOCALIZED: Fans pull from Below", "create.tooltip.chute.contains": "UNLOCALIZED: Contains: %1$s x%2$s", + "create.tooltip.brass_tunnel.contains": "UNLOCALIZED: Currently distributing:", + "create.tooltip.brass_tunnel.contains_entry": "UNLOCALIZED: > %1$s x%2$s", + "create.tooltip.brass_tunnel.retrieve": "UNLOCALIZED: Right-Click to retrieve", "create.linked_controller.bind_mode": "UNLOCALIZED: Bind mode active", "create.linked_controller.press_keybind": "UNLOCALIZED: Press %1$s, %2$s, %3$s, %4$s, %5$s or %6$s, to bind this frequency to the respective key", diff --git a/src/generated/resources/assets/create/lang/unfinished/it_it.json b/src/generated/resources/assets/create/lang/unfinished/it_it.json index 2ebf47e7c..21fbf2683 100644 --- a/src/generated/resources/assets/create/lang/unfinished/it_it.json +++ b/src/generated/resources/assets/create/lang/unfinished/it_it.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 906", + "_": "Missing Localizations: 909", "_": "->------------------------] Game Elements [------------------------<-", @@ -1165,6 +1165,9 @@ "create.tooltip.chute.fans_pull_up": "I ventilatori tirano da sopra", "create.tooltip.chute.fans_pull_down": "I ventilatori tirano da sotto", "create.tooltip.chute.contains": "Contiene: %1$s x%2$s", + "create.tooltip.brass_tunnel.contains": "UNLOCALIZED: Currently distributing:", + "create.tooltip.brass_tunnel.contains_entry": "UNLOCALIZED: > %1$s x%2$s", + "create.tooltip.brass_tunnel.retrieve": "UNLOCALIZED: Right-Click to retrieve", "create.linked_controller.bind_mode": "UNLOCALIZED: Bind mode active", "create.linked_controller.press_keybind": "UNLOCALIZED: Press %1$s, %2$s, %3$s, %4$s, %5$s or %6$s, to bind this frequency to the respective key", diff --git a/src/generated/resources/assets/create/lang/unfinished/ja_jp.json b/src/generated/resources/assets/create/lang/unfinished/ja_jp.json index 5cdfa25f3..a53bab0a1 100644 --- a/src/generated/resources/assets/create/lang/unfinished/ja_jp.json +++ b/src/generated/resources/assets/create/lang/unfinished/ja_jp.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 38", + "_": "Missing Localizations: 41", "_": "->------------------------] Game Elements [------------------------<-", @@ -1165,6 +1165,9 @@ "create.tooltip.chute.fans_pull_up": "ファンが上から吸い込んでいます", "create.tooltip.chute.fans_pull_down": "ファンが下から吸い込んでいます", "create.tooltip.chute.contains": "内容物: %1$s x%2$s", + "create.tooltip.brass_tunnel.contains": "UNLOCALIZED: Currently distributing:", + "create.tooltip.brass_tunnel.contains_entry": "UNLOCALIZED: > %1$s x%2$s", + "create.tooltip.brass_tunnel.retrieve": "UNLOCALIZED: Right-Click to retrieve", "create.linked_controller.bind_mode": "割り当てモード", "create.linked_controller.press_keybind": "%1$s、%2$s、%3$s、%4$s、%5$sまたは%6$sを押すとこの周波数がそのキーに割り当てられます", diff --git a/src/generated/resources/assets/create/lang/unfinished/ko_kr.json b/src/generated/resources/assets/create/lang/unfinished/ko_kr.json index a82e39aea..02e420bed 100644 --- a/src/generated/resources/assets/create/lang/unfinished/ko_kr.json +++ b/src/generated/resources/assets/create/lang/unfinished/ko_kr.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 284", + "_": "Missing Localizations: 287", "_": "->------------------------] Game Elements [------------------------<-", @@ -1165,6 +1165,9 @@ "create.tooltip.chute.fans_pull_up": "선풍기가 위에서 당겨냄", "create.tooltip.chute.fans_pull_down": "선풍기가 아래에서 당겨냄", "create.tooltip.chute.contains": "들어 있는 아이템: %1$s x%2$s", + "create.tooltip.brass_tunnel.contains": "UNLOCALIZED: Currently distributing:", + "create.tooltip.brass_tunnel.contains_entry": "UNLOCALIZED: > %1$s x%2$s", + "create.tooltip.brass_tunnel.retrieve": "UNLOCALIZED: Right-Click to retrieve", "create.linked_controller.bind_mode": "UNLOCALIZED: Bind mode active", "create.linked_controller.press_keybind": "UNLOCALIZED: Press %1$s, %2$s, %3$s, %4$s, %5$s or %6$s, to bind this frequency to the respective key", diff --git a/src/generated/resources/assets/create/lang/unfinished/nl_nl.json b/src/generated/resources/assets/create/lang/unfinished/nl_nl.json index 48066cd30..171e5b407 100644 --- a/src/generated/resources/assets/create/lang/unfinished/nl_nl.json +++ b/src/generated/resources/assets/create/lang/unfinished/nl_nl.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 1759", + "_": "Missing Localizations: 1762", "_": "->------------------------] Game Elements [------------------------<-", @@ -1165,6 +1165,9 @@ "create.tooltip.chute.fans_pull_up": "UNLOCALIZED: Fans pull from Above", "create.tooltip.chute.fans_pull_down": "UNLOCALIZED: Fans pull from Below", "create.tooltip.chute.contains": "UNLOCALIZED: Contains: %1$s x%2$s", + "create.tooltip.brass_tunnel.contains": "UNLOCALIZED: Currently distributing:", + "create.tooltip.brass_tunnel.contains_entry": "UNLOCALIZED: > %1$s x%2$s", + "create.tooltip.brass_tunnel.retrieve": "UNLOCALIZED: Right-Click to retrieve", "create.linked_controller.bind_mode": "UNLOCALIZED: Bind mode active", "create.linked_controller.press_keybind": "UNLOCALIZED: Press %1$s, %2$s, %3$s, %4$s, %5$s or %6$s, to bind this frequency to the respective key", diff --git a/src/generated/resources/assets/create/lang/unfinished/pl_pl.json b/src/generated/resources/assets/create/lang/unfinished/pl_pl.json index bf827e597..f27107538 100644 --- a/src/generated/resources/assets/create/lang/unfinished/pl_pl.json +++ b/src/generated/resources/assets/create/lang/unfinished/pl_pl.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 248", + "_": "Missing Localizations: 251", "_": "->------------------------] Game Elements [------------------------<-", @@ -1165,6 +1165,9 @@ "create.tooltip.chute.fans_pull_up": "Wiatraki ciągną od góry", "create.tooltip.chute.fans_pull_down": "Wiatraki ciągną od dołu", "create.tooltip.chute.contains": "Zawiera: %1$s x%2$s", + "create.tooltip.brass_tunnel.contains": "UNLOCALIZED: Currently distributing:", + "create.tooltip.brass_tunnel.contains_entry": "UNLOCALIZED: > %1$s x%2$s", + "create.tooltip.brass_tunnel.retrieve": "UNLOCALIZED: Right-Click to retrieve", "create.linked_controller.bind_mode": "UNLOCALIZED: Bind mode active", "create.linked_controller.press_keybind": "UNLOCALIZED: Press %1$s, %2$s, %3$s, %4$s, %5$s or %6$s, to bind this frequency to the respective key", diff --git a/src/generated/resources/assets/create/lang/unfinished/pt_br.json b/src/generated/resources/assets/create/lang/unfinished/pt_br.json index 0121ffdb1..7c9a9dbe2 100644 --- a/src/generated/resources/assets/create/lang/unfinished/pt_br.json +++ b/src/generated/resources/assets/create/lang/unfinished/pt_br.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 1800", + "_": "Missing Localizations: 1803", "_": "->------------------------] Game Elements [------------------------<-", @@ -1165,6 +1165,9 @@ "create.tooltip.chute.fans_pull_up": "UNLOCALIZED: Fans pull from Above", "create.tooltip.chute.fans_pull_down": "UNLOCALIZED: Fans pull from Below", "create.tooltip.chute.contains": "UNLOCALIZED: Contains: %1$s x%2$s", + "create.tooltip.brass_tunnel.contains": "UNLOCALIZED: Currently distributing:", + "create.tooltip.brass_tunnel.contains_entry": "UNLOCALIZED: > %1$s x%2$s", + "create.tooltip.brass_tunnel.retrieve": "UNLOCALIZED: Right-Click to retrieve", "create.linked_controller.bind_mode": "UNLOCALIZED: Bind mode active", "create.linked_controller.press_keybind": "UNLOCALIZED: Press %1$s, %2$s, %3$s, %4$s, %5$s or %6$s, to bind this frequency to the respective key", diff --git a/src/generated/resources/assets/create/lang/unfinished/ru_ru.json b/src/generated/resources/assets/create/lang/unfinished/ru_ru.json index 6fb4e0db7..38eb1010b 100644 --- a/src/generated/resources/assets/create/lang/unfinished/ru_ru.json +++ b/src/generated/resources/assets/create/lang/unfinished/ru_ru.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 279", + "_": "Missing Localizations: 282", "_": "->------------------------] Game Elements [------------------------<-", @@ -1165,6 +1165,9 @@ "create.tooltip.chute.fans_pull_up": "Вентилятор тянет сверху", "create.tooltip.chute.fans_pull_down": "Вентилятор тянет снизу", "create.tooltip.chute.contains": "Содержит: %1$s x%2$s", + "create.tooltip.brass_tunnel.contains": "UNLOCALIZED: Currently distributing:", + "create.tooltip.brass_tunnel.contains_entry": "UNLOCALIZED: > %1$s x%2$s", + "create.tooltip.brass_tunnel.retrieve": "UNLOCALIZED: Right-Click to retrieve", "create.linked_controller.bind_mode": "UNLOCALIZED: Bind mode active", "create.linked_controller.press_keybind": "UNLOCALIZED: Press %1$s, %2$s, %3$s, %4$s, %5$s or %6$s, to bind this frequency to the respective key", diff --git a/src/generated/resources/assets/create/lang/unfinished/zh_cn.json b/src/generated/resources/assets/create/lang/unfinished/zh_cn.json index 357e20e97..650be5c55 100644 --- a/src/generated/resources/assets/create/lang/unfinished/zh_cn.json +++ b/src/generated/resources/assets/create/lang/unfinished/zh_cn.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 289", + "_": "Missing Localizations: 292", "_": "->------------------------] Game Elements [------------------------<-", @@ -1165,6 +1165,9 @@ "create.tooltip.chute.fans_pull_up": "鼓风机从上方进行吸引", "create.tooltip.chute.fans_pull_down": "鼓风机从下方进行吸引", "create.tooltip.chute.contains": "内含物品:%1$s x%2$s", + "create.tooltip.brass_tunnel.contains": "UNLOCALIZED: Currently distributing:", + "create.tooltip.brass_tunnel.contains_entry": "UNLOCALIZED: > %1$s x%2$s", + "create.tooltip.brass_tunnel.retrieve": "UNLOCALIZED: Right-Click to retrieve", "create.linked_controller.bind_mode": "UNLOCALIZED: Bind mode active", "create.linked_controller.press_keybind": "UNLOCALIZED: Press %1$s, %2$s, %3$s, %4$s, %5$s or %6$s, to bind this frequency to the respective key", diff --git a/src/generated/resources/assets/create/lang/unfinished/zh_tw.json b/src/generated/resources/assets/create/lang/unfinished/zh_tw.json index 980d8f1df..47656d31a 100644 --- a/src/generated/resources/assets/create/lang/unfinished/zh_tw.json +++ b/src/generated/resources/assets/create/lang/unfinished/zh_tw.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 284", + "_": "Missing Localizations: 287", "_": "->------------------------] Game Elements [------------------------<-", @@ -1165,6 +1165,9 @@ "create.tooltip.chute.fans_pull_up": "鼓風機從下方進行吸引", "create.tooltip.chute.fans_pull_down": "鼓風機從上方進行吸引", "create.tooltip.chute.contains": "物品: %1$s x%2$s", + "create.tooltip.brass_tunnel.contains": "UNLOCALIZED: Currently distributing:", + "create.tooltip.brass_tunnel.contains_entry": "UNLOCALIZED: > %1$s x%2$s", + "create.tooltip.brass_tunnel.retrieve": "UNLOCALIZED: Right-Click to retrieve", "create.linked_controller.bind_mode": "UNLOCALIZED: Bind mode active", "create.linked_controller.press_keybind": "UNLOCALIZED: Press %1$s, %2$s, %3$s, %4$s, %5$s or %6$s, to bind this frequency to the respective key", 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 index 019d46569..d03b45d18 100644 --- 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 @@ -1,15 +1,25 @@ package com.simibubi.create.content.logistics.block.belts.tunnel; +import java.util.List; + import com.simibubi.create.AllTileEntities; +import com.simibubi.create.Create; import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; import com.simibubi.create.foundation.tileEntity.behaviour.filtering.FilteringBehaviour; import net.minecraft.block.AbstractBlock; import net.minecraft.block.Block; import net.minecraft.block.BlockState; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ActionResultType; import net.minecraft.util.Direction; +import net.minecraft.util.Hand; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.SoundEvents; import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.world.IBlockReader; import net.minecraft.world.IWorld; import net.minecraft.world.World; @@ -20,6 +30,26 @@ public class BrassTunnelBlock extends BeltTunnelBlock { super(properties); } + @Override + public ActionResultType onUse(BlockState p_225533_1_, World world, BlockPos pos, PlayerEntity player, + Hand p_225533_5_, BlockRayTraceResult p_225533_6_) { + return onTileEntityUse(world, pos, te -> { + if (!(te instanceof BrassTunnelTileEntity)) + return ActionResultType.PASS; + BrassTunnelTileEntity bte = (BrassTunnelTileEntity) te; + List stacksOfGroup = bte.grabAllStacksOfGroup(world.isRemote); + if (stacksOfGroup.isEmpty()) + return ActionResultType.PASS; + if (world.isRemote) + return ActionResultType.SUCCESS; + for (ItemStack itemStack : stacksOfGroup) + player.inventory.placeItemBackInInventory(world, itemStack.copy()); + world.playSound(null, pos, SoundEvents.ENTITY_ITEM_PICKUP, SoundCategory.PLAYERS, .2f, + 1f + Create.RANDOM.nextFloat()); + return ActionResultType.SUCCESS; + }); + } + @Override public TileEntity createTileEntity(BlockState state, IBlockReader world) { return AllTileEntities.BRASS_TUNNEL.create(); 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 index fd1e51fe1..62e7ca059 100644 --- 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 @@ -14,6 +14,7 @@ import javax.annotation.Nullable; import org.apache.commons.lang3.tuple.Pair; import com.simibubi.create.AllBlocks; +import com.simibubi.create.content.contraptions.goggles.IHaveGoggleInformation; import com.simibubi.create.content.contraptions.relays.belt.BeltHelper; import com.simibubi.create.content.contraptions.relays.belt.BeltTileEntity; import com.simibubi.create.foundation.advancement.AllTriggers; @@ -43,6 +44,9 @@ import net.minecraft.util.Direction.Axis; import net.minecraft.util.Direction.AxisDirection; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.vector.Vector3d; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.TextFormatting; +import net.minecraft.util.text.TranslationTextComponent; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.util.Constants.NBT; import net.minecraftforge.common.util.LazyOptional; @@ -50,7 +54,7 @@ import net.minecraftforge.items.CapabilityItemHandler; import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.ItemHandlerHelper; -public class BrassTunnelTileEntity extends BeltTunnelTileEntity { +public class BrassTunnelTileEntity extends BeltTunnelTileEntity implements IHaveGoggleInformation { SidedFilteringBehaviour filtering; @@ -319,6 +323,36 @@ public class BrassTunnelTileEntity extends BeltTunnelTileEntity { return stackToDistribute; } + public List grabAllStacksOfGroup(boolean simulate) { + List list = new ArrayList<>(); + + ItemStack own = getStackToDistribute(); + if (!own.isEmpty()) { + list.add(own); + if (!simulate) + setStackToDistribute(ItemStack.EMPTY); + } + + for (boolean left : Iterate.trueAndFalse) { + BrassTunnelTileEntity adjacent = this; + while (adjacent != null) { + if (!world.isAreaLoaded(adjacent.getPos(), 1)) + return null; + adjacent = adjacent.getAdjacent(left); + if (adjacent == null) + continue; + ItemStack other = adjacent.getStackToDistribute(); + if (other.isEmpty()) + continue; + list.add(other); + if (!simulate) + adjacent.setStackToDistribute(ItemStack.EMPTY); + } + } + + return list; + } + @Nullable protected ItemStack insertIntoTunnel(BrassTunnelTileEntity tunnel, Direction side, ItemStack stack, boolean simulate) { @@ -357,7 +391,8 @@ public class BrassTunnelTileEntity extends BeltTunnelTileEntity { float movementSpeed = Math.max(Math.abs(beltMovementSpeed), 1 / 8f); int additionalOffset = beltMovementSpeed > 0 ? 1 : 0; Vector3d outPos = BeltHelper.getVectorForOffset(controllerTE, below.index + additionalOffset); - Vector3d outMotion = Vector3d.of(side.getDirectionVec()).scale(movementSpeed) + Vector3d outMotion = Vector3d.of(side.getDirectionVec()) + .scale(movementSpeed) .add(0, 1 / 8f, 0); outPos.add(outMotion.normalize()); ItemEntity entity = new ItemEntity(world, outPos.x, outPos.y + 6 / 16f, outPos.z, ejected); @@ -708,4 +743,26 @@ public class BrassTunnelTileEntity extends BeltTunnelTileEntity { return stackToDistribute.isEmpty() && !syncedOutputActive; } + @Override + public boolean addToGoggleTooltip(List tooltip, boolean isPlayerSneaking) { + List allStacks = grabAllStacksOfGroup(true); + if (allStacks.isEmpty()) + return false; + + tooltip.add(componentSpacing.copy() + .append(Lang.translate("tooltip.brass_tunnel.contains")) + .formatted(TextFormatting.WHITE)); + for (ItemStack item : allStacks) { + tooltip.add(componentSpacing.copy() + .append(Lang.translate("tooltip.brass_tunnel.contains_entry", new TranslationTextComponent(item.getItem() + .getTranslationKey(item)).getString(), item.getCount())) + .formatted(TextFormatting.GRAY)); + } + tooltip.add(componentSpacing.copy() + .append(Lang.translate("tooltip.brass_tunnel.retrieve")) + .formatted(TextFormatting.DARK_GRAY)); + + return true; + } + } diff --git a/src/main/resources/assets/create/lang/default/messages.json b/src/main/resources/assets/create/lang/default/messages.json index 29239e841..0de1d3e9b 100644 --- a/src/main/resources/assets/create/lang/default/messages.json +++ b/src/main/resources/assets/create/lang/default/messages.json @@ -496,6 +496,10 @@ "create.tooltip.chute.fans_pull_up": "Fans pull from Above", "create.tooltip.chute.fans_pull_down": "Fans pull from Below", "create.tooltip.chute.contains": "Contains: %1$s x%2$s", + + "create.tooltip.brass_tunnel.contains": "Currently distributing:", + "create.tooltip.brass_tunnel.contains_entry": "> %1$s x%2$s", + "create.tooltip.brass_tunnel.retrieve": "Right-Click to retrieve", "create.linked_controller.bind_mode": "Bind mode active", "create.linked_controller.press_keybind": "Press %1$s, %2$s, %3$s, %4$s, %5$s or %6$s, to bind this frequency to the respective key",