Skip to content

Commit

Permalink
Update RunAroundLikeCrazyGoalMixin::tick to once again match the vani…
Browse files Browse the repository at this point in the history
…lla impl
  • Loading branch information
nelind3 committed Nov 14, 2024
1 parent 772c198 commit 07dde41
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.spongepowered.api.entity.ai.goal.GoalExecutor;
import org.spongepowered.api.entity.ai.goal.GoalType;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
Expand All @@ -42,6 +43,8 @@
@Mixin(Goal.class)
public abstract class GoalMixin implements GoalBridge {

@Shadow protected abstract int adjustedTickDelay(int $$0);

private Supplier<GoalType> impl$type;
private GoalExecutor<?> impl$owner;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ public abstract class RunAroundLikeCrazyGoalMixin extends GoalMixin {
*/
@Overwrite
public void tick() {
if (!this.horse.isTamed() && this.horse.getRandom().nextInt(50) == 0) {
Entity entity = this.horse.getPassengers().get(0);
if (!this.horse.isTamed() && this.horse.getRandom().nextInt(this.adjustedTickDelay(50)) == 0) {
Entity entity = this.horse.getFirstPassenger();

if (entity == null) {
return;
Expand Down

0 comments on commit 07dde41

Please sign in to comment.