#help-development

1 messages · Page 69 of 1

chrome beacon
#

It should be that

keen obsidian
#

Yes, but why isn't it hitting anything? To my knowledge it should be

rare flicker
#

how can i get a list of every world? Bukkit.getWorlds only returns the overworld

eternal oxide
#

Bukkit only knows about loaded worlds

rare flicker
#

i would still expect it to return the end and nether

agile anvil
eternal oxide
rare flicker
#

o h

rare flicker
eternal oxide
#

Bukkit.getWorlds() returns all three on a standard server

ashen quest
#

How do i get the Block's ItemStack from BlockPlaceEvent

rare flicker
#

to get the server folder do i just parent up from the plugins folder or is there a better way?

ashen quest
crude charm
#

You can see the code, I save the config

#

And the changes show up in the config but it just can’t read them for some reason

marble copper
#

How to do playerclickevent

young knoll
#

Inventory or in world?

marble copper
#

Inventory

young knoll
#

InventoryClickEvent

eternal oxide
#

You are having this issue because you are saving a copy of the config private final FileConfiguration config = Survival.getInstance().getConfig(); You read from a different instance

marble copper
#

The what

#

Then

young knoll
#

Then do whatever you need with the event?

rare flicker
#

neat

young knoll
#

Well it gives you the world container

#

Which can be changed

tender shard
#

where can that be changed?

young knoll
#

Bukkit.yml

tender shard
#

oh k

#

what do you need the server folder for anyway, though?

rare flicker
#

cycle through every world

tender shard
#

because then the only proper way is to get the path from the classloader sources root

tender shard
rare flicker
#

it only gives me the overworld for some reason

tender shard
#

then the other worlds arent loaded

rare flicker
#

yeah that's why i'm using folders instead

tender shard
#

Bukkit.getWorlds() always returns all currently loaded worlds

rare flicker
#

essentially i want to store wold specific configs directly in the world directory

#

that way if the world gets transfered its already configured

tender shard
#

well then the world container is exactly what you're looking for anyway

rare flicker
#

and if it gets deleted its no longer in the config cluttering a single big file

#

yup

eternal oxide
#

What data are you storing with the world? Each world has a PDC if you are able to read teh data after the world loads

young knoll
#

PDC probably isn’t good for config stuff

rare flicker
#

pdc?

young knoll
#

?pdc

rare flicker
#

persistent data container?

eternal oxide
#

Depends what he is storing

rare flicker
#

worlds for a bedwars

eternal oxide
#

what data

rare flicker
#

i have a source world and world i copy from the source

#

and i want to know if the world is a copy or the original

#

BUT

#

i want it to be crash/restart proof

#

so delete all copies when the server starts if it finds some from a previous crash for eg

#

as for the originals, all the data telling where each base's bed is, the spawners, the rates etc

#

not sur i want to use pdc for configs

#

i could for the copies though

random helm
#

Does anyone know how to register a multiverse event with the Multiverse Core Api?

ashen quest
#

If I use PlayerDeathEvent on a Hardcore world.

Is there a way to not ban the player? I want to respawn em

rare flicker
#

hardcore servers dont ban

eternal oxide
rare flicker
#

simply set their gamemode back on the respawn event

ashen quest
rare flicker
eternal oxide
#

so its not hardcore. just use normal mode and set to teh correct mode on death

ashen quest
eternal oxide
#

why? the point of hardcore is its one life

random helm
young knoll
#

Some hardcore servers have more than one life

#

Which you may argue is no longer hardcore but meh

#

Keep in mind if you run it in normal mode you won’t have the hardcore heart texture

eternal oxide
#

ah right

young knoll
#

You could probably spoof it with packets

ashen quest
#

i m bored af so i m makin random plugin requests from people

#

u can send some if u want

eternal oxide
#

texture is enough of a reason. I just couldn;t see the point in using hardcore if it wasn't

young knoll
#

Yeah uhh remake wynncraft for me

#

:p

eternal oxide
#

I'll take a copy of Hypixel please

ashen quest
#

ayo

ashen quest
#

this is what they wanted, this gives you an item which does nto let u die

but its stupid knowing totems do the same

young knoll
#

Lol

#

Thinking quickly Dave crafted an immortality item using nothing but an old CD, an apple, and an immortality item

tender shard
#

yeah lol

#

genius

shadow zinc
#

Is this fine?

shadow zinc
#
public abstract class Command extends SubCommand {
    public abstract List<SubCommand> getSubCommands();

    public Command addSubCommand(SubCommand subCommand) {
        getSubCommands().add(subCommand);
        return this;
    }
}
#

having a non abstract class in an abstract class

#

all good?

tardy delta
#

What does subcommand define as methods?

shadow zinc
#

name, description, syntax, usage, etc

tardy delta
#

I would just have a command class with all that stuff and a list of commands which are the subcommands

shadow zinc
#

Thats another way of doing it

errant narwhal
#

is there have event to checkitemstack move to another the inventory like from playerinventory to chest inventory?

young knoll
#

InventoryClickEvent

errant narwhal
shadow zinc
#

Is it a good idea making my command manager a singleton?

#
public class CommandManager {
    private final Map<String, Command> stringCommandBuilderMap = new HashMap<>();
    public Command getCommandBuilder(String command) {
        return stringCommandBuilderMap.get(command);
    }
    public void addCommandBuilder(Command command) {
        stringCommandBuilderMap.put(command.getName(), command);
    }
}
#

Might be a bit neater than putting it in the main class

#

unless there is another way

#

nevermind I will just make the methods static

visual tide
#

?di

undone axleBOT
shadow zinc
#

ffs thats annoying

visual tide
#

its good style

shadow zinc
#

yeah but so many steps

visual tide
#

its not a lot of steps

shadow zinc
#

more than 1

visual tide
#

just pass the instance via contructors

errant narwhal
visual tide
#

?jd-s

undone axleBOT
visual tide
shadow zinc
young knoll
#

?jd-bcc

shadow zinc
#

lol

sly surge
#

Is there a way to check if a player can interact with the chat (hover event...)? If they have disabled it in their settings or if they are Bedrock with GeyserMC

eternal night
#

no, those are completely client side

#

a click event is too, unless it runs a command obviously

sly surge
#

I know how to detect that the player has disabled his chat so I thought it might be similar

eternal night
#

The player syncs that to the server so you can fetch that information iirc

#

but yea, styling and events of chat are all client side

sly surge
#

👍 thanks

supple elk
#

This is the tick method for a boat, client side 1.18.2. This suggests that boat movement is handled server side right?

visual tide
#

boats are weird

agile anvil
#

Minecraft is weird

supple elk
chrome beacon
#

Boat movement is only server side if there aren't any passengers

#

(players)

supple elk
#

But it only calls controlBoat() if it's client side

chrome beacon
#

Yeah

#

If no passengers it just slows down and stops

#

That is handled server side

#

If a player is controlling it that controlBoat method will be fired on the client

#

and then sends movement to server

supple elk
echo basalt
#

I always wondered what Level#isClientSide was

supple elk
#

unless I am misunderstanding what level.isClientSide() means

chrome beacon
#

level can be the client level

#

instead of ServerLevel

supple elk
#

wdym?

echo basalt
#

flag is always false on a paper server

#

so it might be the internal server for singleplayer worlds

supple elk
#

That's what I was thinking

#

in which case it wouldn't be fired when on a server

chrome beacon
#

Yeah that code is on the client

#

Not the server

supple elk
#

but it checks if the world is being ran on a server or local right?

#

And only fired controlBoat() if it's local

#

so when connected to a server, the client would not be handling the boat movement

chrome beacon
#

It checks if the world is the client world

#

basically if it's running on the client

supple elk
#

Are you saying that there is a 'client world' and 'server world' when the client is connected to a server?

chrome beacon
#

I believe so

#

The server world is on the server

#

and the client world on the client

supple elk
#

Why would you even need such a check though? When would the client ever have the server world

chrome beacon
#

Singleplayer I guess

supple elk
#

Right

crude charm
supple elk
#

Ok thanks for the help

crude charm
#

huh? where?

#

oh wait

#

im stupid

eternal oxide
#

The simple fix is to stop using fields to store yoru config. the lazy way is to call Plugin#reloadConfig() after saving

crude charm
#
    public void restoreInventory(Player p) throws IOException {
        Configuration config= Survival.getInstance().getConfig();

        ItemStack[] armour = config.getList(p.getName() + ".inventory.armor").toArray(new ItemStack[0]);
        ItemStack[] content = config.getList(p.getName() + ".inventory.content").toArray(new ItemStack[0]);


        p.getInventory().setArmorContents(armour);
        p.getInventory().setContents(content);

    }

The issue occurs when restoring

supple elk
crude charm
#

Reload config?

#

Reloading config after saving worked

#

tysm

#

The only reason im using a config to store inventory data is because I know im only using this on a small scale

agile anvil
crude charm
#

If I'm storing max 5 players at a time then there can't be an issue clueless

agile anvil
#

Minecraft protocol isn't friend with sever-side movements control...

tardy delta
#

stackoverflow sucks lol, just wondering how to save an uuid in sqlite

slender widget
#

So I want to make a command that resets the world.
Currently it resets the region files from a backup, but after a restart, the changes have not been applied. How do I make it so that my changes take effect?

tardy delta
#

wondering how to implement that

drowsy helm
tardy delta
drowsy helm
#

like this

marble copper
drowsy helm
#
public abstract class VariableSerializer<T> {
    public abstract byte[] serialize(T obj);

    public abstract T deserialize(byte[] str);
}```
#

like this

tardy delta
#

hmm

marble copper
drowsy helm
#

dont advertise your question we know it's there

marble copper
#

but can u help?

drowsy helm
#

no i have no idea about the plugin

#

if you're really that desperate go ask the plugin dev's discord

tardy delta
#

would PreparedStatement::getBytes work on a column which i declared as BLOB?

drowsy helm
#

uuuh i think so

#

idk ahvent used sql in a while

#

worth a try

tardy delta
#

ill try

cobalt thorn
#
            @Override
            public void onPacketSending(PacketEvent event) {
                PacketContainer packet = event.getPacket();

                List<WrappedChatComponent> components = packet.getChatComponents().getValues();

                for (WrappedChatComponent component : components) {
                    //component.setJson(component.getJson().replace("Swear", "*****"));
                    packet.getChatComponents().write(components.indexOf(component), component);
                }
            }

Hi i made this code with protocollib one thing how i can get the message sent by the server?

tardy delta
#

but got an issue where sqlite couldnt find my record when the pk matched :/

echo basalt
#

sqlite is pain

tardy delta
#

so i hope using uuid in that format will work

echo basalt
#

getObject doesn't work with sqlite

drowsy helm
#

let me check

fiery prairie
echo basalt
#

lmfao ok wtf

drowsy helm
#

what is wait()?

echo basalt
#

wait(15000) just locks your server's thread

#

for 15 seconds

#

effectively crashing your server

drowsy helm
#

yeah dont pause your main thread

#

use a runnable

fiery prairie
#

okay, how do runnables work?

visual tide
#

?scheduling

undone axleBOT
cobalt thorn
fiery prairie
#

okay, thanks

drowsy helm
#

            @Override
            public void onPacketSending(PacketEvent event) {
                PacketContainer packet = event.getPacket();
                String message = packet.getStrings().read(0);
}```
cobalt thorn
drowsy helm
#

declare it, yeah

cobalt thorn
#

Thanks

quasi flint
drowsy helm
#

protocol lib requires packet type when declaring a packet listener

quasi flint
#

ok i was just wondering

#

ahi see

tardy delta
#

smh select query doesnt want to match

#

i'm clearly in the database but it doesnt want to match

drowsy helm
#

im battling in my mind whether i want to split my massivep lugin into separate mini plugins

marble copper
#

What is an api guys

golden turret
#

API

#

AP
PI
I

tardy delta
#

"SELECT * FROM players WHERE uuid=?" doesnt want to match any record

eternal night
#

application programming interface

golden turret
#

also

#

there is a |0

marble copper
#

How to change api of plugin

eternal night
#

maybe das the table index 🤔

tardy delta
#

stored level

eternal night
tardy delta
#

lol

drowsy helm
eternal night
#

the plugin has to change its API

golden turret
eternal night
#

so I guess contribute

drowsy helm
#

an api is basically how plugins talk to other plugins

marble copper
#

What

golden turret
tardy delta
#

yes

eternal night
#

xD

tardy delta
#

still needs to be extended

golden turret
marble copper
#

Can someone change api or my plugin

tardy delta
#

?

golden turret
#

create 2 colmuns

#

pls

eternal night
#

that is a collum right ?

tardy delta
#

those are 2 column

eternal night
#

li

#

yea

tardy delta
#

dunno what ur saying

eternal night
#

phew

golden turret
#

bruh

#

run it on a better cli pls

tardy delta
#

no

eternal night
#

why does it not even show the table collum names

#

that is actually trash

#

lol

golden turret
#

yes

#

very trash

#

not even wlib cli is like that

glossy venture
#

🥶

#

wrong channel

golden turret
#

bruh

tardy delta
#

sqlite cli lol

golden turret
#

use

#

db browser for sqlite

#

i think thats the name

#

it is a desktop app btw

tardy delta
#

dont have a graphical interface lol

#

its running on my server

golden turret
#

a

#

then

#

download the database file

#

and open it on your pc

tardy delta
#

bruh i dont care i just want to see whats there

river oracle
#

Mongo Compass oh wait you use midql

tardy delta
#

yes

boreal sparrow
#

Hey, I'm getting this error when I call this method:

[14:33:27 ERROR]: Could not pass event PlayerChangedWorldEvent to RunnerVSHunter v1.0
java.lang.NullPointerException: Cannot invoke "org.bukkit.World.getName()" because "map.world" is null
at com.sinden.runnervshunter.manager.GameManager.setGameState(GameManager.java:35)

METHOD + CLASS:
https://pastebin.com/5XVWRRR5

CreateMap constructor:
https://pastebin.com/izMN3uds

tardy delta
#

world null lol

river oracle
tardy delta
#

dunno you would even call your class CreateMap

boreal sparrow
#

._.

visual tide
#

MapFactory

marble copper
#

Hi can someone add stocks to supermobcoins plugin for me using their mobcoinshopevent api

golden turret
#

in the constructor

cobalt thorn
#

Hi im having an issues im using the packet serverbound chat message for translate other plugin message but this doesn't work how i can do that? (with protocollib or other method)

near night
#

No suitable driver found for jdbc:mysql://############/###########?useSSL=false pls help im on 1.19.2

boreal sparrow
tardy delta
#

/* lol

#

fuck discord formatting

near night
#

i tagged it so i no get hacked lol

tardy delta
#

ah yes

near night
#

any idea why no working?

golden turret
#

btw

#

is your ip

golden turret
#

127.0.0.1?

chrome beacon
undone axleBOT
near night
#

but im using a extranel host

golden turret
#

so the ip is

near night
#

so anyone can connect

golden turret
#

0.0.0.0

#

?

near night
#

no

#

its from my server panel

marble copper
#

Can someone here do it?

tardy delta
#

whats the point of using an externally hosted mysql server?

marble copper
#

The plugin admin said it's easy but idk how

near night
chrome beacon
near night
crude charm
marble copper
#

This help development channel?

chrome beacon
#

Yeah it's for help development

#

Not requests

marble copper
#

And api thing also for devs

#

Yea I need help adding the api

chrome beacon
#

So you're making an addon/plugin yourself

crude charm
marble copper
chrome beacon
# crude charm ?

That constructor doesn't exist use;
/**
* Creates event with an action and a list of contents.
*
* @param action action of this event
* @param contents array of contents, provide at least one
*/
public HoverEvent(Action action, Content... contents)

Content being Text

chrome beacon
marble copper
#

What

river oracle
tardy delta
#

none ig

river oracle
#

?services

undone axleBOT
river oracle
#

Hire a dev

marble copper
#

I can't post there

river oracle
#

Don't need a post to contact a dev offering

marble copper
#

Ok

chrome beacon
#

Content being Text

marble copper
#

Which one do I choose

chrome beacon
#

new Text("Hello World!");

crude charm
#

Ok

#

Why not just take a string and spigot should convert it to json

river oracle
crude charm
#

lmfao

marble copper
#

There's no api developer

#

Any api developer here want to add api to my plugin

young knoll
#

Because it can be more than just a string

#

You can also have items in hover components

crude charm
#

items?

young knoll
#

Mhm

crude charm
#

How does that look?

river oracle
young knoll
#

You see the tooltip

echo basalt
young knoll
#

As if it was in an inventory

crude charm
#

Ah I see

river oracle
near night
young knoll
#

Mhm

marble copper
#

If u don't want to help me don't reply

crude charm
echo basalt
#

man probably paid for "his" plugin

marble copper
#

Super mob coins plugin

crude charm
#

From spigot mc

echo basalt
#

stored in the block chain

crude charm
#

In btc

river oracle
#

Ahaha

marble copper
#

I bought from mc market it's not in spigot

rapid aspen
#
public class onPlayerDeath implements Listener {

    Main plugin;

    public onPlayerDeath(Main plugin) {
        this.plugin = plugin;
    }

    @EventHandler
    public void onPlayerKilled(PlayerDeathEvent event) {

        Player victim = event.getEntity();

        if (victim.getKiller() instanceof Player) {

            Player killer = victim.getKiller();
            if(killer != victim) {

                double vHealth = victim.getAttribute(Attribute.GENERIC_MAX_HEALTH).getBaseValue();
                double kHealth = killer.getAttribute(Attribute.GENERIC_MAX_HEALTH).getBaseValue();

                victim.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(vHealth - 2);
                killer.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(kHealth + 2);

                if(victim.getAttribute(Attribute.GENERIC_MAX_HEALTH).getBaseValue() <= 0.0) {
                    victim.kickPlayer("Tu foste banido do servidor por teres 0 corações!");
                }
            }
            event.setDeathMessage(ChatColor.YELLOW + victim.getName() + ChatColor.RED + "(" + victim.getAttribute(Attribute.GENERIC_MAX_HEALTH).getBaseValue() + " Corações) " + ChatColor.WHITE + "foi morto por " + ChatColor.YELLOW + killer.getName() + ChatColor.RED + "(" + victim.getAttribute(Attribute.GENERIC_MAX_HEALTH).getBaseValue());
        } else {
                double vHealth = victim.getAttribute(Attribute.GENERIC_MAX_HEALTH).getBaseValue();

                victim.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(vHealth - 2);

                if (victim.getAttribute(Attribute.GENERIC_MAX_HEALTH).getBaseValue() <= 0.0) {
                    victim.kickPlayer("Tu foste banido do servidor por teres 0 corações!");
                }
        }

    }

}```
i want when a player die the player lose 1 heart permanently and the killer win 1 heart "lifesteal"
#

but this isnt working

crude charm
#

Oh wait, judging by this guy, it's probs stored in an NFT

river oracle
#

My NFT plugin guys

echo basalt
#

reuse variables

near night
river oracle
#

Life steal plug8n number 100,001

tardy delta
#

uhm naming conventions lol

echo basalt
#

design patterns where

tardy delta
#

caching stuff where?

chrome beacon
#

?main

tardy delta
#

ah you alr said that

marble copper
#

Who wants to add a stock api to super mob coins plugin

cobalt thorn
#

im having an issues im using the packet serverbound chat message for translate other plugin message but this doesn't work how i can do that? (with protocollib or other method)

chrome beacon
marble copper
#

The plugin admin said it's easy

chrome beacon
#

We've told you so many times now

echo basalt
marble copper
#

Then which option I choose at services

rapid aspen
tardy delta
#

uhh storing variables when?

chrome beacon
undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

marble copper
#

?services

undone axleBOT
tardy delta
#

class names start with an uppercase chaaracter lol

crude charm
undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

echo basalt
#

read around this part

marble copper
#

Plz idk which option to choose for adding api

crude charm
river oracle
crude charm
#

Yup, go back to scratch

marble copper
chrome beacon
river oracle
#

(They are a troll yet we are still responding)

crude charm
#

(I think they can read this even tho its in brackets)

river oracle
#

Shit

brave goblet
river oracle
#

Noooo

marble copper
near night
marble copper
#

Like this

#

Wait

brave goblet
#

why u need api for that?

marble copper
river oracle
#

Because he doesn't know how to use a plugin config or code so he wants to be spoonfed

brave goblet
#

;-;

marble copper
#

This server use super mob coins and they have stock but I dont

crude charm
marble copper
marble copper
brave goblet
#

bro u don't need api?

cobalt thorn
# echo basalt read around this part

i can't do that with protocollib directly and my real question is what packet manage that the chat one doesn't manage that how i can edit the directly sended like that (p.sendMessage("Hi my message") ) <= Grab this and edit it

marble copper
chrome beacon
brave goblet
marble copper
#

They don't have that

brave goblet
#

if you do need api for stock in a shop that's a very dumb plugin

crude charm
#

Step 1) Download intelliJ
Step 2) Get git
Step 3) clone the repo
Step 4) Get a test server
Step 5) Get maven
Step 6) Build it
Step 7) Get mongo
Step 8) Store an int in mongo
Step 9) Edit the int when the stock changes
Step 10) Compile and enjoy

quaint mantle
#

what plugin supports EssentialsX and show balance

chrome beacon
brave goblet
#

oh i get it @marble copper

marble copper
#

And also the timer of their plugin doesn't work it only changes when u reopen the gui

rapid aspen
brave goblet
#

does it use normal economy?

marble copper
#

No its mob coins plugin

brave goblet
#

and not mob coins

marble copper
#

SuperMobCoins

brave goblet
#

and the shop?

#

do u know how the shop is made

marble copper
#

./transfer

chrome beacon
crude charm
marble copper
#

Yes in the config they have gui for shop I edited it

brave goblet
#

Ok then work with that

#

you don't need an api

marble copper
#

But there is no stock option in config

river oracle
#

Help development is no more welcome to helpserver 2

brave goblet
#

go do what @crude charm said or ask google

brave goblet
#

i gtg

grim ice
#

sup

marble copper
#

Is there any other mob coins plugin with stock

crude charm
marble copper
#

I know integers

grim ice
#

lol

ancient plank
#

int is when you intentionally feed in a game such as league of legends

marble copper
#

U said int it confused me

river oracle
grim ice
#

@marble copper what do u want anyways

marble copper
crude charm
#

1 WHOLE THOUSAND SUBSCIBERS

#

WOW

grim ice
#

make it yourself then

crude charm
#

Do you even own the game?

chrome beacon
river oracle
#

probably not xD

marble copper
river oracle
#

more like league of dumb

grim ice
tardy delta
#

i used to play that

grim ice
#

i dont see the funny here

grim ice
#

@marble copper if ur that desperate

#

get yourself some bucks

#

and hire a dev

chrome beacon
young knoll
#

Some vbucks

marble copper
#

I bought the mobcoins plugin

river oracle
marble copper
#

It's bad

chrome beacon
#

What did you expect from mcm

marble copper
#

Supermobcoins?

grim ice
#

they rebranded it

#

now its

chrome beacon
#

I know

marble copper
near night
grim ice
#

BuiltByBit

#

shit name itherway

young knoll
#

I thought spigot had the MySQL driver

chrome beacon
#

It should but it's quite old

marble copper
#

Anyone help plzz

chrome beacon
#

Stop posting here

near night
#

thanks

near night
marble copper
#

Can anyone here make mobcoins plugin with stock I'll buy it

chrome beacon
#

Stop posting here

ancient plank
#

?servives

#

Fuck

#

?services

undone axleBOT
chrome beacon
#

We've sent that 5+ times

#

They ignore it

ancient plank
#

Make a post in services

marble copper
ancient plank
#

#help-development is the channel for development help, and if you aren't writing code yourself then you shouldn't be asking your question

young knoll
#

They don’t have the post requirement

marble copper
#

There's is no api developer

quiet ice
#

API dev as in?

obsidian drift
#

Anyone know any good sounds for completing a quest?

young knoll
#

Ghast scream

grim ice
young knoll
#

The level up sound

near night
quiet ice
#

(assuming you are talking about bstats, too lazy to check)

chrome beacon
#

MySQL driver

near night
#

i was talking about mysql driver

quiet ice
#

Then it is probably optional

near night
#

thanks

quiet ice
#

However, you may need to shade it in anyways unless you include it on the runtime classpath by other means

echo basalt
#

sql driver is usually included

chrome beacon
#

Time to shade your depenedencies

crude charm
#

WUTTTTTTT

Like 26 is:

        getCommand("acceptinventoryrestoration").setExecutor(new AcceptInventoryRestoreCommand());
[23:37:17 ERROR]: Error occurred while enabling Survival v1.0-SNAPSHOT (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "me.zoibox.survival.Survival.getCommand(String)" is null
        at me.zoibox.survival.Survival.onEnable(Survival.java:26) ~[Survival-1.0-SNAPSHOT.jar:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[purpur-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[purpur-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:548) ~[purpur-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_19_R1.CraftServer.enablePlugin(CraftServer.java:596) ~[purpur-1.19.2.jar:git-Purpur-1761]
        at org.bukkit.craftbukkit.v1_19_R1.CraftServer.enablePlugins(CraftServer.java:510) ~[purpur-1.19.2.jar:git-Purpur-1761]
        at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:641) ~[purpur-1.19.2.jar:git-Purpur-1761]
        at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:427) ~[purpur-1.19.2.jar:git-Purpur-1761]
        at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:342) ~[purpur-1.19.2.jar:git-Purpur-1761]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1141) ~[purpur-1.19.2.jar:git-Purpur-1761]
        at net.minecraft.server.MinecraftServer.lambda$spin$1(MinecraftServer.java:310) ~[purpur-1.19.2.jar:git-Purpur-1761]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]
[23:37:17 INFO]: [Survival] Disabling Survival v1.0-SNAPSHOT
ancient plank
#

acceptinventoryrestoration

opal juniper
#

register it in plugin.yml

ancient plank
#

why so long 💀

crude charm
crude charm
echo basalt
#

indentation

crude charm
#

oh wait

#

yeah

#

iim stupid

#

I assumed

quaint mantle
#

Does anyone know how to get ormlite to work with spigot? been trying a bunch of different versions and no luck, using ormlite 6.1 and ormlite-jdbc 6.1 as well as the mysql-connector-java package, complains about this "Could not find class 'com.j256.ormlite.jdbc.JdbcConnectionSource', referenced from method Is it even possible to integrate Spigot with Ormlite? My guess is during the maven package script it is not including the dependencies in the final output jar.

visual tide
#

package should include them if youve got the shade plugin set up properly

#

?paste your pom.xml

undone axleBOT
quaint mantle
visual tide
#

you need to include maven-shade-plugin in your <plugins>

near night
#

shading is confusing lol

quaint mantle
#

ah I see

visual tide
#
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-shade-plugin</artifactId>
  <version>3.3.0</version>
  <executions>
    <execution>
      <phase>package</phase>
      <goals>
        <goal>shade</goal>
      </goals>
    </execution>
    </executions>
</plugin>
near night
#

then dose it not shade the spigot api?

visual tide
near night
#

right

visual tide
#

provided dependencies are not shaded

brave goblet
#

makes sense

near night
#

but compile dose right?

tardy delta
#

sqlite weird

eternal night
#

you still need to define the shade plugin

#

else it won't be shaded

eternal night
#

Yea ^

tardy delta
#

have been trying for two days now lol but that stupid select query doesnt want to match

brave goblet
#

smh

#

just store data in redstone devices not a database

quaint mantle
#

@visual tide damn I've been trying to figure this out for 2 days and I'm glad I joined this server, shading the plugin worked and I can actually use ormlite. thanks a lot!

near night
quaint mantle
#

i would've been miserable using raw sql statements and doing everything with the result set object

sullen canyon
#

how can i detect if chest being open by any other player?

tardy delta
#

my current setup lol

#

just abstracting some things away

near night
tardy delta
#

🥺 ::next() doesnt want to return true

#

even tho its in the database

sullen canyon
tardy delta
#

didnt work yesterday with uuids as strings and today it doesnt work with byte arrays

#

one dark vivid

brave goblet
near night
brave goblet
#

That is what i would think

tardy delta
#

mysql works with hikaricp right?

near night
#

with what?

tardy delta
#

connection pool

sullen canyon
near night
cobalt thorn
#

How i can edit message sended by the server (plugin) i tried with the serverbound chat message with protocollib but doesn't seem to work (how i can do that?)

brave goblet
sullen canyon
quiet ice
#

?jd-s

undone axleBOT
brave goblet
#

ok but how ever you test for custom chest

#

nvm

#

i am dumb this probably won't work

quiet ice
#

You cannot get the view out of it it seems like so you cannot set the title

sullen canyon
#

there is no this method

rough basin
#

when EntityDamgeByEntity event cast?
after get Damaged?

crude charm
#

Ik I could just pass it by using static but its static abuse

ivory sleet
#

new RestoreInventoryCommand()

#

basically you create a new sample/unit/object/thing every time, thus a new array list is created everytime

#

hence different array lists are being used

ancient plank
#

🤤 I actually made a really nice utility class for click action text components

ashen quest
crude charm
#

Yeah I know that but if I don't define it then it'll throw a null pointer

#

Right...

crude charm
ancient plank
#

look at my beautiful code...

    public static TextComponent.Builder addComponentText(List<?> objects, String command, String hoverText) {
        var componentText = Component.text();
        for(Object object : objects) {
            componentText.append(Component.text(object.toString())
                    .clickEvent(ClickEvent.runCommand(command.replace("<object>", object.toString())))
                    .hoverEvent(HoverEvent.showText(Kyori.mini(hoverText))));
            if(objects.indexOf(object) != objects.size() - 1) {
                componentText.append(Component.text(", "));
            }
        }
        return componentText;
    }
near night
#

i see Class.forName() fixing ppls issue thats the same as mine but i dont know to use it for MySQL connector

gray merlin
#

Hey so, i've done remote debugging for a while now, but I booted up my pc today and it stopped working. The code doesn't hit the breakpoints at all anymore.

#

It's the jar application type one

#

Why could that be?

glass mauve
#

is this a correct way of doing that?

    private final @NotNull Map<String, Class<? extends CommandExecutor>> availableCommands = Map.of(
            "close", CloseCommand.class,
            "test", ScreenCommand.class
    );
    // ...
    private void loadCommands(){
        FileConfiguration config = this.getConfig();

        List<String> commands = config.getStringList("enabled-commands").stream().filter(availableCommands::containsKey).toList();

        for (String commandName : commands) {
            PluginCommand command = Objects.requireNonNull(getCommand(commandName));

            try {
                CommandExecutor executor = availableCommands.get(commandName).getDeclaredConstructor().newInstance();
                command.setExecutor(executor);
            } catch (InvocationTargetException | InstantiationException | NoSuchMethodException | IllegalAccessException e) {
                getLogger().warning("Couldn't create command: " + commandName);
                e.printStackTrace();
            }
        }
    }

config:

enabled-commands:
  test: true
  close: true
near night
#

i fix the error No suitable driver found for jdbc:mysql: with java try { Class.forName("com.mysql.cj.jdbc.Driver"); } catch (ClassNotFoundException e) { e.printStackTrace(); } posting for if ppl have this problem

dreamy lily
quiet ice
#

Either you are using a too old JDK version or a too new one (latter is unlikely)

#

However I fail to understand how this happened

chrome beacon
quiet ice
#

Try using the latest Java 17 adoptium release

chrome beacon
#

^ also delete all old BuildTools files and let it start over

marble copper
#

Hi

topaz cape
#

any one got a clue why th is this happening when i tryna build my plugin

marble copper
#

I got muted but now I'm back and I need help with deluxe menus

#

I want to make a stock shop with deluxe menus

#

Van someone help

eternal oxide
#

wrong channel

quiet ice
quiet ice
topaz cape
#

of course

marble copper
quiet ice
#

And which code is wrong?

marble copper
#

U can't see it properly but there's red color on it

topaz cape
#

bro he clearly doesnt know shit just ignore em

#

lol

quiet ice
#

The target folder?

topaz cape
#

the API is just the other module

marble copper
#

Hey um how much will it take for a dev to make a black market plugin

topaz cape
#

the thing is i can build the API just fine

#

just not the core module

quiet ice
#

What happens if you do mvn install (or comparable) on the API module first?

topaz cape
#

here's the thing i do clean package

#

and API module should build first anyways

#

i dont know why it isnt

marble copper
#

What plugin r u making

topaz cape
#

actually i got whats wrong

quiet ice
#

It cannot resolve the API module - so my idea was to look at whether it will resolve it when it is in the maven local dir

topaz cape
#

the working directory was incorrect

#

thats why it was messed up

quiet ice
#

directory or dictionary?

topaz cape
#

sorry im typing on phone

#

autocorrect

quiet ice
#

Figured as such - just wanted to be sure

tardy delta
#

hmm reproduced same thing where sqlite cant find record with byte array as pk

#

dunno how to fix

#

its always printing no query found

#

fuck forget to close db

crude charm
#
                for (ItemStack content : config.getList(player.getName() + ".inventory.content").toArray(new ItemStack[0])) {
                    for (ItemStack armour : config.getList(player.getName() + ".inventory.armor").toArray(new ItemStack[0])) {

                        Inventory inv = Bukkit.createInventory(null, 54, CC.GREEN + player.getName() + "'s restored inventory");
                        inv.addItem(content);
                        inv.addItem(armour);

                        player.openInventory(inv);

                    }
                }

What's wrong with this? Why is it giving me a null pointer?

quiet ice
#

giving the NPE where?

crude charm
#

Doesn't say

#

Ill send full error

#

10s

#

gotta relaunch server

quiet ice
#

?jd-s

undone axleBOT
crude charm
#

?

#
[00:54:33 ERROR]: null
org.bukkit.command.CommandException: Unhandled exception executing command 'previewrestorechest' in plugin Survival v1.0-SNAPSHOT
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[purpur-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:168) ~[purpur-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_19_R1.CraftServer.dispatchCommand(CraftServer.java:942) ~[purpur-1.19.2.jar:git-Purpur-1761]
        at org.bukkit.craftbukkit.v1_19_R1.command.BukkitCommandWrapper.run(BukkitCommandWrapper.java:64) ~[purpur-1.19.2.jar:git-Purpur-1761]
        at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:264) ~[purpur-1.19.2.jar:?]
        at net.minecraft.commands.Commands.performCommand(Commands.java:311) ~[?:?]
        at net.minecraft.commands.Commands.performCommand(Commands.java:295) ~[?:?]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.performChatCommand(ServerGamePacketListenerImpl.java:2390) ~[?:?]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.lambda$handleChatCommand$21(ServerGamePacketListenerImpl.java:2344) ~[?:?]
        at net.minecraft.util.thread.BlockableEventLoop.lambda$submitAsync$0(BlockableEventLoop.java:59) ~[?:?]
        at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) ~[?:?]
        at net.minecraft.server.TickTask.run(TickTask.java:18) ~[purpur-1.19.2.jar:git-Purpur-1761]
        at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:153) ~[?:?]
        at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[?:?]
        at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1387) ~[purpur-1.19.2.jar:git-Purpur-1761]
        at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:185) ~[purpur-1.19.2.jar:git-Purpur-1761]
        at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:126) ~[?:?]
        at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1364) ~[purpur-1.19.2.jar:git-Purpur-1761]
        at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1357) ~[purpur-1.19.2.jar:git-Purpur-1761]        at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:136) ~[?:?]
        at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1335) ~[purpur-1.19.2.jar:git-Purpur-1761]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1223) ~[purpur-1.19.2.jar:git-Purpur-1761]
        at net.minecraft.server.MinecraftServer.lambda$spin$1(MinecraftServer.java:310) ~[purpur-1.19.2.jar:git-Purpur-1761]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.lang.IllegalArgumentException: Item cannot be null
        at org.apache.commons.lang.Validate.noNullElements(Validate.java:364) ~[commons-lang-2.6.jar:2.6]
        at org.bukkit.craftbukkit.v1_19_R1.inventory.CraftInventory.addItem(CraftInventory.java:292) ~[purpur-1.19.2.jar:git-Purpur-1761]
        at me.zoibox.survival.commands.PreviewRestoreChestCommand.onCommand(PreviewRestoreChestCommand.java:40) ~[Survival-1.0-SNAPSHOT.jar:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[purpur-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        ... 23 more
>
quiet ice
#

ah that is not a NPE

crude charm
#

Oh wait I cant read lmfao

#

but still, the list isn't full of nothiong

dreamy lily
crude charm
#

It has items which are restored fine with my restore command

quiet ice
#

And nothing of note above that message?

crude charm
#

Thats the full error

quiet ice
#
Caused by: java.lang.IllegalArgumentException: Item cannot be null
        at org.apache.commons.lang.Validate.noNullElements(Validate.java:364) ~[commons-lang-2.6.jar:2.6]
        at org.bukkit.craftbukkit.v1_19_R1.inventory.CraftInventory.addItem(CraftInventory.java:292) ~[purpur-1.19.2.jar:git-Purpur-1761]
        at me.zoibox.survival.commands.PreviewRestoreChestCommand.onCommand(PreviewRestoreChestCommand.java:40) ~[Survival-1.0-SNAPSHOT.jar:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[purpur-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        ... 23 more

We are idiots

crude charm
#

Line 40

#

there it is

quiet ice
#

Can't see the forest from all the trees

#

You are deserializing Items as null

#

just do a null check and replace the null items with air

crude charm
#

Ok

#

Thanks

#

Why can't I do addItem?

tardy delta
#

lol when trying to reproduce my issue everything works fine but in my project it doesnt

eternal night
#

depression

eternal night
#

or just use jooq 5Head

scarlet dirge
tardy delta
#

hmm i might

eternal night
#

no lol

scarlet dirge
#

huh

#

cant believe you

eternal night
#

its open source ?

scarlet dirge
#

hmm it turns out its free, but

tardy delta
#

i give up lol

#

nearly

scarlet dirge
#

its a heavy library to use,

#

(for a spigot plugin)

eternal night
#

did you just call jooq heavy compared to an orm ?

scarlet dirge
#

ormlite is very lightweight compared to jooq

eternal night
#

I guess ?

#

I mean one has all the not fun orm issues

#

the other is a nice wrapper around sql

near night
#

sooo i know its not a spigot qustion but how to i query 2 keys at once in MySQL

eternal night
#

also kekw

tardy delta
#

👀

#

hmye i give up

#

and my last try doesnt even work 💀

scarlet dirge
#

use jdbc

terse lake
#

is there a way to run mcfunction (datapack) file using spigot plugin?

quiet ice
chrome beacon
eternal night
#

Welp doesn't matter

crude charm
eternal night
#

don't use an ORM

#

¯_(ツ)_/¯

tardy delta
#

lmao

eternal night
#

they work until they don#t and then you get to mix orm with sql and everything explodes

quiet ice
#

I am surprised that even compiled for you. The IDE must have been screaming hard at that

ancient plank
crude charm
# quiet ice if (items == null) { items = new ItemStack(Material.AIR); }

It's still giving me an error
https://hastebin.com/uqukiburiv.properties
Full class:

public class PreviewRestoreChestCommand implements CommandExecutor {
    public InventoryUtility inventoryUtility = new InventoryUtility();

    @Override
    public boolean onCommand(CommandSender sender, Command command, String lavel, String[] args) {
        if (command.getName().equals("previewrestorechest")) {

            Player player = (Player) sender;

            if (!RestoreInventoryCommand.hasRestoreRequest.contains(player)) {
                player.sendMessage(CC.RED + "You don't have an outstanding inventory restoration request!");
            } else {

                Configuration config = Survival.getInstance().getConfig();


                ItemStack[] armour = config.getList(player.getName() + ".inventory.armor").toArray(new ItemStack[0]);
                ItemStack[] content = config.getList(player.getName() + ".inventory.content").toArray(new ItemStack[0]);

                Inventory inv = Bukkit.createInventory(null, 54, CC.GREEN + player.getName() + "'s restored inventory");

                for (ItemStack items : inv.getStorageContents()) {
                    if (items == null)
                        items = new ItemStack(Material.AIR);
                    }


                    inv.addItem(content);
                    inv.addItem(armour);

                    player.openInventory(inv);


                }
            }
            return false;
        }
    }
#

Ah I think I might know

#

I think its order

onyx fjord
#

is there a method to check if server is behind bungee?

crude charm
#

Nope

onyx fjord
#

i could check spigot.yml file but is that good idk

quiet ice
#
                ItemStack[] armour = config.getList(player.getName() + ".inventory.armor").toArray(new ItemStack[0]);
                ItemStack[] content = config.getList(player.getName() + ".inventory.content").toArray(new ItemStack[0]);

                for (int i = 0; i < armour.length; i++) {if (armour[i] == null) {armour[i] = new ItemStack(Material.AIR);}}
                for (int i = 0; i < content.length; i++) {if (content[i] == null) {content[i] = new ItemStack(Material.AIR);}}
                Inventory inv = Bukkit.createInventory(null, 54, CC.GREEN + player.getName() + "'s restored inventory");

                for (ItemStack items : inv.getStorageContents()) {
                    inv.addItem(content);
                    inv.addItem(armour);

                    player.openInventory(inv);


                }

@crude charm

crude charm
#

Ah I see

#

kinda stupid why spigot doesn't just automatically do it

quiet ice
#

Having null be represented as air is kinda being phased out atm

#

Just takes a very, very long time

crude charm
#

Oh uh, found a bug

#

It gives it to me correctly just doesnt show it in the menu right

glossy scroll
tardy delta
#

instantiating utility class 👀

crude charm
tardy delta
#

💀

crude charm
#

?

tardy delta
#

utility classes should be stateless and shouldnt be instantiated

crude charm
#

If I dont then ill get a null pointer?

glossy scroll
#

dependency injection :)

#

?di

undone axleBOT
crude charm
#

I know what di is

thorn wren
#

How to start updating plugins from 1.18 to 1.19?

crude charm
#

I dont use it all the time tho cause I end up having 50 variables to instantiate one class

#

or in the way the spigot guide states which requiring the var

glossy scroll
#

i mean that code you posted would require two parameters

crude charm
#

One? Just the arraylist, no?

glossy scroll
glossy scroll
crude charm
#

This is the first project I have used static for getting an instance of main

#

and it's so much easier

#

and faster

lost matrix
# crude charm and faster

And doesnt force you to think about your design so you can just hack in your stuff so that it works.

crude charm
#

exactly

#

Static is a thing for a reason, if you constantly try not to use it then they may as well remove it

lost matrix
# crude charm exactly

I love to have messy code without any design patterns that create bugs which take you at least the same time to debug that you needed to write it in the first place.

wet breach
bronze night
#

I was coding and wanted to send the argument from the command a player was executing, and instead of getting Test from /test Test i got something like this lJava.lang.String;@b93f202 any way to fix this?

crude charm
tardy delta
#

calling toString or smth?

tardy delta
#

actually String::toString would just returns itself iirc

lost matrix
crude charm
#

Good point, but still

wet breach
#

statics are a handy way to keep some objects from being GC'ed since anything static will never go away.

bronze night
tardy delta
#

?di use this instead of the JavaPlugin.getPlugin

undone axleBOT
tardy delta
#

and class names start with an uppercase char

lost matrix
undone axleBOT
crude charm
#

Why is this happening?

public class PreviewRestoreChestCommand implements CommandExecutor {
    public InventoryUtility inventoryUtility = new InventoryUtility();

    @Override
    public boolean onCommand(CommandSender sender, Command command, String lavel, String[] args) {
        if (command.getName().equals("previewrestorechest")) {

            Player player = (Player) sender;

            if (!RestoreInventoryCommand.hasRestoreRequest.contains(player)) {
                player.sendMessage(CC.RED + "You don't have an outstanding inventory restoration request!");
            } else {

                Configuration config = Survival.getInstance().getConfig();


                ItemStack[] armour = config.getList(player.getName() + ".inventory.armor").toArray(new ItemStack[0]);
                ItemStack[] content = config.getList(player.getName() + ".inventory.content").toArray(new ItemStack[0]);

                for (int i = 0; i < armour.length; i++) {
                    if (armour[i] == null) {
                        armour[i] = new ItemStack(Material.AIR);
                    }
                }
                for (int i = 0; i < content.length; i++) {
                    if (content[i] == null) {
                        content[i] = new ItemStack(Material.AIR);
                    }
                }
                Inventory inv = Bukkit.createInventory(null, 54, CC.GREEN + player.getName() + "'s restored inventory");

                for (ItemStack items : inv.getStorageContents()) {
                    inv.addItem(content);
                    inv.addItem(armour);

                    player.openInventory(inv);


                }
            }
        }
        return false;

    }
}

wet breach
#

when you use toString on an array, it gives you the string representation of the array

#

and not what is in the array

bronze night
#

oh okay

tardy delta
#

Arrays.toString if you really want to see the contents of the array

quaint mantle
#

anyone know any modern guides / tutorials on NMS and packets and stuff?

crude charm
grim ice
#

and am i misreading or is 7smile agreeing with you about static abuse

lost matrix
#

I thought i was sarcastic enough

grim ice
#

nevermind

#

yeah

tardy delta
#

lmfao

grim ice
#

i think zoibox actually thought you were serious though

crude charm
#

Cant even read

grim ice
#

eitherway

#

what youre doing is static abuse

crude charm
#

Committing a cardinal sin

grim ice
#

lol

lost matrix
grim ice
#

to your design, yes

wet breach
#

also, it helps to learn about reflection first as well

#

before going messing with NMS stuff

grim ice
wet breach
#

because sometimes it is necessary to use when messing about with NMS

crude charm
lost matrix
#

With the latest versions its really rare because everything is so data driven now.

#

I actually cant remember if i ever used any reflections after 1.17

quaint mantle
crude charm
#

spigot is os

#

No need to decompile

wet breach
#

the only thing that would require decompiling is the minecraft jar if you are wanting to mess with stuff that spigot doesn't use or import

quaint mantle
#

i ignored the buildtools folder until today. is the source just in BuildTools/ or another subdir?

wet breach
#

depends which source you are looking for

grim ice
#

im looking to make a library

#

anyone got an idea?

#

im bored

wet breach
#

in the work directory you will find the source classes for the minecraft jar

quaint mantle
wet breach
#

in the build directory you will find the sources for spigot server and api

quaint mantle
lost matrix
#

I usually just use Intellij. Really helps navigating through there when you know some shortcuts.

grim ice
#

i use notepad!

quaint mantle
#

and one last thing: how would i compile it into a usable jar once i changed some stuff

grim ice
#

i actually coded a forge mod with notepad once

grim ice
#

completely with notepad, no ide used

quaint mantle
wet breach
#

should only need spigot-server to mess with packets

quaint mantle
wet breach
#

same thing

quaint mantle
wet breach
#

when needing to look at vanilla class files and not spigot ones

#

spigot doesn't use all the class files, but uses a fair bit

#

so for the ones it doesn't use, will need to look there for them to get an idea of what it does etc

#

just because spigot doesn't use it, doesn't mean it isn't being used, just means spigot doesn't modify it thus no need to import it

torn shuttle
#

hey, anyone know of a good mapping tool for minecraft worlds? I just need a 2d top down map of a world, not for real time (so not dynmap)

quaint mantle
#

so i have theoretically modified the buildtools/build classes
how would i compile it into a new spigot.jar file?

quaint mantle
torn shuttle
#

I don't use dynmap

quaint mantle
wet breach
onyx fjord
#

is it possible to get plugin list (bungee) from spigot plugin?

wet breach
onyx fjord
#

ah

#

sounds like overkill then

#

all good

quaint mantle
bronze night
#

btw, how should i add urls properly in config.yml? the upper version or the downward one?

tardy delta
#

both will get accepted

bronze night
#

but when i use getConfig.getString("Plugins." + args[0] + ".Link") it shows null

obsidian drift
#

How can I receive plugin messages from a BungeeCord plugin?

bronze night
obsidian drift
#

Like you would read any other string

obsidian drift
bronze night
#

dunno

#

but i think i found a workaround

#

i will just create strings with those links in config.yml and just read it from there

upbeat wren
#

anyone know how i can turn on or off a var in other jar?

#

this is my first jar

quiet ice
#

Is the other jar in the compile classpath?

upbeat wren
quiet ice
#

If not, is it possible to add it to the compile classpath?

upbeat wren
#

that's my other jar

#

i add in classpath

#

but when i set true just set on my first jar

#

the second jar still false

quiet ice
#

yes, that is because you create a new variable

upbeat wren
#

i already tried without create

ancient plank
#

juicyraspberrypie yummy

upbeat wren
#

😋

quiet ice
# upbeat wren

assuming the .getInstance method works as intended, it is possible that you will have issues such as thiis one if you shade the jar

upbeat wren
#

for unknown reasons

quiet ice
#

Show the plugin.yml of both plugins

upbeat wren
#

it's not depended

#

it's only normal plugin.yml

quiet ice
#

and the other plugin.yml?

upbeat wren
#

same

#

just main, description and version

#

no commands

gray merlin
#

If I register an event listener inside a class that will be instantiated multiple times, it will register my event listener multiple times, right?

#

And if so, is there a way for me to unregister the event listener?

quiet ice
#

Then you need to define plugin A as a dependency of plugin B

upbeat wren
#

i will try now

quiet ice
#

plugin A is loading too early and as such you are getting a var from plugin B before it is loaded

upbeat wren
#

sure

#

same

chrome beacon
#

Use di

#

?di

undone axleBOT
bronze night
#

how do i check if command's argument is equal to the name of the string?

frail swan
#

it's a special communication channel for plugins

bronze night
frail swan
#

not just that bit

bronze night
#

`public class Help implements CommandExecutor {

@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {


    Player player = (Player) sender;






    if (sender instanceof Player) {


            if (args.length == 1) {




                        TextComponent component = Component.text(args[0])
                                .hoverEvent(Component.text("press to get to the website").color(TextColor.color(0, 255, 0)))
                                        .clickEvent(ClickEvent.openUrl(NesterosPlus.getPlugin(NesterosPlus.class).getConfig().getString(args[0])));
                        player.sendMessage(component);

                if (args.equals(NesterosPlus.getPlugin(NesterosPlus.class).getConfig().contains(args[0]))) {
                    TextComponent component1 = Component.text("Error")
                            .color(TextColor.color(255,0,0))
                            .hoverEvent(Component.text("error"))
                            .clickEvent(ClickEvent.suggestCommand("/nhelp"));
                }











        }
            else {
                player.sendMessage("Sprecyzuj plugin");
            }


        }


    return true;
}

}`

frail swan
#

args is an array

#

u're essentially saying if an array is equals to a boolean

#

to different types

#

you should rephrase your code cause I doubt thats what you meant

dim bronze
#

```java
code
```

tardy delta
#

?paste it

undone axleBOT
dim bronze
#

or paste ^^

upbeat wren
tardy delta
#

dont cast sender before you know its an actual player

upbeat wren
#

java.lang.NullPointerException: Cannot invoke "org.wensheng.juicyraspberrypie.JuicyRaspberryPie.setEvento(boolean)" because "this.pie" is null

solid cargo
#

any way i can get length of a sound?

#

if its in vanilla ofc

upbeat wren
#

yeah, but i still working to call pie

solid cargo
#

wait are mc songs saved in an ogg file?

chrome beacon
#

Minecraft uses vorbis (.ogg) for all sounds

solid cargo
#

OH WAIT

#

i figured a workaround, a simple one

#

for getting length of sounds

grizzled cedar
#

Can anyone tell me how to make a specific command public to everyone?

slender widget
#

So I want to make a command that resets the world.
Currently it resets the region files from a backup, but after a restart, the changes have not been applied. How do I make it so that my changes take effect?

tardy delta
#

maybe show code

slender widget
#
try {
                File regionFolder = new File(gameManager.getPlugin().lobbyFolder, "region");
                Bukkit.unloadWorld("world", false);
                FileUtil.copy(regionFolder,
                        new File(new File(Bukkit.getWorldContainer().getParentFile(), "world"), "region"));
                Bukkit.createWorld(new WorldCreator("world"));
                sender.sendMessage(ChatColor.GREEN + "Lobby reset");
            } catch (IOException e) {
                if (Bukkit.getWorld("world") == null) {
                    Bukkit.createWorld(new WorldCreator("world"));
                }
                sender.sendMessage(ChatColor.RED + "Failed to reset lobby");
                Bukkit.getLogger().severe("Failed to reset lobby");
                e.printStackTrace();
            }

(FileUtil.copy(...) is a custom class, but it works)

obsidian drift
#

Wtf

java.lang.NullPointerException: Cannot invoke "net.md_5.bungee.api.chat.BaseComponent.getExtra()" because "root" is null
        public static void say(ClickEvent clickEvent, HoverEvent hoverEvent, TextComponent... messages) {
                RanksLib.getRanksCache().forEach((loopUUID, loopID) -> {
                        ProxiedPlayer loopPlayer = Proxy.getInstance().getProxy().getPlayer(loopUUID);
                        if (loopID > 80 && loopPlayer != null && loopPlayer.isConnected()) {
                                if (clickEvent != null) {
                                        for (TextComponent message : messages)
                                                message.setClickEvent(clickEvent);
                                }
                                if (hoverEvent != null) {
                                        for (TextComponent message : messages)
                                                message.setHoverEvent(hoverEvent);
                                }
                                loopPlayer.sendMessage(messages);
                                Proxy.getInstance().getProxy().getConsole().sendMessage(messages);
                        }
                });
        }
#

What does "root" is null mean

chrome beacon
undone axleBOT
obsidian drift
chrome beacon
#

Can you recreate the issue using Bungeecord

obsidian drift
#

I'll try

crisp forum
#

PrepareItemEnchantEvent gets fired twice, does anyone have any idea about reason?

chrome beacon
#

Called when an ItemStack is inserted in an enchantment table - can be called multiple times

#

Sounds like it's working as intended

crisp forum
#

When I put my sword into enchanting table it should be called on time