Skip to content

Commit

Permalink
Allow AbstractHorses in Rafts, closes #55
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeF53 committed May 8, 2024
1 parent 6f49b5d commit ea85492
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
19 changes: 19 additions & 0 deletions src/main/java/net/F53/HorseBuff/mixin/Server/AllowRaft.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package net.F53.HorseBuff.mixin.Server;

import com.llamalad7.mixinextras.injector.ModifyReturnValue;
import com.llamalad7.mixinextras.sugar.Local;
import net.minecraft.entity.Entity;
import net.minecraft.entity.passive.AbstractHorseEntity;
import net.minecraft.entity.vehicle.BoatEntity;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;

@Mixin(BoatEntity.class)
public abstract class AllowRaft {
@ModifyReturnValue(method = "isSmallerThanBoat", at = @At("RETURN"))
private boolean allowRaft(boolean original, @Local(argsOnly = true)Entity entity){
if (entity instanceof AbstractHorseEntity && ((BoatEntity)(Object)this).getVariant() == BoatEntity.Type.BAMBOO)
return true;
return original;
}
}
5 changes: 3 additions & 2 deletions src/main/resources/horsebuff.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
"PortalHorse.AllowPortalUse",
"PortalHorse.OnCollideEnd",
"PortalHorse.TickNether",
"Server.AllowRaft",
"Server.ClearFutureTickEvents",
"Server.MountedModifiers",
"Server.MovementCheck",
"Server.NoBuck",
"Server.NoWander",
"Server.MountedModifiers"
"Server.NoWander"
],
"client": [
"Client.HeadPitchOffset",
Expand Down

0 comments on commit ea85492

Please sign in to comment.