/*
 * NetherFeature.java
 *
 * Copyright (c) 2014 Graham Howden <graham_howden1 at yahoo.co.uk>.
 *
 * This file is part of UltraHardcore.
 *
 * UltraHardcore is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * UltraHardcore is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with UltraHardcore.  If not, see <http ://www.gnu.org/licenses/>.
 */

package com.publicuhc.ultrahardcore.pluginfeatures.nether;

import com.publicuhc.pluginframework.configuration.Configurator;
import com.publicuhc.pluginframework.shaded.inject.Inject;
import com.publicuhc.pluginframework.shaded.inject.Singleton;
import com.publicuhc.pluginframework.translate.Translate;
import com.publicuhc.ultrahardcore.pluginfeatures.UHCFeature;
import org.bukkit.World;
import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.EntityPortalEvent;
import org.bukkit.permissions.Permissible;
import org.bukkit.plugin.Plugin;


/**
 * NetherFeature
 *
 * @author ghowden
 */
@Singleton
public class NetherFeature extends UHCFeature {

    public static final String ALLOW_NETHER = BASE_PERMISSION+"nether.allow";

    /**
     * Stops travelling to the nether when enabled
     * @param plugin the plugin
     * @param configManager the config manager
     * @param translate the translator
     */
    @Inject
    private NetherFeature(Plugin plugin, Configurator configManager, Translate translate) {
        super(plugin, configManager, translate);
    }

    /**
     * On portal events
     * @param epe related event
     */
    @EventHandler
    public void onPortalEvent(EntityPortalEvent epe) {
        //if it's enabled
        if (isEnabled() && epe.getEntity() instanceof Permissible) {
            //if they're going into the nether cancel it
            if(((Permissible) epe.getEntity()).hasPermission(ALLOW_NETHER)){
                return;
            }
            if (epe.getTo().getWorld().getEnvironment() == World.Environment.NETHER) {
                epe.setCancelled(true);
            }
        }
    }

    @Override
    public String getFeatureID() {
        return "NetherFeature";
    }

    @Override
    public String getDescription() {
        return "Disables the use of nether portals";
    }
}

@@ -891,213 +891,31 @@
 ork.
-configuration.Configurator;%0Aimport com.publicuhc.pluginframework.shaded.inject.Inject;%0Aimport com.publicuhc.pluginframework.shaded.inject.Singleton;%0Aimport com.publicuhc.pluginframework.translate.Translate
+shaded.inject.Singleton
 ;%0Aim
@@ -939,38 +939,32 @@
 c.ultrahardcore.
-plugin
 features.UHCFeat
@@ -1128,85 +1128,101 @@
 le;%0A
-import org.bukkit.plugin.Plugin;%0A%0A%0A/**%0A * NetherFeature%0A *%0A * @author ghowden
+%0A/**%0A * NetherFeature%0A *%0A * Enabled: Disables travelling into the nether%0A * Disabled: Nothing
 %0A */
@@ -1332,25 +1332,13 @@
 R = 
-BASE_PERMISSION+%22
+%22UHC.
 neth
@@ -1353,425 +1353,8 @@
 %22;%0A%0A
-    /**%0A     * Stops travelling to the nether when enabled%0A     * @param plugin the plugin%0A     * @param configManager the config manager%0A     * @param translate the translator%0A     */%0A    @Inject%0A    private NetherFeature(Plugin plugin, Configurator configManager, Translate translate) %7B%0A        super(plugin, configManager, translate);%0A    %7D%0A%0A    /**%0A     * On portal events%0A     * @param epe related event%0A     */%0A
     
@@ -1589,16 +1589,17 @@
      if(
+!
 ((Permis
@@ -1654,48 +1654,15 @@
 ER))
+ 
 %7B%0A    
-            return;%0A            %7D%0A
     
@@ -1760,16 +1760,20 @@
         
+    
 epe.setC
@@ -1788,16 +1788,34 @@
 (true);%0A
+                %7D%0A
         

update the nether feature