mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-05-22 21:15:29 +00:00
32 lines
947 B
C#
32 lines
947 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Numerics;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using OMI.Formats.GameRule;
|
|
|
|
namespace PckStudio.Core.GameRule
|
|
{
|
|
internal sealed class SpawnPositionSet : AbstractGameRule
|
|
{
|
|
internal enum SpanPositionMethod
|
|
{
|
|
OnStart,
|
|
OnRespawn
|
|
}
|
|
private SpanPositionMethod _method;
|
|
|
|
internal SpawnPositionSet(SpanPositionMethod method) => _method = method;
|
|
|
|
public void AddSpawnPosition(int x, int y, int z, int xRot, int yRot) => AddRule(new UpdatePlayer(new Vector3(x, y, z), new Vector2(xRot, yRot)));
|
|
|
|
protected override GameRuleFile.GameRule GetGameRule()
|
|
{
|
|
var gameRule = new GameRuleFile.GameRule("SpawnPositionSet");
|
|
gameRule.AddParameter(new GameRuleFile.IntParameter("method", (int)_method));
|
|
return gameRule;
|
|
}
|
|
}
|
|
}
|