Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-12-25 15:50:14 +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:
Ursprung
225e2a9fb8
Commit
5e664882b1
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren