2022-10-03 23:44:30 +02:00
|
|
|
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.ability.magic.spell.effect.HydrophobicSpell;
|
|
|
|
|
|
|
|
import net.minecraft.block.BlockState;
|
2022-10-07 16:52:35 +02:00
|
|
|
import net.minecraft.fluid.*;
|
2022-10-03 23:44:30 +02:00
|
|
|
import net.minecraft.util.math.BlockPos;
|
|
|
|
import net.minecraft.world.BlockView;
|
|
|
|
|
|
|
|
@Mixin(FlowableFluid.class)
|
|
|
|
abstract class MixinFlowableFluid {
|
|
|
|
@Inject(method = "canFill", at = @At("HEAD"), cancellable = true)
|
|
|
|
private void onCanFill(BlockView world, BlockPos pos, BlockState state, Fluid fluid, CallbackInfoReturnable<Boolean> info) {
|
2024-01-20 16:12:23 +01:00
|
|
|
if (HydrophobicSpell.blocksFluidFlow(world, pos, fluid.getDefaultState())) {
|
2022-10-03 23:44:30 +02:00
|
|
|
info.setReturnValue(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|