update world nano transreciver
All checks were successful
/ Auto-Build-App (push) Successful in 1m47s
All checks were successful
/ Auto-Build-App (push) Successful in 1m47s
This commit is contained in:
parent
fd3d52e575
commit
b4283faa23
4 changed files with 31 additions and 1 deletions
|
@ -250,6 +250,7 @@ public class TextCommands {
|
||||||
txt="[server] Sended "+player.getAccount().getDisplayName()+" to zone "+zoneId;
|
txt="[server] Sended "+player.getAccount().getDisplayName()+" to zone "+zoneId;
|
||||||
Zone old = player.getZone();
|
Zone old = player.getZone();
|
||||||
zone.addPlayer(player);
|
zone.addPlayer(player);
|
||||||
|
player.setZone(zoneId);
|
||||||
player.respawn(zone);
|
player.respawn(zone);
|
||||||
old.removePlayer(player);
|
old.removePlayer(player);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -20,6 +20,8 @@ public class prop {
|
||||||
String txt = (String) get_server_property(key,defaultValue);
|
String txt = (String) get_server_property(key,defaultValue);
|
||||||
String replace = txt.replace("[","");
|
String replace = txt.replace("[","");
|
||||||
String replace1 = replace.replace("]","");
|
String replace1 = replace.replace("]","");
|
||||||
|
if (replace1.isEmpty())
|
||||||
|
return new ArrayList<>();
|
||||||
return new ArrayList<>(Arrays.asList(replace1.split(",")));
|
return new ArrayList<>(Arrays.asList(replace1.split(",")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,8 @@
|
||||||
"MessagePacketMixin",
|
"MessagePacketMixin",
|
||||||
"MobSpawnerMixin",
|
"MobSpawnerMixin",
|
||||||
"PlayerPositionMixin",
|
"PlayerPositionMixin",
|
||||||
"NettyServerMixin"
|
"NettyServerMixin",
|
||||||
|
"ServerSingletonsMixin"
|
||||||
],
|
],
|
||||||
"client": [],
|
"client": [],
|
||||||
"injectors": {
|
"injectors": {
|
||||||
|
|
Loading…
Reference in a new issue