use of com.cjm721.overloaded.storage.GenericDataStorage in project Overloaded by CJ-MC-Mods.
the class ArmorEventHandler method getHelmetDataStorage.
@Nonnull
private static IGenericDataStorage getHelmetDataStorage(PlayerEntity player) {
for (ItemStack stack : player.inventory.armor) {
if (stack.getItem() instanceof ItemMultiHelmet) {
IGenericDataStorage cap = stack.getCapability(GENERIC_DATA_STORAGE).orElse(new GenericDataStorage());
cap.suggestUpdate();
return cap;
}
}
return new GenericDataStorage();
}
Aggregations