Skip to content

Commit

Permalink
UniDict was trying to unify more thing than it should (again).
Browse files Browse the repository at this point in the history
  • Loading branch information
WanionCane committed Aug 27, 2016
1 parent 20db282 commit 2372989
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ plugins {
id "net.minecraftforge.gradle.forge" version "2.0.2"
}
*/
version = "1.10.2-1.7"
version = "1.10.2-1.7b"
group= "wanion.unidict" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "UniDict"

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/wanion/unidict/common/Reference.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public final class Reference
{
public static final String MOD_ID = "UniDict";
public static final String MOD_NAME = MOD_ID;
public static final String MOD_VERSION = "1.10.2-1.7";
public static final String MOD_VERSION = "1.10.2-1.7b";
public static final char SLASH = separatorChar;
public static final String MC_VERSION = "[1.10.2]";

Expand Down
3 changes: 2 additions & 1 deletion src/main/java/wanion/unidict/resource/Resource.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,9 @@ public int getChildrenCount()
public Resource filteredClone(final TIntList kindList)
{
final TIntObjectMap<UniResourceContainer> newChildrenMap = new TIntObjectHashMap<>();
final TIntSet kindSet = new TIntHashSet(kindList);
childrenMap.forEachEntry((child, container) -> {
if (childrenExists(kindList))
if (kindSet.contains(child))
newChildrenMap.put(child, container);
return true;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*/

import com.google.common.collect.Sets;
import gnu.trove.list.TIntList;
import gnu.trove.map.hash.THashMap;
import gnu.trove.map.hash.TIntObjectHashMap;
import gnu.trove.set.TLongSet;
Expand Down Expand Up @@ -143,7 +144,8 @@ private void createResources()
});
apiResourceMap.put(resourceName, new Resource(resourceName, kindMap));
});
Config.metalsToUnify.stream().filter(apiResourceMap::containsKey).forEach(resourceName -> resourceMap.put(resourceName, apiResourceMap.get(resourceName).filteredClone(Resource.kindNamesToKindList(Config.childrenOfMetals.toArray(new String[Config.childrenOfMetals.size()]))).setSortOfChildren(true)));
final TIntList kindList = Resource.kindNamesToKindList(Config.childrenOfMetals.toArray(new String[Config.childrenOfMetals.size()]));
Config.metalsToUnify.stream().filter(apiResourceMap::containsKey).forEach(resourceName -> resourceMap.put(resourceName, apiResourceMap.get(resourceName).filteredClone(kindList).setSortOfChildren(true)));
if (!Config.customUnifiedResources.isEmpty()) {
Config.customUnifiedResources.forEach((resourceName, kinds) -> {
final Resource customResource = resourceMap.containsKey(resourceName) ? resourceMap.get(resourceName) : new Resource(resourceName);
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/mcmod.info
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"modid": "UniDict",
"name": "UniDict",
"description": "a mod about unifying all the things.",
"version": "1.7",
"version": "1.7b",
"mcversion": "${mcversion}",
"url": "http://minecraft.curseforge.com/projects/unidict",
"updateUrl": "",
Expand Down

0 comments on commit 2372989

Please sign in to comment.