diff --git a/README.md b/README.md index 0f2c1fb2c..1a3ac1204 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,11 @@ A Bukkit server implementation utilizing Mixin. ![Downloads](https://img.shields.io/github/downloads/IzzelAliz/Arclight/total?style=flat-square) ![GitHub](https://img.shields.io/github/license/IzzelAliz/Arclight?style=flat-square) -| Release | Forge | Status | Build | -|:--------------------:|:------:|:------:|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:| -| Net (1.20.2) | 48.0.4 | ACTIVE | [![1.20.2 Status](https://img.shields.io/github/actions/workflow/status/IzzelAliz/Arclight/gradle.yml?branch=Net&style=flat-square)](https://github.com/IzzelAliz/Arclight/actions?query=branch%3ANet) | -| Trials (1.20-1.20.1) | 47.2.0 | LTS | [![1.20.1 Status](https://img.shields.io/github/actions/workflow/status/IzzelAliz/Arclight/gradle.yml?branch=Trials&style=flat-square)](https://github.com/IzzelAliz/Arclight/actions?query=branch%3ATrials) | -| Horn (1.19-1.19.2) | 43.3.2 | LTS | [![Horn Status](https://img.shields.io/appveyor/build/IzzelAliz/arclight-19?style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight-19) | +| Release | Forge | Status | Build | +|:--------------------:|:-------:|:------:|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:| +| Net (1.20.2) | 48.0.40 | ACTIVE | [![1.20.2 Status](https://img.shields.io/github/actions/workflow/status/IzzelAliz/Arclight/gradle.yml?branch=Net&style=flat-square)](https://github.com/IzzelAliz/Arclight/actions?query=branch%3ANet) | +| Trials (1.20-1.20.1) | 47.2.0 | LTS | [![1.20.1 Status](https://img.shields.io/github/actions/workflow/status/IzzelAliz/Arclight/gradle.yml?branch=Trials&style=flat-square)](https://github.com/IzzelAliz/Arclight/actions?query=branch%3ATrials) | +| Horn (1.19-1.19.2) | 43.3.2 | LTS | [![Horn Status](https://img.shields.io/appveyor/build/IzzelAliz/arclight-19?style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight-19) | **Legacy versions**: diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/bukkit/CraftEntityMixin.java b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/bukkit/CraftEntityMixin.java index a26d069fe..03011baca 100644 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/bukkit/CraftEntityMixin.java +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/bukkit/CraftEntityMixin.java @@ -1,6 +1,5 @@ package io.izzel.arclight.common.mixin.bukkit; -import io.izzel.arclight.common.mod.server.entity.ArclightFakePlayer; import io.izzel.arclight.common.mod.server.entity.ArclightModChestedHorse; import io.izzel.arclight.common.mod.server.entity.ArclightModEntity; import io.izzel.arclight.common.mod.server.entity.ArclightModHorse; @@ -22,7 +21,6 @@ import net.minecraft.world.entity.raid.Raider; import net.minecraft.world.entity.vehicle.AbstractMinecart; import net.minecraft.world.entity.vehicle.AbstractMinecartContainer; -import net.minecraftforge.common.util.FakePlayer; import org.bukkit.craftbukkit.v.CraftServer; import org.bukkit.craftbukkit.v.entity.CraftAgeable; import org.bukkit.craftbukkit.v.entity.CraftEntity; @@ -43,12 +41,12 @@ public abstract class CraftEntityMixin implements org.bukkit.entity.Entity { @Shadow protected Entity entity; @Shadow @Final protected CraftServer server; - @Inject(method = "getEntity", cancellable = true, at = @At("HEAD")) - private static void arclight$fakePlayer(CraftServer server, Entity entity, CallbackInfoReturnable cir) { - if (entity instanceof FakePlayer) { - cir.setReturnValue(new ArclightFakePlayer(server, (FakePlayer) entity)); - } - } + // @Inject(method = "getEntity", cancellable = true, at = @At("HEAD")) + // private static void arclight$fakePlayer(CraftServer server, Entity entity, CallbackInfoReturnable cir) { + // if (entity instanceof FakePlayer) { + // cir.setReturnValue(new ArclightFakePlayer(server, (FakePlayer) entity)); + // } + // } @Inject(method = "getEntity", cancellable = true, at = @At(value = "NEW", target = "java/lang/AssertionError")) private static void arclight$modEntity(CraftServer server, Entity entity, CallbackInfoReturnable cir) { diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/bukkit/CraftPotionUtilMixin.java b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/bukkit/CraftPotionUtilMixin.java deleted file mode 100644 index 21983a874..000000000 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/bukkit/CraftPotionUtilMixin.java +++ /dev/null @@ -1,43 +0,0 @@ -package io.izzel.arclight.common.mixin.bukkit; - -import com.google.common.base.Preconditions; -import com.google.common.collect.BiMap; -import org.bukkit.craftbukkit.v.potion.CraftPotionUtil; -import org.bukkit.potion.PotionData; -import org.bukkit.potion.PotionType; -import org.spongepowered.asm.mixin.Final; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Mutable; -import org.spongepowered.asm.mixin.Overwrite; -import org.spongepowered.asm.mixin.Shadow; - -@Mixin(value = CraftPotionUtil.class, remap = false) -public class CraftPotionUtilMixin { - - @Shadow @Final private static BiMap upgradeable; - @Shadow @Final private static BiMap extendable; - @Shadow @Final @Mutable private static BiMap regular; - - /** - * @author IzzelAliz - * @reason - */ - @Overwrite - public static String fromBukkit(PotionData data) { - String type; - if (data.isUpgraded()) { - type = upgradeable.get(data.getType()); - } else if (data.isExtended()) { - type = extendable.get(data.getType()); - } else { - type = regular.get(data.getType()); - } - - Preconditions.checkNotNull(type, "Unknown potion type from data " + data); - if (type.indexOf(':') != -1) { - return type; - } else { - return "minecraft:" + type; - } - } -} diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/server/management/PlayerListMixin.java b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/server/management/PlayerListMixin.java index b72b3fe43..76d6dd2fe 100644 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/server/management/PlayerListMixin.java +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/server/management/PlayerListMixin.java @@ -262,6 +262,11 @@ public ServerPlayer respawn(ServerPlayer entityplayer, boolean flag, PlayerRespa } public ServerPlayer respawn(ServerPlayer playerIn, ServerLevel worldIn, boolean flag, Location location, boolean avoidSuffocation, PlayerRespawnEvent.RespawnReason respawnReason) { + if (respawnReason == null && location != null) { + if (ForgeEventFactory.onTravelToDimension((ServerPlayer) (Object) this, worldIn.dimension())) { + return null; + } + } playerIn.stopRiding(); this.players.remove(playerIn); playerIn.serverLevel().removePlayerImmediately(playerIn, Entity.RemovalReason.DISCARDED); diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/entity/EntityMixin.java b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/entity/EntityMixin.java index e8b5c71ed..5c313ceba 100644 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/entity/EntityMixin.java +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/entity/EntityMixin.java @@ -878,7 +878,7 @@ public boolean teleportTo(ServerLevel worldserver, double d0, double d1, double @Overwrite(remap = false) @Nullable public Entity changeDimension(ServerLevel server, net.minecraftforge.common.util.ITeleporter teleporter) { - if (!ForgeEventFactory.onTravelToDimension((Entity) (Object) this, server.dimension())) + if (ForgeEventFactory.onTravelToDimension((Entity) (Object) this, server.dimension())) return null; if (this.level() instanceof ServerLevel && !this.isRemoved()) { this.level().getProfiler().push("changeDimension"); diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/entity/player/ServerPlayerMixin.java b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/entity/player/ServerPlayerMixin.java index c3851aa58..e420ffae3 100644 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/entity/player/ServerPlayerMixin.java +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/entity/player/ServerPlayerMixin.java @@ -485,7 +485,7 @@ public Entity changeDimension(ServerLevel server, ITeleporter teleporter) { if (this.isSleeping()) { return (ServerPlayer) (Object) this; } - if (!ForgeEventFactory.onTravelToDimension((ServerPlayer) (Object) this, server.dimension())) return null; + if (ForgeEventFactory.onTravelToDimension((ServerPlayer) (Object) this, server.dimension())) return null; PlayerTeleportEvent.TeleportCause cause = arclight$cause == null ? PlayerTeleportEvent.TeleportCause.UNKNOWN : arclight$cause; arclight$cause = null; diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/item/FishingRodItemMixin.java b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/item/FishingRodItemMixin.java index c143ce3eb..b9ccd2fc7 100644 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/item/FishingRodItemMixin.java +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/item/FishingRodItemMixin.java @@ -41,9 +41,13 @@ public InteractionResultHolder use(Level worldIn, Player playerIn, In if (playerIn.fishing != null) { if (!worldIn.isClientSide) { int i = playerIn.fishing.retrieve(itemstack); + ItemStack original = itemstack.copy(); itemstack.hurtAndBreak(i, playerIn, (player) -> { player.broadcastBreakEvent(handIn); }); + if(itemstack.isEmpty()) { + net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(playerIn, original, handIn); + } } playerIn.swing(handIn); diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/item/MapItemMixin.java b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/item/MapItemMixin.java index d65409726..9c08e1374 100644 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/item/MapItemMixin.java +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/item/MapItemMixin.java @@ -11,20 +11,29 @@ import org.bukkit.event.server.MapInitializeEvent; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Overwrite; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; -import org.spongepowered.asm.mixin.injection.callback.LocalCapture; +import org.spongepowered.asm.mixin.Shadow; import javax.annotation.Nullable; @Mixin(MapItem.class) public abstract class MapItemMixin { - @Inject(method = "createNewSavedData", locals = LocalCapture.CAPTURE_FAILHARD, at = @At("RETURN")) - private static void arclight$mapInit(Level p_151121_, int p_151122_, int p_151123_, int p_151124_, boolean p_151125_, boolean p_151126_, ResourceKey p_151127_, CallbackInfoReturnable cir, MapItemSavedData mapData) { - MapInitializeEvent event = new MapInitializeEvent(((MapDataBridge) mapData).bridge$getMapView()); + // @formatter:off + @Shadow public static String makeKey(int p_42849_) { return null; } + // @formatter:on + + /** + * @author IzzelAliz + * @reason + */ + @Overwrite + public static int createNewSavedData(Level p_151121_, int p_151122_, int p_151123_, int p_151124_, boolean p_151125_, boolean p_151126_, ResourceKey p_151127_) { + MapItemSavedData mapitemsaveddata = MapItemSavedData.createFresh((double) p_151122_, (double) p_151123_, (byte) p_151124_, p_151125_, p_151126_, p_151127_); + MapInitializeEvent event = new MapInitializeEvent(((MapDataBridge) mapitemsaveddata).bridge$getMapView()); Bukkit.getPluginManager().callEvent(event); + int i = p_151121_.getFreeMapId(); + p_151121_.setMapData(makeKey(i), mapitemsaveddata); + return i; } /** diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/item/crafting/RecipeManagerMixin.java b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/item/crafting/RecipeManagerMixin.java index 3b009d985..efdf7e9b5 100644 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/item/crafting/RecipeManagerMixin.java +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/item/crafting/RecipeManagerMixin.java @@ -65,7 +65,7 @@ protected void apply(Map objectIn, ResourceManage continue; //Forge: filter anything beginning with "_" as it's used for metadata. try { - if (entry.getValue().isJsonObject() && !CraftingHelper.processConditions(entry.getValue().getAsJsonObject(), "conditions", this.context)) { + if (entry.getValue().isJsonObject() && !net.minecraftforge.common.ForgeHooks.readAndTestCondition(this.context, entry.getValue().getAsJsonObject())) { LOGGER.debug("Skipping loading recipe {} as it's conditions were not met", resourcelocation); continue; } diff --git a/arclight-common/src/main/resources/mixins.arclight.bukkit.json b/arclight-common/src/main/resources/mixins.arclight.bukkit.json index 2a2ab70fe..76cbc436d 100644 --- a/arclight-common/src/main/resources/mixins.arclight.bukkit.json +++ b/arclight-common/src/main/resources/mixins.arclight.bukkit.json @@ -27,7 +27,6 @@ "CraftLegacyUtilMixin", "CraftMetaItemMixin", "CraftPlayerMixin", - "CraftPotionUtilMixin", "CraftRecipeMixin", "CraftRegionAccessorMixin", "CraftSchedulerMixin", diff --git a/arclight-forge/build.gradle b/arclight-forge/build.gradle index 117616cd4..d39ffce5b 100644 --- a/arclight-forge/build.gradle +++ b/arclight-forge/build.gradle @@ -65,9 +65,9 @@ dependencies { implementation 'com.google.guava:guava:31.1-jre' implementation 'org.ow2.asm:asm:9.5' implementation 'org.ow2.asm:asm-tree:9.5' - implementation 'cpw.mods:modlauncher:9.0.24' - implementation 'cpw.mods:securejarhandler:2.1.4' - implementation 'net.minecraftforge:forgespi:6.0.0' + implementation 'net.minecraftforge:modlauncher:10.1.1' + implementation 'net.minecraftforge:securemodules:2.2.3' + implementation 'net.minecraftforge:forgespi:7.1.0' gson 'com.google.code.gson:gson:2.9.0' implementation 'org.apache.logging.log4j:log4j-api:2.17.2' implementation 'org.apache.logging.log4j:log4j-core:2.17.2' diff --git a/arclight-forge/src/main/java/io/izzel/arclight/boot/application/ApplicationBootstrap.java b/arclight-forge/src/main/java/io/izzel/arclight/boot/application/ApplicationBootstrap.java index 80362068f..024fa151a 100644 --- a/arclight-forge/src/main/java/io/izzel/arclight/boot/application/ApplicationBootstrap.java +++ b/arclight-forge/src/main/java/io/izzel/arclight/boot/application/ApplicationBootstrap.java @@ -39,7 +39,7 @@ public void accept(String[] args) { this.dirtyHacks(); int targetIndex = Arrays.asList(args).indexOf("--launchTarget"); if (targetIndex >= 0 && targetIndex < args.length - 1) { - args[targetIndex + 1] = "arclightserver"; + args[targetIndex + 1] = "arclight_server"; } ServiceLoader.load(getClass().getModule().getLayer(), Consumer.class).stream() .filter(it -> !it.type().getName().contains("arclight")) diff --git a/arclight-forge/src/main/java/io/izzel/arclight/boot/application/ArclightLaunchHandler.java b/arclight-forge/src/main/java/io/izzel/arclight/boot/application/ArclightLaunchHandler.java index 288c914b7..91f84718f 100644 --- a/arclight-forge/src/main/java/io/izzel/arclight/boot/application/ArclightLaunchHandler.java +++ b/arclight-forge/src/main/java/io/izzel/arclight/boot/application/ArclightLaunchHandler.java @@ -1,12 +1,66 @@ package io.izzel.arclight.boot.application; -import net.minecraftforge.fml.loading.targets.ForgeServerLaunchHandler; +import cpw.mods.jarhandling.SecureJar; +import net.minecraftforge.fml.loading.FMLLoader; +import net.minecraftforge.fml.loading.LibraryFinder; +import net.minecraftforge.fml.loading.VersionInfo; +import net.minecraftforge.fml.loading.targets.CommonLaunchHandler; -public class ArclightLaunchHandler extends ForgeServerLaunchHandler { +import java.nio.file.Path; +import java.util.List; +import java.util.function.BiPredicate; + +// duplicate of ForgeProdLaunchHandler, change on update +public class ArclightLaunchHandler extends CommonLaunchHandler { + + public ArclightLaunchHandler() { + super(SERVER, "arclight_"); + } + + @Override + public String getNaming() { + return "srg"; + } @Override - public String name() { - return "arclightserver"; + public boolean isProduction() { + return true; + } + + protected Path mvn(VersionInfo info, String artifact) { + return mvn(info, artifact, ""); + } + + protected Path mvn(VersionInfo info, String artifact, String classifier) { + return mvn(info.forgeGroup(), artifact, classifier, info.mcAndForgeVersion()); + } + + protected Path mvn(String group, String artifact, String classifier, String version) { + return LibraryFinder.findPathForMaven(group, artifact, "", classifier, version); + } + + @Override + public CommonLaunchHandler.LocatedPaths getMinecraftPaths() { + var vers = FMLLoader.versionInfo(); + + // Minecraft + var mc = getMCPaths(vers); + + // mods (Forge) + var forgejar = mvn(vers, "forge", "universal"); + + // Libraries + var fmlcore = mvn(vers, "fmlcore"); + var javafmllang = mvn(vers, "javafmllanguage"); + var lowcodelang = mvn(vers, "lowcodelanguage"); + var mclang = mvn(vers, "mclanguage"); + + return new CommonLaunchHandler.LocatedPaths( + mc, + null, + List.of(List.of(forgejar)), + List.of(fmlcore, javafmllang, lowcodelang, mclang) + ); } @Override @@ -14,4 +68,20 @@ protected String[] preLaunch(String[] arguments, ModuleLayer layer) { // skip the log4j configuration reloading return arguments; } + + protected List getMCPaths(VersionInfo vers) { + var mc = mvn("net.minecraft", "server", "srg", vers.mcAndMCPVersion()); + var mcextra = mvn("net.minecraft", "server", "extra", vers.mcAndMCPVersion()); + var patches = mvn(vers, "forge", "server"); + + // TODO: Get rid of this by filtering the file at install time. + // We only want it for it's resources. So filter everything else out. + BiPredicate filter = (path, base) -> { + return path.equals("META-INF/versions/") || // This is required because it bypasses our filter for the manifest, and it's a multi-release jar. + (!path.endsWith(".class") && !path.startsWith("META-INF/")); + }; + mcextra = SecureJar.from(filter, mcextra).getRootPath(); + + return List.of(mc, mcextra, patches); + } } diff --git a/arclight-forge/src/main/java/io/izzel/arclight/boot/mod/ModBootstrap.java b/arclight-forge/src/main/java/io/izzel/arclight/boot/mod/ModBootstrap.java index 17f933914..9fcbfa7d6 100644 --- a/arclight-forge/src/main/java/io/izzel/arclight/boot/mod/ModBootstrap.java +++ b/arclight-forge/src/main/java/io/izzel/arclight/boot/mod/ModBootstrap.java @@ -1,7 +1,5 @@ package io.izzel.arclight.boot.mod; -import cpw.mods.cl.JarModuleFinder; -import cpw.mods.cl.ModuleClassLoader; import cpw.mods.jarhandling.SecureJar; import cpw.mods.jarhandling.impl.Jar; import cpw.mods.modlauncher.LaunchPluginHandler; @@ -12,6 +10,8 @@ import io.izzel.arclight.boot.AbstractBootstrap; import io.izzel.arclight.boot.asm.ArclightImplementer; import io.izzel.arclight.forgeinstaller.ForgeInstaller; +import net.minecraftforge.securemodules.SecureModuleClassLoader; +import net.minecraftforge.securemodules.SecureModuleFinder; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.MarkerManager; @@ -35,7 +35,7 @@ public class ModBootstrap extends AbstractBootstrap { - public static record ModBoot(Configuration configuration, ClassLoader parent) {} + public record ModBoot(Configuration configuration, ClassLoader parent) {} private static ModBoot modBoot; @@ -60,8 +60,8 @@ public static void postRun() { try { var conf = modBoot.configuration(); var parent = modBoot.parent(); - var classLoader = (ModuleClassLoader) Thread.currentThread().getContextClassLoader(); - var parentField = ModuleClassLoader.class.getDeclaredField("parentLoaders"); + var classLoader = (SecureModuleClassLoader) Thread.currentThread().getContextClassLoader(); + var parentField = SecureModuleClassLoader.class.getDeclaredField("packageToParentLoader"); var parentLoaders = (Map) Unsafe.getObject(classLoader, Unsafe.objectFieldOffset(parentField)); for (var mod : conf.modules()) { for (var pk : mod.reference().descriptor().packages()) { @@ -115,19 +115,19 @@ private void injectLaunchPlugin() throws Exception { @SuppressWarnings("unchecked") private static void load(Path[] file) throws Throwable { - var classLoader = (ModuleClassLoader) ModBootstrap.class.getClassLoader(); + var classLoader = (SecureModuleClassLoader) ModBootstrap.class.getClassLoader(); var secureJar = SecureJar.from((path, base) -> EXCLUDES.stream().noneMatch(path::startsWith), file); - var configurationField = ModuleClassLoader.class.getDeclaredField("configuration"); + var configurationField = SecureModuleClassLoader.class.getDeclaredField("configuration"); var confOffset = Unsafe.objectFieldOffset(configurationField); var oldConf = (Configuration) Unsafe.getObject(classLoader, confOffset); - var conf = oldConf.resolveAndBind(JarModuleFinder.of(secureJar), ModuleFinder.of(), List.of(secureJar.name())); + var conf = oldConf.resolveAndBind(SecureModuleFinder.of(secureJar), ModuleFinder.of(), List.of(secureJar.name())); modBoot = new ModBoot(conf, classLoader); Unsafe.putObjectVolatile(classLoader, confOffset, conf); - var pkgField = ModuleClassLoader.class.getDeclaredField("packageLookup"); + var pkgField = SecureModuleClassLoader.class.getDeclaredField("packageToOurModules"); var packageLookup = (Map) Unsafe.getObject(classLoader, Unsafe.objectFieldOffset(pkgField)); - var rootField = ModuleClassLoader.class.getDeclaredField("resolvedRoots"); + var rootField = SecureModuleClassLoader.class.getDeclaredField("ourModulesSecure"); var resolvedRoots = (Map) Unsafe.getObject(classLoader, Unsafe.objectFieldOffset(rootField)); - var moduleRefCtor = Unsafe.lookup().findConstructor(Class.forName("cpw.mods.cl.JarModuleFinder$JarModuleReference"), + var moduleRefCtor = Unsafe.lookup().findConstructor(Class.forName("net.minecraftforge.securemodules.SecureModuleFinder$Reference"), MethodType.methodType(void.class, SecureJar.ModuleDataProvider.class)); for (var mod : conf.modules()) { for (var pk : mod.reference().descriptor().packages()) { diff --git a/build.gradle b/build.gradle index a13acdbae..e51a98fb3 100644 --- a/build.gradle +++ b/build.gradle @@ -14,7 +14,7 @@ allprojects { ext { agpVersion = '1.23' minecraftVersion = '1.20.2' - forgeVersion = '48.0.4' + forgeVersion = '48.0.40' apiVersion = '1.5.5' toolsVersion = '1.3.0' mixinVersion = '0.8.5'