We can't have EnumGridType.WIRELESS, iterferes with block stuff
This commit is contained in:
@@ -4,8 +4,7 @@ import net.minecraft.util.IStringSerializable;
|
||||
|
||||
public enum EnumGridType implements IStringSerializable {
|
||||
NORMAL(0, "normal"),
|
||||
CRAFTING(1, "crafting"),
|
||||
WIRELESS(2, "wireless");
|
||||
CRAFTING(1, "crafting");
|
||||
|
||||
private int id;
|
||||
private String name;
|
||||
|
||||
@@ -6,6 +6,7 @@ import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import refinedstorage.block.EnumGridType;
|
||||
import refinedstorage.container.slot.SlotGridCraftingResult;
|
||||
import refinedstorage.tile.TileController;
|
||||
import refinedstorage.tile.grid.IGrid;
|
||||
import refinedstorage.tile.grid.TileGrid;
|
||||
|
||||
@@ -79,7 +80,7 @@ public class ContainerGrid extends ContainerBase {
|
||||
public void onContainerClosed(EntityPlayer player) {
|
||||
super.onContainerClosed(player);
|
||||
|
||||
if (grid.getType() == EnumGridType.WIRELESS && grid.isConnected()) {
|
||||
if (grid.getController() instanceof TileController && grid.isWireless()) {
|
||||
grid.getController().onCloseWirelessGrid(player);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ public class GuiGrid extends GuiBase {
|
||||
public void drawForeground(int mouseX, int mouseY) {
|
||||
scrollbar.update(this, mouseX, mouseY);
|
||||
|
||||
drawString(7, 7, t(grid.getType() == EnumGridType.WIRELESS ? "gui.refinedstorage:wireless_grid" : "gui.refinedstorage:grid"));
|
||||
drawString(7, 7, t(grid.isWireless() ? "gui.refinedstorage:wireless_grid" : "gui.refinedstorage:grid"));
|
||||
|
||||
if (grid.getType() == EnumGridType.CRAFTING) {
|
||||
drawString(7, 94, t("container.crafting"));
|
||||
|
||||
@@ -24,4 +24,6 @@ public interface IGrid {
|
||||
IRedstoneModeSetting getRedstoneModeSetting();
|
||||
|
||||
boolean isConnected();
|
||||
|
||||
boolean isWireless();
|
||||
}
|
||||
|
||||
@@ -209,6 +209,11 @@ public class TileGrid extends TileMachine implements IGrid {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isWireless() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setSearchBoxMode(int searchBoxMode) {
|
||||
this.searchBoxMode = searchBoxMode;
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ public class WirelessGrid implements IGrid {
|
||||
|
||||
@Override
|
||||
public EnumGridType getType() {
|
||||
return EnumGridType.WIRELESS;
|
||||
return EnumGridType.NORMAL;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -81,6 +81,11 @@ public class WirelessGrid implements IGrid {
|
||||
|
||||
@Override
|
||||
public boolean isConnected() {
|
||||
return getController() instanceof TileController;
|
||||
return getController() instanceof TileController && getController().isActive();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isWireless() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user