aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/shedaniel/rei/client
diff options
context:
space:
mode:
authorUnknown <shekwancheung0528@gmail.com>2019-02-03 21:15:22 +0800
committerUnknown <shekwancheung0528@gmail.com>2019-02-03 21:15:22 +0800
commit074a627663e0150e23d47a87486afb852dd2cfdd (patch)
tree0b030485400ed6f03c41b791018ef0c00229b80f /src/main/java/me/shedaniel/rei/client
parentb7abefc2eca79112a2bcc4c1be0629be2f17fb91 (diff)
downloadRoughlyEnoughItems-2.2.0.16.tar.gz
RoughlyEnoughItems-2.2.0.16.tar.bz2
RoughlyEnoughItems-2.2.0.16.zip
Version Checker + Mirror REI + Fix Bugsv2.2.0.16
Diffstat (limited to 'src/main/java/me/shedaniel/rei/client')
-rw-r--r--src/main/java/me/shedaniel/rei/client/ClientHelper.java5
-rw-r--r--src/main/java/me/shedaniel/rei/client/ConfigHelper.java21
-rw-r--r--src/main/java/me/shedaniel/rei/client/GuiHelper.java2
-rw-r--r--src/main/java/me/shedaniel/rei/client/REIConfig.java2
4 files changed, 27 insertions, 3 deletions
diff --git a/src/main/java/me/shedaniel/rei/client/ClientHelper.java b/src/main/java/me/shedaniel/rei/client/ClientHelper.java
index e4347b85b..87e438ab3 100644
--- a/src/main/java/me/shedaniel/rei/client/ClientHelper.java
+++ b/src/main/java/me/shedaniel/rei/client/ClientHelper.java
@@ -2,7 +2,6 @@ package me.shedaniel.rei.client;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
-import me.shedaniel.rei.RoughlyEnoughItemsCore;
import me.shedaniel.rei.api.IRecipeCategory;
import me.shedaniel.rei.api.IRecipeDisplay;
import me.shedaniel.rei.gui.ContainerGuiOverlay;
@@ -95,9 +94,9 @@ public class ClientHelper {
} else {
ResourceLocation location = IRegistry.ITEM.getKey(cheatedStack.getItem());
String tagMessage = cheatedStack.copy().getTag() != null && !cheatedStack.copy().getTag().isEmpty() ? cheatedStack.copy().getTag().toString() : "";
- String madeUpCommand = RoughlyEnoughItemsCore.getConfigHelper().getGiveCommandPrefix() + " " + Minecraft.getInstance().player.getScoreboardName() + " " + location.toString() + tagMessage + (cheatedStack.getCount() != 1 ? " " + cheatedStack.getCount() : "");
+ String madeUpCommand = ConfigHelper.getInstance().getGiveCommandPrefix() + " " + Minecraft.getInstance().player.getScoreboardName() + " " + location.toString() + tagMessage + (cheatedStack.getCount() != 1 ? " " + cheatedStack.getCount() : "");
if (madeUpCommand.length() > 256)
- madeUpCommand = RoughlyEnoughItemsCore.getConfigHelper().getGiveCommandPrefix() + " " + Minecraft.getInstance().player.getScoreboardName() + " " + location.toString() + (cheatedStack.getCount() != 1 ? " " + cheatedStack.getCount() : "");
+ madeUpCommand = ConfigHelper.getInstance().getGiveCommandPrefix() + " " + Minecraft.getInstance().player.getScoreboardName() + " " + location.toString() + (cheatedStack.getCount() != 1 ? " " + cheatedStack.getCount() : "");
Minecraft.getInstance().player.sendChatMessage(madeUpCommand);
return true;
}
diff --git a/src/main/java/me/shedaniel/rei/client/ConfigHelper.java b/src/main/java/me/shedaniel/rei/client/ConfigHelper.java
index d0e5de001..9b6c15596 100644
--- a/src/main/java/me/shedaniel/rei/client/ConfigHelper.java
+++ b/src/main/java/me/shedaniel/rei/client/ConfigHelper.java
@@ -13,8 +13,13 @@ public class ConfigHelper {
private final File configFile;
private REIConfig config;
+ private static ConfigHelper instance = new ConfigHelper();
private boolean craftableOnly;
+ public static ConfigHelper getInstance() {
+ return instance;
+ }
+
public ConfigHelper() {
this.configFile = new File(RiftLoader.instance.configDir, "rei.json");
this.craftableOnly = false;
@@ -105,4 +110,20 @@ public class ConfigHelper {
config.sideSearchField = sideSearchField;
}
+ public boolean checkUpdates() {
+ return config.checkUpdates;
+ }
+
+ public void setCheckUpdates(boolean checkUpdates) {
+ config.checkUpdates = checkUpdates;
+ }
+
+ public boolean isMirrorItemPanel() {
+ return config.mirrorItemPanel;
+ }
+
+ public void setMirrorItemPanel(boolean mirrorItemPanel) {
+ config.mirrorItemPanel = mirrorItemPanel;
+ }
+
}
diff --git a/src/main/java/me/shedaniel/rei/client/GuiHelper.java b/src/main/java/me/shedaniel/rei/client/GuiHelper.java
index 253a51480..1f603463b 100644
--- a/src/main/java/me/shedaniel/rei/client/GuiHelper.java
+++ b/src/main/java/me/shedaniel/rei/client/GuiHelper.java
@@ -4,6 +4,7 @@ import com.google.common.collect.Lists;
import me.shedaniel.rei.gui.ContainerGuiOverlay;
import me.shedaniel.rei.gui.widget.TextFieldWidget;
import me.shedaniel.rei.listeners.IMixinGuiContainer;
+import me.shedaniel.rei.update.UpdateAnnouncer;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.item.ItemStack;
@@ -59,6 +60,7 @@ public class GuiHelper implements ClientTickable {
GuiHelper.lastGuiContainer = (GuiContainer) client.currentScreen;
GuiHelper.lastMixinGuiContainer = (IMixinGuiContainer) lastGuiContainer;
}
+ UpdateAnnouncer.clientTick(client);
}
}
diff --git a/src/main/java/me/shedaniel/rei/client/REIConfig.java b/src/main/java/me/shedaniel/rei/client/REIConfig.java
index 49ccb1dec..b5b798371 100644
--- a/src/main/java/me/shedaniel/rei/client/REIConfig.java
+++ b/src/main/java/me/shedaniel/rei/client/REIConfig.java
@@ -12,5 +12,7 @@ public class REIConfig {
public boolean enableCraftableOnlyButton = true;
public boolean sideSearchField = false;
public String giveCommandPrefix = "/give";
+ public boolean checkUpdates = true;
+ public boolean mirrorItemPanel = false;
}