Skip to content

Commit

Permalink
1.2.1 don't stop when eating (fix #5)
Browse files Browse the repository at this point in the history
  • Loading branch information
okx-code committed Aug 29, 2021
1 parent 7bd9105 commit 55188ef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,21 @@ public void tick() {

if (enabled) {
if (!jump) {
AUTO_EAT:
if (config.isIceRoadAutoEat()) {
if (this.eating != null) {
if (!mc.player.isUsingItem() || !this.eating.equals(mc.player.getUseItem())) {
this.eating = null;
mc.options.keyUse.setDown(false);
} else {
return;
break AUTO_EAT;
}
}

ItemStack mainhand = mc.player.getMainHandItem();
if (tryEat(mainhand)) {
this.eating = mainhand;
mc.options.keyUp.setDown(false);
mc.options.keyUse.setDown(true);
return;
}
}
Expand Down Expand Up @@ -95,7 +96,6 @@ private boolean tryEat(ItemStack item) {
FoodProperties food = item.getItem().getFoodProperties();
if (food != null && food.getNutrition() > 0) {
if (mc.player.getFoodData().getFoodLevel() + food.getNutrition() <= 20) {
mc.options.keyUse.setDown(true);
return true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ org.gradle.jvmargs=-Xmx2048M
minecraft_version=1.16.5

archives_base_name=civmodern
mod_version=1.2
mod_version=1.2.1
maven_group=sh.okx.civmodern

architectury_version=1.14.156
Expand Down

0 comments on commit 55188ef

Please sign in to comment.