Added basic functionality of Hardcore Mode, needs testing...

This commit is contained in:
nossr50 2012-04-30 06:39:30 -07:00
parent 323b41fd58
commit 1fa4fccbcc
3 changed files with 6 additions and 32 deletions

View File

@ -1,32 +0,0 @@
package com.gmail.nossr50.listeners;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import com.gmail.nossr50.events.experience.McMMOPlayerXpGainEvent;
/**
* Listener for listening to our own events, only really useful for catching errors
*/
public class SelfListener implements Listener {
/**
* Monitor internal XP gain events.
*
* @param event The event to watch
*/
@EventHandler
public void onPlayerXpGain(McMMOPlayerXpGainEvent event) {
int xp = event.getXpGained();
if(xp < 0) {
try {
throw new Exception("Gained negative XP!");
}
catch (Exception e) {
System.out.println(e.getMessage());
e.printStackTrace();
}
}
}
}

View File

@ -32,6 +32,9 @@ public class Permissions {
/*
* MCMMO.BYPASS.*
*/
public boolean hardcoremodeBypass(Player player) {
return player.hasPermission("mcmmo.bypass.hardcoremode");
}
public boolean arcaneBypass(Player player) {
return player.hasPermission("mcmmo.bypass.arcanebypass");
}

View File

@ -142,9 +142,12 @@ permissions:
mcmmo.bypass.*:
description: Implies all bypass permissions.
children:
mcmmo.bypass.hardcoremode: true
mcmmo.bypass.arcanebypass: true
mcmmo.bypass.inspect.distance: true
mcmmo.bypass.inspect.offline: true
mcmmo.bypass.hardcoremode:
description: Allows user to bypass the negative effects of death from Hardcore mode
mcmmo.bypass.arcanebypass:
description: Allows user to bypass Arcane Repair so he will never lose enchantments
mcmmo.bypass.inspect.distance: