Skip to content

Instantly share code, notes, and snippets.

@RealRONiN
Last active April 14, 2023 05:48
Show Gist options
  • Select an option

  • Save RealRONiN/bd9efd5f29bf095f07d2b590e4e3e5ab to your computer and use it in GitHub Desktop.

Select an option

Save RealRONiN/bd9efd5f29bf095f07d2b590e4e3e5ab to your computer and use it in GitHub Desktop.
/*
* LifeSteal - Yet another lifecore smp core.
* Copyright (C) 2022 Arcade Labs
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package in.arcadelabs.lifesteal.config.keys;
public enum Config {
/**
* Version config key.
*/
VERSION("Version"),
/**
* Clean console config key.
*/
CLEAN_CONSOLE("Clean-Console"),
/**
* Database enabled config key.
*/
DATABASE_ENABLED("DATABASE.ENABLED"),
/**
* Database address config key.
*/
DATABASE_ADDRESS("DATABASE.ADDRESS"),
/**
* Database port config key.
*/
DATABASE_PORT("DATABASE.PORT"),
/**
* Database name config key.
*/
DATABASE_NAME("DATABASE.DATABASE"),
/**
* Database username config key.
*/
DATABASE_USERNAME("DATABASE.USERNAME"),
/**
* Database password config key.
*/
DATABASE_PASSWORD("DATABASE.PASSWORD"),
/**
* Database realtime config key.
*/
DATABASE_REALTIME("DATABASE.REALTIME"),
/**
* Database ssl config key.
*/
DATABASE_SSL("DATABASE.SSL"),
/**
* Hearts to transfer config key.
*/
HEARTS_TO_TRANSFER("HeartsToTransfer"),
/**
* Default hearts config key.
*/
DEFAULT_HEARTS("DefaultHearts"),
/**
* After revive hearts config key.
*/
AFTER_REVIVE_HEARTS("AfterReviveHearts"),
/**
* Max hearts config key.
*/
MAX_HEARTS("Max-Hearts"),
/**
* Disable totems config key.
*/
DISABLE_TOTEMS("DisableTotem"),
/**
* Disable milk cures config key.
*/
DISABLE_MILK_CURES("DisableMilkCure"),
/**
* Heart consume cooldown config key.
*/
HEART_CONSUME_COOLDOWN("Cooldowns.Heart-Consume"),
/**
* Heart craft cooldown config key.
*/
HEART_CRAFT_COOLDOWN("Cooldowns.Heart-Craft"),
/**
* Heart withdraw cooldown config key.
*/
HEART_WITHDRAW_COOLDOWN("Cooldowns.Heart-Withdraw"),
/**
* Disabled worlds heart craft config key.
*/
DISABLED_WORLDS_HEART_CRAFT("Disabled-Worlds.Heart-Craft"),
/**
* Disabled worlds heart consume config key.
*/
DISABLED_WORLDS_HEART_CONSUME("Disabled-Worlds.Heart-Consume"),
/**
* Disabled worlds heart withdraw config key.
*/
DISABLED_WORLDS_HEART_WITHDRAW("Disabled-Worlds.Heart-Withdraw"),
/**
* Disabled worlds heart drops player kill config key.
*/
DISABLED_WORLDS_HEART_DROPS_PLAYER_KILL("Disabled-Worlds.Heart-Drops.Player-Kill"),
/**
* Disabled worlds heart drops other config key.
*/
DISABLED_WORLDS_HEART_DROPS_OTHER("Disabled-Worlds.Heart-Drops.Other"),
/**
* Heart property itemtype config key.
*/
HEART_PROPERTY_ITEMTYPE("Heart.Properties.ItemType"),
/**
* Heart property name config key.
*/
HEART_PROPERTY_NAME("Heart.Properties.Name"),
/**
* Heart property lore config key.
*/
HEART_PROPERTY_LORE("Heart.Properties.Lore"),
/**
* Heart property model data config key.
*/
HEART_PROPERTY_MODEL_DATA("Heart.Properties.ModelData"),
/**
* Revive beacon property itemtype config key.
*/
REVIVE_BEACON_PROPERTY_ITEMTYPE("ReviveBeacon.Properties.ItemType"),
/**
* Revive beacon property name config key.
*/
REVIVE_BEACON_PROPERTY_NAME("ReviveBeacon.Properties.Name"),
/**
* Revive beacon property lore config key.
*/
REVIVE_BEACON_PROPERTY_LORE("ReviveBeacon.Properties.Lore"),
/**
* Revive beacon property model data config key.
*/
REVIVE_BEACON_PROPERTY_MODEL_DATA("ReviveBeacon.Properties.ModelData"),
/**
* Elimination mode config key.
*/
ELIMINATION_MODE("EliminationMode"),
/**
* Inventory mode config key.
*/
INVENTORY_MODE("InventoryMode"),
/**
* Experience mode config key.
*/
EXPERIENCE_MODE("ExperienceMode"),
/**
* Ban command uri config key.
*/
BAN_COMMAND_URI("Ban-Command-URI"),
/**
* Unban command uri config key.
*/
UNBAN_COMMAND_URI("UnBan-Command-URI"),
/**
* Spirit black hearts config key.
*/
SPIRIT_BLACK_HEARTS("Spirit.Black-Hearts"),
/**
* Spirit model enabled config key.
*/
SPIRIT_MODEL_ENABLED("Spirit.Spirit-Model.Enabled"),
/**
* Spirit model itemtype config key.
*/
SPIRIT_MODEL_ITEMTYPE("Spirit.Spirit-Model.ItemType"),
/**
* Spirit model name config key.
*/
SPIRIT_MODEL_NAME("Spirit.Spirit-Model.Name"),
/**
* Spirit model lore config key.
*/
SPIRIT_MODEL_LORE("Spirit.Spirit-Model.Lore"),
/**
* Spirit model model data config key.
*/
SPIRIT_MODEL_MODEL_DATA("Spirit.Spirit-Model.ModelData"),
/**
* Spirit hearts config key.
*/
SPIRIT_HEARTS("Spirit.Hearts"),
/**
* Spirit gamemode config key.
*/
SPIRIT_GAMEMODE("Spirit.GameMode"),
/**
* Spirit invisible config key.
*/
SPIRIT_INVISIBLE("Spirit.Invisible"),
/**
* Spirit invulnerable config key.
*/
SPIRIT_INVULNERABLE("Spirit.Invulnerable"),
/**
* Spirit can pickup items config key.
*/
SPIRIT_CAN_PICKUP_ITEMS("Spirit.CanPickupItems"),
/**
* Spirit collidable config key.
*/
SPIRIT_COLLIDABLE("Spirit.Collidable"),
/**
* Spirit sleeping ignored config key.
*/
SPIRIT_SLEEPING_IGNORED("Spirit.SleepingIgnored"),
/**
* Spirit silent config key.
*/
SPIRIT_SILENT("Spirit.Silent");
final String key;
Config(final String key) {
this.key = key;
}
public String getKey() {
return key;
}
}
/*
* LifeSteal - Yet another lifecore smp core.
* Copyright (C) 2022 Arcade Labs
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package in.arcadelabs.lifesteal.config;
import in.arcadelabs.lifesteal.LifeSteal;
import in.arcadelabs.lifesteal.config.keys.Config;
import java.util.List;
public class ConfigKeys {
private final LifeSteal lifeSteal;
public ConfigKeys(LifeSteal lifeSteal) {
this.lifeSteal = lifeSteal;
}
public String getString(Config key) {
return this.lifeSteal.getConfig().getString(key.getKey());
}
public boolean getBoolean(Config key) {
return this.lifeSteal.getConfig().getBoolean(key.getKey());
}
public int getInt(Config key) {
return this.lifeSteal.getConfig().getInt(key.getKey());
}
public double getDouble(Config key) {
return this.lifeSteal.getConfig().getDouble(key.getKey());
}
public List<String> getStringList(Config key) {
return this.lifeSteal.getConfig().getStringList(key.getKey());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment