mirror of
https://github.com/Ellpeck/PrettyPipes.git
synced 2024-11-22 11:53:29 +01:00
Merge branch '1.18'
# Conflicts: # build.gradle # src/main/java/de/ellpeck/prettypipes/Registry.java # src/main/java/de/ellpeck/prettypipes/misc/ItemFilter.java # src/main/java/de/ellpeck/prettypipes/pipe/modules/retrieval/RetrievalModuleItem.java # src/main/java/de/ellpeck/prettypipes/terminal/containers/CraftingTerminalGui.java # src/main/java/de/ellpeck/prettypipes/terminal/containers/ItemTerminalGui.java
This commit is contained in:
commit
69fa29aa46
20 changed files with 272 additions and 75 deletions
|
@ -1,9 +1,11 @@
|
|||
package de.ellpeck.prettypipes.items;
|
||||
|
||||
import de.ellpeck.prettypipes.misc.DirectionSelector;
|
||||
import de.ellpeck.prettypipes.misc.ItemFilter;
|
||||
import de.ellpeck.prettypipes.pipe.PipeBlockEntity;
|
||||
import de.ellpeck.prettypipes.pipe.containers.AbstractPipeContainer;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.world.entity.player.Inventory;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
|
@ -17,9 +19,9 @@ public interface IModule {
|
|||
|
||||
void tick(ItemStack module, PipeBlockEntity tile);
|
||||
|
||||
boolean canNetworkSee(ItemStack module, PipeBlockEntity tile);
|
||||
boolean canNetworkSee(ItemStack module, PipeBlockEntity tile, Direction direction, IItemHandler handler);
|
||||
|
||||
boolean canAcceptItem(ItemStack module, PipeBlockEntity tile, ItemStack stack);
|
||||
boolean canAcceptItem(ItemStack module, PipeBlockEntity tile, ItemStack stack, Direction direction, IItemHandler destination);
|
||||
|
||||
int getMaxInsertionAmount(ItemStack module, PipeBlockEntity tile, ItemStack stack, IItemHandler destination);
|
||||
|
||||
|
@ -44,4 +46,6 @@ public interface IModule {
|
|||
Integer getCustomNextNode(ItemStack module, PipeBlockEntity tile, List<BlockPos> nodes, int index);
|
||||
|
||||
ItemFilter getItemFilter(ItemStack module, PipeBlockEntity tile);
|
||||
|
||||
DirectionSelector getDirectionSelector(ItemStack module, PipeBlockEntity tile);
|
||||
}
|
||||
|
|
|
@ -2,10 +2,12 @@ package de.ellpeck.prettypipes.items;
|
|||
|
||||
import de.ellpeck.prettypipes.Registry;
|
||||
import de.ellpeck.prettypipes.Utility;
|
||||
import de.ellpeck.prettypipes.misc.DirectionSelector;
|
||||
import de.ellpeck.prettypipes.misc.ItemFilter;
|
||||
import de.ellpeck.prettypipes.pipe.PipeBlockEntity;
|
||||
import de.ellpeck.prettypipes.pipe.containers.AbstractPipeContainer;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.world.entity.player.Inventory;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
|
@ -45,12 +47,12 @@ public abstract class ModuleItem extends Item implements IModule {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean canNetworkSee(ItemStack module, PipeBlockEntity tile) {
|
||||
public boolean canNetworkSee(ItemStack module, PipeBlockEntity tile, Direction direction, IItemHandler handler) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAcceptItem(ItemStack module, PipeBlockEntity tile, ItemStack stack) {
|
||||
public boolean canAcceptItem(ItemStack module, PipeBlockEntity tile, ItemStack stack, Direction direction, IItemHandler destination) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -103,4 +105,9 @@ public abstract class ModuleItem extends Item implements IModule {
|
|||
public ItemFilter getItemFilter(ItemStack module, PipeBlockEntity tile) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DirectionSelector getDirectionSelector(ItemStack module, PipeBlockEntity tile) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
107
src/main/java/de/ellpeck/prettypipes/misc/DirectionSelector.java
Normal file
107
src/main/java/de/ellpeck/prettypipes/misc/DirectionSelector.java
Normal file
|
@ -0,0 +1,107 @@
|
|||
package de.ellpeck.prettypipes.misc;
|
||||
|
||||
import de.ellpeck.prettypipes.PrettyPipes;
|
||||
import de.ellpeck.prettypipes.packets.PacketButton;
|
||||
import de.ellpeck.prettypipes.pipe.PipeBlockEntity;
|
||||
import net.minecraft.client.gui.components.AbstractWidget;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.MutableComponent;
|
||||
import net.minecraft.network.chat.TranslatableComponent;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.client.gui.widget.ExtendedButton;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
public class DirectionSelector {
|
||||
|
||||
private static final Direction[] ALL = ArrayUtils.addAll(Direction.values(), (Direction) null);
|
||||
|
||||
// null means old behavior, which is all directions
|
||||
private Direction direction;
|
||||
private boolean modified;
|
||||
|
||||
private final ItemStack stack;
|
||||
private final PipeBlockEntity pipe;
|
||||
|
||||
public DirectionSelector(ItemStack stack, PipeBlockEntity pipe) {
|
||||
this.stack = stack;
|
||||
this.pipe = pipe;
|
||||
this.load();
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public AbstractWidget getButton(int x, int y) {
|
||||
return new ExtendedButton(x, y, 100, 20, new TranslatableComponent("info." + PrettyPipes.ID + ".populate"), button ->
|
||||
PacketButton.sendAndExecute(this.pipe.getBlockPos(), PacketButton.ButtonResult.DIRECTION_SELECTOR)) {
|
||||
@Override
|
||||
public Component getMessage() {
|
||||
var pipe = DirectionSelector.this.pipe;
|
||||
var dir = DirectionSelector.this.direction;
|
||||
MutableComponent msg = new TranslatableComponent("dir." + PrettyPipes.ID + "." + (dir != null ? dir.getName() : "all"));
|
||||
if (dir != null) {
|
||||
var blockName = pipe.getItemHandler(dir) != null ? pipe.getLevel().getBlockState(pipe.getBlockPos().relative(dir)).getBlock().getName() : null;
|
||||
if (blockName != null)
|
||||
msg = msg.append(" (").append(blockName).append(")");
|
||||
}
|
||||
return msg;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public void onButtonPacket() {
|
||||
var dir = this.direction;
|
||||
do {
|
||||
dir = DirectionSelector.ALL[(ArrayUtils.indexOf(DirectionSelector.ALL, dir) + 1) % DirectionSelector.ALL.length];
|
||||
} while (!this.isDirectionValid(dir));
|
||||
if (this.direction != dir) {
|
||||
this.direction = dir;
|
||||
this.modified = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void save() {
|
||||
if (!this.modified)
|
||||
return;
|
||||
this.modified = false;
|
||||
|
||||
var tag = new CompoundTag();
|
||||
if (this.direction != null)
|
||||
tag.putString("direction", this.direction.getName());
|
||||
this.stack.getOrCreateTag().put("direction_selector", tag);
|
||||
}
|
||||
|
||||
public void load() {
|
||||
if (this.stack.hasTag()) {
|
||||
var tag = this.stack.getTag().getCompound("direction_selector");
|
||||
this.direction = Direction.byName(tag.getString("direction"));
|
||||
}
|
||||
}
|
||||
|
||||
public Direction[] directions() {
|
||||
return this.direction != null ? new Direction[]{this.direction} : Direction.values();
|
||||
}
|
||||
|
||||
public boolean has(Direction dir) {
|
||||
return this.direction == null || this.direction == dir;
|
||||
}
|
||||
|
||||
private boolean isDirectionValid(Direction dir) {
|
||||
if (dir == null)
|
||||
return true;
|
||||
if (this.pipe.getItemHandler(dir) == null)
|
||||
return false;
|
||||
return this.pipe.streamModules()
|
||||
.filter(p -> p.getLeft() != this.stack)
|
||||
.map(p -> p.getRight().getDirectionSelector(p.getLeft(), this.pipe))
|
||||
.noneMatch(p -> p != null && p.direction == dir);
|
||||
}
|
||||
|
||||
public interface IDirectionContainer {
|
||||
|
||||
DirectionSelector getSelector();
|
||||
|
||||
}
|
||||
}
|
|
@ -11,7 +11,7 @@ import net.minecraft.client.gui.components.Button;
|
|||
import net.minecraft.client.gui.screens.Screen;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.TranslatableComponent;
|
||||
import net.minecraft.world.inventory.Slot;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
|
@ -48,20 +48,25 @@ public class ItemFilter extends ItemStackHandler {
|
|||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public List<AbstractWidget> getButtons(Screen gui, int x, int y) {
|
||||
public List<AbstractWidget> getButtons(Screen gui, int x, int y, boolean rightAligned) {
|
||||
List<AbstractWidget> buttons = new ArrayList<>();
|
||||
if (this.canModifyWhitelist) {
|
||||
Supplier<Component> whitelistText = () -> Component.translatable("info." + PrettyPipes.ID + "." + (this.isWhitelist ? "whitelist" : "blacklist"));
|
||||
buttons.add(new Button(x, y, 70, 20, whitelistText.get(), button -> {
|
||||
var whitelistText = (Supplier<String>) () -> "info." + PrettyPipes.ID + "." + (this.isWhitelist ? "whitelist" : "blacklist");
|
||||
buttons.add(new Button(x - 20, y, 20, 20, new TranslatableComponent(whitelistText.get()), button -> {
|
||||
PacketButton.sendAndExecute(this.pipe.getBlockPos(), PacketButton.ButtonResult.FILTER_CHANGE, 0);
|
||||
button.setMessage(whitelistText.get());
|
||||
}));
|
||||
}
|
||||
if (this.canPopulateFromInventories) {
|
||||
buttons.add(new Button(x + 72, y, 70, 20, Component.translatable("info." + PrettyPipes.ID + ".populate"), button -> PacketButton.sendAndExecute(this.pipe.getBlockPos(), PacketButton.ButtonResult.FILTER_CHANGE, 1)) {
|
||||
button.setMessage(new TranslatableComponent(whitelistText.get()));
|
||||
}) {
|
||||
@Override
|
||||
public void renderToolTip(PoseStack matrix, int x, int y) {
|
||||
gui.renderTooltip(matrix, Component.translatable("info." + PrettyPipes.ID + ".populate.description").withStyle(ChatFormatting.GRAY), x, y);
|
||||
gui.renderTooltip(matrix, new TranslatableComponent(whitelistText.get() + ".description").withStyle(ChatFormatting.GRAY), x, y);
|
||||
}
|
||||
});
|
||||
}
|
||||
if (this.canPopulateFromInventories) {
|
||||
buttons.add(new Button(x - 42, y, 20, 20, new TranslatableComponent("info." + PrettyPipes.ID + ".populate"), button -> PacketButton.sendAndExecute(this.pipe.getBlockPos(), PacketButton.ButtonResult.FILTER_CHANGE, 1)) {
|
||||
@Override
|
||||
public void renderToolTip(PoseStack matrix, int x, int y) {
|
||||
gui.renderTooltip(matrix, new TranslatableComponent("info." + PrettyPipes.ID + ".populate.description").withStyle(ChatFormatting.GRAY), x, y);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -147,7 +147,7 @@ public class PipeNetwork implements ICapabilitySerializable<CompoundTag>, GraphL
|
|||
if (!this.world.isLoaded(pipePos))
|
||||
continue;
|
||||
var pipe = this.getPipe(pipePos);
|
||||
var dest = pipe.getAvailableDestination(stack, false, preventOversending);
|
||||
var dest = pipe.getAvailableDestination(Direction.values(), stack, false, preventOversending);
|
||||
if (dest == null || dest.getLeft().equals(startInventory))
|
||||
continue;
|
||||
var sup = (Function<Float, IPipeItem>) speed -> itemSupplier.apply(dest.getRight(), speed);
|
||||
|
@ -324,11 +324,9 @@ public class PipeNetwork implements ICapabilitySerializable<CompoundTag>, GraphL
|
|||
if (!this.world.isLoaded(dest))
|
||||
continue;
|
||||
var pipe = this.getPipe(dest);
|
||||
if (!pipe.canNetworkSee())
|
||||
continue;
|
||||
for (var dir : Direction.values()) {
|
||||
var handler = pipe.getItemHandler(dir);
|
||||
if (handler == null)
|
||||
if (handler == null || !pipe.canNetworkSee(dir, handler))
|
||||
continue;
|
||||
// check if this handler already exists (double-connected pipes, double chests etc.)
|
||||
if (info.stream().anyMatch(l -> handler.equals(l.getItemHandler(this.world))))
|
||||
|
|
|
@ -26,6 +26,8 @@ import org.apache.logging.log4j.util.TriConsumer;
|
|||
import javax.annotation.Nullable;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import static de.ellpeck.prettypipes.misc.DirectionSelector.IDirectionContainer;
|
||||
|
||||
public class PacketButton {
|
||||
|
||||
private BlockPos pos;
|
||||
|
@ -121,6 +123,10 @@ public class PacketButton {
|
|||
TAG_FILTER((pos, data, player) -> {
|
||||
var container = (FilterModifierModuleContainer) player.containerMenu;
|
||||
FilterModifierModuleItem.setFilterTag(container.moduleStack, container.getTags().get(data[0]));
|
||||
}),
|
||||
DIRECTION_SELECTOR((pos, data, player) -> {
|
||||
if (player.containerMenu instanceof IDirectionContainer filtered)
|
||||
filtered.getSelector().onButtonPacket();
|
||||
});
|
||||
|
||||
public final TriConsumer<BlockPos, int[], Player> action;
|
||||
|
|
|
@ -166,7 +166,7 @@ public class PipeBlockEntity extends BlockEntity implements MenuProvider, IPipeC
|
|||
}
|
||||
|
||||
public Pair<BlockPos, ItemStack> getAvailableDestinationOrConnectable(ItemStack stack, boolean force, boolean preventOversending) {
|
||||
var dest = this.getAvailableDestination(stack, force, preventOversending);
|
||||
var dest = this.getAvailableDestination(Direction.values(), stack, force, preventOversending);
|
||||
if (dest != null)
|
||||
return dest;
|
||||
// if there's no available destination, try inserting into terminals etc.
|
||||
|
@ -184,15 +184,15 @@ public class PipeBlockEntity extends BlockEntity implements MenuProvider, IPipeC
|
|||
return null;
|
||||
}
|
||||
|
||||
public Pair<BlockPos, ItemStack> getAvailableDestination(ItemStack stack, boolean force, boolean preventOversending) {
|
||||
public Pair<BlockPos, ItemStack> getAvailableDestination(Direction[] directions, ItemStack stack, boolean force, boolean preventOversending) {
|
||||
if (!this.canWork())
|
||||
return null;
|
||||
if (!force && this.streamModules().anyMatch(m -> !m.getRight().canAcceptItem(m.getLeft(), this, stack)))
|
||||
return null;
|
||||
for (var dir : Direction.values()) {
|
||||
for (var dir : directions) {
|
||||
var handler = this.getItemHandler(dir);
|
||||
if (handler == null)
|
||||
continue;
|
||||
if (!force && this.streamModules().anyMatch(m -> !m.getRight().canAcceptItem(m.getLeft(), this, stack, dir, handler)))
|
||||
continue;
|
||||
var remain = ItemHandlerHelper.insertItem(handler, stack, true);
|
||||
// did we insert anything?
|
||||
if (remain.getCount() == stack.getCount())
|
||||
|
@ -314,13 +314,9 @@ public class PipeBlockEntity extends BlockEntity implements MenuProvider, IPipeC
|
|||
return null;
|
||||
}
|
||||
|
||||
public boolean isConnectedInventory(Direction dir) {
|
||||
return this.getItemHandler(dir) != null;
|
||||
}
|
||||
|
||||
public boolean canHaveModules() {
|
||||
for (var dir : Direction.values()) {
|
||||
if (this.isConnectedInventory(dir))
|
||||
if (this.getItemHandler(dir) != null)
|
||||
return true;
|
||||
var connectable = this.getPipeConnectable(dir);
|
||||
if (connectable != null && connectable.allowsModules(this.worldPosition, dir))
|
||||
|
@ -329,8 +325,8 @@ public class PipeBlockEntity extends BlockEntity implements MenuProvider, IPipeC
|
|||
return false;
|
||||
}
|
||||
|
||||
public boolean canNetworkSee() {
|
||||
return this.streamModules().allMatch(m -> m.getRight().canNetworkSee(m.getLeft(), this));
|
||||
public boolean canNetworkSee(Direction direction, IItemHandler handler) {
|
||||
return this.streamModules().allMatch(m -> m.getRight().canNetworkSee(m.getLeft(), this, direction, handler));
|
||||
}
|
||||
|
||||
public Stream<Pair<ItemStack, IModule>> streamModules() {
|
||||
|
|
|
@ -13,10 +13,12 @@ import de.ellpeck.prettypipes.pipe.containers.AbstractPipeContainer;
|
|||
import de.ellpeck.prettypipes.terminal.CraftingTerminalBlockEntity;
|
||||
import de.ellpeck.prettypipes.terminal.ItemTerminalBlockEntity;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.util.Mth;
|
||||
import net.minecraft.world.entity.player.Inventory;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
import net.minecraftforge.items.ItemStackHandler;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
|
@ -54,12 +56,12 @@ public class CraftingModuleItem extends ModuleItem {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean canNetworkSee(ItemStack module, PipeBlockEntity tile) {
|
||||
public boolean canNetworkSee(ItemStack module, PipeBlockEntity tile, Direction direction, IItemHandler handler) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAcceptItem(ItemStack module, PipeBlockEntity tile, ItemStack stack) {
|
||||
public boolean canAcceptItem(ItemStack module, PipeBlockEntity tile, ItemStack stack, Direction direction, IItemHandler destination) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -73,7 +75,7 @@ public class CraftingModuleItem extends ModuleItem {
|
|||
network.startProfile("crafting_ingredients");
|
||||
var request = tile.craftIngredientRequests.peek();
|
||||
var equalityTypes = ItemFilter.getEqualityTypes(tile);
|
||||
var dest = tile.getAvailableDestination(request.stack, true, true);
|
||||
var dest = tile.getAvailableDestination(Direction.values(), request.stack, true, true);
|
||||
if (dest != null) {
|
||||
var requestRemain = network.requestExistingItem(request.location, tile.getBlockPos(), dest.getLeft(), request, dest.getRight(), equalityTypes);
|
||||
network.resolveNetworkLock(request);
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package de.ellpeck.prettypipes.pipe.modules.extraction;
|
||||
|
||||
import de.ellpeck.prettypipes.misc.DirectionSelector;
|
||||
import de.ellpeck.prettypipes.misc.DirectionSelector.IDirectionContainer;
|
||||
import de.ellpeck.prettypipes.misc.ItemFilter;
|
||||
import de.ellpeck.prettypipes.misc.ItemFilter.IFilteredContainer;
|
||||
import de.ellpeck.prettypipes.pipe.containers.AbstractPipeContainer;
|
||||
|
@ -9,9 +11,10 @@ import net.minecraft.world.inventory.MenuType;
|
|||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class ExtractionModuleContainer extends AbstractPipeContainer<ExtractionModuleItem> implements IFilteredContainer {
|
||||
public class ExtractionModuleContainer extends AbstractPipeContainer<ExtractionModuleItem> implements IFilteredContainer, IDirectionContainer {
|
||||
|
||||
public ItemFilter filter;
|
||||
public DirectionSelector directionSelector;
|
||||
|
||||
public ExtractionModuleContainer(@Nullable MenuType<?> type, int id, Player player, BlockPos pos, int moduleIndex) {
|
||||
super(type, id, player, pos, moduleIndex);
|
||||
|
@ -20,6 +23,8 @@ public class ExtractionModuleContainer extends AbstractPipeContainer<ExtractionM
|
|||
@Override
|
||||
protected void addSlots() {
|
||||
this.filter = this.module.getItemFilter(this.moduleStack, this.tile);
|
||||
this.directionSelector = this.module.getDirectionSelector(this.moduleStack, this.tile);
|
||||
|
||||
for (var slot : this.filter.getSlots((176 - this.module.filterSlots * 18) / 2 + 1, 17 + 32))
|
||||
this.addSlot(slot);
|
||||
}
|
||||
|
@ -28,10 +33,16 @@ public class ExtractionModuleContainer extends AbstractPipeContainer<ExtractionM
|
|||
public void removed(Player playerIn) {
|
||||
super.removed(playerIn);
|
||||
this.filter.save();
|
||||
this.directionSelector.save();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemFilter getFilter() {
|
||||
return this.filter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DirectionSelector getSelector() {
|
||||
return this.directionSelector;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,8 @@ public class ExtractionModuleGui extends AbstractPipeGui<ExtractionModuleContain
|
|||
@Override
|
||||
protected void init() {
|
||||
super.init();
|
||||
for (var widget : this.menu.filter.getButtons(this, this.leftPos + 7, this.topPos + 17 + 32 + 20))
|
||||
for (var widget : this.menu.filter.getButtons(this, this.leftPos + this.imageWidth - 7, this.topPos + 17 + 32 + 20, true))
|
||||
this.addRenderableWidget(widget);
|
||||
this.addRenderableWidget(this.menu.directionSelector.getButton(this.leftPos + 7, this.topPos + 17 + 32 + 20));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import de.ellpeck.prettypipes.Registry;
|
|||
import de.ellpeck.prettypipes.items.IModule;
|
||||
import de.ellpeck.prettypipes.items.ModuleItem;
|
||||
import de.ellpeck.prettypipes.items.ModuleTier;
|
||||
import de.ellpeck.prettypipes.misc.DirectionSelector;
|
||||
import de.ellpeck.prettypipes.misc.ItemFilter;
|
||||
import de.ellpeck.prettypipes.network.PipeNetwork;
|
||||
import de.ellpeck.prettypipes.pipe.PipeBlockEntity;
|
||||
|
@ -12,6 +13,7 @@ import net.minecraft.core.Direction;
|
|||
import net.minecraft.world.entity.player.Inventory;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
public class ExtractionModuleItem extends ModuleItem {
|
||||
|
||||
|
@ -33,12 +35,12 @@ public class ExtractionModuleItem extends ModuleItem {
|
|||
if (!tile.shouldWorkNow(this.speed) || !tile.canWork())
|
||||
return;
|
||||
var filter = this.getItemFilter(module, tile);
|
||||
|
||||
var network = PipeNetwork.get(tile.getLevel());
|
||||
for (var dir : Direction.values()) {
|
||||
var dirSelector = this.getDirectionSelector(module, tile);
|
||||
for (var dir : dirSelector.directions()) {
|
||||
var handler = tile.getItemHandler(dir);
|
||||
if (handler == null)
|
||||
continue;
|
||||
var network = PipeNetwork.get(tile.getLevel());
|
||||
for (var j = 0; j < handler.getSlots(); j++) {
|
||||
var stack = handler.extractItem(j, this.maxExtraction, true);
|
||||
if (stack.isEmpty())
|
||||
|
@ -55,13 +57,13 @@ public class ExtractionModuleItem extends ModuleItem {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean canNetworkSee(ItemStack module, PipeBlockEntity tile) {
|
||||
return false;
|
||||
public boolean canNetworkSee(ItemStack module, PipeBlockEntity tile, Direction direction, IItemHandler handler) {
|
||||
return !this.getDirectionSelector(module, tile).has(direction);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAcceptItem(ItemStack module, PipeBlockEntity tile, ItemStack stack) {
|
||||
return false;
|
||||
public boolean canAcceptItem(ItemStack module, PipeBlockEntity tile, ItemStack stack, Direction direction, IItemHandler destination) {
|
||||
return !this.getDirectionSelector(module, tile).has(direction);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -83,4 +85,9 @@ public class ExtractionModuleItem extends ModuleItem {
|
|||
public ItemFilter getItemFilter(ItemStack module, PipeBlockEntity tile) {
|
||||
return new ItemFilter(this.filterSlots, module, tile);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DirectionSelector getDirectionSelector(ItemStack module, PipeBlockEntity tile) {
|
||||
return new DirectionSelector(module, tile);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package de.ellpeck.prettypipes.pipe.modules.insertion;
|
||||
|
||||
import de.ellpeck.prettypipes.misc.DirectionSelector;
|
||||
import de.ellpeck.prettypipes.misc.DirectionSelector.IDirectionContainer;
|
||||
import de.ellpeck.prettypipes.misc.ItemFilter;
|
||||
import de.ellpeck.prettypipes.misc.ItemFilter.IFilteredContainer;
|
||||
import de.ellpeck.prettypipes.pipe.containers.AbstractPipeContainer;
|
||||
|
@ -9,9 +11,10 @@ import net.minecraft.world.inventory.MenuType;
|
|||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class FilterModuleContainer extends AbstractPipeContainer<FilterModuleItem> implements IFilteredContainer {
|
||||
public class FilterModuleContainer extends AbstractPipeContainer<FilterModuleItem> implements IFilteredContainer, IDirectionContainer {
|
||||
|
||||
public ItemFilter filter;
|
||||
public DirectionSelector directionSelector;
|
||||
|
||||
public FilterModuleContainer(@Nullable MenuType<?> type, int id, Player player, BlockPos pos, int moduleIndex) {
|
||||
super(type, id, player, pos, moduleIndex);
|
||||
|
@ -26,6 +29,8 @@ public class FilterModuleContainer extends AbstractPipeContainer<FilterModuleIte
|
|||
@Override
|
||||
protected void addSlots() {
|
||||
this.filter = this.module.getItemFilter(this.moduleStack, this.tile);
|
||||
this.directionSelector = this.module.getDirectionSelector(this.moduleStack, this.tile);
|
||||
|
||||
for (var slot : this.filter.getSlots((176 - Math.min(this.module.filterSlots, 9) * 18) / 2 + 1, 17 + 32))
|
||||
this.addSlot(slot);
|
||||
}
|
||||
|
@ -34,10 +39,17 @@ public class FilterModuleContainer extends AbstractPipeContainer<FilterModuleIte
|
|||
public void removed(Player playerIn) {
|
||||
super.removed(playerIn);
|
||||
this.filter.save();
|
||||
this.directionSelector.save();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemFilter getFilter() {
|
||||
return this.filter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DirectionSelector getSelector() {
|
||||
return this.directionSelector;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -14,7 +14,9 @@ public class FilterModuleGui extends AbstractPipeGui<FilterModuleContainer> {
|
|||
@Override
|
||||
protected void init() {
|
||||
super.init();
|
||||
for (var widget : this.menu.filter.getButtons(this, this.leftPos + 7, this.topPos + 17 + 32 + 18 * Mth.ceil(this.menu.filter.getSlots() / 9F) + 2))
|
||||
var buttonsY = this.topPos + 17 + 32 + 18 * Mth.ceil(this.menu.filter.getSlots() / 9F) + 2;
|
||||
for (var widget : this.menu.filter.getButtons(this, this.leftPos + this.imageWidth - 7, buttonsY, true))
|
||||
this.addRenderableWidget(widget);
|
||||
this.addRenderableWidget(this.menu.directionSelector.getButton(this.leftPos + 7, buttonsY));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,12 +4,15 @@ import de.ellpeck.prettypipes.Registry;
|
|||
import de.ellpeck.prettypipes.items.IModule;
|
||||
import de.ellpeck.prettypipes.items.ModuleItem;
|
||||
import de.ellpeck.prettypipes.items.ModuleTier;
|
||||
import de.ellpeck.prettypipes.misc.DirectionSelector;
|
||||
import de.ellpeck.prettypipes.misc.ItemFilter;
|
||||
import de.ellpeck.prettypipes.pipe.PipeBlockEntity;
|
||||
import de.ellpeck.prettypipes.pipe.containers.AbstractPipeContainer;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.world.entity.player.Inventory;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
public class FilterModuleItem extends ModuleItem {
|
||||
|
||||
|
@ -23,9 +26,8 @@ public class FilterModuleItem extends ModuleItem {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean canAcceptItem(ItemStack module, PipeBlockEntity tile, ItemStack stack) {
|
||||
var filter = this.getItemFilter(module, tile);
|
||||
return filter.isAllowed(stack);
|
||||
public boolean canAcceptItem(ItemStack module, PipeBlockEntity tile, ItemStack stack, Direction direction, IItemHandler destination) {
|
||||
return !this.getDirectionSelector(module, tile).has(direction) || this.getItemFilter(module, tile).isAllowed(stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -49,4 +51,9 @@ public class FilterModuleItem extends ModuleItem {
|
|||
filter.canPopulateFromInventories = this.canPopulateFromInventories;
|
||||
return filter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DirectionSelector getDirectionSelector(ItemStack module, PipeBlockEntity tile) {
|
||||
return new DirectionSelector(module, tile);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package de.ellpeck.prettypipes.pipe.modules.retrieval;
|
||||
|
||||
import de.ellpeck.prettypipes.misc.DirectionSelector;
|
||||
import de.ellpeck.prettypipes.misc.DirectionSelector.IDirectionContainer;
|
||||
import de.ellpeck.prettypipes.misc.ItemFilter;
|
||||
import de.ellpeck.prettypipes.misc.ItemFilter.IFilteredContainer;
|
||||
import de.ellpeck.prettypipes.pipe.containers.AbstractPipeContainer;
|
||||
|
@ -9,9 +11,10 @@ import net.minecraft.world.inventory.MenuType;
|
|||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class RetrievalModuleContainer extends AbstractPipeContainer<RetrievalModuleItem> implements IFilteredContainer {
|
||||
public class RetrievalModuleContainer extends AbstractPipeContainer<RetrievalModuleItem> implements IFilteredContainer, IDirectionContainer {
|
||||
|
||||
public ItemFilter filter;
|
||||
public DirectionSelector directionSelector;
|
||||
|
||||
public RetrievalModuleContainer(@Nullable MenuType<?> type, int id, Player player, BlockPos pos, int moduleIndex) {
|
||||
super(type, id, player, pos, moduleIndex);
|
||||
|
@ -20,6 +23,8 @@ public class RetrievalModuleContainer extends AbstractPipeContainer<RetrievalMod
|
|||
@Override
|
||||
protected void addSlots() {
|
||||
this.filter = this.module.getItemFilter(this.moduleStack, this.tile);
|
||||
this.directionSelector = this.module.getDirectionSelector(this.moduleStack, this.tile);
|
||||
|
||||
for (var slot : this.filter.getSlots((176 - this.module.filterSlots * 18) / 2 + 1, 17 + 32))
|
||||
this.addSlot(slot);
|
||||
}
|
||||
|
@ -28,10 +33,16 @@ public class RetrievalModuleContainer extends AbstractPipeContainer<RetrievalMod
|
|||
public void removed(Player playerIn) {
|
||||
super.removed(playerIn);
|
||||
this.filter.save();
|
||||
this.directionSelector.save();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemFilter getFilter() {
|
||||
return this.filter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DirectionSelector getSelector() {
|
||||
return this.directionSelector;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,8 @@ public class RetrievalModuleGui extends AbstractPipeGui<RetrievalModuleContainer
|
|||
@Override
|
||||
protected void init() {
|
||||
super.init();
|
||||
for (var widget : this.menu.filter.getButtons(this, this.leftPos + 7, this.topPos + 17 + 32 + 20))
|
||||
for (var widget : this.menu.filter.getButtons(this, this.leftPos + this.imageWidth - 7, this.topPos + 17 + 32 + 20, true))
|
||||
this.addRenderableWidget(widget);
|
||||
this.addRenderableWidget(this.menu.directionSelector.getButton(this.leftPos + 7, this.topPos + 17 + 32 + 20));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,13 +4,16 @@ import de.ellpeck.prettypipes.Registry;
|
|||
import de.ellpeck.prettypipes.items.IModule;
|
||||
import de.ellpeck.prettypipes.items.ModuleItem;
|
||||
import de.ellpeck.prettypipes.items.ModuleTier;
|
||||
import de.ellpeck.prettypipes.misc.DirectionSelector;
|
||||
import de.ellpeck.prettypipes.misc.ItemFilter;
|
||||
import de.ellpeck.prettypipes.network.PipeNetwork;
|
||||
import de.ellpeck.prettypipes.pipe.PipeBlockEntity;
|
||||
import de.ellpeck.prettypipes.pipe.containers.AbstractPipeContainer;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.world.entity.player.Inventory;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
public class RetrievalModuleItem extends ModuleItem {
|
||||
|
||||
|
@ -31,8 +34,8 @@ public class RetrievalModuleItem extends ModuleItem {
|
|||
public void tick(ItemStack module, PipeBlockEntity tile) {
|
||||
if (!tile.shouldWorkNow(this.speed) || !tile.canWork())
|
||||
return;
|
||||
var directions = this.getDirectionSelector(module, tile).directions();
|
||||
var network = PipeNetwork.get(tile.getLevel());
|
||||
|
||||
var equalityTypes = ItemFilter.getEqualityTypes(tile);
|
||||
// loop through filters to see which items to pull
|
||||
for (var subFilter : tile.getFilters()) {
|
||||
|
@ -42,8 +45,8 @@ public class RetrievalModuleItem extends ModuleItem {
|
|||
continue;
|
||||
var copy = filtered.copy();
|
||||
copy.setCount(this.maxExtraction);
|
||||
var dest = tile.getAvailableDestination(copy, true, this.preventOversending);
|
||||
if (dest == null)
|
||||
var dest = tile.getAvailableDestination(directions, copy, true, this.preventOversending);
|
||||
if (dest.getRight().isEmpty())
|
||||
continue;
|
||||
var remain = dest.getRight().copy();
|
||||
// are we already waiting for crafting results? If so, don't request those again
|
||||
|
@ -55,13 +58,13 @@ public class RetrievalModuleItem extends ModuleItem {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean canNetworkSee(ItemStack module, PipeBlockEntity tile) {
|
||||
return false;
|
||||
public boolean canNetworkSee(ItemStack module, PipeBlockEntity tile, Direction direction, IItemHandler handler) {
|
||||
return !this.getDirectionSelector(module, tile).has(direction);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAcceptItem(ItemStack module, PipeBlockEntity tile, ItemStack stack) {
|
||||
return false;
|
||||
public boolean canAcceptItem(ItemStack module, PipeBlockEntity tile, ItemStack stack, Direction direction, IItemHandler destination) {
|
||||
return !this.getDirectionSelector(module, tile).has(direction);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -86,4 +89,9 @@ public class RetrievalModuleItem extends ModuleItem {
|
|||
filter.isWhitelist = true;
|
||||
return filter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DirectionSelector getDirectionSelector(ItemStack module, PipeBlockEntity tile) {
|
||||
return new DirectionSelector(module, tile);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ import de.ellpeck.prettypipes.packets.PacketHandler;
|
|||
import net.minecraft.client.gui.components.Button;
|
||||
import net.minecraft.client.gui.screens.Screen;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.TranslatableComponent;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.entity.player.Inventory;
|
||||
|
||||
|
@ -24,7 +25,7 @@ public class CraftingTerminalGui extends ItemTerminalGui {
|
|||
@Override
|
||||
protected void init() {
|
||||
super.init();
|
||||
this.requestButton = this.addRenderableWidget(new Button(this.leftPos + 8, this.topPos + 100, 50, 20, Component.translatable("info." + PrettyPipes.ID + ".request"), button -> {
|
||||
this.requestButton = this.addRenderableWidget(new Button(this.leftPos + 8, this.topPos + 100, 50, 20, new TranslatableComponent("info." + PrettyPipes.ID + ".request"), button -> {
|
||||
var amount = ItemTerminalGui.requestModifier();
|
||||
// also allow holding backspace instead of alt for people whose alt key is inaccessible (linux?)
|
||||
var force = Screen.hasAltDown() || InputConstants.isKeyDown(this.minecraft.getWindow().getWindow(), 259) ? 1 : 0;
|
||||
|
|
|
@ -20,6 +20,8 @@ import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
|
|||
import net.minecraft.client.renderer.GameRenderer;
|
||||
import net.minecraft.client.resources.language.I18n;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.TextComponent;
|
||||
import net.minecraft.network.chat.TranslatableComponent;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.util.Mth;
|
||||
import net.minecraft.world.entity.player.Inventory;
|
||||
|
@ -64,13 +66,13 @@ public class ItemTerminalGui extends AbstractContainerScreen<ItemTerminalContain
|
|||
protected void init() {
|
||||
super.init();
|
||||
|
||||
this.search = this.addRenderableWidget(new EditBox(this.font, this.leftPos + this.getXOffset() + 97, this.topPos + 6, 86, 8, Component.literal("")));
|
||||
this.search = this.addRenderableWidget(new EditBox(this.font, this.leftPos + this.getXOffset() + 97, this.topPos + 6, 86, 8, new TextComponent("")));
|
||||
this.search.setBordered(false);
|
||||
this.lastSearchText = "";
|
||||
if (this.items != null)
|
||||
this.updateWidgets();
|
||||
|
||||
this.plusButton = this.addRenderableWidget(new Button(this.leftPos + this.getXOffset() + 95 - 7 + 12, this.topPos + 103, 12, 12, Component.literal("+"), button -> {
|
||||
this.plusButton = this.addRenderableWidget(new Button(this.leftPos + this.getXOffset() + 95 - 7 + 12, this.topPos + 103, 12, 12, new TextComponent("+"), button -> {
|
||||
var modifier = ItemTerminalGui.requestModifier();
|
||||
if (modifier > 1 && this.requestAmount == 1) {
|
||||
this.requestAmount = modifier;
|
||||
|
@ -81,15 +83,15 @@ public class ItemTerminalGui extends AbstractContainerScreen<ItemTerminalContain
|
|||
if (this.requestAmount > 384)
|
||||
this.requestAmount = 384;
|
||||
}));
|
||||
this.minusButton = this.addRenderableWidget(new Button(this.leftPos + this.getXOffset() + 95 - 7 - 24, this.topPos + 103, 12, 12, Component.literal("-"), button -> {
|
||||
this.minusButton = this.addRenderableWidget(new Button(this.leftPos + this.getXOffset() + 95 - 7 - 24, this.topPos + 103, 12, 12, new TextComponent("-"), button -> {
|
||||
this.requestAmount -= ItemTerminalGui.requestModifier();
|
||||
if (this.requestAmount < 1)
|
||||
this.requestAmount = 1;
|
||||
}));
|
||||
this.minusButton.active = false;
|
||||
this.requestButton = this.addRenderableWidget(new Button(this.leftPos + this.getXOffset() + 95 - 7 - 25, this.topPos + 115, 50, 20, Component.translatable("info." + PrettyPipes.ID + ".request"), button -> {
|
||||
this.requestButton = this.addRenderableWidget(new Button(this.leftPos + this.getXOffset() + 95 - 7 - 25, this.topPos + 115, 50, 20, new TranslatableComponent("info." + PrettyPipes.ID + ".request"), button -> {
|
||||
var widget = this.streamWidgets().filter(w -> w.selected).findFirst();
|
||||
if (widget.isEmpty())
|
||||
if (!widget.isPresent())
|
||||
return;
|
||||
var stack = widget.get().stack.copy();
|
||||
stack.setCount(1);
|
||||
|
@ -97,7 +99,7 @@ public class ItemTerminalGui extends AbstractContainerScreen<ItemTerminalContain
|
|||
this.requestAmount = 1;
|
||||
}));
|
||||
this.requestButton.active = false;
|
||||
this.orderButton = this.addRenderableWidget(new Button(this.leftPos - 22, this.topPos, 20, 20, Component.literal(""), button -> {
|
||||
this.orderButton = this.addRenderableWidget(new Button(this.leftPos - 22, this.topPos, 20, 20, new TextComponent(""), button -> {
|
||||
if (this.sortedItems == null)
|
||||
return;
|
||||
var prefs = PlayerPrefs.get();
|
||||
|
@ -105,7 +107,7 @@ public class ItemTerminalGui extends AbstractContainerScreen<ItemTerminalContain
|
|||
prefs.save();
|
||||
this.updateWidgets();
|
||||
}));
|
||||
this.ascendingButton = this.addRenderableWidget(new Button(this.leftPos - 22, this.topPos + 22, 20, 20, Component.literal(""), button -> {
|
||||
this.ascendingButton = this.addRenderableWidget(new Button(this.leftPos - 22, this.topPos + 22, 20, 20, new TextComponent(""), button -> {
|
||||
if (this.sortedItems == null)
|
||||
return;
|
||||
var prefs = PlayerPrefs.get();
|
||||
|
@ -113,7 +115,7 @@ public class ItemTerminalGui extends AbstractContainerScreen<ItemTerminalContain
|
|||
prefs.save();
|
||||
this.updateWidgets();
|
||||
}));
|
||||
this.cancelCraftingButton = this.addRenderableWidget(new Button(this.leftPos + this.imageWidth + 4, this.topPos + 4 + 64, 54, 20, Component.translatable("info." + PrettyPipes.ID + ".cancel_all"), b -> {
|
||||
this.cancelCraftingButton = this.addRenderableWidget(new Button(this.leftPos + this.imageWidth + 4, this.topPos + 4 + 64, 54, 20, new TranslatableComponent("info." + PrettyPipes.ID + ".cancel_all"), b -> {
|
||||
}));
|
||||
this.cancelCraftingButton.visible = false;
|
||||
for (var y = 0; y < 4; y++) {
|
||||
|
@ -206,8 +208,8 @@ public class ItemTerminalGui extends AbstractContainerScreen<ItemTerminalContain
|
|||
|
||||
public void updateWidgets() {
|
||||
var prefs = PlayerPrefs.get();
|
||||
this.ascendingButton.setMessage(Component.literal(prefs.terminalAscending ? "^" : "v"));
|
||||
this.orderButton.setMessage(Component.literal(prefs.terminalItemOrder.name().substring(0, 1)));
|
||||
this.ascendingButton.setMessage(new TextComponent(prefs.terminalAscending ? "^" : "v"));
|
||||
this.orderButton.setMessage(new TextComponent(prefs.terminalItemOrder.name().substring(0, 1)));
|
||||
this.cancelCraftingButton.visible = this.currentlyCrafting != null && !this.currentlyCrafting.isEmpty();
|
||||
|
||||
var comparator = prefs.terminalItemOrder.comparator;
|
||||
|
@ -279,13 +281,13 @@ public class ItemTerminalGui extends AbstractContainerScreen<ItemTerminalContain
|
|||
if (this.sortedItems != null) {
|
||||
var prefs = PlayerPrefs.get();
|
||||
if (this.orderButton.isHoveredOrFocused())
|
||||
this.renderTooltip(matrix, Component.translatable("info." + PrettyPipes.ID + ".order", I18n.get("info." + PrettyPipes.ID + ".order." + prefs.terminalItemOrder.name().toLowerCase(Locale.ROOT))), mouseX, mouseY);
|
||||
this.renderTooltip(matrix, new TranslatableComponent("info." + PrettyPipes.ID + ".order", I18n.get("info." + PrettyPipes.ID + ".order." + prefs.terminalItemOrder.name().toLowerCase(Locale.ROOT))), mouseX, mouseY);
|
||||
if (this.ascendingButton.isHoveredOrFocused())
|
||||
this.renderTooltip(matrix, Component.translatable("info." + PrettyPipes.ID + "." + (prefs.terminalAscending ? "ascending" : "descending")), mouseX, mouseY);
|
||||
this.renderTooltip(matrix, new TranslatableComponent("info." + PrettyPipes.ID + "." + (prefs.terminalAscending ? "ascending" : "descending")), mouseX, mouseY);
|
||||
}
|
||||
if (this.cancelCraftingButton.visible && this.cancelCraftingButton.isHoveredOrFocused()) {
|
||||
var tooltip = I18n.get("info." + PrettyPipes.ID + ".cancel_all.desc").split("\n");
|
||||
this.renderComponentTooltip(matrix, Arrays.stream(tooltip).map(Component::literal).collect(Collectors.toList()), mouseX, mouseY);
|
||||
this.renderComponentTooltip(matrix, Arrays.stream(tooltip).map(TextComponent::new).collect(Collectors.toList()), mouseX, mouseY);
|
||||
}
|
||||
if (!this.hoveredCrafting.isEmpty())
|
||||
this.renderTooltip(matrix, this.hoveredCrafting, mouseX, mouseY);
|
||||
|
|
|
@ -62,11 +62,13 @@
|
|||
"container.prettypipes.item_terminal": "Item Terminal",
|
||||
"container.prettypipes.crafting_terminal": "Crafting Terminal",
|
||||
"container.prettypipes.pressurizer": "Pipe Pressurizer",
|
||||
"info.prettypipes.whitelist": "Allowed",
|
||||
"info.prettypipes.blacklist": "Disallowed",
|
||||
"info.prettypipes.whitelist": "\u00A72A",
|
||||
"info.prettypipes.blacklist": "\u00A74D",
|
||||
"info.prettypipes.whitelist.description": "Items in filter slots are allowed",
|
||||
"info.prettypipes.blacklist.description": "Items in filter slots are disallowed",
|
||||
"info.prettypipes.shift": "Hold Shift for info",
|
||||
"info.prettypipes.populate": "Populate",
|
||||
"info.prettypipes.populate.description": "Filters items from adjacent inventories",
|
||||
"info.prettypipes.populate": "P",
|
||||
"info.prettypipes.populate.description": "Populate filter slots with items from adjacent inventories",
|
||||
"info.prettypipes.max_stack_size": "Maximum item amount",
|
||||
"info.prettypipes.limit_to_max_on": "Limit to one stack",
|
||||
"info.prettypipes.limit_to_max_off": "Don't limit to one stack",
|
||||
|
@ -88,5 +90,12 @@
|
|||
"info.prettypipes.cancel_all": "Cancel",
|
||||
"info.prettypipes.cancel_all.desc": "Stops waiting for current crafting outputs\nDoesn't remove inputs from blocks",
|
||||
"info.prettypipes.no_pipe_connected": "The terminal needs to be connected to a pipe network",
|
||||
"info.prettypipes.too_many_pipes_connected": "The terminal can only be connected to a single pipe at a time"
|
||||
"info.prettypipes.too_many_pipes_connected": "The terminal can only be connected to a single pipe at a time",
|
||||
"dir.prettypipes.up": "Up",
|
||||
"dir.prettypipes.down": "Down",
|
||||
"dir.prettypipes.north": "North",
|
||||
"dir.prettypipes.east": "East",
|
||||
"dir.prettypipes.south": "South",
|
||||
"dir.prettypipes.west": "West",
|
||||
"dir.prettypipes.all": "All Sides"
|
||||
}
|
Loading…
Reference in a new issue