Skip to content

Commit

Permalink
Update modloader version
Browse files Browse the repository at this point in the history
  • Loading branch information
IzzelAliz committed Mar 10, 2024
1 parent 75b33d0 commit 18ec2b0
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 44 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();
Expand Down
Original file line number Diff line number Diff line change
@@ -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<DamageType> 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();
}
}
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ public static Map.Entry<String, List<String>> 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"});
}
Expand All @@ -80,8 +80,8 @@ private static CompletableFuture<Path>[] 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};
}
Expand Down Expand Up @@ -125,28 +125,28 @@ private static Map.Entry<String, List<String>> 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(",")));
}
Expand Down

0 comments on commit 18ec2b0

Please sign in to comment.