Class etc

java.lang.Object
  extended by etc

public class etc
extends java.lang.Object

etc.java - My catch-all class for a bunch of shit. If there's something you need it's probably in here.


Method Summary
Modifier and Type Method and Description
 void addCommand(java.lang.String command, java.lang.String description)
          Adds command to the /help list
 PluginLoader.HookResult autoHeal()
          Returns the status of auto-heal.
 boolean canSaveHomes()
          Returns true if the server is saving homes
 void changeHome(Warp home)
          Adds or modifies the home.
static java.lang.String combineSplit(int startIndex, java.lang.String[] string, java.lang.String seperator)
          Combines the string array into a string at the specified start with the separator separating each string.
 java.util.Set<java.lang.Integer> getAllowedItems()
          Returns a list of allowed items for /item
 java.lang.String[] getAnimals()
          Returns a list of animals that are allowed to spawn naturally
 java.util.LinkedHashMap<java.lang.String,java.lang.String> getCommands()
          Returns the list of commands
static java.lang.String getCompassPointForDirection(double degrees)
          Returns compass direction according to your rotation
static DataSource getDataSource()
          Returns the data source
 Group getDefaultGroup()
          Returns the default group
 java.util.Set<java.lang.Integer> getDisallowedItems()
          Returns a list of disallowed items for /item
 java.lang.String getGroupLocation()
          Returns the location of groups.txt
 java.lang.String getHomeLocation()
          Returns the location of homes.txt
static etc getInstance()
          Returns the instance
 java.lang.String getItemLocation()
          Returns the location of items.txt
 java.util.Set<java.lang.Integer> getItemSpawnBlacklist()
          Returns list of banned blocks
 java.lang.String getKitsLocation()
          Returns the location of kits.txt
static PluginLoader getLoader()
          Returns the plugin loader
static net.minecraft.server.MinecraftServer getMCServer()
          Returns the minecraft server
 int getMobSpawnRate()
          Returns the % from 0 to 100 that a mob or animal will spawn
 java.lang.String[] getMonsters()
          Returns a list of mobs that are allowed to spawn naturally
 java.lang.String[] getMotd()
          Returns the MOTD.
 int getPlayerLimit()
          Returns the player limit
 java.lang.String getReservelistLocation()
          Returns the location of reservelist.txt
static Server getServer()
          Returns the minecraft server interface
 DataSource getSource()
          Returns the data source
 int getSpawnProtectionSize()
          Returns the spawn protection size
static java.sql.Connection getSQLConnection()
          Returns a SQL connection
 boolean getTainted()
          Return whether this build is "tainted"
 java.lang.String getUsersLocation()
          Returns the location of users.txt
 int getVersion()
          Return the current build of the mod
 java.lang.String getVersionStr()
          Return the specified string version of the build
 java.lang.String getWarpLocation()
          Returns the location of warps.txt
 java.lang.String getWhitelistLocation()
          Returns the location of whitelist.txt
 java.lang.String getWhitelistMessage()
          Returns the message the kick will show if a player isn't on the whitelist
 boolean isHealthEnabled()
          Returns true if we want health to be enabled.
 boolean isLogging()
          Returns true if we're logging commands and such
 boolean isOnItemBlacklist(int id)
          Returns true if the item is on the blacklist
 boolean isWhitelistEnabled()
          Returns true if the whitelist is enabled
 void load()
          Loads or reloads the mod
 void loadData()
          Loads or reloads the data source
 boolean parseConsoleCommand(java.lang.String command, net.minecraft.server.MinecraftServer server)
          Parses a console command
 void removeCommand(java.lang.String command)
          Removes command from /help list
 void setAllowedItems(int[] allowedItems)
          Sets the list of allowed items
 void setAnimals(java.lang.String[] animals)
          Sets a list of animals that are allowed to spawn naturally
 void setDisallowedItems(int[] disallowedItems)
          Sets the list of disallowed items
 void setGroupLocation(java.lang.String groupLoc)
          Sets the location of groups.txt
 void setHomeLocation(java.lang.String homeLoc)
          Sets the location of homes.txt
 void setItemLocation(java.lang.String itemLoc)
          Sets the location of items.txt
 void setItemSpawnBlacklist(int[] itemSpawnBlacklist)
          Sets the item spawn blacklist
 void setKitsLocation(java.lang.String kitsLoc)
          Sets the location of kits.txt
 void setLogging(boolean logging)
          If set to true the server will log all commands used.
 void setMobSpawnRate(int rate)
          Sets the % from 0 to 100 that a mob or animal will spawn
 void setMonsters(java.lang.String[] monsters)
          Sets a list of mobs that are allowed to spawn naturally
 void setMotd(java.lang.String[] motd)
          Set the MOTD
 void setPlayerLimit(int playerLimit)
          Set the player limit
 void setReservelistLocation(java.lang.String reservelistLoc)
          Set the location of reservelist.txt
 void setSaveHomes(boolean saveHomes)
          If true the server will save homes.
static void setServer(net.minecraft.server.MinecraftServer s)
          Sets the server to be used.
 void setShowUnknownCommand(boolean showUnknownCommand)
          Sets whether or not to show "Unknown command" to players.
 void setSpawnProtectionSize(int spawnProtectionSize)
          Set the spawn protection size (def: 16)
 void setUsersLocation(java.lang.String usersLoc)
          Sets the location of users.txt
 void setWarp(Warp warp)
          Adds or modifies the warp
 void setWarpLocation(java.lang.String warpLoc)
          Sets the location of warps.txt
 void setWhitelistEnabled(boolean whitelistEnabled)
          If true the whitelist is enabled
 void setWhitelistLocation(java.lang.String whitelistLoc)
          Sets the location of whitelist.txt
 void setWhitelistMessage(java.lang.String whitelistMessage)
          Sets the whitelist message to show when it kicks someone
 boolean showUnknownCommand()
          Returns true if "Unknown command" is shown to a player when they enter an unknown command (For wrappers and such)
 boolean toggleWhitelist()
          Toggles the whitelist (doesn't persist)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

load

public final void load()
Loads or reloads the mod


loadData

public void loadData()
Loads or reloads the data source


getInstance

public static etc getInstance()
Returns the instance

Returns:

setServer

public static void setServer(net.minecraft.server.MinecraftServer s)
Sets the server to be used.

Parameters:
s -

getMCServer

public static net.minecraft.server.MinecraftServer getMCServer()
Returns the minecraft server

Returns:

getDataSource

public static DataSource getDataSource()
Returns the data source

Returns:

getServer

public static Server getServer()
Returns the minecraft server interface

Returns:

getLoader

public static PluginLoader getLoader()
Returns the plugin loader

Returns:

getDefaultGroup

public Group getDefaultGroup()
Returns the default group

Returns:
default group

changeHome

public void changeHome(Warp home)
Adds or modifies the home.

Parameters:
home -

setWarp

public void setWarp(Warp warp)
Adds or modifies the warp

Parameters:
warp -

isOnItemBlacklist

public boolean isOnItemBlacklist(int id)
Returns true if the item is on the blacklist

Parameters:
id -
Returns:

getSource

public DataSource getSource()
Returns the data source

Returns:

isLogging

public boolean isLogging()
Returns true if we're logging commands and such

Returns:

isHealthEnabled

public boolean isHealthEnabled()
Returns true if we want health to be enabled.

Returns:

autoHeal

public PluginLoader.HookResult autoHeal()
Returns the status of auto-heal.

Returns:

addCommand

public void addCommand(java.lang.String command,
                       java.lang.String description)
Adds command to the /help list

Parameters:
command -
description -

removeCommand

public void removeCommand(java.lang.String command)
Removes command from /help list

Parameters:
command -

toggleWhitelist

public boolean toggleWhitelist()
Toggles the whitelist (doesn't persist)

Returns:

parseConsoleCommand

public boolean parseConsoleCommand(java.lang.String command,
                                   net.minecraft.server.MinecraftServer server)
Parses a console command

Parameters:
command -
server -
Returns:

getCompassPointForDirection

public static java.lang.String getCompassPointForDirection(double degrees)
Returns compass direction according to your rotation

Parameters:
degrees -
Returns:

combineSplit

public static java.lang.String combineSplit(int startIndex,
                                            java.lang.String[] string,
                                            java.lang.String seperator)
Combines the string array into a string at the specified start with the separator separating each string.

Parameters:
startIndex -
string -
seperator -
Returns:
combined string

getAllowedItems

public java.util.Set<java.lang.Integer> getAllowedItems()
Returns a list of allowed items for /item

Returns:
list of allowed items

getCommands

public java.util.LinkedHashMap<java.lang.String,java.lang.String> getCommands()
Returns the list of commands

Returns:

getDisallowedItems

public java.util.Set<java.lang.Integer> getDisallowedItems()
Returns a list of disallowed items for /item

Returns:

getGroupLocation

public java.lang.String getGroupLocation()
Returns the location of groups.txt

Returns:

getHomeLocation

public java.lang.String getHomeLocation()
Returns the location of homes.txt

Returns:

getItemLocation

public java.lang.String getItemLocation()
Returns the location of items.txt

Returns:

getItemSpawnBlacklist

public java.util.Set<java.lang.Integer> getItemSpawnBlacklist()
Returns list of banned blocks

Returns:

getKitsLocation

public java.lang.String getKitsLocation()
Returns the location of kits.txt

Returns:

getMotd

public java.lang.String[] getMotd()
Returns the MOTD.

Returns:

getPlayerLimit

public int getPlayerLimit()
Returns the player limit

Returns:

getReservelistLocation

public java.lang.String getReservelistLocation()
Returns the location of reservelist.txt

Returns:

canSaveHomes

public boolean canSaveHomes()
Returns true if the server is saving homes

Returns:
true if server can save homes

getSpawnProtectionSize

public int getSpawnProtectionSize()
Returns the spawn protection size

Returns:

getUsersLocation

public java.lang.String getUsersLocation()
Returns the location of users.txt

Returns:

getWarpLocation

public java.lang.String getWarpLocation()
Returns the location of warps.txt

Returns:

isWhitelistEnabled

public boolean isWhitelistEnabled()
Returns true if the whitelist is enabled

Returns:

getWhitelistLocation

public java.lang.String getWhitelistLocation()
Returns the location of whitelist.txt

Returns:

getWhitelistMessage

public java.lang.String getWhitelistMessage()
Returns the message the kick will show if a player isn't on the whitelist

Returns:

setAllowedItems

public void setAllowedItems(int[] allowedItems)
Sets the list of allowed items

Parameters:
allowedItems -

setDisallowedItems

public void setDisallowedItems(int[] disallowedItems)
Sets the list of disallowed items

Parameters:
disallowedItems -

setGroupLocation

public void setGroupLocation(java.lang.String groupLoc)
Sets the location of groups.txt

Parameters:
groupLoc -

setHomeLocation

public void setHomeLocation(java.lang.String homeLoc)
Sets the location of homes.txt

Parameters:
homeLoc -

setItemLocation

public void setItemLocation(java.lang.String itemLoc)
Sets the location of items.txt

Parameters:
itemLoc -

setItemSpawnBlacklist

public void setItemSpawnBlacklist(int[] itemSpawnBlacklist)
Sets the item spawn blacklist

Parameters:
itemSpawnBlacklist -

setKitsLocation

public void setKitsLocation(java.lang.String kitsLoc)
Sets the location of kits.txt

Parameters:
kitsLoc -

setLogging

public void setLogging(boolean logging)
If set to true the server will log all commands used.

Parameters:
logging -

setMotd

public void setMotd(java.lang.String[] motd)
Set the MOTD

Parameters:
motd -

setPlayerLimit

public void setPlayerLimit(int playerLimit)
Set the player limit

Parameters:
playerLimit -

setReservelistLocation

public void setReservelistLocation(java.lang.String reservelistLoc)
Set the location of reservelist.txt

Parameters:
reservelistLoc -

setSaveHomes

public void setSaveHomes(boolean saveHomes)
If true the server will save homes. If false homes won't be saved and will be wiped the next server restart.

Parameters:
saveHomes -

setSpawnProtectionSize

public void setSpawnProtectionSize(int spawnProtectionSize)
Set the spawn protection size (def: 16)

Parameters:
spawnProtectionSize -

setUsersLocation

public void setUsersLocation(java.lang.String usersLoc)
Sets the location of users.txt

Parameters:
usersLoc -

setWarpLocation

public void setWarpLocation(java.lang.String warpLoc)
Sets the location of warps.txt

Parameters:
warpLoc -

setWhitelistEnabled

public void setWhitelistEnabled(boolean whitelistEnabled)
If true the whitelist is enabled

Parameters:
whitelistEnabled -

setWhitelistLocation

public void setWhitelistLocation(java.lang.String whitelistLoc)
Sets the location of whitelist.txt

Parameters:
whitelistLoc -

setWhitelistMessage

public void setWhitelistMessage(java.lang.String whitelistMessage)
Sets the whitelist message to show when it kicks someone

Parameters:
whitelistMessage -

showUnknownCommand

public boolean showUnknownCommand()
Returns true if "Unknown command" is shown to a player when they enter an unknown command (For wrappers and such)

Returns:
show unknown command

setShowUnknownCommand

public void setShowUnknownCommand(boolean showUnknownCommand)
Sets whether or not to show "Unknown command" to players.

Parameters:
showUnknownCommand - whether or not to show it

getVersion

public int getVersion()
Return the current build of the mod

Returns:
build/version

getTainted

public boolean getTainted()
Return whether this build is "tainted"

Returns:
tainted

getVersionStr

public java.lang.String getVersionStr()
Return the specified string version of the build

Returns:
build/version

getAnimals

public java.lang.String[] getAnimals()
Returns a list of animals that are allowed to spawn naturally

Returns:
a list of animals

setAnimals

public void setAnimals(java.lang.String[] animals)
Sets a list of animals that are allowed to spawn naturally

Parameters:
animals - a list of animals

getMonsters

public java.lang.String[] getMonsters()
Returns a list of mobs that are allowed to spawn naturally

Returns:
a list of mobs

setMonsters

public void setMonsters(java.lang.String[] monsters)
Sets a list of mobs that are allowed to spawn naturally

Parameters:
monsters - a list of mobs

getMobSpawnRate

public int getMobSpawnRate()
Returns the % from 0 to 100 that a mob or animal will spawn

Returns:
a percentage from 0 to 100

setMobSpawnRate

public void setMobSpawnRate(int rate)
Sets the % from 0 to 100 that a mob or animal will spawn

Parameters:
rate - a percentage from 0 to 100

getSQLConnection

public static java.sql.Connection getSQLConnection()
Returns a SQL connection

Returns:
sql connection