diff --git a/README.md b/README.md index 4ddedb91c..243e36893 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 | NeoForge | Fabric | Status | Downloads | -|:---------------------|:--------|:--------------|:-------|:------:|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:| -| Whisper (1.20.4) | 49.0.22 | 20.4.147-beta | 0.96.0 | ACTIVE | [![1.20.4 Status](https://img.shields.io/github/actions/workflow/status/IzzelAliz/Arclight/gradle.yml?branch=Whisper&style=flat-square)](https://github.com/IzzelAliz/Arclight/actions?query=branch%3AWhisper) | -| Trials (1.20-1.20.1) | 47.2.20 | - | - | 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.7 | - | - | 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 | NeoForge | Fabric | Status | Downloads | +|:---------------------|:--------|:---------|:-------|:------:|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:| +| Whisper (1.20.4) | 49.0.31 | 20.4.196 | 0.96.4 | ACTIVE | [![1.20.4 Status](https://img.shields.io/github/actions/workflow/status/IzzelAliz/Arclight/gradle.yml?branch=Whisper&style=flat-square)](https://github.com/IzzelAliz/Arclight/actions?query=branch%3AWhisper) | +| Trials (1.20-1.20.1) | 47.2.20 | - | - | 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.7 | - | - | 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-forge/src/main/java/io/izzel/arclight/forge/mixin/core/world/entity/animal/frog/TadpoleMixin_Forge.java b/arclight-forge/src/main/java/io/izzel/arclight/forge/mixin/core/world/entity/animal/frog/TadpoleMixin_Forge.java index edaeb6121..505217421 100644 --- a/arclight-forge/src/main/java/io/izzel/arclight/forge/mixin/core/world/entity/animal/frog/TadpoleMixin_Forge.java +++ b/arclight-forge/src/main/java/io/izzel/arclight/forge/mixin/core/world/entity/animal/frog/TadpoleMixin_Forge.java @@ -4,6 +4,7 @@ import net.minecraft.server.level.ServerLevel; import net.minecraft.world.entity.animal.frog.Frog; import net.minecraft.world.entity.animal.frog.Tadpole; +import net.minecraft.world.level.Level; import org.bukkit.craftbukkit.v.event.CraftEventFactory; import org.bukkit.event.entity.CreatureSpawnEvent; import org.spongepowered.asm.mixin.Mixin; @@ -14,14 +15,14 @@ import org.spongepowered.asm.mixin.injection.callback.LocalCapture; @Mixin(Tadpole.class) -public abstract class TadpoleMixin_Forge { +public abstract class TadpoleMixin_Forge { // @formatter:off @Shadow protected abstract void setAge(int p_218711_); // @formatter:on @Inject(method = "ageUp()V", cancellable = true, locals = LocalCapture.CAPTURE_FAILHARD, at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/animal/frog/Tadpole;playSound(Lnet/minecraft/sounds/SoundEvent;FF)V")) - private void arclight$transform(CallbackInfo ci, ServerLevel serverLevel, Frog frog) { + private void arclight$transform(CallbackInfo ci, Level level, ServerLevel serverLevel, Frog frog) { if (CraftEventFactory.callEntityTransformEvent((Tadpole) (Object) this, frog, org.bukkit.event.entity.EntityTransformEvent.TransformReason.METAMORPHOSIS).isCancelled()) { this.setAge(0); // Sets the age to 0 for avoid a loop if the event is canceled ci.cancel(); diff --git a/arclight-neoforge/src/main/java/io/izzel/arclight/neoforge/mixin/core/world/effect/PoisonMobEffectMixin_NeoForge.java b/arclight-neoforge/src/main/java/io/izzel/arclight/neoforge/mixin/core/world/effect/PoisonMobEffectMixin_NeoForge.java index 6237abedf..1b7ec94f7 100644 --- a/arclight-neoforge/src/main/java/io/izzel/arclight/neoforge/mixin/core/world/effect/PoisonMobEffectMixin_NeoForge.java +++ b/arclight-neoforge/src/main/java/io/izzel/arclight/neoforge/mixin/core/world/effect/PoisonMobEffectMixin_NeoForge.java @@ -1,20 +1,16 @@ package io.izzel.arclight.neoforge.mixin.core.world.effect; import io.izzel.arclight.common.bridge.core.util.DamageSourceBridge; -import io.izzel.arclight.common.bridge.core.util.DamageSourcesBridge; -import net.minecraft.resources.ResourceKey; import net.minecraft.world.damagesource.DamageSource; -import net.minecraft.world.damagesource.DamageSources; -import net.minecraft.world.damagesource.DamageType; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Redirect; +import org.spongepowered.asm.mixin.injection.ModifyArg; @Mixin(targets = "net.minecraft.world.effect.PoisonMobEffect") public class PoisonMobEffectMixin_NeoForge { - @Redirect(method = "applyEffectTick", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/damagesource/DamageSources;source(Lnet/minecraft/resources/ResourceKey;)Lnet/minecraft/world/damagesource/DamageSource;")) - private DamageSource arclight$redirectPoison(DamageSources instance, ResourceKey source) { - return ((DamageSourceBridge) instance.source(source)).bridge$poison(); + @ModifyArg(method = "applyEffectTick", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/LivingEntity;hurt(Lnet/minecraft/world/damagesource/DamageSource;F)Z")) + private DamageSource arclight$redirectPoison(DamageSource source) { + return ((DamageSourceBridge) source).bridge$poison(); } } diff --git a/build.gradle b/build.gradle index a9facd392..522e24706 100644 --- a/build.gradle +++ b/build.gradle @@ -19,9 +19,9 @@ allprojects { minecraftVersion = '1.20.4' supportedPlatforms = ['forge', 'neoforge', 'fabric'] fabricLoaderVersion = '0.15.6' - fabricApiVersion = '0.96.0+1.20.4' - forgeVersion = '49.0.22' - neoForgeVersion = '20.4.147-beta' + fabricApiVersion = '0.96.4+1.20.4' + forgeVersion = '49.0.31' + neoForgeVersion = '20.4.196' apiVersion = '1.6.3' toolsVersion = '1.3.0' mixinVersion = '0.8.5' diff --git a/installer/src/main/java/io/izzel/arclight/installer/NeoforgeInstaller.java b/installer/src/main/java/io/izzel/arclight/installer/NeoforgeInstaller.java index 99aef84ec..65e076244 100644 --- a/installer/src/main/java/io/izzel/arclight/installer/NeoforgeInstaller.java +++ b/installer/src/main/java/io/izzel/arclight/installer/NeoforgeInstaller.java @@ -60,8 +60,8 @@ public static Map.Entry> applicationInstall() throws Throwa } } catch (IOException e) { try (URLClassLoader loader = new URLClassLoader( - new URL[]{futures[0].join().toUri().toURL()}, - ForgeInstaller.class.getClassLoader().getParent())) { + new URL[]{futures[0].join().toUri().toURL()}, + ForgeInstaller.class.getClassLoader().getParent())) { Method method = loader.loadClass("net.minecraftforge.installer.SimpleInstaller").getMethod("main", String[].class); method.invoke(null, (Object) new String[]{"--installServer", ".", "--debug"}); } @@ -80,8 +80,8 @@ private static CompletableFuture[] installForge(InstallInfo info, Executor String dist = String.format("neoforge-%s-installer.jar", info.installer.neoforge); var installerFuture = ForgeLikeProvider.downloadInstaller(coord, dist, info.installer.neoforgeHash, minecraftData, info, pool, logger); var serverFuture = minecraftData.thenCompose(data -> MinecraftProvider.reportSupply(pool, logger).apply( - new FileDownloader(String.format(data.serverUrl(), info.installer.minecraft), - String.format("libraries/net/minecraft/server/%1$s/server-%1$s.jar", info.installer.minecraft), data.serverHash()) + new FileDownloader(String.format(data.serverUrl(), info.installer.minecraft), + String.format("libraries/net/minecraft/server/%1$s/server-%1$s.jar", info.installer.minecraft), data.serverHash()) )); return new CompletableFuture[]{installerFuture, serverFuture}; } @@ -125,28 +125,28 @@ private static Map.Entry> classpath(Path path, InstallInfo var split = arg.substring(2).split("=", 2); if (split[0].equals("legacyClassPath")) { split[1] = - Stream.concat( - Stream.concat(Stream.concat(Stream.of(self.toString()), Arrays.stream(split[1].split(File.pathSeparator))), installInfo.libraries.keySet().stream() - .map(it -> Paths.get("libraries", Util.mavenToPath(it))) - .peek(it -> { - var name = it.getFileName().toString(); - if (name.contains("maven-model")) { - merges.add(name); - } - }) - .map(Path::toString)), - Stream.empty() - //Stream.of(self) - ).sorted((a, b) -> { - // damn stupid jpms - if (a.contains("maven-repository-metadata")) { - return -1; - } else if (b.contains("maven-repository-metadata")) { - return 1; - } else { - return 0; - } - }).collect(Collectors.joining(File.pathSeparator)); + Stream.concat( + Stream.concat(Stream.concat(Stream.of(self.toString()), Arrays.stream(split[1].split(File.pathSeparator))), installInfo.libraries.keySet().stream() + .peek(it -> { + var lib = Paths.get("libraries", Util.mavenToPath(it)); + var name = lib.getFileName().toString(); + if (name.contains("maven-model")) { + merges.add(name); + } + }) + .map(it -> "libraries/" + Util.mavenToPath(it))), + Stream.empty() + //Stream.of(self) + ).sorted((a, b) -> { + // damn stupid jpms + if (a.contains("maven-repository-metadata")) { + return -1; + } else if (b.contains("maven-repository-metadata")) { + return 1; + } else { + return 0; + } + }).distinct().collect(Collectors.joining(File.pathSeparator)); } else if (split[0].equals("ignoreList")) { ignores.addAll(Arrays.asList(split[1].split(","))); }