-
Notifications
You must be signed in to change notification settings - Fork 497
/
TabletClient.java
57 lines (44 loc) · 1.17 KB
/
TabletClient.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
53
54
55
56
57
package buildcraft.core.tablet;
import net.minecraft.nbt.NBTTagCompound;
import cpw.mods.fml.relauncher.Side;
import buildcraft.BuildCraftCore;
import buildcraft.api.tablet.TabletBitmap;
public class TabletClient extends TabletBase {
protected final TabletRenderer renderer;
public TabletClient() {
super();
this.renderer = new TabletRenderer(new TabletBitmap(this.getScreenWidth(), this.getScreenHeight()));
}
@Override
public void tick(float time) {
super.tick(time);
}
public void updateGui(float time, GuiTablet gui, boolean force) {
renderer.tick(time);
if (renderer.shouldChange() || force) {
gui.copyDisplay(renderer.get());
}
}
@Override
public Side getSide() {
return Side.CLIENT;
}
@Override
public void refreshScreen(TabletBitmap newDisplay) {
renderer.update(newDisplay);
}
@Override
public void receiveMessage(NBTTagCompound compound) {
if (!receiveMessageInternal(compound)) {
}
}
@Override
public void launchProgram(String name) {
// noop
}
@Override
public void sendMessage(NBTTagCompound compound) {
compound.setBoolean("__program", true);
BuildCraftCore.instance.sendToServer(new PacketTabletMessage(compound));
}
}