Skip to content

Commit

Permalink
Changed name of mixin class + fixed injection target(target wasnt wor…
Browse files Browse the repository at this point in the history
…king with forge)
  • Loading branch information
Ivan-Khar committed Dec 18, 2024
1 parent 071d810 commit f93f8fc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,21 @@
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(LivingEntity.class)
public abstract class EntityMixin {
public abstract class LivingEntityMixin {

@Unique
private int brineEffectTick = 0;

@Inject(
method = "baseTick",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/entity/LivingEntity;isSubmergedIn(Lnet/minecraft/registry/tag/TagKey;)Z"
value = "TAIL"
)
)
private void applyToxicShockInBrine(CallbackInfo ci) {
LivingEntity livingEntity = (LivingEntity) (Object) this;

if (brineEffectTick >= 20) {
if (!livingEntity.getWorld().isClient && brineEffectTick >= 20) {
brineEffectTick = 0;
Box box = livingEntity.getBoundingBox().contract(0.001);
int entityMinX = MathHelper.floor(box.minX);
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/hybrid-aquatic.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"compatibilityLevel": "JAVA_17",
"mixins": [
"EnchantmentMixin",
"EntityMixin",
"LivingEntityMixin",
"FishingBobberEntityMixin",
"FishingRodItemMixin",
"PlayerEntityMixin",
Expand Down

0 comments on commit f93f8fc

Please sign in to comment.