[fix] stuff

This commit is contained in:
Hiajen Hiajen 2021-05-22 15:09:10 +02:00
parent f19ea5c876
commit 6a85ecabc3
3 changed files with 17 additions and 9 deletions

View file

@ -3,6 +3,8 @@ package net.saltymc.eaa;
import net.fabricmc.api.ModInitializer; import net.fabricmc.api.ModInitializer;
import net.saltymc.eaa.handler.CommandHandler; import net.saltymc.eaa.handler.CommandHandler;
import net.saltymc.eaa.handler.HandlerInterface; 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 net.saltymc.eaa.util.ResponseEntity;
import java.util.ArrayList; import java.util.ArrayList;
@ -11,9 +13,11 @@ import java.util.List;
public class EaaMod implements ModInitializer { public class EaaMod implements ModInitializer {
private final List<HandlerInterface> handler; private final List<HandlerInterface> handler;
private final List<MixinInterface> mixins;
public EaaMod(){ public EaaMod(){
handler = new ArrayList<>(); handler = new ArrayList<>();
mixins = new ArrayList<>();
} }
@Override @Override
@ -24,6 +28,10 @@ public class EaaMod implements ModInitializer {
System.out.println("EAA Mod initializing..."); System.out.println("EAA Mod initializing...");
//init Mixin
mixins.add(new ExampleMixin().init(this));
//Init CommandHandler //Init CommandHandler
handler.add(new CommandHandler()); handler.add(new CommandHandler());

View file

@ -18,10 +18,14 @@ public class ExampleMixin {
} }
*/ */
@Mixin(ClientPlayerEntity.class) @Mixin(ClientPlayerEntity.class)
public class ExampleMixin extends MixinInterface { //ClientPlayerEntityMixin public class ExampleMixin implements MixinInterface { //ClientPlayerEntityMixin
public ExampleMixin(final EaaMod eaaMod){ private EaaMod eaaMod;
super(eaaMod);
public MixinInterface init(final EaaMod eaaMod){
this.eaaMod = eaaMod;
return this;
} }

View file

@ -2,12 +2,8 @@ package net.saltymc.eaa.mixin;
import net.saltymc.eaa.EaaMod; import net.saltymc.eaa.EaaMod;
public abstract class MixinInterface { public interface MixinInterface {
protected final EaaMod eaaMod; MixinInterface init(final EaaMod eaaMod);
MixinInterface(EaaMod eaaMod){
this.eaaMod = eaaMod;
}
} }