aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUnknown <shekwancheung0528@gmail.com>2019-05-12 10:55:09 +0800
committerUnknown <shekwancheung0528@gmail.com>2019-05-12 10:55:09 +0800
commitb99108611ea89dc0eda6c433447ce398a98ad4ad (patch)
treee490afcfe8974af8a6c65954667bf822505224d4
parenteab120d5619f972e29afc9776959f6d6096d3926 (diff)
downloadRoughlyEnoughItems-b99108611ea89dc0eda6c433447ce398a98ad4ad.tar.gz
RoughlyEnoughItems-b99108611ea89dc0eda6c433447ce398a98ad4ad.tar.bz2
RoughlyEnoughItems-b99108611ea89dc0eda6c433447ce398a98ad4ad.zip
Build 109
-rw-r--r--CHANGELOG.md3
-rwxr-xr-xbuild.gradle24
-rw-r--r--gradle.properties12
-rw-r--r--src/main/java/me/shedaniel/rei/api/ClientHelper.java3
-rw-r--r--src/main/java/me/shedaniel/rei/client/ClientHelperImpl.java9
-rw-r--r--src/main/java/me/shedaniel/rei/client/ConfigObject.java3
-rw-r--r--src/main/java/me/shedaniel/rei/client/DisplayHelperImpl.java2
-rw-r--r--src/main/java/me/shedaniel/rei/client/RecipeHelperImpl.java6
-rw-r--r--src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java3
-rw-r--r--src/main/java/me/shedaniel/rei/gui/widget/SearchFieldWidget.java3
10 files changed, 31 insertions, 37 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 35f13813f..66a4b2643 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,7 @@
View full changelog [here](https://github.com/shedaniel/RoughlyEnoughItems/blob/1.14/CHANGELOG.md).
+## v2.9-beta+build.109 (BETA)
+- Fixed [#92](https://github.com/shedaniel/RoughlyEnoughItems/issues/92): Make REI Buttons use an extra sheet
+- Adds: Support for `{item_name}` in cheating items for getting the path of the item identifier
## v2.9-beta+build.108 (BETA)
- Fixed [#88](https://github.com/shedaniel/RoughlyEnoughItems/issues/88): Stupid Item Search
## v2.9-beta+build.107 (BETA)
diff --git a/build.gradle b/build.gradle
index a9a04feed..66ca0e783 100755
--- a/build.gradle
+++ b/build.gradle
@@ -50,21 +50,21 @@ dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_version}"
modCompile "net.fabricmc:fabric-loader:${project.fabricloader_version}"
- modCompile "net.fabricmc:fabric:${project.fabric_version}"
-// modCompile "net.fabricmc.fabric-api:fabric-keybindings:${project.fabric_keybindings}"
-// modCompile "net.fabricmc.fabric-api:fabric-lib:${project.fabric_lib}"
-// modCompile "net.fabricmc.fabric-api:fabric-networking:${project.fabric_networking}"
-// modCompile "net.fabricmc.fabric-api:fabric-events-lifecycle:${project.fabric_events_lifecycle}"
-// modCompile "net.fabricmc.fabric-api:fabric-resource-loader:${project.fabric_resource_loader}"
+// modCompile "net.fabricmc:fabric:${project.fabric_version}"
+ modCompile "net.fabricmc.fabric-api:fabric-keybindings:${project.fabric_keybindings}"
+ modCompile "net.fabricmc.fabric-api:fabric-lib:${project.fabric_lib}"
+ modCompile "net.fabricmc.fabric-api:fabric-networking:${project.fabric_networking}"
+ modCompile "net.fabricmc.fabric-api:fabric-events-lifecycle:${project.fabric_events_lifecycle}"
+ modCompile "net.fabricmc.fabric-api:fabric-resource-loader:${project.fabric_resource_loader}"
modCompile "cloth:ClothEvents:${cloth_events_version}"
modCompile "cloth-config:ClothConfig:${cloth_config_version}"
if (includeDep) {
- include "net.fabricmc:fabric:${project.fabric_version}"
-// include "net.fabricmc.fabric-api:fabric-keybindings:${project.fabric_keybindings}"
-// include "net.fabricmc.fabric-api:fabric-lib:${project.fabric_lib}"
-// include "net.fabricmc.fabric-api:fabric-networking:${project.fabric_networking}"
-// include "net.fabricmc.fabric-api:fabric-events-lifecycle:${project.fabric_events_lifecycle}"
-// include "net.fabricmc.fabric-api:fabric-resource-loader:${project.fabric_resource_loader}"
+// include "net.fabricmc:fabric:${project.fabric_version}"
+ include "net.fabricmc.fabric-api:fabric-keybindings:${project.fabric_keybindings}"
+ include "net.fabricmc.fabric-api:fabric-lib:${project.fabric_lib}"
+ include "net.fabricmc.fabric-api:fabric-networking:${project.fabric_networking}"
+ include "net.fabricmc.fabric-api:fabric-events-lifecycle:${project.fabric_events_lifecycle}"
+ include "net.fabricmc.fabric-api:fabric-resource-loader:${project.fabric_resource_loader}"
include "cloth:ClothEvents:${cloth_events_version}"
include "cloth-config:ClothConfig:${cloth_config_version}"
}
diff --git a/gradle.properties b/gradle.properties
index 5c886bcf7..ab4d7e811 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1,4 +1,4 @@
-mod_version=2.9-beta+build.108
+mod_version=2.9-beta+build.109
minecraft_version=1.14
yarn_version=1.14+build.5
fabricloader_version=0.4.6+build.141
@@ -8,8 +8,8 @@ cloth_config_version=0.2.1.14
modmenu_version=1.4.0-71
fabric_version=0.2.7+build.127
-fabric_keybindings=0.1.0
-fabric_lib=0.1.0
-fabric_networking=0.1.0
-fabric_events_lifecycle=0.1.0
-fabric_resource_loader=0.1.0
+fabric_keybindings=0.1.0+93af775a
+fabric_lib=0.1.0+93af775a
+fabric_networking=0.1.0+93af775a
+fabric_events_lifecycle=0.1.0+93af775a
+fabric_resource_loader=0.1.0+93af775a
diff --git a/src/main/java/me/shedaniel/rei/api/ClientHelper.java b/src/main/java/me/shedaniel/rei/api/ClientHelper.java
index a6531d08b..e0fbfbed3 100644
--- a/src/main/java/me/shedaniel/rei/api/ClientHelper.java
+++ b/src/main/java/me/shedaniel/rei/api/ClientHelper.java
@@ -6,7 +6,6 @@
package me.shedaniel.rei.api;
import me.shedaniel.rei.client.ClientHelperImpl;
-import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.keybinding.FabricKeyBinding;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@@ -15,7 +14,7 @@ import net.minecraft.util.Identifier;
import java.util.List;
import java.util.Map;
-public interface ClientHelper extends ClientModInitializer {
+public interface ClientHelper {
/**
* @return the api instance of {@link ClientHelperImpl}
*/
diff --git a/src/main/java/me/shedaniel/rei/client/ClientHelperImpl.java b/src/main/java/me/shedaniel/rei/client/ClientHelperImpl.java
index 5271f1c2d..b127a2461 100644
--- a/src/main/java/me/shedaniel/rei/client/ClientHelperImpl.java
+++ b/src/main/java/me/shedaniel/rei/client/ClientHelperImpl.java
@@ -17,6 +17,7 @@ import me.shedaniel.rei.api.RecipeHelper;
import me.shedaniel.rei.gui.PreRecipeViewingScreen;
import me.shedaniel.rei.gui.RecipeViewingScreen;
import me.shedaniel.rei.gui.VillagerRecipeViewingScreen;
+import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.keybinding.FabricKeyBinding;
import net.fabricmc.fabric.api.network.ClientSidePacketRegistry;
import net.fabricmc.fabric.impl.client.keybinding.KeyBindingRegistryImpl;
@@ -41,7 +42,7 @@ import java.util.List;
import java.util.Map;
import java.util.Optional;
-public class ClientHelperImpl implements ClientHelper {
+public class ClientHelperImpl implements ClientHelper, ClientModInitializer {
public static ClientHelperImpl instance;
private final Identifier recipeKeybind = new Identifier("roughlyenoughitems", "recipe_keybind");
@@ -150,10 +151,10 @@ public class ClientHelperImpl implements ClientHelper {
Identifier identifier = Registry.ITEM.getId(cheatedStack.getItem());
String tagMessage = cheatedStack.copy().getTag() != null && !cheatedStack.copy().getTag().isEmpty() ? cheatedStack.copy().getTag().asString() : "";
String og = cheatedStack.getAmount() != 1 ? RoughlyEnoughItemsCore.getConfigManager().getConfig().giveCommand.replaceAll(" \\{count}", "").replaceAll("\\{count}", "") : RoughlyEnoughItemsCore.getConfigManager().getConfig().giveCommand;
- String madeUpCommand = og.replaceAll("\\{player_name}", MinecraftClient.getInstance().player.getEntityName()).replaceAll("\\{item_identifier}", identifier.toString()).replaceAll("\\{nbt}", tagMessage).replaceAll("\\{count}", String.valueOf(cheatedStack.getAmount()));
+ String madeUpCommand = og.replaceAll("\\{player_name}", MinecraftClient.getInstance().player.getEntityName()).replaceAll("\\{item_name}", identifier.getPath()).replaceAll("\\{item_identifier}", identifier.toString()).replaceAll("\\{nbt}", tagMessage).replaceAll("\\{count}", String.valueOf(cheatedStack.getAmount()));
if (madeUpCommand.length() > 256) {
- madeUpCommand = og.replaceAll("\\{player_name}", MinecraftClient.getInstance().player.getEntityName()).replaceAll("\\{item_identifier}", identifier.toString()).replaceAll("\\{nbt}", "").replaceAll("\\{count}", String.valueOf(cheatedStack.getAmount()));
- MinecraftClient.getInstance().player.addChatMessage(new TranslatableTextComponent("text.rei" + ".too_long_nbt"), false);
+ madeUpCommand = og.replaceAll("\\{player_name}", MinecraftClient.getInstance().player.getEntityName()).replaceAll("\\{item_name}", identifier.getPath()).replaceAll("\\{item_identifier}", identifier.toString()).replaceAll("\\{nbt}", "").replaceAll("\\{count}", String.valueOf(cheatedStack.getAmount()));
+ MinecraftClient.getInstance().player.addChatMessage(new TranslatableTextComponent("text.rei.too_long_nbt"), false);
}
MinecraftClient.getInstance().player.sendChatMessage(madeUpCommand);
return true;
diff --git a/src/main/java/me/shedaniel/rei/client/ConfigObject.java b/src/main/java/me/shedaniel/rei/client/ConfigObject.java
index 609f4d1e8..254f9ace8 100644
--- a/src/main/java/me/shedaniel/rei/client/ConfigObject.java
+++ b/src/main/java/me/shedaniel/rei/client/ConfigObject.java
@@ -44,9 +44,6 @@ public class ConfigObject {
public boolean preferVisibleRecipes = false;
- // @Comment("Enable support for old REI plugins which uses registerSpeedCraft")
- // public boolean enableLegacySpeedCraftSupport = false;
-
@Comment("Force enable 2019 REI April Fools' joke") public boolean aprilFoolsFish2019 = false;
public ItemCheatingMode itemCheatingMode = ItemCheatingMode.REI_LIKE;
diff --git a/src/main/java/me/shedaniel/rei/client/DisplayHelperImpl.java b/src/main/java/me/shedaniel/rei/client/DisplayHelperImpl.java
index bb0b165b8..93419651e 100644
--- a/src/main/java/me/shedaniel/rei/client/DisplayHelperImpl.java
+++ b/src/main/java/me/shedaniel/rei/client/DisplayHelperImpl.java
@@ -23,7 +23,7 @@ public class DisplayHelperImpl implements DisplayHelper {
private static final DisplayBoundsHandler EMPTY = new DisplayBoundsHandler() {
@Override
public Class getBaseSupportedClass() {
- return Object.class;
+ return null;
}
@Override
diff --git a/src/main/java/me/shedaniel/rei/client/RecipeHelperImpl.java b/src/main/java/me/shedaniel/rei/client/RecipeHelperImpl.java
index cf8acd66e..80db040d1 100644
--- a/src/main/java/me/shedaniel/rei/client/RecipeHelperImpl.java
+++ b/src/main/java/me/shedaniel/rei/client/RecipeHelperImpl.java
@@ -35,7 +35,6 @@ public class RecipeHelperImpl implements RecipeHelper {
VISIBILITY_HANDLER_COMPARATOR = comparator.reversed();
}
- private final List<Recipe> sortedRecipes = new ArrayList<>();
private final AtomicInteger recipeCount = new AtomicInteger();
private final Map<Identifier, List<RecipeDisplay>> recipeCategoryListMap = Maps.newHashMap();
private final Map<Identifier, DisplaySettings> categoryDisplaySettingsMap = Maps.newHashMap();
@@ -199,7 +198,6 @@ public class RecipeHelperImpl implements RecipeHelper {
this.speedCraftFunctionalMap.clear();
this.categoryDisplaySettingsMap.clear();
this.displayVisibilityHandlers.clear();
- this.sortedRecipes.clear();
((DisplayHelperImpl) RoughlyEnoughItemsCore.getDisplayHelper()).resetCache();
BaseBoundsHandler baseBoundsHandler = new BaseBoundsHandlerImpl();
RoughlyEnoughItemsCore.getDisplayHelper().registerBoundsHandler(baseBoundsHandler);
@@ -253,9 +251,7 @@ public class RecipeHelperImpl implements RecipeHelper {
@Override
public List<Recipe> getVanillaSortedRecipes() {
- if (sortedRecipes.isEmpty())
- sortedRecipes.addAll(getRecipeManager().values().stream().sorted(RECIPE_COMPARATOR).collect(Collectors.toSet()));
- return sortedRecipes;
+ return getRecipeManager().values().stream().sorted(RECIPE_COMPARATOR).collect(Collectors.toList());
}
@Override
diff --git a/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java b/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java
index 3d2c1f12a..d067d4378 100644
--- a/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java
+++ b/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java
@@ -35,9 +35,8 @@ import java.util.function.Supplier;
public class RecipeViewingScreen extends Screen {
- public static final Identifier CHEST_GUI_TEXTURE = new Identifier("roughlyenoughitems", "textures/gui" + "/recipecontainer.png");
+ public static final Identifier CHEST_GUI_TEXTURE = new Identifier("roughlyenoughitems", "textures/gui/recipecontainer.png");
public static final Color SUB_COLOR = new Color(159, 159, 159);
- private static final Identifier CREATIVE_INVENTORY_TABS = new Identifier("textures/gui/container" + "/creative_inventory/tabs.png");
private final List<Widget> widgets;
private final List<TabWidget> tabs;
private final Map<RecipeCategory, List<RecipeDisplay>> categoriesMap;
diff --git a/src/main/java/me/shedaniel/rei/gui/widget/SearchFieldWidget.java b/src/main/java/me/shedaniel/rei/gui/widget/SearchFieldWidget.java
index 9baf62c12..f5442eb14 100644
--- a/src/main/java/me/shedaniel/rei/gui/widget/SearchFieldWidget.java
+++ b/src/main/java/me/shedaniel/rei/gui/widget/SearchFieldWidget.java
@@ -9,7 +9,6 @@ import com.mojang.blaze3d.platform.GlStateManager;
import net.minecraft.client.audio.PositionedSoundInstance;
import net.minecraft.client.render.GuiLighting;
import net.minecraft.sound.SoundEvents;
-import org.lwjgl.glfw.GLFW;
public class SearchFieldWidget extends TextFieldWidget {
@@ -59,7 +58,7 @@ public class SearchFieldWidget extends TextFieldWidget {
@Override
public boolean keyPressed(int int_1, int int_2, int int_3) {
if (this.isVisible() && this.isFocused())
- if (int_1 == GLFW.GLFW_KEY_ENTER || int_1 == GLFW.GLFW_KEY_KP_ENTER) {
+ if (int_1 == 257 || int_1 == 335) {
setFocused(false);
return true;
}