use of net.minecraft.util.Identifier in project frame-fabric by moddingplayground.
the class FrameBannerPattern method getId.
/**
* Returns a cache of the registered id of this pattern.
* @throws IllegalStateException if this {@link FrameBannerPattern} has not been registered.
*/
public Identifier getId() {
if (this.id == null) {
Identifier id = FrameBannerPatterns.REGISTRY.getId(this);
if (id == null)
throw new IllegalStateException("Banner pattern was not registered!");
this.id = id;
}
return this.id;
}
use of net.minecraft.util.Identifier in project Enchanted-Bionics by Bubblie01.
the class EnchantedBionicsStats method register.
private static Identifier register(String id, StatFormatter formatter) {
Identifier identifier = new Identifier(id);
Registry.register(Registry.CUSTOM_STAT, identifier, identifier);
Stats.CUSTOM.getOrCreateStat(identifier, formatter);
return identifier;
}
use of net.minecraft.util.Identifier in project VeinMining by TheIllusiveC4.
the class VeinMiningMod method onInitialize.
@Override
public void onInitialize() {
Registry.register(Registry.ENCHANTMENT, new Identifier(MOD_ID, "vein_mining"), VEIN_MINING);
isConfigLoaded = FabricLoader.getInstance().isModLoaded("cloth-config2");
if (isConfigLoaded) {
AutoConfigPlugin.init();
}
ServerLifecycleEvents.SERVER_STARTED.register(minecraftServer -> {
if (isConfigLoaded) {
AutoConfigPlugin.readConfigData();
}
BlockProcessor.rebuild();
});
ServerLifecycleEvents.END_DATA_PACK_RELOAD.register((minecraftServer, serverResourceManager, b) -> BlockProcessor.rebuild());
ServerTickEvents.END_WORLD_TICK.register((world) -> VeinMiningPlayers.validate(world.getTime()));
ServerPlayNetworking.registerGlobalReceiver(VeinMiningNetwork.SEND_STATE, VeinMiningNetwork::handleState);
}
use of net.minecraft.util.Identifier in project VeinMining by TheIllusiveC4.
the class VeinMiningConfigData method validatePostLoad.
@Override
public void validatePostLoad() {
Set<String> validatedGroups = new HashSet<>();
if (veinMining.groups.isEmpty()) {
List<String> defaults = Lists.newArrayList("#c:adamantite_ores", "#c:aetherium_ores", "#c:aluminum_ores", "#c:amethyst_ores", "#c:antimony_ores", "#c:aquarium_ores", "#c:asterite_ores", "#c:banglum_ores", "#c:bauxite_ores", "#c:carmot_ores", "#c:certus_quartz_ores", "#c:cinnabar_ores", "#c:coal_ores", "#c:cobalt_ores", "#c:copper_ores", "#c:diamond_ores", "#c:emerald_ores", "#c:galaxium_ores", "#c:galena_ores", "#c:gold_ores,#minecraft:gold_ores", "#c:iridium_ores", "#c:iron_ores", "#c:kyber_ores", "#c:lapis_ores", "#c:lead_ores", "#c:lunum_ores", "#c:lutetium_ores", "#c:manganese_ores", "#c:metite_ores", "#c:mythril_ores", "#c:nickel_ores", "#c:orichalcum_ores", "#c:osmium_ores", "#c:palladium_ores", "#c:peridot_ores", "#c:platinum_ores", "#c:prometheum_ores", "#c:pyrite_ores", "#c:quadrillum_ores", "#c:quartz_ores", "#c:redstone_ores", "#c:ruby_ores", "#c:runite_ores", "#c:salt_ores", "#c:sapphire_ores", "#c:sheldonite_ores", "#c:silver_ores", "#c:sodalite_ores", "#c:sphalerite_ores", "#c:starrite_ores", "#c:stellum_ores", "#c:stormyx_ores", "#c:sulfur_ores", "#c:tantalite_ores", "#c:tin_ores", "#c:titanium_ores", "#c:topaz_ores", "#c:truesilver_ores", "#c:tungsten_ores", "#c:unobtainium_ores", "#c:ur_ores", "#c:uranium_ores", "#c:vermiculite_ores", "#c:zinc_ores");
validatedGroups.addAll(defaults);
}
validatedGroups.addAll(veinMining.groups);
veinMining.groups = Lists.newArrayList(validatedGroups);
Set<String> validatedEnchantments = new HashSet<>();
for (String enchantment : enchantment.incompatibleEnchantments) {
if (Registry.ENCHANTMENT.containsId(new Identifier(enchantment))) {
validatedEnchantments.add(enchantment);
}
}
enchantment.incompatibleEnchantments = Lists.newArrayList(validatedEnchantments);
}
use of net.minecraft.util.Identifier in project KahzerxMod by otakucraft.
the class EntityProfiler method addEntity.
public static void addEntity(Entity e, ServerWorld world) {
Identifier id = EntityType.getId(e.getType());
if (id == null) {
return;
}
BlockPos pos = e.getBlockPos();
entityList.add(new EntityInstance(id.getPath(), world.getRegistryKey().getValue().getPath(), pos.getX(), pos.getY(), pos.getZ()));
}
Aggregations