mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-27 23:27:59 +01:00
Pegasi can walk on powdered snow
This commit is contained in:
parent
a664a52bbe
commit
4636ed267b
2 changed files with 23 additions and 0 deletions
|
@ -0,0 +1,22 @@
|
||||||
|
package com.minelittlepony.unicopia.mixin;
|
||||||
|
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
|
import com.minelittlepony.unicopia.Race;
|
||||||
|
import com.minelittlepony.unicopia.entity.player.Pony;
|
||||||
|
|
||||||
|
import net.minecraft.block.PowderSnowBlock;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
|
||||||
|
@Mixin(PowderSnowBlock.class)
|
||||||
|
abstract class MixinPowderSnowBlock {
|
||||||
|
@Inject(method = "canWalkOnPowderSnow", at = @At("HEAD"), cancellable = true)
|
||||||
|
private static void onCanWalkOnPowderSnow(Entity entity, CallbackInfoReturnable<Boolean> info) {
|
||||||
|
if (Pony.of(entity).map(Pony::getSpecies).filter(Race::canFly).isPresent()) {
|
||||||
|
info.setReturnValue(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -22,6 +22,7 @@
|
||||||
"MixinMobEntity",
|
"MixinMobEntity",
|
||||||
"MixinPersistentProjectileEntity",
|
"MixinPersistentProjectileEntity",
|
||||||
"MixinPlayerEntity",
|
"MixinPlayerEntity",
|
||||||
|
"MixinPowderSnowBlock",
|
||||||
"MixinProjectileEntity",
|
"MixinProjectileEntity",
|
||||||
"MixinReachDistanceFix",
|
"MixinReachDistanceFix",
|
||||||
"MixinServerPlayerEntity",
|
"MixinServerPlayerEntity",
|
||||||
|
|
Loading…
Reference in a new issue