Distinguish between Test Server and Main Server when updating. Add in
isArtifactItem() to API.
This commit is contained in:
parent
ee468bf2b7
commit
efc9b09a1e
Binary file not shown.
@ -1,6 +1,6 @@
|
|||||||
name: TwosideKeeper
|
name: TwosideKeeper
|
||||||
main: sig.plugin.TwosideKeeper.TwosideKeeper
|
main: sig.plugin.TwosideKeeper.TwosideKeeper
|
||||||
version: 3.4.1c
|
version: 3.4.2
|
||||||
commands:
|
commands:
|
||||||
money:
|
money:
|
||||||
description: Tells the player the amount of money they are holding.
|
description: Tells the player the amount of money they are holding.
|
||||||
@ -47,8 +47,13 @@ commands:
|
|||||||
usage: /log
|
usage: /log
|
||||||
permission: TwosideKeeper.log
|
permission: TwosideKeeper.log
|
||||||
permission-message: No permissions!
|
permission-message: No permissions!
|
||||||
|
servertype:
|
||||||
|
description: Sets the server type to another type.
|
||||||
|
usage: /servertype <MAIN|TEST|QUIET>
|
||||||
|
permission: TwosideKeeper.servertype
|
||||||
|
permission-message: No permissions!
|
||||||
fix:
|
fix:
|
||||||
description: Does many things depending on what you item is being held. Typically if it's broken, typing this will help.
|
description: Does many things depending on what item is being held. Typically if it's broken, typing this will help.
|
||||||
usage: /fix
|
usage: /fix
|
||||||
permission: TwosideKeeper.fix
|
permission: TwosideKeeper.fix
|
||||||
permission-message: No permissions!
|
permission-message: No permissions!
|
@ -0,0 +1,34 @@
|
|||||||
|
package sig.plugin.TwosideKeeper.HelperStructures;
|
||||||
|
|
||||||
|
public enum ServerType {
|
||||||
|
MAIN(0,""), //The main server. All announcements are made to Discord.
|
||||||
|
TEST(1,"Test"), //The test server. Reload and shutdown announcements are not made to Discord. Only restarts will be announced.
|
||||||
|
QUIET(2,"Private"); //No announcements to Discord are made.
|
||||||
|
|
||||||
|
int val;
|
||||||
|
String name;
|
||||||
|
|
||||||
|
ServerType(int val, String name) {
|
||||||
|
this.val=val;
|
||||||
|
this.name=name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int GetValue() {
|
||||||
|
return this.val;
|
||||||
|
}
|
||||||
|
public static ServerType GetTypeFromValue(int val) {
|
||||||
|
for (int i=0;i<ServerType.values().length;i++) {
|
||||||
|
if (ServerType.values()[i].GetValue()==val) {
|
||||||
|
return ServerType.values()[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ServerType.TEST; //Return the default if none exists.
|
||||||
|
}
|
||||||
|
public String GetServerName() {
|
||||||
|
if (this.name.length()>0) {
|
||||||
|
return this.name+" ";
|
||||||
|
} else {
|
||||||
|
return this.name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -37,12 +37,12 @@ public class SpleefManager {
|
|||||||
public void SetupSpleefArena(SpleefArena id,Location corner1,Location corner2,Location shovel_block, Location register_sign) {
|
public void SetupSpleefArena(SpleefArena id,Location corner1,Location corner2,Location shovel_block, Location register_sign) {
|
||||||
SpleefGame newGame = new SpleefGame(plugin, id, corner1,corner2,shovel_block,register_sign);
|
SpleefGame newGame = new SpleefGame(plugin, id, corner1,corner2,shovel_block,register_sign);
|
||||||
spleef_game_list.add(newGame);
|
spleef_game_list.add(newGame);
|
||||||
TwosideKeeper.log("Added new SpleefGame: "+newGame.toString(),3);
|
TwosideKeeper.log("Added new SpleefGame: "+newGame.toString(),4);
|
||||||
}
|
}
|
||||||
public void SetupSpleefArena(SpleefArena id, Location corner1, Location corner2, Location shovel_block, Location shovel_block2, Location register_sign) {
|
public void SetupSpleefArena(SpleefArena id, Location corner1, Location corner2, Location shovel_block, Location shovel_block2, Location register_sign) {
|
||||||
SpleefGame newGame = new SpleefGame(plugin, id, corner1,corner2,shovel_block,shovel_block2,register_sign);
|
SpleefGame newGame = new SpleefGame(plugin, id, corner1,corner2,shovel_block,shovel_block2,register_sign);
|
||||||
spleef_game_list.add(newGame);
|
spleef_game_list.add(newGame);
|
||||||
TwosideKeeper.log("Added new SpleefGame: "+newGame.toString(),3);
|
TwosideKeeper.log("Added new SpleefGame: "+newGame.toString(),4);
|
||||||
}
|
}
|
||||||
public void PassEvent(Event e) {
|
public void PassEvent(Event e) {
|
||||||
//Passes events in the world to all Spleef Games.
|
//Passes events in the world to all Spleef Games.
|
||||||
|
@ -96,6 +96,7 @@ import org.bukkit.event.player.PlayerQuitEvent;
|
|||||||
import org.bukkit.event.player.PlayerRespawnEvent;
|
import org.bukkit.event.player.PlayerRespawnEvent;
|
||||||
import org.bukkit.event.player.PlayerTeleportEvent;
|
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||||
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||||
|
import org.bukkit.event.server.ServerCommandEvent;
|
||||||
import org.bukkit.event.server.ServerListPingEvent;
|
import org.bukkit.event.server.ServerListPingEvent;
|
||||||
import org.bukkit.event.vehicle.VehicleCreateEvent;
|
import org.bukkit.event.vehicle.VehicleCreateEvent;
|
||||||
import org.bukkit.event.vehicle.VehicleExitEvent;
|
import org.bukkit.event.vehicle.VehicleExitEvent;
|
||||||
@ -131,6 +132,7 @@ import sig.plugin.TwosideKeeper.HelperStructures.MalleableBaseQuest;
|
|||||||
import sig.plugin.TwosideKeeper.HelperStructures.MonsterDifficulty;
|
import sig.plugin.TwosideKeeper.HelperStructures.MonsterDifficulty;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.MonsterType;
|
import sig.plugin.TwosideKeeper.HelperStructures.MonsterType;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.QuestStatus;
|
import sig.plugin.TwosideKeeper.HelperStructures.QuestStatus;
|
||||||
|
import sig.plugin.TwosideKeeper.HelperStructures.ServerType;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.SessionState;
|
import sig.plugin.TwosideKeeper.HelperStructures.SessionState;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.SpleefArena;
|
import sig.plugin.TwosideKeeper.HelperStructures.SpleefArena;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.WorldShop;
|
import sig.plugin.TwosideKeeper.HelperStructures.WorldShop;
|
||||||
@ -169,6 +171,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
public static int WORLD_SHOP_ID=0; //The shop ID number we are on.
|
public static int WORLD_SHOP_ID=0; //The shop ID number we are on.
|
||||||
public static int LOGGING_LEVEL=0; //The logging level the server will output in for the console. 0 = No Debug Messages. Toggled with /log.
|
public static int LOGGING_LEVEL=0; //The logging level the server will output in for the console. 0 = No Debug Messages. Toggled with /log.
|
||||||
public static double ARTIFACT_RARITY=1.5; //The multiplier of artifact drops.
|
public static double ARTIFACT_RARITY=1.5; //The multiplier of artifact drops.
|
||||||
|
public static ServerType SERVER_TYPE=ServerType.TEST; //The type of server this is running on.
|
||||||
public static File filesave;
|
public static File filesave;
|
||||||
public static HashMap playerdata;
|
public static HashMap playerdata;
|
||||||
public static SpleefManager TwosideSpleefGames;
|
public static SpleefManager TwosideSpleefGames;
|
||||||
@ -273,12 +276,14 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Announce the server has restarted soon after.
|
//Announce the server has restarted soon after.
|
||||||
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
|
if (SERVER_TYPE!=ServerType.QUIET) {
|
||||||
@Override
|
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
|
||||||
public void run() {
|
@Override
|
||||||
DiscordMessageSender.sendItalicizedRawMessageDiscord("The server has been restarted.\nRunning v."+Bukkit.getPluginManager().getPlugin("TwosideKeeper").getDescription().getVersion()+" of TwosideKeeper\nRunning v"+Bukkit.getPluginManager().getPlugin("aPlugin").getDescription().getVersion()+" of Jobs.");
|
public void run() {
|
||||||
}
|
DiscordMessageSender.sendItalicizedRawMessageDiscord(SERVER_TYPE.GetServerName()+"Server has been restarted.\nRunning v."+Bukkit.getPluginManager().getPlugin("TwosideKeeper").getDescription().getVersion()+" of TwosideKeeper\nRunning v"+Bukkit.getPluginManager().getPlugin("aPlugin").getDescription().getVersion()+" of Jobs.");
|
||||||
},100);
|
}
|
||||||
|
},100);
|
||||||
|
}
|
||||||
|
|
||||||
//This is the constant timing method.
|
//This is the constant timing method.
|
||||||
getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable(){
|
getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable(){
|
||||||
@ -400,7 +405,12 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
double old_buffdmg = pd.prev_buffdmg;
|
double old_buffdmg = pd.prev_buffdmg;
|
||||||
double old_partydmg = pd.prev_partydmg;
|
double old_partydmg = pd.prev_partydmg;
|
||||||
double old_armordef = pd.prev_armordef;
|
double old_armordef = pd.prev_armordef;
|
||||||
double store1=CalculateDamageReduction(1,p,p),store2=CalculateWeaponDamage(p,null);
|
double store1=CalculateDamageReduction(1,p,p);
|
||||||
|
|
||||||
|
double store2=old_weapondmg;
|
||||||
|
if (GenericFunctions.isWeapon(p.getEquipment().getItemInMainHand())) {
|
||||||
|
store2 = CalculateWeaponDamage(p,null);
|
||||||
|
}
|
||||||
if (store1!=pd.damagereduction || store2!=pd.damagedealt) {
|
if (store1!=pd.damagereduction || store2!=pd.damagedealt) {
|
||||||
log("Values: "+old_weapondmg+","
|
log("Values: "+old_weapondmg+","
|
||||||
+old_buffdmg+","
|
+old_buffdmg+","
|
||||||
@ -488,7 +498,6 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
TwosideSpleefGames.TickEvent();
|
TwosideSpleefGames.TickEvent();
|
||||||
}}, 20l, 20l);
|
}}, 20l, 20l);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDisable() {
|
public void onDisable() {
|
||||||
// TODO Insert logic to be performed when the plugin is disabled
|
// TODO Insert logic to be performed when the plugin is disabled
|
||||||
@ -497,17 +506,25 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "scoreboard objectives remove Party"+i);
|
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "scoreboard objectives remove Party"+i);
|
||||||
}
|
}
|
||||||
saveOurData(); //Saves all of our server variables and closes down.
|
saveOurData(); //Saves all of our server variables and closes down.
|
||||||
DiscordMessageSender.sendItalicizedRawMessageDiscord("Server is shutting down and restarting...");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
|
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
|
||||||
if (cmd.getName().equalsIgnoreCase("log")) {
|
if (cmd.getName().equalsIgnoreCase("log")) {
|
||||||
LOGGING_LEVEL = (LOGGING_LEVEL+1) % 6;
|
LOGGING_LEVEL = (LOGGING_LEVEL+1) % 6;
|
||||||
sender.sendMessage("Debugging Log Level is now "+ChatColor.RED+LOGGING_LEVEL+".");
|
sender.sendMessage("Debugging Log Level is now "+ChatColor.RED+LOGGING_LEVEL+".");
|
||||||
return true;
|
return true;
|
||||||
}
|
} else
|
||||||
|
if (cmd.getName().equalsIgnoreCase("servertype")) {
|
||||||
|
if (args.length==1) {
|
||||||
|
if (ServerType.valueOf(args[0].toUpperCase())!=null) {
|
||||||
|
SERVER_TYPE = ServerType.valueOf(args[0].toUpperCase());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
sender.sendMessage("Wrong arguments!");
|
||||||
|
}
|
||||||
|
} else
|
||||||
if (sender instanceof Player) {
|
if (sender instanceof Player) {
|
||||||
DecimalFormat df = new DecimalFormat("0.00");
|
DecimalFormat df = new DecimalFormat("0.00");
|
||||||
if (cmd.getName().equalsIgnoreCase("fix")) {
|
if (cmd.getName().equalsIgnoreCase("fix")) {
|
||||||
@ -527,13 +544,14 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
if (args.length==2) {
|
if (args.length==2) {
|
||||||
p.getEquipment().getItemInMainHand().addUnsafeEnchantment(Enchantment.getById(Integer.parseInt(args[0])), Integer.parseInt(args[1]));
|
p.getEquipment().getItemInMainHand().addUnsafeEnchantment(Enchantment.getById(Integer.parseInt(args[0])), Integer.parseInt(args[1]));
|
||||||
sender.sendMessage("Enchantment applied!");
|
sender.sendMessage("Enchantment applied!");
|
||||||
|
return true;
|
||||||
} else {
|
} else {
|
||||||
sender.sendMessage("Wrong arguments!");
|
sender.sendMessage("Wrong arguments!");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
sender.sendMessage("Cannot enchant nothing!");
|
sender.sendMessage("Cannot enchant nothing!");
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
} else
|
} else
|
||||||
if (cmd.getName().equalsIgnoreCase("harden_armor")) {
|
if (cmd.getName().equalsIgnoreCase("harden_armor")) {
|
||||||
//sender.sendMessage("You are currently holding "+ChatColor.GREEN+"$"+getPlayerMoney((Player)sender));
|
//sender.sendMessage("You are currently holding "+ChatColor.GREEN+"$"+getPlayerMoney((Player)sender));
|
||||||
@ -556,13 +574,14 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
}
|
}
|
||||||
item.setItemMeta(meta);
|
item.setItemMeta(meta);
|
||||||
p.getEquipment().setItemInMainHand(item);
|
p.getEquipment().setItemInMainHand(item);
|
||||||
|
return true;
|
||||||
} else {
|
} else {
|
||||||
sender.sendMessage("Wrong arguments!");
|
sender.sendMessage("Wrong arguments!");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
sender.sendMessage("Cannot harden nothing!");
|
sender.sendMessage("Cannot harden nothing!");
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
} else
|
} else
|
||||||
if (cmd.getName().equalsIgnoreCase("item_cube")) {
|
if (cmd.getName().equalsIgnoreCase("item_cube")) {
|
||||||
//sender.sendMessage("You are currently holding "+ChatColor.GREEN+"$"+getPlayerMoney((Player)sender));
|
//sender.sendMessage("You are currently holding "+ChatColor.GREEN+"$"+getPlayerMoney((Player)sender));
|
||||||
@ -591,13 +610,14 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
}
|
}
|
||||||
item.setItemMeta(meta);
|
item.setItemMeta(meta);
|
||||||
p.getEquipment().setItemInMainHand(item);
|
p.getEquipment().setItemInMainHand(item);
|
||||||
|
return true;
|
||||||
} else {
|
} else {
|
||||||
sender.sendMessage("Wrong arguments!");
|
sender.sendMessage("Wrong arguments!");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
sender.sendMessage("Cannot convert nothing!");
|
sender.sendMessage("Cannot convert nothing!");
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
} else
|
} else
|
||||||
if (cmd.getName().equalsIgnoreCase("artifact")) {
|
if (cmd.getName().equalsIgnoreCase("artifact")) {
|
||||||
Player p = (Player)sender;
|
Player p = (Player)sender;
|
||||||
@ -605,9 +625,11 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
ItemStack newartifact = Artifact.createArtifactItem(ArtifactItem.valueOf(args[0]));
|
ItemStack newartifact = Artifact.createArtifactItem(ArtifactItem.valueOf(args[0]));
|
||||||
newartifact.setAmount(Integer.parseInt((args[1])));
|
newartifact.setAmount(Integer.parseInt((args[1])));
|
||||||
p.getInventory().addItem(newartifact);
|
p.getInventory().addItem(newartifact);
|
||||||
|
return true;
|
||||||
} else
|
} else
|
||||||
if (args.length==1) {
|
if (args.length==1) {
|
||||||
p.getInventory().addItem(Artifact.createArtifactItem(ArtifactItem.valueOf(args[0])));
|
p.getInventory().addItem(Artifact.createArtifactItem(ArtifactItem.valueOf(args[0])));
|
||||||
|
return true;
|
||||||
} else {
|
} else {
|
||||||
sender.sendMessage("Wrong arguments!");
|
sender.sendMessage("Wrong arguments!");
|
||||||
}
|
}
|
||||||
@ -648,6 +670,24 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler(priority=EventPriority.LOW)
|
||||||
|
public void onServerCommand(ServerCommandEvent ev) {
|
||||||
|
log(ev.getSender().getName()+" is Executing Command: "+ev.getCommand(),3);
|
||||||
|
String msg = "";
|
||||||
|
if (ev.getCommand().equalsIgnoreCase("stop") || ev.getCommand().equalsIgnoreCase("restart")) {
|
||||||
|
msg = "Server is shutting down...";
|
||||||
|
}/* else
|
||||||
|
if (ev.getCommand().equalsIgnoreCase("reload")) {
|
||||||
|
msg = "Server plugins have been reloaded.";
|
||||||
|
}*/ //
|
||||||
|
if (!msg.equalsIgnoreCase("")) {
|
||||||
|
if (SERVER_TYPE==ServerType.MAIN) {
|
||||||
|
DiscordMessageSender.sendItalicizedRawMessageDiscord(SERVER_TYPE.GetServerName()+msg);
|
||||||
|
}
|
||||||
|
Bukkit.broadcastMessage(msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler(priority=EventPriority.LOW)
|
@EventHandler(priority=EventPriority.LOW)
|
||||||
public void onWorldSave(WorldSaveEvent ev) {
|
public void onWorldSave(WorldSaveEvent ev) {
|
||||||
saveOurData();
|
saveOurData();
|
||||||
@ -1217,7 +1257,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
ev.setCancelled(true);
|
ev.setCancelled(true);
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
if (ev.getMessage().equalsIgnoreCase("()") || ev.getMessage().indexOf(" ()")>-1) {
|
if (ev.getMessage().equalsIgnoreCase("()") || ev.getMessage().indexOf(" ()")>-1 || (ev.getMessage().indexOf("() ")>-1 && ev.getMessage().indexOf("() ")==0)) {
|
||||||
ev.setMessage(ev.getMessage().replace("()", "("+ev.getPlayer().getLocation().getBlockX()+","+ev.getPlayer().getLocation().getBlockY()+","+ev.getPlayer().getLocation().getBlockZ()+")"));
|
ev.setMessage(ev.getMessage().replace("()", "("+ev.getPlayer().getLocation().getBlockX()+","+ev.getPlayer().getLocation().getBlockY()+","+ev.getPlayer().getLocation().getBlockZ()+")"));
|
||||||
}
|
}
|
||||||
for (int i=0;i<Bukkit.getOnlinePlayers().toArray().length;i++) {
|
for (int i=0;i<Bukkit.getOnlinePlayers().toArray().length;i++) {
|
||||||
@ -1229,7 +1269,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
}
|
}
|
||||||
int pos = -1;
|
int pos = -1;
|
||||||
log(ev.getMessage()+" "+ev.getMessage().indexOf(" []"),5);
|
log(ev.getMessage()+" "+ev.getMessage().indexOf(" []"),5);
|
||||||
if (ev.getMessage().equalsIgnoreCase("[]") || ev.getMessage().indexOf(" []")>-1) {
|
if (ev.getMessage().equalsIgnoreCase("[]") || ev.getMessage().indexOf(" []")>-1 || (ev.getMessage().indexOf("[] ")>-1 && ev.getMessage().indexOf("[] ")==0)) {
|
||||||
pos = ev.getMessage().indexOf("[]");
|
pos = ev.getMessage().indexOf("[]");
|
||||||
ev.setMessage(ev.getMessage().replace("[]", ""));
|
ev.setMessage(ev.getMessage().replace("[]", ""));
|
||||||
log("pos is "+pos+" message is: {"+ev.getMessage()+"}",5);
|
log("pos is "+pos+" message is: {"+ev.getMessage()+"}",5);
|
||||||
@ -4310,6 +4350,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
getConfig().set("WORLD_SHOP_ID", WORLD_SHOP_ID);
|
getConfig().set("WORLD_SHOP_ID", WORLD_SHOP_ID);
|
||||||
getConfig().set("LOGGING_LEVEL", LOGGING_LEVEL);
|
getConfig().set("LOGGING_LEVEL", LOGGING_LEVEL);
|
||||||
getConfig().set("ARTIFACT_RARITY", ARTIFACT_RARITY);
|
getConfig().set("ARTIFACT_RARITY", ARTIFACT_RARITY);
|
||||||
|
getConfig().set("SERVER_TYPE", SERVER_TYPE.GetValue());
|
||||||
//getConfig().set("MOTD", MOTD); //It makes no sense to save the MOTD as it will never be modified in-game.
|
//getConfig().set("MOTD", MOTD); //It makes no sense to save the MOTD as it will never be modified in-game.
|
||||||
saveConfig();
|
saveConfig();
|
||||||
|
|
||||||
@ -4358,6 +4399,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
getConfig().addDefault("WORLD_SHOP_ID", WORLD_SHOP_ID);
|
getConfig().addDefault("WORLD_SHOP_ID", WORLD_SHOP_ID);
|
||||||
getConfig().addDefault("LOGGING_LEVEL", LOGGING_LEVEL);
|
getConfig().addDefault("LOGGING_LEVEL", LOGGING_LEVEL);
|
||||||
getConfig().addDefault("ARTIFACT_RARITY", ARTIFACT_RARITY);
|
getConfig().addDefault("ARTIFACT_RARITY", ARTIFACT_RARITY);
|
||||||
|
getConfig().addDefault("SERVER_TYPE", SERVER_TYPE.GetValue());
|
||||||
getConfig().options().copyDefaults(true);
|
getConfig().options().copyDefaults(true);
|
||||||
saveConfig();
|
saveConfig();
|
||||||
SERVERTICK = getConfig().getLong("SERVERTICK");
|
SERVERTICK = getConfig().getLong("SERVERTICK");
|
||||||
@ -4386,23 +4428,24 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
WORLD_SHOP_ID = getConfig().getInt("WORLD_SHOP_ID");
|
WORLD_SHOP_ID = getConfig().getInt("WORLD_SHOP_ID");
|
||||||
LOGGING_LEVEL = getConfig().getInt("LOGGING_LEVEL");
|
LOGGING_LEVEL = getConfig().getInt("LOGGING_LEVEL");
|
||||||
ARTIFACT_RARITY = getConfig().getDouble("ARTIFACT_RARITY");
|
ARTIFACT_RARITY = getConfig().getDouble("ARTIFACT_RARITY");
|
||||||
|
SERVER_TYPE = ServerType.GetTypeFromValue(getConfig().getInt("SERVER_TYPE"));
|
||||||
getMOTD();
|
getMOTD();
|
||||||
|
|
||||||
//Informational reports to the console.
|
//Informational reports to the console.
|
||||||
getLogger().info("[CONFIG] SERVERTICK set to "+SERVERTICK+".");
|
log("[CONFIG] Server Type is set to "+SERVER_TYPE+".",2);
|
||||||
getLogger().info("[CONFIG] SPEED of Day/Night Cycles are x"+DAYMULT);
|
log("[CONFIG] SERVERTICK set to "+SERVERTICK+".",3);
|
||||||
getLogger().info("[CONFIG] Server will auto-save configs every "+SERVERCHECKERTICKS+" ticks.");
|
log("[CONFIG] SPEED of Day/Night Cycles are x"+DAYMULT,3);
|
||||||
getLogger().info("[CONFIG] Withdraw/Deposit terminals can be used for "+TERMINALTIME+" ticks.");
|
log("[CONFIG] Server will auto-save configs every "+SERVERCHECKERTICKS+" ticks.",3);
|
||||||
getLogger().info("[CONFIG] Death Penalty is "+DEATHPENALTY+"% of holding money.");
|
log("[CONFIG] Withdraw/Deposit terminals can be used for "+TERMINALTIME+" ticks.",4);
|
||||||
getLogger().info("[CONFIG] Chance to Recycle an Item on Despawn: "+RECYCLECHANCE+"%. Decay AMT: "+RECYCLEDECAYAMT+"%.");
|
log("[CONFIG] Death Penalty is "+DEATHPENALTY+"% of holding money.",4);
|
||||||
getLogger().info("[CONFIG] Item Cube ID is currently at "+ITEMCUBEID+". World Shop ID is at "+WORLD_SHOP_ID);
|
log("[CONFIG] Chance to Recycle an Item on Despawn: "+RECYCLECHANCE+"%. Decay AMT: "+RECYCLEDECAYAMT+"%.",4);
|
||||||
getLogger().info("[CONFIG] Health Regeneration Rate is "+HEALTH_REGENERATION_RATE+" ticks per heal.");
|
log("[CONFIG] Item Cube ID is currently at "+ITEMCUBEID+". World Shop ID is at "+WORLD_SHOP_ID,5);
|
||||||
getLogger().info("[CONFIG] Food healing amount is "+FOOD_HEAL_AMT+" health per food item.");
|
log("[CONFIG] Health Regeneration Rate is "+HEALTH_REGENERATION_RATE+" ticks per heal.",4);
|
||||||
getLogger().info("[CONFIG] Enemy Damage Multiplier x"+ENEMY_DMG_MULT+". Explosion Damage Multiplier x"+EXPLOSION_DMG_MULT);
|
log("[CONFIG] Enemy Damage Multiplier x"+ENEMY_DMG_MULT+". Explosion Damage Multiplier x"+EXPLOSION_DMG_MULT,3);
|
||||||
getLogger().info("[CONFIG] Headshots have to be "+(HEADSHOT_ACC*100)+"% accurate.");
|
log("[CONFIG] Headshots have to be "+(HEADSHOT_ACC*100)+"% accurate.",4);
|
||||||
getLogger().info("[CONFIG] Rare Drop Rate is currently "+(RARE_DROP_RATE*100)+"%. Artifact Drop Rarity is x"+ARTIFACT_RARITY);
|
log("[CONFIG] Rare Drop Rate is currently "+(RARE_DROP_RATE*100)+"%. Artifact Drop Rarity is x"+ARTIFACT_RARITY,5);
|
||||||
getLogger().info("[CONFIG] Party Chunk Size Detection is set to "+(PARTY_CHUNK_SIZE)+" chunks.");
|
log("[CONFIG] Party Chunk Size Detection is set to "+(PARTY_CHUNK_SIZE)+" chunks.",5);
|
||||||
getLogger().info("[CONFIG] XP Conversion rate is $"+XP_CONVERSION_RATE+" per XP Point.");
|
log("[CONFIG] XP Conversion rate is $"+XP_CONVERSION_RATE+" per XP Point.",5);
|
||||||
getLogger().info("[CONFIG] Console Logging Level set to "+LOGGING_LEVEL+".");
|
getLogger().info("[CONFIG] Console Logging Level set to "+LOGGING_LEVEL+".");
|
||||||
log("----------TwosideKeeper----------",5);
|
log("----------TwosideKeeper----------",5);
|
||||||
log("You are running version _"+Bukkit.getPluginManager().getPlugin("TwosideKeeper").getDescription().getVersion()+"_ of TwosideKeeper.",5);
|
log("You are running version _"+Bukkit.getPluginManager().getPlugin("TwosideKeeper").getDescription().getVersion()+"_ of TwosideKeeper.",5);
|
||||||
@ -5449,4 +5492,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public static ServerType getServerType() {
|
||||||
|
return SERVER_TYPE;
|
||||||
|
}
|
||||||
}
|
}
|
@ -11,6 +11,7 @@ import org.bukkit.inventory.ItemStack;
|
|||||||
import sig.plugin.TwosideKeeper.HelperStructures.ArtifactItem;
|
import sig.plugin.TwosideKeeper.HelperStructures.ArtifactItem;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.MonsterDifficulty;
|
import sig.plugin.TwosideKeeper.HelperStructures.MonsterDifficulty;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.MonsterType;
|
import sig.plugin.TwosideKeeper.HelperStructures.MonsterType;
|
||||||
|
import sig.plugin.TwosideKeeper.HelperStructures.ServerType;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
|
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
|
||||||
|
|
||||||
public final class TwosideKeeperAPI {
|
public final class TwosideKeeperAPI {
|
||||||
@ -60,6 +61,9 @@ public final class TwosideKeeperAPI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Artifact Commands.
|
//Artifact Commands.
|
||||||
|
public static boolean isArtifactItem(ItemStack item) {
|
||||||
|
return Artifact.isArtifact(item);
|
||||||
|
}
|
||||||
public static ItemStack dropArtifactItem(ArtifactItem type) {
|
public static ItemStack dropArtifactItem(ArtifactItem type) {
|
||||||
return Artifact.createArtifactItem(type);
|
return Artifact.createArtifactItem(type);
|
||||||
}
|
}
|
||||||
@ -83,6 +87,11 @@ public final class TwosideKeeperAPI {
|
|||||||
return GenericFunctions.breakHardenedItem(i,p);
|
return GenericFunctions.breakHardenedItem(i,p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Server COMMANDS.
|
||||||
|
public static ServerType getServerType() {
|
||||||
|
return TwosideKeeper.getServerType();
|
||||||
|
}
|
||||||
|
|
||||||
//Combat COMMANDS.
|
//Combat COMMANDS.
|
||||||
public static double getModifiedDamage(double dmg_amt, LivingEntity p) {
|
public static double getModifiedDamage(double dmg_amt, LivingEntity p) {
|
||||||
return TwosideKeeper.CalculateDamageReduction(dmg_amt, p, p);
|
return TwosideKeeper.CalculateDamageReduction(dmg_amt, p, p);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user