Skip to content

Commit c97a9ff

Browse files
committed
Fixed a bug
1 parent c7aa229 commit c97a9ff

8 files changed

Lines changed: 25 additions & 8 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ BucikTitles supports multiple GUI pages. One page can contain up to 28 titles.
2929

3030
## Screenshots
3131
![Screenshot 1](https://i.imgur.com/qu5rhT3.png)
32-
![Screenshot 2](https://i.imgur.com/98AMdNY.png)
32+
![Screenshot 2](https://i.imgur.com/LPNGeos.png)
3333
![Screenshot 3](https://media.discordapp.net/attachments/710596678486327298/713148507078524969/ezgif.com-video-to-gif_1.gif)
3434
![Screenshot 4](https://i.imgur.com/Ct4Kfen.png)
3535
![Screenshot 5](https://i.imgur.com/Qe52DAq.png)

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>pl.workonfire</groupId>
88
<artifactId>BucikTitles</artifactId>
9-
<version>1.1.2</version>
9+
<version>1.1.3</version>
1010
<packaging>jar</packaging>
1111

1212
<name>BucikTitles</name>

src/main/java/pl/workonfire/buciktitles/Main.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
/**
1010
* A very simple plugin for showing titles on chat above players heads that depends on TAB.
1111
* @author workonfire, aka Buty935
12-
* @version 1.1.2
12+
* @version 1.1.3
1313
*/
1414

1515
public final class Main extends JavaPlugin {
1616
public static Main plugin;
17-
public static final String version = "1.1.2";
17+
public static final String version = "1.1.3";
1818

1919
@Override
2020
public void onEnable() {

src/main/java/pl/workonfire/buciktitles/data/Functions.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public class Functions {
2525

2626
/**
2727
* Replaces & to § in order to show colors properly.
28+
* @since 1.0
2829
* @param text String to format
2930
* @return Formatted string
3031
*/
@@ -34,6 +35,7 @@ public static String formatColors(String text) {
3435

3536
/**
3637
* Gets access to a list of titles from a specific page.
38+
* @since 1.0
3739
* @param page GUI page
3840
* @return A set of titles
3941
*/
@@ -43,6 +45,7 @@ public static Set<String> getTitlesFromPage(int page) {
4345

4446
/**
4547
* Gets a current user title from TAB API.
48+
* @since 1.0.7
4649
* @param player Player object
4750
* @return Current user title
4851
*/
@@ -52,6 +55,7 @@ public static String getCurrentUserTitle(Player player) {
5255

5356
/**
5457
* Sets a specific texture for a player head.
58+
* @since 1.0
5559
* @param head ItemStack representation of a player head
5660
* @param value Head texture as Base64 value
5761
* @return ItemStack representation of a textured player head
@@ -74,6 +78,7 @@ public static ItemStack setHeadTexture(ItemStack head, String value) {
7478

7579
/**
7680
* Listens for errors and prints the details.
81+
* @since 1.0
7782
* @param player Player object
7883
* @param exception Exception object
7984
*/
@@ -98,6 +103,7 @@ public static void handleErrors(Player player, Exception exception) {
98103

99104
/**
100105
* Sets the TAB above name for player.
106+
* @since 1.0
101107
* @param player Player representation
102108
* @param titleID Title ID from config
103109
* @param page Page number where the title appears
@@ -107,7 +113,7 @@ public static void setTitle(Player player, String titleID, int page) {
107113
Title title = new Title(titleID, page);
108114
Sound sound;
109115
player.closeInventory();
110-
if (!getCurrentUserTitle(player).equals(title.getFormattedValue())) {
116+
if (!getCurrentUserTitle(player).equals(title.getRawValue())) {
111117
TABAPI.setValuePermanently(player.getUniqueId(), getHeadTitlePosition(), title.getRawValue());
112118
player.sendMessage(getPrefixedLanguageVariable("title-set"));
113119
sound = Sound.ENTITY_LLAMA_SWAG;
@@ -125,6 +131,7 @@ public static void setTitle(Player player, String titleID, int page) {
125131

126132
/**
127133
* Sets the raw value of a title for player.
134+
* @since 1.1.0
128135
* @param player Player representation
129136
* @param title Raw title value
130137
*/
@@ -134,6 +141,7 @@ public static void setRawTitle(Player player, String title) {
134141

135142
/**
136143
* Removes the TAB above name from player.
144+
* @since 1.0
137145
* @param player Player representation
138146
* @param silent Whether to show the info for player or not
139147
*/
@@ -161,6 +169,7 @@ public static void takeOff(Player player, boolean silent) {
161169

162170
/**
163171
* Gets the position of head title (abovename, belowname)
172+
* @since 1.0.6
164173
* @return Head title position as EnumProperty
165174
*/
166175
public static EnumProperty getHeadTitlePosition() {
@@ -176,6 +185,7 @@ public static EnumProperty getHeadTitlePosition() {
176185

177186
/**
178187
* Gets the position of head title (abovename, belowname)
188+
* @since 1.0.6
179189
* @return Head title position as String
180190
*/
181191
public static String getHeadTitlePositionAsString() {
@@ -184,6 +194,7 @@ public static String getHeadTitlePositionAsString() {
184194

185195
/**
186196
* Gets the title property name.
197+
* @since 1.1.2
187198
* @param page GUI page where the title appers
188199
* @param titleID Title ID
189200
* @param propertyName Property name
@@ -195,6 +206,7 @@ public static String getTitlePropertyName(int page, String titleID, String prope
195206

196207
/**
197208
* Gets the title GUI property name.
209+
* @since 1.1.2
198210
* @param page GUI page where the title appers
199211
* @param titleID Title ID
200212
* @param propertyName Property name

src/main/java/pl/workonfire/buciktitles/listeners/EventHandler.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import pl.workonfire.buciktitles.managers.ConfigManager;
99
import pl.workonfire.buciktitles.data.Functions;
1010

11-
1211
public class EventHandler implements Listener {
1312

1413
@org.bukkit.event.EventHandler

src/main/java/pl/workonfire/buciktitles/managers/ConfigManager.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ public class ConfigManager {
1313
private static FileConfiguration titlesConfig;
1414

1515
/**
16+
* @since 1.0.5
1617
* Initializes the configuration files.
1718
*/
1819
public static void initializeConfiguration() {
@@ -35,6 +36,7 @@ public static void initializeConfiguration() {
3536
}
3637

3738
/**
39+
* @since 1.0.5
3840
* Reloads the configuration files.
3941
*/
4042
public static void reloadConfiguration() {
@@ -43,6 +45,7 @@ public static void reloadConfiguration() {
4345
}
4446

4547
/**
48+
* @since 1.0.1
4649
* Gets a language variable value from the config.
4750
* @param variable Unparsed language variable, e.g. "no-permission"
4851
* @return Language string
@@ -53,6 +56,7 @@ public static String getLanguageVariable(String variable) {
5356

5457
/**
5558
* Gets a language variable value from the config including a prefix.
59+
* @since 1.0.7
5660
* @param variable Unparsed language variable, e.g. "no-permission"
5761
* @return Language string with prefix.
5862
*/
@@ -62,6 +66,7 @@ public static String getPrefixedLanguageVariable(String variable) {
6266

6367
/**
6468
* Gets a global plugin prefix.
69+
* @since 1.0.6
6570
* @return Plugin prefix
6671
*/
6772
public static String getPrefix() {

src/main/java/pl/workonfire/buciktitles/managers/GUIManager.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public class GUIManager {
1919

2020
/**
2121
* Shows a title selection interface for a player.
22+
* @since 1.0
2223
* @param plugin Plugin instance
2324
* @param player Player instance
2425
* @param page Page number
@@ -112,7 +113,7 @@ public static void showGUI(JavaPlugin plugin, Player player, int page) {
112113
for (String loreLine : title.getLore())
113114
titleItemLore.add(Functions.formatColors(loreLine));
114115
}
115-
if (title.getFormattedValue().equals(Functions.getCurrentUserTitle(player))) {
116+
if (title.getRawValue().equals(Functions.getCurrentUserTitle(player))) {
116117
titleItemLore.add(ConfigManager.getLanguageVariable("currently-selected"));
117118
titleItemMeta.setLore(titleItemLore);
118119
}

src/main/resources/plugin.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: BucikTitles
2-
version: 1.1.2
2+
version: 1.1.3
33
main: pl.workonfire.buciktitles.Main
44
api-version: 1.14
55
depend: [TAB]

0 commit comments

Comments
 (0)