Fabric:
- Fix Geyser detection - Force rebuild with new PE - Build with only used FabricAPI modules
This commit is contained in:
1 parent
c970c1af6f
commit
e861daa8c1
4 files changed
+8
-28
No files matched your search
+1
-1
@@ -3,7 +3,7 @@ import java.io.ByteArrayOutputStream
|
||||
plugins {
|
||||
id("java")
|
||||
id("com.gradleup.shadow") version "8.3.3" apply false
|
||||
id("fabric-loom") version "1.10.2" apply false
|
||||
id("fabric-loom") version "1.10.4" apply false
|
||||
}
|
||||
|
||||
val fullVersion = "1.3.5"
|
||||
|
||||
@@ -19,18 +19,9 @@ public class GeyserUtil {
|
||||
public static boolean isGeyserPlayer(UUID uuid) {
|
||||
if (!CHECKED_FOR_GEYSER) {
|
||||
try {
|
||||
switch (Base.INSTANCE.getPlatform()) {
|
||||
case BUKKIT:
|
||||
case FOLIA:
|
||||
ClassLoader classLoader = PacketEvents.getAPI().getPlugin().getClass().getClassLoader();
|
||||
GEYSER_CLASS = classLoader.loadClass("org.geysermc.api.Geyser");
|
||||
break;
|
||||
case FABRIC:
|
||||
GEYSER_CLASS = Class.forName("org.geysermc.api.Geyser");
|
||||
GEYSER_PRESENT = true;
|
||||
break;
|
||||
}
|
||||
|
||||
ClassLoader classLoader = PacketEvents.getAPI().getPlugin().getClass().getClassLoader();
|
||||
GEYSER_CLASS = classLoader.loadClass("org.geysermc.api.Geyser");
|
||||
GEYSER_PRESENT = true;
|
||||
} catch (ClassNotFoundException e) {
|
||||
GEYSER_PRESENT = false;
|
||||
}
|
||||
@@ -40,17 +31,8 @@ public class GeyserUtil {
|
||||
if (GEYSER_PRESENT) {
|
||||
if (GEYSER_API_CLASS == null) {
|
||||
try {
|
||||
switch (Base.INSTANCE.getPlatform()) {
|
||||
case BUKKIT:
|
||||
case FOLIA:
|
||||
ClassLoader classLoader = PacketEvents.getAPI().getPlugin().getClass().getClassLoader();
|
||||
GEYSER_API_CLASS = classLoader.loadClass("org.geysermc.api.GeyserApiBase");
|
||||
break;
|
||||
case FABRIC:
|
||||
GEYSER_CLASS = Class.forName("org.geysermc.api.GeyserApiBase");
|
||||
GEYSER_PRESENT = true;
|
||||
break;
|
||||
}
|
||||
ClassLoader classLoader = PacketEvents.getAPI().getPlugin().getClass().getClassLoader();
|
||||
GEYSER_API_CLASS = classLoader.loadClass("org.geysermc.api.GeyserApiBase");
|
||||
} catch (ClassNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -41,7 +41,8 @@ dependencies {
|
||||
parchment("org.parchmentmc.data:parchment-1.21:${rootProject.property("parchment_mappings")}")
|
||||
})
|
||||
modImplementation("net.fabricmc:fabric-loader:${rootProject.property("loader_version")}")
|
||||
modImplementation("net.fabricmc.fabric-api:fabric-api:${rootProject.property("fabric_version")}")
|
||||
modImplementation(fabricApi.module("fabric-lifecycle-events-v1", "${rootProject.property("fabric_version")}"))
|
||||
modImplementation(fabricApi.module("fabric-events-interaction-v0", "${rootProject.property("fabric_version")}"))
|
||||
|
||||
include(modImplementation("me.lucko:fabric-permissions-api:0.3.1")!!)
|
||||
include(modImplementation("com.github.retrooper:packetevents-fabric:2.7.1-SNAPSHOT")!!)
|
||||
|
||||
@@ -3,12 +3,9 @@ package me.caseload.knockbacksync.player;
|
||||
import com.github.retrooper.packetevents.PacketEvents;
|
||||
import com.github.retrooper.packetevents.protocol.player.User;
|
||||
import com.github.retrooper.packetevents.protocol.world.BoundingBox;
|
||||
import com.github.retrooper.packetevents.protocol.world.Location;
|
||||
import com.github.retrooper.packetevents.util.Vector3d;
|
||||
import me.caseload.knockbacksync.world.FabricWorld;
|
||||
import me.caseload.knockbacksync.world.PlatformWorld;
|
||||
import net.fabricmc.fabric.api.entity.event.v1.ServerPlayerEvents;
|
||||
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerEntityEvents;
|
||||
import net.minecraft.core.Holder;
|
||||
import net.minecraft.core.registries.Registries;
|
||||
import net.minecraft.data.registries.VanillaRegistries;
|
||||
|
||||
Reference in new issue
Block a user