// Path: src/main/java/com/legobmw99/stormlight/modules/powers/PowersSetup.java
// public class PowersSetup {
// 
//     public static final DeferredRegister<MobEffect> EFFECTS = DeferredRegister.create(ForgeRegistries.MOB_EFFECTS, Stormlight.MODID);
// 
//     public static final RegistryObject<MobEffect> STORMLIGHT = EFFECTS.register("stormlight", () -> new GenericEffect(MobEffectCategory.BENEFICIAL, 0));
//     public static final RegistryObject<MobEffect> SLICKING = EFFECTS.register("slicking", () -> new StormlightEffect(16737535));
//     public static final RegistryObject<MobEffect> STICKING = EFFECTS.register("sticking", () -> new StormlightEffect(6579455));
//     public static final RegistryObject<MobEffect> COHESION = EFFECTS.register("cohesion", () -> new StormlightEffect(16777010));
//     public static final RegistryObject<MobEffect> TENSION = EFFECTS.register("tension", () -> new StormlightEffect(16711780));
//     public static final RegistryObject<MobEffect> GRAVITATION = EFFECTS.register("gravitation",
//                                                                                  () -> new StormlightEffect(6605055).addAttributeModifier(ForgeMod.ENTITY_GRAVITY.get(),
//                                                                                                                                           "a81758d2-c355-11eb-8529-0242ac130003",
//                                                                                                                                           -0.08,
//                                                                                                                                           AttributeModifier.Operation.ADDITION));
// 
// 
//     public static void register() {
//         EFFECTS.register(FMLJavaModLoadingContext.get().getModEventBus());
//     }
// 
// 
//     public static void init(final FMLCommonSetupEvent e) {
//         ArgumentTypes.register("stormlight_ideal", StormlightArgType.IdealType.class, new EmptyArgumentSerializer<>(() -> StormlightArgType.IdealType.INSTANCE));
//         ArgumentTypes.register("stormlight_order", StormlightArgType.OrderType.class, new EmptyArgumentSerializer<>(() -> StormlightArgType.OrderType.INSTANCE));
// 
//         MinecraftForge.EVENT_BUS.register(PowersEventHandler.class);
//     }
// }


import com.legobmw99.stormlight.modules.powers.PowersSetup;
import net.minecraft.core.BlockPos;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.material.Fluid;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import java.util.Optional;
package com.legobmw99.stormlight.modules.powers.mixin;



@Mixin(LivingEntity.class)
public abstract class LivingEntityMixin extends Entity {

    @Shadow(remap = false)
    private Optional<BlockPos> lastClimbablePos;

    public LivingEntityMixin(EntityType<?> type, Level world) {
        super(type, world);
    }

    // todo actually mixin to IForgeBlockState?
    @Inject(at = @At("RETURN"), method = "onClimbable", cancellable = true, remap = false)
    public void doCohesionClimb(CallbackInfoReturnable<Boolean> info) {
        if (!info.getReturnValue()) {
            LivingEntity entity = (LivingEntity) (Entity) this;
// Path: src/main/java/com/legobmw99/stormlight/modules/powers/PowersSetup.java
// public class PowersSetup {
// 
//     public static final DeferredRegister<MobEffect> EFFECTS = DeferredRegister.create(ForgeRegistries.MOB_EFFECTS, Stormlight.MODID);
// 
//     public static final RegistryObject<MobEffect> STORMLIGHT = EFFECTS.register("stormlight", () -> new GenericEffect(MobEffectCategory.BENEFICIAL, 0));
//     public static final RegistryObject<MobEffect> SLICKING = EFFECTS.register("slicking", () -> new StormlightEffect(16737535));
//     public static final RegistryObject<MobEffect> STICKING = EFFECTS.register("sticking", () -> new StormlightEffect(6579455));
//     public static final RegistryObject<MobEffect> COHESION = EFFECTS.register("cohesion", () -> new StormlightEffect(16777010));
//     public static final RegistryObject<MobEffect> TENSION = EFFECTS.register("tension", () -> new StormlightEffect(16711780));
//     public static final RegistryObject<MobEffect> GRAVITATION = EFFECTS.register("gravitation",
//                                                                                  () -> new StormlightEffect(6605055).addAttributeModifier(ForgeMod.ENTITY_GRAVITY.get(),
//                                                                                                                                           "a81758d2-c355-11eb-8529-0242ac130003",
//                                                                                                                                           -0.08,
//                                                                                                                                           AttributeModifier.Operation.ADDITION));
// 
// 
//     public static void register() {
//         EFFECTS.register(FMLJavaModLoadingContext.get().getModEventBus());
//     }
// 
// 
//     public static void init(final FMLCommonSetupEvent e) {
//         ArgumentTypes.register("stormlight_ideal", StormlightArgType.IdealType.class, new EmptyArgumentSerializer<>(() -> StormlightArgType.IdealType.INSTANCE));
//         ArgumentTypes.register("stormlight_order", StormlightArgType.OrderType.class, new EmptyArgumentSerializer<>(() -> StormlightArgType.OrderType.INSTANCE));
// 
//         MinecraftForge.EVENT_BUS.register(PowersEventHandler.class);
//     }
// }


// Path: src/main/java/com/legobmw99/stormlight/modules/powers/mixin/LivingEntityMixin.java
import com.legobmw99.stormlight.modules.powers.PowersSetup;
import net.minecraft.core.BlockPos;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.material.Fluid;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import java.util.Optional;

package com.legobmw99.stormlight.modules.powers.mixin;



@Mixin(LivingEntity.class)
public abstract class LivingEntityMixin extends Entity {

    @Shadow(remap = false)
    private Optional<BlockPos> lastClimbablePos;

    public LivingEntityMixin(EntityType<?> type, Level world) {
        super(type, world);
    }

    // todo actually mixin to IForgeBlockState?
    @Inject(at = @At("RETURN"), method = "onClimbable", cancellable = true, remap = false)
    public void doCohesionClimb(CallbackInfoReturnable<Boolean> info) {
        if (!info.getReturnValue()) {
            LivingEntity entity = (LivingEntity) (Entity) this;
            if (entity.hasEffect(PowersSetup.STICKING.get()) && entity.level.getBlockCollisions(entity, entity.getBoundingBox().inflate(0.15, 0, 0.15)).iterator().hasNext()) {