Dammit, line endings!

By: Dinnerbone <dinnerbone@dinnerbone.com>
This commit is contained in:
Bukkit/Spigot 2011-04-21 15:27:18 +01:00
parent e943cffb00
commit 42104fcf61
4 changed files with 247 additions and 247 deletions

View File

@ -1,42 +1,42 @@
package org.bukkit;
/**
* A delegate for handling block changes. This serves as a direct interface
* between generation algorithms in the server implementation and utilizing
* code.
*
* @author sk89q
*/
public interface BlockChangeDelegate {
/**
* Set a block type at the specified coordinates.
*
* @param x
* @param y
* @param z
* @param typeId
* @return true if the block was set successfully
*/
public boolean setRawTypeId(int x, int y, int z, int typeId);
/**
* Set a block type and data at the specified coordinates.
*
* @param x
* @param y
* @param z
* @param typeId
* @param data
* @return true if the block was set successfully
*/
public boolean setRawTypeIdAndData(int x, int y, int z, int typeId, int data);
/**
* Get the block type at the location.
* @param x
* @param y
* @param z
* @return
*/
public int getTypeId(int x, int y, int z);
}
package org.bukkit;
/**
* A delegate for handling block changes. This serves as a direct interface
* between generation algorithms in the server implementation and utilizing
* code.
*
* @author sk89q
*/
public interface BlockChangeDelegate {
/**
* Set a block type at the specified coordinates.
*
* @param x
* @param y
* @param z
* @param typeId
* @return true if the block was set successfully
*/
public boolean setRawTypeId(int x, int y, int z, int typeId);
/**
* Set a block type and data at the specified coordinates.
*
* @param x
* @param y
* @param z
* @param typeId
* @param data
* @return true if the block was set successfully
*/
public boolean setRawTypeIdAndData(int x, int y, int z, int typeId, int data);
/**
* Get the block type at the location.
* @param x
* @param y
* @param z
* @return
*/
public int getTypeId(int x, int y, int z);
}

View File

@ -1,50 +1,50 @@
package org.bukkit.event.player;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
/**
* This event is fired when the player is almost about to enter the bed.
* It can be cancelled.
*
* @author sk89q
*/
public class PlayerBedEnterEvent extends PlayerEvent implements Cancellable {
private boolean cancel = false;
private Block bed;
public PlayerBedEnterEvent(Player who, Block bed) {
super(Type.PLAYER_BED_ENTER, who);
this.bed = bed;
}
/**
* Gets the cancellation state of this event.
*
* @return true if this event is cancelled
*/
public boolean isCancelled() {
return cancel;
}
/**
* Prevents the player from entering the bed.
*
* @param cancel true if you wish to cancel this event
*/
public void setCancelled(boolean cancel) {
this.cancel = cancel;
}
/**
* Returns the bed block.
*
* @return
*/
public Block getBed() {
return bed;
}
}
package org.bukkit.event.player;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
/**
* This event is fired when the player is almost about to enter the bed.
* It can be cancelled.
*
* @author sk89q
*/
public class PlayerBedEnterEvent extends PlayerEvent implements Cancellable {
private boolean cancel = false;
private Block bed;
public PlayerBedEnterEvent(Player who, Block bed) {
super(Type.PLAYER_BED_ENTER, who);
this.bed = bed;
}
/**
* Gets the cancellation state of this event.
*
* @return true if this event is cancelled
*/
public boolean isCancelled() {
return cancel;
}
/**
* Prevents the player from entering the bed.
*
* @param cancel true if you wish to cancel this event
*/
public void setCancelled(boolean cancel) {
this.cancel = cancel;
}
/**
* Returns the bed block.
*
* @return
*/
public Block getBed() {
return bed;
}
}

View File

@ -1,29 +1,29 @@
package org.bukkit.event.player;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
/**
* This event is fired when the player is leaving a bed.
*
* @author sk89q
*/
public class PlayerBedLeaveEvent extends PlayerEvent {
private Block bed;
public PlayerBedLeaveEvent(Player who, Block bed) {
super(Type.PLAYER_BED_LEAVE, who);
this.bed = bed;
}
/**
* Returns the bed block.
*
* @return
*/
public Block getBed() {
return bed;
}
}
package org.bukkit.event.player;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
/**
* This event is fired when the player is leaving a bed.
*
* @author sk89q
*/
public class PlayerBedLeaveEvent extends PlayerEvent {
private Block bed;
public PlayerBedLeaveEvent(Player who, Block bed) {
super(Type.PLAYER_BED_LEAVE, who);
this.bed = bed;
}
/**
* Returns the bed block.
*
* @return
*/
public Block getBed() {
return bed;
}
}

View File

@ -1,126 +1,126 @@
package org.bukkit.event.player;
import java.net.InetAddress;
import org.bukkit.event.Event;
/**
* Stores details for players attempting to log in
*/
public class PlayerPreLoginEvent extends Event {
private Result result;
private String message;
private String name;
private InetAddress ipAddress;
public PlayerPreLoginEvent(String name, InetAddress ipAddress) {
super(Type.PLAYER_PRELOGIN);
this.result = Result.ALLOWED;
this.message = "";
this.name = name;
this.ipAddress = ipAddress;
}
/**
* Gets the current result of the login, as an enum
*
* @return Current Result of the login
*/
public Result getResult() {
return result;
}
/**
* Sets the new result of the login, as an enum
*
* @param result New result to set
*/
public void setResult(final Result result) {
this.result = result;
}
/**
* Gets the current kick message that will be used if getResult() != Result.ALLOWED
*
* @return Current kick message
*/
public String getKickMessage() {
return message;
}
/**
* Sets the kick message to display if getResult() != Result.ALLOWED
*
* @param message New kick message
*/
public void setKickMessage(final String message) {
this.message = message;
}
/**
* Allows the player to log in
*/
public void allow() {
result = Result.ALLOWED;
message = "";
}
/**
* Disallows the player from logging in, with the given reason
*
* @param result New result for disallowing the player
* @param message Kick message to display to the user
*/
public void disallow(final Result result, final String message) {
this.result = result;
this.message = message;
}
/**
* Gets the player name.
*
* @return
*/
public String getName() {
return name;
}
/**
* Gets the player IP address.
*
* @return
*/
public InetAddress getAddress() {
return ipAddress;
}
/**
* Basic kick reasons for communicating to plugins
*/
public enum Result {
/**
* The player is allowed to log in
*/
ALLOWED,
/**
* The player is not allowed to log in, due to the server being full
*/
KICK_FULL,
/**
* The player is not allowed to log in, due to them being banned
*/
KICK_BANNED,
/**
* The player is not allowed to log in, due to them not being on the white list
*/
KICK_WHITELIST,
/**
* The player is not allowed to log in, for reasons undefined
*/
KICK_OTHER
}
}
package org.bukkit.event.player;
import java.net.InetAddress;
import org.bukkit.event.Event;
/**
* Stores details for players attempting to log in
*/
public class PlayerPreLoginEvent extends Event {
private Result result;
private String message;
private String name;
private InetAddress ipAddress;
public PlayerPreLoginEvent(String name, InetAddress ipAddress) {
super(Type.PLAYER_PRELOGIN);
this.result = Result.ALLOWED;
this.message = "";
this.name = name;
this.ipAddress = ipAddress;
}
/**
* Gets the current result of the login, as an enum
*
* @return Current Result of the login
*/
public Result getResult() {
return result;
}
/**
* Sets the new result of the login, as an enum
*
* @param result New result to set
*/
public void setResult(final Result result) {
this.result = result;
}
/**
* Gets the current kick message that will be used if getResult() != Result.ALLOWED
*
* @return Current kick message
*/
public String getKickMessage() {
return message;
}
/**
* Sets the kick message to display if getResult() != Result.ALLOWED
*
* @param message New kick message
*/
public void setKickMessage(final String message) {
this.message = message;
}
/**
* Allows the player to log in
*/
public void allow() {
result = Result.ALLOWED;
message = "";
}
/**
* Disallows the player from logging in, with the given reason
*
* @param result New result for disallowing the player
* @param message Kick message to display to the user
*/
public void disallow(final Result result, final String message) {
this.result = result;
this.message = message;
}
/**
* Gets the player name.
*
* @return
*/
public String getName() {
return name;
}
/**
* Gets the player IP address.
*
* @return
*/
public InetAddress getAddress() {
return ipAddress;
}
/**
* Basic kick reasons for communicating to plugins
*/
public enum Result {
/**
* The player is allowed to log in
*/
ALLOWED,
/**
* The player is not allowed to log in, due to the server being full
*/
KICK_FULL,
/**
* The player is not allowed to log in, due to them being banned
*/
KICK_BANNED,
/**
* The player is not allowed to log in, due to them not being on the white list
*/
KICK_WHITELIST,
/**
* The player is not allowed to log in, for reasons undefined
*/
KICK_OTHER
}
}