fix problem
Some checks failed
/ Auto-Build-App (push) Has been cancelled

This commit is contained in:
pietru 2024-11-08 11:36:05 +01:00
parent e2170844d9
commit b744e4b2b1
4 changed files with 36 additions and 35 deletions

View file

@ -32,20 +32,6 @@ public class CookieUtils implements ModInitializer {
setupCreator.registerSetupCreators(); setupCreator.registerSetupCreators();
System.out.println("CookieUtils loaded setup creators..."); System.out.println("CookieUtils loaded setup creators...");
try {
ArrayList<String> zones = get_server_property_array("zones","[]");
for (String zoneId : zones){
Zone z = GameSingletons.world.getZoneIfExists(zoneId);
if (z == null && GameSingletons.isHost) {
z = Zone.loadZone(GameSingletons.world, zoneId);
GameSingletons.world.addZone(z);
}
}
System.out.println("CookieUtils loaded additional zones...");
} catch (IOException e) {
throw new RuntimeException(e);
}
// List<String> paths = List.of(Gdx.files.internal(MOD_ID + "/assets.txt").readString().split("\n")); // List<String> paths = List.of(Gdx.files.internal(MOD_ID + "/assets.txt").readString().split("\n"));
// for (String path : paths){ // for (String path : paths){
// if (path.contains("block_events")) { // if (path.contains("block_events")) {

View file

@ -0,0 +1,35 @@
package net.pietru.cookie_utils.mixins;
import finalforeach.cosmicreach.GameSingletons;
import finalforeach.cosmicreach.networking.netty.NettyServer;
import finalforeach.cosmicreach.world.Zone;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import java.io.IOException;
import java.util.ArrayList;
import static net.pietru.cookie_utils.utils.prop.get_server_property_array;
@Mixin(NettyServer.class)
public class NettyServerMixin {
@Inject(method = "run", at = @At("HEAD"))
private static void on_singletons_create(CallbackInfo ci){
try {
ArrayList<String> zones = get_server_property_array("zones","[]");
for (String zoneId : zones){
Zone z = GameSingletons.world.getZoneIfExists(zoneId);
if (z == null && GameSingletons.isHost) {
z = Zone.loadZone(GameSingletons.world, zoneId);
GameSingletons.world.addZone(z);
}
}
System.out.println("CookieUtils loaded additional zones...");
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}

View file

@ -1,20 +0,0 @@
package net.pietru.cookie_utils.mixins;
import finalforeach.cosmicreach.networking.server.ServerSingletons;
import net.pietru.cookie_utils.api.Region;
import net.pietru.cookie_utils.permissions.Permissions;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(ServerSingletons.class)
public class ServerSingletonsMixin {
@Inject(method = "create", at = @At("HEAD"))
private static void on_singletons_create(CallbackInfo ci){
// Permissions.reload_perm_groups();
// Permissions.reload_player_groups(true);
// Region.reload_regions();
}
}

View file

@ -12,7 +12,7 @@
"MessagePacketMixin", "MessagePacketMixin",
"MobSpawnerMixin", "MobSpawnerMixin",
"PlayerPositionMixin", "PlayerPositionMixin",
"ServerSingletonsMixin" "NettyServerMixin"
], ],
"client": [], "client": [],
"injectors": { "injectors": {