Skip to content
This repository was archived by the owner on Jan 7, 2023. It is now read-only.

Commit e3fcce4

Browse files
committed
Fix API errors
1 parent fe7542f commit e3fcce4

File tree

5 files changed

+238
-119
lines changed

5 files changed

+238
-119
lines changed

lib/SimpleGems-2.0.jar

4.95 KB
Binary file not shown.

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<modelVersion>4.0.0</modelVersion>
66

7-
<groupId>me.refrac</groupId>
7+
<groupId>me.refracdevelopment</groupId>
88
<artifactId>SimpleGemsAPI</artifactId>
9-
<version>2.0-SNAPSHOT</version>
9+
<version>2.1-SNAPSHOT</version>
1010
<packaging>jar</packaging>
1111

1212
<name>SimpleGemsAPI</name>

src/main/java/me/refracdevelopment/simplegems/api/GemsAPI.java

Lines changed: 11 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@
2121
*/
2222
package me.refracdevelopment.simplegems.api;
2323

24-
import me.refracdevelopment.simplegems.plugin.manager.ProfileData;
25-
import org.bukkit.OfflinePlayer;
26-
import org.bukkit.entity.Player;
24+
import me.refracdevelopment.simplegems.api.manager.*;
2725
import org.bukkit.plugin.IllegalPluginAccessException;
2826

2927
/**
@@ -37,129 +35,25 @@ public class GemsAPI {
3735
* @return Is the SimpleGemsAPI enabled and registered?
3836
*/
3937
public static boolean isRegistered() {
40-
throw new IllegalPluginAccessException("API is not registered!");
38+
throw new IllegalPluginAccessException("SimpleGemsAPI is not registered!");
4139
}
4240

4341
/**
44-
* Used to get a player's profile data.
42+
* The #getProfileManager method allows you to use settings inside the
43+
* profile management class. This gives you info on gems, settings, and more.
4544
*
46-
* @return Player's profile
45+
* @return player's profile.
4746
*/
48-
public ProfileData getProfileData(Player player) {
49-
throw new IllegalPluginAccessException("API is not registered!");
47+
public ProfileManager getProfileManager() {
48+
throw new IllegalPluginAccessException("SimpleGemsAPI is not registered!");
5049
}
5150

5251
/**
53-
* Used to get player gems.
52+
* The #getProfileData method allows you to get a player's profile data.
5453
*
55-
* @param player player
56-
* @return Player's gems
54+
* @return player's profile data.
5755
*/
58-
public double getGems(Player player) {
59-
throw new IllegalPluginAccessException("API is not registered!");
60-
}
61-
62-
/**
63-
* Used to get offline player gems.
64-
*
65-
* @param player player
66-
* @return Player's gems
67-
*/
68-
public double getOfflineGems(OfflinePlayer player) {
69-
throw new IllegalPluginAccessException("API is not registered!");
70-
}
71-
72-
/**
73-
* This will give gems in item form
74-
* to the player who withdraw them or
75-
* received them by doing events etc
76-
*
77-
* @param player player profile
78-
* @param amount gems to remove and turn into an item
79-
*/
80-
public void giveGemsItem(Player player, int amount) {
81-
throw new IllegalPluginAccessException("API is not registered!");
82-
}
83-
84-
/**
85-
* Used to check if the player has enough gems
86-
*
87-
* @param player player
88-
* @param amount gems
89-
* @return If the player has enough gems
90-
*/
91-
public boolean hasGems(Player player, double amount) {
92-
throw new IllegalPluginAccessException("API is not registered!");
93-
}
94-
95-
/**
96-
* Used to check if the offline player has enough gems
97-
*
98-
* @param player player
99-
* @param amount gems
100-
* @return If the player has enough gems
101-
*/
102-
public boolean hasOfflineGems(Player player, double amount) {
103-
throw new IllegalPluginAccessException("API is not registered!");
104-
}
105-
106-
/**
107-
* Used to give player gems.
108-
*
109-
* @param player player
110-
* @param amount gems
111-
*/
112-
public void giveGems(Player player, double amount) {
113-
throw new IllegalPluginAccessException("API is not registered!");
114-
}
115-
116-
/**
117-
* Used to give offline player gems.
118-
*
119-
* @param player player
120-
* @param amount gems
121-
*/
122-
public void giveOfflineGems(OfflinePlayer player, double amount) {
123-
throw new IllegalPluginAccessException("API is not registered!");
124-
}
125-
126-
/**
127-
* Used to take player gems.
128-
*
129-
* @param player data
130-
* @param amount gems
131-
*/
132-
public void takeGems(Player player, double amount) {
133-
throw new IllegalPluginAccessException("API is not registered!");
134-
}
135-
136-
/**
137-
* Used to take offline player gems.
138-
*
139-
* @param player data
140-
* @param amount gems
141-
*/
142-
public void takeOfflineGems(OfflinePlayer player, double amount) {
143-
throw new IllegalPluginAccessException("API is not registered!");
144-
}
145-
146-
/**
147-
* Used to set player gems.
148-
*
149-
* @param player data
150-
* @param amount gems
151-
*/
152-
public void setGems(Player player, double amount) {
153-
throw new IllegalPluginAccessException("API is not registered!");
154-
}
155-
156-
/**
157-
* Used to set offline player gems.
158-
*
159-
* @param player data
160-
* @param amount gems
161-
*/
162-
public void setOfflineGems(OfflinePlayer player, double amount) {
163-
throw new IllegalPluginAccessException("API is not registered!");
56+
public ProfileData getProfileData() {
57+
throw new IllegalPluginAccessException("SimpleGemsAPI is not registered!");
16458
}
16559
}
Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
/*
2+
* The MIT License (MIT)
3+
*
4+
* Copyright (c) 2022 RefracDevelopment
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in
14+
* all copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
17+
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
18+
* PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
19+
* FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20+
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21+
*/
22+
package me.refracdevelopment.simplegems.api.manager;
23+
24+
import org.bukkit.OfflinePlayer;
25+
import org.bukkit.entity.Player;
26+
import org.bukkit.inventory.ItemStack;
27+
import org.bukkit.plugin.IllegalPluginAccessException;
28+
29+
public class ProfileData {
30+
31+
/**
32+
* Used to get player gems.
33+
*
34+
* @param player data
35+
* @return Player's gems
36+
*/
37+
public double getGems(Player player) {
38+
throw new IllegalPluginAccessException("SimpleGemsAPI is not registered!");
39+
}
40+
41+
/**
42+
* Used to get offline player gems.
43+
*
44+
* @param player data
45+
* @return Player's gems
46+
*/
47+
public double getOfflineGems(OfflinePlayer player) {
48+
throw new IllegalPluginAccessException("SimpleGemsAPI is not registered!");
49+
}
50+
51+
/**
52+
* This will give gems in item form
53+
* to the player who withdraw them or
54+
* received them by doing events etc
55+
*
56+
* @param player player profile
57+
* @param amount gems to remove and turn into an item
58+
*/
59+
public void giveGemsItem(Player player, int amount) {
60+
throw new IllegalPluginAccessException("SimpleGemsAPI is not registered!");
61+
}
62+
63+
/**
64+
* This will give gems in item form
65+
* to the player who withdraw them or
66+
* received them by doing events etc
67+
*
68+
* @return an item stack to redeem gems
69+
*/
70+
public ItemStack getGemsItem() {
71+
throw new IllegalPluginAccessException("SimpleGemsAPI is not registered!");
72+
}
73+
74+
/**
75+
* Used to check if the player has enough gems
76+
*
77+
* @param player player
78+
* @param amount gems
79+
* @return If the player has enough gems
80+
*/
81+
public boolean hasGems(Player player, double amount) {
82+
throw new IllegalPluginAccessException("SimpleGemsAPI is not registered!");
83+
}
84+
85+
/**
86+
* Used to check if the offline player has enough gems
87+
*
88+
* @param player player
89+
* @param amount gems
90+
* @return If the player has enough gems
91+
*/
92+
public boolean hasGems(OfflinePlayer player, double amount) {
93+
throw new IllegalPluginAccessException("SimpleGemsAPI is not registered!");
94+
}
95+
96+
/**
97+
* Used to give player gems.
98+
*
99+
* @param player player
100+
* @param amount gems
101+
*/
102+
public void giveGems(Player player, double amount) {
103+
throw new IllegalPluginAccessException("SimpleGemsAPI is not registered!");
104+
}
105+
106+
/**
107+
* Used to give offline player gems.
108+
*
109+
* @param player player
110+
* @param amount gems
111+
*/
112+
public void giveOfflineGems(OfflinePlayer player, double amount) {
113+
throw new IllegalPluginAccessException("SimpleGemsAPI is not registered!");
114+
}
115+
116+
/**
117+
* Used to take player gems.
118+
*
119+
* @param player player
120+
* @param amount gems
121+
*/
122+
public void takeGems(Player player, double amount) {
123+
throw new IllegalPluginAccessException("SimpleGemsAPI is not registered!");
124+
}
125+
126+
/**
127+
* Used to take offline player gems.
128+
*
129+
* @param player player
130+
* @param amount gems
131+
*/
132+
public void takeOfflineGems(OfflinePlayer player, double amount) {
133+
throw new IllegalPluginAccessException("SimpleGemsAPI is not registered!");
134+
}
135+
136+
/**
137+
* Used to set player gems.
138+
*
139+
* @param player player
140+
* @param amount gems
141+
*/
142+
public void setGems(Player player, double amount) {
143+
throw new IllegalPluginAccessException("SimpleGemsAPI is not registered!");
144+
}
145+
146+
/**
147+
* Used to set offline player gems.
148+
*
149+
* @param player player
150+
* @param amount gems
151+
*/
152+
public void setOfflineGems(OfflinePlayer player, double amount) {
153+
throw new IllegalPluginAccessException("SimpleGemsAPI is not registered!");
154+
}
155+
}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
/*
2+
* The MIT License (MIT)
3+
*
4+
* Copyright (c) 2022 RefracDevelopment
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in
14+
* all copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
17+
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
18+
* PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
19+
* FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20+
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21+
*/
22+
package me.refracdevelopment.simplegems.api.manager;
23+
24+
import me.refracdevelopment.simplegems.plugin.manager.Profile;
25+
import org.bukkit.plugin.IllegalPluginAccessException;
26+
27+
import java.util.Map;
28+
import java.util.UUID;
29+
30+
public class ProfileManager {
31+
32+
/**
33+
* Used to create a player's profile.
34+
* This is done on the first join of the player.
35+
*
36+
* @param uuid Player's UUID
37+
* @param name Player's name
38+
*/
39+
public void handleProfileCreation(UUID uuid, String name) {
40+
throw new IllegalPluginAccessException("SimpleGemsAPI is not registered!");
41+
}
42+
43+
/**
44+
* Used to get a player's profile.
45+
*
46+
* @param object Player's UUID or Name
47+
* @return Player's profile
48+
*/
49+
public Profile getProfile(Object object) {
50+
throw new IllegalPluginAccessException("SimpleGemsAPI is not registered!");
51+
}
52+
53+
/**
54+
* Used to get the list of profiles.
55+
*
56+
* @return List of profiles
57+
*/
58+
public Map<UUID, Profile> getProfiles() {
59+
throw new IllegalPluginAccessException("SimpleGemsAPI is not registered!");
60+
}
61+
62+
/**
63+
* Used to set the list of profiles.
64+
*
65+
* @param profiles List of profiles
66+
*/
67+
public void setProfiles(Map<UUID, Profile> profiles) {
68+
throw new IllegalPluginAccessException("SimpleGemsAPI is not registered!");
69+
}
70+
}

0 commit comments

Comments
 (0)