1
0
mirror of https://github.com/Minestom/Minestom.git synced 2025-03-02 11:21:15 +01:00

Resource pack cleanup

This commit is contained in:
Felix Cravic 2020-05-31 20:09:42 +02:00
parent c17aba4ac7
commit 7128844563
2 changed files with 5 additions and 7 deletions
src/main/java/net/minestom/server

View File

@ -966,7 +966,7 @@ public class Player extends LivingEntity {
}
/**
* Set the resource pack of the player
* Set the player resource pack
*
* @param resourcePack the resource pack
*/
@ -974,10 +974,7 @@ public class Player extends LivingEntity {
Check.notNull(resourcePack, "The resource pack cannot be null");
final String url = resourcePack.getUrl();
Check.notNull(url, "The resource pack url cannot be null");
// Optional hash, set to empty if null
String hash = resourcePack.getHash();
hash = hash == null ? "" : hash;
final String hash = resourcePack.getHash();
ResourcePackSendPacket resourcePackSendPacket = new ResourcePackSendPacket();
resourcePackSendPacket.url = url;

View File

@ -10,13 +10,14 @@ public class ResourcePack {
public ResourcePack(String url, String hash) {
this.url = url;
this.hash = hash;
// Optional, set to empty if null
this.hash = hash == null ? "" : hash;
}
/**
* Get the resource pack URL
*
* @return
* @return the resource pack URL
*/
public String getUrl() {
return url;