event base
This commit is contained in:
parent
fd9b51e9e0
commit
f4d14f0b2b
3
.vscode/settings.json
vendored
Normal file
3
.vscode/settings.json
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"liveServer.settings.port": 5501
|
||||
}
|
71204
javascript/classes.js
71204
javascript/classes.js
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -2,6 +2,7 @@ package net.FatalCodes.shadow;
|
|||
|
||||
import de.Hero.clickgui.ClickGui;
|
||||
import de.Hero.settings.SettingsManager;
|
||||
import net.FatalCodes.shadow.event.Event;
|
||||
import net.FatalCodes.shadow.module.ModuleManager;
|
||||
|
||||
public class Shadow {
|
||||
|
|
53
src/main/java/net/FatalCodes/shadow/event/Event.java
Normal file
53
src/main/java/net/FatalCodes/shadow/event/Event.java
Normal file
|
@ -0,0 +1,53 @@
|
|||
package net.FatalCodes.shadow.event;
|
||||
|
||||
public class Event<T> {
|
||||
|
||||
public boolean cancelled;
|
||||
public EventType type;
|
||||
public EventDirection direction;
|
||||
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
public void setCancelled(boolean cancelled) {
|
||||
this.cancelled = cancelled;
|
||||
}
|
||||
public EventType getType() {
|
||||
return type;
|
||||
}
|
||||
public void setType(EventType type) {
|
||||
this.type = type;
|
||||
}
|
||||
public EventDirection getDirection() {
|
||||
return direction;
|
||||
}
|
||||
public void setDirection(EventDirection direction) {
|
||||
this.direction = direction;
|
||||
}
|
||||
|
||||
public boolean isPre() {
|
||||
if(type == null)
|
||||
return false;
|
||||
return type == EventType.PRE;
|
||||
}
|
||||
|
||||
public boolean isPost() {
|
||||
if(type == null)
|
||||
return false;
|
||||
return type == EventType.POST;
|
||||
}
|
||||
|
||||
public boolean isIncoming() {
|
||||
if(type == null)
|
||||
return false;
|
||||
return direction == EventDirection.INCOMING;
|
||||
}
|
||||
|
||||
public boolean isOutgoing() {
|
||||
if(type == null)
|
||||
return false;
|
||||
return direction == EventDirection.OUTGOING;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
package net.FatalCodes.shadow.event;
|
||||
|
||||
public enum EventDirection {
|
||||
OUTGOING,
|
||||
INCOMING;
|
||||
}
|
6
src/main/java/net/FatalCodes/shadow/event/EventType.java
Normal file
6
src/main/java/net/FatalCodes/shadow/event/EventType.java
Normal file
|
@ -0,0 +1,6 @@
|
|||
package net.FatalCodes.shadow.event;
|
||||
|
||||
public enum EventType {
|
||||
PRE,
|
||||
POST;
|
||||
}
|
|
@ -8,6 +8,7 @@ import java.util.List;
|
|||
|
||||
import de.Hero.settings.Setting;
|
||||
import net.FatalCodes.shadow.Shadow;
|
||||
import net.FatalCodes.shadow.event.Event;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.entity.EntityPlayerSP;
|
||||
import net.minecraft.client.multiplayer.PlayerControllerMP;
|
||||
|
@ -108,4 +109,8 @@ public class Module {
|
|||
player().sendQueue.addToSendQueue(p);
|
||||
}
|
||||
|
||||
public void onEvent(Event e) {
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -2,6 +2,7 @@ package net.FatalCodes.shadow.module;
|
|||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.FatalCodes.shadow.event.Event;
|
||||
import net.FatalCodes.shadow.module.hud.ClickGui;
|
||||
import net.FatalCodes.shadow.module.hud.Drag;
|
||||
import net.FatalCodes.shadow.module.pvp.AutoWtap;
|
||||
|
@ -66,4 +67,11 @@ public class ModuleManager {
|
|||
return inCategory;
|
||||
}
|
||||
|
||||
public static void onEvent(Event e) {
|
||||
for(Module m : mods) {
|
||||
if(!m.isToggled())
|
||||
continue;
|
||||
m.onEvent(e);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1636,6 +1636,7 @@ public class Minecraft implements IThreadListener {
|
|||
this.myNetworkManager.processReceivedPackets();
|
||||
}
|
||||
|
||||
|
||||
if (this.theWorld != null) {
|
||||
++joinWorldTickCounter;
|
||||
if (bungeeOutdatedMsgTimer > 0) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user