Search in sources :

Example 96 with Identifier

use of net.minecraft.util.Identifier in project meteor-client by MeteorDevelopment.

the class ChatHudMixin method drawIcon.

private void drawIcon(MatrixStack matrices, String line, int y, float opacity) {
    if (METEOR_PREFIX_REGEX.matcher(line).find()) {
        RenderSystem.setShaderTexture(0, METEOR_CHAT_ICON);
        matrices.push();
        RenderSystem.setShaderColor(1, 1, 1, opacity);
        matrices.translate(0, y, 0);
        matrices.scale(0.125f, 0.125f, 1);
        DrawableHelper.drawTexture(matrices, 0, 0, 0f, 0f, 64, 64, 64, 64);
        RenderSystem.setShaderColor(1, 1, 1, 1);
        matrices.pop();
        return;
    } else if (BARITONE_PREFIX_REGEX.matcher(line).find()) {
        RenderSystem.setShaderTexture(0, BARITONE_CHAT_ICON);
        matrices.push();
        RenderSystem.setShaderColor(1, 1, 1, opacity);
        matrices.translate(0, y, 10);
        matrices.scale(0.125f, 0.125f, 1);
        DrawableHelper.drawTexture(matrices, 0, 0, 0f, 0f, 64, 64, 64, 64);
        RenderSystem.setShaderColor(1, 1, 1, 1);
        matrices.pop();
        return;
    }
    Identifier skin = getMessageTexture(line);
    if (skin != null) {
        RenderSystem.setShaderColor(1, 1, 1, opacity);
        RenderSystem.setShaderTexture(0, skin);
        DrawableHelper.drawTexture(matrices, 0, y, 8, 8, 8.0F, 8.0F, 8, 8, 64, 64);
        DrawableHelper.drawTexture(matrices, 0, y, 8, 8, 40.0F, 8.0F, 8, 8, 64, 64);
        RenderSystem.setShaderColor(1, 1, 1, 1);
    }
}
Also used : Identifier(net.minecraft.util.Identifier)

Example 97 with Identifier

use of net.minecraft.util.Identifier in project meteor-client by MeteorDevelopment.

the class StorageBlockListSetting method load.

@Override
public List<BlockEntityType<?>> load(NbtCompound tag) {
    get().clear();
    NbtList valueTag = tag.getList("value", 8);
    for (NbtElement tagI : valueTag) {
        BlockEntityType<?> type = Registry.BLOCK_ENTITY_TYPE.get(new Identifier(tagI.asString()));
        if (type != null)
            get().add(type);
    }
    return get();
}
Also used : Identifier(net.minecraft.util.Identifier) NbtList(net.minecraft.nbt.NbtList) NbtElement(net.minecraft.nbt.NbtElement)

Example 98 with Identifier

use of net.minecraft.util.Identifier in project meteor-client by MeteorDevelopment.

the class ParticleTypeListSetting method load.

@Override
public List<ParticleType<?>> load(NbtCompound tag) {
    get().clear();
    NbtList valueTag = tag.getList("value", 8);
    for (NbtElement tagI : valueTag) {
        ParticleType<?> particleType = Registry.PARTICLE_TYPE.get(new Identifier(tagI.asString()));
        if (particleType != null)
            get().add(particleType);
    }
    return get();
}
Also used : Identifier(net.minecraft.util.Identifier) NbtList(net.minecraft.nbt.NbtList) NbtElement(net.minecraft.nbt.NbtElement)

Example 99 with Identifier

use of net.minecraft.util.Identifier in project meteor-client by MeteorDevelopment.

the class ParticleTypeListSetting method save.

@Override
public NbtCompound save(NbtCompound tag) {
    NbtList valueTag = new NbtList();
    for (ParticleType<?> particleType : get()) {
        Identifier id = Registry.PARTICLE_TYPE.getId(particleType);
        if (id != null)
            valueTag.add(NbtString.of(id.toString()));
    }
    tag.put("value", valueTag);
    return tag;
}
Also used : Identifier(net.minecraft.util.Identifier) NbtList(net.minecraft.nbt.NbtList)

Example 100 with Identifier

use of net.minecraft.util.Identifier in project meteor-client by MeteorDevelopment.

the class SoundEventListSetting method save.

@Override
public NbtCompound save(NbtCompound tag) {
    NbtList valueTag = new NbtList();
    for (SoundEvent sound : get()) {
        Identifier id = Registry.SOUND_EVENT.getId(sound);
        if (id != null)
            valueTag.add(NbtString.of(id.toString()));
    }
    tag.put("value", valueTag);
    return tag;
}
Also used : SoundEvent(net.minecraft.sound.SoundEvent) Identifier(net.minecraft.util.Identifier) NbtList(net.minecraft.nbt.NbtList)

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