mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-02-16 10:30:42 +00:00
implement identifier loader
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.dfsek.terra.forge;
|
||||
|
||||
import com.dfsek.tectonic.exception.ConfigException;
|
||||
import com.dfsek.tectonic.exception.LoadException;
|
||||
import com.dfsek.tectonic.loading.TypeRegistry;
|
||||
import com.dfsek.terra.api.TerraPlugin;
|
||||
import com.dfsek.terra.api.addons.TerraAddon;
|
||||
@@ -293,7 +294,12 @@ public class TerraForgePlugin implements TerraPlugin {
|
||||
genericLoaders.register(registry);
|
||||
registry
|
||||
.registerLoader(BlockData.class, (t, o, l) -> worldHandle.createBlockData((String) o))
|
||||
.registerLoader(com.dfsek.terra.api.platform.world.Biome.class, (t, o, l) -> biomeFixer.translate((String) o));
|
||||
.registerLoader(com.dfsek.terra.api.platform.world.Biome.class, (t, o, l) -> biomeFixer.translate((String) o))
|
||||
.registerLoader(ResourceLocation.class, (t, o, l) -> {
|
||||
ResourceLocation identifier = ResourceLocation.tryParse((String) o);
|
||||
if(identifier == null) throw new LoadException("Invalid identifier: " + o);
|
||||
return identifier;
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user