mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-11-10 03:53:12 +01:00
Behind the flaps
- Brass tunnels now show a goggle tooltip of contained items within their group - Right-clicking brass tunnels now retrieves all contained items from their group
This commit is contained in:
parent
e56da570e8
commit
30ba34dbb0
18 changed files with 162 additions and 29 deletions
|
@ -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
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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を押すとこの周波数がそのキーに割り当てられます",
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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<ItemStack> 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();
|
||||
|
|
|
@ -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<ItemStack> grabAllStacksOfGroup(boolean simulate) {
|
||||
List<ItemStack> 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<ITextComponent> tooltip, boolean isPlayerSneaking) {
|
||||
List<ItemStack> 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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in a new issue