Migrate old worlds to new ID system
This commit is contained in:
parent
28fa7115c6
commit
e2cfd1d656
@ -1,5 +1,8 @@
|
||||
### Changelog
|
||||
|
||||
**1.0.4**
|
||||
* Migrate old worlds to new ID system
|
||||
|
||||
**1.0.3**
|
||||
* Tweak Loot Tables
|
||||
* Fix Dispenser Bugs
|
||||
|
@ -24,12 +24,10 @@ dependencies {
|
||||
|
||||
processResources {
|
||||
inputs.property "version", version
|
||||
inputs.property "modid", archivesBaseName
|
||||
|
||||
from(sourceSets.main.resources.srcDirs) {
|
||||
include "fabric.mod.json"
|
||||
expand "version": version
|
||||
expand "modid": archivesBaseName
|
||||
}
|
||||
|
||||
from(sourceSets.main.resources.srcDirs) {
|
||||
|
@ -8,7 +8,7 @@ org.gradle.jvmargs = -Xmx1G
|
||||
loader_version = 0.7.8+build.184
|
||||
|
||||
# Mod Properties
|
||||
mod_version = 1.0.3
|
||||
mod_version = 1.0.4
|
||||
maven_group = com.thebrokenrail
|
||||
archives_base_name = sorcerycraft
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.thebrokenrail.sorcerycraft.spell;
|
||||
|
||||
import com.thebrokenrail.sorcerycraft.SorceryCraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.ListTag;
|
||||
@ -64,7 +65,13 @@ public class SpellTag {
|
||||
|
||||
for (int i = 0; i < spells.size(); i++) {
|
||||
CompoundTag spell = spells.getCompound(i);
|
||||
Identifier id = new Identifier(spell.getString("id"));
|
||||
|
||||
String idStr = spell.getString("id");
|
||||
Identifier id = new Identifier(idStr);
|
||||
if (!idStr.equals(id.toString())) {
|
||||
id = new Identifier(SorceryCraft.NAMESPACE, idStr);
|
||||
}
|
||||
|
||||
int level = spell.getInt("level");
|
||||
if (map.get(id) == null || map.get(id) < level) {
|
||||
map.put(id, level);
|
||||
|
Reference in New Issue
Block a user