Minecraft OneWayNether mod 2026 download
logo
minecraft mod OneWayNether

OneWayNether

Game Version: 1.6.2
Total Downloads: 796
Updated: Aug 1, 2013
Created: Aug 1, 2013
Download OneWayNetherDownload Earlier Versions

Earlier Versions

Name Size Uploaded Game Version Downloads
OneWayNether v1.0 release 4.83 KB Aug 1, 2013 1.6.2 796 download OneWayNether OneWayNether v1.0 releaseDownload

Description

Share this:

Description

This plugin denies people from using the Portal in the nether to prevent griefers walking into other people's bases.

Forum

http://forums.bukkit.org/threads/one-way-nether.164270/

Config

You can change the message, people recieving when entering the portal in the config.

locale:
  deny: You are not allowed to go back from the nether!

Permission

The permission node to bypass this is

onewaynether.bypass

Source

import org.bukkit.World.Environment;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.HandlerList;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerPortalEvent;
import org.bukkit.plugin.java.JavaPlugin;

public class OneWayNether extends JavaPlugin implements Listener {
	public static final String LOCALE_DENY = "locale.deny";

	public void onEnable() {
		this.getServer().getPluginManager().registerEvents(this, this);

		this.getConfig().addDefault(LOCALE_DENY,
				"You are not allowed to go back from the nether!");
		this.getConfig().options().copyDefaults(true);
		this.saveConfig();
	}

	public void onDisable() {
		HandlerList.unregisterAll((Listener) this);
	}

	@EventHandler
	public void onPlayerPortal(PlayerPortalEvent event) {
		Player p = event.getPlayer();
		if (p.hasPermission("onewaynether.bypass") || p.isOp())
			return;
		if (!event.getFrom().getWorld().getEnvironment()
				.equals(Environment.NETHER))
			return;
		if (!event.getTo().getWorld().getEnvironment()
				.equals(Environment.NORMAL))
			return;
		p.sendMessage(this.getConfig().getString(LOCALE_DENY));
		this.getLogger()
				.info(p.getName()
						+ " tried to get from the nether to the normal world but was denied.");
		event.setCancelled(true);
	}

}

Comments

Add a comment