Java 类net.minecraft.util.datafix.DataFixer 实例源码

项目:Backmemed    文件:SaveHandler.java   
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();
}
项目:CustomWorldGen    文件:SaveHandler.java   
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();
}
项目:CustomWorldGen    文件:DedicatedServer.java   
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)
                {
                    ;
                }
            }
        }
    };
}
项目:Backmemed    文件:Template.java   
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;
        }
    });
}
项目:Backmemed    文件:SaveFormatOld.java   
public SaveFormatOld(File savesDirectoryIn, DataFixer dataFixerIn)
{
    this.dataFixer = dataFixerIn;

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

    this.savesDirectory = savesDirectoryIn;
}
项目:Backmemed    文件:SaveFormatOld.java   
@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;
    }
}
项目:CustomWorldGen    文件:MinecraftServer.java   
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;
}
项目:Backmemed    文件:MinecraftServer.java   
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;
}
项目:harshencastle    文件:HarshenTemplate.java   
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);
       }
}
项目:Zombe-Modpack    文件:Minecraft.java   
public DataFixer getDataFixer()
{
    return this.dataFixer;
}
项目:EndermanEvolution    文件:EntityFrienderPearl.java   
public static void registerFixesThrowable(DataFixer p_189663_0_) {
    EntityThrowable.registerFixesThrowable(p_189663_0_, "ThrownFrienderpearl");
}
项目:CustomWorldGen    文件:MinecraftServer.java   
public DataFixer getDataFixer()
{
    return this.dataFixer;
}
项目:CustomWorldGen    文件:EntityMagmaCube.java   
public static void registerFixesMagmaCube(DataFixer fixer)
{
    EntityLiving.registerFixesMob(fixer, "LavaSlime");
}
项目:CustomWorldGen    文件:TileEntityChest.java   
public static void registerFixesChest(DataFixer fixer)
{
    fixer.registerWalker(FixTypes.BLOCK_ENTITY, new ItemStackDataLists("Chest", new String[] {"Items"}));
}
项目:CustomWorldGen    文件:EntityMinecartHopper.java   
public static void registerFixesMinecartHopper(DataFixer fixer)
{
    EntityMinecartContainer.registerFixesMinecartContainer(fixer, "MinecartHopper");
}
项目:CustomWorldGen    文件:EntityEnderman.java   
public static void registerFixesEnderman(DataFixer fixer)
{
    EntityLiving.registerFixesMob(fixer, "Enderman");
}
项目:Backmemed    文件:EntityMinecartFurnace.java   
public static void registerFixesMinecartFurnace(DataFixer fixer)
{
    EntityMinecart.registerFixesMinecart(fixer, EntityMinecartFurnace.class);
}
项目:CustomWorldGen    文件:EntityGiantZombie.java   
public static void registerFixesGiantZombie(DataFixer fixer)
{
    EntityLiving.registerFixesMob(fixer, "Giant");
}
项目:Backmemed    文件:EntityMinecartTNT.java   
public static void registerFixesMinecartTNT(DataFixer fixer)
{
    EntityMinecart.registerFixesMinecart(fixer, EntityMinecartTNT.class);
}
项目:CustomWorldGen    文件:EntityWitch.java   
public static void registerFixesWitch(DataFixer fixer)
{
    EntityLiving.registerFixesMob(fixer, "Witch");
}
项目:CustomWorldGen    文件:EntityMinecartTNT.java   
public static void registerFixesMinecartTNT(DataFixer fixer)
{
    EntityMinecart.registerFixesMinecart(fixer, "MinecartTNT");
}
项目:CustomWorldGen    文件:EntityLiving.java   
public static void registerFixesMob(DataFixer fixer)
{
    registerFixesMob(fixer, "Mob");
}
项目:CustomWorldGen    文件:EntityMooshroom.java   
public static void registerFixesMooshroom(DataFixer fixer)
{
    EntityLiving.registerFixesMob(fixer, "MushroomCow");
}
项目:Backmemed    文件:EntityItemFrame.java   
public static void registerFixesItemFrame(DataFixer fixer)
{
    fixer.registerWalker(FixTypes.ENTITY, new ItemStackData(EntityItemFrame.class, new String[] {"Item"}));
}
项目:Backmemed    文件:EntityEnderPearl.java   
public static void registerFixesEnderPearl(DataFixer fixer)
{
    EntityThrowable.registerFixesThrowable(fixer, "ThrownEnderpearl");
}
项目:Backmemed    文件:EntityArmorStand.java   
public static void registerFixesArmorStand(DataFixer fixer)
{
    fixer.registerWalker(FixTypes.ENTITY, new ItemStackDataLists(EntityArmorStand.class, new String[] {"ArmorItems", "HandItems"}));
}
项目:CustomWorldGen    文件:EntityWolf.java   
public static void registerFixesWolf(DataFixer fixer)
{
    EntityLiving.registerFixesMob(fixer, "Wolf");
}
项目:Backmemed    文件:EntityMinecartHopper.java   
public static void registerFixesMinecartHopper(DataFixer fixer)
{
    EntityMinecartContainer.func_190574_b(fixer, EntityMinecartHopper.class);
}
项目:CustomWorldGen    文件:EntitySilverfish.java   
public static void registerFixesSilverfish(DataFixer fixer)
{
    EntityLiving.registerFixesMob(fixer, "Silverfish");
}
项目:Backmemed    文件:EntityLiving.java   
public static void registerFixesMob(DataFixer fixer, Class<?> name)
{
    fixer.registerWalker(FixTypes.ENTITY, new ItemStackDataLists(name, new String[] {"ArmorItems", "HandItems"}));
}
项目:CustomWorldGen    文件:EntitySnowman.java   
public static void registerFixesSnowman(DataFixer fixer)
{
    EntityLiving.registerFixesMob(fixer, "SnowMan");
}
项目:CustomWorldGen    文件:EntityBat.java   
public static void registerFixesBat(DataFixer fixer)
{
    EntityLiving.registerFixesMob(fixer, "Bat");
}
项目:Backmemed    文件:EntityWitherSkull.java   
public static void registerFixesWitherSkull(DataFixer fixer)
{
    EntityFireball.registerFixesFireball(fixer, "WitherSkull");
}
项目:Backmemed    文件:EntitySnowball.java   
public static void registerFixesSnowball(DataFixer fixer)
{
    EntityThrowable.registerFixesThrowable(fixer, "Snowball");
}
项目:Backmemed    文件:EntityPotion.java   
public static void registerFixesPotion(DataFixer fixer)
{
    EntityThrowable.registerFixesThrowable(fixer, "ThrownPotion");
    fixer.registerWalker(FixTypes.ENTITY, new ItemStackData(EntityPotion.class, new String[] {"Potion"}));
}
项目:Backmemed    文件:EntityTippedArrow.java   
public static void registerFixesTippedArrow(DataFixer fixer)
{
    EntityArrow.registerFixesArrow(fixer, "TippedArrow");
}
项目:Backmemed    文件:EntitySpectralArrow.java   
public static void registerFixesSpectralArrow(DataFixer fixer)
{
    EntityArrow.registerFixesArrow(fixer, "SpectralArrow");
}
项目:CustomWorldGen    文件:EntityArrow.java   
public static void registerFixesArrow(DataFixer fixer, String name)
{
}
项目:Backmemed    文件:EntityArrow.java   
public static void registerFixesArrow(DataFixer fixer, String name)
{
}
项目:CustomWorldGen    文件:EntityWitherSkull.java   
public static void registerFixesWitherSkull(DataFixer fixer)
{
    EntityFireball.registerFixesFireball(fixer, "WitherSkull");
}