use of hellfirepvp.astralsorcery.common.base.patreon.types.TypeHelmetRender in project AstralSorcery by HellFirePvP.
the class ProviderHelmetRender method buildEffect.
@Override
public TypeHelmetRender buildEffect(UUID playerUUID, List<String> effectParameters) throws Exception {
UUID effectUniqueId = UUID.fromString(effectParameters.get(0));
if (effectParameters.get(1).equals("astralsorcery:blockaltar;3")) {
effectParameters.set(1, "astralsorcery:altar_radiance");
}
String[] itemInfo = effectParameters.get(1).split(";");
Item item = ForgeRegistries.ITEMS.getValue(new ResourceLocation(itemInfo[0]));
if (item == null || item == Items.AIR) {
throw new IllegalArgumentException("Unknown item: " + itemInfo[0]);
}
ItemStack stack = new ItemStack(item);
if (itemInfo.length > 1) {
int data = Integer.parseInt(itemInfo[1]);
stack.setDamage(data);
}
FlareColor flColor = effectParameters.size() > 2 ? FlareColor.valueOf(effectParameters.get(2)) : null;
return new TypeHelmetRender(effectUniqueId, flColor, playerUUID, stack);
}
Aggregations