mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-16 18:45:09 +00:00
Reorganize basemod ticking to use ITickHandler. Introduce "GAME" tick vs "WORLD" tick for
mods that want to tick per world and "globally"
This commit is contained in:
1 parent
5acab9e790
commit
856fa4f337
13 files changed
+197
-147
No files matched your search
@@ -44,13 +44,13 @@ public abstract class BaseMod implements cpw.mods.fml.common.modloader.BaseMod
|
||||
Minecraft mc = (Minecraft) minecraftInstance;
|
||||
boolean hasWorld = mc.field_6324_e != null;
|
||||
// World and render ticks
|
||||
if (((tickEnd && tick==TickType.WORLD) || (tickEnd && tick==TickType.RENDER)) && hasWorld) {
|
||||
if (((tickEnd && tick==TickType.GAME) || (tickEnd && tick==TickType.RENDER)) && hasWorld) {
|
||||
return onTickInGame((Float) data[0], mc);
|
||||
} else if (((tickEnd && tick==TickType.WORLDGUI) || (tickEnd && tick==TickType.GUI))) {
|
||||
return onTickInGUI((Float) data[0], mc, (GuiScreen)data[1]);
|
||||
} else if (tick == TickType.WORLDLOADTICK && hasWorld) {
|
||||
} else if (tick == TickType.WORLDLOAD && hasWorld) {
|
||||
return onTickInGame(0.0f, mc);
|
||||
} else if (tick == TickType.GUILOADTICK) {
|
||||
} else if (tick == TickType.GUILOAD) {
|
||||
return onTickInGUI(0.0f, mc, mc.field_6313_p);
|
||||
}
|
||||
return true;
|
||||
|
||||
Reference in new issue
Block a user