[1.19.2] Remove 'final' access modifier at PNCUpgrade::getItem
gisellevonbingen opened this issue ยท 0 comments
Describe the feature
Remove 'final' access modifier at PNCUpgrade::getItem.
Else add guide to add custom PNGUpgrade from addon mods.
Reasons why it should be considered
I'm developing mod have integration with PNC.
I would add own pneumatic armor's upgrade.
I should create own DeferredRegister to register new upgrades.
Upgrade item be register automatically like 'mymod:pneumatic_UPGRADE_NAME
_upgrade' .
public static final MyDeferredRegister UPGRADES = new MyDeferredRegister(MODID);
public static final MyRegistryObject<AddonPNCUpgrade, UpgradeItem> SPACE_BREATHING = UPGRADES.register("space_breathing", MyItems::getItemProperties);
public static final MyRegistryObject<AddonPNCUpgrade, UpgradeItem> SPACE_FIRE_PROOF = UPGRADES.register("space_fire_proof", MyItems::getItemProperties);
public static final MyRegistryObject<AddonPNCUpgrade, UpgradeItem> VENUS_ACID_PROOF = UPGRADES.register("venus_acid_proof", MyItems::getItemProperties);
AddonPNCUpgrade.java
public class AddonPNCUpgrade extends PNCUpgrade
{
public AddonPNCUpgrade()
{
super();
}
public AddonPNCUpgrade(int maxTier, String... depModIds)
{
super(maxTier, depModIds);
}
}
In Charging Station, this upgrade's name show as 'Air'
Because item name limited to have spectific rule in getItemRegistryName.
So it return air.
But getItem is final method.
I can't override it and return my added upgrade item.
So for addon mod, I think to need remove 'final' access modifier at 'PNCUpgrade::getItem()'.
Additional details
In 1.18.2, can instead via override 'PNCUpgrade::getItemRegistryName' method.