Add missing javadocs.

This commit is contained in:
drtshock 2014-07-09 14:01:53 -05:00
parent 4d5278b079
commit 3298183fdf
14 changed files with 165 additions and 24 deletions

View File

@ -44,7 +44,7 @@ public class CmdKick extends FCommand {
Faction toKickFaction = toKick.getFaction();
// The PlayerEntityCollection only holds online players, this was a specific issue that kept happening.
if(toKickFaction.getTag().equalsIgnoreCase(TL.WILDERNESS.toString())) {
if (toKickFaction.getTag().equalsIgnoreCase(TL.WILDERNESS.toString())) {
sender.sendMessage("Something went wrong with getting the offline player's faction.");
return;
}

View File

@ -3,9 +3,10 @@ package com.massivecraft.factions.event;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.Faction;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
/**
* Event called when an FPlayer joins a Faction.
*/
public class FPlayerJoinEvent extends FactionPlayerEvent implements Cancellable {
PlayerJoinReason reason;
@ -20,6 +21,11 @@ public class FPlayerJoinEvent extends FactionPlayerEvent implements Cancellable
reason = r;
}
/**
* Get the reason the player joined the faction.
*
* @return reason player joined the faction.
*/
public PlayerJoinReason getReason() {
return reason;
}

View File

@ -3,8 +3,6 @@ package com.massivecraft.factions.event;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.Faction;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
public class FPlayerLeaveEvent extends FactionPlayerEvent implements Cancellable {
@ -20,6 +18,11 @@ public class FPlayerLeaveEvent extends FactionPlayerEvent implements Cancellable
reason = r;
}
/**
* Get the reason the player left the faction.
*
* @return reason player left the faction.
*/
public PlayerLeaveReason getReason() {
return reason;
}

View File

@ -8,6 +8,9 @@ import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
/**
* Event called when a Faction is created.
*/
public class FactionCreateEvent extends Event implements Cancellable {
private static final HandlerList handlers = new HandlerList();

View File

@ -2,13 +2,13 @@ package com.massivecraft.factions.event;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.FPlayers;
import com.massivecraft.factions.Faction;
import com.massivecraft.factions.Factions;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
/**
* Event called when a faction is disbanded.
*/
public class FactionDisbandEvent extends FactionEvent implements Cancellable {
private boolean cancelled = false;

View File

@ -4,6 +4,9 @@ import com.massivecraft.factions.Faction;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
/**
* Represents an event involving a Faction.
*/
public class FactionEvent extends Event {
private static final HandlerList handlers = new HandlerList();
@ -13,13 +16,19 @@ public class FactionEvent extends Event {
this.faction = faction;
}
/**
* Get the Faction involved in the event.
*
* @return faction involved in the event.
*/
public Faction getFaction() {
return this.getFaction();
return this.faction;
}
public HandlerList getHandlers() {
return handlers;
}
public static HandlerList getHandlerList() {
return handlers;
}

View File

@ -3,6 +3,9 @@ package com.massivecraft.factions.event;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.Faction;
/**
* Represents an event involving a Faction and a FPlayer.
*/
public class FactionPlayerEvent extends FactionEvent {
private final FPlayer fPlayer;

View File

@ -5,7 +5,9 @@ import com.massivecraft.factions.struct.Relation;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
/**
* Event called when a Faction relation is called.
*/
public class FactionRelationEvent extends Event {
private static final HandlerList handlers = new HandlerList();

View File

@ -1,11 +1,8 @@
package com.massivecraft.factions.event;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.Faction;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
public class FactionRenameEvent extends FactionPlayerEvent implements Cancellable {
@ -17,16 +14,35 @@ public class FactionRenameEvent extends FactionPlayerEvent implements Cancellabl
tag = newTag;
}
/**
* Get the player involved in the event.
*
* @return Player involved in the event.
*
* @deprecated use getfPlayer().getPlayer() instead.
*/
@Deprecated
public Player getPlayer() {
return getfPlayer().getPlayer();
}
/**
* Get the faction tag before it was renamed.
*
* @return old faction tag.
*
* @deprecated use getFaction().getTag() instead.
*/
@Deprecated
public String getOldFactionTag() {
return getFaction().getTag();
}
/**
* Get the new faction tag.
*
* @return new faction tag as String.
*/
public String getFactionTag() {
return tag;
}

View File

@ -5,9 +5,10 @@ import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.Faction;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
/**
* Event called when an FPlayer claims land for a Faction.
*/
public class LandClaimEvent extends FactionPlayerEvent implements Cancellable {
private boolean cancelled;
@ -19,20 +20,46 @@ public class LandClaimEvent extends FactionPlayerEvent implements Cancellable {
location = loc;
}
/**
* Get the FLocation involved in this event.
*
* @return the FLocation (also a chunk) involved in this event.
*/
public FLocation getLocation() {
return this.location;
}
/**
* Get the id of the faction.
*
* @return id of faction as String
*
* @deprecated use getFaction().getId() instead.
*/
@Deprecated
public String getFactionId() {
return getFaction().getId();
}
/**
* Get the tag of the faction.
*
* @return tag of faction as String
*
* @deprecated use getFaction().getTag() instead.
*/
@Deprecated
public String getFactionTag() {
return getFaction().getTag();
}
/**
* Get the Player involved in this event.
*
* @return player from FPlayer.
*
* @deprecated use getfPlayer().getPlayer() instead.
*/
@Deprecated
public Player getPlayer() {
return getfPlayer().getPlayer();

View File

@ -3,8 +3,6 @@ package com.massivecraft.factions.event;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.Faction;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
public class LandUnclaimAllEvent extends FactionPlayerEvent {
@ -12,16 +10,37 @@ public class LandUnclaimAllEvent extends FactionPlayerEvent {
super(f, p);
}
/**
* Get the id of the faction.
*
* @return id of faction as String
*
* @deprecated use getFaction().getId() instead.
*/
@Deprecated
public String getFactionId() {
return getFaction().getId();
}
/**
* Get the tag of the faction.
*
* @return tag of faction as String
*
* @deprecated use getFaction().getTag() instead.
*/
@Deprecated
public String getFactionTag() {
return getFaction().getTag();
}
/**
* Get the Player involved in the event.
*
* @return Player from FPlayer.
*
* @deprecated use getfPlayer().getPlayer() instead.
*/
@Deprecated
public Player getPlayer() {
return getfPlayer().getPlayer();

View File

@ -5,9 +5,10 @@ import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.Faction;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
/**
* Event called when an FPlayer unclaims land for a Faction.
*/
public class LandUnclaimEvent extends FactionPlayerEvent implements Cancellable {
private boolean cancelled;
@ -23,16 +24,37 @@ public class LandUnclaimEvent extends FactionPlayerEvent implements Cancellable
return this.location;
}
/**
* Get the id of the faction.
*
* @return id of faction as String
*
* @deprecated use getFaction().getId() instead.
*/
@Deprecated
public String getFactionId() {
return getFaction().getId();
}
/**
* Get the tag of the faction.
*
* @return tag of faction as String
*
* @deprecated use getFaction().getTag() instead.
*/
@Deprecated
public String getFactionTag() {
return getFaction().getTag();
}
/**
* Get the Player involved in the event.
*
* @return Player from FPlayer.
*
* @deprecated use getfPlayer().getPlayer() instead.
*/
@Deprecated
public Player getPlayer() {
return getfPlayer().getPlayer();

View File

@ -4,9 +4,10 @@ import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.Faction;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
/**
* Event called when a player loses power.
*/
public class PowerLossEvent extends FactionPlayerEvent implements Cancellable {
private boolean cancelled = false;
@ -16,25 +17,56 @@ public class PowerLossEvent extends FactionPlayerEvent implements Cancellable {
super(f, p);
}
/**
* Get the id of the faction.
*
* @return id of faction as String
*
* @deprecated use getFaction().getId() instead.
*/
@Deprecated
public String getFactionId() {
return getFaction().getId();
}
/**
* Get the tag of the faction.
*
* @return tag of faction as String
*
* @deprecated use getFaction().getTag() instead.
*/
@Deprecated
public String getFactionTag() {
return getFaction().getTag();
}
/**
* Get the Player involved in the event.
*
* @return Player from FPlayer.
*
* @deprecated use getfPlayer().getPlayer() instead.
*/
@Deprecated
public Player getPlayer() {
return getfPlayer().getPlayer();
}
/**
* Get the power loss message.
*
* @return power loss message as String.
*/
public String getMessage() {
return message;
}
/**
* Set the power loss message.
*
* @param message
*/
public void setMessage(String message) {
this.message = message;
}

View File

@ -21,7 +21,6 @@ import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import org.bukkit.projectiles.ProjectileSource;
import java.text.MessageFormat;
import java.util.*;