Fixes issues #199
This commit is contained in:
@@ -3,6 +3,9 @@
|
|||||||
### 0.8.16
|
### 0.8.16
|
||||||
**Bugfixes**
|
**Bugfixes**
|
||||||
- Fixed issue with IC2 integration causing console spam
|
- Fixed issue with IC2 integration causing console spam
|
||||||
|
- Slight performance improvement in GUI's
|
||||||
|
- Fixed not being able to change some configs in blocks
|
||||||
|
- Fixed serverside configs not syncing up with clientside sometimes
|
||||||
|
|
||||||
**Features**
|
**Features**
|
||||||
- Added German translation by ChillUpX
|
- Added German translation by ChillUpX
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import refinedstorage.gui.sidebutton.SideButtonCompare;
|
|||||||
import refinedstorage.gui.sidebutton.SideButtonMode;
|
import refinedstorage.gui.sidebutton.SideButtonMode;
|
||||||
import refinedstorage.gui.sidebutton.SideButtonRedstoneMode;
|
import refinedstorage.gui.sidebutton.SideButtonRedstoneMode;
|
||||||
import refinedstorage.tile.IStorageGui;
|
import refinedstorage.tile.IStorageGui;
|
||||||
|
import refinedstorage.tile.data.TileDataManager;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
@@ -15,7 +16,7 @@ public class GuiStorage extends GuiBase {
|
|||||||
private IStorageGui gui;
|
private IStorageGui gui;
|
||||||
private String texture;
|
private String texture;
|
||||||
|
|
||||||
private GuiTextField priorityField;
|
public static GuiTextField PRIORITY;
|
||||||
|
|
||||||
private int barX = 8;
|
private int barX = 8;
|
||||||
private int barY = 54;
|
private int barY = 54;
|
||||||
@@ -35,27 +36,26 @@ public class GuiStorage extends GuiBase {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(int x, int y) {
|
public void init(int x, int y) {
|
||||||
if (gui.getRedstoneModeConfig() != null) {
|
if (gui.getRedstoneModeParameter() != null) {
|
||||||
addSideButton(new SideButtonRedstoneMode(gui.getRedstoneModeConfig()));
|
addSideButton(new SideButtonRedstoneMode(gui.getRedstoneModeParameter()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gui.getModeConfig() != null) {
|
if (gui.getFilterParameter() != null) {
|
||||||
addSideButton(new SideButtonMode(gui.getModeConfig()));
|
addSideButton(new SideButtonMode(gui.getFilterParameter()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gui.getCompareConfig() != null) {
|
if (gui.getCompareParameter() != null) {
|
||||||
addSideButton(new SideButtonCompare(gui.getCompareConfig(), CompareUtils.COMPARE_DAMAGE));
|
addSideButton(new SideButtonCompare(gui.getCompareParameter(), CompareUtils.COMPARE_DAMAGE));
|
||||||
addSideButton(new SideButtonCompare(gui.getCompareConfig(), CompareUtils.COMPARE_NBT));
|
addSideButton(new SideButtonCompare(gui.getCompareParameter(), CompareUtils.COMPARE_NBT));
|
||||||
}
|
}
|
||||||
|
|
||||||
priorityField = new GuiTextField(0, fontRendererObj, x + 98 + 1, y + 54 + 1, 25, fontRendererObj.FONT_HEIGHT);
|
PRIORITY = new GuiTextField(0, fontRendererObj, x + 98 + 1, y + 54 + 1, 25, fontRendererObj.FONT_HEIGHT);
|
||||||
// @TODO: Only change this when packet is received
|
PRIORITY.setText(String.valueOf(gui.getPriorityParameter().getValue()));
|
||||||
priorityField.setText(String.valueOf(gui.getPriority()));
|
PRIORITY.setEnableBackgroundDrawing(false);
|
||||||
priorityField.setEnableBackgroundDrawing(false);
|
PRIORITY.setVisible(true);
|
||||||
priorityField.setVisible(true);
|
PRIORITY.setTextColor(16777215);
|
||||||
priorityField.setTextColor(16777215);
|
PRIORITY.setCanLoseFocus(true);
|
||||||
priorityField.setCanLoseFocus(true);
|
PRIORITY.setFocused(false);
|
||||||
priorityField.setFocused(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -72,7 +72,7 @@ public class GuiStorage extends GuiBase {
|
|||||||
|
|
||||||
drawTexture(x + barX, y + barY + barHeight - barHeightNew, 179, barHeight - barHeightNew, barWidth, barHeightNew);
|
drawTexture(x + barX, y + barY + barHeight - barHeightNew, 179, barHeight - barHeightNew, barWidth, barHeightNew);
|
||||||
|
|
||||||
priorityField.drawTextBox();
|
PRIORITY.drawTextBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -97,16 +97,16 @@ public class GuiStorage extends GuiBase {
|
|||||||
protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException {
|
protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException {
|
||||||
super.mouseClicked(mouseX, mouseY, mouseButton);
|
super.mouseClicked(mouseX, mouseY, mouseButton);
|
||||||
|
|
||||||
priorityField.mouseClicked(mouseX, mouseY, mouseButton);
|
PRIORITY.mouseClicked(mouseX, mouseY, mouseButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void keyTyped(char character, int keyCode) throws IOException {
|
protected void keyTyped(char character, int keyCode) throws IOException {
|
||||||
if (!checkHotbarKeys(keyCode) && priorityField.textboxKeyTyped(character, keyCode)) {
|
if (!checkHotbarKeys(keyCode) && PRIORITY.textboxKeyTyped(character, keyCode)) {
|
||||||
Integer result = Ints.tryParse(priorityField.getText());
|
Integer result = Ints.tryParse(PRIORITY.getText());
|
||||||
|
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
gui.onPriorityChanged(result);
|
TileDataManager.setParameter(gui.getPriorityParameter(), result);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
super.keyTyped(character, keyCode);
|
super.keyTyped(character, keyCode);
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ public class GuiGrid extends GuiBase {
|
|||||||
private GridSortingQuantity quantitySorting = new GridSortingQuantity();
|
private GridSortingQuantity quantitySorting = new GridSortingQuantity();
|
||||||
private GridSortingName nameSorting = new GridSortingName();
|
private GridSortingName nameSorting = new GridSortingName();
|
||||||
|
|
||||||
private GuiTextField searchField;
|
public static GuiTextField SEARCH_FIELD;
|
||||||
|
|
||||||
private ContainerGrid container;
|
private ContainerGrid container;
|
||||||
private List<ClientStack> items = new ArrayList<ClientStack>();
|
private List<ClientStack> items = new ArrayList<ClientStack>();
|
||||||
@@ -64,17 +64,15 @@ public class GuiGrid extends GuiBase {
|
|||||||
int sx = x + 80 + 1;
|
int sx = x + 80 + 1;
|
||||||
int sy = y + 6 + 1;
|
int sy = y + 6 + 1;
|
||||||
|
|
||||||
if (searchField == null) {
|
if (SEARCH_FIELD == null) {
|
||||||
searchField = new GuiTextField(0, fontRendererObj, sx, sy, 88 - 6, fontRendererObj.FONT_HEIGHT);
|
SEARCH_FIELD = new GuiTextField(0, fontRendererObj, sx, sy, 88 - 6, fontRendererObj.FONT_HEIGHT);
|
||||||
searchField.setEnableBackgroundDrawing(false);
|
SEARCH_FIELD.setEnableBackgroundDrawing(false);
|
||||||
searchField.setVisible(true);
|
SEARCH_FIELD.setVisible(true);
|
||||||
searchField.setTextColor(16777215);
|
SEARCH_FIELD.setTextColor(16777215);
|
||||||
|
updateSearchFieldFocus(grid.getSearchBoxMode());
|
||||||
// @TODO: Only do this after packet
|
|
||||||
updateSearchBoxFocus(grid.getSearchBoxMode());
|
|
||||||
} else {
|
} else {
|
||||||
searchField.xPosition = sx;
|
SEARCH_FIELD.xPosition = sx;
|
||||||
searchField.yPosition = sy;
|
SEARCH_FIELD.yPosition = sy;
|
||||||
}
|
}
|
||||||
|
|
||||||
addSideButton(new SideButtonGridViewType(grid));
|
addSideButton(new SideButtonGridViewType(grid));
|
||||||
@@ -94,7 +92,7 @@ public class GuiGrid extends GuiBase {
|
|||||||
if (grid.isConnected()) {
|
if (grid.isConnected()) {
|
||||||
items.addAll(RefinedStorage.INSTANCE.items);
|
items.addAll(RefinedStorage.INSTANCE.items);
|
||||||
|
|
||||||
String query = searchField.getText().trim().toLowerCase();
|
String query = SEARCH_FIELD.getText().trim().toLowerCase();
|
||||||
|
|
||||||
Iterator<ClientStack> t = items.iterator();
|
Iterator<ClientStack> t = items.iterator();
|
||||||
|
|
||||||
@@ -245,7 +243,7 @@ public class GuiGrid extends GuiBase {
|
|||||||
drawTexture(x + 152, y + 114, 240, ty * 16, 16, 16);
|
drawTexture(x + 152, y + 114, 240, ty * 16, 16, 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
searchField.drawTextBox();
|
SEARCH_FIELD.drawTextBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -330,11 +328,11 @@ public class GuiGrid extends GuiBase {
|
|||||||
public void mouseClicked(int mouseX, int mouseY, int clickedButton) throws IOException {
|
public void mouseClicked(int mouseX, int mouseY, int clickedButton) throws IOException {
|
||||||
super.mouseClicked(mouseX, mouseY, clickedButton);
|
super.mouseClicked(mouseX, mouseY, clickedButton);
|
||||||
|
|
||||||
searchField.mouseClicked(mouseX, mouseY, clickedButton);
|
SEARCH_FIELD.mouseClicked(mouseX, mouseY, clickedButton);
|
||||||
|
|
||||||
if (clickedButton == 1 && inBounds(79, 5, 90, 12, mouseX - guiLeft, mouseY - guiTop)) {
|
if (clickedButton == 1 && inBounds(79, 5, 90, 12, mouseX - guiLeft, mouseY - guiTop)) {
|
||||||
searchField.setText("");
|
SEARCH_FIELD.setText("");
|
||||||
searchField.setFocused(true);
|
SEARCH_FIELD.setFocused(true);
|
||||||
|
|
||||||
updateJEI();
|
updateJEI();
|
||||||
}
|
}
|
||||||
@@ -387,7 +385,7 @@ public class GuiGrid extends GuiBase {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void keyTyped(char character, int keyCode) throws IOException {
|
protected void keyTyped(char character, int keyCode) throws IOException {
|
||||||
if (!checkHotbarKeys(keyCode) && searchField.textboxKeyTyped(character, keyCode)) {
|
if (!checkHotbarKeys(keyCode) && SEARCH_FIELD.textboxKeyTyped(character, keyCode)) {
|
||||||
updateJEI();
|
updateJEI();
|
||||||
} else {
|
} else {
|
||||||
super.keyTyped(character, keyCode);
|
super.keyTyped(character, keyCode);
|
||||||
@@ -396,12 +394,12 @@ public class GuiGrid extends GuiBase {
|
|||||||
|
|
||||||
private void updateJEI() {
|
private void updateJEI() {
|
||||||
if (IntegrationJEI.isLoaded() && (grid.getSearchBoxMode() == TileGrid.SEARCH_BOX_MODE_JEI_SYNCHRONIZED || grid.getSearchBoxMode() == TileGrid.SEARCH_BOX_MODE_JEI_SYNCHRONIZED_AUTOSELECTED)) {
|
if (IntegrationJEI.isLoaded() && (grid.getSearchBoxMode() == TileGrid.SEARCH_BOX_MODE_JEI_SYNCHRONIZED || grid.getSearchBoxMode() == TileGrid.SEARCH_BOX_MODE_JEI_SYNCHRONIZED_AUTOSELECTED)) {
|
||||||
IntegrationJEI.INSTANCE.getRuntime().getItemListOverlay().setFilterText(searchField.getText());
|
IntegrationJEI.INSTANCE.getRuntime().getItemListOverlay().setFilterText(SEARCH_FIELD.getText());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateSearchBoxFocus(int mode) {
|
public static void updateSearchFieldFocus(int mode) {
|
||||||
searchField.setCanLoseFocus(!TileGrid.isSearchBoxModeWithAutoselection(mode));
|
SEARCH_FIELD.setCanLoseFocus(!TileGrid.isSearchBoxModeWithAutoselection(mode));
|
||||||
searchField.setFocused(TileGrid.isSearchBoxModeWithAutoselection(mode));
|
SEARCH_FIELD.setFocused(TileGrid.isSearchBoxModeWithAutoselection(mode));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,7 +43,5 @@ public class SideButtonGridSearchBoxMode extends SideButton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
gui.getGrid().onSearchBoxModeChanged(mode);
|
gui.getGrid().onSearchBoxModeChanged(mode);
|
||||||
|
|
||||||
gui.updateSearchBoxFocus(mode);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,17 +6,15 @@ import refinedstorage.tile.data.TileDataParameter;
|
|||||||
public interface IStorageGui {
|
public interface IStorageGui {
|
||||||
String getGuiTitle();
|
String getGuiTitle();
|
||||||
|
|
||||||
int getPriority();
|
|
||||||
|
|
||||||
void onPriorityChanged(int priority);
|
|
||||||
|
|
||||||
IItemHandler getFilters();
|
IItemHandler getFilters();
|
||||||
|
|
||||||
TileDataParameter<Integer> getRedstoneModeConfig();
|
TileDataParameter<Integer> getRedstoneModeParameter();
|
||||||
|
|
||||||
TileDataParameter<Integer> getCompareConfig();
|
TileDataParameter<Integer> getCompareParameter();
|
||||||
|
|
||||||
TileDataParameter<Integer> getModeConfig();
|
TileDataParameter<Integer> getFilterParameter();
|
||||||
|
|
||||||
|
TileDataParameter<Integer> getPriorityParameter();
|
||||||
|
|
||||||
int getStored();
|
int getStored();
|
||||||
|
|
||||||
|
|||||||
@@ -48,14 +48,14 @@ public class TileDetector extends TileNode implements IComparable {
|
|||||||
|
|
||||||
tile.markDirty();
|
tile.markDirty();
|
||||||
}
|
}
|
||||||
}, new ITileDataListener() {
|
}, new ITileDataListener<Integer>() {
|
||||||
@Override
|
@Override
|
||||||
public void onChanged() {
|
public void onChanged(TileDataParameter<Integer> parameter) {
|
||||||
if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) {
|
if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) {
|
||||||
GuiScreen gui = Minecraft.getMinecraft().currentScreen;
|
GuiScreen gui = Minecraft.getMinecraft().currentScreen;
|
||||||
|
|
||||||
if (gui instanceof GuiDetector) {
|
if (gui instanceof GuiDetector) {
|
||||||
((GuiDetector) gui).AMOUNT.setText(String.valueOf(AMOUNT.getValue()));
|
((GuiDetector) gui).AMOUNT.setText(String.valueOf(parameter.getValue()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ import refinedstorage.inventory.ItemValidatorBasic;
|
|||||||
import refinedstorage.tile.config.IComparable;
|
import refinedstorage.tile.config.IComparable;
|
||||||
import refinedstorage.tile.config.IFilterable;
|
import refinedstorage.tile.config.IFilterable;
|
||||||
import refinedstorage.tile.config.IPrioritizable;
|
import refinedstorage.tile.config.IPrioritizable;
|
||||||
import refinedstorage.tile.data.TileDataManager;
|
|
||||||
import refinedstorage.tile.data.TileDataParameter;
|
import refinedstorage.tile.data.TileDataParameter;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -284,30 +283,30 @@ public class TileDiskDrive extends TileNode implements IStorageProvider, IStorag
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileDataParameter<Integer> getRedstoneModeConfig() {
|
public TileDataParameter<Integer> getRedstoneModeParameter() {
|
||||||
return REDSTONE_MODE;
|
return REDSTONE_MODE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileDataParameter<Integer> getCompareConfig() {
|
public TileDataParameter<Integer> getCompareParameter() {
|
||||||
return COMPARE;
|
return COMPARE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileDataParameter<Integer> getModeConfig() {
|
public TileDataParameter<Integer> getFilterParameter() {
|
||||||
return MODE;
|
return MODE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TileDataParameter<Integer> getPriorityParameter() {
|
||||||
|
return PRIORITY;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getPriority() {
|
public int getPriority() {
|
||||||
return priority;
|
return priority;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onPriorityChanged(int priority) {
|
|
||||||
TileDataManager.setParameter(PRIORITY, priority);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setPriority(int priority) {
|
public void setPriority(int priority) {
|
||||||
this.priority = priority;
|
this.priority = priority;
|
||||||
|
|||||||
@@ -206,20 +206,25 @@ public class TileStorage extends TileNode implements IStorageProvider, IStorageG
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileDataParameter<Integer> getRedstoneModeConfig() {
|
public TileDataParameter<Integer> getRedstoneModeParameter() {
|
||||||
return REDSTONE_MODE;
|
return REDSTONE_MODE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileDataParameter<Integer> getCompareConfig() {
|
public TileDataParameter<Integer> getCompareParameter() {
|
||||||
return COMPARE;
|
return COMPARE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileDataParameter<Integer> getModeConfig() {
|
public TileDataParameter<Integer> getFilterParameter() {
|
||||||
return MODE;
|
return MODE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TileDataParameter<Integer> getPriorityParameter() {
|
||||||
|
return PRIORITY;
|
||||||
|
}
|
||||||
|
|
||||||
public NBTTagCompound getStorageTag() {
|
public NBTTagCompound getStorageTag() {
|
||||||
return storageTag;
|
return storageTag;
|
||||||
}
|
}
|
||||||
@@ -237,11 +242,6 @@ public class TileStorage extends TileNode implements IStorageProvider, IStorageG
|
|||||||
return priority;
|
return priority;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onPriorityChanged(int priority) {
|
|
||||||
TileDataManager.setParameter(PRIORITY, priority);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setPriority(int priority) {
|
public void setPriority(int priority) {
|
||||||
this.priority = priority;
|
this.priority = priority;
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
package refinedstorage.tile.config;
|
package refinedstorage.tile.config;
|
||||||
|
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.gui.GuiScreen;
|
||||||
import net.minecraft.network.datasync.DataSerializers;
|
import net.minecraft.network.datasync.DataSerializers;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import refinedstorage.tile.data.ITileDataConsumer;
|
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||||
import refinedstorage.tile.data.ITileDataProducer;
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
import refinedstorage.tile.data.TileDataManager;
|
import refinedstorage.gui.GuiStorage;
|
||||||
import refinedstorage.tile.data.TileDataParameter;
|
import refinedstorage.tile.data.*;
|
||||||
|
|
||||||
public interface IPrioritizable {
|
public interface IPrioritizable {
|
||||||
static <T extends TileEntity> TileDataParameter createParameter() {
|
static <T extends TileEntity> TileDataParameter createParameter() {
|
||||||
@@ -19,6 +21,17 @@ public interface IPrioritizable {
|
|||||||
public void setValue(T tile, Integer value) {
|
public void setValue(T tile, Integer value) {
|
||||||
((IPrioritizable) tile).setPriority(value);
|
((IPrioritizable) tile).setPriority(value);
|
||||||
}
|
}
|
||||||
|
}, new ITileDataListener<Integer>() {
|
||||||
|
@Override
|
||||||
|
public void onChanged(TileDataParameter<Integer> parameter) {
|
||||||
|
if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) {
|
||||||
|
GuiScreen gui = Minecraft.getMinecraft().currentScreen;
|
||||||
|
|
||||||
|
if (gui instanceof GuiStorage) {
|
||||||
|
((GuiStorage) gui).PRIORITY.setText(String.valueOf(parameter.getValue()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
package refinedstorage.tile.data;
|
package refinedstorage.tile.data;
|
||||||
|
|
||||||
public interface ITileDataListener {
|
public interface ITileDataListener<T> {
|
||||||
void onChanged();
|
void onChanged(TileDataParameter<T> parameter);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,15 +35,11 @@ public class TileDataParameter<T> {
|
|||||||
return valueConsumer;
|
return valueConsumer;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ITileDataListener getListener() {
|
|
||||||
return listener;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setValue(T value) {
|
public void setValue(T value) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
|
|
||||||
if (listener != null) {
|
if (listener != null) {
|
||||||
listener.onChanged();
|
listener.onChanged(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -170,11 +170,6 @@ public class TileExternalStorage extends TileNode implements IStorageProvider, I
|
|||||||
return priority;
|
return priority;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onPriorityChanged(int priority) {
|
|
||||||
TileDataManager.setParameter(PRIORITY, priority);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setPriority(int priority) {
|
public void setPriority(int priority) {
|
||||||
this.priority = priority;
|
this.priority = priority;
|
||||||
@@ -221,20 +216,25 @@ public class TileExternalStorage extends TileNode implements IStorageProvider, I
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileDataParameter<Integer> getRedstoneModeConfig() {
|
public TileDataParameter<Integer> getRedstoneModeParameter() {
|
||||||
return REDSTONE_MODE;
|
return REDSTONE_MODE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileDataParameter<Integer> getCompareConfig() {
|
public TileDataParameter<Integer> getCompareParameter() {
|
||||||
return COMPARE;
|
return COMPARE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileDataParameter<Integer> getModeConfig() {
|
public TileDataParameter<Integer> getFilterParameter() {
|
||||||
return MODE;
|
return MODE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TileDataParameter<Integer> getPriorityParameter() {
|
||||||
|
return PRIORITY;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getStored() {
|
public int getStored() {
|
||||||
int stored = 0;
|
int stored = 0;
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ import net.minecraft.item.crafting.CraftingManager;
|
|||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.network.datasync.DataSerializers;
|
import net.minecraft.network.datasync.DataSerializers;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||||
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
import net.minecraftforge.items.IItemHandler;
|
import net.minecraftforge.items.IItemHandler;
|
||||||
import net.minecraftforge.items.wrapper.CombinedInvWrapper;
|
import net.minecraftforge.items.wrapper.CombinedInvWrapper;
|
||||||
import net.minecraftforge.items.wrapper.InvWrapper;
|
import net.minecraftforge.items.wrapper.InvWrapper;
|
||||||
@@ -21,15 +23,13 @@ import refinedstorage.block.BlockGrid;
|
|||||||
import refinedstorage.block.EnumGridType;
|
import refinedstorage.block.EnumGridType;
|
||||||
import refinedstorage.container.ContainerGrid;
|
import refinedstorage.container.ContainerGrid;
|
||||||
import refinedstorage.gui.grid.GridFilteredItem;
|
import refinedstorage.gui.grid.GridFilteredItem;
|
||||||
|
import refinedstorage.gui.grid.GuiGrid;
|
||||||
import refinedstorage.inventory.ItemHandlerBasic;
|
import refinedstorage.inventory.ItemHandlerBasic;
|
||||||
import refinedstorage.inventory.ItemHandlerGridFilterInGrid;
|
import refinedstorage.inventory.ItemHandlerGridFilterInGrid;
|
||||||
import refinedstorage.inventory.ItemValidatorBasic;
|
import refinedstorage.inventory.ItemValidatorBasic;
|
||||||
import refinedstorage.item.ItemPattern;
|
import refinedstorage.item.ItemPattern;
|
||||||
import refinedstorage.tile.TileNode;
|
import refinedstorage.tile.TileNode;
|
||||||
import refinedstorage.tile.data.ITileDataConsumer;
|
import refinedstorage.tile.data.*;
|
||||||
import refinedstorage.tile.data.ITileDataProducer;
|
|
||||||
import refinedstorage.tile.data.TileDataManager;
|
|
||||||
import refinedstorage.tile.data.TileDataParameter;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -97,6 +97,13 @@ public class TileGrid extends TileNode implements IGrid {
|
|||||||
tile.markDirty();
|
tile.markDirty();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}, new ITileDataListener<Integer>() {
|
||||||
|
@Override
|
||||||
|
public void onChanged(TileDataParameter<Integer> parameter) {
|
||||||
|
if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) {
|
||||||
|
GuiGrid.updateSearchFieldFocus(parameter.getValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
public static final String NBT_VIEW_TYPE = "ViewType";
|
public static final String NBT_VIEW_TYPE = "ViewType";
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import refinedstorage.RefinedStorage;
|
|||||||
import refinedstorage.api.network.IGridHandler;
|
import refinedstorage.api.network.IGridHandler;
|
||||||
import refinedstorage.block.EnumGridType;
|
import refinedstorage.block.EnumGridType;
|
||||||
import refinedstorage.gui.grid.GridFilteredItem;
|
import refinedstorage.gui.grid.GridFilteredItem;
|
||||||
|
import refinedstorage.gui.grid.GuiGrid;
|
||||||
import refinedstorage.inventory.ItemHandlerBasic;
|
import refinedstorage.inventory.ItemHandlerBasic;
|
||||||
import refinedstorage.inventory.ItemHandlerGridFilterInGrid;
|
import refinedstorage.inventory.ItemHandlerGridFilterInGrid;
|
||||||
import refinedstorage.item.ItemWirelessGrid;
|
import refinedstorage.item.ItemWirelessGrid;
|
||||||
@@ -135,6 +136,8 @@ public class WirelessGrid implements IGrid {
|
|||||||
RefinedStorage.INSTANCE.network.sendToServer(new MessageWirelessGridSettingsUpdate(getViewType(), getSortingDirection(), getSortingType(), searchBoxMode));
|
RefinedStorage.INSTANCE.network.sendToServer(new MessageWirelessGridSettingsUpdate(getViewType(), getSortingDirection(), getSortingType(), searchBoxMode));
|
||||||
|
|
||||||
this.searchBoxMode = searchBoxMode;
|
this.searchBoxMode = searchBoxMode;
|
||||||
|
|
||||||
|
GuiGrid.updateSearchFieldFocus(searchBoxMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user