v0.4.2
This commit is contained in:
@@ -14,6 +14,7 @@ import org.bukkit.plugin.Plugin;
|
|||||||
import org.bukkit.plugin.PluginDescriptionFile;
|
import org.bukkit.plugin.PluginDescriptionFile;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
|
import com.majinnaibu.bukkit.plugins.metropolis.commands.MetropolisFlagResetCommand;
|
||||||
import com.majinnaibu.bukkit.plugins.metropolis.commands.MetropolisHomeGenerateCommand;
|
import com.majinnaibu.bukkit.plugins.metropolis.commands.MetropolisHomeGenerateCommand;
|
||||||
import com.majinnaibu.bukkit.plugins.metropolis.commands.MetropolisHomeListCommand;
|
import com.majinnaibu.bukkit.plugins.metropolis.commands.MetropolisHomeListCommand;
|
||||||
import com.sk89q.worldedit.BlockVector;
|
import com.sk89q.worldedit.BlockVector;
|
||||||
@@ -116,6 +117,7 @@ public class MetropolisPlugin extends JavaPlugin {
|
|||||||
|
|
||||||
getCommand("metropolis-home-generate").setExecutor(new MetropolisHomeGenerateCommand(this));
|
getCommand("metropolis-home-generate").setExecutor(new MetropolisHomeGenerateCommand(this));
|
||||||
getCommand("metropolis-home-list").setExecutor(new MetropolisHomeListCommand(this));
|
getCommand("metropolis-home-list").setExecutor(new MetropolisHomeListCommand(this));
|
||||||
|
getCommand("metropolis-flag-reset").setExecutor(new MetropolisFlagResetCommand(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -0,0 +1,53 @@
|
|||||||
|
package com.majinnaibu.bukkit.plugins.metropolis.commands;
|
||||||
|
|
||||||
|
import org.bukkit.command.Command;
|
||||||
|
import org.bukkit.command.CommandExecutor;
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
||||||
|
import com.majinnaibu.bukkit.plugins.metropolis.MetropolisPlugin;
|
||||||
|
import com.sk89q.worldguard.protection.flags.DefaultFlag;
|
||||||
|
import com.sk89q.worldguard.protection.flags.StateFlag;
|
||||||
|
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
||||||
|
|
||||||
|
public class MetropolisFlagResetCommand implements CommandExecutor {
|
||||||
|
private MetropolisPlugin _plugin;
|
||||||
|
|
||||||
|
public MetropolisFlagResetCommand(MetropolisPlugin plugin){
|
||||||
|
_plugin = plugin;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||||
|
ProtectedRegion cityRegion = _plugin.regionManager.getRegion("City");
|
||||||
|
cityRegion.setFlag(DefaultFlag.PVP, StateFlag.State.DENY);
|
||||||
|
cityRegion.setFlag(DefaultFlag.MOB_DAMAGE, StateFlag.State.DENY);
|
||||||
|
cityRegion.setFlag(DefaultFlag.MOB_SPAWNING, StateFlag.State.DENY);
|
||||||
|
cityRegion.setFlag(DefaultFlag.CREEPER_EXPLOSION, StateFlag.State.DENY);
|
||||||
|
cityRegion.setFlag(DefaultFlag.ENDER_BUILD, StateFlag.State.DENY);
|
||||||
|
cityRegion.setFlag(DefaultFlag.GHAST_FIREBALL, StateFlag.State.DENY);
|
||||||
|
cityRegion.setFlag(DefaultFlag.TNT, StateFlag.State.DENY);
|
||||||
|
cityRegion.setFlag(DefaultFlag.LAVA_FLOW, StateFlag.State.DENY);
|
||||||
|
cityRegion.setFlag(DefaultFlag.SNOW_FALL, StateFlag.State.DENY);
|
||||||
|
|
||||||
|
for(ProtectedRegion homeRegion: _plugin.regionManager.getRegions().values()){
|
||||||
|
if(homeRegion.getId().startsWith("h_")){
|
||||||
|
homeRegion.setFlag(DefaultFlag.PVP, StateFlag.State.DENY);
|
||||||
|
homeRegion.setFlag(DefaultFlag.MOB_DAMAGE, StateFlag.State.DENY);
|
||||||
|
homeRegion.setFlag(DefaultFlag.MOB_SPAWNING, StateFlag.State.DENY);
|
||||||
|
homeRegion.setFlag(DefaultFlag.CREEPER_EXPLOSION, StateFlag.State.DENY);
|
||||||
|
homeRegion.setFlag(DefaultFlag.ENDER_BUILD, StateFlag.State.DENY);
|
||||||
|
homeRegion.setFlag(DefaultFlag.GHAST_FIREBALL, StateFlag.State.DENY);
|
||||||
|
homeRegion.setFlag(DefaultFlag.TNT, StateFlag.State.DENY);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sender.sendMessage("Metropolis: flags have been reset");
|
||||||
|
|
||||||
|
return true;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -3,7 +3,6 @@ package com.majinnaibu.bukkit.plugins.metropolis.commands;
|
|||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandExecutor;
|
import org.bukkit.command.CommandExecutor;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
|
|
||||||
import com.majinnaibu.bukkit.plugins.metropolis.MetropolisPlugin;
|
import com.majinnaibu.bukkit.plugins.metropolis.MetropolisPlugin;
|
||||||
|
|
||||||
@@ -17,17 +16,6 @@ public class MetropolisHomeGenerateCommand implements CommandExecutor {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||||
Player player = null;
|
|
||||||
if(sender instanceof Player){
|
|
||||||
player = (Player)sender;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(player != null){
|
|
||||||
if(!player.hasPermission("metropolis.generate")){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(args.length < 1){
|
if(args.length < 1){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,9 +7,13 @@ database: false
|
|||||||
commands:
|
commands:
|
||||||
metropolis-home-generate:
|
metropolis-home-generate:
|
||||||
description: This command generates a home for a user as if they'd just logged in.
|
description: This command generates a home for a user as if they'd just logged in.
|
||||||
permission: metropolis.generate
|
permission: metropolis.home.generate
|
||||||
usage: /metropolis-home-generate <playername>
|
usage: /metropolis-home-generate <playername>
|
||||||
metropolis-home-list:
|
metropolis-home-list:
|
||||||
description: This lists the regions managed by Metropolis
|
description: This lists the regions managed by Metropolis
|
||||||
permission: metropolis.list
|
permission: metropolis.home.list
|
||||||
usage: /metropolis-home-list
|
usage: /metropolis-home-list
|
||||||
|
metropolis-flag-reset:
|
||||||
|
description: This command resets the WorldGuard flags for all managed regions (city and h_*).
|
||||||
|
permission: metropolis.flag.reset
|
||||||
|
usage: /metropolis-flag-reset
|
||||||
|
|||||||
Reference in New Issue
Block a user