Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified builds/murAPI.jar
Binary file not shown.
14 changes: 12 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<!--
~ Copyright (c) 2016
~
~ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
~
~ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
~
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-->

<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

Expand Down
23 changes: 16 additions & 7 deletions src/main/java/me/jdog/murapi/MurAPI.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
/*
* Copyright (c) 2016
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

package me.jdog.murapi;

import com.connorlinfoot.bountifulapi.Actionbar;
import me.jdog.murapi.api.config.Config;
import me.jdog.murapi.api.cmd.CMDManager;
import me.jdog.murapi.api.cmd.Mur;
import me.jdog.murapi.api.config.Config;
import me.jdog.murapi.api.gui.GuiManager;
import me.jdog.murapi.api.logger.LogType;
import me.jdog.murapi.api.logger.Logger;
Expand All @@ -16,26 +26,25 @@
* Created by Muricans on 11/19/16.
*/
public class MurAPI extends JavaPlugin {
public static String sv_version = Bukkit.getServer().getVersion();
/**
* An instance of the class MurAPI.
*/
private static MurAPI instance;
public Config config = new Config(this, "config.yml");
private Logger logger = Logger.getInstance();

public static MurAPI getInstance() {
return instance;
}

public static String sv_version = Bukkit.getServer().getVersion();
private Logger logger = Logger.getInstance();
public Config config = new Config(this, "config.yml");


@Override
public void onEnable() {
instance = this;

config.create();
config.addDefault("debug", true);
if(config.getBoolean("debug")) {
if (config.getBoolean("debug")) {
getLogger().log(Level.CONFIG, "Debug mode: TRUE");
} else if (!config.getBoolean("debug")) {
getLogger().log(Level.CONFIG, "Debug mode: FALSE");
Expand Down
14 changes: 11 additions & 3 deletions src/main/java/me/jdog/murapi/api/Color.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
/*
* Copyright (c) 2016
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

package me.jdog.murapi.api;

import org.bukkit.ChatColor;
Expand All @@ -8,7 +18,6 @@
*/
public class Color {
/**
*
* @param text The text to add color.
* @return Returns the text with color.
*/
Expand All @@ -17,8 +26,7 @@ public static String addColor(String text) {
}

/**
*
* @param text The line of the config to add color.
* @param text The line of the config to add color.
* @param plugin The plugins main class.
* @return The line from config with color.
*/
Expand Down
12 changes: 10 additions & 2 deletions src/main/java/me/jdog/murapi/api/Packet.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
/*
* Copyright (c) 2016
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

package me.jdog.murapi.api;

import org.bukkit.Bukkit;
Expand All @@ -9,7 +19,6 @@
public class Packet {

/**
*
* @param player The player to send the packet to.
* @param packet The packet to send.
*/
Expand All @@ -24,7 +33,6 @@ public static void sendPacket(Player player, Object packet) {
}

/**
*
* @param name Class name.
* @return The class.
*/
Expand Down
45 changes: 26 additions & 19 deletions src/main/java/me/jdog/murapi/api/Title.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
/*
* Copyright (c) 2016
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

package me.jdog.murapi.api;

import org.bukkit.entity.Player;
Expand All @@ -10,12 +20,11 @@
public class Title {

/**
*
* @param player The player to send the title to.
* @param text The text of the title.
* @param fadeI Fade in.
* @param time The time it should stay.
* @param fadeO Fade out.
* @param text The text of the title.
* @param fadeI Fade in.
* @param time The time it should stay.
* @param fadeO Fade out.
*/
public static void sendTitle(Player player, String text, int fadeI, int time, int fadeO) {
try {
Expand All @@ -30,12 +39,11 @@ public static void sendTitle(Player player, String text, int fadeI, int time, in
}

/**
*
* @param player The player to send the subtitle to.
* @param text The text of the subtitle.
* @param fadeI Fade in.
* @param time The time it should stay.
* @param fadeO Fade out.
* @param text The text of the subtitle.
* @param fadeI Fade in.
* @param time The time it should stay.
* @param fadeO Fade out.
*/
public static void sendSubtitle(Player player, String text, int fadeI, int time, int fadeO) {
try {
Expand All @@ -50,21 +58,20 @@ public static void sendSubtitle(Player player, String text, int fadeI, int time,
}

/**
*
* @param player The player to send the title and subtitle to.
* @param titleText The text of the title.
* @param player The player to send the title and subtitle to.
* @param titleText The text of the title.
* @param subtitleText The text of the subtitle.
* @param fadeI Fade in.
* @param time The time it should stay.
* @param fadeO Fade out.
* @param fadeI Fade in.
* @param time The time it should stay.
* @param fadeO Fade out.
*/
public static void sendTitle(Player player, String titleText, String subtitleText, int fadeI, int time, int fadeO) {
if(titleText != null && subtitleText != null) {
if (titleText != null && subtitleText != null) {
sendTitle(player, titleText, fadeI, time, fadeO);
sendSubtitle(player, subtitleText, fadeI, time, fadeO);
} else if(titleText == null && subtitleText != null) {
} else if (titleText == null && subtitleText != null) {
sendSubtitle(player, subtitleText, fadeI, time, fadeO);
} else if(titleText != null && subtitleText == null) {
} else if (titleText != null && subtitleText == null) {
sendTitle(player, titleText, fadeI, time, fadeO);
}
}
Expand Down
15 changes: 12 additions & 3 deletions src/main/java/me/jdog/murapi/api/Utilities.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
/*
* Copyright (c) 2016
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

package me.jdog.murapi.api;

import org.bukkit.Bukkit;
Expand All @@ -8,14 +18,15 @@
*/
public class Utilities {
private static Utilities instance = new Utilities();

private Utilities() {
}

public static Utilities getInstance() {
return instance;
}

/**
*
* @param plugin The plugins main class.
* @return The plugins version.
*/
Expand All @@ -24,15 +35,13 @@ public String getVersion(Plugin plugin) {
}

/**
*
* @return The server version.
*/
public String getServerVersion() {
return Bukkit.getServer().getVersion();
}

/**
*
* @return The bukkit version of the server.
*/
public String getBukkitVersion() {
Expand Down
23 changes: 14 additions & 9 deletions src/main/java/me/jdog/murapi/api/cmd/CMD.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
/*
* Copyright (c) 2016
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

package me.jdog.murapi.api.cmd;

import me.jdog.murapi.api.Utilities;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;

Expand All @@ -11,35 +20,31 @@ public abstract class CMD {
private String name;

/**
*
* @param name The commands name.
*/
public CMD(String name) {
this.name = name;
this.name = name;
}

/**
*
* @return Return the name of the command.
*/
public String getName() {
return name;
}

/**
*
* @param name The commands name.
*/
public void setName(String name) {
this.name = name;
}

/**
*
* @param sender The sender of the command.
* @param sender The sender of the command.
* @param command The command itself.
* @param label The commands label.
* @param args The commands args.
* @param label The commands label.
* @param args The commands args.
* @return True or false
*/
public abstract boolean execute(CommandSender sender, Command command, String label, String[] args);
Expand Down
19 changes: 13 additions & 6 deletions src/main/java/me/jdog/murapi/api/cmd/CMDManager.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
/*
* Copyright (c) 2016
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

package me.jdog.murapi.api.cmd;

import me.jdog.murapi.MurAPI;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
Expand All @@ -20,7 +29,6 @@ public CMDManager() {


/**
*
* @param id The ID of the command.
* @return Return the command that holds the specified ID
*/
Expand All @@ -30,8 +38,7 @@ public static CMD getCMD(int id) {


/**
*
* @param id ID to get that command.
* @param id ID to get that command.
* @param cmd The command.
*/
public static void registerCommand(int id, CMD cmd) {
Expand All @@ -40,8 +47,8 @@ public static void registerCommand(int id, CMD cmd) {

@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
for(CMD c : cmdBaseMap.values()) {
if(command.getName().equalsIgnoreCase(c.getName())) {
for (CMD c : cmdBaseMap.values()) {
if (command.getName().equalsIgnoreCase(c.getName())) {
c.execute(sender, command, label, args);
return true;
}
Expand Down
Loading