update world nano transreciver
All checks were successful
/ Auto-Build-App (push) Successful in 1m47s

This commit is contained in:
pietru 2024-11-09 14:13:17 +01:00
parent fd3d52e575
commit b4283faa23
4 changed files with 31 additions and 1 deletions

View file

@ -250,6 +250,7 @@ public class TextCommands {
txt="[server] Sended "+player.getAccount().getDisplayName()+" to zone "+zoneId;
Zone old = player.getZone();
zone.addPlayer(player);
player.setZone(zoneId);
player.respawn(zone);
old.removePlayer(player);
}

View file

@ -0,0 +1,26 @@
package net.pietru.cookie_utils.mixins;
import com.llamalad7.mixinextras.sugar.Local;
import finalforeach.cosmicreach.GameSingletons;
import finalforeach.cosmicreach.accounts.Account;
import finalforeach.cosmicreach.networking.NetworkIdentity;
import finalforeach.cosmicreach.networking.packets.ZonePacket;
import finalforeach.cosmicreach.networking.server.ServerSingletons;
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;
@Mixin(ServerSingletons.class)
public class ServerSingletonsMixin {
@Inject(method = "addAccount", at = @At("TAIL"))
private static void event_player_data(CallbackInfo ci, @Local NetworkIdentity id, @Local Account account){
for (Zone z : GameSingletons.world.getZones()){
if (!account.getPlayer().getZone().zoneId.equals(z.zoneId)){
id.send(new ZonePacket(z, false));
}
}
}
}

View file

@ -20,6 +20,8 @@ public class prop {
String txt = (String) get_server_property(key,defaultValue);
String replace = txt.replace("[","");
String replace1 = replace.replace("]","");
if (replace1.isEmpty())
return new ArrayList<>();
return new ArrayList<>(Arrays.asList(replace1.split(",")));
}

View file

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