Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fixes and new features #23

Open
wants to merge 72 commits into
base: main
Choose a base branch
from

Conversation

Hackerokuz
Copy link

@Hackerokuz Hackerokuz commented Aug 13, 2024

Summary


************* Fixes *************

  1. Fixed inventory getting stuck when full while swapping throwaway items to try and make free space...
  2. Fixed bot gets stuck clearing and then filling the 2x2 grid while crafting something.
  3. Fixed bot getting stuck while wandering and while trying to exit a cave with bare hands
  4. Applied duct tape solution for FPS drops. [BATTER SOLUTION SHOULD BE FOUND!! THIS IS PRETTY BAD WAY TO KEEP PERFORMANCE GOOD.]
  5. Update shielding mechanic
  6. Improved the check for when to eat so we dont eat when we know that we will die if we do not shield
  7. Improved command system

************* Additions *************

  1. Added legit mine (Simply set #legitMine true in baritone settings and altoclef will obey the setting when mining ores.)
  2. Added suggestions to commands
  3. Added a check if the branch mining tunnel is going to touch water/lava at any point and limited the length of the tunnel to avoid all liquids
  4. Added a task that allows bot to protect it self with blocks from projectiles
  5. Added Azealia and flowered Azealia to all annoying blocks lists.
  6. Added a function to check if bot is surronded by mobs on multiple sides
  7. Added avoidence toggling based on if runAwayTask is active and also made bot get a stone sword if no other swords are available
  8. Added @branchMine command

************* Bugs *************

No currently known bugs


Information

  • This PR fixes an issue.
  • This PR adds something new (e.g. new method or parameters).
  • This PR is a breaking change (e.g. methods or parameters removed/renamed).

Checklist

  • I have searched the open pull requests for duplicates.
  • If code changes were made then they have been tested.

Hackerokuz and others added 30 commits August 10, 2023 15:31
…sabled and also fixed an issue with aiming at entity incorrectly on servers specifically chikens cant be killed
…ade bot get a stone sword if no other swords are available
… block as if it stops early it can get stuck
…and place penalty as well as cost heuristics
…is dangerous check to drop and block searches
@MiranCZ
Copy link

MiranCZ commented Aug 13, 2024

The FPS drops you are talking about is likely a memory leak in the mod. Fixed it on my fork in this commit: MiranCZ/altoclef@2c1863b

Copy link

@JustaSqu1d JustaSqu1d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some formatting issues and coding conventions

.gitignore Outdated Show resolved Hide resolved
src/main/java/adris/altoclef/AltoClef.java Outdated Show resolved Hide resolved
src/main/java/adris/altoclef/Settings.java Outdated Show resolved Hide resolved
src/main/java/adris/altoclef/Settings.java Outdated Show resolved Hide resolved
src/main/java/adris/altoclef/chains/DeathMenuChain.java Outdated Show resolved Hide resolved
Comment on lines 138 to 184
if(block == Blocks.COAL_ORE || block == Blocks.DEEPSLATE_COAL_ORE)
{
maxHeight = 192;
optimalHeight = 96;
minHeight = 0;
}else
if(block == Blocks.COPPER_ORE || block == Blocks.DEEPSLATE_COPPER_ORE)
{
maxHeight = 112;
optimalHeight = 48;
minHeight = -16;
}else
if(block == Blocks.IRON_ORE || block == Blocks.DEEPSLATE_IRON_ORE)
{
maxHeight = 72;
optimalHeight = 16;
minHeight = -32;
}else
if(block == Blocks.LAPIS_ORE || block == Blocks.DEEPSLATE_LAPIS_ORE)
{
maxHeight = 64;
optimalHeight = 0;
minHeight = -59;
}else
if(block == Blocks.GOLD_ORE || block == Blocks.DEEPSLATE_GOLD_ORE)
{
maxHeight = 32;
optimalHeight = -16;
minHeight = -59;
}else
if(block == Blocks.DIAMOND_ORE || block == Blocks.DEEPSLATE_DIAMOND_ORE)
{
maxHeight = 15;
optimalHeight = -59;
minHeight = -59;
}else
if(block == Blocks.REDSTONE_ORE || block == Blocks.DEEPSLATE_REDSTONE_ORE)
{
maxHeight = 15;
optimalHeight = -59;
minHeight = -59;
}else
{
maxHeight = 8;
optimalHeight = 8;
minHeight = 8;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Create a map for this instead

Comment on lines 57 to 69
try {
int num = Integer.parseInt(part);
numbers.add(num);
} catch (NumberFormatException e) {
try {
dimension = (Dimension) Arg.parseEnum(part, Dimension.class);
} catch (CommandException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
Debug.logWarning(e1.getMessage());
return null;
}
break;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use a "look before you leap" approach instead of "ask for forgiveness than permission"

Comment on lines 116 to 126
try {
int num = Integer.parseInt(part);
numbers.add(num);
} catch (NumberFormatException e) {
try {
dimension = (Dimension) Arg.parseEnum(part, Dimension.class);
} catch (CommandException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
break;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thing, LBYL instead of EAFP

Copy link

@JustaSqu1d JustaSqu1d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional stuff

src/main/java/adris/altoclef/util/CraftingRecipe.java Outdated Show resolved Hide resolved
src/main/resources/altoclef.mixins.json Show resolved Hide resolved
@Hackerokuz Hackerokuz requested a review from JustaSqu1d August 14, 2024 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants