diff options
| author | shedaniel <daniel@shedaniel.me> | 2020-02-27 02:48:41 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2020-02-27 02:48:41 +0800 |
| commit | 9a7d1bc21e86041d8a6f54602282a770ca557c60 (patch) | |
| tree | 06efc60d62062e11c19af7f27230c35aec776803 | |
| parent | 2af7db96fa42f6c3c4cf2c90a170cfd25533c7ac (diff) | |
| download | RoughlyEnoughItems-9a7d1bc21e86041d8a6f54602282a770ca557c60.tar.gz RoughlyEnoughItems-9a7d1bc21e86041d8a6f54602282a770ca557c60.tar.bz2 RoughlyEnoughItems-9a7d1bc21e86041d8a6f54602282a770ca557c60.zip | |
Better refiltering, 20w09a, delta based PreRecipeViewingScreen animation and fix pressing E closes when searching.
Signed-off-by: shedaniel <daniel@shedaniel.me>
| -rwxr-xr-x | build.gradle | 17 | ||||
| -rw-r--r-- | gradle.properties | 4 | ||||
| -rw-r--r-- | src/main/java/me/shedaniel/rei/gui/PreRecipeViewingScreen.java | 2 | ||||
| -rw-r--r-- | src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java | 10 | ||||
| -rw-r--r-- | src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java | 15 | ||||
| -rw-r--r-- | src/main/java/me/shedaniel/rei/impl/EntryRegistryImpl.java | 7 |
6 files changed, 31 insertions, 24 deletions
diff --git a/build.gradle b/build.gradle index 4faa5121c..275940f8e 100755 --- a/build.gradle +++ b/build.gradle @@ -52,12 +52,18 @@ dependencies { minecraft("com.mojang:minecraft:${project.minecraft_version}") mappings("net.fabricmc:yarn:${project.yarn_version}:v2") modApi("net.fabricmc:fabric-loader:${project.fabricloader_version}") - modApi("net.fabricmc.fabric-api:fabric-api:${project.fabric_api}") + modApi("net.fabricmc.fabric-api:fabric-api:${project.fabric_api}") { + exclude module: "fabric-renderer-indigo" + } modApi("me.shedaniel.cloth:cloth-events:${cloth_events_version}") { transitive = false } - modImplementation("me.shedaniel.cloth:config-2:${cloth_config_version}") - modApi("me.sargunvohra.mcmods:autoconfig1u:${project.autoconfig1u}") + modImplementation("me.shedaniel.cloth:config-2:${cloth_config_version}") { + exclude module: "fabric-api" + } + modApi("me.sargunvohra.mcmods:autoconfig1u:${project.autoconfig1u}") { + exclude module: "fabric-api" + } modApi("org.jetbrains:annotations:18.0.0") modCompileOnly("io.github.prospector:modmenu:${modmenu_version}") { transitive = false @@ -65,9 +71,6 @@ dependencies { modRuntime("io.github.prospector:modmenu:${modmenu_version}") { transitive = false } -// modRuntime("com.lettuce.fudge:notenoughcrashes:1.1.5+1.15.1") { -// transitive = false -// } if (includeDep) { afterEvaluate { def listAdded = new ArrayList(Arrays.asList((api_exculde as String).split(','))) @@ -130,7 +133,7 @@ curseforge { embeddedLibrary 'cloth-config' } mainArtifact(file("${project.buildDir}/libs/${project.archivesBaseName}-${project.version}.jar")) { - displayName = "[Fabric 20w08a] v$project.version" + displayName = "[Fabric 20w09a] v$project.version" } afterEvaluate { uploadTask.dependsOn("remapJar") diff --git a/gradle.properties b/gradle.properties index 8ebee84ec..75cfb9dae 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ mod_version=4.0.5-unstable -minecraft_version=20w08a -yarn_version=20w08a+build.1 +minecraft_version=20w09a +yarn_version=20w09a+build.1 fabricloader_version=0.7.8+build.184 cloth_events_version=1.2.0 cloth_config_version=2.10 diff --git a/src/main/java/me/shedaniel/rei/gui/PreRecipeViewingScreen.java b/src/main/java/me/shedaniel/rei/gui/PreRecipeViewingScreen.java index 57a8859c6..13fd15027 100644 --- a/src/main/java/me/shedaniel/rei/gui/PreRecipeViewingScreen.java +++ b/src/main/java/me/shedaniel/rei/gui/PreRecipeViewingScreen.java @@ -156,7 +156,7 @@ public class PreRecipeViewingScreen extends Screen { private void updateFramePosition(float delta) { target = clamp(target); if (!DynamicNewSmoothScrollingEntryListWidget.Precision.almostEquals(frame, target, DynamicNewSmoothScrollingEntryListWidget.Precision.FLOAT_EPSILON)) - frame = ease(frame, target, Math.min((System.currentTimeMillis() - start) / ((double) duration), 1)); + frame = ease(frame, target, Math.min((System.currentTimeMillis() - start) / (double) duration * delta * 3.0D, 1)); else frame = target; } diff --git a/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java b/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java index 9ce0ce872..a678ce12c 100644 --- a/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java +++ b/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java @@ -150,11 +150,6 @@ public class RecipeViewingScreen extends Screen implements StackToNoticeScreen { init(); return true; } - if ((int_1 == 256 || this.minecraft.options.keyInventory.matchesKey(int_1, int_2)) && this.shouldCloseOnEsc()) { - MinecraftClient.getInstance().openScreen(ScreenHelper.getLastContainerScreen()); - ScreenHelper.getLastOverlay().init(); - return true; - } if (int_1 == 258) { boolean boolean_1 = !hasShiftDown(); if (!this.changeFocus(boolean_1)) @@ -175,6 +170,11 @@ public class RecipeViewingScreen extends Screen implements StackToNoticeScreen { for (Element element : children()) if (element.keyPressed(int_1, int_2, int_3)) return true; + if (int_1 == 256 || this.minecraft.options.keyInventory.matchesKey(int_1, int_2)) { + MinecraftClient.getInstance().openScreen(ScreenHelper.getLastContainerScreen()); + ScreenHelper.getLastOverlay().init(); + return true; + } if (int_1 == 259) { if (ScreenHelper.hasLastRecipeScreen()) minecraft.openScreen(ScreenHelper.getLastRecipeScreen()); diff --git a/src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java b/src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java index e60140c78..fc9e287b4 100644 --- a/src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java +++ b/src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java @@ -105,6 +105,11 @@ public class VillagerRecipeViewingScreen extends Screen implements StackToNotice } @Override + public boolean isPauseScreen() { + return false; + } + + @Override public void addIngredientStackToNotice(EntryStack stack) { ingredientStackToNotice = stack; } @@ -457,11 +462,6 @@ public class VillagerRecipeViewingScreen extends Screen implements StackToNotice @Override public boolean keyPressed(int int_1, int int_2, int int_3) { - if ((int_1 == 256 || this.minecraft.options.keyInventory.matchesKey(int_1, int_2)) && this.shouldCloseOnEsc()) { - MinecraftClient.getInstance().openScreen(ScreenHelper.getLastContainerScreen()); - ScreenHelper.getLastOverlay().init(); - return true; - } if (int_1 == 258) { boolean boolean_1 = !hasShiftDown(); if (!this.changeFocus(boolean_1)) @@ -490,6 +490,11 @@ public class VillagerRecipeViewingScreen extends Screen implements StackToNotice for (Element element : children()) if (element.keyPressed(int_1, int_2, int_3)) return true; + if (int_1 == 256 || this.minecraft.options.keyInventory.matchesKey(int_1, int_2)) { + MinecraftClient.getInstance().openScreen(ScreenHelper.getLastContainerScreen()); + ScreenHelper.getLastOverlay().init(); + return true; + } if (int_1 == 259) { if (ScreenHelper.hasLastRecipeScreen()) minecraft.openScreen(ScreenHelper.getLastRecipeScreen()); diff --git a/src/main/java/me/shedaniel/rei/impl/EntryRegistryImpl.java b/src/main/java/me/shedaniel/rei/impl/EntryRegistryImpl.java index c6d6ce190..c4db31c96 100644 --- a/src/main/java/me/shedaniel/rei/impl/EntryRegistryImpl.java +++ b/src/main/java/me/shedaniel/rei/impl/EntryRegistryImpl.java @@ -94,15 +94,14 @@ public class EntryRegistryImpl implements EntryRegistry { public void refilter() { long started = System.currentTimeMillis(); - Set<EntryStack> set = Sets.newLinkedHashSet(); - set.addAll(ConfigObject.getInstance().getFilteredStacks()); + Collection<EntryStack> filteredStacks = ConfigObject.getInstance().getFilteredStacks(); preFilteredList.clear(); for (EntryStack stack : getStacksList()) { - if (findFirstOrNullEqualsEntryIgnoreAmount(set, stack) == null) + if (findFirstOrNullEqualsEntryIgnoreAmount(filteredStacks, stack) == null) preFilteredList.add(stack); } long time = System.currentTimeMillis() - started; - RoughlyEnoughItemsCore.LOGGER.info("[REI] Refiltered %d entries in %dms.", set.size(), time); + RoughlyEnoughItemsCore.LOGGER.info("[REI] Refiltered %d entries in %dms.", filteredStacks.size(), time); } public void reset() { |
