Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.mystchonky.arsocultas.common.mixins;

import com.klikli_dev.occultism.common.block.otherworld.IOtherworldBlock;
import com.llamalad7.mixinextras.injector.ModifyReceiver;
import net.minecraft.core.Holder;
import net.minecraft.world.effect.MobEffect;
import net.minecraft.world.entity.player.Player;
import net.neoforged.neoforge.common.util.FakePlayer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;

@Mixin(value = IOtherworldBlock.class, remap = false)
public interface IOtherworldBlockMixin {
@ModifyReceiver(method = "getPlayerHarvestTier", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/player/Player;hasEffect(Lnet/minecraft/core/Holder;)Z"))
default Player getPlayerHarvestTier(Player instance, Holder<MobEffect> holder) {
if (instance instanceof FakePlayer fake) {
Player real = fake.level().getPlayerByUUID(fake.getUUID());
if (real != null) {
return real;
}
}
return instance;
}
}
6 changes: 3 additions & 3 deletions src/main/resources/META-INF/neoforge.mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ logoFile = "logo.png"
authors = "${mod_authors}"
description = '''${mod_description}'''

#[[mixins]]
#config="${mod_id}.mixins.json"
[[mixins]]
config="${mod_id}.mixins.json"

#[[accessTransformers]]
#file="META-INF/accesstransformer.cfg"
Expand All @@ -40,5 +40,5 @@ side="BOTH"
modId = "occultism"
type = "required"
versionRange="${occultism_version_range}"
ordering="NONE"
ordering="AFTER"
side="BOTH"
12 changes: 12 additions & 0 deletions src/main/resources/ars_ocultas.mixins.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"required": true,
"minVersion": "0.8.3",
"compatibilityLevel": "JAVA_21",
"package": "com.mystchonky.arsocultas.common.mixins",
"mixins": [
"IOtherworldBlockMixin"
],
"injectors": {
"defaultRequire": 1
}
}