Skip to content

Commit

Permalink
fixed previous commit with help from benonardo and zeronoryouki from …
Browse files Browse the repository at this point in the history
…the fabric developers discord server
  • Loading branch information
lever1209 committed Jan 26, 2024
1 parent 9e62c57 commit abc2151
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,16 @@
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

import com.mojang.authlib.GameProfile;

import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.nbt.NbtCompound;
import net.minecraft.nbt.NbtElement;
import net.minecraft.network.encryption.PlayerPublicKey;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import pkg.deepCurse.pandora.core.util.interfaces.PlayerGrueDataInterface;

//import net.minecraft.nbt.NbtCompound;
//import net.minecraft.world.PersistentState;

@Mixin(PlayerEntity.class)
public abstract class PlayerEntityMixin extends PlayerEntity implements PlayerGrueDataInterface {
public PlayerEntityMixin(World world, BlockPos pos, float yaw, GameProfile gameProfile, PlayerPublicKey publicKey) {
super(world, pos, yaw, gameProfile, publicKey);
}
public class PlayerEntityMixin implements PlayerGrueDataInterface {

private long lastEncounterTime; // PandoraGrueLastEncounterTime
private short trainingWheelEncountersLeft; // PandoraGrueTrainingWheelEncountersLeft
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,15 @@ public static void run(ServerWorld world) {
+ PandoraConfig.Debug.GrueMinimumTickWait;

if (entity instanceof PlayerEntity) {
PlayerEntity player = (PlayerEntity) entity;
log.info("{}, {}", ((PlayerGrueDataInterface) player).getLastEncounterTime(),
((PlayerGrueDataInterface) player).getTrainingWheelEncountersLeft());
// log.info("{} in {} for {}", entity.getEntityName(), entity.getWorld().getDimensionKey(), ((float) wait) / 20f);
PlayerGrueDataInterface player = (PlayerGrueDataInterface) (PlayerEntity) entity;
log.info("{}, {}, {}", player.getLastEncounterTime(),
player.getTrainingWheelEncountersLeft());



}
doDarknessDamage(entity, 0.0F, world);
// dimensionalCooldownManager.remove(entity);
dimensionalCooldownManager.set(entity, wait);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ public void update(Entity entity) {
var entry = this.entries.get(entity);

if (entry != null && entry.endTick < ++entry.currentTick) {
this.entries.remove(entity);
this.onCooldownUpdate(entity);
this.remove(entity);
}

}
Expand Down

0 comments on commit abc2151

Please sign in to comment.