Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-10-05 01:11:08 +02:00
Check if Items of campfire block entity is null (#3986)
* Check if items of campfire block entity is null * Use instanceof for Items
Dieser Commit ist enthalten in:
Ursprung
19914a5d7a
Commit
3949fb1988
@ -39,13 +39,14 @@ import org.geysermc.geyser.registry.type.ItemMapping;
|
||||
public class CampfireBlockEntityTranslator extends BlockEntityTranslator {
|
||||
@Override
|
||||
public void translateTag(NbtMapBuilder builder, CompoundTag tag, int blockState) {
|
||||
ListTag items = tag.get("Items");
|
||||
if (tag.get("Items") instanceof ListTag items) {
|
||||
int i = 1;
|
||||
for (Tag itemTag : items.getValue()) {
|
||||
builder.put("Item" + i, getItem((CompoundTag) itemTag));
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected NbtMap getItem(CompoundTag tag) {
|
||||
// TODO: Version independent mappings
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren