diff --git a/.idea/misc.xml b/.idea/misc.xml index b0c36e8..4a4279b 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,4 +1,3 @@ - diff --git a/geyser/src/main/java/me/zimzaza4/geyserutils/geyser/GeyserUtils.java b/geyser/src/main/java/me/zimzaza4/geyserutils/geyser/GeyserUtils.java index 404812d..a904bf8 100644 --- a/geyser/src/main/java/me/zimzaza4/geyserutils/geyser/GeyserUtils.java +++ b/geyser/src/main/java/me/zimzaza4/geyserutils/geyser/GeyserUtils.java @@ -59,6 +59,10 @@ import org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponen import org.geysermc.mcprotocollib.protocol.data.game.level.particle.ItemParticleData; import org.geysermc.mcprotocollib.protocol.packet.common.clientbound.ClientboundCustomPayloadPacket; import org.geysermc.mcprotocollib.protocol.packet.common.serverbound.ServerboundCustomPayloadPacket; +import org.geysermc.mcprotocollib.protocol.packet.ingame.clientbound.entity.ClientboundMoveEntityPosPacket; +import org.geysermc.mcprotocollib.protocol.packet.ingame.clientbound.entity.ClientboundMoveEntityPosRotPacket; +import org.geysermc.mcprotocollib.protocol.packet.ingame.clientbound.entity.ClientboundMoveVehiclePacket; +import org.geysermc.mcprotocollib.protocol.packet.ingame.clientbound.entity.ClientboundTeleportEntityPacket; import org.geysermc.mcprotocollib.protocol.packet.ingame.clientbound.entity.spawn.ClientboundAddEntityPacket; import org.geysermc.mcprotocollib.protocol.packet.ingame.clientbound.level.ClientboundLevelParticlesPacket; import org.jetbrains.annotations.NotNull; @@ -68,6 +72,7 @@ import java.io.ByteArrayInputStream; import java.io.File; import java.io.FileReader; import java.io.IOException; +import java.lang.reflect.Method; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.util.*; @@ -79,6 +84,11 @@ public class GeyserUtils implements Extension { @Getter public static PacketManager packetManager = new PacketManager(); + @Getter + public static List REGISTERED_ENTITIES = new ArrayList<>(); + + public static boolean GEYSER_LOADED = false; + @Getter public static Map LOADED_SKIN_DATA = new HashMap<>(); @@ -181,6 +191,14 @@ public class GeyserUtils implements Extension { .build()); */ + + REGISTERED_ENTITIES.add(id); + registerEntityToGeyser(id); + } + + public static void registerEntityToGeyser(String id) { + Registries.init(); + NbtMap registry = Registries.BEDROCK_ENTITY_IDENTIFIERS.get(); List idList = new ArrayList<>(registry.getList("idlist", NbtType.COMPOUND)); idList.add(NbtMap.builder() diff --git a/geyser/src/main/java/me/zimzaza4/geyserutils/geyser/MountFix.java b/geyser/src/main/java/me/zimzaza4/geyserutils/geyser/MountFix.java index 896972d..60c5fda 100644 --- a/geyser/src/main/java/me/zimzaza4/geyserutils/geyser/MountFix.java +++ b/geyser/src/main/java/me/zimzaza4/geyserutils/geyser/MountFix.java @@ -34,6 +34,8 @@ public class MountFix { } } }, 2000, 80, TimeUnit.MILLISECONDS); + + } } diff --git a/pom.xml b/pom.xml index f265b27..9dadb1d 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ me.zimzaza4 GeyserUtils - 1.0-SNAPSHOT-${commit.short} + 1.0-SNAPSHOT pom common