Major Overhaul (needs testing)

This commit is contained in:
TheLividaProject
2025-05-27 22:32:49 +01:00
parent 1ac7beec4c
commit f2cc0b9663
102 changed files with 2307 additions and 957 deletions

View File

@@ -0,0 +1,29 @@
package re.imc.geysermodelengine.runnables;
import com.ticxo.modelengine.api.model.ActiveModel;
import io.papermc.paper.threadedregions.scheduler.ScheduledTask;
import re.imc.geysermodelengine.GeyserModelEngine;
import re.imc.geysermodelengine.managers.model.data.ModelEntityData;
import java.util.Map;
import java.util.function.Consumer;
public class UpdateTaskRunnable implements Consumer<ScheduledTask> {
private final GeyserModelEngine plugin;
public UpdateTaskRunnable(GeyserModelEngine plugin) {
this.plugin = plugin;
}
@Override
public void accept(ScheduledTask scheduledTask) {
try {
for (Map<ActiveModel, ModelEntityData> models : plugin.getModelManager().getEntitiesCache().values()) {
models.values().forEach(model -> model.getEntityTask().updateEntityProperties(model, model.getViewers(), false));
}
} catch (Throwable err) {
throw new RuntimeException(err);
}
}
}