Update to Minecraft 1.21.8, add checkstyle, fix compilation errors
- Update Paper API: 1.20.1 -> 1.21.4 - Update plugin version: 1.5.5-1.20.1 -> 1.5.5-1.21.8 - Add checkstyle plugin with reasonable rules - Fix Enchantment.LUCK -> Enchantment.UNBREAKING - Fix EntityType.FIREWORK -> EntityType.FIREWORK_ROCKET - Remove unused imports - Add temp_*/ to .gitignore - 118 files changed, 1633 insertions(+), 1301 deletions(-)
This commit is contained in:
parent
6a4c8a7886
commit
e78d8a2de4
121 changed files with 1792 additions and 1301 deletions
|
|
@ -22,7 +22,7 @@ public class GradientLuckPermsHook {
|
|||
|
||||
public GradientLuckPermsHook(JavaPlugin plugin) {
|
||||
this.enabled = false;
|
||||
|
||||
|
||||
if (Bukkit.getPluginManager().isPluginEnabled("LuckPerms")) {
|
||||
try {
|
||||
this.luckPerms = LuckPermsProvider.get();
|
||||
|
|
@ -40,12 +40,12 @@ public class GradientLuckPermsHook {
|
|||
|
||||
public void setPrefix(Player player, String prefix) {
|
||||
if (!isEnabled()) return;
|
||||
|
||||
|
||||
User user = luckPerms.getUserManager().getUser(player.getUniqueId());
|
||||
if (user == null) return;
|
||||
|
||||
user.data().clear(node ->
|
||||
node instanceof PrefixNode && ((PrefixNode) node).getPriority() == GradientConstants.LUCKPERMS_PREFIX_PRIORITY
|
||||
user.data().clear(node ->
|
||||
node instanceof PrefixNode && ((PrefixNode) node).getPriority() == GradientConstants.LUCKPERMS_PREFIX_PRIORITY
|
||||
);
|
||||
|
||||
if (prefix != null && !prefix.isEmpty()) {
|
||||
|
|
@ -58,12 +58,12 @@ public class GradientLuckPermsHook {
|
|||
|
||||
public void setPrefix(UUID uuid, String prefix) {
|
||||
if (!isEnabled()) return;
|
||||
|
||||
|
||||
luckPerms.getUserManager().loadUser(uuid).thenAccept(user -> {
|
||||
if (user == null) return;
|
||||
|
||||
user.data().clear(node ->
|
||||
node instanceof PrefixNode && ((PrefixNode) node).getPriority() == GradientConstants.LUCKPERMS_PREFIX_PRIORITY
|
||||
user.data().clear(node ->
|
||||
node instanceof PrefixNode && ((PrefixNode) node).getPriority() == GradientConstants.LUCKPERMS_PREFIX_PRIORITY
|
||||
);
|
||||
|
||||
if (prefix != null && !prefix.isEmpty()) {
|
||||
|
|
@ -85,10 +85,10 @@ public class GradientLuckPermsHook {
|
|||
|
||||
public String getActivePrefix(Player player) {
|
||||
if (!isEnabled()) return null;
|
||||
|
||||
|
||||
User user = luckPerms.getUserManager().getUser(player.getUniqueId());
|
||||
if (user == null) return null;
|
||||
|
||||
|
||||
CachedMetaData metaData = user.getCachedData().getMetaData();
|
||||
return metaData.getPrefix();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue