1.5.2
This commit is contained in:
parent
da48cc9d9e
commit
8c573b12a2
28 changed files with 42 additions and 210 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -48,3 +48,7 @@ processResources {
|
||||||
expand props
|
expand props
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Clean build output jars before every build
|
||||||
|
def var = build.dependsOn clean
|
||||||
|
var
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -1,202 +0,0 @@
|
||||||
name: GrimmsServer
|
|
||||||
author: Grimm&tyuXX
|
|
||||||
description: A spigot plugin made by Grimm and tyuXX, it adds player leveling, a market, money, and more.
|
|
||||||
website: www.gsdistance.org
|
|
||||||
prefix: Grimm's
|
|
||||||
main: org.gsdistance.grimmsServer.GrimmsServer
|
|
||||||
version: 1.5.2
|
|
||||||
api-version: 1.20
|
|
||||||
load: STARTUP
|
|
||||||
commands:
|
|
||||||
sendMoney:
|
|
||||||
description: Send money to another player from your balance
|
|
||||||
usage: /sendMoney <player> <amount>
|
|
||||||
permission: grimmsserver.sendMoney
|
|
||||||
makeItemLevelable:
|
|
||||||
description: Make the item in your main hand levelable (costs 3500 money, requires level 10+)
|
|
||||||
usage: /makeItemLevelable
|
|
||||||
permission: grimmsserver.makeItemLevelable
|
|
||||||
setPlayerStat:
|
|
||||||
description: Set a specific stat for any player (admin only)
|
|
||||||
usage: /setPlayerStat <player> <statId> <value>
|
|
||||||
permission: grimmsserver.setPlayerStat
|
|
||||||
addTitle:
|
|
||||||
description: Add a title to a player (admin only)
|
|
||||||
usage: /addTitle <player> <title>
|
|
||||||
permission: grimmsserver.addTitle
|
|
||||||
executePlayer:
|
|
||||||
description: Execute a player (requires Executioner title)
|
|
||||||
usage: /executePlayer <player>
|
|
||||||
permission: grimmsserver.executePlayer
|
|
||||||
grimmsServerCommands:
|
|
||||||
description: List all available GrimmsServer commands
|
|
||||||
usage: /grimmsServerCommands
|
|
||||||
withdrawMoney:
|
|
||||||
description: Withdraw money from your balance into physical banknotes
|
|
||||||
usage: /withdrawMoney <amount> [banknoteCount]
|
|
||||||
permission: grimmsserver.withdrawMoney
|
|
||||||
depositMoney:
|
|
||||||
description: Deposit banknotes by holding them in your main hand
|
|
||||||
usage: /depositMoney
|
|
||||||
permission: grimmsserver.depositMoney
|
|
||||||
acceptRequest:
|
|
||||||
description: Accept a pending request by ID
|
|
||||||
usage: /acceptRequest <requestId>
|
|
||||||
permission: grimmsserver.acceptRequest
|
|
||||||
removeTitle:
|
|
||||||
description: Remove a title from a player (admin only)
|
|
||||||
usage: /removeTitle <player> <title>
|
|
||||||
permission: grimmsserver.removeTitle
|
|
||||||
gFaction:
|
|
||||||
description: Manage factions - create, join, leave, claim land, and manage members
|
|
||||||
usage: /gFaction <invite|join|leave|kick|info|new|claim|unclaim|setrank|unclaimall> [args]
|
|
||||||
permission: grimmsserver.faction
|
|
||||||
home:
|
|
||||||
description: Manage your homes - set, teleport, list, or delete
|
|
||||||
usage: /home <sethome|tp|homes|delhome> [args]
|
|
||||||
permission: grimmsserver.home
|
|
||||||
nick:
|
|
||||||
description: Change your nickname or set another player's nickname (admin)
|
|
||||||
usage: /nick <nickname> OR /nick <player> <nickname>
|
|
||||||
permission: grimmsserver.nick
|
|
||||||
market:
|
|
||||||
description: Access the market system for buying, selling, enchanting, and viewing stock
|
|
||||||
usage: /market <get|stock|ripoff|enchant|potioneffect|tp|sell|sellall|buy|enchcosts|info> [args]
|
|
||||||
permission: grimmsserver.market
|
|
||||||
gLog:
|
|
||||||
description: View statistics for yourself, other players, worlds, or leaderboards
|
|
||||||
usage: /gLog <self_stats|other_stats|self_titles|other_titles|world|leaderboard|commands|chunk> [args]
|
|
||||||
permission: grimmsserver.log
|
|
||||||
gStats:
|
|
||||||
description: View historical statistics and growth graphs for yourself or other players
|
|
||||||
usage: /gStats <self_history|others_history> [args]
|
|
||||||
permission: grimmsserver.stats
|
|
||||||
gDim:
|
|
||||||
description: Manage custom dimensions - create, delete, teleport, list, or get info
|
|
||||||
usage: /gDim <create|delete|tp|list|info> [args]
|
|
||||||
permission: grimmsserver.dimensions
|
|
||||||
gUtil:
|
|
||||||
description: Utility commands for version info, relics, capabilities, and settings
|
|
||||||
usage: /gUtil <version|relic|capability|setting> [args]
|
|
||||||
permission: grimmsserver.util
|
|
||||||
gConfig:
|
|
||||||
description: Manage server configuration - dump config or reload settings
|
|
||||||
usage: /gConfig <dump|reload>
|
|
||||||
permission: grimmsserver.config
|
|
||||||
job:
|
|
||||||
description: Manage your job - log jobs, take jobs, or buy education
|
|
||||||
usage: /job <log|take|buyedu> [args]
|
|
||||||
permission: grimmsserver.job
|
|
||||||
gHelp:
|
|
||||||
description: Get detailed help for any GrimmsServer command
|
|
||||||
usage: /gHelp [command]
|
|
||||||
permission: grimmsserver.ghelp
|
|
||||||
gAuth:
|
|
||||||
description: Offline mode authentication - register, login, or unregister
|
|
||||||
usage: /gAuth <register|login|unregister> <password>
|
|
||||||
permission: grimmsserver.gauth
|
|
||||||
gDeco:
|
|
||||||
description: Manage player decorations - set or clear decorative titles
|
|
||||||
usage: /gDeco <setdecotitle|cleardecotitle>
|
|
||||||
permission: grimmsserver.gdeco
|
|
||||||
gLevel:
|
|
||||||
description: Manage player level and prestige
|
|
||||||
usage: /gLevel <prestige>
|
|
||||||
permission: grimmsserver.glevel
|
|
||||||
permissions:
|
|
||||||
grimmsserver.sendMoney:
|
|
||||||
description: Allows sending money to other players from your balance
|
|
||||||
default: true
|
|
||||||
grimmsserver.makeItemLevelable:
|
|
||||||
description: Allows making items levelable for XP gain and stat bonuses
|
|
||||||
default: true
|
|
||||||
grimmsserver.setPlayerStat:
|
|
||||||
description: Allows setting any player's stats directly (admin only)
|
|
||||||
default: op
|
|
||||||
grimmsserver.addTitle:
|
|
||||||
description: Allows granting titles to players (admin only)
|
|
||||||
default: op
|
|
||||||
grimmsserver.executePlayer:
|
|
||||||
description: Allows executing players with the Executioner title
|
|
||||||
default: true
|
|
||||||
grimmsserver.multiHome:
|
|
||||||
description: Allows setting multiple homes instead of just one
|
|
||||||
default: op
|
|
||||||
grimmsserver.home:
|
|
||||||
description: Allows using home teleportation commands
|
|
||||||
default: true
|
|
||||||
grimmsserver.withdrawMoney:
|
|
||||||
description: Allows withdrawing money into physical banknotes for trading
|
|
||||||
default: true
|
|
||||||
grimmsserver.depositMoney:
|
|
||||||
description: Allows depositing banknotes back into your balance
|
|
||||||
default: true
|
|
||||||
grimmsserver.acceptRequest:
|
|
||||||
description: Allows accepting pending requests (faction invites, etc.)
|
|
||||||
default: true
|
|
||||||
grimmsserver.removeTitle:
|
|
||||||
description: Allows removing titles from players (admin only)
|
|
||||||
default: op
|
|
||||||
grimmsserver.faction:
|
|
||||||
description: Allows using faction commands for group gameplay
|
|
||||||
default: true
|
|
||||||
grimmsserver.factionAdmin:
|
|
||||||
description: Allows administrative faction commands (admin only)
|
|
||||||
default: op
|
|
||||||
grimmsserver.nick:
|
|
||||||
description: Allows changing your own display nickname
|
|
||||||
default: true
|
|
||||||
grimmsserver.nick.others:
|
|
||||||
description: Allows changing other players' nicknames (admin only)
|
|
||||||
default: op
|
|
||||||
grimmsserver.market:
|
|
||||||
description: Allows using the market for buying, selling, and enchanting
|
|
||||||
default: true
|
|
||||||
grimmsserver.log:
|
|
||||||
description: Allows viewing various statistics and logs
|
|
||||||
default: true
|
|
||||||
grimmsserver.log.self:
|
|
||||||
description: Allows viewing your own statistics and titles
|
|
||||||
default: true
|
|
||||||
grimmsserver.log.other:
|
|
||||||
description: Allows viewing other players' statistics (admin only)
|
|
||||||
default: op
|
|
||||||
grimmsserver.stats:
|
|
||||||
description: Allows viewing historical statistics and growth graphs
|
|
||||||
default: true
|
|
||||||
grimmsserver.stats.self:
|
|
||||||
description: Allows viewing your own historical statistics
|
|
||||||
default: true
|
|
||||||
grimmsserver.stats.other:
|
|
||||||
description: Allows viewing other players' statistics (admin only)
|
|
||||||
default: op
|
|
||||||
grimmsserver.dimensions:
|
|
||||||
description: Allows managing custom dimensions (admin only)
|
|
||||||
default: op
|
|
||||||
grimmsserver.util:
|
|
||||||
description: Allows using general utility commands
|
|
||||||
default: true
|
|
||||||
grimmsserver.util.admin:
|
|
||||||
description: Allows using administrative utility commands (admin only)
|
|
||||||
default: op
|
|
||||||
grimmsserver.config:
|
|
||||||
description: Allows modifying server configuration (admin only)
|
|
||||||
default: op
|
|
||||||
grimmsserver.faction.bypass:
|
|
||||||
description: Allows bypassing faction claim restrictions
|
|
||||||
default: op
|
|
||||||
grimmsserver.job:
|
|
||||||
description: Allows using the job system for income
|
|
||||||
default: true
|
|
||||||
grimmsserver.ghelp:
|
|
||||||
description: Allows using the help command system
|
|
||||||
default: true
|
|
||||||
grimmsserver.gauth:
|
|
||||||
description: Allows using offline mode authentication
|
|
||||||
default: true
|
|
||||||
grimmsserver.gdeco:
|
|
||||||
description: Allows using player decoration options
|
|
||||||
default: true
|
|
||||||
grimmsserver.glevel:
|
|
||||||
description: Allows using player level and prestige commands
|
|
||||||
default: true
|
|
||||||
Binary file not shown.
|
|
@ -1,2 +0,0 @@
|
||||||
Manifest-Version: 1.0
|
|
||||||
|
|
||||||
|
|
@ -33,7 +33,7 @@ public enum ConfigKey {
|
||||||
PRESTIGE_CAPABILITY_AUTOSELL_PRICE("prestige_capability_autosell_price", 4),
|
PRESTIGE_CAPABILITY_AUTOSELL_PRICE("prestige_capability_autosell_price", 4),
|
||||||
PRESTIGE_CAPABILITY_MAGNET_PRICE("prestige_capability_magnet_price", 2),
|
PRESTIGE_CAPABILITY_MAGNET_PRICE("prestige_capability_magnet_price", 2),
|
||||||
PRESTIGE_CAPABILITY_VEINMINER_PRICE("prestige_capability_veinminer_price", 3),
|
PRESTIGE_CAPABILITY_VEINMINER_PRICE("prestige_capability_veinminer_price", 3),
|
||||||
PRESTIGE_CAPABILITY_SATURATION_PERK_PRICE("prestige_capability_saturation_perk_price", 4);
|
PRESTIGE_CAPABILITY_SATURATION_PERK_PRICE("prestige_capability_saturation_perk_price", 10);
|
||||||
|
|
||||||
private final String key;
|
private final String key;
|
||||||
private final Object defaultValue;
|
private final Object defaultValue;
|
||||||
|
|
|
||||||
|
|
@ -11,19 +11,49 @@ import java.io.IOException;
|
||||||
|
|
||||||
public class ConfigLoader {
|
public class ConfigLoader {
|
||||||
private static FileConfiguration config;
|
private static FileConfiguration config;
|
||||||
|
private static File configFile;
|
||||||
|
|
||||||
public ConfigLoader() {
|
public ConfigLoader() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void initialize(JavaPlugin plugin) {
|
public static void initialize(JavaPlugin plugin) {
|
||||||
File configFile = new File(plugin.getDataFolder(), "config.yml");
|
configFile = new File(plugin.getDataFolder(), "config.yml");
|
||||||
if (!configFile.exists()) {
|
if (!configFile.exists()) {
|
||||||
generateDefaultConfig(configFile);
|
generateDefaultConfig(configFile);
|
||||||
|
} else {
|
||||||
|
migrateConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
config = YamlConfiguration.loadConfiguration(configFile);
|
config = YamlConfiguration.loadConfiguration(configFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void migrateConfig() {
|
||||||
|
YamlConfiguration existingConfig = YamlConfiguration.loadConfiguration(configFile);
|
||||||
|
String currentVersion = GrimmsServer.instance.getDescription().getVersion();
|
||||||
|
String configVersion = existingConfig.getString(ConfigKey.CONFIG_VERSION.getKey());
|
||||||
|
|
||||||
|
if (configVersion == null || !configVersion.equals(currentVersion)) {
|
||||||
|
boolean needsUpdate = false;
|
||||||
|
for (ConfigKey key : ConfigKey.values()) {
|
||||||
|
if (!existingConfig.contains(key.getKey())) {
|
||||||
|
existingConfig.set(key.getKey(), key.getDefaultValue());
|
||||||
|
needsUpdate = true;
|
||||||
|
GrimmsServer.logger.info("Added missing config field: " + key.getKey());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
existingConfig.set(ConfigKey.CONFIG_VERSION.getKey(), currentVersion);
|
||||||
|
|
||||||
|
if (needsUpdate) {
|
||||||
|
try {
|
||||||
|
existingConfig.save(configFile);
|
||||||
|
GrimmsServer.logger.info("Config migrated to version " + currentVersion);
|
||||||
|
} catch (IOException e) {
|
||||||
|
GrimmsServer.logger.severe("Failed to migrate config: " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static void generateDefaultConfig(File configFile) {
|
private static void generateDefaultConfig(File configFile) {
|
||||||
YamlConfiguration yamlConfig = new YamlConfiguration();
|
YamlConfiguration yamlConfig = new YamlConfiguration();
|
||||||
for (ConfigKey key : ConfigKey.values()) {
|
for (ConfigKey key : ConfigKey.values()) {
|
||||||
|
|
@ -40,9 +70,10 @@ public class ConfigLoader {
|
||||||
public static void loadConfigFromFile() {
|
public static void loadConfigFromFile() {
|
||||||
Stopwatch sw = Stopwatch.createStarted();
|
Stopwatch sw = Stopwatch.createStarted();
|
||||||
GrimmsServer.logger.info("Loading GrimmsServer config...");
|
GrimmsServer.logger.info("Loading GrimmsServer config...");
|
||||||
if (config == null) {
|
if (configFile == null) {
|
||||||
GrimmsServer.logger.warning("Config somehow not initialized. (" + sw.stop() + ")");
|
GrimmsServer.logger.warning("Config file not initialized. (" + sw.stop() + ")");
|
||||||
} else {
|
} else {
|
||||||
|
config = YamlConfiguration.loadConfiguration(configFile);
|
||||||
for (ConfigKey key : ConfigKey.values()) {
|
for (ConfigKey key : ConfigKey.values()) {
|
||||||
Object value = config.get(key.getKey(), key.getDefaultValue());
|
Object value = config.get(key.getKey(), key.getDefaultValue());
|
||||||
ActiveConfig.setConfigValue(key, value);
|
ActiveConfig.setConfigValue(key, value);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package org.gsdistance.grimmsServer.Events.Listeners;
|
package org.gsdistance.grimmsServer.Events.Listeners;
|
||||||
|
|
||||||
|
import org.bukkit.attribute.Attribute;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.gsdistance.grimmsServer.Constructable.Player.PlayerLevelHandler;
|
import org.gsdistance.grimmsServer.Constructable.Player.PlayerLevelHandler;
|
||||||
|
|
@ -19,7 +20,7 @@ public class EntityDeathEvent {
|
||||||
event.getEntity().setCustomName(null);
|
event.getEntity().setCustomName(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event.getEntity().getKiller() != null && event.getEntity().getKiller().getType() == EntityType.PLAYER) {
|
if (event.getEntity().getKiller() != null && event.getEntity().getAttribute(Attribute.MAX_HEALTH) != null && event.getEntity().getAttribute(Attribute.MAX_HEALTH).getValue() > 0 && event.getEntity().getKiller().getType() == EntityType.PLAYER) {
|
||||||
PlayerStats playerStats = PlayerStats.getPlayerStats(event.getEntity().getKiller());
|
PlayerStats playerStats = PlayerStats.getPlayerStats(event.getEntity().getKiller());
|
||||||
WorldStats worldStats = WorldStats.getWorldStats(event.getEntity().getWorld());
|
WorldStats worldStats = WorldStats.getWorldStats(event.getEntity().getWorld());
|
||||||
playerStats.changeStat("total_kill_count", 1);
|
playerStats.changeStat("total_kill_count", 1);
|
||||||
|
|
|
||||||
|
|
@ -89,8 +89,8 @@ public class PlayerTickEvent {
|
||||||
double money = playerStats.getStat("money", Double.class);
|
double money = playerStats.getStat("money", Double.class);
|
||||||
if(playerStats.getStat("maximum_balance", Double.class) < money + payCheck){
|
if(playerStats.getStat("maximum_balance", Double.class) < money + payCheck){
|
||||||
playerStats.setStat("money", money + payCheck);
|
playerStats.setStat("money", money + payCheck);
|
||||||
|
player.sendMessage(ChatColor.GREEN + "You have received your paycheck: " + ChatColor.GOLD + Shared.formatNumber(payCheck));
|
||||||
}
|
}
|
||||||
player.sendMessage(ChatColor.GREEN + "You have received your paycheck: " + ChatColor.GOLD + Shared.formatNumber(payCheck));
|
|
||||||
lastPaycheckTimes.put(playerId, currentTime);
|
lastPaycheckTimes.put(playerId, currentTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue