use of net.silentchaos512.gear.util.ModResourceLocation in project Silent-Gear by SilentChaos512.
the class PartType method create.
/**
* Call during mod construction to create a new part type.
*
* @param builder Type builder
* @return The new PartType
* @throws IllegalArgumentException if a type with the same name already exists
*/
public static PartType create(Builder builder) {
if (VALUES.containsKey(builder.name))
throw new IllegalArgumentException(String.format("Already have PartType \"%s\"", builder.name));
PartType type = new PartType(builder);
VALUES.put(builder.name, type);
if (!type.alias.isEmpty()) {
VALUES.put(new ModResourceLocation(type.alias), type);
}
return type;
}
use of net.silentchaos512.gear.util.ModResourceLocation in project Silent-Gear by SilentChaos512.
the class PartType method fromJson.
public static PartType fromJson(JsonObject json, String key) {
String str = GsonHelper.getAsString(json, key);
PartType type = get(new ModResourceLocation(str));
if (type == null) {
throw new JsonSyntaxException("Unknown part type: " + str);
}
return type;
}
use of net.silentchaos512.gear.util.ModResourceLocation in project Silent-Gear by SilentChaos512.
the class ModWorldFeatures method registerConfiguredFeature.
private static void registerConfiguredFeature(String name, ConfiguredFeature<?, ?> configuredFeature) {
ModResourceLocation id = SilentGear.getId(name);
debugLog("Register configured feature " + id);
Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, id, configuredFeature);
}
Aggregations