Skip to content

Commit

Permalink
thusfar
Browse files Browse the repository at this point in the history
  • Loading branch information
bobmagicii committed Oct 22, 2024
1 parent c8439d5 commit f5a418b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/Nether/Atlantis/Struct/PrototypeIndex.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,13 @@ static public function

static public function
FetchTypeForUUID(string $UUID):
string {
?string {

$PIndex = static::GetByField('UUID', $UUID);

if(!$PIndex)
return NULL;

return $PIndex->Type;
}

Expand Down
12 changes: 11 additions & 1 deletion src/Nether/Atlantis/Tag/EntityLink.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,14 +248,24 @@ static public function
];
}


static public function
GetTypeByEntityClass(string $CName):
string {

$EntProp = NULL;

////////

foreach(static::$TypeList as $LinkType => $LinkClass) {
try { $EntProp = ($LinkClass)::EntityProperty($LinkClass); }
catch(Exception $E) { }

if($EntProp->Type === $CName)
return $LinkType;
}

throw new Exception("no type found for $CName");

return '';
}

Expand Down

0 comments on commit f5a418b

Please sign in to comment.