From 6a85ecabc35d04951f399c68e123d5c76844a1c5 Mon Sep 17 00:00:00 2001 From: "Ansgar [Hiajen]" Date: Sat, 22 May 2021 15:09:10 +0200 Subject: [PATCH] [fix] stuff --- src/main/java/net/saltymc/eaa/EaaMod.java | 8 ++++++++ src/main/java/net/saltymc/eaa/mixin/ExampleMixin.java | 10 +++++++--- .../java/net/saltymc/eaa/mixin/MixinInterface.java | 8 ++------ 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/main/java/net/saltymc/eaa/EaaMod.java b/src/main/java/net/saltymc/eaa/EaaMod.java index e0ba7d2..68045a2 100644 --- a/src/main/java/net/saltymc/eaa/EaaMod.java +++ b/src/main/java/net/saltymc/eaa/EaaMod.java @@ -3,6 +3,8 @@ package net.saltymc.eaa; import net.fabricmc.api.ModInitializer; import net.saltymc.eaa.handler.CommandHandler; import net.saltymc.eaa.handler.HandlerInterface; +import net.saltymc.eaa.mixin.ExampleMixin; +import net.saltymc.eaa.mixin.MixinInterface; import net.saltymc.eaa.util.ResponseEntity; import java.util.ArrayList; @@ -11,9 +13,11 @@ import java.util.List; public class EaaMod implements ModInitializer { private final List handler; + private final List mixins; public EaaMod(){ handler = new ArrayList<>(); + mixins = new ArrayList<>(); } @Override @@ -24,6 +28,10 @@ public class EaaMod implements ModInitializer { System.out.println("EAA Mod initializing..."); + //init Mixin + mixins.add(new ExampleMixin().init(this)); + + //Init CommandHandler handler.add(new CommandHandler()); diff --git a/src/main/java/net/saltymc/eaa/mixin/ExampleMixin.java b/src/main/java/net/saltymc/eaa/mixin/ExampleMixin.java index d78e435..e68aea6 100644 --- a/src/main/java/net/saltymc/eaa/mixin/ExampleMixin.java +++ b/src/main/java/net/saltymc/eaa/mixin/ExampleMixin.java @@ -18,10 +18,14 @@ public class ExampleMixin { } */ @Mixin(ClientPlayerEntity.class) -public class ExampleMixin extends MixinInterface { //ClientPlayerEntityMixin +public class ExampleMixin implements MixinInterface { //ClientPlayerEntityMixin - public ExampleMixin(final EaaMod eaaMod){ - super(eaaMod); + private EaaMod eaaMod; + + public MixinInterface init(final EaaMod eaaMod){ + this.eaaMod = eaaMod; + + return this; } diff --git a/src/main/java/net/saltymc/eaa/mixin/MixinInterface.java b/src/main/java/net/saltymc/eaa/mixin/MixinInterface.java index 802d648..b9c6f14 100644 --- a/src/main/java/net/saltymc/eaa/mixin/MixinInterface.java +++ b/src/main/java/net/saltymc/eaa/mixin/MixinInterface.java @@ -2,12 +2,8 @@ package net.saltymc.eaa.mixin; import net.saltymc.eaa.EaaMod; -public abstract class MixinInterface { +public interface MixinInterface { - protected final EaaMod eaaMod; - - MixinInterface(EaaMod eaaMod){ - this.eaaMod = eaaMod; - } + MixinInterface init(final EaaMod eaaMod); }