Fixes
This commit is contained in:
@@ -1,27 +0,0 @@
|
|||||||
package io.github.skippyall.minions;
|
|
||||||
|
|
||||||
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class MinionsTickExecutor {
|
|
||||||
private static final List<Runnable> executeOnNextTick = Collections.synchronizedList(new ArrayList<>());
|
|
||||||
|
|
||||||
public static void register() {
|
|
||||||
ServerTickEvents.START_SERVER_TICK.register(server -> {
|
|
||||||
synchronized (executeOnNextTick) {
|
|
||||||
for (Runnable run:executeOnNextTick) {
|
|
||||||
run.run();
|
|
||||||
}
|
|
||||||
executeOnNextTick.clear();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void addExecuteOnNextTick(Runnable run) {
|
|
||||||
executeOnNextTick.add(run);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -69,7 +69,7 @@ public class MinionFakePlayer extends ServerPlayerEntity {
|
|||||||
PropertyMap skin = data.skin().orElse(null);
|
PropertyMap skin = data.skin().orElse(null);
|
||||||
|
|
||||||
GameProfile profile = MinionProfileUtils.makeNewMinionProfile(data.uuid(), data.name(), skin);
|
GameProfile profile = MinionProfileUtils.makeNewMinionProfile(data.uuid(), data.name(), skin);
|
||||||
doSpawn(data, profile, server, level, pos, rot);
|
server.send(server.createTask(() -> doSpawn(data, profile, server, level, pos, rot)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user