当前位置: 首页>>代码示例>>Java>>正文


Java DataFixer类代码示例

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


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

示例1: SaveHandler

import net.minecraft.util.datafix.DataFixer; //导入依赖的package包/类
public SaveHandler(File p_i46648_1_, String saveDirectoryNameIn, boolean p_i46648_3_, DataFixer dataFixerIn)
{
    this.dataFixer = dataFixerIn;
    this.worldDirectory = new File(p_i46648_1_, saveDirectoryNameIn);
    this.worldDirectory.mkdirs();
    this.playersDirectory = new File(this.worldDirectory, "playerdata");
    this.mapDataDir = new File(this.worldDirectory, "data");
    this.mapDataDir.mkdirs();
    this.saveDirectoryName = saveDirectoryNameIn;

    if (p_i46648_3_)
    {
        this.playersDirectory.mkdirs();
        this.structureTemplateManager = new TemplateManager((new File(this.worldDirectory, "structures")).toString(), dataFixerIn);
    }
    else
    {
        this.structureTemplateManager = null;
    }

    this.setSessionLock();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:23,代码来源:SaveHandler.java

示例2: SaveHandler

import net.minecraft.util.datafix.DataFixer; //导入依赖的package包/类
public SaveHandler(File p_i46648_1_, String saveDirectoryNameIn, boolean p_i46648_3_, DataFixer dataFixerIn)
{
    this.dataFixer = dataFixerIn;
    this.worldDirectory = new File(p_i46648_1_, saveDirectoryNameIn);
    this.worldDirectory.mkdirs();
    this.playersDirectory = new File(this.worldDirectory, "playerdata");
    this.mapDataDir = new File(this.worldDirectory, "data");
    this.mapDataDir.mkdirs();
    this.saveDirectoryName = saveDirectoryNameIn;

    if (p_i46648_3_)
    {
        this.playersDirectory.mkdirs();
        this.structureTemplateManager = new TemplateManager((new File(this.worldDirectory, "structures")).toString());
    }
    else
    {
        this.structureTemplateManager = null;
    }

    this.setSessionLock();
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:23,代码来源:SaveHandler.java

示例3: DedicatedServer

import net.minecraft.util.datafix.DataFixer; //导入依赖的package包/类
public DedicatedServer(File anvilFileIn, DataFixer dataFixerIn, YggdrasilAuthenticationService authServiceIn, MinecraftSessionService sessionServiceIn, GameProfileRepository profileRepoIn, PlayerProfileCache profileCacheIn)
{
    super(anvilFileIn, Proxy.NO_PROXY, dataFixerIn, authServiceIn, sessionServiceIn, profileRepoIn, profileCacheIn);
    Thread thread = new Thread("Server Infinisleeper")
    {
        {
            this.setDaemon(true);
            this.start();
        }
        public void run()
        {
            while (true)
            {
                try
                {
                    Thread.sleep(2147483647L);
                }
                catch (InterruptedException var2)
                {
                    ;
                }
            }
        }
    };
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:26,代码来源:DedicatedServer.java

示例4: func_191158_a

import net.minecraft.util.datafix.DataFixer; //导入依赖的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

示例5: SaveFormatOld

import net.minecraft.util.datafix.DataFixer; //导入依赖的package包/类
public SaveFormatOld(File savesDirectoryIn, DataFixer dataFixerIn)
{
    this.dataFixer = dataFixerIn;

    if (!savesDirectoryIn.exists())
    {
        savesDirectoryIn.mkdirs();
    }

    this.savesDirectory = savesDirectoryIn;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:12,代码来源:SaveFormatOld.java

示例6: getWorldData

import net.minecraft.util.datafix.DataFixer; //导入依赖的package包/类
@Nullable
public static WorldInfo getWorldData(File p_186353_0_, DataFixer dataFixerIn)
{
    try
    {
        NBTTagCompound nbttagcompound = CompressedStreamTools.readCompressed(new FileInputStream(p_186353_0_));
        NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("Data");
        return new WorldInfo(dataFixerIn.process(FixTypes.LEVEL, nbttagcompound1));
    }
    catch (Exception exception)
    {
        LOGGER.error("Exception reading {}", new Object[] {p_186353_0_, exception});
        return null;
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:16,代码来源:SaveFormatOld.java

示例7: MinecraftServer

import net.minecraft.util.datafix.DataFixer; //导入依赖的package包/类
public MinecraftServer(File anvilFileIn, Proxy proxyIn, DataFixer dataFixerIn, YggdrasilAuthenticationService authServiceIn, MinecraftSessionService sessionServiceIn, GameProfileRepository profileRepoIn, PlayerProfileCache profileCacheIn)
{
    this.serverProxy = proxyIn;
    this.authService = authServiceIn;
    this.sessionService = sessionServiceIn;
    this.profileRepo = profileRepoIn;
    this.profileCache = profileCacheIn;
    this.anvilFile = anvilFileIn;
    this.networkSystem = new NetworkSystem(this);
    this.commandManager = this.createNewCommandManager();
    this.anvilConverterForAnvilFile = new AnvilSaveConverter(anvilFileIn, dataFixerIn);
    this.dataFixer = dataFixerIn;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:14,代码来源:MinecraftServer.java

示例8: HarshenTemplate

import net.minecraft.util.datafix.DataFixer; //导入依赖的package包/类
protected HarshenTemplate(ResourceLocation location) {
	String s = location.getResourceDomain();
       String s1 = location.getResourcePath();
       InputStream stream = null;
       boolean flag;
       try
       {
       	stream = getClass().getResourceAsStream("/assets/" + HarshenCastle.MODID + "/structures/" + s1 + ".nbt");
           NBTTagCompound compound = CompressedStreamTools.readCompressed(stream);
           if (!compound.hasKey("DataVersion", 99))
           {
           	compound.setInteger("DataVersion", 500);
           }
           Template template = new Template();
           DataFixer fixer;
           try
           {
           	fixer = Minecraft.getMinecraft().getDataFixer();
           }
           catch (Throwable e) {
			fixer = FMLServerHandler.instance().getDataFixer();
		}
           template.read(fixer.process(FixTypes.STRUCTURE, compound));
           this.blocks.clear();
           NBTTagList nbttaglist = compound.getTagList("size", 3);
           this.size = new BlockPos(nbttaglist.getIntAt(0), nbttaglist.getIntAt(1), nbttaglist.getIntAt(2));
           NBTTagList nbttaglist4 = compound.getTagList("pos", 3);
           if(nbttaglist4.hasNoTags())
           	this.pos = BlockPos.ORIGIN;
           else
               this.pos = new BlockPos(nbttaglist4.getIntAt(0), nbttaglist4.getIntAt(1), nbttaglist4.getIntAt(2));
           BasicPalette template$basicpalette = new BasicPalette();
           NBTTagList nbttaglist1 = compound.getTagList("palette", 10);

           for (int i = 0; i < nbttaglist1.tagCount(); ++i)
           {
               template$basicpalette.addMapping(NBTUtil.readBlockState(nbttaglist1.getCompoundTagAt(i)), i);
           }

           NBTTagList nbttaglist3 = compound.getTagList("blocks", 10);
           for (int j = 0; j < nbttaglist3.tagCount(); ++j)
           {
               NBTTagCompound nbttagcompound = nbttaglist3.getCompoundTagAt(j);
               NBTTagList nbttaglist2 = nbttagcompound.getTagList("pos", 3);
               BlockPos blockpos = new BlockPos(nbttaglist2.getIntAt(0), nbttaglist2.getIntAt(1), nbttaglist2.getIntAt(2));
               IBlockState iblockstate = template$basicpalette.stateFor(nbttagcompound.getInteger("state"));
               NBTTagCompound nbttagcompound1;

               if (nbttagcompound.hasKey("nbt"))
               {
                   nbttagcompound1 = nbttagcompound.getCompoundTag("nbt");
               }
               else
               {
                   nbttagcompound1 = null;
               }

               if(!(iblockstate.getBlock() instanceof BlockStructure))
               	this.blocks.add(new Template.BlockInfo(blockpos, iblockstate, nbttagcompound1));
           }
       }
       catch (Throwable var10)
       {
       }
       finally
       {
           IOUtils.closeQuietly(stream);
       }
}
 
开发者ID:kenijey,项目名称:harshencastle,代码行数:70,代码来源:HarshenTemplate.java

示例9: getDataFixer

import net.minecraft.util.datafix.DataFixer; //导入依赖的package包/类
public DataFixer getDataFixer()
{
    return this.dataFixer;
}
 
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:5,代码来源:Minecraft.java

示例10: registerFixesThrowable

import net.minecraft.util.datafix.DataFixer; //导入依赖的package包/类
public static void registerFixesThrowable(DataFixer p_189663_0_) {
	EntityThrowable.registerFixesThrowable(p_189663_0_, "ThrownFrienderpearl");
}
 
开发者ID:p455w0rd,项目名称:EndermanEvolution,代码行数:4,代码来源:EntityFrienderPearl.java

示例11: registerFixesMagmaCube

import net.minecraft.util.datafix.DataFixer; //导入依赖的package包/类
public static void registerFixesMagmaCube(DataFixer fixer)
{
    EntityLiving.registerFixesMob(fixer, "LavaSlime");
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:5,代码来源:EntityMagmaCube.java

示例12: registerFixesChest

import net.minecraft.util.datafix.DataFixer; //导入依赖的package包/类
public static void registerFixesChest(DataFixer fixer)
{
    fixer.registerWalker(FixTypes.BLOCK_ENTITY, new ItemStackDataLists("Chest", new String[] {"Items"}));
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:5,代码来源:TileEntityChest.java

示例13: registerFixesMinecartHopper

import net.minecraft.util.datafix.DataFixer; //导入依赖的package包/类
public static void registerFixesMinecartHopper(DataFixer fixer)
{
    EntityMinecartContainer.registerFixesMinecartContainer(fixer, "MinecartHopper");
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:5,代码来源:EntityMinecartHopper.java

示例14: registerFixesEnderman

import net.minecraft.util.datafix.DataFixer; //导入依赖的package包/类
public static void registerFixesEnderman(DataFixer fixer)
{
    EntityLiving.registerFixesMob(fixer, "Enderman");
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:5,代码来源:EntityEnderman.java

示例15: registerFixesMinecartFurnace

import net.minecraft.util.datafix.DataFixer; //导入依赖的package包/类
public static void registerFixesMinecartFurnace(DataFixer fixer)
{
    EntityMinecart.registerFixesMinecart(fixer, EntityMinecartFurnace.class);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:5,代码来源:EntityMinecartFurnace.java


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