update for 0.4.5, add npc update per tick
All checks were successful
/ Auto-Build-App (push) Successful in 1m48s
All checks were successful
/ Auto-Build-App (push) Successful in 1m48s
This commit is contained in:
parent
cad703778d
commit
c1ab21d21e
3 changed files with 12 additions and 5 deletions
|
@ -10,9 +10,9 @@ id=cookie_utils
|
|||
|
||||
# Dependency Versions
|
||||
cosmic_reach_rev=alpha
|
||||
cosmic_reach_version=0.4.4
|
||||
cosmic_reach_version=0.4.6
|
||||
# If unspecified, will use the version above
|
||||
cosmic_reach_server_version=0.4.4
|
||||
cosmic_reach_server_version=0.4.6
|
||||
cosmic_quilt_version=2.3.1
|
||||
#2.2.0
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ package net.pietru.cookie_utils;
|
|||
import finalforeach.cosmicreach.util.FloatConsumer;
|
||||
import net.pietru.cookie_utils.api.Area;
|
||||
import net.pietru.cookie_utils.api.Region;
|
||||
import net.pietru.cookie_utils.npcs.NpcDef;
|
||||
import net.pietru.cookie_utils.scripting.ExecutionContext;
|
||||
import net.pietru.cookie_utils.scripting.ScriptsDB;
|
||||
|
||||
|
@ -27,5 +28,9 @@ public class CookieUtilsLogicRunner implements FloatConsumer {
|
|||
ScriptsDB.run_script(area.scriptFile,"on_area_update", context);
|
||||
}
|
||||
}
|
||||
|
||||
for (NpcDef def : NpcDef.registered_npc_list){
|
||||
def.send_update();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -86,10 +86,12 @@ public class NpcDef {
|
|||
packet.viewDirOff.set(e.viewPositionOffset);
|
||||
packet.zoneId = player.zoneId;
|
||||
packet.playerFlags = 0;
|
||||
addFlag(packet, PlayerPositionPacket.PLAYER_FLAG_SNEAKING, e.isSneaking());
|
||||
addFlag(packet, PlayerPositionPacket.PLAYER_FLAG_SPRINTING, player.isSprinting);
|
||||
addFlag(packet,PlayerPositionPacket.PLAYER_FLAG_SNEAKING, e.isSneaking());
|
||||
addFlag(packet,PlayerPositionPacket.PLAYER_FLAG_SPRINTING, player.isSprinting);
|
||||
addFlag(packet,PlayerPositionPacket.PLAYER_FLAG_PRONE, player.isProne);
|
||||
addFlag(packet,PlayerPositionPacket.PLAYER_FLAG_ON_GROUND, e.isOnGround);
|
||||
|
||||
ServerSingletons.SERVER.broadcastToAll(packet);
|
||||
ServerSingletons.SERVER.broadcast(this.zone,packet);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue