-
Notifications
You must be signed in to change notification settings - Fork 497
/
TickHandlerCoreClient.java
52 lines (35 loc) · 1.24 KB
/
TickHandlerCoreClient.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package buildcraft.core;
import java.util.EnumSet;
import buildcraft.core.proxy.CoreProxy;
import net.minecraft.src.EntityPlayer;
import cpw.mods.fml.common.ITickHandler;
import cpw.mods.fml.common.TickType;
public class TickHandlerCoreClient implements ITickHandler {
private boolean nagged;
@Override
public void tickStart(EnumSet<TickType> type, Object... tickData) {
}
@Override
public void tickEnd(EnumSet<TickType> type, Object... tickData) {
if(nagged)
return;
EntityPlayer player = (EntityPlayer)tickData[0];
//if(!Config.disableVersionCheck) {
if(Version.needsUpdateNoticeAndMarkAsSeen()) {
player.sendChatToPlayer(String.format("\u00A7cNew version of BuildCraft available: %s for Minecraft %s", Version.getRecommendedVersion(), CoreProxy.proxy.getMinecraftVersion()));
for(String updateLine : Version.getChangelog())
player.sendChatToPlayer("\u00A79" + updateLine);
player.sendChatToPlayer("\u00A7cThis message only displays once. Type '/buildcraft version' if you want to see it again.");
}
//}
nagged = true;
}
@Override
public EnumSet<TickType> ticks() {
return EnumSet.of(TickType.PLAYER);
}
@Override
public String getLabel() {
return "BuildCraft - Player update tick";
}
}