baritone icon indicating copy to clipboard operation
baritone copied to clipboard

Baritone tries to place air, and gets stuck in a loop

Open XorOwl opened this issue 3 years ago • 3 comments

Some information

Operating system: Windows Java version: dunno, not important for this one Minecraft version: 1.18.2 Baritone version: 1.8.3 Other mods (if used): appleskin-fabric-mc1.18.2-2.4.0.jar architectury-4.1.32.jar baritone-standalone-fabric-1.8.3.jar beehive-tooltips-fabric-1.4.2.jar BetterF3-1.2.3-Fabric-1.18.2.jar cloth-config-6.2.57-fabric.jar Clumps-fabric-1.18.2-8.0.0+7.jar Controlling-fabric-1.18.2-9.0+17.jar entityculling-fabric-mc1.18-1.5.0.jar fabric-api-0.48.0+1.18.2.jar FPS-Monitor-1.18-1.1.0-Fabric.jar InventoryHUD-fabric-[1.18] -3.4.2.jar InventorySorter-1.8.6-1.18.jar iris-mc1.18.2-1.2.2-build.32.jar.disabled light-overlay-6.0.5.jar lithium-fabric-mc1.18.2-0.7.9.jar malilib-fabric-1.18.2-0.12.1.jar modmenu-3.1.0.jar morevillagers-FABRIC-1.18.2-3.2.0.jar MouseTweaks-fabric-mc1.18-2.22.jar notenoughcrashes-4.1.4+1.18.2-fabric.jar phosphor-fabric-mc1.18.x-0.8.1.jar replaymod-1.18.2-2.6.4.jar RoughlyEnoughItems-8.0.442.jar sodium-fabric-mc1.18.2-0.4.1+build.15.jar tweakeroo-fabric-1.18.2-0.13.1.jar wthit-fabric-4.7.3.jar XaerosWorldMap_1.20.4.1_Fabric_1.18.2.jar Xaeros_Minimap_22.3.1.1_Fabric_1.18.2.jar

9000% sure this modlist wont help you though

Exception, error or logs

Please find your latest.log or debug.log in this folder and attach it to the issue

The error appears as baritone appears to try to put a block down, but cant seem to. It violently disallows you to move anything, the player, the camera, the active toolbar slot, and the empty slot in your hand. I've seen a few patterns it does, One where it tries to place nothing below it, one where it backs up and moves closer and backs up and moves closer while crouching, or just stopping, and staring at the block it needs to place as hard as it can.

How to reproduce

Add your steps to reproduce the issue/bug experienced here.

if minecraft:air gets added to throwaway items, it tries to PLACE AIR. It decides that you can place air by having an empty inventory slot and right clicking for scaffolding and building and getting places.

Modified settings

To get the modified settings run #modified in game acceptableThrowawayItems allowInventory blocksToAvoidBreaking replantNetherWart useSwordToMine

Suggested Solution

Disallow air from being selected as a viable block to place, or ignore it's presence in the acceptableThrowawayItems list.

Final checklist

  • [x] I know how to properly use check boxes
  • [x] I have included the version of Minecraft I'm running, baritone's version and forge mods (if used).
  • [x] I have included logs, exceptions and / or steps to reproduce the issue.
  • [x] I have not used any OwO's or UwU's in this issue.

XorOwl avatar Apr 16 '22 21:04 XorOwl

I've got a really simple solution to this for you, don't add air to acceptable throwaway items.

However yes there should probably be some check that scaffolding block can actually be walked on.

scorbett123 avatar Apr 16 '22 22:04 scorbett123

I've got a really simple solution to this for you, don't add air to acceptable throwaway items.

However yes there should probably be some check that scaffolding block can actually be walked on.

Yeah, i didn't understand that "throwaway" explicitly meant "for scaffolding". I thought it was for throwing out items to make room for others.

I've already written a teensy bit of code to handle the air bit. I'm trying to figure out how to rebuilt it to test it myself before opening a PR

XorOwl avatar Apr 16 '22 22:04 XorOwl

I have exhausted myself trying to built this thing. kept getting a sh\r error, finally found the fix for that in another issue, then couldnt get it to build the fabric jar despite passing the flag for it. I give up here, but the gist is, in InventoryBehavior.java, the logic in firstValidThrowaway() should read as

if (
    invy.get(i).getItem() != Item.getItemFromBlock(Blocks.AIR) 
    && Baritone.settings().acceptableThrowawayItems.value.contains(invy.get(i).getItem())
  ) {
      return i;
  }```

XorOwl avatar Apr 16 '22 23:04 XorOwl