mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-29 16:46:46 +01:00
All changes up to 0.8.5
This commit is contained in:
parent
bf328555dd
commit
4d09cab58d
@ -30,6 +30,7 @@ public class mcMMO extends JavaPlugin {
|
|||||||
private final mcPlayerListener playerListener = new mcPlayerListener(this);
|
private final mcPlayerListener playerListener = new mcPlayerListener(this);
|
||||||
private final mcBlockListener blockListener = new mcBlockListener(this);
|
private final mcBlockListener blockListener = new mcBlockListener(this);
|
||||||
private final mcEntityListener entityListener = new mcEntityListener(this);
|
private final mcEntityListener entityListener = new mcEntityListener(this);
|
||||||
|
private final mcServerListener serverListener = new mcServerListener(this);
|
||||||
private final HashMap<Player, Boolean> debugees = new HashMap<Player, Boolean>();
|
private final HashMap<Player, Boolean> debugees = new HashMap<Player, Boolean>();
|
||||||
private final String name = "mcMMO";
|
private final String name = "mcMMO";
|
||||||
public static PermissionHandler PermissionsHandler = null;
|
public static PermissionHandler PermissionsHandler = null;
|
||||||
@ -53,27 +54,6 @@ public class mcMMO extends JavaPlugin {
|
|||||||
FileWriter writer = null;
|
FileWriter writer = null;
|
||||||
try {
|
try {
|
||||||
writer = new FileWriter(Properties);
|
writer = new FileWriter(Properties);
|
||||||
writer.append("#Turn this setting to false to disable pvp interactions completely");
|
|
||||||
writer.append("pvp=true");
|
|
||||||
writer.append("#Excavation Loot Toggles");
|
|
||||||
writer.append("eggs=true");
|
|
||||||
writer.append("apples=true");
|
|
||||||
writer.append("cake=true");
|
|
||||||
writer.append("music=true");
|
|
||||||
writer.append("diamond=true");
|
|
||||||
writer.append("glowstone=true");
|
|
||||||
writer.append("slowsand=true");
|
|
||||||
writer.append("netherrack=true");
|
|
||||||
writer.append("bones=true");
|
|
||||||
writer.append("sulphur=true");
|
|
||||||
writer.append("coal=true");
|
|
||||||
writer.append("mcmmo=mcmmo");
|
|
||||||
writer.append("mcc=mcc");
|
|
||||||
writer.append("stats=stats");
|
|
||||||
writer.append("clay=true");
|
|
||||||
writer.append("anvilmessages=true");
|
|
||||||
writer.append("xpmodifier=2");
|
|
||||||
writer.append("#Appreciate the plugin? Send me a donation via paypal nossr50@gmail.com\r\n");
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.log(Level.SEVERE, "Exception while creating " + Properties, e);
|
log.log(Level.SEVERE, "Exception while creating " + Properties, e);
|
||||||
} finally {
|
} finally {
|
||||||
@ -91,15 +71,17 @@ public class mcMMO extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//Load the file
|
//Load the file
|
||||||
|
//sup
|
||||||
mcLoadProperties.loadMain();
|
mcLoadProperties.loadMain();
|
||||||
mcUsers.getInstance().loadUsers();
|
mcUsers.getInstance().loadUsers();
|
||||||
PluginManager pm = getServer().getPluginManager();
|
PluginManager pm = getServer().getPluginManager();
|
||||||
pm.registerEvent(Event.Type.PLAYER_JOIN, playerListener, Priority.Normal, this);
|
pm.registerEvent(Event.Type.PLAYER_JOIN, playerListener, Priority.Normal, this);
|
||||||
|
pm.registerEvent(Event.Type.PLAYER_LOGIN, playerListener, Priority.Normal, this);
|
||||||
pm.registerEvent(Event.Type.PLAYER_DROP_ITEM, playerListener, Priority.Normal, this);
|
pm.registerEvent(Event.Type.PLAYER_DROP_ITEM, playerListener, Priority.Normal, this);
|
||||||
pm.registerEvent(Event.Type.PLAYER_QUIT, playerListener, Priority.Normal, this);
|
pm.registerEvent(Event.Type.PLAYER_QUIT, playerListener, Priority.Normal, this);
|
||||||
pm.registerEvent(Event.Type.PLAYER_COMMAND, playerListener, Priority.Normal, this);
|
|
||||||
pm.registerEvent(Event.Type.BLOCK_DAMAGED, blockListener, Priority.Normal, this);
|
pm.registerEvent(Event.Type.BLOCK_DAMAGED, blockListener, Priority.Normal, this);
|
||||||
pm.registerEvent(Event.Type.PLAYER_CHAT, playerListener, Priority.Monitor, this);
|
pm.registerEvent(Event.Type.PLAYER_CHAT, playerListener, Priority.Monitor, this);
|
||||||
|
pm.registerEvent(Event.Type.PLAYER_COMMAND_PREPROCESS, playerListener, Priority.Normal, this);
|
||||||
pm.registerEvent(Event.Type.ENTITY_DEATH, entityListener, Priority.Normal, this);
|
pm.registerEvent(Event.Type.ENTITY_DEATH, entityListener, Priority.Normal, this);
|
||||||
pm.registerEvent(Event.Type.BLOCK_FLOW, blockListener, Priority.Normal, this);
|
pm.registerEvent(Event.Type.BLOCK_FLOW, blockListener, Priority.Normal, this);
|
||||||
pm.registerEvent(Event.Type.BLOCK_PLACED, blockListener, Priority.Normal, this);
|
pm.registerEvent(Event.Type.BLOCK_PLACED, blockListener, Priority.Normal, this);
|
||||||
|
@ -14,6 +14,7 @@ import org.bukkit.event.player.PlayerEvent;
|
|||||||
import org.bukkit.event.player.PlayerItemEvent;
|
import org.bukkit.event.player.PlayerItemEvent;
|
||||||
import org.bukkit.event.player.PlayerItemHeldEvent;
|
import org.bukkit.event.player.PlayerItemHeldEvent;
|
||||||
import org.bukkit.event.player.PlayerListener;
|
import org.bukkit.event.player.PlayerListener;
|
||||||
|
import org.bukkit.event.player.PlayerLoginEvent;
|
||||||
import org.bukkit.plugin.*;
|
import org.bukkit.plugin.*;
|
||||||
import org.bukkit.event.player.PlayerRespawnEvent;
|
import org.bukkit.event.player.PlayerRespawnEvent;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
@ -85,9 +86,12 @@ public class mcPlayerListener extends PlayerListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void onPlayerJoin(PlayerEvent event) {
|
public void onPlayerLogin(PlayerLoginEvent event) {
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
mcUsers.addUser(player);
|
mcUsers.addUser(player);
|
||||||
|
}
|
||||||
|
public void onPlayerJoin(PlayerEvent event) {
|
||||||
|
Player player = event.getPlayer();
|
||||||
if(mcPermissions.getInstance().motd(player)){
|
if(mcPermissions.getInstance().motd(player)){
|
||||||
player.sendMessage(ChatColor.BLUE + "This server is running mcMMO "+plugin.getDescription().getVersion()+" type /"+ChatColor.YELLOW+mcLoadProperties.mcmmo+ChatColor.BLUE+ " for help.");
|
player.sendMessage(ChatColor.BLUE + "This server is running mcMMO "+plugin.getDescription().getVersion()+" type /"+ChatColor.YELLOW+mcLoadProperties.mcmmo+ChatColor.BLUE+ " for help.");
|
||||||
}
|
}
|
||||||
@ -109,8 +113,7 @@ public class mcPlayerListener extends PlayerListener {
|
|||||||
mcm.getInstance().repairCheck(player, is, block);
|
mcm.getInstance().repairCheck(player, is, block);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public void onPlayerCommandPreprocess(PlayerChatEvent event) {
|
||||||
public void onPlayerCommand(PlayerChatEvent event) {
|
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
String[] split = event.getMessage().split(" ");
|
String[] split = event.getMessage().split(" ");
|
||||||
String playerName = player.getName();
|
String playerName = player.getName();
|
||||||
@ -448,8 +451,7 @@ public class mcPlayerListener extends PlayerListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void onPlayerChat(PlayerChatEvent event) {
|
public void onPlayerChat(PlayerChatEvent event) {
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
String[] split = event.getMessage().split(" ");
|
|
||||||
String x = ChatColor.GREEN + "(" + ChatColor.WHITE + player.getName() + ChatColor.GREEN + ") ";
|
String x = ChatColor.GREEN + "(" + ChatColor.WHITE + player.getName() + ChatColor.GREEN + ") ";
|
||||||
String y = ChatColor.AQUA + "{" + ChatColor.WHITE + player.getName() + ChatColor.AQUA + "} ";
|
String y = ChatColor.AQUA + "{" + ChatColor.WHITE + player.getName() + ChatColor.AQUA + "} ";
|
||||||
if(mcConfig.getInstance().isPartyToggled(player.getName())){
|
if(mcConfig.getInstance().isPartyToggled(player.getName())){
|
||||||
|
19
mcMMO/com/gmail/nossr50/mcServerListener.java
Normal file
19
mcMMO/com/gmail/nossr50/mcServerListener.java
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
package com.gmail.nossr50;
|
||||||
|
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.event.server.ServerCommandEvent;
|
||||||
|
import org.bukkit.event.server.ServerListener;
|
||||||
|
|
||||||
|
public class mcServerListener extends ServerListener{
|
||||||
|
protected static final Logger log = Logger.getLogger("Minecraft");
|
||||||
|
public Location spawn = null;
|
||||||
|
private mcMMO plugin;
|
||||||
|
|
||||||
|
public mcServerListener(mcMMO instance) {
|
||||||
|
plugin = instance;
|
||||||
|
}
|
||||||
|
public void onServerCommand(ServerCommandEvent event) {
|
||||||
|
}
|
||||||
|
}
|
@ -18,8 +18,6 @@ public class mcTimer extends TimerTask{
|
|||||||
public void run() {
|
public void run() {
|
||||||
if(thecount == 5 || thecount == 10 || thecount == 15 || thecount == 20){
|
if(thecount == 5 || thecount == 10 || thecount == 15 || thecount == 20){
|
||||||
for(Player player : plugin.getServer().getOnlinePlayers()){
|
for(Player player : plugin.getServer().getOnlinePlayers()){
|
||||||
//Add the user to the file so we don't create null exception error
|
|
||||||
mcUsers.addUser(player);
|
|
||||||
if(player != null &&
|
if(player != null &&
|
||||||
player.getHealth() > 0 && player.getHealth() < 20
|
player.getHealth() > 0 && player.getHealth() < 20
|
||||||
&& mcUsers.getProfile(player).getPowerLevel() >= 1000
|
&& mcUsers.getProfile(player).getPowerLevel() >= 1000
|
||||||
@ -52,6 +50,11 @@ public class mcTimer extends TimerTask{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for(Player player : plugin.getServer().getOnlinePlayers()){
|
||||||
|
if(player != null){
|
||||||
|
mcUsers.getProfile(player).decreaseLastHurt();
|
||||||
|
}
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
* RESET THE COUNT
|
* RESET THE COUNT
|
||||||
*/
|
*/
|
||||||
@ -60,13 +63,6 @@ public class mcTimer extends TimerTask{
|
|||||||
} else {
|
} else {
|
||||||
thecount = 1;
|
thecount = 1;
|
||||||
}
|
}
|
||||||
for(Player player : plugin.getServer().getOnlinePlayers()){
|
|
||||||
if(player == null)
|
|
||||||
continue;
|
|
||||||
if(player != null
|
|
||||||
&& mcUsers.getProfile(player).getRecentlyHurt() >= 1)
|
|
||||||
mcUsers.getProfile(player).decreaseLastHurt();
|
|
||||||
}
|
|
||||||
mcm.getInstance().bleedSimulate(plugin);
|
mcm.getInstance().bleedSimulate(plugin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
name: mcMMO
|
name: mcMMO
|
||||||
main: com.gmail.nossr50.mcMMO
|
main: com.gmail.nossr50.mcMMO
|
||||||
version: 0.8.4
|
version: 0.8.5
|
Loading…
Reference in New Issue
Block a user