From ca8f62b490a240bb9f8300adf4909b32d63aa14e Mon Sep 17 00:00:00 2001 From: CammiePone Date: Wed, 8 Sep 2021 09:56:50 -0400 Subject: [PATCH] I'm a dumb --- src/main/java/dev/cammiescorner/arcanus/Arcanus.java | 4 ---- .../arcanus/core/mixin/LivingEntityMixin.java | 12 +++++++++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/main/java/dev/cammiescorner/arcanus/Arcanus.java b/src/main/java/dev/cammiescorner/arcanus/Arcanus.java index ac33837..fab0982 100644 --- a/src/main/java/dev/cammiescorner/arcanus/Arcanus.java +++ b/src/main/java/dev/cammiescorner/arcanus/Arcanus.java @@ -14,7 +14,6 @@ import net.fabricmc.fabric.api.event.registry.FabricRegistryBuilder; import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking; import net.fabricmc.fabric.api.screenhandler.v1.ScreenHandlerRegistry; -import net.minecraft.entity.LivingEntity; import net.minecraft.entity.data.DataTracker; import net.minecraft.entity.data.TrackedData; import net.minecraft.entity.data.TrackedDataHandlerRegistry; @@ -92,9 +91,6 @@ public static MutableText getSpellInputs(List pattern, int index) { } public static class DataTrackers { - public static final TrackedData IS_DISCOMBOBULATED = DataTracker.registerData(LivingEntity.class, TrackedDataHandlerRegistry.BOOLEAN); - public static final TrackedData DISCOMBOBULATED_TIMER = DataTracker.registerData(LivingEntity.class, TrackedDataHandlerRegistry.INTEGER); - public static final TrackedData MANA = DataTracker.registerData(PlayerEntity.class, TrackedDataHandlerRegistry.INTEGER); public static final TrackedData MANA_RECHARGE_RATE = DataTracker.registerData(PlayerEntity.class, TrackedDataHandlerRegistry.FLOAT); public static final TrackedData BURNOUT = DataTracker.registerData(PlayerEntity.class, TrackedDataHandlerRegistry.INTEGER); diff --git a/src/main/java/dev/cammiescorner/arcanus/core/mixin/LivingEntityMixin.java b/src/main/java/dev/cammiescorner/arcanus/core/mixin/LivingEntityMixin.java index 4c6cc33..acf243f 100644 --- a/src/main/java/dev/cammiescorner/arcanus/core/mixin/LivingEntityMixin.java +++ b/src/main/java/dev/cammiescorner/arcanus/core/mixin/LivingEntityMixin.java @@ -5,24 +5,30 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.EntityType; import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.data.DataTracker; +import net.minecraft.entity.data.TrackedData; +import net.minecraft.entity.data.TrackedDataHandlerRegistry; import net.minecraft.nbt.NbtCompound; import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Unique; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.ModifyVariable; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import static dev.cammiescorner.arcanus.Arcanus.DataTrackers.DISCOMBOBULATED_TIMER; -import static dev.cammiescorner.arcanus.Arcanus.DataTrackers.IS_DISCOMBOBULATED; - @Mixin(LivingEntity.class) public abstract class LivingEntityMixin extends Entity implements CanBeDiscombobulated { public LivingEntityMixin(EntityType type, World world) { super(type, world); } + @Unique + private static final TrackedData IS_DISCOMBOBULATED = DataTracker.registerData(LivingEntity.class, TrackedDataHandlerRegistry.BOOLEAN); + @Unique + private static final TrackedData DISCOMBOBULATED_TIMER = DataTracker.registerData(LivingEntity.class, TrackedDataHandlerRegistry.INTEGER); + @ModifyVariable(method = "travel", at = @At("HEAD")) public Vec3d invertInput(Vec3d movementInput) { if(((CanBeDiscombobulated) this).isDiscombobulated())