diff --git a/src/main/java/net/levelz/mixin/player/AbstractClientPlayerEntityMixin.java b/src/main/java/net/levelz/mixin/player/AbstractClientPlayerEntityMixin.java index 1048117..502894f 100644 --- a/src/main/java/net/levelz/mixin/player/AbstractClientPlayerEntityMixin.java +++ b/src/main/java/net/levelz/mixin/player/AbstractClientPlayerEntityMixin.java @@ -22,9 +22,9 @@ protected PlayerListEntry getPlayerListEntry() { @Override public int getLevel() { - if (getPlayerListEntry() != null) + if (getPlayerListEntry() != null) { return ((PlayerListAccess) getPlayerListEntry()).getLevel(); - + } return 0; } } diff --git a/src/main/java/net/levelz/mixin/player/MinecraftClientMixin.java b/src/main/java/net/levelz/mixin/player/MinecraftClientMixin.java index c3e9230..bface76 100644 --- a/src/main/java/net/levelz/mixin/player/MinecraftClientMixin.java +++ b/src/main/java/net/levelz/mixin/player/MinecraftClientMixin.java @@ -69,14 +69,16 @@ private boolean restrictHandUsage(boolean blockBreaking) { if (item instanceof SwordItem) { levelList = LevelLists.swordList; } else if (item instanceof AxeItem) { - if (ConfigInit.CONFIG.bindAxeDamageToSwordRestriction && !blockBreaking) + if (ConfigInit.CONFIG.bindAxeDamageToSwordRestriction && !blockBreaking) { levelList = LevelLists.swordList; - else + } else { levelList = LevelLists.axeList; - } else if (item instanceof HoeItem) + } + } else if (item instanceof HoeItem) { levelList = LevelLists.hoeList; - else if (item instanceof PickaxeItem || item instanceof ShovelItem) + } else if (item instanceof PickaxeItem || item instanceof ShovelItem) { levelList = LevelLists.toolList; + } if (levelList != null && ((ToolItem) item).getMaterial() != null) { String material = ((ToolItem) item).getMaterial().toString().toLowerCase(); if (!PlayerStatsManager.playerLevelisHighEnough(player, levelList, material, true)) { diff --git a/src/main/java/net/levelz/mixin/player/PlayerEntityRendererMixin.java b/src/main/java/net/levelz/mixin/player/PlayerEntityRendererMixin.java index 8b100d7..30fb6cd 100644 --- a/src/main/java/net/levelz/mixin/player/PlayerEntityRendererMixin.java +++ b/src/main/java/net/levelz/mixin/player/PlayerEntityRendererMixin.java @@ -33,10 +33,11 @@ protected void renderLabelIfPresentMixin(AbstractClientPlayerEntity abstractClie @ModifyArg(method = "renderLabelIfPresent", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/entity/LivingEntityRenderer;renderLabelIfPresent(Lnet/minecraft/entity/Entity;Lnet/minecraft/text/Text;Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;I)V", ordinal = 1)) protected Text renderLabelIfPresentMixin(Text original) { - if (ConfigInit.CONFIG.showLevel) + if (ConfigInit.CONFIG.showLevel) { return Team.decorateName(abstractClientPlayerEntity.getScoreboardTeam(), Text.translatable("text.levelz.scoreboard", ((PlayerListAccess) abstractClientPlayerEntity).getLevel(), abstractClientPlayerEntity.getName())); - else + } else { return original; + } } }