• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java IDataFixer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中net.minecraft.util.datafix.IDataFixer的典型用法代码示例。如果您正苦于以下问题:Java IDataFixer类的具体用法?Java IDataFixer怎么用?Java IDataFixer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IDataFixer类属于net.minecraft.util.datafix包,在下文中一共展示了IDataFixer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: func_190533_a

import net.minecraft.util.datafix.IDataFixer; //导入依赖的package包/类
public static void func_190533_a(DataFixer p_190533_0_)
{
    p_190533_0_.registerWalker(FixTypes.ENTITY, new IDataWalker()
    {
        public NBTTagCompound process(IDataFixer fixer, NBTTagCompound compound, int versionIn)
        {
            if (compound.hasKey("Passengers", 9))
            {
                NBTTagList nbttaglist = compound.getTagList("Passengers", 10);

                for (int i = 0; i < nbttaglist.tagCount(); ++i)
                {
                    nbttaglist.set(i, fixer.process(FixTypes.ENTITY, nbttaglist.getCompoundTagAt(i), versionIn));
                }
            }

            return compound;
        }
    });
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:21,代码来源:Entity.java


示例2: func_191522_a

import net.minecraft.util.datafix.IDataFixer; //导入依赖的package包/类
public static void func_191522_a(DataFixer p_191522_0_)
{
    p_191522_0_.registerWalker(FixTypes.PLAYER, new IDataWalker()
    {
        public NBTTagCompound process(IDataFixer fixer, NBTTagCompound compound, int versionIn)
        {
            if (compound.hasKey("RootVehicle", 10))
            {
                NBTTagCompound nbttagcompound = compound.getCompoundTag("RootVehicle");

                if (nbttagcompound.hasKey("Entity", 10))
                {
                    nbttagcompound.setTag("Entity", fixer.process(FixTypes.ENTITY, nbttagcompound.getCompoundTag("Entity"), versionIn));
                }
            }

            return compound;
        }
    });
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:21,代码来源:EntityPlayerMP.java


示例3: func_189670_a

import net.minecraft.util.datafix.IDataFixer; //导入依赖的package包/类
public static void func_189670_a(DataFixer p_189670_0_)
{
    EntityMinecart.func_189669_a(p_189670_0_, "MinecartCommandBlock");
    p_189670_0_.registerWalker(FixTypes.ENTITY, new IDataWalker()
    {
        public NBTTagCompound process(IDataFixer fixer, NBTTagCompound compound, int versionIn)
        {
            if ("MinecartCommandBlock".equals(compound.getString("id")))
            {
                compound.setString("id", "Control");
                fixer.process(FixTypes.BLOCK_ENTITY, compound, versionIn);
                compound.setString("id", "MinecartCommandBlock");
            }

            return compound;
        }
    });
}
 
开发者ID:BlazeAxtrius,项目名称:ExpandedRailsMod,代码行数:19,代码来源:EntityMinecartCommandBlock.java


示例4: func_189672_a

import net.minecraft.util.datafix.IDataFixer; //导入依赖的package包/类
public static void func_189672_a(DataFixer p_189672_0_)
{
    func_189669_a(p_189672_0_, "MinecartSpawner");
    p_189672_0_.registerWalker(FixTypes.ENTITY, new IDataWalker()
    {
        public NBTTagCompound process(IDataFixer fixer, NBTTagCompound compound, int versionIn)
        {
            if ("MinecartSpawner".equals(compound.getString("id")))
            {
                compound.setString("id", "MobSpawner");
                fixer.process(FixTypes.BLOCK_ENTITY, compound, versionIn);
                compound.setString("id", "MinecartSpawner");
            }

            return compound;
        }
    });
}
 
开发者ID:BlazeAxtrius,项目名称:ExpandedRailsMod,代码行数:19,代码来源:EntityMinecartMobSpawner.java


示例5: func_191158_a

import net.minecraft.util.datafix.IDataFixer; //导入依赖的package包/类
public static void func_191158_a(DataFixer p_191158_0_)
{
    p_191158_0_.registerWalker(FixTypes.STRUCTURE, new IDataWalker()
    {
        public NBTTagCompound process(IDataFixer fixer, NBTTagCompound compound, int versionIn)
        {
            if (compound.hasKey("entities", 9))
            {
                NBTTagList nbttaglist = compound.getTagList("entities", 10);

                for (int i = 0; i < nbttaglist.tagCount(); ++i)
                {
                    NBTTagCompound nbttagcompound = (NBTTagCompound)nbttaglist.get(i);

                    if (nbttagcompound.hasKey("nbt", 10))
                    {
                        nbttagcompound.setTag("nbt", fixer.process(FixTypes.ENTITY, nbttagcompound.getCompoundTag("nbt"), versionIn));
                    }
                }
            }

            if (compound.hasKey("blocks", 9))
            {
                NBTTagList nbttaglist1 = compound.getTagList("blocks", 10);

                for (int j = 0; j < nbttaglist1.tagCount(); ++j)
                {
                    NBTTagCompound nbttagcompound1 = (NBTTagCompound)nbttaglist1.get(j);

                    if (nbttagcompound1.hasKey("nbt", 10))
                    {
                        nbttagcompound1.setTag("nbt", fixer.process(FixTypes.BLOCK_ENTITY, nbttagcompound1.getCompoundTag("nbt"), versionIn));
                    }
                }
            }

            return compound;
        }
    });
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:41,代码来源:Template.java


示例6: filteredProcess

import net.minecraft.util.datafix.IDataFixer; //导入依赖的package包/类
NBTTagCompound filteredProcess(IDataFixer fixer, NBTTagCompound compound, int versionIn)
{
    for (String s : this.matchingTags)
    {
        compound = DataFixesManager.processItemStack(fixer, compound, versionIn, s);
    }

    return compound;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:10,代码来源:ItemStackData.java


示例7: process

import net.minecraft.util.datafix.IDataFixer; //导入依赖的package包/类
public NBTTagCompound process(IDataFixer fixer, NBTTagCompound compound, int versionIn)
{
    if (!compound.hasKey("tag", 10))
    {
        return compound;
    }
    else
    {
        NBTTagCompound nbttagcompound = compound.getCompoundTag("tag");

        if (nbttagcompound.hasKey("BlockEntityTag", 10))
        {
            NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("BlockEntityTag");
            String s = compound.getString("id");
            String s1 = getBlockEntityID(versionIn, s);
            boolean flag;

            if (s1 == null)
            {
                LOGGER.warn("Unable to resolve BlockEntity for ItemInstance: {}", new Object[] {s});
                flag = false;
            }
            else
            {
                flag = !nbttagcompound1.hasKey("id");
                nbttagcompound1.setString("id", s1);
            }

            fixer.process(FixTypes.BLOCK_ENTITY, nbttagcompound1, versionIn);

            if (flag)
            {
                nbttagcompound1.removeTag("id");
            }
        }

        return compound;
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:40,代码来源:BlockEntityTag.java


示例8: process

import net.minecraft.util.datafix.IDataFixer; //导入依赖的package包/类
public NBTTagCompound process(IDataFixer fixer, NBTTagCompound compound, int versionIn)
{
    if ((new ResourceLocation(compound.getString("id"))).equals(this.key))
    {
        compound = this.filteredProcess(fixer, compound, versionIn);
    }

    return compound;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:10,代码来源:Filtered.java


示例9: filteredProcess

import net.minecraft.util.datafix.IDataFixer; //导入依赖的package包/类
NBTTagCompound filteredProcess(IDataFixer fixer, NBTTagCompound compound, int versionIn)
{
    for (String s : this.matchingTags)
    {
        compound = DataFixesManager.processInventory(fixer, compound, versionIn, s);
    }

    return compound;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:10,代码来源:ItemStackDataLists.java


示例10: process

import net.minecraft.util.datafix.IDataFixer; //导入依赖的package包/类
public NBTTagCompound process(IDataFixer fixer, NBTTagCompound compound, int versionIn)
{
    if (!compound.hasKey("tag", 10))
    {
        return compound;
    }
    else
    {
        NBTTagCompound nbttagcompound = compound.getCompoundTag("tag");

        if (nbttagcompound.hasKey("BlockEntityTag", 10))
        {
            NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("BlockEntityTag");
            String s = compound.getString("id");
            String s1 = getBlockEntityID(s);
            boolean flag;

            if (s1 == null)
            {
                LOGGER.warn("Unable to resolve BlockEntity for ItemInstance: {}", new Object[] {s});
                flag = false;
            }
            else
            {
                flag = !nbttagcompound1.hasKey("id");
                nbttagcompound1.setString("id", s1);
            }

            fixer.process(FixTypes.BLOCK_ENTITY, nbttagcompound1, versionIn);

            if (flag)
            {
                nbttagcompound1.removeTag("id");
            }
        }

        return compound;
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:40,代码来源:BlockEntityTag.java


示例11: process

import net.minecraft.util.datafix.IDataFixer; //导入依赖的package包/类
public NBTTagCompound process(IDataFixer fixer, NBTTagCompound compound, int versionIn)
{
    if (compound.getString(this.key).equals(this.value))
    {
        compound = this.filteredProcess(fixer, compound, versionIn);
    }

    return compound;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:10,代码来源:Filtered.java


示例12: func_189806_a

import net.minecraft.util.datafix.IDataFixer; //导入依赖的package包/类
public static void func_189806_a(DataFixer p_189806_0_)
{
    p_189806_0_.registerWalker(FixTypes.PLAYER, new IDataWalker()
    {
        public NBTTagCompound process(IDataFixer fixer, NBTTagCompound compound, int versionIn)
        {
            DataFixesManager.processInventory(fixer, compound, versionIn, "Inventory");
            DataFixesManager.processInventory(fixer, compound, versionIn, "EnderItems");
            return compound;
        }
    });
}
 
开发者ID:BlazeAxtrius,项目名称:ExpandedRailsMod,代码行数:13,代码来源:EntityPlayer.java


示例13: func_189785_b

import net.minecraft.util.datafix.IDataFixer; //导入依赖的package包/类
public static void func_189785_b(DataFixer p_189785_0_)
{
    EntityLiving.func_189752_a(p_189785_0_, "Villager");
    p_189785_0_.registerWalker(FixTypes.ENTITY, new ItemStackDataLists("Villager", new String[] {"Inventory"}));
    p_189785_0_.registerWalker(FixTypes.ENTITY, new IDataWalker()
    {
        public NBTTagCompound process(IDataFixer fixer, NBTTagCompound compound, int versionIn)
        {
            if ("Villager".equals(compound.getString("id")) && compound.hasKey("Offers", 10))
            {
                NBTTagCompound nbttagcompound = compound.getCompoundTag("Offers");

                if (nbttagcompound.hasKey("Recipes", 9))
                {
                    NBTTagList nbttaglist = nbttagcompound.getTagList("Recipes", 10);

                    for (int i = 0; i < nbttaglist.tagCount(); ++i)
                    {
                        NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i);
                        DataFixesManager.processItemStack(fixer, nbttagcompound1, versionIn, "buy");
                        DataFixesManager.processItemStack(fixer, nbttagcompound1, versionIn, "buyB");
                        DataFixesManager.processItemStack(fixer, nbttagcompound1, versionIn, "sell");
                        nbttaglist.set(i, nbttagcompound1);
                    }
                }
            }

            return compound;
        }
    });
}
 
开发者ID:BlazeAxtrius,项目名称:ExpandedRailsMod,代码行数:32,代码来源:EntityVillager.java


示例14: processTag

import net.minecraft.util.datafix.IDataFixer; //导入依赖的package包/类
@Override
protected NBTTagCompound processTag(IDataFixer fixer, NBTTagCompound compound, int version) {
	for (String tag : tags)
		compound = DataFixesManager.processInventory(fixer, compound, version, tag);

	return compound;
}
 
开发者ID:OpenMods,项目名称:OpenModsLib,代码行数:8,代码来源:NestedItemInventoryWalker.java


示例15: process

import net.minecraft.util.datafix.IDataFixer; //导入依赖的package包/类
@Override
public NBTTagCompound process(IDataFixer fixer, NBTTagCompound compound, int version) {
	final ResourceLocation id = new ResourceLocation(compound.getString(idTag));
	final ResourceLocation expected = entry.getRegistryName();
	if (id.equals(expected)) return processImpl(fixer, compound, version);

	return compound;
}
 
开发者ID:OpenMods,项目名称:OpenModsLib,代码行数:9,代码来源:ResourceDataWalker.java


示例16: processImpl

import net.minecraft.util.datafix.IDataFixer; //导入依赖的package包/类
@Override
protected final NBTTagCompound processImpl(IDataFixer fixer, NBTTagCompound compound, int version) {
	if (compound.hasKey("tag", Constants.NBT.TAG_COMPOUND)) {
		final NBTTagCompound tag = compound.getCompoundTag("tag");
		final NBTTagCompound newTag = processTag(fixer, tag, version);
		compound.setTag("tag", newTag);
	}

	return compound;
}
 
开发者ID:OpenMods,项目名称:OpenModsLib,代码行数:11,代码来源:ItemTagWalker.java


示例17: processTag

import net.minecraft.util.datafix.IDataFixer; //导入依赖的package包/类
@Override
protected NBTTagCompound processTag(IDataFixer fixer, NBTTagCompound compound, int version) {
	for (String tag : tags)
		compound = DataFixesManager.processItemStack(fixer, compound, version, tag);

	return compound;
}
 
开发者ID:OpenMods,项目名称:OpenModsLib,代码行数:8,代码来源:NestedItemStackWalker.java


示例18: processTag

import net.minecraft.util.datafix.IDataFixer; //导入依赖的package包/类
@Override
protected NBTTagCompound processTag(IDataFixer fixer, NBTTagCompound compound, int version) {
	if (compound.hasKey(ItemInventory.TAG_INVENTORY, Constants.NBT.TAG_COMPOUND)) {
		final NBTTagCompound inventoryTag = compound.getCompoundTag(ItemInventory.TAG_INVENTORY);
		final NBTTagCompound newInventoryTag = DataFixesManager.processInventory(fixer, inventoryTag, version, GenericInventory.TAG_ITEMS);
		compound.setTag(ItemInventory.TAG_INVENTORY, newInventoryTag);
	}

	return compound;
}
 
开发者ID:OpenMods,项目名称:OpenModsLib,代码行数:11,代码来源:ItemInventoryWalker.java


示例19: process

import net.minecraft.util.datafix.IDataFixer; //导入依赖的package包/类
public NBTTagCompound process(IDataFixer fixer, NBTTagCompound compound, int versionIn)
{
    NBTTagCompound nbttagcompound = compound.getCompoundTag("tag");

    if (nbttagcompound.hasKey("EntityTag", 10))
    {
        NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("EntityTag");
        String s = compound.getString("id");
        String s1;

        if ("minecraft:armor_stand".equals(s))
        {
            s1 = versionIn < 515 ? "ArmorStand" : "minecraft:armor_stand";
        }
        else
        {
            if (!"minecraft:spawn_egg".equals(s))
            {
                return compound;
            }

            s1 = nbttagcompound1.getString("id");
        }

        boolean flag;

        if (s1 == null)
        {
            LOGGER.warn("Unable to resolve Entity for ItemInstance: {}", new Object[] {s});
            flag = false;
        }
        else
        {
            flag = !nbttagcompound1.hasKey("id", 8);
            nbttagcompound1.setString("id", s1);
        }

        fixer.process(FixTypes.ENTITY, nbttagcompound1, versionIn);

        if (flag)
        {
            nbttagcompound1.removeTag("id");
        }
    }

    return compound;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:48,代码来源:EntityTag.java


示例20: process

import net.minecraft.util.datafix.IDataFixer; //导入依赖的package包/类
public NBTTagCompound process(IDataFixer fixer, NBTTagCompound compound, int versionIn)
{
    NBTTagCompound nbttagcompound = compound.getCompoundTag("tag");

    if (nbttagcompound.hasKey("EntityTag", 10))
    {
        NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("EntityTag");
        String s = compound.getString("id");
        String s1;

        if ("minecraft:armor_stand".equals(s))
        {
            s1 = "ArmorStand";
        }
        else
        {
            if (!"minecraft:spawn_egg".equals(s))
            {
                return compound;
            }

            s1 = nbttagcompound1.getString("id");
        }

        boolean flag;

        if (s1 == null)
        {
            LOGGER.warn("Unable to resolve Entity for ItemInstance: {}", new Object[] {s});
            flag = false;
        }
        else
        {
            flag = !nbttagcompound1.hasKey("id", 8);
            nbttagcompound1.setString("id", s1);
        }

        fixer.process(FixTypes.ENTITY, nbttagcompound1, versionIn);

        if (flag)
        {
            nbttagcompound1.removeTag("id");
        }
    }

    return compound;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:48,代码来源:EntityTag.java



注:本文中的net.minecraft.util.datafix.IDataFixer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java RowAVL类代码示例发布时间:2022-05-22
下一篇:
Java RpcControllerFactory类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap