diff --git a/src/main/java/net/F53/HorseBuff/mixin/Server/AllowRaft.java b/src/main/java/net/F53/HorseBuff/mixin/Server/AllowRaft.java new file mode 100644 index 0000000..56d5e14 --- /dev/null +++ b/src/main/java/net/F53/HorseBuff/mixin/Server/AllowRaft.java @@ -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; + } +} diff --git a/src/main/resources/horsebuff.mixins.json b/src/main/resources/horsebuff.mixins.json index dfcc224..b3d2375 100644 --- a/src/main/resources/horsebuff.mixins.json +++ b/src/main/resources/horsebuff.mixins.json @@ -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",