#Initializing Legacy Material Support issue

1 messages · Page 1 of 1 (latest)

crude ember
#

Im running my server on 1.17.1 spigot and the api-version in the plugin.yml is 1.17. I tried to make a menu plugin. It works but I get " Initializing Legacy Material Support. Unless you have legacy plugins and/or data this is a bug!" in the console. It also causes lag. Please help

dull grotto
#

Send your plugin.yml

#

?paste

#

oh guess that doesn't work in threads

crude ember
#

name: MyFirstPlugin
version: '${project.version}'
main: me.ihsan.myfirstplugin.MyFirstPlugin
api-version: 1.17
authors: [ ihsan ]
description: My first plugin
commands:
die:
description: Simple way to attempt suicide.
usage: /<command>
aliases:
- suicide
- killme
about:
description: About the server.
usage: /<command>
aliases:
- info
- server
tpa:
description: Send a teleport request to a player.
usage: /<command> <player>
fly:
description: Get ability to fly. Only for operators.
usage: /<command>
tpaccept:
description: Accept teleport request.
tpdeny:
description: Deny teleport request.
menu:
description: Opens menu.
usage: /<command>

dull grotto
#

Does it do it if you change your version to something like 1.0.0 instead of '{$project.version}'

crude ember
#

what should i actually put there

#

i didn't know what to change it to

dull grotto
#

1.0.0

crude ember
#

ok ill check

#

btw can you check if tehre is any problem in the class where i make the gui

#

package me.ihsan.myfirstplugin.commands;

import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;

public class VaultCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if(sender instanceof Player player) {
Inventory menu = Bukkit.createInventory(null, 27, "Menu");

        ItemStack survival = new ItemStack(Material.IRON_SWORD);
        ItemMeta survivalMeta = survival.getItemMeta();
        survivalMeta.setDisplayName(ChatColor.BLUE + "Game Mode");
        survival.setItemMeta(survivalMeta);
        menu.setItem(11, survival);


        player.openInventory(menu);
        return true;


    }
    return false;
}

}

dull grotto
#

Looks fine

crude ember
#

i change the version and it still does that

#

😦

dull grotto
#

Send plugin.yml again

crude ember
#

name: MyFirstPlugin
version: 1.0.0
main: me.ihsan.myfirstplugin.MyFirstPlugin
api-version: 1.17
authors: [ ihsan ]
description: My first plugin
commands:
die:
description: Simple way to attempt suicide.
usage: /<command>
aliases:
- suicide
- killme
about:
description: About the server.
usage: /<command>
aliases:
- info
- server
tpa:
description: Send a teleport request to a player.
usage: /<command> <player>
fly:
description: Get ability to fly. Only for operators.
usage: /<command>
tpaccept:
description: Accept teleport request.
tpdeny:
description: Deny teleport request.
menu:
description: Opens menu.
usage: /<command>

#

also I found something in the forum

#

here the dude says he got the error when Inventory::adItem command

#

is it related or something?

#

I used Inventory.setitem ithink

dull grotto
#

It shouldn't, I wouldn't think

crude ember
#

but then how!?

dull grotto
#

If you comment it out does it still do it?

crude ember
#

ok let me see

#

omg I think i finally fixed it

#

The error was not the setitem

#

it was the system.out.printline

#

I used itemstack.getdata.getitemtype instead of itemstack.gettype()

dull grotto
#

Ah

crude ember
#

i got scammed a lot of hours

#

minecraft development plugin for intellij didnt warn me that the function i use was deprecated

#

8 hours

#

@dull grotto should i close this thread

#

oh nvm i cant

dull grotto
#

If you solved your problem sure

#

Yeah I didn't think you could

#

Just leave it to archive