fix fabric mixin crash
This commit is contained in:
parent
50a5262239
commit
23ad7dbc0a
|
@ -1,3 +1,7 @@
|
||||||
|
Flan 1.8.4.2
|
||||||
|
================
|
||||||
|
- Fabric: Fix mixin crash
|
||||||
|
|
||||||
Flan 1.8.4.1
|
Flan 1.8.4.1
|
||||||
================
|
================
|
||||||
- Update to 1.19.4
|
- Update to 1.19.4
|
||||||
|
|
|
@ -15,6 +15,14 @@ configurations {
|
||||||
developmentFabric.extendsFrom common
|
developmentFabric.extendsFrom common
|
||||||
}
|
}
|
||||||
|
|
||||||
|
loom {
|
||||||
|
runs {
|
||||||
|
client {
|
||||||
|
vmArgs "-Dmixin.debug.export=true"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
maven {
|
maven {
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
package io.github.flemmli97.flan.fabric.mixin;
|
||||||
|
|
||||||
|
import io.github.flemmli97.flan.event.WorldEvents;
|
||||||
|
import net.minecraft.server.level.ServerLevel;
|
||||||
|
import net.minecraft.world.damagesource.DamageSource;
|
||||||
|
import net.minecraft.world.entity.Entity;
|
||||||
|
import net.minecraft.world.level.Explosion;
|
||||||
|
import net.minecraft.world.level.ExplosionDamageCalculator;
|
||||||
|
import net.minecraft.world.level.Level;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
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;
|
||||||
|
|
||||||
|
@Mixin(Level.class)
|
||||||
|
public abstract class LevelMixin {
|
||||||
|
|
||||||
|
@Inject(method = "explode(Lnet/minecraft/world/entity/Entity;Lnet/minecraft/world/damagesource/DamageSource;Lnet/minecraft/world/level/ExplosionDamageCalculator;DDDFZLnet/minecraft/world/level/Level$ExplosionInteraction;Z)Lnet/minecraft/world/level/Explosion;",
|
||||||
|
at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/Explosion;explode()V", shift = At.Shift.AFTER), locals = LocalCapture.CAPTURE_FAILHARD)
|
||||||
|
private void explosionHook(Entity source, DamageSource damageSource, ExplosionDamageCalculator damageCalculator, double x, double y, double z, float radius, boolean fire, Level.ExplosionInteraction explosionInteraction, boolean spawnParticles, CallbackInfoReturnable<Explosion> info, Explosion.BlockInteraction interaction, Explosion explosion) {
|
||||||
|
if ((Object) this instanceof ServerLevel serverLevel)
|
||||||
|
WorldEvents.modifyExplosion(explosion, serverLevel);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,22 +0,0 @@
|
||||||
package io.github.flemmli97.flan.fabric.mixin;
|
|
||||||
|
|
||||||
import io.github.flemmli97.flan.event.WorldEvents;
|
|
||||||
import net.minecraft.server.level.ServerLevel;
|
|
||||||
import net.minecraft.world.damagesource.DamageSource;
|
|
||||||
import net.minecraft.world.entity.Entity;
|
|
||||||
import net.minecraft.world.level.Explosion;
|
|
||||||
import net.minecraft.world.level.ExplosionDamageCalculator;
|
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
|
||||||
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;
|
|
||||||
|
|
||||||
@Mixin(ServerLevel.class)
|
|
||||||
public abstract class ServerWorldMixin {
|
|
||||||
|
|
||||||
@Inject(method = "explode", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/Explosion;explode()V", shift = At.Shift.AFTER), locals = LocalCapture.CAPTURE_FAILHARD)
|
|
||||||
private void explosionHook(Entity entity, DamageSource damageSource, ExplosionDamageCalculator explosionBehavior, double d, double e, double f, float g, boolean bl, Explosion.BlockInteraction destructionType, CallbackInfoReturnable<Explosion> info, Explosion explosion) {
|
|
||||||
WorldEvents.modifyExplosion(explosion, (ServerLevel) (Object) this);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -4,7 +4,7 @@
|
||||||
"package": "io.github.flemmli97.flan.fabric.mixin",
|
"package": "io.github.flemmli97.flan.fabric.mixin",
|
||||||
"compatibilityLevel": "JAVA_16",
|
"compatibilityLevel": "JAVA_16",
|
||||||
"mixins": [
|
"mixins": [
|
||||||
"ServerWorldMixin",
|
"LevelMixin",
|
||||||
"SpawnHelperMixin",
|
"SpawnHelperMixin",
|
||||||
"PlayerInteractEntityMixin",
|
"PlayerInteractEntityMixin",
|
||||||
"ProjectileMixin",
|
"ProjectileMixin",
|
||||||
|
|
|
@ -9,7 +9,7 @@ forge_version=1.19.4-45.0.22
|
||||||
loader_version=0.14.17
|
loader_version=0.14.17
|
||||||
|
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
mod_version=1.8.4.1
|
mod_version=1.8.4.2
|
||||||
maven_group=io.github.flemmli97
|
maven_group=io.github.flemmli97
|
||||||
archives_base_name=flan
|
archives_base_name=flan
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user