feat(AutoBread): AutoBread module#281
Conversation
|
Good work |
| import com.lambda.command.LambdaCommand | ||
| import com.lambda.module.modules.player.AutoBread | ||
| import com.lambda.util.extension.CommandBuilder | ||
|
|
| import com.lambda.util.extension.CommandBuilder | ||
|
|
||
|
|
||
| object AutoBread : LambdaCommand( |
There was a problem hiding this comment.
there is a naming convention for commands, please abide by it
| object AutoBread : LambdaCommand( | ||
| name = "autobread", | ||
| usage = "autobread", | ||
| description = "Automatically eats bread when your hunger is low." |
There was a problem hiding this comment.
im gonna guess this was because you vibe-coded this?
|
|
||
| object AutoBread : Module( | ||
| name = "AutoBread", | ||
| description = "Bread entities around you. Activated using the autobread command", |
There was a problem hiding this comment.
could use single quotes around the "autobread" text like you have in the checkBreadCooldown setting description
| import net.minecraft.util.hit.EntityHitResult | ||
|
|
||
|
|
||
| object AutoBread : Module( |
There was a problem hiding this comment.
the module does nothing when enabling. There are no listeners and the logic is only called when the command is invoked.
| import net.minecraft.util.hit.EntityHitResult | ||
|
|
||
|
|
||
| object AutoBread : Module( |
There was a problem hiding this comment.
Bread is a food made of flour, water, and a leavening agent such as yeast mixed together and baked
| val lastBreadEntities = LimitedDecayQueue<AnimalEntity>(100, 5 * 60 * 1000) | ||
|
|
||
| @JvmStatic | ||
| fun bread() { |
There was a problem hiding this comment.
can replace the brackets with an = with the runSafe on the next line like it is now
| fun bread() { | ||
| runSafe { | ||
| fastEntitySearch<AnimalEntity>(distance).filter { !checkBreadCooldown || !lastBreadEntities.contains(it) }.forEach { | ||
| if (it.isAlive) { |
There was a problem hiding this comment.
it.isAlive can be moved into the filter. I'd also place the filter on a new line and open the brackets:
fastEntitySearch<AnimalEntity>(distance)
.filter {
(!checkBreadCooldown || !lastBreadEntities.contains(it)) &&
it.isAlive
}.forEach {
...
}
Has a single command to interact with all breedable entities in range. Tested on 2b2t.