mirror of
https://github.com/GeyserExtensionists/GeyserUtils.git
synced 2025-12-19 06:59:19 +00:00
Update api version
This commit is contained in:
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@@ -20,7 +20,7 @@
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="azul-17 (2)" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="21" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -66,7 +66,7 @@
|
||||
<dependency>
|
||||
<groupId>net.md-5</groupId>
|
||||
<artifactId>bungeecord-api</artifactId>
|
||||
<version>1.20-R0.3-SNAPSHOT</version>
|
||||
<version>1.21-R0.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
@@ -12,17 +12,26 @@
|
||||
<artifactId>geyserutils-common</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>11</maven.compiler.source>
|
||||
<maven.compiler.target>11</maven.compiler.target>
|
||||
<maven.compiler.source>21</maven.compiler.source>
|
||||
<maven.compiler.target>21</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.14.0</version>
|
||||
<configuration>
|
||||
<source>21</source>
|
||||
<target>21</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>3.4.1</version>
|
||||
<version>3.6.0</version>
|
||||
<configuration>
|
||||
<relocations>
|
||||
<relocation>
|
||||
@@ -58,7 +67,7 @@
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.28</version>
|
||||
<version>1.18.32</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -77,12 +86,6 @@
|
||||
<version>24.0.1</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains</groupId>
|
||||
<artifactId>annotations</artifactId>
|
||||
<version>24.0.1</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
Binary file not shown.
@@ -22,7 +22,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>3.4.1</version>
|
||||
<version>3.6.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
@@ -79,7 +79,7 @@
|
||||
<dependency>
|
||||
<groupId>org.geysermc.geyser</groupId>
|
||||
<artifactId>core</artifactId>
|
||||
<version>2.8.0-SNAPSHOT</version>
|
||||
<version>2.9.0-SNAPSHOT</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/libs/Geyser-Standalone.jar</systemPath>
|
||||
</dependency>
|
||||
|
||||
@@ -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<Map.Entry<String, Class<?>>> 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<Entity> 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();
|
||||
}
|
||||
|
||||
@@ -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<ClientboundAddEntityPacket> {
|
||||
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<Clientbound
|
||||
}
|
||||
|
||||
Vector3f position = Vector3f.from(packet.getX(), packet.getY(), packet.getZ());
|
||||
Vector3f motion = Vector3f.from(packet.getMotionX(), packet.getMotionY(), packet.getMotionZ());
|
||||
Vector3f motion = packet.getMovement().toFloat();
|
||||
float yaw = packet.getYaw();
|
||||
float pitch = packet.getPitch();
|
||||
float headYaw = packet.getHeadYaw();
|
||||
@@ -73,7 +77,9 @@ public class JavaAddEntityTranslatorReplace extends PacketTranslator<Clientbound
|
||||
} else {
|
||||
entity = session.getEntityCache().getPlayerEntity(packet.getUuid());
|
||||
if (entity == null) {
|
||||
GeyserImpl.getInstance().getLogger().error(GeyserLocale.getLocaleStringLog("geyser.entity.player.failed_list", packet.getUuid()));
|
||||
if (SHOW_PLAYER_LIST_LOGS) {
|
||||
GeyserImpl.getInstance().getLogger().error(GeyserLocale.getLocaleStringLog("geyser.entity.player.failed_list", packet.getUuid()));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -110,7 +116,6 @@ public class JavaAddEntityTranslatorReplace extends PacketTranslator<Clientbound
|
||||
return;
|
||||
}
|
||||
} else if (packet.getType() == EntityType.AREA_EFFECT_CLOUD) {
|
||||
/* todo this fix gets rid of aec's in general, we should see if it's a meg aec somehow */
|
||||
definition = Registries.ENTITY_DEFINITIONS.get(EntityType.INTERACTION);
|
||||
entity = definition.factory().create(session, packet.getEntityId(), session.getEntityCache().getNextEntityId().incrementAndGet(),
|
||||
packet.getUuid(), definition, position, motion, yaw, pitch, headYaw);
|
||||
@@ -142,4 +147,7 @@ public class JavaAddEntityTranslatorReplace extends PacketTranslator<Clientbound
|
||||
|
||||
session.getEntityCache().spawnEntity(entity);
|
||||
}
|
||||
/*
|
||||
|
||||
*/
|
||||
}
|
||||
@@ -21,7 +21,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<version>3.13.0</version>
|
||||
<configuration>
|
||||
<source>${java.version}</source>
|
||||
<target>${java.version}</target>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<name>geyserutils-velocity</name>
|
||||
|
||||
<properties>
|
||||
<java.version>11</java.version>
|
||||
<java.version>21</java.version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
@@ -47,23 +47,7 @@
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-site-plugin</artifactId>
|
||||
<version>3.9.1</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>net.trajano.wagon</groupId>
|
||||
<artifactId>wagon-git</artifactId>
|
||||
<version>2.0.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.doxia</groupId>
|
||||
<artifactId>doxia-module-markdown</artifactId>
|
||||
<version>1.9.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-release-plugin</artifactId>
|
||||
|
||||
Reference in New Issue
Block a user