mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-12-27 19:17:44 +01:00
Added basic functionality of Hardcore Mode, needs testing...
This commit is contained in:
parent
323b41fd58
commit
1fa4fccbcc
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -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");
|
||||
}
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user