mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-06-23 18:25:32 +00:00
Add AbstractGameRule.cs & derived classes
This commit is contained in:
26
PckStudio.Core/GameRule/WorldPosition.cs
Normal file
26
PckStudio.Core/GameRule/WorldPosition.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
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 WorldPosition(int x, int y, int z) : AbstractGameRule
|
||||
{
|
||||
private Vector3 _pos = new Vector3(x, y, z);
|
||||
|
||||
protected override GameRuleFile.GameRule GetGameRule()
|
||||
{
|
||||
var gameRule = new GameRuleFile.GameRule("WorldPosition");
|
||||
gameRule.AddParameters(
|
||||
new GameRuleFile.IntParameter("x", (int)_pos.X),
|
||||
new GameRuleFile.IntParameter("y", (int)_pos.Y),
|
||||
new GameRuleFile.IntParameter("z", (int)_pos.Z)
|
||||
);
|
||||
return gameRule;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user