Skip to content

Commit

Permalink
Implement more data
Browse files Browse the repository at this point in the history
AlexProgrammerDE committed Dec 12, 2024

Verified

This commit was signed with the committer’s verified signature. The key has expired.
nowseemee Daniel Beck
1 parent 20f4f94 commit 31443ff
Showing 2 changed files with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -724,4 +724,16 @@ private void swapHandItems() {
this.setItemSlot(EquipmentSlot.OFFHAND, this.getItemBySlot(EquipmentSlot.MAINHAND).orElse(null));
this.setItemSlot(EquipmentSlot.MAINHAND, item);
}

public boolean isInvulnerable() {
return false;
}

public boolean canBeSeenAsEnemy() {
return !this.isInvulnerable() && this.canBeSeenByAnyone();
}

public boolean canBeSeenByAnyone() {
return !this.isSpectator() && this.isAlive();
}
}
Original file line number Diff line number Diff line change
@@ -34,6 +34,7 @@
import org.cloudburstmc.math.vector.Vector3i;
import org.geysermc.mcprotocollib.auth.GameProfile;
import org.geysermc.mcprotocollib.protocol.data.game.entity.EntityEvent;
import org.geysermc.mcprotocollib.protocol.data.game.entity.metadata.MetadataType;
import org.geysermc.mcprotocollib.protocol.data.game.entity.metadata.Pose;
import org.jetbrains.annotations.Nullable;

@@ -216,6 +217,20 @@ public boolean isLocalPlayer() {
return false;
}

public int getScore() {
return this.metadataState.getMetadata(NamedEntityData.PLAYER__SCORE, MetadataType.INT);
}

@Override
public boolean canBeSeenAsEnemy() {
return !this.abilitiesData().invulnerable && super.canBeSeenAsEnemy();
}

@Override
public boolean onClimbable() {
return !this.abilitiesData().flying && super.onClimbable();
}

public void onUpdateAbilities() {
}

0 comments on commit 31443ff

Please sign in to comment.