diff options
Diffstat (limited to 'src/main')
3 files changed, 8 insertions, 16 deletions
diff --git a/src/main/java/de/hysky/skyblocker/mixin/ClientPlayerEntityMixin.java b/src/main/java/de/hysky/skyblocker/mixin/ClientPlayerEntityMixin.java index 049443f7..8fb2fda4 100644 --- a/src/main/java/de/hysky/skyblocker/mixin/ClientPlayerEntityMixin.java +++ b/src/main/java/de/hysky/skyblocker/mixin/ClientPlayerEntityMixin.java @@ -27,7 +27,9 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; @Mixin(ClientPlayerEntity.class) public abstract class ClientPlayerEntityMixin extends AbstractClientPlayerEntity { - @Shadow @Final protected MinecraftClient client; + @Shadow + @Final + protected MinecraftClient client; public ClientPlayerEntityMixin(ClientWorld world, GameProfile profile) { super(world, profile); @@ -35,14 +37,9 @@ public abstract class ClientPlayerEntityMixin extends AbstractClientPlayerEntity @Inject(method = "dropSelectedItem", at = @At("HEAD"), cancellable = true) public void skyblocker$dropSelectedItem(CallbackInfoReturnable<Boolean> cir) { - if (Utils.isOnSkyblock()) { - if (ItemProtection.isItemProtected(this.getInventory().getMainHandStack())) { - if (!SkyblockerConfigManager.get().locations.dungeons.allowDroppingProtectedItems - || (SkyblockerConfigManager.get().locations.dungeons.allowDroppingProtectedItems && !Utils.isInDungeons())) { - cir.setReturnValue(false); - } - } - HotbarSlotLock.handleDropSelectedItem(this.getInventory().selectedSlot, cir); + if (Utils.isOnSkyblock() && (ItemProtection.isItemProtected(this.getInventory().getMainHandStack()) || HotbarSlotLock.isLocked(this.getInventory().selectedSlot)) + && (!SkyblockerConfigManager.get().locations.dungeons.allowDroppingProtectedItems || !Utils.isInDungeons())) { + cir.setReturnValue(false); } } diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/HotbarSlotLock.java b/src/main/java/de/hysky/skyblocker/skyblock/item/HotbarSlotLock.java index 069a030d..0fda3ef4 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/HotbarSlotLock.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/HotbarSlotLock.java @@ -5,7 +5,6 @@ import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper; import net.minecraft.client.network.ClientPlayerEntity; import net.minecraft.client.option.KeyBinding; import org.lwjgl.glfw.GLFW; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import java.util.List; @@ -24,10 +23,6 @@ public class HotbarSlotLock { return SkyblockerConfigManager.get().general.lockedSlots.contains(slot); } - public static void handleDropSelectedItem(int slot, CallbackInfoReturnable<Boolean> cir) { - if (isLocked(slot)) cir.setReturnValue(false); - } - public static void handleInputEvents(ClientPlayerEntity player) { while (hotbarSlotLock.wasPressed()) { List<Integer> lockedSlots = SkyblockerConfigManager.get().general.lockedSlots; diff --git a/src/main/resources/assets/skyblocker/lang/en_us.json b/src/main/resources/assets/skyblocker/lang/en_us.json index bda6a909..3696ab67 100644 --- a/src/main/resources/assets/skyblocker/lang/en_us.json +++ b/src/main/resources/assets/skyblocker/lang/en_us.json @@ -326,8 +326,8 @@ "text.autoconfig.skyblocker.option.locations.dungeons.fireFreezeStaffTimer.@Tooltip": "Display a timer when to use a Fire Freeze Staff in the F3/M3 boss fight.", "text.autoconfig.skyblocker.option.locations.dungeons.floor3GuardianHealthDisplay": "Guardian Health Display (F3/M3)", "text.autoconfig.skyblocker.option.locations.dungeons.floor3GuardianHealthDisplay.@Tooltip": "Displays guardian's health below them in the F3/M3 boss fight.", - "text.autoconfig.skyblocker.option.locations.dungeons.allowDroppingProtectedItems": "Enabled Dropping Protected Items", - "text.autoconfig.skyblocker.option.locations.dungeons.allowDroppingProtectedItems.@Tooltip": "Allows the use of class abilities in Dungeons while holding an item which has been protected using /skyblocker protectItem.", + "text.autoconfig.skyblocker.option.locations.dungeons.allowDroppingProtectedItems": "Enabled Dropping Protected Items & on Locked Slots", + "text.autoconfig.skyblocker.option.locations.dungeons.allowDroppingProtectedItems.@Tooltip": "Allows the use of class abilities in Dungeons on a locked slot or while holding an item which has been protected using /skyblocker protectItem.", "text.autoconfig.skyblocker.option.locations.dwarvenMines": "Dwarven Mines", "text.autoconfig.skyblocker.option.locations.dwarvenMines.enableDrillFuel": "Enable Drill Fuel", |