Skip to content

Commit

Permalink
feat(mixin): mixin arrow to get,set effects of tipped arrow
Browse files Browse the repository at this point in the history
  • Loading branch information
WakelessSloth56 committed Sep 16, 2022
1 parent e7176e4 commit 7867177
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
@@ -0,0 +1,7 @@
package org.auioc.mcmod.arnicalib.api.mixin.common;

import org.auioc.mcmod.arnicalib.api.game.entity.ITippedArrow;

public interface IMixinArrow extends ITippedArrow {

}
@@ -0,0 +1,37 @@
package org.auioc.mcmod.arnicalib.mixin.common;

import java.util.Set;
import org.auioc.mcmod.arnicalib.api.mixin.common.IMixinArrow;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import net.minecraft.world.effect.MobEffectInstance;
import net.minecraft.world.entity.projectile.Arrow;
import net.minecraft.world.item.alchemy.Potion;

@Mixin(value = Arrow.class)
public class MixinArrow implements IMixinArrow {

@Shadow
private Potion potion;

@Shadow
@Final
private Set<MobEffectInstance> effects;

@Override
public Set<MobEffectInstance> getEffects() {
return this.effects;
}

@Override
public Potion getPotion() {
return this.potion;
}

@Override
public void setPotion(Potion potion) {
this.potion = potion;
}

}
1 change: 1 addition & 0 deletions src/main/resources/arnicalib.mixin.json
Expand Up @@ -8,6 +8,7 @@
"common.MixinCommandSourceStack",
"common.MixinCreativeModeTab",
"common.MixinItemStack",
"common.MixinArrow",
"server.MixinServerLifecycleHooks",
"server.MixinLootContext",
"server.MixinServerPlayer",
Expand Down

0 comments on commit 7867177

Please sign in to comment.