Skip to content

Commit 3e31914

Browse files
committed
Update to support latest MC
1 parent c17c4ef commit 3e31914

25 files changed

Lines changed: 205 additions & 181 deletions

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ jobs:
1515
steps:
1616
- uses: actions/checkout@v2
1717

18-
- name: setup JDK 11
18+
- name: setup JDK 24
1919
uses: actions/setup-java@v2
2020
with:
21-
java-version: '11'
22-
distribution: 'adopt'
21+
java-version: '24'
22+
distribution: 'corretto'
2323
cache: maven
2424

2525
- name: cache maven packages

.github/workflows/publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ jobs:
1414

1515
steps:
1616
- uses: actions/checkout@v2
17-
- name: setup JDK 11
17+
- name: setup JDK 24
1818
uses: actions/setup-java@v2
1919
with:
20-
java-version: '11'
21-
distribution: 'adopt'
20+
java-version: '24'
21+
distribution: 'corretto'
2222
server-id: majek-repo
2323
settings-path: ${{ github.workspace }}
2424

README.md

Lines changed: 36 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,29 @@
1-
<img align="right" src="https://github.com/MajekDev/SimpleHomes/blob/main/img/logo.png?raw=true" height="200" width="220">
2-
<h1 align="center">SimpleHomes by Majekdor</h1>
1+
<img align="right" src="https://github.com/MajekDev/SimpleHomes/blob/main/img/logo.png?raw=true" height="200" width="220" alt="SimpleHomes logo">
2+
<h1>SimpleHomes by Majekdor</h1>
33

4-
SimpleHomes is a stable base homes plugin. It offers all the essential features necessary in a homes plugin and some additional useful permissions. If you're looking for a more featured homes plugin with many more commands/permissions, then you'll want to take a look at UltimateHomes.
4+
SimpleHomes is a stable base homes plugin. It offers all the essential features necessary in a home plugin and some additional useful permissions.
55

6-
## Commands
6+
<img src="https://github.com/MajekDev/SimpleHomes/blob/main/img/features.png?raw=true" alt="Commands">
77

8-
There are only 5 commands in SimpleHomes.
9-
- **/sethome [name]** - Set a new home at your current location.
10-
- **/home [player|name] [name]** - Teleport to a certain home.
11-
- **/homes [player]** - View a paginated list of homes.
12-
- **/delhome [player|name] [name]** - Delete a certain home.
13-
- **/simplehomes [help|reload]** - Get help or reload the plugin.
8+
- User data stored in separate JSON files.
9+
- Paginated homes list with clickable text to traverse pages/go to homes.
10+
- All messages sent by the plugin are changeable/translatable.
11+
- Full PlaceholderAPI support.
12+
- Metrics through bStats.
13+
- Boss bar for teleport delay.
14+
- Permission-based max homes.
15+
- Completely open-source.
1416

15-
## Permissions
17+
<img src="https://github.com/MajekDev/SimpleHomes/blob/main/img/commands.png?raw=true" alt="Commands">
18+
19+
There are only five commands in SimpleHomes.
20+
- `/sethome [name]` - Set a new home at your current location.
21+
- `/home [player|name] [name]` - Teleport to a certain home.
22+
- `/homes [player]` - View a paginated list of homes.
23+
- `/delhome [player|name] [name]` - Delete a certain home.
24+
- `/simplehomes [help|reload]` - Get help or reload the plugin.
25+
26+
<img src="https://github.com/MajekDev/SimpleHomes/blob/main/img/permissions.png?raw=true" alt="Permissions">
1627

1728
There are a number of permissions available to modify what certain players can do.
1829

@@ -27,39 +38,40 @@ These are given to all players automatically, but can be negated with a permissi
2738
These are only given to opped players automatically:
2839
- `simplehomes.delhome.other` - Allows players to delete another player's home.
2940
- `simplehomes.home.other` - Allows players to travel to another player's home.
30-
- `simplehomes.homes.other` - Allows players to view other player's homes.
41+
- `simplehomes.homes.other` - Allows players to view another player's homes.
3142
- `simplehomes.reload` - Allows players to reload the plugin.
3243
- `simplehomes.sethome.unlimited` - Allows players to set unlimited homes.
3344
- `simplehomes.delay.bypass` - Allows players to bypass the teleport delay.
3445

3546
To set a player's max homes limit with permissions use `simplehomes.sethome.max.<integer>`, replacing `<integer>` with the number of max homes.
3647

37-
> Note: If you set a lower home limit than what has been set before, the lower limit will not overwrite the higher limit. Meaning if a player has, for example, a home limit of 5 and you set it to 3 via permissions, it will remain 5. To lower it you must manually edit the player's JSON file.
48+
> Note: If you set a lower home limit than what has been set before, the lower limit will not overwrite the higher limit. Meaning if a player has, for example, a home limit of 5, and you set it to 3 via permissions, it will remain 5. To lower it, you must manually edit the player's JSON file.
3849
39-
## Configuration
50+
<img src="https://github.com/MajekDev/SimpleHomes/blob/main/img/configuration.png?raw=true" alt="Configuration">
4051

41-
The default `config.yml` is available [here](https://github.com/MajekDev/SimpleHomes/blob/main/src/main/resources/config.yml) where a handful of configuration options can be changed. To make these changes take effect run `/simplehomes reload`. If you have questions about the configuration or want to suggest a new configuration option you can discuss that in [Discord](https://discord.majek.dev).
52+
The default `config.yml` is available [here](https://github.com/MajekDev/SimpleHomes/blob/main/src/main/resources/config.yml) where a handful of configuration options can be changed. To make these changes take effect run `/simplehomes reload`. If you have questions about the configuration or want to suggest a new configuration option, you can discuss that in [Discord](https://discord.majek.dev).
4253

43-
All messages sent by SimpleHomes are stored in the `lang.yml` file [here](https://github.com/MajekDev/SimpleHomes/blob/main/src/main/resources/lang.yml) and can be changed/translated. Color codes and other formatting are done using [MiniMessage](https://docs.adventure.kyori.net/minimessage.html#the-components). Legacy color codes (`&c`, `&l`, etc.) will not work. Those are being removed from Minecraft entirely in the near future.
54+
All messages sent by SimpleHomes are stored in the `lang.yml` file [here](https://github.com/MajekDev/SimpleHomes/blob/main/src/main/resources/lang.yml) and can be changed/translated. Color codes and other formatting are done using [MiniMessage](https://docs.adventure.kyori.net/minimessage.html#the-components). Legacy color codes (`&c`, `&l`, etc.) will not work. Those are being removed from Minecraft entirely soon.
4455

45-
## For the nerds... I meean devs :P
56+
## Support
4657

47-
SimpleHomes stores homes using JSON. When the plugin is installed the `playerdata` folder is created and every player has a file named with their unique id. When homes are set/deleted the file updates in real time. The plugin also depends heavily on [adventure](https://github.com/KyoriPowered/adventure) by Kyori for components in chat. SimpleHomes has an API and documentation for that is coming.
58+
<img src="https://github.com/MajekDev/SimpleHomes/blob/main/img/support.png?raw=true" alt="Configuration">
4859

49-
## Support
60+
If you need help with the plugin and can't find the answer here, then the best way to get help is to join my [Discord](https://discord.gg/CGgvDUz). Make sure you read the frequently asked channel before posting in the bug-reports channel (if it's a bug) or in the simple-homes channel (for general help).
5061

51-
If you need help with the plugin and can't find the answer here or on Spigot, then the best way to get help is to join my [Discord](https://discord.gg/CGgvDUz). Make sure you read the frequently-asked channel before posting in the bug-reports channel (if it's a bug) or in the simple-homes channel (for general help).
62+
If you have discovered a bug, you can either join my [Discord](https://discord.gg/CGgvDUz) and report it there or open an issue here on GitHub.
5263

53-
If you have discovered a bug you can either join my [Discord](https://discord.gg/CGgvDUz) and report it there or open an issue here on GitHub. Please do not message me on Spigot in regard to a bug, there are easier ways to communicate.
64+
## For the nerds... I mean devs :P
5465

66+
SimpleHomes stores homes using JSON. When the plugin is installed the `playerdata` folder is created and every player has a file named with their unique id. When homes are set/deleted the file updates in real time. The plugin also depends heavily on [adventure](https://github.com/KyoriPowered/adventure) by Kyori for components in chat. SimpleHomes has an API and documentation for that is coming.
5567

56-
## Contributing
68+
### Contributing
5769

5870
SimpleHomes is open-source and licensed under the [MIT License](https://github.com/MajekDev/SimpleHomes/blob/main/LICENSE), so if you want to use any code contained in the plugin or clone the repository and make some changes, go ahead!
5971

60-
If you've found a bug within the plugin and would like to just make the changes to fix it yourself, you're free to do so and make a pull request here on GitHub. If you make significant contributions to the project, and by significant I mean one little PR to fix a tiny bug doesn't count as significant, you can earn the Contributor role in my [Discord](https://discord.gg/CGgvDUz).
72+
If you've found a bug within the plugin and would like to just make the changes to fix it yourself, you're free to do so and make a pull request on GitHub. If you make significant contributions to the project, and by significant I mean one little PR to fix a tiny bug doesn't count as significant, you can earn the Contributor role in my [Discord](https://discord.gg/CGgvDUz).
6173

6274

6375
## Donate
6476

65-
I'm a full time college student who makes and supports these plugins in my free time (when I have any). As a long time supporter of open source, most of my plugins are free. If you enjoy my plugins and would like to support me, you can buy me coffee over on [PayPal](https://paypal.com/paypalme/majekdor). Donations of any amount are appreciated and a donation of $10 or more will get you the Supporter role in my [Discord](https://discord.gg/CGgvDUz)!
77+
I'm a full-time developer who makes and supports these plugins in my free time (when I have any). As a long-time supporter of open source, most of my plugins are free. If you enjoy my plugins and would like to support me, you can buy me coffee over on [PayPal](https://paypal.com/paypalme/majekdor). Donations of any amount are appreciated, and a donation of $10 or more will get you the Supporter role in my [Discord](https://discord.gg/CGgvDUz)!

pom.xml

Lines changed: 14 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>dev.majek.simplehomes</groupId>
88
<artifactId>SimpleHomes</artifactId>
9-
<version>1.0.3</version>
9+
<version>1.1.0</version>
1010
<packaging>jar</packaging>
1111

1212
<name>SimpleHomes</name>
@@ -30,16 +30,16 @@
3030
<plugin>
3131
<groupId>org.apache.maven.plugins</groupId>
3232
<artifactId>maven-compiler-plugin</artifactId>
33-
<version>3.8.1</version>
33+
<version>3.11.0</version>
3434
<configuration>
35-
<source>11</source>
36-
<target>11</target>
35+
<source>24</source>
36+
<target>24</target>
3737
</configuration>
3838
</plugin>
3939
<plugin>
4040
<groupId>org.apache.maven.plugins</groupId>
4141
<artifactId>maven-shade-plugin</artifactId>
42-
<version>3.2.4</version>
42+
<version>3.6.2</version>
4343
<executions>
4444
<execution>
4545
<phase>package</phase>
@@ -90,67 +90,53 @@
9090

9191
<repositories>
9292
<repository>
93-
<id>papermc-repo</id>
94-
<url>https://papermc.io/repo/repository/maven-public/</url>
93+
<id>papermc</id>
94+
<url>https://repo.papermc.io/repository/maven-public/</url>
9595
</repository>
9696
<repository>
9797
<id>sonatype</id>
9898
<url>https://oss.sonatype.org/content/groups/public/</url>
9999
</repository>
100100
<repository>
101101
<id>placeholderapi</id>
102-
<url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
102+
<url>https://repo.helpch.at/releases/</url>
103103
</repository>
104104
</repositories>
105105

106106
<dependencies>
107107
<!-- PaperMC -->
108108
<dependency>
109-
<groupId>com.destroystokyo.paper</groupId>
109+
<groupId>io.papermc.paper</groupId>
110110
<artifactId>paper-api</artifactId>
111-
<version>1.16.5-R0.1-SNAPSHOT</version>
111+
<version>[26.1.2.build,)</version>
112112
<scope>provided</scope>
113113
</dependency>
114114
<!-- PlaceholderAPI -->
115115
<dependency>
116116
<groupId>me.clip</groupId>
117117
<artifactId>placeholderapi</artifactId>
118-
<version>2.10.10</version>
118+
<version>2.12.2</version>
119119
<scope>provided</scope>
120120
</dependency>
121-
<!-- Adventure API -->
122-
<dependency>
123-
<groupId>net.kyori</groupId>
124-
<artifactId>adventure-api</artifactId>
125-
<version>4.9.3</version>
126-
<scope>compile</scope>
127-
</dependency>
128121
<!-- Adventure - Bukkit Specific -->
129122
<dependency>
130123
<groupId>net.kyori</groupId>
131124
<artifactId>adventure-platform-bukkit</artifactId>
132-
<version>4.0.0</version>
133-
<scope>compile</scope>
134-
</dependency>
135-
<!-- Adventure MiniMessage -->
136-
<dependency>
137-
<groupId>net.kyori</groupId>
138-
<artifactId>adventure-text-minimessage</artifactId>
139-
<version>4.1.0-SNAPSHOT</version>
125+
<version>4.4.1</version>
140126
<scope>compile</scope>
141127
</dependency>
142128
<!-- GSON -->
143129
<dependency>
144130
<groupId>com.google.code.gson</groupId>
145131
<artifactId>gson</artifactId>
146-
<version>2.8.9</version>
132+
<version>2.14.0</version>
147133
<scope>compile</scope>
148134
</dependency>
149135
<!-- bStats -->
150136
<dependency>
151137
<groupId>org.bstats</groupId>
152138
<artifactId>bstats-bukkit</artifactId>
153-
<version>2.2.1</version>
139+
<version>3.2.1</version>
154140
<scope>compile</scope>
155141
</dependency>
156142
<!-- ConfigUpdater -->

src/main/java/dev/majek/simplehomes/SimpleHomes.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ public void onEnable() {
6363
} catch (IOException | JsonParseException e) {
6464
SimpleHomes.core().getLogger().severe("Critical error loading player data from "
6565
+ dataStorage.getFile().getName());
66-
e.printStackTrace();
6766
continue;
6867
}
6968
addToUserMap(new HomesPlayer(dataStorage, fileContents));
@@ -114,18 +113,18 @@ public void reload() {
114113
try {
115114
ConfigUpdater.update(core, "config.yml", configFile, Collections.emptyList());
116115
} catch (IOException e) {
117-
e.printStackTrace();
116+
this.getLogger().severe("Failed to update config.yml");
118117
}
119118
reloadConfig();
120119

121120
// Initialize lang config
122-
YAMLConfig langConfig = new YAMLConfig(core, null, "lang.yml");
121+
YAMLConfig langConfig = new YAMLConfig(core, "lang.yml");
123122
File langFile = new File(core.getDataFolder(), "lang.yml");
124123
langConfig.saveDefaultConfig();
125124
try {
126125
ConfigUpdater.update(core, "lang.yml", langFile, Collections.emptyList());
127126
} catch (IOException e) {
128-
e.printStackTrace();
127+
this.getLogger().severe("Failed to update lang.yml");
129128
}
130129
langConfig.reloadConfig();
131130
lang = langConfig.getConfig();
@@ -200,7 +199,7 @@ public Map<UUID, HomesPlayer> getUserMap() {
200199
* @param location Teleport destination.
201200
*/
202201
public void safeTeleportPlayer(final Player player, final Location location) {
203-
player.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 140, 7));
202+
player.addPotionEffect(new PotionEffect(PotionEffectType.RESISTANCE, 140, 7));
204203
player.teleport(location);
205204
player.setFallDistance(0);
206205
player.setVelocity(new Vector(0, 0.3, 0));

src/main/java/dev/majek/simplehomes/api/HomeDeleteEvent.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ public Home home() {
6262
* Whether or not the {@link #player()} is attempting to delete a home that belongs to them.
6363
* @return Own home?
6464
*/
65+
@SuppressWarnings("unused")
6566
public boolean deletingOwnHome() {
6667
return deletingOwnHome;
6768
}
@@ -88,8 +89,4 @@ public void setCancelled(boolean cancel) {
8889
public @NotNull HandlerList getHandlers() {
8990
return HANDLER_LIST;
9091
}
91-
92-
public static HandlerList getHandlerList() {
93-
return HANDLER_LIST;
94-
}
9592
}

src/main/java/dev/majek/simplehomes/api/HomeSetEvent.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,4 @@ public void setCancelled(boolean cancel) {
7676
public @NotNull HandlerList getHandlers() {
7777
return HANDLER_LIST;
7878
}
79-
80-
public static HandlerList getHandlerList() {
81-
return HANDLER_LIST;
82-
}
8379
}

src/main/java/dev/majek/simplehomes/api/HomeTeleportEvent.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ public Location teleportingTo() {
8080
* Set where the {@link #player()} is teleporting to.
8181
* @param teleportingTo Teleport location.
8282
*/
83+
@SuppressWarnings("unused")
8384
public void teleportingTo(Location teleportingTo) {
8485
this.teleportingTo = teleportingTo;
8586
}
@@ -88,6 +89,7 @@ public void teleportingTo(Location teleportingTo) {
8889
* The location the {@link #player()} is teleporting from. This cannot be changed.
8990
* @return Previous location.
9091
*/
92+
@SuppressWarnings("unused")
9193
public Location teleportingFrom() {
9294
return teleportingFrom;
9395
}
@@ -104,6 +106,7 @@ public boolean noTeleportDelay() {
104106
* Set whether or not the {@link #player()} should teleport without a delay.
105107
* @param hasTeleportDelay Teleport delay?
106108
*/
109+
@SuppressWarnings("unused")
107110
public void hasTeleportDelay(boolean hasTeleportDelay) {
108111
this.hasTeleportDelay = hasTeleportDelay;
109112
}
@@ -120,6 +123,7 @@ public int teleportDelay() {
120123
* Set the teleport delay for the teleporting {@link #player()}.
121124
* @param teleportDelay Teleport delay.
122125
*/
126+
@SuppressWarnings("unused")
123127
public void teleportDelay(int teleportDelay) {
124128
this.teleportDelay = teleportDelay;
125129
}
@@ -128,6 +132,7 @@ public void teleportDelay(int teleportDelay) {
128132
* Whether or not the {@link #player()} is teleporting to their own {@link #home()}.
129133
* @return Own home?
130134
*/
135+
@SuppressWarnings("unused")
131136
public boolean toOwnHome() {
132137
return toOwnHome;
133138
}
@@ -155,7 +160,4 @@ public void setCancelled(boolean cancel) {
155160
return HANDLER_LIST;
156161
}
157162

158-
public static HandlerList getHandlerList() {
159-
return HANDLER_LIST;
160-
}
161163
}

src/main/java/dev/majek/simplehomes/api/SimpleHomesAPI.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public void callEvent(Event event) {
3030
* @param name The home name for lookup.
3131
* @return {@link HomesPlayer}s with a home matching the name.
3232
*/
33+
@SuppressWarnings("unused")
3334
public List<HomesPlayer> homeLookup(String name) {
3435
List<HomesPlayer> owners = new ArrayList<>();
3536
for (HomesPlayer homesPlayer : SimpleHomes.core().getUserMap().values()) {
@@ -45,6 +46,7 @@ public List<HomesPlayer> homeLookup(String name) {
4546
* @param player The player.
4647
* @return List of homes.
4748
*/
49+
@SuppressWarnings("unused")
4850
public List<Home> getHomes(Player player) {
4951
return SimpleHomes.core().getHomesPlayer(player.getUniqueId()).getHomes();
5052
}
@@ -54,6 +56,7 @@ public List<Home> getHomes(Player player) {
5456
* @param player The offline player.
5557
* @return List of homes.
5658
*/
59+
@SuppressWarnings("unused")
5760
public List<Home> getHomes(OfflinePlayer player) {
5861
return SimpleHomes.core().getHomesPlayer(player.getUniqueId()).getHomes();
5962
}
@@ -64,6 +67,7 @@ public List<Home> getHomes(OfflinePlayer player) {
6467
* @param name The name of the new home.
6568
* @param location The location of the new home.
6669
*/
70+
@SuppressWarnings("unused")
6771
public void createHome(Player player, String name, Location location) {
6872
SimpleHomes.core().getHomesPlayer(player.getUniqueId()).addHome(new Home(name, location));
6973
}

0 commit comments

Comments
 (0)