fix for slow servers

This commit is contained in:
sebseb7
2024-01-05 00:46:43 +01:00
parent 140aae7f4a
commit 8255d5782f
2 changed files with 6 additions and 10 deletions

View File

@@ -7,7 +7,7 @@ mod_name = AutoTrade
author = sebseb7
mod_file_name = autotrade-fabric
mod_version = 0.0.6
mod_version = 0.0.7
malilib_version = 0.18.0
@@ -15,4 +15,4 @@ minecraft_version_out = 1.20.4
minecraft_version = 1.20.4
mappings_version = 1.20.4+build.1
fabric_loader_version = 0.15.1
mod_menu_version = 9.0.0-pre.1
mod_menu_version = 9.0.0

View File

@@ -332,20 +332,16 @@ public class KeybindCallbacks implements IHotkeyCallback, IClientTickHandler {
inputInRange = true;
ActionResult result = mc.interactionManager.interactBlock(mc.player, Hand.MAIN_HAND,
new BlockHitResult(input.toCenterPos(), Direction.UP, input, false));
if (result.isAccepted()) {
inputOpened = true;
return;
}
}
if ((output.toCenterPos().distanceTo(mc.player.getPos()) < 4) && (outputInRange == false)) {
outputInRange = true;
ActionResult result = mc.interactionManager.interactBlock(mc.player, Hand.MAIN_HAND,
new BlockHitResult(output.toCenterPos(), Direction.UP, output, false));
if (result.isAccepted()) {
outputOpened = true;
return;
}
}
if (input.toCenterPos().distanceTo(mc.player.getPos()) > 5) {
inputOpened = false;