Skip to content

Commit a77f5d4

Browse files
committed
Fix live performance harness compilation
1 parent 0b6eb44 commit a77f5d4

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

common/src/main/java/com/loohp/interactionvisualizer/managers/PerformanceMetrics.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,13 @@ public static Snapshot stop() {
100100
return null;
101101
}
102102
INSTANCE.collecting = false;
103-
Snapshot snapshot = INSTANCE.snapshot();
103+
Snapshot snapshot = INSTANCE.createSnapshot();
104104
InteractionVisualizer.plugin.getLogger().info("IV_PERF " + snapshot.json());
105105
return snapshot;
106106
}
107107

108108
public static Snapshot snapshot() {
109-
return INSTANCE.collecting ? INSTANCE.snapshot() : null;
109+
return INSTANCE.collecting ? INSTANCE.createSnapshot() : null;
110110
}
111111

112112
public static void virtualSpawnBundle() {
@@ -212,7 +212,7 @@ public void onServerTickEnd(ServerTickEndEvent event) {
212212
}
213213
}
214214

215-
private Snapshot snapshot() {
215+
private Snapshot createSnapshot() {
216216
int samples = tickCount;
217217
double[] sorted = Arrays.copyOf(tickDurations, samples);
218218
Arrays.sort(sorted);

common/src/main/java/com/loohp/interactionvisualizer/objectholders/EnchantmentTableAnimation.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,11 @@ private CompletableFuture<Integer> playEnchantAnimation(Map<Enchantment, Integer
160160
item.setGravity(false);
161161
item.setLocked(true);
162162
item.setVelocity(new Vector(0.0, 0.05, 0.0));
163-
DisplayManager.updateItem(item);
163+
if (spawned) {
164+
DisplayManager.sendItemSpawn(InteractionVisualizerAPI.getPlayerModuleList(Modules.ITEMDROP, KEY), item);
165+
} else {
166+
DisplayManager.updateItem(item);
167+
}
164168
for (Player each : InteractionVisualizerAPI.getPlayerModuleList(Modules.ITEMDROP, KEY)) {
165169
each.spawnParticle(Particle.PORTAL, location.clone().add(0.5, 2.6, 0.5), 200);
166170
}
@@ -279,11 +283,7 @@ private CompletableFuture<Integer> playPickUpAnimation(ItemStack itemstack) {
279283
return future;
280284
}
281285

282-
if (spawned) {
283-
DisplayManager.sendItemSpawn(InteractionVisualizerAPI.getPlayerModuleList(Modules.ITEMDROP, KEY), item);
284-
} else {
285-
DisplayManager.updateItem(item);
286-
}
286+
DisplayManager.updateItem(item);
287287
DisplayManager.collectItem(item, enchanter);
288288

289289
Scheduler.runTaskLater(plugin, () -> {

0 commit comments

Comments
 (0)