3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-11-03 14:50:19 +01:00

Merge branch 'master' of https://github.com/GeyserMC/Geyser into server-inventory

Dieser Commit ist enthalten in:
Camotoy 2021-03-02 00:49:26 -05:00
Commit 61e5784796
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 7EEFB66FE798081F
2 geänderte Dateien mit 47 neuen und 44 gelöschten Zeilen

Datei anzeigen

@ -12,6 +12,8 @@
<properties> <properties>
<netty.version>4.1.59.Final</netty.version> <netty.version>4.1.59.Final</netty.version>
<fastutil.version>8.5.2</fastutil.version>
<adventure.version>4.5.0</adventure.version>
</properties> </properties>
<dependencies> <dependencies>
@ -28,15 +30,11 @@
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.github.CloudburstMC.Protocol</groupId> <groupId>com.nukkitx.protocol</groupId>
<artifactId>bedrock-v422</artifactId> <artifactId>bedrock-v422</artifactId>
<version>294e7e5</version> <version>2.6.2-20210228.150048-4</version>
<scope>compile</scope> <scope>compile</scope>
<exclusions> <exclusions>
<exclusion>
<groupId>net.sf.trove4j</groupId>
<artifactId>trove</artifactId>
</exclusion>
<exclusion> <exclusion>
<groupId>com.nukkitx.network</groupId> <groupId>com.nukkitx.network</groupId>
<artifactId>raknet</artifactId> <artifactId>raknet</artifactId>
@ -44,9 +42,9 @@
</exclusions> </exclusions>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.github.CloudburstMC.Network</groupId> <groupId>com.nukkitx.network</groupId>
<artifactId>raknet</artifactId> <artifactId>raknet</artifactId>
<version>a94d2dd</version> <version>1.6.26-20210217.205834-2</version>
<scope>compile</scope> <scope>compile</scope>
<exclusions> <exclusions>
<exclusion> <exclusion>
@ -58,61 +56,61 @@
<dependency> <dependency>
<groupId>com.nukkitx.fastutil</groupId> <groupId>com.nukkitx.fastutil</groupId>
<artifactId>fastutil-int-int-maps</artifactId> <artifactId>fastutil-int-int-maps</artifactId>
<version>8.3.1</version> <version>${fastutil.version}</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.nukkitx.fastutil</groupId> <groupId>com.nukkitx.fastutil</groupId>
<artifactId>fastutil-int-float-maps</artifactId> <artifactId>fastutil-int-float-maps</artifactId>
<version>8.3.1</version> <version>${fastutil.version}</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.nukkitx.fastutil</groupId> <groupId>com.nukkitx.fastutil</groupId>
<artifactId>fastutil-long-long-maps</artifactId> <artifactId>fastutil-long-long-maps</artifactId>
<version>8.3.1</version> <version>${fastutil.version}</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.nukkitx.fastutil</groupId> <groupId>com.nukkitx.fastutil</groupId>
<artifactId>fastutil-object-long-maps</artifactId> <artifactId>fastutil-object-long-maps</artifactId>
<version>8.3.1</version> <version>${fastutil.version}</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.nukkitx.fastutil</groupId> <groupId>com.nukkitx.fastutil</groupId>
<artifactId>fastutil-int-byte-maps</artifactId> <artifactId>fastutil-int-byte-maps</artifactId>
<version>8.3.1</version> <version>${fastutil.version}</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.nukkitx.fastutil</groupId> <groupId>com.nukkitx.fastutil</groupId>
<artifactId>fastutil-int-double-maps</artifactId> <artifactId>fastutil-int-double-maps</artifactId>
<version>8.3.1</version> <version>${fastutil.version}</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.nukkitx.fastutil</groupId> <groupId>com.nukkitx.fastutil</groupId>
<artifactId>fastutil-int-boolean-maps</artifactId> <artifactId>fastutil-int-boolean-maps</artifactId>
<version>8.3.1</version> <version>${fastutil.version}</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.nukkitx.fastutil</groupId> <groupId>com.nukkitx.fastutil</groupId>
<artifactId>fastutil-object-int-maps</artifactId> <artifactId>fastutil-object-int-maps</artifactId>
<version>8.3.1</version> <version>${fastutil.version}</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.nukkitx.fastutil</groupId> <groupId>com.nukkitx.fastutil</groupId>
<artifactId>fastutil-object-byte-maps</artifactId> <artifactId>fastutil-object-byte-maps</artifactId>
<version>8.3.1</version> <version>${fastutil.version}</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.nukkitx.fastutil</groupId> <groupId>com.nukkitx.fastutil</groupId>
<artifactId>fastutil-object-object-maps</artifactId> <artifactId>fastutil-object-object-maps</artifactId>
<version>8.3.1</version> <version>${fastutil.version}</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
@ -214,25 +212,25 @@
<dependency> <dependency>
<groupId>net.kyori</groupId> <groupId>net.kyori</groupId>
<artifactId>adventure-api</artifactId> <artifactId>adventure-api</artifactId>
<version>4.5.0</version> <version>${adventure.version}</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.kyori</groupId> <groupId>net.kyori</groupId>
<artifactId>adventure-text-serializer-gson</artifactId> <artifactId>adventure-text-serializer-gson</artifactId>
<version>4.5.0</version> <version>${adventure.version}</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.kyori</groupId> <groupId>net.kyori</groupId>
<artifactId>adventure-text-serializer-legacy</artifactId> <artifactId>adventure-text-serializer-legacy</artifactId>
<version>4.5.0</version> <version>${adventure.version}</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.kyori</groupId> <groupId>net.kyori</groupId>
<artifactId>adventure-text-serializer-gson-legacy-impl</artifactId> <artifactId>adventure-text-serializer-gson-legacy-impl</artifactId>
<version>4.5.0</version> <version>${adventure.version}</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>

Datei anzeigen

@ -123,43 +123,38 @@ public class ArmorStandEntity extends LivingEntity {
isInvisible = (xd & 0x20) == 0x20; isInvisible = (xd & 0x20) == 0x20;
updateSecondEntityStatus(false); updateSecondEntityStatus(false);
} }
} else if (entityMetadata.getId() == 2 || entityMetadata.getId() == 3) { } else if (entityMetadata.getId() == 2) {
updateSecondEntityStatus(false); updateSecondEntityStatus(false);
} else if (entityMetadata.getId() == 14 && entityMetadata.getType() == MetadataType.BYTE) { } else if (entityMetadata.getId() == 14 && entityMetadata.getType() == MetadataType.BYTE) {
byte xd = (byte) entityMetadata.getValue(); byte xd = (byte) entityMetadata.getValue();
// isSmall // isSmall
boolean newIsSmall = (xd & 0x01) == 0x01; boolean newIsSmall = (xd & 0x01) == 0x01;
if ((newIsSmall != isSmall) && positionRequiresOffset) { if (newIsSmall != isSmall) {
if (positionRequiresOffset) {
// Fix new inconsistency with offset // Fix new inconsistency with offset
this.position = fixOffsetForSize(position, newIsSmall); this.position = fixOffsetForSize(position, newIsSmall);
positionUpdateRequired = true; positionUpdateRequired = true;
} }
isSmall = newIsSmall; isSmall = newIsSmall;
if (isSmall) { if (!isMarker) {
toggleSmallStatus();
float scale = metadata.getFloat(EntityData.SCALE);
if (scale != 0.55f && scale != 0.0f) {
metadata.put(EntityData.SCALE, 0.55f);
} }
if (metadata.getFloat(EntityData.BOUNDING_BOX_WIDTH) == 0.5f) {
metadata.put(EntityData.BOUNDING_BOX_WIDTH, 0.25f);
metadata.put(EntityData.BOUNDING_BOX_HEIGHT, 0.9875f);
}
} else if (metadata.getFloat(EntityData.BOUNDING_BOX_WIDTH) == 0.25f) {
metadata.put(EntityData.BOUNDING_BOX_WIDTH, entityType.getWidth());
metadata.put(EntityData.BOUNDING_BOX_HEIGHT, entityType.getHeight());
} }
// setMarker // setMarker
boolean oldIsMarker = isMarker; boolean oldIsMarker = isMarker;
isMarker = (xd & 0x10) == 0x10; isMarker = (xd & 0x10) == 0x10;
if (oldIsMarker != isMarker) {
if (isMarker) { if (isMarker) {
metadata.put(EntityData.BOUNDING_BOX_WIDTH, 0.0f); metadata.put(EntityData.BOUNDING_BOX_WIDTH, 0.0f);
metadata.put(EntityData.BOUNDING_BOX_HEIGHT, 0.0f); metadata.put(EntityData.BOUNDING_BOX_HEIGHT, 0.0f);
metadata.put(EntityData.SCALE, 0f);
} else {
toggleSmallStatus();
} }
if (oldIsMarker != isMarker) {
updateSecondEntityStatus(false); updateSecondEntityStatus(false);
} }
} }
@ -226,6 +221,7 @@ public class ArmorStandEntity extends LivingEntity {
if (!primaryEntity) return; if (!primaryEntity) return;
if (!isInvisible || isMarker) { if (!isInvisible || isMarker) {
// It is either impossible to show armor, or the armor stand isn't invisible. We good. // It is either impossible to show armor, or the armor stand isn't invisible. We good.
metadata.getFlags().setFlag(EntityFlag.INVISIBLE, false);
updateOffsetRequirement(false); updateOffsetRequirement(false);
if (positionUpdateRequired) { if (positionUpdateRequired) {
positionUpdateRequired = false; positionUpdateRequired = false;
@ -306,6 +302,15 @@ public class ArmorStandEntity extends LivingEntity {
} }
} }
/**
* If this armor stand is not a marker, set its bounding box size and scale.
*/
private void toggleSmallStatus() {
metadata.put(EntityData.BOUNDING_BOX_WIDTH, isSmall ? 0.25f : entityType.getWidth());
metadata.put(EntityData.BOUNDING_BOX_HEIGHT, isSmall ? 0.9875f : entityType.getHeight());
metadata.put(EntityData.SCALE, isSmall ? 0.55f : 1f);
}
/** /**
* @return the selected position with the position offset applied. * @return the selected position with the position offset applied.
*/ */