Skip to content

Commit c4ee655

Browse files
committed
PMMP removed hasTag
1 parent 6822616 commit c4ee655

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/xenialdan/libstructure/format/MCStructure.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ private function parseBlockLayers(?CompoundTag $paletteCompound, ?ListTag $block
199199
}
200200
}
201201
//nbt
202-
if ($blockPositionData->hasTag((string)$offset)) {
202+
if ($blockPositionData->getTag((string)$offset) !== null) {
203203
/** @var CompoundTag<CompoundTag> $tag1 */
204204
$tag1 = $blockPositionData->getCompoundTag((string)$offset);
205205
$blockEntities[World::blockHash($x, $y, $z)] = $tag1->getCompoundTag(self::TAG_PALETTE_BLOCK_ENTITY_DATA);
@@ -248,10 +248,10 @@ public function translateBlockEntity(Position $position, Vector3 $origin): ?Tile
248248
foreach ($inventoryTag as $itemNBT) {
249249
$itemNBT->setString("id", $itemNBT->getString("Name", "minecraft:air"));
250250
$itemNBT->removeTag("Name");
251-
if ($itemNBT->hasTag("tag", CompoundTag::class)) {
251+
if ($itemNBT->getTag("tag", CompoundTag::class) !== null) {
252252
/** @var CompoundTag $tag */
253253
$tag = $itemNBT->getTag("tag", CompoundTag::class);
254-
if ($tag->hasTag("Damage")) $tag->removeTag("Damage");
254+
if ($tag->getTag("Damage") !== null) $tag->removeTag("Damage");
255255
}
256256
}
257257
}

src/xenialdan/libstructure/format/NBTStructure.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,15 +104,15 @@ private function paletteToBlocks(ListTag $paletteList): array
104104
$properties = $blockCompound->getCompoundTag('Properties');
105105
if ($properties instanceof CompoundTag)
106106
//Java/legacy hack
107-
/*if($properties->hasTag('dataID')){
107+
/*if($properties->getTag('dataID') !== null){
108108
$legacyDataId = $properties->getInt('dataID');
109109
//Block::getStateFromLegacyData
110110
} else{
111-
if($properties->hasTag('half')){
111+
if($properties->getTag('half') !== null){
112112
$legacyHalf = $properties->getString('half');
113113
//LegacyStructureTemplate::_mapToProperty(&v99, v19, v65);
114114
}
115-
if($properties->hasTag('waterlogged')){
115+
if($properties->getTag('waterlogged') !== null){
116116
$legacyWaterlogged = $properties->getString('waterlogged');
117117
//LegacyStructureTemplate::_mapPropertyToExtraBlock(&v97, v20);
118118
}

virion.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: libstructure
2-
version: 0.1.3
2+
version: 0.1.4
33
antigen: xenialdan\libstructure
44
api: [4.0.0]
55
php: [ 7.3, 8.0 ]

0 commit comments

Comments
 (0)