A whole bunch of assorted changes
This commit is contained in:
parent
9b4f3f3803
commit
c120f2e46f
30 changed files with 359 additions and 480 deletions
|
@ -1,3 +1,4 @@
|
||||||
eclipse.preferences.version=1
|
eclipse.preferences.version=1
|
||||||
encoding/<project>=UTF-8
|
encoding/<project>=UTF-8
|
||||||
encoding/src=UTF-8
|
encoding/metrics=UTF-8
|
||||||
|
encoding/src=UTF-8
|
||||||
|
|
|
@ -11,10 +11,8 @@ commands:
|
||||||
description: Official g-power command that activates the ghostie powerups
|
description: Official g-power command that activates the ghostie powerups
|
||||||
powerdown:
|
powerdown:
|
||||||
description: Offical g-power command that deactivates the ghostie powerups
|
description: Offical g-power command that deactivates the ghostie powerups
|
||||||
pressalilink:
|
alilink:
|
||||||
description: Presses an Ali Link pressalilink frequency
|
description: Arguments: <press/set>
|
||||||
setalilink:
|
|
||||||
description: Creates an Ali Link setalilink frequency
|
|
||||||
cbgm0:
|
cbgm0:
|
||||||
description: Creative Boundaries Gamemode 0 - allows players to return to survival
|
description: Creative Boundaries Gamemode 0 - allows players to return to survival
|
||||||
cbgm1:
|
cbgm1:
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
package alisolarflare.architecture.commands.subcommands;
|
||||||
|
|
||||||
|
public abstract class ModSubCommand extends SubCommand{
|
||||||
|
@Override
|
||||||
|
public boolean getPlayerOnly() {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean getModOnly() {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
package alisolarflare.architecture.commands.subcommands;
|
||||||
|
|
||||||
|
public abstract class PlayerSubCommand extends SubCommand{
|
||||||
|
@Override
|
||||||
|
public boolean getModOnly() {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean getPlayerOnly() {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
package alisolarflare.architecture.commands.subcommands;
|
||||||
|
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
public abstract class SubCommand {
|
||||||
|
public abstract boolean run(Player player, String label, String[] args);
|
||||||
|
public abstract boolean getPlayerOnly();
|
||||||
|
public abstract boolean getModOnly();
|
||||||
|
public abstract String[] GetHelpText(String alias);
|
||||||
|
}
|
|
@ -8,23 +8,21 @@ import org.bukkit.Server;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
import alisolarflare.architecture.Component;
|
import alisolarflare.architecture.Component;
|
||||||
import alisolarflare.components.alilinks.commands.PressAliLink;
|
import alisolarflare.components.alilinks.commands.AliLink;
|
||||||
import alisolarflare.components.alilinks.commands.SetAliLink;
|
|
||||||
import alisolarflare.components.alilinks.entities.Link;
|
import alisolarflare.components.alilinks.entities.Link;
|
||||||
|
|
||||||
public class AliLinkComponent extends Component {
|
public class AliLinkComponent extends Component {
|
||||||
|
|
||||||
private List<Link> linkList;
|
private List<Link> linkList;
|
||||||
private List<Map<String,String>> linkData;
|
private List<Map<String,String>> linkMap;
|
||||||
@Override
|
@Override
|
||||||
public void register(JavaPlugin plugin) {
|
public void register(JavaPlugin plugin) {
|
||||||
this.linkList = MapToLinkList(plugin.getConfig().getMapList("aliLinkList"), plugin.getServer());
|
this.linkList = MapToLinkList(plugin.getConfig().getMapList("aliLinkList"), plugin.getServer());
|
||||||
for (Link link: linkList){
|
for (Link link: linkList){
|
||||||
linkData.add(link.toMap());
|
linkMap.add(link.toMap());
|
||||||
}
|
}
|
||||||
|
|
||||||
registerCommand(plugin, new PressAliLink(plugin, linkList));
|
registerCommand(plugin, new AliLink(plugin, linkList));
|
||||||
registerCommand(plugin, new SetAliLink(plugin.getConfig(), linkList, linkData));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
|
|
|
@ -1,65 +1,86 @@
|
||||||
package alisolarflare.components.alilinks.commands;
|
package alisolarflare.components.alilinks.commands;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.Arrays;
|
||||||
import java.util.Map;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.configuration.file.FileConfiguration;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
import alisolarflare.architecture.commands.PlayerCommand;
|
import alisolarflare.architecture.commands.PlayerCommand;
|
||||||
import alisolarflare.components.alilinks.entities.Link;
|
import alisolarflare.components.alilinks.entities.Link;
|
||||||
|
|
||||||
public class SetAliLink extends PlayerCommand {
|
public class AliLink extends PlayerCommand{
|
||||||
public List<Link> linkList;
|
private JavaPlugin plugin;
|
||||||
public List<Map<String, String>> linkData;
|
private List<Link> linkList;
|
||||||
private FileConfiguration config;
|
|
||||||
|
public AliLink(JavaPlugin plugin, List<Link> linkList) {
|
||||||
public SetAliLink(FileConfiguration config, List<Link> linkList, List<Map<String, String>> linkData) {
|
this.plugin = plugin;
|
||||||
this.linkList = linkList;
|
this.linkList = linkList;
|
||||||
this.linkData = linkData;
|
}
|
||||||
this.config = config;
|
@Override
|
||||||
}
|
public boolean OnCommand(Player player, String alias, String[] args) {
|
||||||
|
if(args.length < 1)
|
||||||
@Override
|
return false;
|
||||||
public boolean OnCommand(Player player, String label, String[] args) {
|
|
||||||
if (args == null || args.length < 1) {
|
switch (args[0].toLowerCase()){
|
||||||
player.sendMessage("You must specify a link frequency");
|
case "press":
|
||||||
player.sendMessage("/pressalilink [name]");
|
return press(player, alias, args);
|
||||||
return false;
|
case "set":
|
||||||
}
|
return set(player, alias, args);
|
||||||
|
default:
|
||||||
String frequency = args[0];
|
return false;
|
||||||
World world = player.getWorld();
|
}
|
||||||
int x = player.getLocation().getBlockX();
|
|
||||||
int y = player.getLocation().getBlockY();
|
}
|
||||||
int z = player.getLocation().getBlockZ();
|
/**"Usage: /pressalilink <frequency>"*/
|
||||||
|
private boolean press(Player player, String alias, String[] inputFrequencies) {
|
||||||
if (args.length > 4) {
|
if (inputFrequencies.length == 0) {
|
||||||
boolean arg1isNumber = StringUtils.isNumericSpace(args[1]);
|
player.sendMessage("You must specify a link frequency");
|
||||||
boolean arg2isNumber = StringUtils.isNumericSpace(args[2]);
|
return false;
|
||||||
boolean arg3isNumber = StringUtils.isNumericSpace(args[3]);
|
}
|
||||||
if (arg1isNumber && arg2isNumber && arg3isNumber) {
|
|
||||||
x = Integer.parseInt(args[1]);
|
List<String> inputFrequencyList= Arrays.asList(inputFrequencies);
|
||||||
y = Integer.parseInt(args[2]);
|
for (Link link : linkList) {
|
||||||
z = Integer.parseInt(args[3]);
|
if(inputFrequencyList.contains(link.frequency)){
|
||||||
}
|
link.press(plugin);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Link link = new Link(frequency, world, x, y, z);
|
|
||||||
linkList.add(link);
|
player.sendMessage("Link pressed!");
|
||||||
linkData.add(link.toMap());
|
|
||||||
saveLinkList();
|
return true;
|
||||||
return true;
|
}
|
||||||
}
|
|
||||||
private void saveLinkList(){
|
/**Usage: /setalilink <frequency> [x] [y] [z]*/
|
||||||
config.set("aliLinkList", linkData);
|
public boolean set(Player player, String label, String[] args) {
|
||||||
}
|
if (args == null || args.length < 1) {
|
||||||
@Override
|
player.sendMessage("You must specify a link frequency");
|
||||||
public String[] GetHelpText(String alias){
|
player.sendMessage("/pressalilink [name]");
|
||||||
return new String[]{
|
return false;
|
||||||
"Usage: /setalilink <frequency> [x] [y] [z]"
|
}
|
||||||
};
|
|
||||||
}
|
String frequency = args[0];
|
||||||
}
|
World world = player.getWorld();
|
||||||
|
int x = player.getLocation().getBlockX();
|
||||||
|
int y = player.getLocation().getBlockY();
|
||||||
|
int z = player.getLocation().getBlockZ();
|
||||||
|
|
||||||
|
if (args.length > 4) {
|
||||||
|
boolean arg1isNumber = StringUtils.isNumericSpace(args[1]);
|
||||||
|
boolean arg2isNumber = StringUtils.isNumericSpace(args[2]);
|
||||||
|
boolean arg3isNumber = StringUtils.isNumericSpace(args[3]);
|
||||||
|
if (arg1isNumber && arg2isNumber && arg3isNumber) {
|
||||||
|
x = Integer.parseInt(args[1]);
|
||||||
|
y = Integer.parseInt(args[2]);
|
||||||
|
z = Integer.parseInt(args[3]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Link link = new Link(frequency, world, x, y, z);
|
||||||
|
linkList.add(link);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -1,43 +0,0 @@
|
||||||
package alisolarflare.components.alilinks.commands;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
|
||||||
|
|
||||||
import alisolarflare.architecture.commands.PlayerCommand;
|
|
||||||
import alisolarflare.components.alilinks.entities.Link;
|
|
||||||
|
|
||||||
public class PressAliLink extends PlayerCommand {
|
|
||||||
private JavaPlugin plugin;
|
|
||||||
private List<Link> linkList;
|
|
||||||
|
|
||||||
public PressAliLink(JavaPlugin plugin, List<Link> linkList) {
|
|
||||||
this.plugin = plugin;
|
|
||||||
this.linkList = linkList;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean OnCommand(Player player, String label, String[] inputFrequencies) {
|
|
||||||
if (inputFrequencies.length < 1) {
|
|
||||||
player.sendMessage("You must specify a link frequency");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (Link link : linkList) {
|
|
||||||
for (String frequency : inputFrequencies) {
|
|
||||||
if (frequency.equals(link.frequency)) {
|
|
||||||
link.press(plugin);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
player.sendMessage("Link pressed!");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public String[] GetHelpText(String alias){
|
|
||||||
return new String[]{
|
|
||||||
"Usage: /pressalilink <frequency>"
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -12,6 +12,7 @@ import org.bukkit.plugin.java.JavaPlugin;
|
||||||
import alisolarflare.components.alilinks.tasks.UnpressTask;
|
import alisolarflare.components.alilinks.tasks.UnpressTask;
|
||||||
|
|
||||||
public class Link{
|
public class Link{
|
||||||
|
|
||||||
public String frequency;
|
public String frequency;
|
||||||
public World world;
|
public World world;
|
||||||
public int x;
|
public int x;
|
||||||
|
|
|
@ -23,8 +23,6 @@ public class Cbgm0 extends PlayerCommand{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
public String[] GetHelpText(String alias){
|
public String[] GetHelpText(String alias){
|
||||||
return new String[]{
|
return new String[]{"Creative Boundaries Usage: /cbgm0"};
|
||||||
"Creative Boundaries Usage: /cbgm0"
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
package alisolarflare.components.creativeboundaries.listeners;
|
|
||||||
|
|
||||||
import org.bukkit.event.Listener;
|
|
||||||
|
|
||||||
public class ItemRestrictionListener implements Listener {
|
|
||||||
}
|
|
|
@ -4,13 +4,6 @@ import org.bukkit.Location;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
import alisolarflare.architecture.Component;
|
import alisolarflare.architecture.Component;
|
||||||
import alisolarflare.components.easyuhc.commands.ActivatePowers;
|
|
||||||
import alisolarflare.components.easyuhc.commands.SetUHCLobby;
|
|
||||||
import alisolarflare.components.easyuhc.commands.SetWorldBorders;
|
|
||||||
import alisolarflare.components.easyuhc.commands.SpreadPlayers;
|
|
||||||
import alisolarflare.components.easyuhc.commands.StartTimer;
|
|
||||||
import alisolarflare.components.easyuhc.commands.StartUHC;
|
|
||||||
import alisolarflare.components.easyuhc.commands.TeleportToUHC;
|
|
||||||
|
|
||||||
public class EasyUHCComponent extends Component{
|
public class EasyUHCComponent extends Component{
|
||||||
public Location lobbyLocation;
|
public Location lobbyLocation;
|
||||||
|
@ -19,14 +12,14 @@ public class EasyUHCComponent extends Component{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
registerCommand(plugin, new ActivatePowers());
|
// registerCommand(plugin, new ActivatePowers());
|
||||||
registerCommand(plugin, new SetUHCLobby(this));
|
// registerCommand(plugin, new SetUHCLobby(this));
|
||||||
registerCommand(plugin, new SetWorldBorders());
|
// registerCommand(plugin, new SetWorldBorders());
|
||||||
registerCommand(plugin, new SetWorldBorders());
|
// registerCommand(plugin, new SetWorldBorders());
|
||||||
registerCommand(plugin, new SpreadPlayers());
|
// registerCommand(plugin, new SpreadPlayers());
|
||||||
registerCommand(plugin, new StartTimer());
|
// registerCommand(plugin, new StartTimer());
|
||||||
registerCommand(plugin, new StartUHC());
|
// registerCommand(plugin, new StartUHC());
|
||||||
registerCommand(plugin, new TeleportToUHC());
|
// registerCommand(plugin, new TeleportToUHC());
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
package alisolarflare.components.easyuhc.commands;
|
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
|
|
||||||
import alisolarflare.architecture.commands.ModCommand;
|
|
||||||
|
|
||||||
public class ActivatePowers extends ModCommand{
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean OnCommand(Player player, String alias, String[] args) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,20 +0,0 @@
|
||||||
package alisolarflare.components.easyuhc.commands;
|
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
|
|
||||||
import alisolarflare.architecture.commands.ModCommand;
|
|
||||||
import alisolarflare.components.easyuhc.EasyUHCComponent;
|
|
||||||
|
|
||||||
public class SetUHCLobby extends ModCommand{
|
|
||||||
EasyUHCComponent module;
|
|
||||||
public SetUHCLobby(EasyUHCComponent easyUHCModule) {
|
|
||||||
this.module = easyUHCModule;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean OnCommand(Player player, String alias, String[] args) {
|
|
||||||
module.lobbyLocation = player.getLocation();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,14 +0,0 @@
|
||||||
package alisolarflare.components.easyuhc.commands;
|
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
|
|
||||||
import alisolarflare.architecture.commands.ModCommand;
|
|
||||||
|
|
||||||
public class SetWorldBorders extends ModCommand {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean OnCommand(Player player, String alias, String[] args) {
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,14 +0,0 @@
|
||||||
package alisolarflare.components.easyuhc.commands;
|
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
|
|
||||||
import alisolarflare.architecture.commands.ModCommand;
|
|
||||||
|
|
||||||
public class ShrinkWorldBorders extends ModCommand {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean OnCommand(Player player, String alias, String[] args) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,15 +0,0 @@
|
||||||
package alisolarflare.components.easyuhc.commands;
|
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
|
|
||||||
import alisolarflare.architecture.commands.ModCommand;
|
|
||||||
|
|
||||||
public class SpreadPlayers extends ModCommand{
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean OnCommand(Player player, String alias, String[] args) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,14 +0,0 @@
|
||||||
package alisolarflare.components.easyuhc.commands;
|
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
|
|
||||||
import alisolarflare.architecture.commands.ModCommand;
|
|
||||||
|
|
||||||
public class StartTimer extends ModCommand{
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean OnCommand(Player player, String alias, String[] args) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,14 +0,0 @@
|
||||||
package alisolarflare.components.easyuhc.commands;
|
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
|
|
||||||
import alisolarflare.architecture.commands.ModCommand;
|
|
||||||
|
|
||||||
public class StartUHC extends ModCommand{
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean OnCommand(Player player, String alias, String[] args) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,14 +0,0 @@
|
||||||
package alisolarflare.components.easyuhc.commands;
|
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
|
|
||||||
import alisolarflare.architecture.commands.PlayerCommand;
|
|
||||||
|
|
||||||
public class TeleportToUHC extends PlayerCommand{
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean OnCommand(Player player, String alias, String[] args) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -14,39 +14,57 @@ public class PlayerProximityLoop extends BukkitRunnable implements Listener{
|
||||||
private Location startLocation;
|
private Location startLocation;
|
||||||
private Location endLocation;
|
private Location endLocation;
|
||||||
|
|
||||||
|
private int sX;
|
||||||
|
private int sY;
|
||||||
|
private int sZ;
|
||||||
|
private int eX;
|
||||||
|
private int eY;
|
||||||
|
private int eZ;
|
||||||
|
|
||||||
public PlayerProximityLoop(JavaPlugin plugin, FlairDoorComponent component) {
|
public PlayerProximityLoop(JavaPlugin plugin, FlairDoorComponent component) {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
this.component = component;
|
this.component = component;
|
||||||
this.startLocation = component.startLocation;
|
setStartLocation(component.startLocation);
|
||||||
this.endLocation = component.endLocation;
|
setEndLocation(component.endLocation);
|
||||||
this.runTaskTimer(plugin, 0, 20);
|
this.runTaskTimer(plugin, 0, 20);
|
||||||
}
|
}
|
||||||
|
public void setStartLocation(Location location){
|
||||||
|
this.sX = startLocation.getBlockX();
|
||||||
|
this.sY = startLocation.getBlockY();
|
||||||
|
this.sZ = startLocation.getBlockZ();
|
||||||
|
this.startLocation = location;
|
||||||
|
this.endLocation.setWorld(location.getWorld());
|
||||||
|
}
|
||||||
|
public void setEndLocation(Location location){
|
||||||
|
this.eX = startLocation.getBlockX();
|
||||||
|
this.eY = startLocation.getBlockY();
|
||||||
|
this.eZ = startLocation.getBlockZ();
|
||||||
|
this.endLocation = location;
|
||||||
|
this.startLocation.setWorld(location.getWorld());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if (startLocation == null || endLocation == null){
|
if (startLocation == null || endLocation == null){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int sX = startLocation.getBlockX();
|
|
||||||
int sY = startLocation.getBlockY();
|
|
||||||
int sZ = startLocation.getBlockZ();
|
|
||||||
int eX = endLocation.getBlockX();
|
|
||||||
int eY = endLocation.getBlockY();
|
|
||||||
int eZ = endLocation.getBlockZ();
|
|
||||||
int playerX;
|
int playerX;
|
||||||
int playerY;
|
int playerY;
|
||||||
int playerZ;
|
int playerZ;
|
||||||
|
Location playerLocation;
|
||||||
for (Player player : plugin.getServer().getOnlinePlayers()){
|
for (Player player : plugin.getServer().getOnlinePlayers()){
|
||||||
playerX = player.getLocation().getBlockX();
|
playerLocation = player.getLocation();
|
||||||
playerY = player.getLocation().getBlockY();
|
if(playerLocation.getWorld() != startLocation.getWorld())
|
||||||
playerZ = player.getLocation().getBlockZ();
|
|
||||||
if(player.getLocation().getWorld() != startLocation.getWorld())
|
|
||||||
continue;
|
continue;
|
||||||
if((playerX < sX && playerX < eX) ||(playerX > sX && playerX > eX))
|
|
||||||
|
playerX = playerLocation.getBlockX();
|
||||||
|
if((playerX < sX && playerX < eX) || (playerX > sX && playerX > eX))
|
||||||
continue;
|
continue;
|
||||||
if((playerY < sY && playerY < eY) ||(playerY > sY && playerY > eY))
|
playerY = playerLocation.getBlockY();
|
||||||
|
if((playerY < sY && playerY < eY) || (playerY > sY && playerY > eY))
|
||||||
continue;
|
continue;
|
||||||
if((playerZ < sZ && playerZ < eZ) ||(playerZ > sZ && playerZ > eZ))
|
playerZ = playerLocation.getBlockZ();
|
||||||
|
if((playerZ < sZ && playerZ < eZ) || (playerZ > sZ && playerZ > eZ))
|
||||||
continue;
|
continue;
|
||||||
component.playersToBeFlaired.add(player);
|
component.playersToBeFlaired.add(player);
|
||||||
|
|
||||||
|
|
|
@ -1,110 +1,111 @@
|
||||||
package alisolarflare.components.magic.tricks;
|
package alisolarflare.components.magic.tricks;
|
||||||
|
|
||||||
import org.bukkit.GameMode;
|
import org.bukkit.GameMode;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.Particle;
|
import org.bukkit.Particle;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.enchantments.Enchantment;
|
import org.bukkit.enchantments.Enchantment;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.block.Action;
|
import org.bukkit.event.block.Action;
|
||||||
import org.bukkit.event.player.PlayerInteractEvent;
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.inventory.PlayerInventory;
|
||||||
import org.bukkit.potion.PotionEffect;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
import org.bukkit.potion.PotionEffectType;
|
import org.bukkit.potion.PotionEffect;
|
||||||
|
import org.bukkit.potion.PotionEffectType;
|
||||||
public class BoomBowListener implements Listener {
|
|
||||||
JavaPlugin plugin;
|
public class BoomBowListener implements Listener {
|
||||||
public BoomBowListener(JavaPlugin plugin){
|
JavaPlugin plugin;
|
||||||
this.plugin = plugin;
|
public BoomBowListener(JavaPlugin plugin){
|
||||||
}
|
this.plugin = plugin;
|
||||||
@EventHandler
|
}
|
||||||
public void ClickEvent(PlayerInteractEvent event){
|
@EventHandler
|
||||||
FlyBowBoost(event);
|
public void ClickEvent(PlayerInteractEvent event){
|
||||||
|
FlyBowBoost(event);
|
||||||
}
|
|
||||||
public void FlyBowBoost(PlayerInteractEvent event){
|
}
|
||||||
|
public void FlyBowBoost(PlayerInteractEvent event){
|
||||||
//ACTION SANITATION
|
|
||||||
if(!(event.getAction() == Action.LEFT_CLICK_AIR || event.getAction() == Action.LEFT_CLICK_BLOCK)) return;
|
//ACTION SANITATION
|
||||||
if(!(event.getPlayer().isGliding())) return;
|
if(!(event.getAction() == Action.LEFT_CLICK_AIR || event.getAction() == Action.LEFT_CLICK_BLOCK)) return;
|
||||||
if(!(event.getMaterial() == Material.BOW)) return;
|
if(!(event.getPlayer().isGliding())) return;
|
||||||
|
if(!(event.getMaterial() == Material.BOW)) return;
|
||||||
//BOW SANITATION
|
|
||||||
ItemStack bow = event.getItem();
|
//BOW SANITATION
|
||||||
if(!(bow.containsEnchantment(Enchantment.ARROW_KNOCKBACK))) return;
|
ItemStack bow = event.getItem();
|
||||||
if(!(bow.getEnchantmentLevel(Enchantment.ARROW_KNOCKBACK) == 3)) return;
|
if(!(bow.containsEnchantment(Enchantment.ARROW_KNOCKBACK))) return;
|
||||||
if(!(bow.getItemMeta().getDisplayName().contains("BOOM BOW"))) return;
|
if(!(bow.getEnchantmentLevel(Enchantment.ARROW_KNOCKBACK) == 3)) return;
|
||||||
|
if(!(bow.getItemMeta().getDisplayName().contains("BOOM BOW"))) return;
|
||||||
//PLAYER SANITATION
|
|
||||||
Player player = event.getPlayer();
|
//PLAYER SANITATION
|
||||||
if(player.getGameMode().equals(GameMode.CREATIVE))return;
|
Player player = event.getPlayer();
|
||||||
|
PlayerInventory inventory = player.getInventory();
|
||||||
if(bow.containsEnchantment(Enchantment.ARROW_INFINITE)){
|
if(player.getGameMode().equals(GameMode.SPECTATOR))return;
|
||||||
//HAS INIFINITY
|
|
||||||
Activate(event);
|
if(bow.containsEnchantment(Enchantment.ARROW_INFINITE)){
|
||||||
|
//HAS INIFINITY
|
||||||
}else if((player.getInventory().contains(Material.TNT))){
|
Activate(event);
|
||||||
//HAS TNT
|
|
||||||
Activate(event);
|
}else if((inventory.contains(Material.TNT))){
|
||||||
|
//HAS TNT
|
||||||
//Reduce tnt by 1
|
Activate(event);
|
||||||
int tntSlot = player.getInventory().first(Material.TNT);
|
|
||||||
ItemStack tntStack = player.getInventory().getItem(tntSlot);
|
//Reduce TNT
|
||||||
if(tntStack.getAmount() > 3){
|
ItemStack tnt = inventory.getItem(inventory.first(Material.TNT));
|
||||||
tntStack.setAmount(tntStack.getAmount()-3);
|
|
||||||
}else{
|
if(tnt.getAmount() > 3){
|
||||||
player.getInventory().remove(tntStack);
|
tnt.setAmount(tnt.getAmount()-3);
|
||||||
}
|
}else{
|
||||||
if (bow.getDurability() < 0){
|
inventory.remove(tnt);
|
||||||
player.getInventory().clear(player.getInventory().getHeldItemSlot());
|
}
|
||||||
}
|
if (bow.getDurability() < 0){
|
||||||
|
inventory.clear(inventory.getHeldItemSlot());
|
||||||
}else{
|
}
|
||||||
return;
|
|
||||||
}
|
}else{
|
||||||
}
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void Activate(PlayerInteractEvent event){
|
|
||||||
//INIT - Player variables
|
|
||||||
Player player = event.getPlayer();
|
public void Activate(PlayerInteractEvent event){
|
||||||
Location playerLocation = player.getLocation();
|
//INIT - Player variables
|
||||||
ItemStack boomBow = player.getInventory().getItemInMainHand();
|
Player player = event.getPlayer();
|
||||||
|
Location playerLocation = player.getLocation();
|
||||||
//TODO: NERF - boomDecay
|
ItemStack boomBow = player.getInventory().getItemInMainHand();
|
||||||
//TODO: NERF - endCrystal
|
|
||||||
//TODO: NERF - healthReduction
|
//TODO: NERF - boomDecay
|
||||||
//TODO: NERF - localized
|
//TODO: NERF - endCrystal
|
||||||
|
//TODO: NERF - healthReduction
|
||||||
if(BoomBowRule.boomDecay)
|
//TODO: NERF - localized
|
||||||
new BoomDecayTask(player).runTaskTimer(plugin, 1, 1);
|
|
||||||
if(BoomBowRule.endCrystal){
|
if(BoomBowRule.boomDecay)
|
||||||
//BoomBowCyrstalSpawn
|
new BoomDecayTask(player).runTaskTimer(plugin, 1, 1);
|
||||||
}
|
if(BoomBowRule.endCrystal){
|
||||||
if(BoomBowRule.healthReduction){
|
//BoomBowCyrstalSpawn
|
||||||
player.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST, 400, -1));
|
}
|
||||||
}
|
if(BoomBowRule.healthReduction){
|
||||||
if(BoomBowRule.localized);
|
player.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST, 400, -1));
|
||||||
|
}
|
||||||
|
if(BoomBowRule.localized);
|
||||||
//SET - Player Velocity
|
|
||||||
player.setVelocity(playerLocation.getDirection().normalize().multiply(3.0));
|
|
||||||
|
//SET - Player Velocity
|
||||||
//CREATE - Explosion + damage
|
player.setVelocity(playerLocation.getDirection().normalize().multiply(3.0));
|
||||||
player.getWorld().playSound(playerLocation, Sound.ENTITY_GENERIC_EXPLODE, 10, -20);
|
|
||||||
player.getWorld().spawnParticle(Particle.EXPLOSION_HUGE, playerLocation, 2);
|
//CREATE - Explosion + damage
|
||||||
player.damage(7.42425, player);
|
player.getWorld().playSound(playerLocation, Sound.ENTITY_GENERIC_EXPLODE, 10, -20);
|
||||||
boomBow.setDurability((short) (boomBow.getDurability() + 3));
|
player.getWorld().spawnParticle(Particle.EXPLOSION_HUGE, playerLocation, 2);
|
||||||
if(boomBow.getDurability() < 0){
|
player.damage(7.42425, player);
|
||||||
player.getInventory().setItemInMainHand(null);
|
boomBow.setDurability((short) (boomBow.getDurability() + 3));
|
||||||
player.getWorld().playSound(playerLocation, Sound.ENTITY_ITEM_BREAK, 0, 0)
|
if(boomBow.getDurability() > 385){
|
||||||
;
|
player.getInventory().setItemInMainHand(null);
|
||||||
}
|
player.getWorld().playSound(playerLocation, Sound.ENTITY_ITEM_BREAK, 0, 0);
|
||||||
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -17,6 +17,7 @@ import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
public class CannonBowListener implements Listener {
|
public class CannonBowListener implements Listener {
|
||||||
|
public final static String launchedTNTName = "CANNON BOW TNT:42170";
|
||||||
JavaPlugin plugin;
|
JavaPlugin plugin;
|
||||||
public CannonBowListener(JavaPlugin plugin){
|
public CannonBowListener(JavaPlugin plugin){
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
|
@ -24,32 +25,33 @@ public class CannonBowListener implements Listener {
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onProjectileLaunch(ProjectileLaunchEvent event){
|
public void onProjectileLaunch(ProjectileLaunchEvent event){
|
||||||
if(event.getEntity().getType() != EntityType.ARROW)
|
//ENTITY SANITATION
|
||||||
return;
|
if(event.getEntity().getType() != EntityType.ARROW)return;
|
||||||
|
|
||||||
|
//ARROW SANITATION
|
||||||
Arrow arrow = (Arrow) event.getEntity();
|
Arrow arrow = (Arrow) event.getEntity();
|
||||||
if (!(arrow.isCritical()) || !(arrow.getShooter() instanceof Player))
|
if (!(arrow.isCritical()) || !(arrow.getShooter() instanceof Player))return;
|
||||||
return;
|
|
||||||
|
//PLAYER SANITATION
|
||||||
Player player = (Player) arrow.getShooter();
|
Player player = (Player) arrow.getShooter();
|
||||||
|
if (!player.getInventory().contains(Material.TNT))return;
|
||||||
|
|
||||||
|
//BOW SANITATION
|
||||||
ItemStack bow;
|
ItemStack bow;
|
||||||
if ((bow = player.getInventory().getItemInMainHand()).getType() != Material.BOW)
|
if (!((bow = player.getInventory().getItemInMainHand()).getType() == Material.BOW))return;
|
||||||
return;
|
if (!(bow.containsEnchantment(Enchantment.PROTECTION_EXPLOSIONS)))return;
|
||||||
if (!bow.containsEnchantment(Enchantment.PROTECTION_EXPLOSIONS))
|
if (!(bow.getEnchantmentLevel(Enchantment.PROTECTION_EXPLOSIONS) == 10))return;
|
||||||
return;
|
if (!(bow.getItemMeta().getDisplayName().toUpperCase().contains("CANNON BOW")))return;
|
||||||
if(!(bow.getEnchantmentLevel(Enchantment.PROTECTION_EXPLOSIONS) == 10))
|
|
||||||
return;
|
|
||||||
if (!bow.getItemMeta().getDisplayName().toUpperCase().contains("CANNON BOW"))
|
|
||||||
return;
|
|
||||||
if (!player.getInventory().contains(Material.TNT))
|
|
||||||
return;
|
|
||||||
|
|
||||||
TNTPrimed tnt = (TNTPrimed) arrow.getWorld().spawnEntity(arrow.getLocation(), EntityType.PRIMED_TNT);
|
TNTPrimed tnt = (TNTPrimed) arrow.getWorld().spawnEntity(arrow.getLocation(), EntityType.PRIMED_TNT);
|
||||||
tnt.setVelocity(player.getEyeLocation().getDirection().normalize().multiply(1.0));
|
tnt.setVelocity(player.getEyeLocation().getDirection().normalize().multiply(1.0));
|
||||||
tnt.setCustomName("CANNON BOW TNT");
|
tnt.setCustomName(launchedTNTName);
|
||||||
tnt.setFuseTicks(40);
|
tnt.setFuseTicks(40);
|
||||||
|
|
||||||
player.setVelocity(player.getEyeLocation().getDirection().normalize().multiply(-1));
|
player.setVelocity(player.getEyeLocation().getDirection().normalize().multiply(-1));
|
||||||
player.getWorld().playSound(player.getLocation(), Sound.ENTITY_GENERIC_EXPLODE, 2.0F, 0);
|
player.getWorld().playSound(player.getLocation(), Sound.ENTITY_GENERIC_EXPLODE, 2.0F, 0);
|
||||||
player.getWorld().spawnParticle(Particle.EXPLOSION_NORMAL, player.getLocation(), 1);
|
player.getWorld().spawnParticle(Particle.EXPLOSION_HUGE, player.getLocation(), 2);
|
||||||
|
|
||||||
arrow.remove();
|
arrow.remove();
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -57,10 +59,9 @@ public class CannonBowListener implements Listener {
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onTnTExplode(EntityExplodeEvent event) {
|
public void onTnTExplode(EntityExplodeEvent event) {
|
||||||
if (event.getEntityType() != EntityType.PRIMED_TNT)
|
if (event.getEntityType() != EntityType.PRIMED_TNT) return;
|
||||||
return;
|
if (!event.getEntity().getCustomName().equals(launchedTNTName)) return;
|
||||||
if (!event.getEntity().getCustomName().equals("CANNON BOW TNT"))
|
|
||||||
return;
|
|
||||||
Location loc = event.getEntity().getLocation();
|
Location loc = event.getEntity().getLocation();
|
||||||
event.getEntity().getWorld().createExplosion(loc.getX(), loc.getY(), loc.getZ(), 3, false, false);
|
event.getEntity().getWorld().createExplosion(loc.getX(), loc.getY(), loc.getZ(), 3, false, false);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
|
|
@ -2,6 +2,7 @@ package alisolarflare.components.minigames;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
import alisolarflare.architecture.Component;
|
import alisolarflare.architecture.Component;
|
||||||
|
@ -14,7 +15,7 @@ import alisolarflare.components.minigames.data.SpawnSet;
|
||||||
public class MinigameComponent extends Component{
|
public class MinigameComponent extends Component{
|
||||||
public SpawnSet spawnSet;
|
public SpawnSet spawnSet;
|
||||||
public List<String> fighters;
|
public List<String> fighters;
|
||||||
private GameState gameState;
|
public GameState gameState;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void register(JavaPlugin plugin) {
|
public void register(JavaPlugin plugin) {
|
||||||
|
@ -25,9 +26,11 @@ public class MinigameComponent extends Component{
|
||||||
registerCommand(plugin, new ListFighters(this));
|
registerCommand(plugin, new ListFighters(this));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
public class Fighter {
|
||||||
public GameState getGameState() {return gameState;}
|
public Player player;
|
||||||
public void setGameState(GameState gameState) {this.gameState = gameState;}
|
public String colour;
|
||||||
|
public Fighter(Player player, String colour){
|
||||||
|
this.colour = colour;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,28 +1,25 @@
|
||||||
package alisolarflare.components.minigames.commands;
|
package alisolarflare.components.minigames.commands;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import alisolarflare.architecture.commands.PlayerCommand;
|
import alisolarflare.architecture.commands.PlayerCommand;
|
||||||
import alisolarflare.components.minigames.MinigameComponent;
|
import alisolarflare.components.minigames.MinigameComponent;
|
||||||
|
|
||||||
public class JoinMinigame extends PlayerCommand {
|
public class JoinMinigame extends PlayerCommand {
|
||||||
private MinigameComponent module;
|
private List<String> fighterList;
|
||||||
|
|
||||||
public JoinMinigame(MinigameComponent module) {
|
public JoinMinigame(MinigameComponent component) {
|
||||||
this.module = module;
|
this.fighterList = component.fighters;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean OnCommand(Player player, String arg2, String[] arg3) {
|
public boolean OnCommand(Player player, String arg2, String[] arg3) {
|
||||||
String name = player.getName();
|
if (fighterList.contains(player.getName())) {
|
||||||
if (module.fighters.contains(name)) {
|
|
||||||
player.sendMessage("You are already in the minigame!");
|
player.sendMessage("You are already in the minigame!");
|
||||||
return true;
|
}else{
|
||||||
}
|
fighterList.add(player.getName());
|
||||||
|
|
||||||
module.fighters.add(name);
|
|
||||||
|
|
||||||
if (module.fighters.contains(name)) {
|
|
||||||
player.sendMessage("You have joined the minigame!");
|
player.sendMessage("You have joined the minigame!");
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -1,16 +1,17 @@
|
||||||
package alisolarflare.components.minigames.commands;
|
package alisolarflare.components.minigames.commands;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import alisolarflare.architecture.commands.PlayerCommand;
|
import alisolarflare.architecture.commands.PlayerCommand;
|
||||||
import alisolarflare.components.minigames.MinigameComponent;
|
import alisolarflare.components.minigames.MinigameComponent;
|
||||||
|
|
||||||
public class LeaveMinigame extends PlayerCommand {
|
public class LeaveMinigame extends PlayerCommand {
|
||||||
|
private List<String> fighters;
|
||||||
|
|
||||||
private MinigameComponent module;
|
public LeaveMinigame(MinigameComponent components) {
|
||||||
|
this.fighters = components.fighters;
|
||||||
public LeaveMinigame(MinigameComponent module) {
|
|
||||||
this.module = module;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -18,15 +19,14 @@ public class LeaveMinigame extends PlayerCommand {
|
||||||
if(!(player instanceof Player))
|
if(!(player instanceof Player))
|
||||||
player.sendMessage("You must be a player to use this command!");
|
player.sendMessage("You must be a player to use this command!");
|
||||||
|
|
||||||
|
|
||||||
String name = player.getName();
|
String name = player.getName();
|
||||||
if (!(module.fighters.contains(name))) {
|
if (!(fighters.contains(name))) {
|
||||||
player.sendMessage("You are not fighting!");
|
player.sendMessage("You are not fighting!");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
while(module.fighters.contains(name)){
|
while(fighters.contains(name)){
|
||||||
module.fighters.remove(name);
|
fighters.remove(name);
|
||||||
}
|
}
|
||||||
player.sendMessage("You have left the fighters category!");
|
player.sendMessage("You have left the fighters category!");
|
||||||
|
|
||||||
|
|
|
@ -6,15 +6,15 @@ import alisolarflare.architecture.commands.PlayerCommand;
|
||||||
import alisolarflare.components.minigames.MinigameComponent;
|
import alisolarflare.components.minigames.MinigameComponent;
|
||||||
|
|
||||||
public class ListFighters extends PlayerCommand {
|
public class ListFighters extends PlayerCommand {
|
||||||
private MinigameComponent lobby;
|
private MinigameComponent component;
|
||||||
|
|
||||||
public ListFighters(MinigameComponent lobby) {
|
public ListFighters(MinigameComponent component) {
|
||||||
this.lobby = lobby;
|
this.component = component;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean OnCommand(Player player, String arg2, String[] arg3) {
|
public boolean OnCommand(Player player, String arg2, String[] arg3) {
|
||||||
player.sendMessage(lobby.fighters.toString());
|
player.sendMessage(component.fighters.toString());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -7,7 +7,7 @@ import alisolarflare.components.minigames.data.SpawnSet;
|
||||||
|
|
||||||
public class SetColourSpawn extends ModCommand{
|
public class SetColourSpawn extends ModCommand{
|
||||||
private SpawnSet spawnSet;
|
private SpawnSet spawnSet;
|
||||||
|
|
||||||
public SetColourSpawn(SpawnSet spawnSet){
|
public SetColourSpawn(SpawnSet spawnSet){
|
||||||
this.spawnSet = spawnSet;
|
this.spawnSet = spawnSet;
|
||||||
}
|
}
|
||||||
|
@ -17,41 +17,41 @@ public class SetColourSpawn extends ModCommand{
|
||||||
player.sendMessage("ERROR: Arguments required.");
|
player.sendMessage("ERROR: Arguments required.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
String input = args[0];
|
String input = args[0];
|
||||||
|
|
||||||
input.toLowerCase();
|
input.toLowerCase();
|
||||||
switch(input){
|
switch(input){
|
||||||
case ("r"):
|
case ("r"):
|
||||||
player.sendMessage("Setting Red Spawn...");
|
player.sendMessage("Setting Red Spawn...");
|
||||||
spawnSet.setRSpawn(player.getLocation());
|
spawnSet.RSpawn = player.getLocation();
|
||||||
player.sendMessage("Red Spawn Set!");
|
player.sendMessage("Red Spawn Set!");
|
||||||
break;
|
break;
|
||||||
case ("o"):
|
case ("o"):
|
||||||
player.sendMessage("Setting Orange Spawn...");
|
player.sendMessage("Setting Orange Spawn...");
|
||||||
spawnSet.setRSpawn(player.getLocation());
|
spawnSet.OSpawn = player.getLocation();
|
||||||
player.sendMessage("Orange Spawn Set!");
|
player.sendMessage("Orange Spawn Set!");
|
||||||
break;
|
break;
|
||||||
case ("y"):
|
case ("y"):
|
||||||
player.sendMessage("Setting Yellow Spawn...");
|
player.sendMessage("Setting Yellow Spawn...");
|
||||||
spawnSet.setRSpawn(player.getLocation());
|
spawnSet.YSpawn = player.getLocation();
|
||||||
player.sendMessage("Yellow Spawn Set!");
|
player.sendMessage("Yellow Spawn Set!");
|
||||||
break;
|
break;
|
||||||
case ("g"):
|
case ("g"):
|
||||||
player.sendMessage("Setting Green Spawn...");
|
player.sendMessage("Setting Green Spawn...");
|
||||||
spawnSet.setRSpawn(player.getLocation());
|
spawnSet.GSpawn = player.getLocation();
|
||||||
player.sendMessage("Green Spawn Set!");
|
player.sendMessage("Green Spawn Set!");
|
||||||
break;
|
break;
|
||||||
case ("b"):
|
case ("b"):
|
||||||
player.sendMessage("Setting Blue Spawn...");
|
player.sendMessage("Setting Blue Spawn...");
|
||||||
spawnSet.setRSpawn(player.getLocation());
|
spawnSet.BSpawn = player.getLocation();
|
||||||
player.sendMessage("Blue Spawn Set!");
|
player.sendMessage("Blue Spawn Set!");
|
||||||
break;
|
break;
|
||||||
case ("p"):
|
case ("p"):
|
||||||
player.sendMessage("Setting Purple Spawn...");
|
player.sendMessage("Setting Purple Spawn...");
|
||||||
spawnSet.setRSpawn(player.getLocation());
|
spawnSet.PSpawn = player.getLocation();
|
||||||
player.sendMessage("Purple Spawn Set!");
|
player.sendMessage("Purple Spawn Set!");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,25 +3,11 @@ package alisolarflare.components.minigames.data;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
|
|
||||||
public class SpawnSet {
|
public class SpawnSet {
|
||||||
private Location RSpawn;
|
public Location RSpawn;
|
||||||
private Location OSpawn;
|
public Location OSpawn;
|
||||||
private Location YSpawn;
|
public Location YSpawn;
|
||||||
private Location GSpawn;
|
public Location GSpawn;
|
||||||
private Location BSpawn;
|
public Location BSpawn;
|
||||||
private Location PSpawn;
|
public Location PSpawn;
|
||||||
|
|
||||||
public Location getRSpawn(){return RSpawn;}
|
|
||||||
public Location getOSpawn(){return OSpawn;}
|
|
||||||
public Location getYSpawn(){return YSpawn;}
|
|
||||||
public Location getGSpawn(){return GSpawn;}
|
|
||||||
public Location getBSpawn(){return BSpawn;}
|
|
||||||
public Location getPSpawn(){return PSpawn;}
|
|
||||||
|
|
||||||
public void setRSpawn(Location RSpawn){this.RSpawn = RSpawn; return;}
|
|
||||||
public void setOSpawn(Location OSpawn){this.OSpawn = OSpawn; return;}
|
|
||||||
public void setYSpawn(Location YSpawn){this.YSpawn = YSpawn; return;}
|
|
||||||
public void setGSpawn(Location GSpawn){this.GSpawn = GSpawn; return;}
|
|
||||||
public void setBSpawn(Location BSpawn){this.BSpawn = BSpawn; return;}
|
|
||||||
public void setPSpawn(Location PSpawn){this.PSpawn = PSpawn; return;}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
package alisolarflare.components.minigames.entities;
|
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
|
|
||||||
public class Fighter {
|
|
||||||
public Player player;
|
|
||||||
public String colour;
|
|
||||||
public Fighter(Player player, String colour){
|
|
||||||
this.colour = colour;
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in a new issue