diff --git a/.idea/misc.xml b/.idea/misc.xml index 8d6cca2..06c620a 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -20,7 +20,7 @@ - + \ No newline at end of file diff --git a/bungee/pom.xml b/bungee/pom.xml index 7b457d5..24800fa 100644 --- a/bungee/pom.xml +++ b/bungee/pom.xml @@ -66,7 +66,7 @@ net.md-5 bungeecord-api - 1.20-R0.3-SNAPSHOT + 1.21-R0.1 provided diff --git a/common/pom.xml b/common/pom.xml index db42047..ba7c2bb 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -12,17 +12,26 @@ geyserutils-common - 11 - 11 + 21 + 21 UTF-8 + + org.apache.maven.plugins + maven-compiler-plugin + 3.14.0 + + 21 + 21 + + org.apache.maven.plugins maven-shade-plugin - 3.4.1 + 3.6.0 @@ -58,7 +67,7 @@ org.projectlombok lombok - 1.18.28 + 1.18.32 compile @@ -77,12 +86,6 @@ 24.0.1 compile - - org.jetbrains - annotations - 24.0.1 - compile - \ No newline at end of file diff --git a/geyser/libs/Geyser-Standalone.jar b/geyser/libs/Geyser-Standalone.jar index 5b803c7..5574b8f 100644 Binary files a/geyser/libs/Geyser-Standalone.jar and b/geyser/libs/Geyser-Standalone.jar differ diff --git a/geyser/pom.xml b/geyser/pom.xml index 5b0e1ee..15707bb 100644 --- a/geyser/pom.xml +++ b/geyser/pom.xml @@ -22,7 +22,7 @@ org.apache.maven.plugins maven-shade-plugin - 3.4.1 + 3.6.0 package @@ -79,7 +79,7 @@ org.geysermc.geyser core - 2.8.0-SNAPSHOT + 2.9.0-SNAPSHOT system ${project.basedir}/libs/Geyser-Standalone.jar 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 43024aa..bb9a77f 100644 --- a/geyser/src/main/java/me/zimzaza4/geyserutils/geyser/GeyserUtils.java +++ b/geyser/src/main/java/me/zimzaza4/geyserutils/geyser/GeyserUtils.java @@ -40,8 +40,12 @@ import org.geysermc.geyser.api.skin.Cape; import org.geysermc.geyser.api.skin.Skin; import org.geysermc.geyser.api.skin.SkinData; import org.geysermc.geyser.api.skin.SkinGeometry; +import org.geysermc.geyser.api.util.Identifier; import org.geysermc.geyser.entity.EntityDefinition; import org.geysermc.geyser.entity.properties.GeyserEntityProperties; +import org.geysermc.geyser.entity.properties.type.BooleanProperty; +import org.geysermc.geyser.entity.properties.type.FloatProperty; +import org.geysermc.geyser.entity.properties.type.IntProperty; import org.geysermc.geyser.entity.type.Entity; import org.geysermc.geyser.entity.type.player.PlayerEntity; import org.geysermc.geyser.registry.Registries; @@ -94,20 +98,20 @@ public class GeyserUtils implements Extension { } // the static here is crazy ;( - private static GeyserEntityProperties getProperties(String id) { + private static GeyserEntityProperties.Builder getProperties(String id) { if (!properties.containsKey(id)) return null; - GeyserEntityProperties.Builder builder = new GeyserEntityProperties.Builder(); + GeyserEntityProperties.Builder builder = new GeyserEntityProperties.Builder(id); List>> pairs = properties.get(id); pairs.forEach(p -> { // only bool, float and int support for now - if (p.getValue() == Boolean.class) builder.addBoolean(p.getKey()); - else if (p.getValue() == Float.class) builder.addFloat(p.getKey()); - else if (p.getValue() == Integer.class) builder.addInt(p.getKey()); + if (p.getValue() == Boolean.class) builder.add(new BooleanProperty(Identifier.of(p.getKey()), false)); + else if (p.getValue() == Float.class) builder.add(new FloatProperty(Identifier.of(p.getKey()), Float.MAX_VALUE, Float.MIN_VALUE,0f)); + else if (p.getValue() == Integer.class) builder.add(new IntProperty(Identifier.of(p.getKey()), Integer.MAX_VALUE, Integer.MIN_VALUE, 0)); else instance.logger().info("Found unknown property: " + p.getKey()); }); - return builder.build(); + return builder; } private static boolean containsProperty(String entityId, String identifier) { @@ -135,7 +139,7 @@ public class GeyserUtils implements Extension { public static void registerPropertiesForGeyser(String entityId) { - GeyserEntityProperties entityProperties = getProperties(entityId); + GeyserEntityProperties entityProperties = getProperties(entityId).build(); if (entityProperties == null) return; properties.values().stream() .flatMap(List::stream) @@ -188,7 +192,7 @@ public class GeyserUtils implements Extension { ); EntityDefinition def = EntityDefinition.builder(null) - .height(0.1f).width(0.1f).identifier(id).registeredProperties(getProperties(id)).build(); + .height(0.1f).width(0.1f).identifier(id).propertiesBuilder(getProperties(id)).build(); LOADED_ENTITY_DEFINITIONS.put(id, def); } @@ -572,9 +576,9 @@ public class GeyserUtils implements Extension { if (entity.getPropertyManager() == null) return; if (entityPropertyPacket.getValue() instanceof Boolean value) { - entity.getPropertyManager().add(entityPropertyPacket.getIdentifier(), value); + entity.getPropertyManager().addProperty(new BooleanProperty(Identifier.of(entityPropertyPacket.getIdentifier()), false), value); } else if (entityPropertyPacket.getValue() instanceof Integer value) { - entity.getPropertyManager().add(entityPropertyPacket.getIdentifier(), value); + entity.getPropertyManager().addProperty(new IntProperty(Identifier.of(entityPropertyPacket.getIdentifier()), Integer.MAX_VALUE, Integer.MIN_VALUE, 0), value); } entity.updateBedrockEntityProperties(); } diff --git a/geyser/src/main/java/me/zimzaza4/geyserutils/geyser/replace/JavaAddEntityTranslatorReplace.java b/geyser/src/main/java/me/zimzaza4/geyserutils/geyser/replace/JavaAddEntityTranslatorReplace.java index 6e4bea1..5e954db 100644 --- a/geyser/src/main/java/me/zimzaza4/geyserutils/geyser/replace/JavaAddEntityTranslatorReplace.java +++ b/geyser/src/main/java/me/zimzaza4/geyserutils/geyser/replace/JavaAddEntityTranslatorReplace.java @@ -47,7 +47,11 @@ import org.geysermc.mcprotocollib.protocol.packet.ingame.clientbound.entity.Clie import static me.zimzaza4.geyserutils.geyser.GeyserUtils.CUSTOM_ENTITIES; import static me.zimzaza4.geyserutils.geyser.GeyserUtils.LOADED_ENTITY_DEFINITIONS; + public class JavaAddEntityTranslatorReplace extends PacketTranslator { + private static final boolean SHOW_PLAYER_LIST_LOGS = Boolean.parseBoolean(System.getProperty("Geyser.ShowPlayerListLogs", "true")); + + @Override public void translate(GeyserSession session, ClientboundAddEntityPacket packet) { EntityDefinition definition = Registries.ENTITY_DEFINITIONS.get(packet.getType()); @@ -57,7 +61,7 @@ public class JavaAddEntityTranslatorReplace extends PacketTranslator org.apache.maven.plugins maven-compiler-plugin - 3.8.1 + 3.13.0 ${java.version} ${java.version} diff --git a/velocity/pom.xml b/velocity/pom.xml index cb9489a..ec1b2b4 100644 --- a/velocity/pom.xml +++ b/velocity/pom.xml @@ -12,7 +12,7 @@ geyserutils-velocity - 11 + 21 UTF-8 @@ -47,23 +47,7 @@ - - org.apache.maven.plugins - maven-site-plugin - 3.9.1 - - - net.trajano.wagon - wagon-git - 2.0.4 - - - org.apache.maven.doxia - doxia-module-markdown - 1.9.1 - - - + org.apache.maven.plugins maven-release-plugin