use of net.minecraft.util.Identifier in project fabric by FabricMC.
the class MixinLootManager method apply.
@Inject(method = "method_20712", at = @At("RETURN"))
private void apply(Map<Identifier, JsonObject> objectMap, ResourceManager manager, Profiler profiler, CallbackInfo info) {
Map<Identifier, LootSupplier> newSuppliers = new HashMap<>();
suppliers.forEach((id, supplier) -> {
FabricLootSupplierBuilder builder = FabricLootSupplierBuilder.of(supplier);
// noinspection ConstantConditions
LootTableLoadingCallback.EVENT.invoker().onLootTableLoading(manager, (LootManager) (Object) this, id, builder, (s) -> newSuppliers.put(id, s));
newSuppliers.computeIfAbsent(id, (i) -> builder.create());
});
suppliers = ImmutableMap.copyOf(newSuppliers);
}
use of net.minecraft.util.Identifier in project Liminal-Library by LudoCrypt.
the class LimLib method onInitialize.
@Override
public void onInitialize() {
LiminalSkyRegistry.register(new Identifier("limlib", "regular_sky"), SkyHook.RegularSky.CODEC);
LiminalSkyRegistry.register(new Identifier("limlib", "skybox_sky"), SkyHook.SkyboxSky.CODEC);
LiminalShaderRegistry.register(new Identifier("limlib", "simple_shader"), LiminalShader.SimpleShader.CODEC);
LiminalSoundRegistry.register(new Identifier("limlib", "simple_sound"), LiminalTravelSound.SimpleTravelSound.CODEC);
LiminalSoundRegistry.register(new Identifier("limlib", "regex_sound"), LiminalTravelSound.RegexTravelSound.CODEC);
}
use of net.minecraft.util.Identifier in project frame-fabric by moddingplayground.
the class RecipeProvider method createFileMapAdvancements.
public Map<Identifier, JsonElement> createFileMapAdvancements() {
Map<Identifier, JsonElement> map = Maps.newHashMap();
for (Supplier<AbstractRecipeGenerator> generator : this.getGenerators()) {
AbstractRecipeGenerator gen = generator.get();
gen.accept((id, factory) -> factory.offerTo(provider -> {
JsonObject json = provider.toAdvancementJson();
if (json != null && map.put(id, json) != null)
throw new IllegalStateException("Duplicate recipe advancement " + id);
}, id));
Identifier rootId = gen.getId("root");
if (!map.containsKey(rootId)) {
map.put(rootId, Advancement.Builder.create().criterion("impossible", new ImpossibleCriterion.Conditions()).toJson());
}
}
return map;
}
use of net.minecraft.util.Identifier in project frame-fabric by moddingplayground.
the class AbstractTagGenerator method getId.
public Identifier getId(Identifier id) {
String format = this.getFormat();
RegistryKey<? extends Registry<T>> key = this.registry.getKey();
Identifier reg = key.getValue();
return new Identifier(id.getNamespace(), format.formatted(reg.getPath(), id.getPath()));
}
use of net.minecraft.util.Identifier in project frame-fabric by moddingplayground.
the class AbstractModelGenerator method name.
public Identifier name(T object, String nameFormat, String pattern, String reformat) {
Identifier id = this.getRegistry().getId(object);
String path = id.getPath();
path = path.replaceAll(pattern, reformat);
return new Identifier(id.getNamespace(), String.format(nameFormat, path));
}
Aggregations