fix overwriting VirtualPockets with same key

This commit is contained in:
CreepyCre 2021-01-28 21:15:19 +01:00
parent 0fb93068bd
commit c088b6c701

View file

@ -53,7 +53,7 @@ public class DepthDependentSelector extends VirtualPocket {
pocketList = Maps.newLinkedHashMap(); pocketList = Maps.newLinkedHashMap();
for (int i = 0; i < regexPockets.size(); i++) { for (int i = 0; i < regexPockets.size(); i++) {
CompoundTag pocket = regexPockets.getCompound(i); CompoundTag pocket = regexPockets.getCompound(i);
pocketList.put(pocket.getString("regex"), VirtualPocket.deserialize(pocket.getCompound("pocket"))); pocketList.putIfAbsent(pocket.getString("regex"), VirtualPocket.deserialize(pocket.getCompound("pocket")));
} }
return this; return this;
} }