Don't show oredict pattern when processing+fluids, fix crafting preview scrollbar.
This commit is contained in:
@@ -79,7 +79,7 @@ public class GuiCraftingPreview extends GuiBase {
|
|||||||
this.quantity = quantity;
|
this.quantity = quantity;
|
||||||
this.fluids = fluids;
|
this.fluids = fluids;
|
||||||
|
|
||||||
this.scrollbar = new Scrollbar(235, 20, 12, 168);
|
this.scrollbar = new Scrollbar(235, 20, 12, 149);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import com.raoulvdberge.refinedstorage.gui.grid.view.GridViewFluid;
|
|||||||
import com.raoulvdberge.refinedstorage.gui.grid.view.GridViewItem;
|
import com.raoulvdberge.refinedstorage.gui.grid.view.GridViewItem;
|
||||||
import com.raoulvdberge.refinedstorage.gui.grid.view.IGridView;
|
import com.raoulvdberge.refinedstorage.gui.grid.view.IGridView;
|
||||||
import com.raoulvdberge.refinedstorage.network.*;
|
import com.raoulvdberge.refinedstorage.network.*;
|
||||||
|
import com.raoulvdberge.refinedstorage.tile.config.IType;
|
||||||
import com.raoulvdberge.refinedstorage.tile.data.TileDataManager;
|
import com.raoulvdberge.refinedstorage.tile.data.TileDataManager;
|
||||||
import com.raoulvdberge.refinedstorage.tile.grid.TileGrid;
|
import com.raoulvdberge.refinedstorage.tile.grid.TileGrid;
|
||||||
import com.raoulvdberge.refinedstorage.tile.grid.portable.IPortableGrid;
|
import com.raoulvdberge.refinedstorage.tile.grid.portable.IPortableGrid;
|
||||||
@@ -124,7 +125,15 @@ public class GuiGrid extends GuiBase implements IResizableDisplay {
|
|||||||
|
|
||||||
if (grid.getGridType() == GridType.PATTERN) {
|
if (grid.getGridType() == GridType.PATTERN) {
|
||||||
processingPattern = addCheckBox(x + 7, y + tabs.getHeight() + getTopHeight() + (getVisibleRows() * 18) + 60, t("misc.refinedstorage:processing"), TileGrid.PROCESSING_PATTERN.getValue());
|
processingPattern = addCheckBox(x + 7, y + tabs.getHeight() + getTopHeight() + (getVisibleRows() * 18) + 60, t("misc.refinedstorage:processing"), TileGrid.PROCESSING_PATTERN.getValue());
|
||||||
oredictPattern = addCheckBox(processingPattern.x + processingPattern.width + 5, y + tabs.getHeight() + getTopHeight() + (getVisibleRows() * 18) + 60, t("misc.refinedstorage:oredict"), TileGrid.OREDICT_PATTERN.getValue());
|
|
||||||
|
boolean showOredict = true;
|
||||||
|
if (((NetworkNodeGrid) grid).isProcessingPattern() && ((NetworkNodeGrid) grid).getType() == IType.FLUIDS) {
|
||||||
|
showOredict = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (showOredict) {
|
||||||
|
oredictPattern = addCheckBox(processingPattern.x + processingPattern.width + 5, y + tabs.getHeight() + getTopHeight() + (getVisibleRows() * 18) + 60, t("misc.refinedstorage:oredict"), TileGrid.OREDICT_PATTERN.getValue());
|
||||||
|
}
|
||||||
|
|
||||||
addSideButton(new SideButtonType(this, TileGrid.PROCESSING_TYPE));
|
addSideButton(new SideButtonType(this, TileGrid.PROCESSING_TYPE));
|
||||||
}
|
}
|
||||||
@@ -455,7 +464,7 @@ public class GuiGrid extends GuiBase implements IResizableDisplay {
|
|||||||
FMLCommonHandler.instance().showGuiScreen(new GuiGridCraftingSettings(this, ((ContainerGrid) this.inventorySlots).getPlayer(), stack));
|
FMLCommonHandler.instance().showGuiScreen(new GuiGridCraftingSettings(this, ((ContainerGrid) this.inventorySlots).getPlayer(), stack));
|
||||||
} else if (grid.getGridType() == GridType.FLUID && held.isEmpty()) {
|
} else if (grid.getGridType() == GridType.FLUID && held.isEmpty()) {
|
||||||
RS.INSTANCE.network.sendToServer(new MessageGridFluidPull(view.getStacks().get(slotNumber).getHash(), GuiScreen.isShiftKeyDown()));
|
RS.INSTANCE.network.sendToServer(new MessageGridFluidPull(view.getStacks().get(slotNumber).getHash(), GuiScreen.isShiftKeyDown()));
|
||||||
} else if (grid.getGridType() == GridType.NORMAL || grid.getGridType() == GridType.PATTERN) {
|
} else if (grid.getGridType() != GridType.FLUID) {
|
||||||
int flags = 0;
|
int flags = 0;
|
||||||
|
|
||||||
if (clickedButton == 1) {
|
if (clickedButton == 1) {
|
||||||
|
|||||||
@@ -3,15 +3,18 @@ package com.raoulvdberge.refinedstorage.tile.config;
|
|||||||
import com.raoulvdberge.refinedstorage.api.network.node.INetworkNodeProxy;
|
import com.raoulvdberge.refinedstorage.api.network.node.INetworkNodeProxy;
|
||||||
import com.raoulvdberge.refinedstorage.container.ContainerBase;
|
import com.raoulvdberge.refinedstorage.container.ContainerBase;
|
||||||
import com.raoulvdberge.refinedstorage.tile.data.TileDataParameter;
|
import com.raoulvdberge.refinedstorage.tile.data.TileDataParameter;
|
||||||
|
import com.raoulvdberge.refinedstorage.tile.data.TileDataParameterClientListener;
|
||||||
import net.minecraft.network.datasync.DataSerializers;
|
import net.minecraft.network.datasync.DataSerializers;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraftforge.items.IItemHandler;
|
import net.minecraftforge.items.IItemHandler;
|
||||||
|
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
public interface IType {
|
public interface IType {
|
||||||
int ITEMS = 0;
|
int ITEMS = 0;
|
||||||
int FLUIDS = 1;
|
int FLUIDS = 1;
|
||||||
|
|
||||||
static <T extends TileEntity & INetworkNodeProxy> TileDataParameter<Integer, T> createParameter() {
|
static <T extends TileEntity & INetworkNodeProxy> TileDataParameter<Integer, T> createParameter(@Nullable TileDataParameterClientListener<Integer> clientListener) {
|
||||||
return new TileDataParameter<>(DataSerializers.VARINT, ITEMS, t -> ((IType) t.getNode()).getType(), (t, v) -> {
|
return new TileDataParameter<>(DataSerializers.VARINT, ITEMS, t -> ((IType) t.getNode()).getType(), (t, v) -> {
|
||||||
if (v == IType.ITEMS || v == IType.FLUIDS) {
|
if (v == IType.ITEMS || v == IType.FLUIDS) {
|
||||||
((IType) t.getNode()).setType(v);
|
((IType) t.getNode()).setType(v);
|
||||||
@@ -20,7 +23,11 @@ public interface IType {
|
|||||||
.filter(p -> p.openContainer instanceof ContainerBase && ((ContainerBase) p.openContainer).getTile().getPos().equals(t.getPos()))
|
.filter(p -> p.openContainer instanceof ContainerBase && ((ContainerBase) p.openContainer).getTile().getPos().equals(t.getPos()))
|
||||||
.forEach(p -> p.openContainer.detectAndSendChanges());
|
.forEach(p -> p.openContainer.detectAndSendChanges());
|
||||||
}
|
}
|
||||||
});
|
}, clientListener);
|
||||||
|
}
|
||||||
|
|
||||||
|
static <T extends TileEntity & INetworkNodeProxy> TileDataParameter<Integer, T> createParameter() {
|
||||||
|
return createParameter(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
int getType();
|
int getType();
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ public class TileGrid extends TileNode<NetworkNodeGrid> {
|
|||||||
((ContainerGrid) player.openContainer).sendAllSlots();
|
((ContainerGrid) player.openContainer).sendAllSlots();
|
||||||
});
|
});
|
||||||
}, (initial, p) -> GuiBase.executeLater(GuiGrid.class, GuiBase::initGui));
|
}, (initial, p) -> GuiBase.executeLater(GuiGrid.class, GuiBase::initGui));
|
||||||
public static final TileDataParameter<Integer, TileGrid> PROCESSING_TYPE = IType.createParameter();
|
public static final TileDataParameter<Integer, TileGrid> PROCESSING_TYPE = IType.createParameter((initial, p) -> GuiBase.executeLater(GuiGrid.class, GuiBase::initGui));
|
||||||
|
|
||||||
public static void trySortGrid(boolean initial) {
|
public static void trySortGrid(boolean initial) {
|
||||||
if (!initial) {
|
if (!initial) {
|
||||||
|
|||||||
Reference in New Issue
Block a user