From 7befb2e0519592d63f405a04952fb253b5fbb35f Mon Sep 17 00:00:00 2001 From: sk89q Date: Thu, 4 Nov 2010 22:57:56 -0700 Subject: [PATCH] Renamed some classes. --- src/EditSession.java | 4 ++-- src/HmodWorldEditListener.java | 14 +++++++------- src/WorldEdit.java | 6 +++--- ...ldEditLibrary.java => WorldEditController.java} | 14 +++++++------- src/WorldEditPlayer.java | 2 +- 5 files changed, 20 insertions(+), 20 deletions(-) rename src/{WorldEditLibrary.java => WorldEditController.java} (99%) diff --git a/src/EditSession.java b/src/EditSession.java index 2fc84f68d..ad5c37fa7 100644 --- a/src/EditSession.java +++ b/src/EditSession.java @@ -96,7 +96,7 @@ public class EditSession { * Default constructor. There is no maximum blocks limit. */ public EditSession() { - server = WorldEditLibrary.getServer(); + server = WorldEditController.getServer(); } /** @@ -108,7 +108,7 @@ public class EditSession { } this.maxBlocks = maxBlocks; - server = WorldEditLibrary.getServer(); + server = WorldEditController.getServer(); } /** diff --git a/src/HmodWorldEditListener.java b/src/HmodWorldEditListener.java index 2a3ed2f3d..b1834ef6f 100644 --- a/src/HmodWorldEditListener.java +++ b/src/HmodWorldEditListener.java @@ -1,6 +1,6 @@ // $Id$ /* - * WorldEditLibrary + * WorldEdit * Copyright (C) 2010 sk89q * * This program is free software: you can redistribute it and/or modify @@ -31,7 +31,7 @@ public class HmodWorldEditListener extends PluginListener { */ @Override public void onDisconnect(Player player) { - WorldEditLibrary worldEdit = WorldEditLibrary.getInstance(); + WorldEditController worldEdit = WorldEditController.getInstance(); worldEdit.removeSession(new HmodWorldEditPlayer(player)); } @@ -47,7 +47,7 @@ public class HmodWorldEditListener extends PluginListener { @Override public boolean onBlockCreate(Player modPlayer, Block blockPlaced, Block blockClicked, int itemInHand) { - WorldEditLibrary worldEdit = WorldEditLibrary.getInstance(); + WorldEditController worldEdit = WorldEditController.getInstance(); WorldEditPlayer player = new HmodWorldEditPlayer(modPlayer); if (itemInHand != 271) { return false; } @@ -82,7 +82,7 @@ public class HmodWorldEditListener extends PluginListener { if (!canUseCommand(modPlayer, "//pos1") && !canUseCommand(modPlayer, "//")) { return false; } - WorldEditLibrary worldEdit = WorldEditLibrary.getInstance(); + WorldEditController worldEdit = WorldEditController.getInstance(); WorldEditPlayer player = new HmodWorldEditPlayer(modPlayer); WorldEditSession session = worldEdit.getSession(player); @@ -114,12 +114,12 @@ public class HmodWorldEditListener extends PluginListener { if (session.hasSuperPickAxe()) { Vector pos = new Vector(blockClicked.getX(), blockClicked.getY(), blockClicked.getZ()); - if (WorldEditLibrary.getServer().getBlockType(pos) == 7 + if (WorldEditController.getServer().getBlockType(pos) == 7 && !canUseCommand(modPlayer, "/worldeditbedrock")) { return true; } - WorldEditLibrary.getServer().setBlockType(pos, 0); + WorldEditController.getServer().setBlockType(pos, 0); return true; } @@ -136,7 +136,7 @@ public class HmodWorldEditListener extends PluginListener { */ @Override public boolean onCommand(Player modPlayer, String[] split) { - WorldEditLibrary worldEdit = WorldEditLibrary.getInstance(); + WorldEditController worldEdit = WorldEditController.getInstance(); try { // Legacy /, command diff --git a/src/WorldEdit.java b/src/WorldEdit.java index 691348be2..6191735ba 100644 --- a/src/WorldEdit.java +++ b/src/WorldEdit.java @@ -44,8 +44,8 @@ public class WorldEdit extends Plugin { /** * WorldEditLibrary instance. */ - private static final WorldEditLibrary worldEdit = - WorldEditLibrary.setup(new HmodServerInterface()); + private static final WorldEditController worldEdit = + WorldEditController.setup(new HmodServerInterface()); /** * Listener for the plugin system. */ @@ -87,7 +87,7 @@ public class WorldEdit extends Plugin { // Get allowed blocks HashSet allowedBlocks = new HashSet(); for (String b : properties.getString("allowed-blocks", - WorldEditLibrary.getDefaultAllowedBlocks()).split(",")) { + WorldEditController.getDefaultAllowedBlocks()).split(",")) { try { allowedBlocks.add(Integer.parseInt(b)); } catch (NumberFormatException e) { diff --git a/src/WorldEditLibrary.java b/src/WorldEditController.java similarity index 99% rename from src/WorldEditLibrary.java rename to src/WorldEditController.java index 342630ebe..21ca9114d 100644 --- a/src/WorldEditLibrary.java +++ b/src/WorldEditController.java @@ -1,6 +1,6 @@ // $Id$ /* - * WorldEditLibrary + * WorldEdit * Copyright (C) 2010 sk89q * * This program is free software: you can redistribute it and/or modify @@ -37,11 +37,11 @@ import java.io.*; * * @author sk89q */ -public class WorldEditLibrary { +public class WorldEditController { /** * WorldEditLibrary instance. */ - private static WorldEditLibrary instance; + private static WorldEditController instance; /** * Server interface. */ @@ -93,8 +93,8 @@ public class WorldEditLibrary { * @param server * @return */ - public static WorldEditLibrary setup(ServerInterface server) { - WorldEditLibrary worldEdit = new WorldEditLibrary(); + public static WorldEditController setup(ServerInterface server) { + WorldEditController worldEdit = new WorldEditController(); worldEdit.server = server; instance = worldEdit; return worldEdit; @@ -105,7 +105,7 @@ public class WorldEditLibrary { * * @return */ - public static WorldEditLibrary getInstance() { + public static WorldEditController getInstance() { return instance; } @@ -121,7 +121,7 @@ public class WorldEditLibrary { /** * Construct an instance of the plugin. */ - private WorldEditLibrary() { + private WorldEditController() { // Note: Commands should only have the phrase 'air' at the end // for now (see SMWorldEditListener.canUseCommand) commands.put("//pos1", "Set editing position #1"); diff --git a/src/WorldEditPlayer.java b/src/WorldEditPlayer.java index 170778ca1..85a75f618 100644 --- a/src/WorldEditPlayer.java +++ b/src/WorldEditPlayer.java @@ -35,7 +35,7 @@ public abstract class WorldEditPlayer { * Construct the player. */ public WorldEditPlayer() { - server = WorldEditLibrary.getServer(); + server = WorldEditController.getServer(); } /**