use of org.spongepowered.common.data.type.SpongeGuiId in project SpongeCommon by SpongePowered.
the class CustomInventory method getGuiID.
@Override
public String getGuiID() {
String key = AbstractInventoryProperty.getDefaultKey(GuiIdProperty.class).toString();
InventoryProperty<?, ?> property = this.properties.get(key);
if (property instanceof GuiIdProperty) {
if (property.getValue() instanceof SpongeGuiId) {
// Handle Vanilla EntityHorse GuiId
return ((SpongeGuiId) property.getValue()).getInternalId();
}
return ((GuiIdProperty) property).getValue().getId();
}
GuiId guiId = this.archetype.getProperty(GuiIdProperty.class, key).map(GuiIdProperty::getValue).orElse(GuiIds.CHEST);
if (guiId instanceof SpongeGuiId) {
// Handle Vanilla EntityHorse GuiId
return ((SpongeGuiId) guiId).getInternalId();
}
return guiId.getId();
}
Aggregations