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

项目:IvToolkit    文件:IvWorldData.java   
public IvWorldData(NBTTagCompound compound, MCRegistry registry)
{
    compound = compound.copy(); // Copy since ID fix tags are being removed when being applied
    final DataFixer fixer = DataFixesManager.createFixer();

    blockCollection = new IvBlockCollection(compound.getCompoundTag("blockCollection"), registry);

    tileEntities = new ArrayList<>();
    tileEntities.addAll(NBTTagLists.compoundsFrom(compound, "tileEntities"));
    tileEntities.forEach(teCompound -> NBTStateInjector.recursivelyApply(teCompound, registry, false));
    tileEntities.replaceAll(teCompound -> fixer.process(FixTypes.BLOCK_ENTITY, teCompound));

    entities = new ArrayList<>();
    entities.addAll(NBTTagLists.compoundsFrom(compound, "entities"));
    entities.forEach(entityCompound -> NBTStateInjector.recursivelyApply(entityCompound, registry, false));
    tileEntities.replaceAll(teCompound -> fixer.process(FixTypes.ENTITY, teCompound));
}
项目:Zombe-Modpack    文件:Minecraft.java   
public Minecraft(GameConfiguration gameConfig)
{
    theMinecraft = this;
    this.mcDataDir = gameConfig.folderInfo.mcDataDir;
    this.fileAssets = gameConfig.folderInfo.assetsDir;
    this.fileResourcepacks = gameConfig.folderInfo.resourcePacksDir;
    this.launchedVersion = gameConfig.gameInfo.version;
    this.versionType = gameConfig.gameInfo.versionType;
    this.twitchDetails = gameConfig.userInfo.userProperties;
    this.profileProperties = gameConfig.userInfo.profileProperties;
    this.mcDefaultResourcePack = new DefaultResourcePack(gameConfig.folderInfo.getAssetsIndex());
    this.proxy = gameConfig.userInfo.proxy == null ? Proxy.NO_PROXY : gameConfig.userInfo.proxy;
    this.sessionService = (new YggdrasilAuthenticationService(this.proxy, UUID.randomUUID().toString())).createMinecraftSessionService();
    this.session = gameConfig.userInfo.session;
    LOGGER.info("Setting user: {}", new Object[] {this.session.getUsername()});
    LOGGER.debug("(Session ID is {})", new Object[] {this.session.getSessionID()});
    this.isDemo = gameConfig.gameInfo.isDemo;
    this.displayWidth = gameConfig.displayInfo.width > 0 ? gameConfig.displayInfo.width : 1;
    this.displayHeight = gameConfig.displayInfo.height > 0 ? gameConfig.displayInfo.height : 1;
    this.tempDisplayWidth = gameConfig.displayInfo.width;
    this.tempDisplayHeight = gameConfig.displayInfo.height;
    this.fullscreen = gameConfig.displayInfo.fullscreen;
    this.jvm64bit = isJvm64bit();
    this.theIntegratedServer = null;

    if (gameConfig.serverInfo.serverName != null)
    {
        this.serverName = gameConfig.serverInfo.serverName;
        this.serverPort = gameConfig.serverInfo.serverPort;
    }

    ImageIO.setUseCache(false);
    Bootstrap.register();
    this.dataFixer = DataFixesManager.createFixer();

    //-ZMod-core----------------------------------------------------------
    ZHandle.onMinecraftInit(this);
    //--------------------------------------------------------------------
}
项目:Backmemed    文件:Minecraft.java   
public Minecraft(GameConfiguration gameConfig)
{
    theMinecraft = this;
    this.mcDataDir = gameConfig.folderInfo.mcDataDir;
    this.fileAssets = gameConfig.folderInfo.assetsDir;
    this.fileResourcepacks = gameConfig.folderInfo.resourcePacksDir;
    this.launchedVersion = gameConfig.gameInfo.version;
    this.versionType = gameConfig.gameInfo.versionType;
    this.twitchDetails = gameConfig.userInfo.userProperties;
    this.profileProperties = gameConfig.userInfo.profileProperties;
    this.mcDefaultResourcePack = new DefaultResourcePack(gameConfig.folderInfo.getAssetsIndex());
    this.proxy = gameConfig.userInfo.proxy == null ? Proxy.NO_PROXY : gameConfig.userInfo.proxy;
    this.sessionService = (new YggdrasilAuthenticationService(this.proxy, UUID.randomUUID().toString())).createMinecraftSessionService();
    this.session = gameConfig.userInfo.session;
    LOGGER.info("Setting user: {}", new Object[] {this.session.getUsername()});
    LOGGER.debug("(Session ID is {})", new Object[] {this.session.getSessionID()});
    this.isDemo = gameConfig.gameInfo.isDemo;
    this.displayWidth = gameConfig.displayInfo.width > 0 ? gameConfig.displayInfo.width : 1;
    this.displayHeight = gameConfig.displayInfo.height > 0 ? gameConfig.displayInfo.height : 1;
    this.tempDisplayWidth = gameConfig.displayInfo.width;
    this.tempDisplayHeight = gameConfig.displayInfo.height;
    this.fullscreen = gameConfig.displayInfo.fullscreen;
    this.jvm64bit = isJvm64bit();
    this.theIntegratedServer = null;

    if (gameConfig.serverInfo.serverName != null)
    {
        this.serverName = gameConfig.serverInfo.serverName;
        this.serverPort = gameConfig.serverInfo.serverPort;
    }

    ImageIO.setUseCache(false);
    Locale.setDefault(Locale.ROOT);
    Bootstrap.register();
    this.dataFixer = DataFixesManager.createFixer();
}
项目:Backmemed    文件:ItemStackData.java   
NBTTagCompound filteredProcess(IDataFixer fixer, NBTTagCompound compound, int versionIn)
{
    for (String s : this.matchingTags)
    {
        compound = DataFixesManager.processItemStack(fixer, compound, versionIn, s);
    }

    return compound;
}
项目:Backmemed    文件:ItemStackDataLists.java   
NBTTagCompound filteredProcess(IDataFixer fixer, NBTTagCompound compound, int versionIn)
{
    for (String s : this.matchingTags)
    {
        compound = DataFixesManager.processInventory(fixer, compound, versionIn, s);
    }

    return compound;
}
项目:CustomWorldGen    文件:Minecraft.java   
public Minecraft(GameConfiguration gameConfig)
{
    theMinecraft = this;
    this.mcDataDir = gameConfig.folderInfo.mcDataDir;
    this.fileAssets = gameConfig.folderInfo.assetsDir;
    this.fileResourcepacks = gameConfig.folderInfo.resourcePacksDir;
    this.launchedVersion = gameConfig.gameInfo.version;
    this.versionType = gameConfig.gameInfo.versionType;
    this.twitchDetails = gameConfig.userInfo.userProperties;
    this.profileProperties = gameConfig.userInfo.profileProperties;
    this.mcDefaultResourcePack = new DefaultResourcePack(gameConfig.folderInfo.getAssetsIndex());
    this.proxy = gameConfig.userInfo.proxy == null ? Proxy.NO_PROXY : gameConfig.userInfo.proxy;
    this.sessionService = (new YggdrasilAuthenticationService(this.proxy, UUID.randomUUID().toString())).createMinecraftSessionService();
    this.session = gameConfig.userInfo.session;
    LOGGER.info("Setting user: {}", new Object[] {this.session.getUsername()});
    this.isDemo = gameConfig.gameInfo.isDemo;
    this.displayWidth = gameConfig.displayInfo.width > 0 ? gameConfig.displayInfo.width : 1;
    this.displayHeight = gameConfig.displayInfo.height > 0 ? gameConfig.displayInfo.height : 1;
    this.tempDisplayWidth = gameConfig.displayInfo.width;
    this.tempDisplayHeight = gameConfig.displayInfo.height;
    this.fullscreen = gameConfig.displayInfo.fullscreen;
    this.jvm64bit = isJvm64bit();
    this.theIntegratedServer = null;

    if (gameConfig.serverInfo.serverName != null)
    {
        this.serverName = gameConfig.serverInfo.serverName;
        this.serverPort = gameConfig.serverInfo.serverPort;
    }

    ImageIO.setUseCache(false);
    Bootstrap.register();
    this.dataFixer = DataFixesManager.createFixer();
}
项目:CustomWorldGen    文件:ItemStackData.java   
NBTTagCompound filteredProcess(IDataFixer fixer, NBTTagCompound compound, int versionIn)
{
    for (String s : this.matchingTags)
    {
        compound = DataFixesManager.processItemStack(fixer, compound, versionIn, s);
    }

    return compound;
}
项目:CustomWorldGen    文件:ItemStackDataLists.java   
NBTTagCompound filteredProcess(IDataFixer fixer, NBTTagCompound compound, int versionIn)
{
    for (String s : this.matchingTags)
    {
        compound = DataFixesManager.processInventory(fixer, compound, versionIn, s);
    }

    return compound;
}
项目:Basin    文件:SinkActivator.java   
@Nonnull
private DedicatedServer constructServerInstance(@Nonnull BundleContext ctx) {
  logger.info("Initializing Minecraft %s", FaucetVersion.API_VERSION);
  Bootstrap.register(); // apparently this is how the registries work ... don't question it

  // log some environment information
  logger.info("Running on Java v%s supplied by %s", System.getProperty("java.version", "Unknown"),
      System.getProperty("java.vendor"));

  // TODO: Integrate with plugins here?
  YggdrasilAuthenticationService var15 = new YggdrasilAuthenticationService(Proxy.NO_PROXY,
      UUID.randomUUID().toString());
  MinecraftSessionService var16 = var15.createMinecraftSessionService();
  GameProfileRepository var17 = var15.createProfileRepository();
  PlayerProfileCache var18 = new PlayerProfileCache(var17, new File(".", "usercache.json"));

  DedicatedServer server = new DedicatedServer(new File("."), DataFixesManager.createFixer(),
      var15, var16, var17, var18);

  // TODO: Re-introduce configuration

  if (!GraphicsEnvironment.isHeadless()) {
    logger.info("Server GUI has been disabled or is unavailable in this environment");
    // TODO: Custom GUI
  } else {
    logger
        .info("Server GUI has been disabled or is not available within the current environment");
  }

  return server;
}
项目:Sink    文件:SinkActivator.java   
@Nonnull
private DedicatedServer constructServerInstance(@Nonnull BundleContext ctx) {
  logger.info("Initializing Minecraft %s", FaucetVersion.API_VERSION);
  Bootstrap.register(); // apparently this is how the registries work ... don't question it

  // log some environment information
  logger.info("Running on Java v%s supplied by %s", System.getProperty("java.version", "Unknown"),
      System.getProperty("java.vendor"));

  // TODO: Integrate with plugins here?
  YggdrasilAuthenticationService var15 = new YggdrasilAuthenticationService(Proxy.NO_PROXY,
      UUID.randomUUID().toString());
  MinecraftSessionService var16 = var15.createMinecraftSessionService();
  GameProfileRepository var17 = var15.createProfileRepository();
  PlayerProfileCache var18 = new PlayerProfileCache(var17, new File(".", "usercache.json"));

  DedicatedServer server = new DedicatedServer(new File("."), DataFixesManager.createFixer(),
      var15, var16, var17, var18);

  // TODO: Re-introduce configuration

  if (!GraphicsEnvironment.isHeadless()) {
    logger.info("Server GUI has been disabled or is unavailable in this environment");
    // TODO: Custom GUI
  } else {
    logger
        .info("Server GUI has been disabled or is not available within the current environment");
  }

  return server;
}
项目:ExpandedRailsMod    文件:EntityPlayer.java   
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;
        }
    });
}
项目:ExpandedRailsMod    文件:EntityVillager.java   
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;
        }
    });
}
项目:ExpandedRailsMod    文件:Minecraft.java   
public Minecraft(GameConfiguration gameConfig)
{
    theMinecraft = this;
    this.mcDataDir = gameConfig.folderInfo.mcDataDir;
    this.fileAssets = gameConfig.folderInfo.assetsDir;
    this.fileResourcepacks = gameConfig.folderInfo.resourcePacksDir;
    this.launchedVersion = gameConfig.gameInfo.version;
    this.versionType = gameConfig.gameInfo.versionType;
    this.twitchDetails = gameConfig.userInfo.userProperties;
    this.profileProperties = gameConfig.userInfo.profileProperties;
    this.mcDefaultResourcePack = new DefaultResourcePack(gameConfig.folderInfo.getAssetsIndex());
    this.proxy = gameConfig.userInfo.proxy == null ? Proxy.NO_PROXY : gameConfig.userInfo.proxy;
    this.sessionService = (new YggdrasilAuthenticationService(this.proxy, UUID.randomUUID().toString())).createMinecraftSessionService();
    this.session = gameConfig.userInfo.session;
    LOGGER.info("Setting user: {}", new Object[] {this.session.getUsername()});
    this.isDemo = gameConfig.gameInfo.isDemo;
    this.displayWidth = gameConfig.displayInfo.width > 0 ? gameConfig.displayInfo.width : 1;
    this.displayHeight = gameConfig.displayInfo.height > 0 ? gameConfig.displayInfo.height : 1;
    this.tempDisplayWidth = gameConfig.displayInfo.width;
    this.tempDisplayHeight = gameConfig.displayInfo.height;
    this.fullscreen = gameConfig.displayInfo.fullscreen;
    this.jvm64bit = isJvm64bit();
    this.theIntegratedServer = null;

    if (gameConfig.serverInfo.serverName != null)
    {
        this.serverName = gameConfig.serverInfo.serverName;
        this.serverPort = gameConfig.serverInfo.serverPort;
    }

    ImageIO.setUseCache(false);
    Bootstrap.register();
    this.dataFixer = DataFixesManager.createFixer();
}
项目:OpenModsLib    文件:NestedItemInventoryWalker.java   
@Override
protected NBTTagCompound processTag(IDataFixer fixer, NBTTagCompound compound, int version) {
    for (String tag : tags)
        compound = DataFixesManager.processInventory(fixer, compound, version, tag);

    return compound;
}
项目:OpenModsLib    文件:NestedItemStackWalker.java   
@Override
protected NBTTagCompound processTag(IDataFixer fixer, NBTTagCompound compound, int version) {
    for (String tag : tags)
        compound = DataFixesManager.processItemStack(fixer, compound, version, tag);

    return compound;
}
项目:OpenModsLib    文件:ItemInventoryWalker.java   
@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;
}