Example #1
0
 private void innerLoad() {
   File f = DimensionManager.getCurrentSaveRootDirectory();
   conf =
       new HyperCubeConfig(
           new File(
               DimensionManager.getCurrentSaveRootDirectory(),
               "enderio/dimensionalTransceiver.cfg"));
   publicChannels.addAll(conf.getPublicChannels());
   userChannels.putAll(conf.getUserChannels());
 }
 @Override
 public void reload() {
   MinecraftScriptMod.getLogger().fine("Reloading Scripting Scope");
   loadScope(false);
   loadAllScripts(_scriptsDirectory, false);
   loadAllScripts(new File(DimensionManager.getCurrentSaveRootDirectory(), "scripts"), true);
 }
Example #3
0
 @Override
 public void doCommand(ItemStack duplicator, EntityPlayerMP sender, String[] arguments) {
   try {
     String name = arguments.length == 2 ? arguments[1] : sender.getCommandSenderName();
     File file =
         new File(
             DimensionManager.getCurrentSaveRootDirectory().getPath()
                 + File.separator
                 + "managers"
                 + File.separator
                 + name
                 + ".nbt");
     if (!file.exists()) {
       throw new CommandException("Couldn't access file: " + name + ".nbt");
     }
     NBTTagCompound tagCompound = CompressedStreamTools.read(file);
     duplicator.setTagCompound(unstripBaseNBT(tagCompound));
     CommandBase.getCommandSenderAsPlayer(sender)
         .addChatComponentMessage(
             new ChatComponentText(
                 LocalizationHelper.translateFormatted(
                     "stevesaddons.command.loadSuccess", name + ".nbt")));
   } catch (IOException e) {
     throw new CommandException("stevesaddons.command.loadFailed");
   }
 }
  private static void loadSavedConfig(World world) {
    try {
      worldSaveDir = DimensionManager.getCurrentSaveRootDirectory();
      worldSaveFile = new File(worldSaveDir, "NEI.dat");
      if (!worldSaveFile.getParentFile().exists()) worldSaveFile.getParentFile().mkdirs();
      if (!worldSaveFile.exists()) worldSaveFile.createNewFile();

      if (worldSaveFile.length() == 0) worldCompound = new NBTTagCompound();
      else {
        DataInputStream din = new DataInputStream(new FileInputStream(worldSaveFile));
        worldCompound = (NBTTagCompound) NBTBase.readNamedTag(din);
        din.close();
      }
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }
Example #5
0
  @Mod.EventHandler
  public void serverLoad(FMLServerStartingEvent event) {
    File f = new File(DimensionManager.getCurrentSaveRootDirectory(), "buildcraft/zonemap");

    try {
      f.mkdirs();
    } catch (Exception e) {
      e.printStackTrace();
    }

    stopMapManager();

    manager = new MapManager(f);
    managerThread = new Thread(manager);
    managerThread.start();

    MinecraftForge.EVENT_BUS.register(manager);
    FMLCommonHandler.instance().bus().register(manager);
  }