Fix alternatives button showing up when not allowed

This commit is contained in:
raoulvdberge
2019-11-11 16:50:03 +01:00
parent dcefbf0a0a
commit 03287f071a
2 changed files with 4 additions and 5 deletions

View File

@@ -191,13 +191,13 @@ public abstract class BaseScreen<T extends Container> extends ContainerScreen<T>
slot.slotNumber, slot.slotNumber,
slot.getStack(), slot.getStack(),
slot.getSlotStackLimit(), slot.getSlotStackLimit(),
parent -> new AlternativesScreen( ((FilterSlot) slot).isAlternativesAllowed() ? (parent -> new AlternativesScreen(
parent, parent,
minecraft.player, minecraft.player,
new TranslationTextComponent("gui.refinedstorage.alternatives"), new TranslationTextComponent("gui.refinedstorage.alternatives"),
slot.getStack(), slot.getStack(),
slot.getSlotIndex() slot.getSlotIndex()
) )) : null
)); ));
} }
} }
@@ -220,13 +220,13 @@ public abstract class BaseScreen<T extends Container> extends ContainerScreen<T>
slot.slotNumber, slot.slotNumber,
stack, stack,
((FluidFilterSlot) slot).getFluidInventory().getMaxAmount(), ((FluidFilterSlot) slot).getFluidInventory().getMaxAmount(),
parent -> new AlternativesScreen( ((FluidFilterSlot) slot).isAlternativesAllowed() ? (parent -> new AlternativesScreen(
this, this,
minecraft.player, minecraft.player,
new TranslationTextComponent("gui.refinedstorage.alternatives"), new TranslationTextComponent("gui.refinedstorage.alternatives"),
stack, stack,
slot.getSlotIndex() slot.getSlotIndex()
) )) : null
)); ));
} }
} else { } else {

View File

@@ -14,7 +14,6 @@ import org.apache.commons.lang3.tuple.Pair;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import java.util.function.Function; import java.util.function.Function;
// TODO here too
public class FluidAmountScreen extends AmountSpecifyingScreen<FluidAmountContainer> { public class FluidAmountScreen extends AmountSpecifyingScreen<FluidAmountContainer> {
private int containerSlot; private int containerSlot;
private FluidStack stack; private FluidStack stack;