Deleted branch to clean map #48

Merged
alisolarflare merged 2 commits from GPowerUpdate into master 2016-12-30 01:46:18 +00:00
5 changed files with 22 additions and 87 deletions
Showing only changes of commit 50f5ccf9c1 - Show all commits

View file

@ -1,55 +0,0 @@
package buttondevteam.alipresents.components.gpower;
import org.bukkit.entity.Player;
import buttondevteam.alipresents.architecture.commands.ModCommand;
import buttondevteam.alipresents.components.gpower.api.GPowerAPI;
public class ApplyPowerUp extends ModCommand {
@Override
public boolean OnCommand(Player player, String alias, String[] args) {
if (args.length > 1) //No one's online
return false;
String playerArgument = args[0];
Player argPlayer = player.getServer().getPlayer(playerArgument);
if (argPlayer == null)
{
// Attempted player is not online
player.sendMessage(playerArgument + " is not online right now. Players online are: ");
player.sendMessage(player.getServer().getOnlinePlayers().toString());
if (args.length < 2){
player.sendMessage("You may apply the effect " + args[1] + "to them");
}
}
if (args.length < 2){
//recolour no colour
GPowerAPI.PowerUpPlayer(player);
return true;
}else{
GPowerAPI.PowerUpPlayer(player);
//recolour with colour
return true;
}
}
@Override
public String[] GetHelpText(String string){
return new String[]{
"Usage: /"+GetCommandPath()+"<player> <colour>",
"Use this command to apply a gpower colour to players",
};
}
@Override
public String GetCommandPath(){
return "gpower applypowerup";
}
}

View file

@ -15,9 +15,7 @@ public class GPowerComponent extends Component {
registerCommand(plugin, new Test()); registerCommand(plugin, new Test());
registerCommand(plugin, new PowerUp()); registerCommand(plugin, new PowerUp());
registerCommand(plugin, new PowerDown()); registerCommand(plugin, new PowerDown());
registerCommand(plugin, new ApplyPowerUp());
registerCommand(plugin, new ApplyPowerDown());
registerListener(plugin, new EnchantingLoop(plugin)); registerListener(plugin, new EnchantingLoop(plugin));
} }

View file

@ -18,9 +18,6 @@ public class GPowerAPI{
public static void addPlayer(Player player, String colour, boolean powerIsActive){ public static void addPlayer(Player player, String colour, boolean powerIsActive){
poweredPlayerList.put(player.getUniqueId(), new PoweredPlayer(player.getUniqueId(), colour, true)); poweredPlayerList.put(player.getUniqueId(), new PoweredPlayer(player.getUniqueId(), colour, true));
} }
public static void PowerUpPlayer(Player player, String colour){
PowerUpPlayer(player);
}
public static void PowerUpPlayer(Player player){ public static void PowerUpPlayer(Player player){
player.sendMessage("Powering up!"); player.sendMessage("Powering up!");
if(poweredPlayerList.containsKey(player.getUniqueId())){ if(poweredPlayerList.containsKey(player.getUniqueId())){
@ -36,15 +33,14 @@ public class GPowerAPI{
} }
} }
public static boolean PowerDownPlayer(Player player){ public static void PowerDownPlayer(Player player){
player.sendMessage("Powering down!"); player.sendMessage("Powering down!");
if (poweredPlayerList.containsKey(player.getUniqueId())){ if (poweredPlayerList.containsKey(player.getUniqueId())){
player.sendMessage("Powered down!"); player.sendMessage("Powered down!");
poweredPlayerList.get(player.getUniqueId()).isPowersActive = false; poweredPlayerList.get(player.getUniqueId()).isPowersActive = false;
return true;
}else{ }else{
player.sendMessage("P down!"); player.sendMessage("P down!");
return false; return;
} }
} }

View file

@ -7,19 +7,17 @@ import buttondevteam.alipresents.components.magic.tricks.AliArrowListener;
import buttondevteam.alipresents.components.magic.tricks.BoomBowDeathListener; import buttondevteam.alipresents.components.magic.tricks.BoomBowDeathListener;
import buttondevteam.alipresents.components.magic.tricks.BoomBowListener; import buttondevteam.alipresents.components.magic.tricks.BoomBowListener;
import buttondevteam.alipresents.components.magic.tricks.CannonBowListener; import buttondevteam.alipresents.components.magic.tricks.CannonBowListener;
import buttondevteam.alipresents.components.magic.tricks.CannonBowSettings;
public class MagicComponent extends Component{ public class MagicComponent extends Component{
@Override @Override
public void register(JavaPlugin plugin) { public void register(JavaPlugin plugin) {
//registerCommand(plugin, new CannonBowSettings()); registerCommand(plugin, new CannonBowSettings());
registerListener(plugin, new AliArrowListener(plugin)); registerListener(plugin, new AliArrowListener(plugin));
registerListener(plugin, new BoomBowDeathListener()); registerListener(plugin, new BoomBowDeathListener());
registerListener(plugin, new BoomBowListener(plugin)); registerListener(plugin, new BoomBowListener(plugin));
registerListener(plugin, new CannonBowListener(plugin));
CannonBowListener cbl = new CannonBowListener(plugin);
//cbl.loadSettings(plugin.getConfig());
registerListener(plugin, cbl);
} }
} }

View file

@ -56,8 +56,23 @@ public class CannonBowListener implements Listener {
static FileConfiguration config; static FileConfiguration config;
public CannonBowListener(JavaPlugin plugin){ public CannonBowListener(JavaPlugin plugin){
config = plugin.getConfig(); config = plugin.getConfig();
if (config.isDouble(speedMultiplierPath))
setSpeedMultiplier(config.getDouble(speedMultiplierPath));
if (config.isDouble(minForcePath))
setMinforce(config.getDouble(minForcePath));
if (config.isInt(fuseTicksPath))
setFuseticks(config.getInt(fuseTicksPath));
if (config.isDouble(recoilPath))
setRecoil(config.getDouble(recoilPath));
if (config.isBoolean(isDestructivePath))
setIsDestructive(config.getBoolean(isDestructivePath));
} }
@EventHandler @EventHandler
public void onProjectileLaunch(EntityShootBowEvent event){ public void onProjectileLaunch(EntityShootBowEvent event){
//Entity Sanitation //Entity Sanitation
@ -232,21 +247,4 @@ public class CannonBowListener implements Listener {
CannonBowListener.isDestructive = isDestructive; CannonBowListener.isDestructive = isDestructive;
config.set(speedMultiplierPath, isDestructive); config.set(speedMultiplierPath, isDestructive);
} }
public void loadSettings(FileConfiguration config){
if (config.isDouble(speedMultiplierPath))
setSpeedMultiplier(config.getDouble(speedMultiplierPath));
if (config.isDouble(minForcePath))
setMinforce(config.getDouble(minForcePath));
if (config.isInt(fuseTicksPath))
setFuseticks(config.getInt(fuseTicksPath));
if (config.isDouble(recoilPath))
setRecoil(config.getDouble(recoilPath));
if (config.isBoolean(isDestructivePath))
setIsDestructive(config.getBoolean(isDestructivePath));
}
} }