Package com.sk89q.worldedit.bukkit

Examples of com.sk89q.worldedit.bukkit.WorldEditPlugin


    SettingsManager s = SettingsManager.getInstance();
    if (!c.getBoolean("sg-system.lobby.sign.set", false)) {
      c.set("sg-system.lobby.sign.set", true);
      s.saveSystemConfig();
    }
    WorldEditPlugin we = GameManager.getInstance().getWorldEdit();
    Selection sel = we.getSelection(pl);
    if (sel == null) {
      pl.sendMessage(ChatColor.RED + "You must make a WorldEdit Selection first");
      return;
    }
    if ((sel.getNativeMaximumPoint().getBlockX() - sel.getNativeMinimumPoint().getBlockX()) != 0 && (sel.getNativeMinimumPoint().getBlockZ() - sel.getNativeMaximumPoint().getBlockZ() != 0)) {
View Full Code Here


* Date: 6/12/12
*/
public class WorldEditUtil {
  public static LocalSession getSession(Player player) {
    Plugin plugin = Bukkit.getPluginManager().getPlugin("WorldEdit");
    WorldEditPlugin worldEditPlugin = (WorldEditPlugin)plugin;

    return worldEditPlugin.getSession(player);
  }
View Full Code Here

  }
 
  // VERY Loosely based on work contributed by drew-bahrue (https://github.com/echurchill/CityWorld/pull/2)
  public static PasteProvider loadWorldEdit(WorldGenerator generator) {
//    return null;
    WorldEditPlugin worldEditPlugin = null;

    try {
      PluginManager pm = Bukkit.getServer().getPluginManager();
      worldEditPlugin = (WorldEditPlugin) pm.getPlugin(pluginName);
     
      // not there? darn
      if (worldEditPlugin == null)
        return null;

      // got the right version?
      if (!isPlugInVersionOrBetter(generator, worldEditPlugin, pluginMinVersion))
       
        // Use it anyway?
        if (generator.settings.forceLoadWorldEdit) {
          generator.reportMessage("'" + CityWorldSettings.tagForceLoadWorldEdit + "' setting enabled!");
         
        // Well that didn't work... let's tell the user about a potential workaround
        } else {
          generator.reportMessage("[PasteProvider] Cannot use the installed WorldEdit. ",
                      "See the '" + CityWorldSettings.tagForceLoadWorldEdit + "' setting for possible workaround.");
          return null;
        }
     
      // make sure it is enabled
      if (!pm.isPluginEnabled(worldEditPlugin))
        pm.enablePlugin(worldEditPlugin);

      // woot!
      generator.reportMessage("[PasteProvider] Found WorldEdit v" + worldEditPlugin.getDescription().getVersion() + ", enabling its schematics");
     
      return new PasteProvider_WorldEdit(generator);
     
    } catch (Exception e) {
      generator.reportException("[PasteProvider] Problem with WorldEdit", e);
View Full Code Here

  public boolean setupZone(CommandSender sender, AutoRefMatch match, String[] args, CommandLine options)
  {
    if (match == null) return false;
    Player player = (Player) sender;

    WorldEditPlugin worldEdit = AutoReferee.getWorldEdit();
    if (worldEdit == null)
    {
      // world edit not installed
      sender.sendMessage("This method requires WorldEdit installed and running.");
      return true;
    }

    Set<AutoRefTeam> teams = Sets.newHashSet();
    for (String arg : args)
    {
      AutoRefTeam team = match.getTeam(arg);
      if (team != null) teams.add(team);
    }

    boolean isStartRegion = options.hasOption('S');
    if (teams.isEmpty() && !isStartRegion)
    {
      // team name is invalid. let the player know
      sender.sendMessage(ChatColor.DARK_GRAY + "No valid team names given.");
      sender.sendMessage("Teams are " + match.getTeamList());
      return true;
    }

    Selection sel = worldEdit.getSelection(player);
    AutoRefRegion reg = null;

    if ((sel instanceof CuboidSelection))
    {
      CuboidSelection csel = (CuboidSelection) sel;
View Full Code Here

  public boolean setupCore(CommandSender sender, AutoRefMatch match, String[] args, CommandLine options)
  {
    if (match == null) return false;
    Player player = (Player) sender;

    WorldEditPlugin worldEdit = AutoReferee.getWorldEdit();
    if (worldEdit == null)
    {
      // world edit not installed
      sender.sendMessage("This method requires WorldEdit installed and running.");
      return true;
    }

    AutoRefTeam team = match.getTeam(args[0]);
    Selection sel = worldEdit.getSelection(player);
    AutoRefRegion reg = null;

    if ((sel instanceof CuboidSelection))
    {
      CuboidSelection csel = (CuboidSelection) sel;
View Full Code Here

TOP

Related Classes of com.sk89q.worldedit.bukkit.WorldEditPlugin

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.