mirror of
https://github.com/Coloryr/AllMusic.git
synced 2026-11-20 15:49:37 +00:00
up
This commit is contained in:
1 parent
c1d6862392
commit
cf303690f4
7 files changed
+25
-18
No files matched your search
@@ -10,7 +10,7 @@ loader_version=0.14.14
|
||||
fabric_kotlin_version=1.9.1+kotlin.1.8.10
|
||||
|
||||
# Mod Properties
|
||||
mod_version = 2.18.5
|
||||
mod_version = 2.18.6
|
||||
maven_group = coloryr.allmusic
|
||||
archives_base_name =[Fabric1.19.2]AllMusic_Server
|
||||
|
||||
|
||||
@@ -2,23 +2,30 @@ package coloryr.allmusic;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
public class Tasks {
|
||||
public static List<TaskItem> taskItems = new ArrayList<>();
|
||||
private static final List<TaskItem> taskItems = new CopyOnWriteArrayList<>();
|
||||
|
||||
public static void init() {
|
||||
AllMusicFabric.server.addServerGuiTickable(Tasks::tick);
|
||||
}
|
||||
|
||||
public static void tick() {
|
||||
var li = taskItems.iterator();
|
||||
while (li.hasNext()) {
|
||||
var item = li.next();
|
||||
item.tick--;
|
||||
if (item.tick == 0) {
|
||||
li.remove();
|
||||
item.run.run();
|
||||
synchronized (taskItems) {
|
||||
for(var item : taskItems){
|
||||
item.tick--;
|
||||
if (item.tick == 0) {
|
||||
taskItems.remove(item);
|
||||
item.run.run();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void add(TaskItem item) {
|
||||
synchronized (taskItems) {
|
||||
taskItems.add(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -47,7 +47,7 @@ public class SideFabric extends ISide {
|
||||
|
||||
@Override
|
||||
public void runTask(Runnable run1, int delay) {
|
||||
Tasks.taskItems.add(new TaskItem() {{
|
||||
Tasks.add(new TaskItem() {{
|
||||
tick = delay;
|
||||
run = run1;
|
||||
}});
|
||||
|
||||
+3
-3
@@ -4,11 +4,11 @@
|
||||
"package": "coloryr.allmusic.mixin",
|
||||
"compatibilityLevel": "JAVA_17",
|
||||
"server": [
|
||||
"IGetCommandOutput",
|
||||
"ServerPlayerMixin"
|
||||
|
||||
],
|
||||
"mixins": [
|
||||
|
||||
"IGetCommandOutput",
|
||||
"ServerPlayerMixin"
|
||||
],
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
File renamed without changes.
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"id": "allmusic",
|
||||
"id": "allmusic_server",
|
||||
"version": "${version}",
|
||||
|
||||
"name": "AllMusic",
|
||||
"name": "AllMusic Server",
|
||||
"description": "AllMusic Server Mod",
|
||||
"authors": [
|
||||
"Color_yr"
|
||||
@@ -14,7 +14,7 @@
|
||||
},
|
||||
|
||||
"license": "CC0-1.0",
|
||||
"icon": "assets/allmusic/icon.png",
|
||||
"icon": "assets/allmusic_server/icon.png",
|
||||
"environment": "*",
|
||||
"entrypoints": {
|
||||
"main": [
|
||||
@@ -22,7 +22,7 @@
|
||||
]
|
||||
},
|
||||
"mixins": [
|
||||
"allmusic.mixins.json"
|
||||
"allmusic_server.mixins.json"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.14.14",
|
||||
|
||||
@@ -7,7 +7,7 @@ import java.util.concurrent.ConcurrentLinkedDeque;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
public class Tasks {
|
||||
private static final List<TaskItem> taskItems = new CopyOnWriteArrayList<>();
|
||||
private static final List<TaskItem> taskItems = new ArrayList<>();
|
||||
|
||||
public static void init() {
|
||||
AllMusicForge.server.addTickable(Tasks::tick);
|
||||
|
||||
Reference in new issue
Block a user