From 611f397c165cf4d1598b5a6ec105ce3d00f19f3a Mon Sep 17 00:00:00 2001 From: HexedHero <6012891+HexedHero@users.noreply.github.com> Date: Fri, 22 Apr 2022 12:17:08 +0100 Subject: [PATCH] The 1.17 method works on 1.18, update depends --- pom.xml | 12 ++++++------ src/org/inventivetalent/glow/GlowAPI.java | 7 +------ 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/pom.xml b/pom.xml index 8bc7f86..b356fd4 100644 --- a/pom.xml +++ b/pom.xml @@ -31,7 +31,7 @@ maven-compiler-plugin - 3.8.1 + 3.10.1 16 16 @@ -40,7 +40,7 @@ org.apache.maven.plugins maven-shade-plugin - 3.3.0-SNAPSHOT + 3.3.0 package @@ -86,18 +86,18 @@ io.papermc.paper paper-api - 1.17.1-R0.1-SNAPSHOT + 1.18.2-R0.1-SNAPSHOT provided org.inventivetalent.packetlistenerapi api - 3.9.9-SNAPSHOT + 3.9.10-SNAPSHOT org.inventivetalent reflectionhelper - 1.18.9-SNAPSHOT + 1.18.10-SNAPSHOT org.bstats @@ -117,7 +117,7 @@ md_5-repo - http://repo.md-5.net/content/repositories/public/ + https://repo.md-5.net/content/repositories/public/ sonatype diff --git a/src/org/inventivetalent/glow/GlowAPI.java b/src/org/inventivetalent/glow/GlowAPI.java index 4a45c84..d4f12d8 100644 --- a/src/org/inventivetalent/glow/GlowAPI.java +++ b/src/org/inventivetalent/glow/GlowAPI.java @@ -669,12 +669,7 @@ public static Entity getEntityById(World world, int entityId) { Object nmsWorld = CraftWorldFieldResolver.resolve("world").get(world); Object entity; - if (MinecraftVersion.VERSION.newerThan(Minecraft.Version.v1_18_R1)) { - entity = world.getEntitiesByClass(ItemFrame.class).stream().filter(i -> i.getEntityId() == entityId).findFirst().orElse(null); - if (entity != null) { - entity = Minecraft.getHandle(entity); - } - } else if (MinecraftVersion.VERSION.newerThan(Minecraft.Version.v1_17_R1)) { + if (MinecraftVersion.VERSION.newerThan(Minecraft.Version.v1_17_R1)) { // no more entitiesById in 1.17+ entity = WorldServerMethodResolver.resolve(new ResolverQuery[]{ new ResolverQuery("getEntity", int.class),