refactor some stuff to use new errors

This commit is contained in:
dfsek
2025-12-29 22:47:59 -07:00
parent c4a366112e
commit bdcd93f164
7 changed files with 35 additions and 12 deletions
@@ -1,5 +1,7 @@
package com.dfsek.terra.minestom.api;
import com.dfsek.terra.api.error.Invalid;
import net.minestom.server.instance.Instance;
import net.minestom.server.registry.RegistryKey;
import net.minestom.server.world.DimensionType;
@@ -39,7 +41,7 @@ public class TerraMinestomWorldBuilder {
}
public TerraMinestomWorldBuilder packById(String id) {
this.pack = platform.getConfigRegistry().getByID(id).collectThrow(RuntimeException::new);
this.pack = platform.getConfigRegistry().getByID(id).collectThrow(Invalid::toIllegal);
return this;
}