Search in sources :

Example 76 with Identifier

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;
}
Also used : Identifier(net.minecraft.util.Identifier)

Example 77 with Identifier

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;
}
Also used : Identifier(net.minecraft.util.Identifier)

Example 78 with 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);
}
Also used : Identifier(net.minecraft.util.Identifier) VeinMiningNetwork(top.theillusivec4.veinmining.network.VeinMiningNetwork)

Example 79 with Identifier

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);
}
Also used : Identifier(net.minecraft.util.Identifier) HashSet(java.util.HashSet)

Example 80 with Identifier

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()));
}
Also used : Identifier(net.minecraft.util.Identifier) EntityInstance(com.kahzerx.kahzerxmod.profiler.instances.EntityInstance) BlockPos(net.minecraft.util.math.BlockPos)

Aggregations

Identifier (net.minecraft.util.Identifier)343 NbtList (net.minecraft.nbt.NbtList)36 ItemStack (net.minecraft.item.ItemStack)31 Item (net.minecraft.item.Item)28 NbtCompound (net.minecraft.nbt.NbtCompound)22 NbtElement (net.minecraft.nbt.NbtElement)22 Inject (org.spongepowered.asm.mixin.injection.Inject)22 IOException (java.io.IOException)18 Block (net.minecraft.block.Block)18 MinecraftClient (net.minecraft.client.MinecraftClient)15 BlockItem (net.minecraft.item.BlockItem)15 BlockPos (net.minecraft.util.math.BlockPos)15 Map (java.util.Map)12 BlockState (net.minecraft.block.BlockState)12 ArrayList (java.util.ArrayList)11 VertexConsumer (net.minecraft.client.render.VertexConsumer)11 ResourceManager (net.minecraft.resource.ResourceManager)11 SoundEvent (net.minecraft.sound.SoundEvent)11 ServerPlayerEntity (net.minecraft.server.network.ServerPlayerEntity)10 LiteralText (net.minecraft.text.LiteralText)10