mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Check if Items of campfire block entity is null (#3986)
* Check if items of campfire block entity is null * Use instanceof for Items
This commit is contained in:
parent
19914a5d7a
commit
3949fb1988
1 changed files with 6 additions and 5 deletions
|
@ -39,11 +39,12 @@ import org.geysermc.geyser.registry.type.ItemMapping;
|
||||||
public class CampfireBlockEntityTranslator extends BlockEntityTranslator {
|
public class CampfireBlockEntityTranslator extends BlockEntityTranslator {
|
||||||
@Override
|
@Override
|
||||||
public void translateTag(NbtMapBuilder builder, CompoundTag tag, int blockState) {
|
public void translateTag(NbtMapBuilder builder, CompoundTag tag, int blockState) {
|
||||||
ListTag items = tag.get("Items");
|
if (tag.get("Items") instanceof ListTag items) {
|
||||||
int i = 1;
|
int i = 1;
|
||||||
for (Tag itemTag : items.getValue()) {
|
for (Tag itemTag : items.getValue()) {
|
||||||
builder.put("Item" + i, getItem((CompoundTag) itemTag));
|
builder.put("Item" + i, getItem((CompoundTag) itemTag));
|
||||||
i++;
|
i++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue