Renamed some classes.

This commit is contained in:
sk89q 2010-11-04 22:57:56 -07:00
parent 4d06bc5df1
commit 7befb2e051
5 changed files with 20 additions and 20 deletions

View File

@ -96,7 +96,7 @@ public class EditSession {
* Default constructor. There is no maximum blocks limit. * Default constructor. There is no maximum blocks limit.
*/ */
public EditSession() { public EditSession() {
server = WorldEditLibrary.getServer(); server = WorldEditController.getServer();
} }
/** /**
@ -108,7 +108,7 @@ public class EditSession {
} }
this.maxBlocks = maxBlocks; this.maxBlocks = maxBlocks;
server = WorldEditLibrary.getServer(); server = WorldEditController.getServer();
} }
/** /**

View File

@ -1,6 +1,6 @@
// $Id$ // $Id$
/* /*
* WorldEditLibrary * WorldEdit
* Copyright (C) 2010 sk89q <http://www.sk89q.com> * Copyright (C) 2010 sk89q <http://www.sk89q.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
@ -31,7 +31,7 @@ public class HmodWorldEditListener extends PluginListener {
*/ */
@Override @Override
public void onDisconnect(Player player) { public void onDisconnect(Player player) {
WorldEditLibrary worldEdit = WorldEditLibrary.getInstance(); WorldEditController worldEdit = WorldEditController.getInstance();
worldEdit.removeSession(new HmodWorldEditPlayer(player)); worldEdit.removeSession(new HmodWorldEditPlayer(player));
} }
@ -47,7 +47,7 @@ public class HmodWorldEditListener extends PluginListener {
@Override @Override
public boolean onBlockCreate(Player modPlayer, Block blockPlaced, public boolean onBlockCreate(Player modPlayer, Block blockPlaced,
Block blockClicked, int itemInHand) { Block blockClicked, int itemInHand) {
WorldEditLibrary worldEdit = WorldEditLibrary.getInstance(); WorldEditController worldEdit = WorldEditController.getInstance();
WorldEditPlayer player = new HmodWorldEditPlayer(modPlayer); WorldEditPlayer player = new HmodWorldEditPlayer(modPlayer);
if (itemInHand != 271) { return false; } if (itemInHand != 271) { return false; }
@ -82,7 +82,7 @@ public class HmodWorldEditListener extends PluginListener {
if (!canUseCommand(modPlayer, "//pos1") if (!canUseCommand(modPlayer, "//pos1")
&& !canUseCommand(modPlayer, "//")) { return false; } && !canUseCommand(modPlayer, "//")) { return false; }
WorldEditLibrary worldEdit = WorldEditLibrary.getInstance(); WorldEditController worldEdit = WorldEditController.getInstance();
WorldEditPlayer player = new HmodWorldEditPlayer(modPlayer); WorldEditPlayer player = new HmodWorldEditPlayer(modPlayer);
WorldEditSession session = worldEdit.getSession(player); WorldEditSession session = worldEdit.getSession(player);
@ -114,12 +114,12 @@ public class HmodWorldEditListener extends PluginListener {
if (session.hasSuperPickAxe()) { if (session.hasSuperPickAxe()) {
Vector pos = new Vector(blockClicked.getX(), Vector pos = new Vector(blockClicked.getX(),
blockClicked.getY(), blockClicked.getZ()); blockClicked.getY(), blockClicked.getZ());
if (WorldEditLibrary.getServer().getBlockType(pos) == 7 if (WorldEditController.getServer().getBlockType(pos) == 7
&& !canUseCommand(modPlayer, "/worldeditbedrock")) { && !canUseCommand(modPlayer, "/worldeditbedrock")) {
return true; return true;
} }
WorldEditLibrary.getServer().setBlockType(pos, 0); WorldEditController.getServer().setBlockType(pos, 0);
return true; return true;
} }
@ -136,7 +136,7 @@ public class HmodWorldEditListener extends PluginListener {
*/ */
@Override @Override
public boolean onCommand(Player modPlayer, String[] split) { public boolean onCommand(Player modPlayer, String[] split) {
WorldEditLibrary worldEdit = WorldEditLibrary.getInstance(); WorldEditController worldEdit = WorldEditController.getInstance();
try { try {
// Legacy /, command // Legacy /, command

View File

@ -44,8 +44,8 @@ public class WorldEdit extends Plugin {
/** /**
* WorldEditLibrary instance. * WorldEditLibrary instance.
*/ */
private static final WorldEditLibrary worldEdit = private static final WorldEditController worldEdit =
WorldEditLibrary.setup(new HmodServerInterface()); WorldEditController.setup(new HmodServerInterface());
/** /**
* Listener for the plugin system. * Listener for the plugin system.
*/ */
@ -87,7 +87,7 @@ public class WorldEdit extends Plugin {
// Get allowed blocks // Get allowed blocks
HashSet<Integer> allowedBlocks = new HashSet<Integer>(); HashSet<Integer> allowedBlocks = new HashSet<Integer>();
for (String b : properties.getString("allowed-blocks", for (String b : properties.getString("allowed-blocks",
WorldEditLibrary.getDefaultAllowedBlocks()).split(",")) { WorldEditController.getDefaultAllowedBlocks()).split(",")) {
try { try {
allowedBlocks.add(Integer.parseInt(b)); allowedBlocks.add(Integer.parseInt(b));
} catch (NumberFormatException e) { } catch (NumberFormatException e) {

View File

@ -1,6 +1,6 @@
// $Id$ // $Id$
/* /*
* WorldEditLibrary * WorldEdit
* Copyright (C) 2010 sk89q <http://www.sk89q.com> * Copyright (C) 2010 sk89q <http://www.sk89q.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
@ -37,11 +37,11 @@ import java.io.*;
* *
* @author sk89q * @author sk89q
*/ */
public class WorldEditLibrary { public class WorldEditController {
/** /**
* WorldEditLibrary instance. * WorldEditLibrary instance.
*/ */
private static WorldEditLibrary instance; private static WorldEditController instance;
/** /**
* Server interface. * Server interface.
*/ */
@ -93,8 +93,8 @@ public class WorldEditLibrary {
* @param server * @param server
* @return * @return
*/ */
public static WorldEditLibrary setup(ServerInterface server) { public static WorldEditController setup(ServerInterface server) {
WorldEditLibrary worldEdit = new WorldEditLibrary(); WorldEditController worldEdit = new WorldEditController();
worldEdit.server = server; worldEdit.server = server;
instance = worldEdit; instance = worldEdit;
return worldEdit; return worldEdit;
@ -105,7 +105,7 @@ public class WorldEditLibrary {
* *
* @return * @return
*/ */
public static WorldEditLibrary getInstance() { public static WorldEditController getInstance() {
return instance; return instance;
} }
@ -121,7 +121,7 @@ public class WorldEditLibrary {
/** /**
* Construct an instance of the plugin. * Construct an instance of the plugin.
*/ */
private WorldEditLibrary() { private WorldEditController() {
// Note: Commands should only have the phrase 'air' at the end // Note: Commands should only have the phrase 'air' at the end
// for now (see SMWorldEditListener.canUseCommand) // for now (see SMWorldEditListener.canUseCommand)
commands.put("//pos1", "Set editing position #1"); commands.put("//pos1", "Set editing position #1");

View File

@ -35,7 +35,7 @@ public abstract class WorldEditPlayer {
* Construct the player. * Construct the player.
*/ */
public WorldEditPlayer() { public WorldEditPlayer() {
server = WorldEditLibrary.getServer(); server = WorldEditController.getServer();
} }
/** /**