generated from FabricMC/fabric-example-mod
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow AbstractHorses in Rafts, closes #55
- Loading branch information
Showing
2 changed files
with
22 additions
and
2 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
src/main/java/net/F53/HorseBuff/mixin/Server/AllowRaft.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters