Mirror von
https://github.com/Moulberry/AxiomPaperPlugin.git
synchronisiert 2024-11-17 05:40:06 +01:00
Fix not being able to spawn entities with passenger
Dieser Commit ist enthalten in:
Ursprung
63c3d91ece
Commit
68d2fe6492
@ -26,6 +26,7 @@ import org.jetbrains.annotations.Nullable;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
|
|
||||||
public class SpawnEntityPacketListener implements PluginMessageListener {
|
public class SpawnEntityPacketListener implements PluginMessageListener {
|
||||||
|
|
||||||
@ -99,12 +100,18 @@ public class SpawnEntityPacketListener implements PluginMessageListener {
|
|||||||
|
|
||||||
if (!tag.contains("id")) continue;
|
if (!tag.contains("id")) continue;
|
||||||
|
|
||||||
|
AtomicBoolean useNewUuid = new AtomicBoolean(true);
|
||||||
|
|
||||||
Entity spawned = EntityType.loadEntityRecursive(tag, serverLevel, entity -> {
|
Entity spawned = EntityType.loadEntityRecursive(tag, serverLevel, entity -> {
|
||||||
String type = EntityType.getKey(entity.getType()).toString();
|
String type = EntityType.getKey(entity.getType()).toString();
|
||||||
if (!whitelistedEntities.isEmpty() && !whitelistedEntities.contains(type)) return null;
|
if (!whitelistedEntities.isEmpty() && !whitelistedEntities.contains(type)) return null;
|
||||||
if (blacklistedEntities.contains(type)) return null;
|
if (blacklistedEntities.contains(type)) return null;
|
||||||
|
|
||||||
entity.setUUID(entry.newUuid);
|
if (useNewUuid.getAndSet(false)) {
|
||||||
|
entity.setUUID(entry.newUuid);
|
||||||
|
} else {
|
||||||
|
entity.setUUID(UUID.randomUUID());
|
||||||
|
}
|
||||||
|
|
||||||
if (entity instanceof HangingEntity hangingEntity) {
|
if (entity instanceof HangingEntity hangingEntity) {
|
||||||
float changedYaw = entry.yaw - entity.getYRot();
|
float changedYaw = entry.yaw - entity.getYRot();
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren