Skip to content

Fix variables in finally blocks not getting renamed#105

Merged
LexManos merged 5 commits into
MinecraftForge:masterfrom
coehlrich:master
Nov 17, 2021
Merged

Fix variables in finally blocks not getting renamed#105
LexManos merged 5 commits into
MinecraftForge:masterfrom
coehlrich:master

Conversation

@coehlrich

Copy link
Copy Markdown
Contributor

The variable's are detected by using the start and and type but in the finally block the store instruction for the exception was removed but not the offset for that instruction causing the instruction offset to be different than expected

1.18 Pre Release 1 diff:

diff --git a/net/minecraft/client/resources/model/ModelBakery.java b/net/minecraft/client/resources/model/ModelBakery.java
index 98d5127..6708b64 100644
--- a/net/minecraft/client/resources/model/ModelBakery.java
+++ b/net/minecraft/client/resources/model/ModelBakery.java
@@ -19,7 +19,6 @@ import java.io.Reader;
 import java.io.StringReader;
 import java.nio.charset.StandardCharsets;
 import java.util.Collection;
-import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
@@ -428,7 +427,7 @@ public class ModelBakery {
             } catch (Exception exception) {
                throw new ModelBakery.BlockStateDefinitionException(String.format("Exception loading blockstate definition: '%s': %s", resourcelocation1, exception));
             } finally {
-               HashMap $$26 = Maps.newHashMap();
+               Map<ModelBakery.ModelGroupKey, Set<BlockState>> map3 = Maps.newHashMap();
                map.forEach((p_119336_, p_119337_) -> {
                   Pair<UnbakedModel, Supplier<ModelBakery.ModelGroupKey>> pair2 = map1.get(p_119337_);
                   if (pair2 == null) {
@@ -440,7 +439,7 @@ public class ModelBakery {

                   try {
                      ModelBakery.ModelGroupKey modelbakery$modelgroupkey1 = pair2.getSecond().get();
-                     $$26.computeIfAbsent(modelbakery$modelgroupkey1, (p_174894_) -> {
+                     map3.computeIfAbsent(modelbakery$modelgroupkey1, (p_174894_) -> {
                         return Sets.newIdentityHashSet();
                      }).add(p_119337_);
                   } catch (Exception exception1) {
@@ -448,7 +447,7 @@ public class ModelBakery {
                   }

                });
-               $$26.forEach((p_119304_, p_119305_) -> {
+               map3.forEach((p_119304_, p_119305_) -> {
                   Iterator<BlockState> iterator = p_119305_.iterator();

                   while(iterator.hasNext()) {

@LexManos LexManos merged commit f2f742b into MinecraftForge:master Nov 17, 2021
jaskarth pushed a commit to Vineflower/vineflower that referenced this pull request Jun 20, 2026
* Add missing instruction offsets

* Revert of MinecraftForge/ForgeFlower/pull/105
Revert of d88f743

Fixes #596

* temp undo

* Fix dec file issues

* Update kotlin dec file
hourianto pushed a commit to hourianto/sporeflower that referenced this pull request Jul 11, 2026
* Add missing instruction offsets

* Revert of MinecraftForge/ForgeFlower/pull/105
Revert of d88f743

Fixes #596

* temp undo

* Fix dec file issues

* Update kotlin dec file

(cherry picked from commit 5c3607387f342e042e2232f62999e133f16ae2c9)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants