generated from AriasCreations/vsmodtemplate
Optimize by using the existing helper functions
This commit is contained in:
parent
6598eb44da
commit
3712399a03
2 changed files with 10 additions and 14 deletions
|
@ -49,13 +49,9 @@ public class RTPFactory
|
|||
/// <returns>A safe position if able to be found</returns>
|
||||
public static PlayerPosition GetSafePosition(RTPData data, RTPPosition position)
|
||||
{
|
||||
PlayerPosition PPos = PlayerPosition.from(data.player.Entity);
|
||||
BlockPos check = new(
|
||||
x: position.x,
|
||||
y: 1,
|
||||
z: position.z,
|
||||
dim: position.dimension
|
||||
);
|
||||
PlayerPosition PPos = data.LastPosition.GetPlayerPosition();
|
||||
BlockPos check = data.LastPosition.GetBlockPos();
|
||||
check.Y = 1;
|
||||
|
||||
int height = ServerUtilities.API.World.BlockAccessor.GetTerrainMapheightAt(check);
|
||||
|
||||
|
@ -110,12 +106,12 @@ public class RTPFactory
|
|||
chunk.dim = position.dimension;
|
||||
chunk.rtp = rtp;
|
||||
|
||||
// Load the chunk
|
||||
worldManager.LoadChunkColumnForDimension(chunk.ChunkX, chunk.ChunkZ, chunk.dim);
|
||||
|
||||
// Log the request
|
||||
ChunkChecks.Add(chunk);
|
||||
|
||||
// Load the chunk
|
||||
worldManager.LoadChunkColumnPriority(chunk.ChunkX, chunk.ChunkZ);
|
||||
|
||||
if (rtp.NumTriesRemaining <= 0)
|
||||
{
|
||||
// Send failure message to the player
|
||||
|
@ -214,7 +210,7 @@ public class RTPPosition
|
|||
this.dimension = dim;
|
||||
}
|
||||
|
||||
PlayerPosition GetPlayerPosition()
|
||||
public PlayerPosition GetPlayerPosition()
|
||||
{
|
||||
return new PlayerPosition
|
||||
{
|
||||
|
@ -225,7 +221,7 @@ public class RTPPosition
|
|||
};
|
||||
}
|
||||
|
||||
BlockPos GetBlockPos()
|
||||
public BlockPos GetBlockPos()
|
||||
{
|
||||
return new BlockPos(new Vec3i(x, y, z), dimension);
|
||||
}
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
"modid": "ariasserverutils",
|
||||
"name": "Aria's Server Utilities",
|
||||
"authors": ["zontreck"],
|
||||
"description": "A collection of server utilities\n\nBuild Date: 03-10-2025 @ 10:36 AM MST",
|
||||
"version": "1.0.6-dev.13",
|
||||
"description": "A collection of server utilities\n\nBuild Date: 03-10-2025 @ 10:54 AM MST",
|
||||
"version": "1.0.6-dev.14",
|
||||
"dependencies": {
|
||||
"game": ""
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue