Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

Commit

Permalink
Fix citizens compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
windcolor-dev committed Sep 16, 2023
1 parent f749dff commit ee3449a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

import ga.windpvp.windspigot.async.AsyncUtil;
import ga.windpvp.windspigot.config.WindSpigotConfig;
import me.rastrian.dev.utils.IndexedLinkedHashSet;
import net.minecraft.server.EntityTracker;
import net.minecraft.server.EntityTrackerEntry;
import net.minecraft.server.WorldServer;

public class AsyncEntityTracker extends EntityTracker {
Expand All @@ -28,7 +30,7 @@ public void updatePlayers() {

AsyncUtil.run(() -> {
for (int index = finalOffset; index < c.size(); index += WindSpigotConfig.trackingThreads) {
c.get(index).update();
((IndexedLinkedHashSet<EntityTrackerEntry>) c).get(index).update();
}
worldServer.ticker.getLatch().decrement();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

import ga.windpvp.windspigot.async.AsyncUtil;
import ga.windpvp.windspigot.config.WindSpigotConfig;
import me.rastrian.dev.utils.IndexedLinkedHashSet;
import net.minecraft.server.EntityTracker;
import net.minecraft.server.EntityTrackerEntry;
import net.minecraft.server.WorldServer;

public class MultithreadedEntityTracker extends EntityTracker {
Expand All @@ -28,7 +30,7 @@ public void updatePlayers() {

AsyncUtil.run(() -> {
for (int index = finalOffset; index < c.size(); index += WindSpigotConfig.trackingThreads) {
c.get(index).update();
((IndexedLinkedHashSet<EntityTrackerEntry>) c).get(index).update();
}
worldServer.ticker.getLatch().decrement();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
package net.minecraft.server;

import java.util.List;
import java.util.Set;

import com.google.common.collect.Lists;

import ga.windpvp.windspigot.commons.ConcurrentIntHashMap;
import ga.windpvp.windspigot.config.WindSpigotConfig;
import me.rastrian.dev.utils.IndexedLinkedHashSet;

public class EntityTracker {

public List<EntityTrackerEntry> c = Lists.newCopyOnWriteArrayList();
public Set<EntityTrackerEntry> c = new IndexedLinkedHashSet<>();

public IntHashMap<EntityTrackerEntry> trackedEntities = new ConcurrentIntHashMap<>(); // WindSpigot

Expand Down

0 comments on commit ee3449a

Please sign in to comment.