Hi,
I did update my server from Paper 1.20.4 to Paper 1.21.11. After the update my custom addon does no longer work after server startup. Only if I do a /shop reload. It implements the following logic:
public class MythicMobItemDataPart extends ItemDataPart implements Listener {
private final LocaleManager localeManager;
private final ItemExecutor itemExecutor;
public MythicMobItemDataPart(LocaleManager localeManager, ItemExecutor itemExecutor) {
this.localeManager = localeManager;
this.itemExecutor = itemExecutor;
}
@EventHandler
public void onRegister(GenesisRegisterTypesEvent event) {
this.register();
}
@Override
public ItemStack transform(ItemStack item, String usedName, String mmItemName) {
@Nullable ItemStack mmItem = itemExecutor.getItemStack(mmItemName);
if (mmItem == null) {
ClassManager.manager.getBugFinder()
.severe("Mistake in Config: '" + mmItemName + "' is not a valid '" + usedName +
"'. Please make sure the item exists.");
return item;
}
int amount = item.getAmount();
item = mmItem;
item.setAmount(amount);
return item;
}
@Override
public int getPriority() {
return PRIORITY_NORMAL;
}
@Override
public boolean removeSpaces() {
return true;
}
@Override
public String[] createNames() {
return new String[]{"mmitem"};
}
@Override
public List<String> read(ItemStack i, List<String> output) {
output.add("type:" + i.getType().name());
output.add("name:" + localeManager.toServerLocale(localeManager.queryItemStack(i)));
if (i.getItemMeta() != null && i.getItemMeta().getLore() != null) {
for (String lore : i.getItemMeta().getLore()) {
output.add("lore:" + lore);
}
}
return output;
}
@Override
public boolean isSimilar(ItemStack shopItem, ItemStack playerItem, GenesisBuy buy, Player p) {
return shopItem.getType() == playerItem.getType() &&
localeManager.toServerLocale(localeManager.queryItemStack(shopItem))
.equals(localeManager.toServerLocale(localeManager.queryItemStack(playerItem)));
}
I did implement everything as described in the BossShopPro Wiki. And the addon did work on the old version just fine. What am I missing? Why did the update broke that addon?! Yan you please help there? Thanks!
Hi,
I did update my server from Paper 1.20.4 to Paper 1.21.11. After the update my custom addon does no longer work after server startup. Only if I do a
/shop reload. It implements the following logic:I did implement everything as described in the BossShopPro Wiki. And the addon did work on the old version just fine. What am I missing? Why did the update broke that addon?! Yan you please help there? Thanks!