-
-
Notifications
You must be signed in to change notification settings - Fork 514
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Manaweave boots and Snowflake pendant allow walking on powder snow (#…
- Loading branch information
1 parent
4f7a112
commit 5d68df9
Showing
4 changed files
with
42 additions
and
1 deletion.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
Fabric/src/main/java/vazkii/botania/fabric/mixin/PowderSnowBlockMixin.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,26 @@ | ||
package vazkii.botania.fabric.mixin; | ||
|
||
import net.minecraft.world.entity.Entity; | ||
import net.minecraft.world.entity.EquipmentSlot; | ||
import net.minecraft.world.entity.LivingEntity; | ||
import net.minecraft.world.level.block.PowderSnowBlock; | ||
|
||
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 vazkii.botania.common.handler.EquipmentHandler; | ||
import vazkii.botania.common.item.BotaniaItems; | ||
|
||
@Mixin(PowderSnowBlock.class) | ||
public class PowderSnowBlockMixin { | ||
@Inject(method = "canEntityWalkOnPowderSnow", at = @At("RETURN"), cancellable = true) | ||
private static void canWalkOnPowderSnowWithBotaniaItems(Entity entity, CallbackInfoReturnable<Boolean> cir) { | ||
if (!cir.getReturnValueZ() && entity instanceof LivingEntity living | ||
&& (living.getItemBySlot(EquipmentSlot.FEET).is(BotaniaItems.manaweaveBoots) | ||
|| !EquipmentHandler.findOrEmpty(BotaniaItems.icePendant, living).isEmpty())) { | ||
cir.setReturnValue(true); | ||
} | ||
} | ||
} |
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
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
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