Search in sources :

Example 11 with NbtElement

use of net.minecraft.nbt.NbtElement in project meteor-client by MeteorDevelopment.

the class ModuleListSetting method load.

@Override
public List<Module> load(NbtCompound tag) {
    get().clear();
    NbtList valueTag = tag.getList("modules", 8);
    for (NbtElement tagI : valueTag) {
        Module module = Modules.get().get(tagI.asString());
        if (module != null)
            get().add(module);
    }
    return get();
}
Also used : NbtList(net.minecraft.nbt.NbtList) NbtElement(net.minecraft.nbt.NbtElement) Module(meteordevelopment.meteorclient.systems.modules.Module)

Example 12 with NbtElement

use of net.minecraft.nbt.NbtElement in project meteor-client by MeteorDevelopment.

the class PacketListSetting method load.

@Override
public Set<Class<? extends Packet<?>>> load(NbtCompound tag) {
    get().clear();
    NbtElement valueTag = tag.get("value");
    if (valueTag instanceof NbtList) {
        for (NbtElement t : (NbtList) valueTag) {
            Class<? extends Packet<?>> packet = PacketUtils.getPacket(t.asString());
            if (packet != null && (filter == null || filter.test(packet)))
                get().add(packet);
        }
    }
    return get();
}
Also used : NbtList(net.minecraft.nbt.NbtList) NbtElement(net.minecraft.nbt.NbtElement)

Example 13 with NbtElement

use of net.minecraft.nbt.NbtElement in project meteor-client by MeteorDevelopment.

the class EnchantmentListSetting method load.

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

Example 14 with NbtElement

use of net.minecraft.nbt.NbtElement in project meteor-client by MeteorDevelopment.

the class EntityTypeListSetting method load.

@Override
public Object2BooleanMap<EntityType<?>> load(NbtCompound tag) {
    get().clear();
    NbtList valueTag = tag.getList("value", 8);
    for (NbtElement tagI : valueTag) {
        EntityType<?> type = Registry.ENTITY_TYPE.get(new Identifier(tagI.asString()));
        if (!onlyAttackable || EntityUtils.isAttackable(type))
            get().put(type, true);
    }
    return get();
}
Also used : Identifier(net.minecraft.util.Identifier) NbtList(net.minecraft.nbt.NbtList) NbtElement(net.minecraft.nbt.NbtElement)

Example 15 with NbtElement

use of net.minecraft.nbt.NbtElement 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)

Aggregations

NbtElement (net.minecraft.nbt.NbtElement)51 NbtList (net.minecraft.nbt.NbtList)44 NbtCompound (net.minecraft.nbt.NbtCompound)22 Identifier (net.minecraft.util.Identifier)20 ItemStack (net.minecraft.item.ItemStack)6 Field (java.lang.reflect.Field)2 Block (net.minecraft.block.Block)2 Enchantment (net.minecraft.enchantment.Enchantment)2 StatusEffect (net.minecraft.entity.effect.StatusEffect)2 Item (net.minecraft.item.Item)2 SoundEvent (net.minecraft.sound.SoundEvent)2 DyeColor (net.minecraft.util.DyeColor)2 RecipePair (top.theillusivec4.polymorph.api.common.base.RecipePair)2 RecipePairImpl (top.theillusivec4.polymorph.common.impl.RecipePairImpl)2 ArrayList (java.util.ArrayList)1 Comparator (java.util.Comparator)1 HashMap (java.util.HashMap)1 Iterator (java.util.Iterator)1 Module (mathax.client.systems.modules.Module)1 Module (meteordevelopment.meteorclient.systems.modules.Module)1