Skip to content

Commit cba6c3d

Browse files
committed
Add VelocityAPI & BungeeAPI
1 parent e7796f5 commit cba6c3d

File tree

5 files changed

+243
-3
lines changed

5 files changed

+243
-3
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Phoenix-API (Version: 1.7.5)
1+
# Phoenix-API (Version: 1.7.5.1)
22
This is the API for Phoenix & pxQueue!
33

44
## Installing
@@ -27,7 +27,7 @@ Add this to your `pom.xml` under `<dependencies>`:
2727
<dependency>
2828
<groupId>xyz.refinedev.phoenix</groupId>
2929
<artifactId>pxAPI</artifactId>
30-
<version>1.7.5</version>
30+
<version>1.7.5.1</version>
3131
<scope>provided</scope>
3232
</dependency>
3333
```

pom.xml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
<groupId>xyz.refinedev.phoenix</groupId>
1616
<artifactId>pxAPI</artifactId>
17-
<version>1.7.5</version>
17+
<version>1.7.5.1</version>
1818

1919
<properties>
2020
<maven.compiler.source>1.8</maven.compiler.source>
@@ -23,13 +23,29 @@
2323
</properties>
2424

2525
<repositories>
26+
<repository>
27+
<id>bungeecord-repo</id>
28+
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
29+
</repository>
2630
<repository>
2731
<id>refine-public</id>
2832
<url>https://maven.refinedev.xyz/repository/public-repo/</url>
2933
</repository>
3034
</repositories>
3135

3236
<dependencies>
37+
<dependency>
38+
<groupId>com.velocitypowered</groupId>
39+
<artifactId>velocity-api</artifactId>
40+
<version>3.2.0-SNAPSHOT</version>
41+
<scope>provided</scope>
42+
</dependency>
43+
<dependency>
44+
<groupId>net.md-5</groupId>
45+
<artifactId>bungeecord-api</artifactId>
46+
<version>1.18-R0.1-SNAPSHOT</version>
47+
<scope>provided</scope>
48+
</dependency>
3349
<dependency>
3450
<groupId>org.projectlombok</groupId>
3551
<artifactId>lombok</artifactId>
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
package xyz.refinedev.phoenix;
2+
3+
import lombok.experimental.UtilityClass;
4+
import net.md_5.bungee.api.config.ServerInfo;
5+
import net.md_5.bungee.api.connection.ProxiedPlayer;
6+
import org.bukkit.plugin.IllegalPluginAccessException;
7+
import xyz.refinedev.phoenix.profile.Profile;
8+
import xyz.refinedev.phoenix.server.ServerData;
9+
import xyz.refinedev.phoenix.utils.Pair;
10+
11+
import java.util.List;
12+
13+
/**
14+
* This Project is the property of Refine Development © 2023
15+
* Redistribution of this Project is not allowed
16+
*
17+
* @author Creaxx
18+
* Created At: 15/12/2022
19+
* Project: Phoenix
20+
*/
21+
22+
@UtilityClass
23+
public class BungeeAPI {
24+
public boolean isUuid(String string) {
25+
throw new IllegalPluginAccessException("You need to install the plugin.");
26+
}
27+
28+
/**
29+
* Get a Random Server for the Player
30+
*
31+
* @param player {@link ProxiedPlayer} Player
32+
* @return {@link ServerInfo} Server
33+
*/
34+
public ServerInfo getRandomServer(ProxiedPlayer player) {
35+
throw new IllegalPluginAccessException("You need to install the plugin.");
36+
}
37+
38+
/**
39+
* Get a Random Auth Server for the Player
40+
*
41+
* @param player {@link ProxiedPlayer} Player
42+
* @return {@link ServerInfo} Server
43+
*/
44+
public ServerInfo getRandomAuthServer(ProxiedPlayer player) {
45+
throw new IllegalPluginAccessException("You need to install the plugin.");
46+
}
47+
48+
/**
49+
* Get a Player's UUID by Fake Name
50+
*
51+
* @param fakeName {@link String} Fake Name
52+
* @return {@link String} UUID
53+
*/
54+
public String getUuidByFakeName(String fakeName) {
55+
throw new IllegalPluginAccessException("You need to install the plugin.");
56+
}
57+
58+
/**
59+
* Kick unwhitelisted Players
60+
*/
61+
public void kickUnwhitelistedUsers() {
62+
throw new IllegalPluginAccessException("You need to install the plugin.");
63+
}
64+
65+
/**
66+
* Get a Result for if a Profile can
67+
* join with current whitelist settings
68+
*
69+
* @param profile {@link Profile} Profile
70+
* @return {@link Pair<Boolean, String>} Can Join, Kick Message
71+
*/
72+
public Pair<Boolean, String> canJoinWhitelist(Profile profile) {
73+
throw new IllegalPluginAccessException("You need to install the plugin.");
74+
}
75+
76+
77+
/**
78+
* Get a Result for if a Profile can join
79+
* a server with current whitelist settings
80+
*
81+
* @param profile {@link Profile} Profile
82+
* @param serverData {@link ServerData} Server
83+
* @return {@link Boolean} Can Join
84+
*/
85+
public boolean canJoinWhitelist(Profile profile, ServerData serverData) {
86+
throw new IllegalPluginAccessException("You need to install the plugin.");
87+
}
88+
89+
/**
90+
* Format a List in to a Kick Message
91+
*
92+
* @param source {@link List<String>} Source
93+
* @return {@link String} Kick Message
94+
*/
95+
public String getKickMessage(List<String> source) {
96+
throw new IllegalPluginAccessException("You need to install the plugin.");
97+
}
98+
}
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
package xyz.refinedev.phoenix;
2+
3+
import com.velocitypowered.api.proxy.Player;
4+
import com.velocitypowered.api.proxy.server.RegisteredServer;
5+
import lombok.experimental.UtilityClass;
6+
import net.kyori.adventure.text.TextComponent;
7+
import org.bukkit.plugin.IllegalPluginAccessException;
8+
import xyz.refinedev.phoenix.profile.Profile;
9+
import xyz.refinedev.phoenix.server.ServerData;
10+
import xyz.refinedev.phoenix.utils.Pair;
11+
12+
import java.util.List;
13+
14+
/**
15+
* This Project is the property of Refine Development © 2023
16+
* Redistribution of this Project is not allowed
17+
*
18+
* @author Creaxx
19+
* Created At: 15/12/2022
20+
* Project: Phoenix
21+
*/
22+
23+
@UtilityClass
24+
public class VelocityAPI {
25+
public boolean isUuid(String string) {
26+
throw new IllegalPluginAccessException("You need to install the plugin.");
27+
}
28+
29+
/**
30+
* Get a Random Server for the Player
31+
*
32+
* @param player {@link RegisteredServer} Player
33+
* @return {@link Player} Server
34+
*/
35+
public RegisteredServer getRandomServer(Player player) {
36+
throw new IllegalPluginAccessException("You need to install the plugin.");
37+
}
38+
39+
/**
40+
* Get a Random Auth Server for the Player
41+
*
42+
* @param player {@link Player} Player
43+
* @return {@link RegisteredServer} Server
44+
*/
45+
public RegisteredServer getRandomAuthServer(Player player) {
46+
throw new IllegalPluginAccessException("You need to install the plugin.");
47+
}
48+
49+
/**
50+
* Get a Player's UUID by Fake Name
51+
*
52+
* @param fakeName {@link String} Fake Name
53+
* @return {@link String} UUID
54+
*/
55+
public String getUuidByFakeName(String fakeName) {
56+
throw new IllegalPluginAccessException("You need to install the plugin.");
57+
}
58+
59+
/**
60+
* Kick unwhitelisted Players
61+
*/
62+
public void kickUnwhitelistedUsers() {
63+
throw new IllegalPluginAccessException("You need to install the plugin.");
64+
}
65+
66+
/**
67+
* Get a Result for if a Profile can
68+
* join with current whitelist settings
69+
*
70+
* @param profile {@link Profile} Profile
71+
* @return {@link Pair<Boolean, TextComponent>} Can Join, Kick Message
72+
*/
73+
public Pair<Boolean, TextComponent> canJoinWhitelist(Profile profile) {
74+
throw new IllegalPluginAccessException("You need to install the plugin.");
75+
}
76+
77+
/**
78+
* Get a Result for if a Profile can join
79+
* a server with current whitelist settings
80+
*
81+
* @param profile {@link Profile} Profile
82+
* @param serverData {@link ServerData} Server
83+
* @return {@link Boolean} Can Join
84+
*/
85+
public boolean canJoinWhitelist(Profile profile, ServerData serverData) {
86+
throw new IllegalPluginAccessException("You need to install the plugin.");
87+
}
88+
89+
90+
/**
91+
* Format a List in to a Kick Message
92+
*
93+
* @param source {@link List<String>} Source
94+
* @return {@link String} Kick Message
95+
*/
96+
public String getKickMessage(List<String> source) {
97+
throw new IllegalPluginAccessException("You need to install the plugin.");
98+
}
99+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package xyz.refinedev.phoenix.utils;
2+
3+
import lombok.Getter;
4+
5+
/**
6+
* This Project is the property of Refine Development © 2023
7+
* Redistribution of this Project is not allowed
8+
*
9+
* @author Creaxx
10+
* Created At: 08/12/2022
11+
* Project: Phoenix
12+
*/
13+
14+
@Getter
15+
public class Pair<K, V> {
16+
public final K first;
17+
public final V second;
18+
19+
private Pair(K first, V second) {
20+
this.first = first;
21+
this.second = second;
22+
}
23+
24+
public static <K, V> Pair<K, V> of(K a, V b) {
25+
return new Pair<>(a, b);
26+
}
27+
}

0 commit comments

Comments
 (0)