Search in sources :

Example 1 with LegacyEnchantmentRewriter

use of com.viaversion.viabackwards.api.rewriters.LegacyEnchantmentRewriter in project ViaBackwards by ViaVersion.

the class ItemPackets1_11_1 method registerRewrites.

@Override
protected void registerRewrites() {
    enchantmentRewriter = new LegacyEnchantmentRewriter(nbtTagName);
    enchantmentRewriter.registerEnchantment(22, "§7Sweeping Edge");
}
Also used : LegacyEnchantmentRewriter(com.viaversion.viabackwards.api.rewriters.LegacyEnchantmentRewriter)

Example 2 with LegacyEnchantmentRewriter

use of com.viaversion.viabackwards.api.rewriters.LegacyEnchantmentRewriter in project ViaBackwards by ViaVersion.

the class BlockItemPackets1_11 method registerRewrites.

@Override
protected void registerRewrites() {
    // Handle spawner block entity (map to itself with custom handler)
    MappedLegacyBlockItem data = replacementData.computeIfAbsent(52, s -> new MappedLegacyBlockItem(52, (short) -1, null, false));
    data.setBlockEntityHandler((b, tag) -> {
        EntityIdRewriter.toClientSpawner(tag, true);
        return tag;
    });
    enchantmentRewriter = new LegacyEnchantmentRewriter(nbtTagName);
    enchantmentRewriter.registerEnchantment(71, "§cCurse of Vanishing");
    enchantmentRewriter.registerEnchantment(10, "§cCurse of Binding");
    // Curses do not display their level
    enchantmentRewriter.setHideLevelForEnchants(71, 10);
}
Also used : LegacyEnchantmentRewriter(com.viaversion.viabackwards.api.rewriters.LegacyEnchantmentRewriter) MappedLegacyBlockItem(com.viaversion.viabackwards.api.data.MappedLegacyBlockItem)

Aggregations

LegacyEnchantmentRewriter (com.viaversion.viabackwards.api.rewriters.LegacyEnchantmentRewriter)2 MappedLegacyBlockItem (com.viaversion.viabackwards.api.data.MappedLegacyBlockItem)1