Skip to content

Commit

Permalink
Update all imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Staartvin committed Jan 28, 2016
1 parent 4454c0e commit ce90fee
Show file tree
Hide file tree
Showing 17 changed files with 182 additions and 73 deletions.
3 changes: 3 additions & 0 deletions src/me/staartvin/plugins/pluginlibrary/PluginLibrary.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
import java.util.Collections;
import java.util.List;

import org.bukkit.ChatColor;
import org.bukkit.plugin.java.JavaPlugin;

import me.staartvin.plugins.pluginlibrary.hooks.LibraryHook;
import me.staartvin.plugins.pluginlibrary.hooks.customstats.CustomStatsManager;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import java.util.UUID;

import me.edge209.afkTerminator.AfkDetect;
import me.edge209.afkTerminator.AfkDetect.AFKMACHINES;
import me.staartvin.plugins.pluginlibrary.Library;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
import java.util.List;
import java.util.UUID;

import javax.xml.transform.Result;

import org.bukkit.entity.Player;

import me.armar.plugins.autorank.Autorank;
import me.armar.plugins.autorank.playerchecker.requirement.Requirement;
import me.staartvin.plugins.pluginlibrary.Library;

/**
Expand Down Expand Up @@ -132,7 +138,7 @@ public void registerRequirement(String requirementName, Class<? extends Requirem
* @param resultName The name of the result.
* @param res The custom result class for Autorank to use.
*/
public void registerResult(String resultName, Class<? extends Result> res) {
public void registerResult(String resultName, Class<? extends me.armar.plugins.autorank.playerchecker.result.Result> res) {
autorank.getAPI().registerResult(resultName, res);
}

Expand Down
121 changes: 65 additions & 56 deletions src/me/staartvin/plugins/pluginlibrary/hooks/FactionsHook.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,22 @@
import java.util.List;
import java.util.UUID;

import org.bukkit.Location;

import com.massivecraft.factions.Factions;
import com.massivecraft.factions.entity.BoardColl;
import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.entity.FactionColl;
import com.massivecraft.factions.entity.MPlayer;
import com.massivecraft.massivecore.ps.PS;

import me.staartvin.plugins.pluginlibrary.Library;
import me.staartvin.plugins.pluginlibrary.hooks.factions.Faction;
import me.staartvin.plugins.pluginlibrary.hooks.factions.PLFaction;
import me.staartvin.plugins.pluginlibrary.hooks.factions.PLMPlayer;

/**
* Factions, <a
* href="https://www.spigotmc.org/resources/factions.1900/">link</a>.
* Factions,
* <a href="https://www.spigotmc.org/resources/factions.1900/">link</a>.
* <p>
* Date created: 20:22:17 12 aug. 2015
*
Expand All @@ -20,18 +30,21 @@ public class FactionsHook extends LibraryHook {

private Factions factions;

/* (non-Javadoc)
/*
* (non-Javadoc)
*
* @see me.staartvin.plugins.pluginlibrary.LibraryHook#isAvailable()
*/
@Override
public boolean isAvailable() {
// TODO Auto-generated method stub

return this.getPlugin().getServer().getPluginManager()
.isPluginEnabled(Library.FACTIONS.getPluginName());
return this.getPlugin().getServer().getPluginManager().isPluginEnabled(Library.FACTIONS.getPluginName());
}

/* (non-Javadoc)
/*
* (non-Javadoc)
*
* @see me.staartvin.plugins.pluginlibrary.LibraryHook#hook()
*/
@Override
Expand All @@ -57,33 +70,34 @@ private MPlayer getMPlayer(UUID uuid) {

/**
* Gets the faction by its name. Use the comparison name, see
* {@link me.staartvin.plugins.pluginlibrary.hooks.factions.Faction#getComparisonName()}
* {@link me.staartvin.plugins.pluginlibrary.hooks.factions.PLFaction#getComparisonName()}
* .
*
* @param factionName Name of the faction. <b>Without colour codes!</b>
* @return {@link Faction} or null if no faction found.
* @param factionName
* Name of the faction. <b>Without colour codes!</b>
* @return {@link PLFaction} or null if no faction found.
*/
public Faction getFactionByName(String factionName) {
public PLFaction getFactionByName(String factionName) {
if (factionName == null)
return null;

com.massivecraft.factions.entity.Faction fac = FactionColl.get()
.getByName(factionName);
com.massivecraft.factions.entity.Faction fac = FactionColl.get().getByName(factionName);

if (fac == null)
return null;

return new Faction(fac);
return new PLFaction(fac);
}

/**
* Gets the faction a player is in.
*
* @param uuid UUID of the player.
* @return {@link Faction}, null if the player doesn't exist or is not in a
* faction.
* @param uuid
* UUID of the player.
* @return {@link PLFaction}, null if the player doesn't exist or is not in
* a faction.
*/
public Faction getFactionByUUID(UUID uuid) {
public PLFaction getFactionByUUID(UUID uuid) {
if (uuid == null)
return null;

Expand All @@ -92,32 +106,32 @@ public Faction getFactionByUUID(UUID uuid) {
if (mPlayer == null)
return null;

com.massivecraft.factions.entity.Faction fac = mPlayer.getFaction();
Faction fac = mPlayer.getFaction();

if (fac == null)
return null;

return new Faction(fac);
return new PLFaction(fac);
}

/**
* Gets a faction by its internal Factions id.
*
* @param factionId Id of the faction
* @return {@link Faction} or null if id is invalid.
* @param factionId
* Id of the faction
* @return {@link PLFaction} or null if id is invalid.
*/
public Faction getFactionById(String factionId) {
public PLFaction getFactionById(String factionId) {
if (factionId == null)
return null;

if (FactionColl.get().containsId(factionId)) {
com.massivecraft.factions.entity.Faction fac = FactionColl.get()
.get(factionId);
com.massivecraft.factions.entity.Faction fac = FactionColl.get().get(factionId);

if (fac == null)
return null;

return new Faction(fac);
return new PLFaction(fac);
}

return null;
Expand All @@ -128,12 +142,11 @@ public Faction getFactionById(String factionId) {
*
* @return a list of all factions.
*/
public List<Faction> getAllFactions() {
List<Faction> factions = new ArrayList<Faction>();
public List<PLFaction> getAllFactions() {
List<PLFaction> factions = new ArrayList<PLFaction>();

for (com.massivecraft.factions.entity.Faction fac : FactionColl.get()
.getAll()) {
factions.add(new Faction(fac));
for (com.massivecraft.factions.entity.Faction fac : FactionColl.get().getAll()) {
factions.add(new PLFaction(fac));
}

return factions;
Expand All @@ -144,84 +157,80 @@ public List<Faction> getAllFactions() {
*
* @return the Wilderness faction.
*/
public Faction getWilderness() {
com.massivecraft.factions.entity.Faction fac = FactionColl.get()
.getNone();
public PLFaction getWilderness() {
com.massivecraft.factions.entity.Faction fac = FactionColl.get().getNone();

if (fac == null)
return null;

return new Faction(fac);
return new PLFaction(fac);
}

/**
* Gets the Safezone 'faction'.
*
* @return the Safezone faction.
*/
public Faction getSafezone() {
public PLFaction getSafezone() {

com.massivecraft.factions.entity.Faction fac = FactionColl.get()
.getSafezone();
com.massivecraft.factions.entity.Faction fac = FactionColl.get().getSafezone();

if (fac == null)
return null;

return new Faction(fac);
return new PLFaction(fac);
}

/**
* Gets the Warzone 'faction'.
*
* @return the Warzone faction.
*/
public Faction getWarzone() {
com.massivecraft.factions.entity.Faction fac = FactionColl.get()
.getWarzone();
public PLFaction getWarzone() {
com.massivecraft.factions.entity.Faction fac = FactionColl.get().getWarzone();

if (fac == null)
return null;

return new Faction(fac);
return new PLFaction(fac);
}

/**
* Gets the faction at a specific {@link Location}.
*
* @param location Location for the faction to be at.
* @return A {@link Faction} or null if the location does not contain a
* @param location
* Location for the faction to be at.
* @return A {@link PLFaction} or null if the location does not contain a
* faction.
*/
public Faction getFactionAt(Location location) {
public PLFaction getFactionAt(Location location) {
if (location == null)
return null;

com.massivecraft.factions.entity.Faction fac = BoardColl.get()
.getFactionAt(PS.valueOf(location));
com.massivecraft.factions.entity.Faction fac = BoardColl.get().getFactionAt(PS.valueOf(location));

if (fac == null)
return null;

return new Faction(fac);
return new PLFaction(fac);
}

/**
* Gets the
* {@link me.staartvin.plugins.pluginlibrary.hooks.factions.MPlayer} for a
* {@link me.staartvin.plugins.pluginlibrary.hooks.factions.PLMPlayer} for a
* player, which represents the player object Factions internally uses.
*
* @param uuid UUID of the player.
* @return {@link me.staartvin.plugins.pluginlibrary.hooks.factions.MPlayer}
* @param uuid
* UUID of the player.
* @return {@link me.staartvin.plugins.pluginlibrary.hooks.factions.PLMPlayer}
* or null if player does not exist/is not stored by Factions.
*/
public me.staartvin.plugins.pluginlibrary.hooks.factions.MPlayer getFactionsPlayer(
UUID uuid) {
public me.staartvin.plugins.pluginlibrary.hooks.factions.PLMPlayer getFactionsPlayer(UUID uuid) {
MPlayer mPlayer = MPlayer.get(uuid);

if (mPlayer == null)
return null;

return new me.staartvin.plugins.pluginlibrary.hooks.factions.MPlayer(
mPlayer);
return new me.staartvin.plugins.pluginlibrary.hooks.factions.PLMPlayer(mPlayer);
}
}
2 changes: 2 additions & 0 deletions src/me/staartvin/plugins/pluginlibrary/hooks/LibraryHook.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package me.staartvin.plugins.pluginlibrary.hooks;

import org.bukkit.Bukkit;

import me.staartvin.plugins.pluginlibrary.PluginLibrary;

/**
Expand Down
17 changes: 17 additions & 0 deletions src/me/staartvin/plugins/pluginlibrary/hooks/McMMOHook.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,23 @@
import java.util.List;
import java.util.UUID;

import org.bukkit.OfflinePlayer;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;

import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.api.AbilityAPI;
import com.gmail.nossr50.api.ChatAPI;
import com.gmail.nossr50.api.ExperienceAPI;
import com.gmail.nossr50.api.PartyAPI;
import com.gmail.nossr50.api.SkillAPI;
import com.gmail.nossr50.api.exceptions.InvalidFormulaTypeException;
import com.gmail.nossr50.api.exceptions.InvalidPlayerException;
import com.gmail.nossr50.api.exceptions.InvalidSkillException;
import com.gmail.nossr50.api.exceptions.InvalidXPGainReasonException;
import com.gmail.nossr50.datatypes.party.Party;

import me.staartvin.plugins.pluginlibrary.Library;

/**
Expand Down
4 changes: 4 additions & 0 deletions src/me/staartvin/plugins/pluginlibrary/hooks/OnTimeHook.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
import java.util.HashMap;
import java.util.Map;

import me.edge209.OnTime.DataIO;
import me.edge209.OnTime.OnTimeAPI;
import me.edge209.OnTime.OnTimeAPI.topData;
import me.edge209.OnTime.PlayingTime;
import me.staartvin.plugins.pluginlibrary.Library;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
package me.staartvin.plugins.pluginlibrary.hooks;

import org.bukkit.OfflinePlayer;
import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;
import org.royaldev.royalcommands.RoyalCommands;
import org.royaldev.royalcommands.WorldManager;

import me.staartvin.plugins.pluginlibrary.Library;

/**
Expand Down
7 changes: 7 additions & 0 deletions src/me/staartvin/plugins/pluginlibrary/hooks/StatsHook.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,16 @@
import java.util.Map;
import java.util.UUID;

import org.bukkit.Material;
import org.bukkit.entity.EntityType;

import me.staartvin.plugins.pluginlibrary.Library;
import me.staartvin.plugins.pluginlibrary.hooks.customstats.FoodEatenStat;
import me.staartvin.plugins.pluginlibrary.hooks.customstats.MobKilledStat;
import nl.lolmewn.stats.api.stat.Stat;
import nl.lolmewn.stats.api.stat.StatEntry;
import nl.lolmewn.stats.api.user.StatsHolder;
import nl.lolmewn.stats.bukkit.BukkitMain;

/**
* Stats library, <a
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package me.staartvin.plugins.pluginlibrary.hooks;

import bammerbom.ultimatecore.bukkit.UltimateCore;
import me.staartvin.plugins.pluginlibrary.Library;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
import java.util.HashMap;
import java.util.Map;

import nl.lolmewn.stats.api.stat.Stat;
import nl.lolmewn.stats.api.stat.StatEntry;
import nl.lolmewn.stats.api.storage.DataType;

/**
* Stat that tracks what kind of food is eaten by a player
* <p>
Expand Down
Loading

0 comments on commit ce90fee

Please sign in to comment.