3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-12-26 00:00:41 +01:00

Fix no gravity falling block entities (#927)

* Fix no gravity falling block entities

Co-authored-by: AJ Ferguson <AJ-Ferguson@users.noreply.github.com>

* Add spacing

Co-authored-by: AJ Ferguson <AJ-Ferguson@users.noreply.github.com>
Co-authored-by: Camotoy <20743703+DoctorMacc@users.noreply.github.com>
Dieser Commit ist enthalten in:
rtm516 2020-07-10 15:43:52 +01:00 committet von GitHub
Ursprung 225e2a9fb8
Commit 5e664882b1
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23

Datei anzeigen

@ -25,9 +25,12 @@
package org.geysermc.connector.entity;
import com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata;
import com.nukkitx.math.vector.Vector3f;
import com.nukkitx.protocol.bedrock.data.entity.EntityData;
import com.nukkitx.protocol.bedrock.data.entity.EntityFlag;
import org.geysermc.connector.entity.type.EntityType;
import org.geysermc.connector.network.session.GeyserSession;
import org.geysermc.connector.network.translators.world.block.BlockTranslator;
public class FallingBlockEntity extends Entity {
@ -37,4 +40,12 @@ public class FallingBlockEntity extends Entity {
this.metadata.put(EntityData.VARIANT, BlockTranslator.getBedrockBlockId(javaId));
}
@Override
public void updateBedrockMetadata(EntityMetadata entityMetadata, GeyserSession session) {
// Set the NO_AI flag based on the no gravity flag to prevent movement
if (entityMetadata.getId() == 5) {
this.metadata.getFlags().setFlag(EntityFlag.NO_AI, (boolean) entityMetadata.getValue());
}
}
}