mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 02:37:27 +00:00
Forge tick events only run if they are in the starting phase.
This commit is contained in:
1 parent
7d94e0e210
commit
03ee733620
1 file changed
+7
-3
@@ -433,6 +433,10 @@ public class ScriptPlayerEventHandler {
|
||||
@SubscribeEvent
|
||||
public void forgeEntity(Event event) {
|
||||
if(CustomNpcs.getServer() != null && ScriptController.Instance.forgeScripts.isEnabled()) {
|
||||
if(event instanceof TickEvent && !(((TickEvent)event).side == Side.SERVER && ((TickEvent)event).phase == TickEvent.Phase.START)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(event instanceof EntityEvent) {
|
||||
EntityEvent ev2 = (EntityEvent)event;
|
||||
if(ev2.entity != null && ev2.entity.worldObj instanceof WorldServer) {
|
||||
@@ -444,9 +448,9 @@ public class ScriptPlayerEventHandler {
|
||||
EventHooks.onForgeWorldEvent(ev1);
|
||||
}
|
||||
} else if(!(event instanceof TickEvent) || ((TickEvent)event).side != Side.CLIENT) {
|
||||
if(event instanceof PlayerEvent) {
|
||||
PlayerEvent ev = (PlayerEvent)event;
|
||||
if(!(ev.player.worldObj instanceof WorldServer)) {
|
||||
if (event instanceof PlayerEvent) {
|
||||
PlayerEvent ev = (PlayerEvent) event;
|
||||
if (!(ev.player.worldObj instanceof WorldServer)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user