Skip to content

Commit

Permalink
I'm a dumb
Browse files Browse the repository at this point in the history
  • Loading branch information
CammiePone committed Sep 8, 2021
1 parent eb4b7ac commit ca8f62b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
4 changes: 0 additions & 4 deletions src/main/java/dev/cammiescorner/arcanus/Arcanus.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -92,9 +91,6 @@ public static MutableText getSpellInputs(List<Pattern> pattern, int index) {
}

public static class DataTrackers {
public static final TrackedData<Boolean> IS_DISCOMBOBULATED = DataTracker.registerData(LivingEntity.class, TrackedDataHandlerRegistry.BOOLEAN);
public static final TrackedData<Integer> DISCOMBOBULATED_TIMER = DataTracker.registerData(LivingEntity.class, TrackedDataHandlerRegistry.INTEGER);

public static final TrackedData<Integer> MANA = DataTracker.registerData(PlayerEntity.class, TrackedDataHandlerRegistry.INTEGER);
public static final TrackedData<Float> MANA_RECHARGE_RATE = DataTracker.registerData(PlayerEntity.class, TrackedDataHandlerRegistry.FLOAT);
public static final TrackedData<Integer> BURNOUT = DataTracker.registerData(PlayerEntity.class, TrackedDataHandlerRegistry.INTEGER);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Boolean> IS_DISCOMBOBULATED = DataTracker.registerData(LivingEntity.class, TrackedDataHandlerRegistry.BOOLEAN);
@Unique
private static final TrackedData<Integer> DISCOMBOBULATED_TIMER = DataTracker.registerData(LivingEntity.class, TrackedDataHandlerRegistry.INTEGER);

@ModifyVariable(method = "travel", at = @At("HEAD"))
public Vec3d invertInput(Vec3d movementInput) {
if(((CanBeDiscombobulated) this).isDiscombobulated())
Expand Down

0 comments on commit ca8f62b

Please sign in to comment.