MCPcopy Create free account
hub / github.com/BuildCraft/BuildCraft / tick

Method tick

tests/buildcraft/tests/BuildCraftTests.java:104–142  ·  view source on GitHub ↗
(WorldTickEvent evt)

Source from the content-addressed store, hash-verified

102 }
103
104 @SubscribeEvent
105 public void tick(WorldTickEvent evt) {
106 WorldServer world = MinecraftServer.getServer().worldServers[0];
107 long time = world.getTotalWorldTime();
108
109 if (startTestTime == 0) {
110 startTestTime = time;
111 } else if (testSequence == null) {
112 if (time - startTestTime > 10) {
113
114 try {
115 testSequence = new Sequence(world);
116
117 File file = new File(testFile);
118 FileInputStream f = new FileInputStream(file);
119 byte[] data = new byte[(int) file.length()];
120 f.read(data);
121 f.close();
122
123 NBTTagCompound nbt = CompressedStreamTools.decompress(data);
124
125 testSequence.readFromNBT(nbt);
126 } catch (FileNotFoundException e) {
127 e.printStackTrace();
128 } catch (IOException e) {
129 e.printStackTrace();
130 }
131 }
132 } else {
133 if (!testSequence.done()) {
134 testSequence.iterate();
135 } else {
136 if (quitAfterRun) {
137 MinecraftServer.getServer().stopServer();
138 System.exit(0);
139 }
140 }
141 }
142 }
143}

Callers

nothing calls this directly

Calls 5

getServerMethod · 0.80
doneMethod · 0.80
readMethod · 0.65
iterateMethod · 0.65
readFromNBTMethod · 0.45

Tested by

no test coverage detected