File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
github/kasuminova/mmce/client/gui/widget/impl/preview
hellfirepvp/modularmachinery/client/util Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -177,7 +177,10 @@ protected void addUpgradeIngredientToPattern(final DynamicMachine machine) {
177177 Map <BlockPos , BlockArray .BlockInformation > pattern = this .pattern .getPattern ();
178178 machine .getModifiersAsMatchingReplacements ().forEach ((pos , infoList ) -> infoList .forEach (info -> {
179179 if (pattern .containsKey (pos )) {
180- pattern .get (pos ).addMatchingStates (info .getMatchingStates ());
180+ // Clone the block info, we don't want to modify the canonical instance.
181+ BlockArray .BlockInformation newInfo = pattern .get (pos ).copy ();
182+ newInfo .addMatchingStates (info .getMatchingStates ());
183+ this .pattern .addBlock (pos , newInfo );
181184 } else {
182185 this .pattern .addBlock (pos , info );
183186 }
Original file line number Diff line number Diff line change @@ -136,9 +136,12 @@ public static void addReplacementToBlockArray(
136136 for (BlockArray .BlockInformation info : informationList ) {
137137 Map <BlockPos , BlockArray .BlockInformation > pattern = blockArray .getPattern ();
138138 if (pattern .containsKey (pos )) {
139- pattern .get (pos ).addMatchingStates (info .getMatchingStates ());
139+ // Clone the block info, we don't want to modify the canonical instance.
140+ BlockArray .BlockInformation newInfo = pattern .get (pos ).copy ();
141+ newInfo .addMatchingStates (info .getMatchingStates ());
142+ blockArray .addBlock (pos , newInfo );
140143 } else {
141- pattern . put (pos , info );
144+ blockArray . addBlock (pos , info );
142145 }
143146 }
144147 }
You can’t perform that action at this time.
0 commit comments