コード例 #1
0
  private static void loadPropertiesFiles(File dataFolder) {
    // Use Configuration once it's finished.
    PropertiesFile pf = new PropertiesFile(new File(dataFolder, "watching.properties"));
    blockBreak = pf.getBoolean("blockBreak", true, "Watch when players break blocks");
    blockPlace = pf.getBoolean("blockPlace", true, "Watch when players place blocks");
    teleport = pf.getBoolean("teleport", true, "Watch when players teleport around");
    chestChanges =
        pf.getBoolean("chestChanges", true, "Watch when players add/remove items from chests");
    commands = pf.getBoolean("commands", true, "Watch for all player commands");
    chat = pf.getBoolean("chat", true, "Watch for player chat");
    login = pf.getBoolean("login", true, "Watch for player logins");
    disconnect = pf.getBoolean("disconnect", true, "Watch for player disconnects");
    doorOpen = pf.getBoolean("doorOpen", false, "Watch for when player opens doors");
    buttonPress = pf.getBoolean("buttonPress", false, "Watch for when player pushes buttons");
    leverSwitch = pf.getBoolean("leverSwitch", false, "Watch for when player switches levers");
    fire = pf.getBoolean("fireLogging", true, "Watch for when players start fires");
    leafDrops = pf.getBoolean("leafDrops", true, "Watch for when leaves drop");
    tntExplosions = pf.getBoolean("tntExplosions", true, "Watch for when TNT explodes");
    creeperExplosions =
        pf.getBoolean("creeperExplosions", true, "Watch for when Creepers explodes");
    miscExplosions = pf.getBoolean("miscExplosions", true, "Watch for miscellaneous explosions");
    ipPlayer = pf.getBoolean("ipPlayer", false, "Add player's IP when login");
    pf.save();

    pf = new PropertiesFile(new File(dataFolder, "BigBrother.properties"));
    freedMem = pf.getDouble("freedMem", 0.0, "The amount of memory freed by BB");
    stickItem = pf.getLong("stickItem", 280l, "The item used for /bb stick");
    restoreFire = pf.getBoolean("restoreFire", false, "Restore fire when rolling back");
    autoWatch = pf.getBoolean("autoWatch", true, "Automatically start watching players");
    defaultSearchRadius =
        pf.getInt("defaultSearchRadius", 2, "Default search radius for bbhere and bbfind");
    mysql = pf.getBoolean("MySQL", true, "If true, uses MySQL. If false, uses Sqlite");
    flatLog =
        pf.getBoolean(
            "flatFileLogs", false, "If true, will also log actions to .logs (one for each player)");
    mysqlUser = pf.getString("mysqlUser", "root", "Username for MySQL db (if applicable)");
    mysqlPass = pf.getString("mysqlPass", "root", "Password for MySQL db (if applicable)");
    mysqlDB =
        pf.getString(
            "mysqlDB", "jdbc:mysql://localhost:3306/minecraft", "DB for MySQL (if applicable)");
    BBDataBlock.BBDATA_TABLE_MYSQL =
        BBDataBlock.BBDATA_TABLE_MYSQL
            + " ENGINE="
            + pf.getString("engine", "INNODB", "Engine for the Database (INNODB is recommended)")
            + ";";

    sendDelay =
        pf.getInt("sendDelay", 4, "Delay to batch send updates to database (4-5 recommended)");
    pf.save();
  }
コード例 #2
0
ファイル: WarpSettings.java プロジェクト: ZachBora/MyWarp
  public static void initialize(File dataFolder) {
    if (!dataFolder.exists()) {
      dataFolder.mkdirs();
    }

    File configFile = new File(dataFolder, settingsFile);
    PropertiesFile file = new PropertiesFile(configFile);
    dataDir = dataFolder;

    maxPublic = file.getInt("maxPublic", 5, "Maximum number of public warps any player can make");
    maxPrivate =
        file.getInt("maxPrivate", 10, "Maximum number of private warps any player can make");
    adminsObeyLimits =
        file.getBoolean("adminsObeyLimits", false, "Whether or not admins can disobey warp limits");
    adminPrivateWarps =
        file.getBoolean(
            "adminPrivateWarps", true, "Whether or not admins can see private warps in their list");
    loadChunks =
        file.getBoolean(
            "loadChunks",
            false,
            "Force sending of the chunk which people teleport to - default: false");

    usemySQL =
        file.getBoolean(
            "usemySQL", false, "MySQL usage --  true = use MySQL database / false = use SQLite");
    mySQLconn =
        file.getString(
            "mySQLconn",
            "jdbc:mysql://localhost:3306/minecraft",
            "MySQL Connection (only if using MySQL)");
    mySQLuname = file.getString("mySQLuname", "root", "MySQL Username (only if using MySQL)");
    mySQLpass = file.getString("mySQLpass", "password", "MySQL Password (only if using MySQL)");

    file.save();
  }
コード例 #3
0
 public static void onDisable(File dataFolder) {
   PropertiesFile pf = new PropertiesFile(new File(dataFolder, "BigBrother.properties"));
   pf.setDouble("freedMem", Stats.getGlobalMemory(), "The amount of memory freed by BB");
   pf.save();
 }