mirror of
https://github.com/GeyserExtensionists/GeyserUtils.git
synced 2025-12-19 14:59:18 +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>
|
</list>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</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" />
|
<output url="file://$PROJECT_DIR$/out" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
@@ -66,7 +66,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.md-5</groupId>
|
<groupId>net.md-5</groupId>
|
||||||
<artifactId>bungeecord-api</artifactId>
|
<artifactId>bungeecord-api</artifactId>
|
||||||
<version>1.20-R0.3-SNAPSHOT</version>
|
<version>1.21-R0.1</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|||||||
@@ -12,17 +12,26 @@
|
|||||||
<artifactId>geyserutils-common</artifactId>
|
<artifactId>geyserutils-common</artifactId>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<maven.compiler.source>11</maven.compiler.source>
|
<maven.compiler.source>21</maven.compiler.source>
|
||||||
<maven.compiler.target>11</maven.compiler.target>
|
<maven.compiler.target>21</maven.compiler.target>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<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>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-shade-plugin</artifactId>
|
<artifactId>maven-shade-plugin</artifactId>
|
||||||
<version>3.4.1</version>
|
<version>3.6.0</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<relocations>
|
<relocations>
|
||||||
<relocation>
|
<relocation>
|
||||||
@@ -58,7 +67,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.projectlombok</groupId>
|
<groupId>org.projectlombok</groupId>
|
||||||
<artifactId>lombok</artifactId>
|
<artifactId>lombok</artifactId>
|
||||||
<version>1.18.28</version>
|
<version>1.18.32</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
@@ -77,12 +86,6 @@
|
|||||||
<version>24.0.1</version>
|
<version>24.0.1</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.jetbrains</groupId>
|
|
||||||
<artifactId>annotations</artifactId>
|
|
||||||
<version>24.0.1</version>
|
|
||||||
<scope>compile</scope>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
Binary file not shown.
@@ -22,7 +22,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-shade-plugin</artifactId>
|
<artifactId>maven-shade-plugin</artifactId>
|
||||||
<version>3.4.1</version>
|
<version>3.6.0</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<phase>package</phase>
|
<phase>package</phase>
|
||||||
@@ -79,7 +79,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.geysermc.geyser</groupId>
|
<groupId>org.geysermc.geyser</groupId>
|
||||||
<artifactId>core</artifactId>
|
<artifactId>core</artifactId>
|
||||||
<version>2.8.0-SNAPSHOT</version>
|
<version>2.9.0-SNAPSHOT</version>
|
||||||
<scope>system</scope>
|
<scope>system</scope>
|
||||||
<systemPath>${project.basedir}/libs/Geyser-Standalone.jar</systemPath>
|
<systemPath>${project.basedir}/libs/Geyser-Standalone.jar</systemPath>
|
||||||
</dependency>
|
</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.Skin;
|
||||||
import org.geysermc.geyser.api.skin.SkinData;
|
import org.geysermc.geyser.api.skin.SkinData;
|
||||||
import org.geysermc.geyser.api.skin.SkinGeometry;
|
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.EntityDefinition;
|
||||||
import org.geysermc.geyser.entity.properties.GeyserEntityProperties;
|
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.Entity;
|
||||||
import org.geysermc.geyser.entity.type.player.PlayerEntity;
|
import org.geysermc.geyser.entity.type.player.PlayerEntity;
|
||||||
import org.geysermc.geyser.registry.Registries;
|
import org.geysermc.geyser.registry.Registries;
|
||||||
@@ -94,20 +98,20 @@ public class GeyserUtils implements Extension {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// the static here is crazy ;(
|
// the static here is crazy ;(
|
||||||
private static GeyserEntityProperties getProperties(String id) {
|
private static GeyserEntityProperties.Builder getProperties(String id) {
|
||||||
if (!properties.containsKey(id)) return null;
|
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);
|
List<Map.Entry<String, Class<?>>> pairs = properties.get(id);
|
||||||
pairs.forEach(p -> {
|
pairs.forEach(p -> {
|
||||||
// only bool, float and int support for now
|
// only bool, float and int support for now
|
||||||
if (p.getValue() == Boolean.class) builder.addBoolean(p.getKey());
|
if (p.getValue() == Boolean.class) builder.add(new BooleanProperty(Identifier.of(p.getKey()), false));
|
||||||
else if (p.getValue() == Float.class) builder.addFloat(p.getKey());
|
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.addInt(p.getKey());
|
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());
|
else instance.logger().info("Found unknown property: " + p.getKey());
|
||||||
});
|
});
|
||||||
|
|
||||||
return builder.build();
|
return builder;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean containsProperty(String entityId, String identifier) {
|
private static boolean containsProperty(String entityId, String identifier) {
|
||||||
@@ -135,7 +139,7 @@ public class GeyserUtils implements Extension {
|
|||||||
|
|
||||||
public static void registerPropertiesForGeyser(String entityId) {
|
public static void registerPropertiesForGeyser(String entityId) {
|
||||||
|
|
||||||
GeyserEntityProperties entityProperties = getProperties(entityId);
|
GeyserEntityProperties entityProperties = getProperties(entityId).build();
|
||||||
if (entityProperties == null) return;
|
if (entityProperties == null) return;
|
||||||
properties.values().stream()
|
properties.values().stream()
|
||||||
.flatMap(List::stream)
|
.flatMap(List::stream)
|
||||||
@@ -188,7 +192,7 @@ public class GeyserUtils implements Extension {
|
|||||||
);
|
);
|
||||||
|
|
||||||
EntityDefinition<Entity> def = EntityDefinition.builder(null)
|
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);
|
LOADED_ENTITY_DEFINITIONS.put(id, def);
|
||||||
}
|
}
|
||||||
@@ -572,9 +576,9 @@ public class GeyserUtils implements Extension {
|
|||||||
|
|
||||||
if (entity.getPropertyManager() == null) return;
|
if (entity.getPropertyManager() == null) return;
|
||||||
if (entityPropertyPacket.getValue() instanceof Boolean value) {
|
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) {
|
} 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();
|
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.CUSTOM_ENTITIES;
|
||||||
import static me.zimzaza4.geyserutils.geyser.GeyserUtils.LOADED_ENTITY_DEFINITIONS;
|
import static me.zimzaza4.geyserutils.geyser.GeyserUtils.LOADED_ENTITY_DEFINITIONS;
|
||||||
|
|
||||||
|
|
||||||
public class JavaAddEntityTranslatorReplace extends PacketTranslator<ClientboundAddEntityPacket> {
|
public class JavaAddEntityTranslatorReplace extends PacketTranslator<ClientboundAddEntityPacket> {
|
||||||
|
private static final boolean SHOW_PLAYER_LIST_LOGS = Boolean.parseBoolean(System.getProperty("Geyser.ShowPlayerListLogs", "true"));
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void translate(GeyserSession session, ClientboundAddEntityPacket packet) {
|
public void translate(GeyserSession session, ClientboundAddEntityPacket packet) {
|
||||||
EntityDefinition<?> definition = Registries.ENTITY_DEFINITIONS.get(packet.getType());
|
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 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 yaw = packet.getYaw();
|
||||||
float pitch = packet.getPitch();
|
float pitch = packet.getPitch();
|
||||||
float headYaw = packet.getHeadYaw();
|
float headYaw = packet.getHeadYaw();
|
||||||
@@ -73,7 +77,9 @@ public class JavaAddEntityTranslatorReplace extends PacketTranslator<Clientbound
|
|||||||
} else {
|
} else {
|
||||||
entity = session.getEntityCache().getPlayerEntity(packet.getUuid());
|
entity = session.getEntityCache().getPlayerEntity(packet.getUuid());
|
||||||
if (entity == null) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -110,7 +116,6 @@ public class JavaAddEntityTranslatorReplace extends PacketTranslator<Clientbound
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else if (packet.getType() == EntityType.AREA_EFFECT_CLOUD) {
|
} 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);
|
definition = Registries.ENTITY_DEFINITIONS.get(EntityType.INTERACTION);
|
||||||
entity = definition.factory().create(session, packet.getEntityId(), session.getEntityCache().getNextEntityId().incrementAndGet(),
|
entity = definition.factory().create(session, packet.getEntityId(), session.getEntityCache().getNextEntityId().incrementAndGet(),
|
||||||
packet.getUuid(), definition, position, motion, yaw, pitch, headYaw);
|
packet.getUuid(), definition, position, motion, yaw, pitch, headYaw);
|
||||||
@@ -142,4 +147,7 @@ public class JavaAddEntityTranslatorReplace extends PacketTranslator<Clientbound
|
|||||||
|
|
||||||
session.getEntityCache().spawnEntity(entity);
|
session.getEntityCache().spawnEntity(entity);
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>3.8.1</version>
|
<version>3.13.0</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<source>${java.version}</source>
|
<source>${java.version}</source>
|
||||||
<target>${java.version}</target>
|
<target>${java.version}</target>
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
<name>geyserutils-velocity</name>
|
<name>geyserutils-velocity</name>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<java.version>11</java.version>
|
<java.version>21</java.version>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
@@ -47,23 +47,7 @@
|
|||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</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>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-release-plugin</artifactId>
|
<artifactId>maven-release-plugin</artifactId>
|
||||||
|
|||||||
Reference in New Issue
Block a user