Skip to content

Commit

Permalink
fix: text display entity data index incorrect and teleport packet wro…
Browse files Browse the repository at this point in the history
…ng pitch and yaw
  • Loading branch information
GoodestEnglish committed Oct 3, 2024
1 parent 20fc858 commit 2190eec
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ public void update(MCPlayer player) {
WrapperPlayServerEntityTeleport packet = new WrapperPlayServerEntityTeleport(
this.entityId,
this.packetPosition(),
this.hologram.getPosition().getPitch(),
this.hologram.getPosition().getYaw(),
this.hologram.getPosition().getPitch(),
false
);
WrapperPlayServerEntityMetadata metadataPacket = new WrapperPlayServerEntityMetadata(
Expand Down Expand Up @@ -101,10 +101,10 @@ public void hide(MCPlayer player) {
private List<EntityData> createEntityData(MCPlayer mcPlayer) {
List<EntityData> entityDataList = new ArrayList<>();

entityDataList.add(new EntityData(22, EntityDataTypes.COMPONENT, MCAdventure.asItemString(line.render(mcPlayer), mcPlayer.getLocale()))); // text
entityDataList.add(new EntityData(23, EntityDataTypes.CAT_VARIANT, 200)); // line width
entityDataList.add(new EntityData(24, EntityDataTypes.CAT_VARIANT, 0x40000000)); // background color
entityDataList.add(new EntityData(25, EntityDataTypes.CAT_VARIANT, -1)); // text opacity
entityDataList.add(new EntityData(23, EntityDataTypes.COMPONENT, MCAdventure.asItemString(line.render(mcPlayer), mcPlayer.getLocale()))); // text
entityDataList.add(new EntityData(24, EntityDataTypes.INT, 200)); // line width
entityDataList.add(new EntityData(25, EntityDataTypes.INT, 0x40000000)); // background color
entityDataList.add(new EntityData(26, EntityDataTypes.BYTE, (byte) -1)); // text opacity
/**
* bit mask
* 0x01 = has shadow
Expand All @@ -116,7 +116,7 @@ private List<EntityData> createEntityData(MCPlayer mcPlayer) {
boolean isSeeThrough = false;
boolean useDefaultBackgroundColor = true;
int alignment = 0;
entityDataList.add(new EntityData(26, EntityDataTypes.CAT_VARIANT, (hasShadow ? 0x01 : 0) | (isSeeThrough ? 0x02 : 0) | (useDefaultBackgroundColor ? 0x04 : 0) | alignment));
entityDataList.add(new EntityData(27, EntityDataTypes.BYTE, (byte)((hasShadow ? 0x01 : 0) | (isSeeThrough ? 0x02 : 0) | (useDefaultBackgroundColor ? 0x04 : 0) | alignment)));

return entityDataList;
}
Expand Down

0 comments on commit 2190eec

Please sign in to comment.