[fix] stuff working now
This commit is contained in:
parent
6a85ecabc3
commit
116c3142e3
5 changed files with 30 additions and 31 deletions
|
@ -3,8 +3,6 @@ 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;
|
||||
|
@ -12,12 +10,20 @@ import java.util.List;
|
|||
|
||||
public class EaaMod implements ModInitializer {
|
||||
|
||||
private static EaaMod instance;
|
||||
private final List<HandlerInterface> handler;
|
||||
private final List<MixinInterface> mixins;
|
||||
|
||||
public EaaMod(){
|
||||
handler = new ArrayList<>();
|
||||
mixins = new ArrayList<>();
|
||||
}
|
||||
|
||||
public static EaaMod getInstance(){
|
||||
if (instance == null) {
|
||||
instance = new EaaMod();
|
||||
instance.onInitialize();
|
||||
}
|
||||
|
||||
return instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -28,10 +34,6 @@ 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());
|
||||
|
||||
|
@ -40,8 +42,9 @@ public class EaaMod implements ModInitializer {
|
|||
public ResponseEntity onEvent(Object object){
|
||||
for (HandlerInterface hi : handler) {
|
||||
ResponseEntity handlerResponse = hi.handle(object);
|
||||
if (handlerResponse.isWasHandled())
|
||||
return handlerResponse; // Events are exclusive yet
|
||||
if (handlerResponse.isWasHandled()) {
|
||||
return handlerResponse; // Events are exclusive yet
|
||||
}
|
||||
}
|
||||
|
||||
return new ResponseEntity(false);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue