#help-development

1 messages Β· Page 2031 of 1

tender shard
#

like

#

the amount of IP packets sent in the last 10 minutes

#

their ping

#

how you moved your mouse

#

the amount of porn in your homework folder

#

etc etc

wet breach
#

basically whatever it can get its hands on

#

to inject more entropy

tender shard
#

exactly

viral crag
#

it is a popular research project for masters and doctorate thesis, no shortage of data on it

tender shard
#

anyway I'm going to bath in a few minutes, so prepare to get some weird videos

#

you can feed those videos to your random number generators to gain some entropy

tender shard
#

lol the different reactions

#

espresso is like 😐

wet breach
#

yeah I am good. I had enough cryptography training and learning in the Army

tender shard
#

frostalf is like "oh no"

viral crag
tender shard
#

and bishop wants to get some NSFW videos

wet breach
#

even for most enterprises as well

tender shard
#

like what is really truly random?

viral crag
tender shard
#

is it random that LM reacted after 9.8273 seconds to my message while frostalf reacted after 2.333382 seconds?

#

or would have somebody be able to calculate how many seconds everyone of you take to react to my last message?

wet breach
#

the only thing we know of to be truly random at the moment is DNA. Everything else we have seen in the world isn't really truly random

tender shard
#

if NOONE is able to calculate it, in ANY means possible, I consider it to be "truly" random

wet breach
#

but even DNA might not be truly random, because it could just be because we don't fully understand it enough

tender shard
#

exactly

unreal quartz
#

I'm random πŸ€ͺ

tender shard
#

if we know everything about how every brain works, we could totally predict the future

#

but we can't

#

so it's random

#

everything is random until we exactly know on how to predict the outcome

viral crag
#

pretty sure the ex-president is the apex of random

wet breach
#

Trump? The stuff he did wasn't random at all lol

#

I loved him for his use of the military in getting rid ISIS πŸ™‚

#

well the majority of ISIS anyways

viral crag
#

cept he didnt do anything

wet breach
#

yes he did

viral crag
#

that was leftovers

wet breach
#

No it wasn't

#

We did a fake out on ISIS

#

Trump came up with it and approved it

#

we stated we were leaving an area

#

started packing up

#

and then they came out, and we bombed them with drones because we didn't leave yet. We didn't lie in that we were leaving, we just didn't give accurate time line πŸ˜›

unreal quartz
#

Gonna write that one down for my next military operation

viral crag
tender shard
wet breach
#

but such things require the president to be involved though πŸ™‚

tender shard
#

and yeah trumps actions really weren't random. you basically had to predict what was the worst possible thing be for him to do and bam, you knew that that was the thing he'd be going to do next lol

unreal quartz
#

Epic roast

wet breach
#

Well, he didn't do very bad things

tender shard
#

yeah let's not engange into that

wet breach
#

I mean look at the current potus

tender shard
#

he only killed hundreds of thousands of americans by ignoring all the corona stuff

sterile token
#

HI, how are you?

wet breach
tender shard
#

I enganged into politics although I didnt want to, smh, my bad

tender shard
unreal quartz
#

I know all the details

tender shard
#

all I know is that he basically removed the whole pandemics task force a year before a pandemic happened

wet breach
#

Also governors are free to perform their own quarantines despite if the President does anything

#

so if you want to hate on the president for it, then hate all 50 states Governors as well

#

for doing exactly nothing as well

tender shard
#

I don't wanna hate on anyone besides the Rump

unreal quartz
#

Could do with a steak right now

tender shard
#

"obama played too much golf" continues to play golf the whole time

wet breach
#

Congress also doesn't have to wait on the President either, so that includes all your Senators and Representatives as well πŸ™‚

tender shard
#

"I hate immigrants" continues to marry not one, but two illegal immigrants

#

"grab her by the pussy"

#

etc

#

the Rump is a jerk and everyone knows that

sterile token
tender shard
wet breach
#

so to blame just a single person, when you have multiple others more responsible and could have done something or said something is just quite ludicrous

tender shard
#

just google "the rump grab her by the pussy"

sterile token
tender shard
#

tRump basically said "i am so rich, I can touch women's vaginas and they won't complain because I am rich"

#

well that's not his exact words

#

but that's basically what he said

wet breach
sterile token
#

Yeah i agree. I hate that too

wet breach
#

You know how many people just get a slap on the hand because guess what they are rich lol

#

oh no, lets not punish the rich person

#

they didn't know better

#

but hey if you are poor you should have known better though

#

because you could afford all that stuff being poor πŸ™‚

grim ice
#

hm

sterile token
#

I don't know what you're arguing about. But I am against rich people being able to do illegal things without being punished.

grim ice
#

you being against something wont do anything but thats cool

#

life is unfair, u cant change it

sterile token
#

You can change it lmao

grim ice
#

Do it then

sterile token
#

I don't like that people think that nothing can be changed. For example, why do you think that in the United States they fine you for anything? This is how countries should be. You do something wrong and it's fine, it's the only way people really learn.

grim ice
#

reborn me somewhere not in africa, give me parents that dont cheat on each other, ones mature enough and "change it"

#

Life is unfair and you cant change it, if you were born strong you can change the weaker though

sterile token
grim ice
#

gth?

sterile token
grim ice
#

Oh

#

why though

sterile token
#

i call it gth

sterile token
#

I just realized i was looking smth like that

#

πŸ™‚

grim ice
#

my github is connected to my account

sterile token
grim ice
#

eitherway its not like I like trump

#

I dont defend someone that wont defend me, exception is when it would not harm me to do so

#

it is true that he's an asshole, that's the least

wet breach
#

as far as doing things as a President he did the majority of things he said he would do. If that is considered bad then that makes sense why people love having a President that does nothing

#

but you also have to remember, the President does not dictate the laws in States and what States can or can not do. That is the President does not have Total control over the US

#

this is the case in some other Countries where their President or whatever name they go by, actually does

quiet ice
#

The german president for example has next to no power

#

He has vetoing capabilities but that is about it

grim ice
#

eitherway

#

Trump's personality

#

is pure garbage

unique eagle
#

Hello ! i try to change a block client side for a player
i used Player#sendBlockChange but all player see the block change
it's very weird

quiet ice
wet breach
grim ice
#

Sexist, racist, supports sexually assaulting females

wet breach
#

I am not sure about the racist part

quiet ice
#

I think that is just an implementation flaw. Trump 2.0 might have resolved it

wet breach
#

However, do keep in mind people have been wanting Trump to run for president for many years as well since like the 70's or 80's

quiet ice
#

he was alive back then??

grim ice
#

google it

wet breach
#

yeah, trump is like 75

quiet ice
#

It shouldn't surprise me tbh

vocal cloud
# grim ice google it

I mean Trump's platinum plan is 10x better than any policy Biden's put forth so either Biden is more racist than Trump or you're falling for the "I heard it from someone else" fallacy

quiet ice
#

Politicians are pretty old

wet breach
#

if you are going to infer about the wall, then that isn't racist at all lol

quiet ice
#

The wall was a propaganda tool. Big words, but not that much action behind it. While sure, some sections were completed most are not due to cost concerns

wet breach
#

we have the money to do it

vocal cloud
#

The issue with any policy is mostly opposition

wet breach
#

Most people don't even know that the border in the south largely has nothing there, not even a fence, and if you do see a fence it is like 3ft high XD

#

I would much rather there be something even if it is a wall, then there to be nothing

#

but, again most people don't do their research or actually ever been to the southern border πŸ™‚

quiet ice
#

Does the wall even have an economic benefit for it to be able to make economic sense (I know that not everything needs to make economic sense, but let's suppose they have to be)

wet breach
#

in other words it forces them to actually use the other methods

#

other methods being flying or boats which is far easier to spot then some people walking in the desert

quiet ice
#

digs under the fence

wet breach
#

well the wall extended some feet underground, I don't remember the specifics, while you technically could do this, it isn't going to happen in a single day

quiet ice
#

Yeah I do not think that anyone is going to be mad enough

#

Though it was certainly attempted with the berlin wall, so probably will happen from time to time

wet breach
#

I think this was done for in Iran

#

There was along one of there borders 3 or 4 tunnels

#

they have since closed them up, but it is something that people will do

vocal cloud
#

politicians claim we don't need a wall yet live in houses with high fences and tight security in communities with gates and walls.

safe edge
#

How i can add local repository to maven dependency in plugin ?

quiet ice
#

Maven or gradle?

viral crag
#

haha you lured geol in to replace mfnalex ?

safe edge
quiet ice
#

What?

vocal cloud
#

oof size large

wet breach
# quiet ice What?

they are converting a gradle project to a maven one. I guess the gradle project uses local maven repo

safe edge
#

Not

quiet ice
#

Yeah, maven uses maven local by default

#

With a few exceptiions as some will say just about now

safe edge
#

I have maven plugin and need depednecy from dynmap

wet breach
quiet ice
#

Oh, then just declare the dynmap repo as a maven repo and add it as a dependency?

wet breach
#

yep that is the best way

#

just add its repo info into the pom and add it as a dependency and it should work out just fine πŸ™‚

quiet ice
#

To be honest a wall does not make much sense to me, but as an European I probably don't understand the problem at all

lavish hemlock
#

diamond shovel time

wet breach
# quiet ice To be honest a wall does not make much sense to me, but as an European I probabl...

Well most people assumed the wall was only for stopping immigration and while it is also for that purpose because there is a ton of people migrating from the south, it has other benefits too in terms of security. As I previously stated most people in the US actually do not know there is no barrier at all in many parts of the southern border and if there is, it isn't stopping anyone because you could literally just walk over it. We don't have enough people to patrol the border 100% all the time.

quiet ice
#

The EU doesn't have very visible borders either, so what is the difference there?

wet breach
#

well what the EU decides is on them. Generally some EU countries share a border with another EU country

#

and passage between them is allowed without anything being required

#

a better comparison is EU to US states

#

I can travel between any state in the US without being stopped to show ID or a passport

quiet ice
#

yeah

wet breach
#

and the US states are not about to put up walls either around their state border when passage is allowed already lol

#

however, the southern border is an issue because of immigrants not just from Mexico but all the way from other countries in South America

#

like Brazil

#

or Venezuela

grim ice
#

how to check if the left click button is down for like 1 second

#

(held down)

wet breach
#

we can't just accept 100% of all immigrants without it having a negative impact on our economy

quiet ice
#

makes sense

wet breach
#

I don't blame immigrants for wanting to enter the US either

#

whether to work or just permanently stay

chrome beacon
wet breach
#

quality of life is generally better then any country in SA

chrome beacon
#

If not then you can't

grim ice
chrome beacon
#

Oh

grim ice
#

pure java

quiet ice
#

Well, do you need to know when the player is NOT holding left clock button for 1 second?

grim ice
#

no, the user

#

not related to minecraft

quiet ice
#

Ah

wet breach
#

there is usually button events

#

also you might be able to capture mouse inputs directly

grim ice
#

i want it to be outside of y application

#

my*

#

do i need jnativehook for that

lavish hemlock
#

Yeah, probably

quiet ice
grim ice
#

how do i check if its holding, not a click

quiet ice
#

Oh you mentioned it already

grim ice
lavish hemlock
vocal cloud
#

check for mouse down event or whatever it's called store the time compare to mouse up

#

voila

wet breach
quiet ice
#

Check for mousePressed, schedule a task and check if there has been a mouseReleased after it

vocal cloud
#

Probably can just store it globally since unless you're using an external api a mouse up will always follow a mouse down

wet breach
quiet ice
#

Yes, something like that, just with the repository

patent horizon
#

is there a way i can check for a player's client minecraft version in spigot?

#

or would i have to use like ProtocolSupport/Viawhatever's apis?

quiet ice
#

yep, you'd have to do it that way

#

The minecraft server just thinks that it is accepting clients from the latest version I assume

wet breach
#

server automatically checks the client version if its acceptable for the version of server that is running

#

things like viaversion however aim at removing this

#

so, if you need to know client version you would have to listen for the packet yourself or use protocollib

viral crag
wet breach
#

probably using something like viaversion and allowing older clients to play

#

however depending on the client version, dictates what you could show or not show

patent horizon
#

since protocolsupport almost always has bugs

viral crag
#

vulcan queries clients for version and which client

patent horizon
#

what

mellow edge
#

if I wanna set the player to full life with player.setHealth, do I need to pass in 20

patent horizon
#

yes

#

or just pass the player's max health

mellow edge
#

ok πŸ™‚

frozen thorn
quiet ice
#

there was someone that had a similar issue not long ago...

sterile token
quiet ice
#

Either way give use the code and I'll show what you can do to resolve this

chrome beacon
vocal cloud
#

Well it's pufferfish which is a fork of paper

frozen thorn
vocal cloud
#

Have you tried it on base spigot?

frozen thorn
chrome beacon
#

^

#

Did you just copy paste that code without knowing what it does

quiet ice
#

You can skip the config.load(file); if the file does not exist

#

Then just remove the plugin.saveResource(name, true); given that it is not needed at all

sterile token
quiet ice
#

Alternatively, instead of plugin.saveResource you create a file

quiet ice
sterile token
#

File file = new File(path, name);
file.createNewFile();

File creation

quiet ice
#

But technically creating a file is very much useless there

sterile token
#

Idk what he want to do

frozen thorn
#

I want to save locations in a yml file

#

and that is my config manager I used in 1.8

quiet ice
#

A simple

        config = new YamlConfiguration();
        if (file.exists()) {
            try {
                config.load(file);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

is enough

sterile token
#

Because you can use for 2 pupuses. As a config file (whe i load it from the plugin jar) or storage file (where i just create an empty file)

quiet ice
#

the #save call will create the file either way

sterile token
quiet ice
#

It should

sterile token
#

Oh i always learn smth new here

quiet ice
#

?jd-s lemme look at the api sepc

undone axleBOT
quiet ice
#

This behaviour is the only logical behaviour as requiring the file to exist if you are going to overwrite it either way is bogus

#

And if you aren't overwriting the file with a #save call there is something really wrong

sterile token
#

What?

frozen thorn
#

thanks

tender shard
#

omg there's so many good songs about smoking crack

#

whoops wrong channel

#

sry

sterile token
#

So this is wrong?

tender shard
quiet ice
#

why would it be wrong?

patent horizon
sterile token
tender shard
sterile token
undone axleBOT
sterile token
#

Send full error there

quiet ice
#

What does this.save(this.file) do?

patent horizon
quiet ice
#

chances are it overwrites

sterile token
#

I done because my FileHandler extends YamlConfiguration

quiet ice
#

So it overwrites, thus making the save call adhere to my logical assumptions I proposed earlier

patent horizon
sterile token
patent horizon
#

ok

viral crag
patent horizon
#

what tags

quiet ice
#

He might be at sleep considering it is midnight for him

viral crag
#

compileOnly 'com.comphenix.protocol:ProtocolLib:4.7.0'

viral crag
patent horizon
#

because thats what protocollib's wiki said to add

viral crag
#

the format compileOnly 'com.comphenix.protocol:ProtocolLib:4.7.0' is what it should be as far as i know

mellow edge
#

why can't you debug plugins😫

vocal cloud
#

You can

viral crag
patent horizon
#

oh i see what went wrong

#

bracket misplaced

vocal cloud
viral crag
#

oof

mellow edge
vocal cloud
#

pings person
oops I figured it out
a tale as old as time

sterile token
mellow edge
#

ok, I have it and how can I debug the plugin now

sterile token
#

Just debug your plugin adding console out message?

mellow edge
#

horrable

sterile token
#

Or maybe doing unit tests

#

Idk do what ever you consider

pliant oyster
#

How do I pick a random item from a ItemStack array

vocal cloud
mellow edge
#

I miss you

sterile token
sterile token
mellow edge
#

I miss debug button lol

viral crag
#

although in the end, usually you still need to launch a clinet to do something

mellow edge
#

and bdw I am already using system.out, i'm not dumb

#

and no I don't use logger

viral crag
#

wonders who martin is talking to

lavish hemlock
#

your mom

#

he's flexing his lack of logger to your mother

viral crag
#

good luck, he will cry from the lack of punctuation and line breaks

sterile token
#

You have to load the file again

viral crag
#

dunno what you are doing in the first part, but yes you have to set it after editing

sterile token
#

When you edit a file, you have to do it manually or via cofig#set(path, value). And them save (config#save()) it or just load it again (confi#load())

#

@pliant oyster here you have:

List<String> array = new ArrayList<>();
array.add("banana");
array.add("apple");
array.add("orange");
Random random = new Random();
int integer = random.nextInt();
if (integer < array.size() && array.get(integer) != null) System.out.println(array.get(integer));
patent horizon
#

what do i have to change in my spigot lib info to go from spigot api -> spigot server

sterile token
patent horizon
#

i wanna access nms and craftbukkit shits in my plugin

#

i know what to change in maven to get it

#

but idk what to do in gradle

sterile token
#

You have to use Spigot-Jar instead of api

#

Cannot just change the dependencies of your project?

patent horizon
#

i could

#

i just dont know what to change it to

#

do i just remove the -api like normal?

sterile token
#

org.spigotmc:spigot-jar:1.18-R0.1-SNAPSHOT

#

Just change the version there

patent horizon
#

the option to import CraftPlayer isnt popping up

#

do i have to get 1.18 buildtools on my computer?

wanton remnant
#

Hello, I have a problem with my plugin. I just updated to 1.18 except that there are modifications with the "java.sql.Connection.prepareStatement()" and I don't know what I have to change ^^'
Can you help me ?

primal kite
# wanton remnant

getConnection is null
you are not connected to the database make sure you have a valid connection before calling a statement

wanton remnant
patent horizon
primal kite
patent horizon
#

like put that on my server?

#

where do i put it

primal kite
#

add the jar as a dependency to the project

patent horizon
#

so i stick the jar into the resources folder?

undone axleBOT
#

Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.

Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163

wet breach
#

please read the post and the following posts it mentions in regards to NMS related things and how to setup the pom

patent horizon
#

post doesnt have gradle stuff

wet breach
#

so still helpful to read it

tender shard
#

the bootstrap bot answer needs to be updated

patent horizon
#

how do i translate to gradle

wet breach
#

I don't use gradle so you will need to wait for someone who is a gradle expert to help with that lol

tender shard
wet breach
tender shard
#

oh

#

there are two rules:

#
  1. If you don't know on how to it in gradle, use maven
  2. See rule 1
patent horizon
#

cant use maven

#

it's a pain to shade other libs in maven

primal kite
wet breach
tender shard
#

I don't have anything against gradle besides the fact that I don't like it. But, and THIS IS VERY IMPORTANT:
If you do not know how to do something in gradle, use maven instead

#

gradle is like the complicated, and a tiny bit more powerful version of maven

wet breach
#

I can show you how to shade in maven without it being complex πŸ™‚

tender shard
#

gradle is like 300% more complicated than maven while providing 7% of extra features

#

if you don't need the 7% of extra features, just stick to maven

wet breach
#

inb4 someone says maven is slow >>

primal kite
tender shard
wet breach
tender shard
#

as said, gradle definitely is good. but it's also soooo much more complicated than maven

#

I would never use gradle unless I absolutely have to

#

I would much rather use maven

wet breach
#

I am just pointing out usually someone comes around and says as an argument that maven is slow XD

#

which irritates me because maven is not slow

tender shard
#

in my opinion, both gradle and maven are awesome tools. but one can'T deny that maven is just waaay more straight forward

#

sure, if you're an expert in gradle, you don't have problems. but if you're not, gradle ist just 10 times more complicated than maven is

wet breach
tender shard
#

so the 3 seconds you save in compiling doesn't really add up with the 3 hours you need on stackoverflow to make your shadowJar compile

wet breach
#

so if maven is taking like 5-10 minutes to build and you have resources to give it. Giving it more resources to use will turn that build time into something more like under a minute XD

tender shard
#

I mean

primal kite
#

forget Maven and Gradle, just go back to the OG....
ANT

tender shard
#

even spigot compiles within 5 minutes using maven

#

so if a project needs 5 minutes in amven, it must be SOOOOO HUGE

#

that using gradle wouldnt make a difference anyway

wet breach
tender shard
#

I'm not an md5 fanboy, but if gradle really is so much better, I am sure md5 would use it

tender shard
#

I 100% agree with you on this one

wet breach
#

also the main reason for md_5 probably not switching to gradle

#

would probably because before gradle came along he had already made maven plugins for specialsource

#

and the sorts

tender shard
wet breach
#

so easier to just stick with maven then try to import special source to gradle

#

well yeah its not needed

#

just pointing out that he has created maven plugins for spigot

tender shard
#

although I have never made out with md_5, I can probably safely assume he's not stupid, so he sticks to one of the main rules that every decent admin sticks to, which is to "never change a running system"

wet breach
tender shard
#

what do you mean?

wet breach
#

And yes md_5 is quite knowledgeable himself πŸ™‚

tender shard
#

he definitely knows more than 10x as I do about java and stuff

#

but so does choco, I guess

viral crag
#

... its almost exactly the same for gradle as it is for maven to get nms access ...

tender shard
#

πŸ˜„

#

funny that you think this

#

you're probably on 1.16.5 and below? or not using NMS at all?

tender shard
#

use the ComponentBuilder

#

you cant just concat strings and components

#

either go full component, or don't use them at all

primal kite
#

I don't use much components but if I recall based on your code. you are sending a string and not a full Text Component

viral crag
#

i go the cursed route if needed

tender shard
#

TextComponent.fromLegacyText(...)

#

(although you will NEVER need this unless you wanna have configurable messages, and it seems like you don't need them)

patent horizon
#

so i rewatched the kody simpson video for nms, and he essentially just changed spigot-api to spigot and was able to import CraftPlayer and whatnot into his code. so why isn't this the case for me?

viral crag
#

you still need to use buildtools as well and have it in teh right location

patent horizon
#

i have buildtools

#

and installed 1.18.2

primal kite
# patent horizon so i rewatched the kody simpson video for nms, and he essentially just changed `...

I have seen some of Kody's stuff in the past but found that CodedRed has a little better explanation behind stuff. Try this one https://www.youtube.com/watch?v=K6-deuw4N_o he has some troubleshooting stuff about 4 and a half minutes in

Another IntelliJ video! In this video, I go over how to use NMS with Maven in IntelliJ! It is super easy but can be confusing to new devs. This will be the last IntelliJ video for a while, the next videos will be all about CODE!

------ Links ------
JetBrains Toolbox: https://www.jetbrains.com/toolbox-app/
Java 16 Download: https://www.oracle.c...

β–Ά Play video
worldly ingot
patent horizon
#

i changed it

#

still no

#

oh wow

worldly ingot
#

lol

patent horizon
#

compileOnly 'org.spigotmc:spigot:1.18.2-R0.1-SNAPSHOT'

tender shard
worldly ingot
#

Well if it's still not importing then I'd (1) make sure your project has been refreshed, and (2) re-run BuildTools to be certain

patent horizon
worldly ingot
#

because I'm looking at my local repository and it's installed automatically for me

tender shard
#

also, what part of spigot do you need? you want to use the remapped mojang .jar in 99% of cases

patent horizon
#

looks like i got 1.18.1

worldly ingot
#

Well, latest isn't 1.18.2 atm

#

Yeah

tender shard
#

you have to specify --rev 1.18.2

patent horizon
#

changed it to 1.18.1 but still doesnt work

tender shard
#

BUT

#

IMPORTANT

#

don't you wanna use actual NMS classes?

patent horizon
#

yes

tender shard
#

because if yes, you must use the remapped .jar

#

otherwise you'll have a very bad time

patent horizon
#

hm

wet breach
#

did you not read the post?

patent horizon
#

and how do i do that

#

i did

wet breach
#

why do people not read the post

patent horizon
#

it was a whole bunch of text

pliant oyster
#

How can I pick a random item from ItemStack array using Random(), idk how randoms work

tender shard
#

I don't know how to use remapped in gradle, I only know how to do it in maven

#

maybe choco or someone else knows

#

I can only help you when you decide to switch to maven πŸ˜›

wet breach
patent horizon
#

oh so i just throw this Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar in there?

tender shard
#

no

wet breach
#

remapped is what you are needing, but getting closer I suppose

patent horizon
#

org.spigotmc![spigot](https://cdn.discordapp.com/emojis/728421352721088542.webp?size=128 "spigot")1.18-R0.1-SNAPSHOT:jar:remapped-mojang

#

jesus discord is stupid

pliant oyster
patent horizon
#

org.spigotmc:spigot:1.18-R0.1-SNAPSHOT:jar:remapped-mojang

tender shard
# pliant oyster

player.getInventory().addItem(emeraldCrateRewards[randomItem]);

sterile token
# pliant oyster

ItemStack item = emeraldCratesRewards.get(randomItem);
if (item == null) return;
player.getInventory().addItem(item);

tender shard
primal kite
patent horizon
#

im guessing no since idk what you're talking about

ivory sleet
#

declare mavenLocal() inside repositories block

primal kite
#

in gradle.build add mavenLocal() right under mavenCentral()

patent horizon
#

still no

ivory sleet
#

1.18.2 no?

primal kite
#

1.18.2-R0.1

patent horizon
#

my buildtools is 1.18.1

primal kite
#

add the .2 to the version

ivory sleet
#

Then use 1.18.1

primal kite
#

then add .1

ivory sleet
#

Or run bt for 1.18.2 shrug

patent horizon
#

i thought thats what the -R0.1

primal kite
#

nope

ivory sleet
#

Oh that’s just, the revision which is always there

wet breach
primal kite
#

and going back to the Gradle vs Maven conversation.....

ivory sleet
#

Is completely meaningless since both work fine

primal kite
#

i know that. but i know maven so much better

#

what the shortcut to inset code?

ivory sleet
#

I know gradle so much better, but like, the choice is quite insignificant since swapping between the two doesn’t take that much effort and they pretty much achieve the equivalent

#

inset code?

primal kite
#

insert

ivory sleet
#

Idk exactly what you mean by insert code πŸ˜…

primal kite
#

the code snippets for chat

patent horizon
primal kite
patent horizon
#

wha

#

you dont need the remapped thing?

primal kite
#

This worked for me on a fresh project

brave sparrow
#

You don’t need remapped unless you’re using nms afaik

patent horizon
#

well im tryna use nms

brave sparrow
#

Then you will need it lol

#

And you’ll also need to use the thing that unmaps your code at compile time

#

Since the server won’t have stuff deobfuscated for you

patent horizon
#

thats above my gradle expertise

dire marsh
#

there is no gradle example for spigot remapping nms stuff

#

so, you are on your own there, or you use paperweight, which means you'll have to be careful to avoid using paper only methods and initial setup takes a bit longer as it downloads and applies patches

patent horizon
#

so ig it's time to switch back over to maven

#

would someone be able to show me how to shade w/ relocation in maven then?

ivory sleet
#

I mean paperweight userdev isn’t that hard to setup?

patent horizon
#

i'd rather not

dire marsh
#

well it's the same thing as spigot basically but easier, just with paper methods, just add the gradle plugin and build dependon reobfjar and done

ivory sleet
#

I mean it’s possible to remove paper api from compile time classpath

reef kindle
#

i have issue with deprecated sendMessage methods paperweight adds

#

they do not work on spigot the new net.kyori.adventure.text.Component methods kyori

#

but paperweight is soooooooooooo much better than spigot specialsource

#

it fucks all my synthetic methods

#

specialsource

dire marsh
#

just ignore those deprecations, or add the adventure api inside your plugin so you can use audiences (read their docs), or do what conclure said

reef kindle
#

but how to do that

#

remove the paper api and add spigot api

dire marsh
#

or, consider whether you need nms in the first place

reef kindle
#

i also want to avoid using paper added nms

#

no I do need nms, for nbt and setting blocks fast in palette

#

maybe i just make my plugin papermc only 😭

#

it will make everything so much easier

ivory sleet
#

As said it’s possible to remove paper api from your compile time classpath

reef kindle
#

is there a guide for this?

ivory sleet
#

Thus combining paper userdev with merely spigot

#

Well you’d need to know how to use gradle and then look at the paper userdev example I suppose

reef kindle
#

ok I will try

#

also new question, is it possible for spigot to add ItemStack#serializeAsBytes api from paper?

#

because I need nms for this now

#

it is very good api, highly recommended 10/10

patent horizon
#

oh no

#

nonono

#

that page is cursed

ivory sleet
reef kindle
#
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.4</version>
                <configuration>
                    <relocations>
                        <relocation>
                            <pattern>org.bstats</pattern>
                            <shadedPattern>com.myplugin.whatever.org.bstats</shadedPattern>
                        </relocation>
                    </relocations>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
#

there is better example @patent horizon

dire marsh
#

you could use the lucko helper thing to make itemstack serialisation

ivory sleet
patent horizon
#

yes thank u

reef kindle
#

but gradle is way better

#

and specialsource is F tier remapper

sterile token
dire marsh
reef kindle
#

i will try to use userdev with spigot, and maybe write guide

#

yes that serialization is SUPER bad

reef kindle
#

this is why I serialize with nms, bukkit serialization sucks

ivory sleet
#

It’s a bit special but it doesn’t suck

reef kindle
#

"special"

dire marsh
#

it removes things like names and enchants

reef kindle
#

in a bad way

ivory sleet
#

There’s no data loss as far as I am concerned

dire marsh
#

basically it just fails entirely for custom items

ivory sleet
#

No lol it doesn’t

#

Of course if people inject raw nbt then maybe

reef kindle
#

yes it fails for custom nbt

#

it will just delete

#

never existed

ivory sleet
#

But that’s not bukkit’s fault

dire marsh
#

Maybe it's gson specific since that's the only thing I've tried it for

reef kindle
#

raw byte api (i just copy from paper to my plugin) makes it work

ivory sleet
#

That’s because developers constantly fail to use api such as pdc api

reef kindle
#

essentialsx plugin do the same thing, this is where I find it

dire marsh
#

But I would name an item and save it, and it would just remove that

ivory sleet
#

That’s strange, hasn’t ever happened to me

reef kindle
#

i will get repro code

#

or maybe essx issue is more simple, they have good one with repro

#

maybe my and essx code is bad

dire marsh
#

ok time to sleep

ivory sleet
#

Good night

reef kindle
#

here is essx with bunch of linked issues

#

same issues I have and avoid

ivory sleet
#

jacksyyy it’s your fault alone if you use implementation such as nbt, of course normal serialization api won’t be able to recognize that, but that’s why people should use the api spigot provides such as persistent data containers. Saying that the serialization api sucks is untrue and just you in principle spreading fud.

reef kindle
#

it is not me using nbt, users input nbt items and I must serialize it

#

users can not access pdc with /give command

#

but yes, I understand

ivory sleet
#

Yes but that’s still not api, nbt implementation can change at any second thus why there’s an api abstracting over said thing

reef kindle
#

I know it is not api, this is why I use nms

ivory sleet
#

Yes the issue with item stack versions was a problem tho I’m fairly certain that has been addressed by now

reef kindle
#

oh ok, maybe I try again

#

but maybe because net.minecraft.server is not relocated anymore it is safe to use and APi πŸ‘€

#

idk

ivory sleet
#

wat

#

I mean sure I do see your point, just don’t think it’s far to say the serialization api is trash or that it sucks

reef kindle
#

yes ok, it has use

#

it is just not full serialization, you must be careful

ivory sleet
#

Myeah

#

If you deal with raw nbt

sterile token
#

Who tag me??

#

I didnt see the tag. if someone tag me just dm me

reef kindle
#

do you think spigot will ever have the kyori api? it is just question. i might break down and shade bukkit-platform

reef kindle
#

it does work, to shade

#

I am asking if there is plan to ever include in spigot, because it is much more integrated and nicer

#

net.md5.bungee.chat works but kyori is a lot nicer

sterile token
#

Ahh now i understand

#

You are wondering if Spigot api can include the Kyori api chat?

#

That what you are asking?

ivory sleet
#

Yeah jacksyy

#

Just shade

#

And possibly relocate

sterile token
#

You have to shade and relocate it

ivory sleet
#

Maybe peek at how luckperms addresses it

sterile token
#

Conclure

#

Do you use maven right?

ivory sleet
#

Both

reef kindle
#

ok so good idea. i will do that

#

so there is no plan for spigot native?

ivory sleet
#

Probably not

reef kindle
#

my plugin only support the last 2 version anyways so if it comes now I can use in 2 years

#

ok

sterile token
#

Because when im using org.maven.plugins:maven-shade-plugin it shade all dependencies. Not just the one i want

#

Its really engorrous

reef kindle
#

use scope provided

#

on the dep

#

but really gradle is nicer, just use gradle if you are already knowing

#
            <scope>provided</scope>
#

on each dep you want not shaded ^

patent horizon
#

could someone link me to the docs for this? i dont have the dependency installed

ivory sleet
#

Myeah scope provided is for compile time dependencies whilst scope compile iirc is for unprovided runtime dependencies

sterile token
#

Then i have to be like a crazy, opnening the jar with winrar and taken out the dependencies i dont want inisde the jar

sterile token
#

How wondering to dont have errors? if the dependency is not installed

#

πŸ€”

ivory sleet
#

@patent horizon

patent horizon
#

tysm

#

why would it be looking in spigot

#
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-stdlib</artifactId>
            <version>kotlin-stdlib-jdk8</version>
        </dependency>```
simple anvil
#

how do i change the blocks of a player head meta data so its a diffrent player?

patent horizon
#

something horrible happened with this version of spigot

#

and some materials are missing

#

and other things wont import correctly

#

yeah it seems like all 1.17+ items arent registered

quaint mantle
#

Is there a script or smth to generate usernames like this?

patent horizon
#

theres a thing in skript for it

quaint mantle
patent horizon
#

skript minecraft plugin

quaint mantle
#

send?

patent horizon
#

the function or the plugin

quaint mantle
#

function

patent horizon
worldly ingot
#

There's a website as well to do it with Essentials colour codes

worldly ingot
#

Unless you're trying to write one yourself

#

In which case, disregard

patent horizon
#

omg there's like multiple things in my project that worked in the other one that just cant be imported anymore

worldly ingot
simple anvil
#
public void onPlayerQuit(PlayerQuitEvent event) {
    event.setCancelled(true);
}
quaint mantle
#

would that actually work LMAO

simple anvil
#

definitely

quaint mantle
#

totally

patent horizon
#

would anyone know why certain things wont import?

#

im running 1.18 nms build

simple anvil
#

same and it works for me

patent horizon
#

wdym

lime jolt
#

anyone know hot to color code your messages when you message a Player

upper crater
#

.... was literally about to ask that^^^ I need help too
I looked it up and they told me to do ChatColor.RED + "message here" but for some reason that seems to return An internal Error occurred while attempting to perform this command

river oracle
upper crater
#

I did that, but I'm getting an internal error occurred....

river oracle
#

Also I reccomend using ChatColor#translateColorCodes or something along those lines

river oracle
upper crater
#

oh shoot... i was looking at mineacraft chat, not server logs

river oracle
#

Also use Google :P

upper crater
#

i did

#

then joined here once i saw this server existed

#

Caused by: java.lang.ClassNotFoundException: net.md_5.bungee.api.ChatColor
this is the error

#

is that the wrong import

river oracle
#

What I've never seen that error before lol. Anyways I reccomend using chatcolor that isnt md5s api

#

Yea wrong import

upper crater
#

org.bukkit.ChatColor right

river oracle
#

Yea

#

If your using 1.16 plus you can do hex too

brave sparrow
#

That import should work

upper crater
#

i'm doing 1.18.2

brave sparrow
#

What kind of server are you running @upper crater

upper crater
#

craftbukkit 1.18.2

river oracle
#

There's your issue

#

You need to be running spigot

#

Or alternatively something like paper

brave sparrow
#

If you want to use the md5 chat

upper crater
#

oh

brave sparrow
#

If you want to stick with craftbukkit then just use org.bukkit

river oracle
#

I didn't even know people still used craft bukkit

upper crater
#

i had searched it up and the first tutorial that worked used craft bukkit

brave sparrow
#

Spigot has the md5 stuff so I figured it had to be

upper crater
river oracle
#

I always forget craft bukkit exists

upper crater
#

lol i'm using spigotmc in pom.xml

#

if you're wondering, i was using the tutorial on bukkit's fandom

eternal oxide
#

depend on spigot-api not craftbucket

brave sparrow
#

But the server is craftbukkit

#

So they got an error using a spigot dependency that CB doesn’t have

eternal oxide
#

ah, no one shoudl be using CB these days

fossil lily
brave sparrow
#

?paste

undone axleBOT
fossil lily
brave sparrow
#

Looks like a deadlock of some kind

upper crater
#

i dont'r emember how i installed craft bukkit...
i assume that for spigot i just install the server.jar from the website and java -jar it and it will make the entire server?

fossil lily
river oracle
undone axleBOT
brave sparrow
# fossil lily *Whats that*

In concurrent computing, deadlock is any situation in which no member of some group of entities can proceed because each waits for another member, including itself, to take action, such as sending a message or, more commonly, releasing a lock. Deadlocks are a common problem in multiprocessing systems, parallel computing, and distributed systems,...

upper crater
#

my server crashed because i was making a deathswap plugin that would tp me 10000 blocks away from spawn

fossil lily
#

This happened right after I cleared my github cache

brave sparrow
#

Unrelated

fossil lily
#

k

#

Maven package clean fixed it

brave sparrow
#

Unlikely

fossil lily
#

idk lol

brave sparrow
#

If it’s a deadlock it’s likely not something you can reliably reproduce

#

It’ll just randomly happen when the right set of circumstances occur

upper crater
brave sparrow
#

It’s a poorly designed concurrent system and there’s a specific set of conditions that cause a deadlock

fossil lily
#

Hm

brave sparrow
#

It has nothing to do with a dependency in your maven

#

It’s not a compile error

#

It’s a runtime issue

fossil lily
#

Thanks for the explanation

#

I reproduced it 3 times

#

But I fixed it now

brave sparrow
#

Mk

fossil lily
#

Okay, its happening again. It seems to be originating here: Since its awaiting ready, and it never gets ready, it gets a "deadlock"

config.yml looks like that

wet breach
#

but related

fossil lily
#

I have no idea what the problem is

brave sparrow
#

It’s trying to avoid a deadlock by timing out

#

But technically

wet breach
#

^

brave sparrow
#

That is still a deadlock

#

Lol

#

Unless it’s timing out for an unrelated reason

wet breach
#

basically it is timing out because it couldn't get a lock on a resource or thread

#

in a specified time period

brave sparrow
#

My best guess is that two threads are dead locking and one is just killing itself

#

But I guess if there’s severe resource starvation it could be that

fossil lily
#

How does this config call create a deadlock?

wet breach
brave sparrow
#

It looks like you’re using a third party dependency and they’re probably doing something shitty

fossil lily
#

Yes

brave sparrow
#

Lol

fossil lily
#

Aight il ask them

wet breach
#

ok so I have seen this before with discord bot

fossil lily
#

Thanks

wet breach
#

Essentially this can happen when using an incorrect token

#

and the bot shuts down when you are trying to login

fossil lily
eternal oxide
#

sysout the token you are getting from teh config. make sure it's what you are expecting.

wet breach
#

what you pasted and how you are retrieving are two separate things

brave sparrow
#

Lol

wet breach
#

JDA

brave sparrow
#

β€œOh the login failed, guess I’ll just hold this lock forever then”

#

Genius

wet breach
#

lol

brave sparrow
#

Great way to indicate invalid credentials

wet breach
#

yeah, basically your intuition is spot on tonight πŸ˜›

fossil lily
brave sparrow
wet breach
#

lol

brave sparrow
#

Either there’s a deadlock or they’ve done something shitty

fossil lily
#

Now its showing this

wet breach
#

better then the lock

brave sparrow
fossil lily
#

yAS

wet breach
#

just use a more sane discord lib πŸ˜›

brave sparrow
#

Classic example of someone going β€œooo threads” and just chucking them in without a clue as to what they’ve done

#

If I saw that shit I’d be running away from that library as fast as my legs can carry me

#

You know there has to be more less-visible crap just waiting to bite you in the ass

fossil lily
#

Lots of people use it

wet breach
#

I know what you are using

#

just because there is a lot of people who use it, doesn't make it the best

fossil lily
#

eh

#

What would you recommend?

#

Discord4j?

#

Those are the only 2 I know of

wet breach
#

a decent lib where you don't need to interact with JDA yourself

lavish hemlock
#

Yeah there's like only JDA and Discord4j and JDA has more support

wet breach
#

is DiscordSRV

fossil lily
#

I wanted to make my own

#

I was using that

#

But I thought it would be fun πŸ₯²

wet breach
#

You could just make your own lib don't necessarily need JDA or Discord4J

fossil lily
#

Im too noobish

wet breach
#

all you need to know is the endpoints

brave sparrow
#

Lmao

fossil lily
#

xd

wet breach
#

but you can use DiscordSRV to make a very customized bot though

#

without much effort

fossil lily
#

I want to feel accomplished

wet breach
#

well discord doesn't hide the endpoints or the documentation

#

although their documentation can be a bit vague at times

fossil lily
#

Sorta Offtopic: Is there a ratelimit to resetting discord tokens? I had to do it like 7 times in a row rn and now its saying its invalid.

brave sparrow
fossil lily
#

dont ask

brave sparrow
fossil lily
#

Ah okayh

#

Il wait like 30 mins

wet breach
# brave sparrow Do they have swaggerdocs?

Not that I am aware of, they could by now. But esssentially everything is listed on the left hand side and then you have to go through to see which you want and then it has documentation on the right supposedly explaining stuff

#

which for the most part it does, it is just when you get into something specific that it starts to not really answer anything XD

brave sparrow
#

Darn

#

I have a lovely little tool I wrote to turn swaggerdocs into a Java API

wet breach
#

oh that is handy

brave sparrow
#

And vice versa

#

So Java API -> Swaggerdocs -> Java API

wet breach
#

but because of discord not quite documenting things in a fashion that explains when you should do something or watch out for something we have libs like JDA doing crazy things

brave sparrow
#

Lovely

wet breach
#

for instance, removing messages applies to the rate limit of the discord server just like messages being sent to it do

#

but this isn't really explained

brave sparrow
#

Amazing

wet breach
#

yeah I hate the Discord API if you could call it that

fossil lily
#

at least it has an api

brave sparrow
#

Sounds like they did the very bare minimum to call it an API and went

#

β€œOk good enough”

wet breach
#

Also, it doesn't explain that half the permissions are client side as well, so you might think your channel being hidden can't be seen, really can be seen. Now fortunately while although you could still see a channel, you can't see inside it without the appropriate perm which is the other half from the server πŸ˜›

brave sparrow
#

The modded discords could see people so they changed it

wet breach
#

used to yeah, but like its stuff like that, where it isn't really documented to point out to you

#

it is just something you either know or someone tells you or you get in a situation where you magically figure it out

#

I am just surprised Discord has managed to continue XD

#

even with a half baked API lol, reminds me of one of those older protocol API stuff really

#

SOAP

brave sparrow
#

Lol

wet breach
#

that is what it reminds me of

upper crater
#

from buildtools, where do i find the server.jar

wet breach
#

should be in the same directory as buildtools

upper crater
#

is it spigot-version.jar?

#

yes it is

lime jolt
#

anyone know how to spawn a chest in with specific items inside (that are located in a specific spot in the chest)

amber marsh
#

is if (sender instanceof CommandBlock) right?

sharp flare
amber marsh
high pewter
#

Not sure if this is the right place to ask but I'm making a tool using Spiget (API for viewing Spigot resources) but it doesn't seem to return the resource URL with the resource details. Is it safe to assume all resource URLs can just be https://spigotmc.org/resources/RESOURCE_ID_HERE ? If not, how should I go about producing the resource URL with the details given by Spiget?

upper crater
#

how can i post images? I got an error that crashes the server when trying to use ChatColor

#

actually nvm```
[22:36:58 ERROR]: java.base@17.0.2/java.util.regex.Pattern$GroupHead.match(Pattern.java:4789)
[22:36:58 ERROR]: java.base@17.0.2/java.util.regex.Pattern$GroupHead.match(Pattern.java:4789)
[22:36:58 ERROR]: java.base@17.0.2/java.util.regex.Pattern$Branch.match(Pattern.java:4734)
[22:36:58 ERROR]: java.base@17.0.2/java.util.regex.Pattern$GroupHead.match(Pattern.java:4789)
[22:36:58 ERROR]: java.base@17.0.2/java.util.regex.Pattern$Branch.match(Pattern.java:4734)
[22:36:58 ERROR]: java.base@17.0.2/java.util.regex.Pattern$StartS.match(Pattern.java:3641)
[22:36:58 ERROR]: java.base@17.0.2/java.util.regex.Matcher.search(Matcher.java:1728)
[22:36:58 ERROR]: java.base@17.0.2/java.util.regex.Matcher.find(Matcher.java:745)
[22:36:58 ERROR]: org.bukkit.craftbukkit.v1_18_R2.util.CraftChatMessage$StringMessage.<init>(CraftChatMessage.java:70)
[22:36:58 ERROR]: org.bukkit.craftbukkit.v1_18_R2.util.CraftChatMessage.fromString(CraftChatMessage.java:180)
[22:36:58 ERROR]: org.bukkit.craftbukkit.v1_18_R2.util.CraftChatMessage.fromString(CraftChatMessage.java:176)
[22:36:58 ERROR]: org.bukkit.craftbukkit.v1_18_R2.util.CraftChatMessage.fromStringOrNull(CraftChatMessage.java:168)
[22:36:58 ERROR]: org.bukkit.craftbukkit.v1_18_R2.util.CraftChatMessage.fromStringOrNull(CraftChatMessage.java:164)
[22:36:58 ERROR]: org.bukkit.craftbukkit.v1_18_R2.entity.CraftPlayer.sendTitle(CraftPlayer.java:1689)
[22:36:58 ERROR]: com.gmail.groupid.DeathSwapPlugin.DeathSwapPlugin.startDeathSwap(DeathSwapPlugin.java:111)
[22:36:58 ERROR]: com.gmail.groupid.DeathSwapPlugin.DeathSwapPlugin.onCommand(DeathSwapPlugin.java:50)

#

please help

vocal cloud
#

?paste errors in pastebin to format them better

undone axleBOT
kind hatch
upper crater
#

that's the first error

earnest forum
#

theres no error there

#

it doesnt say what error it is

upper crater
#

I use the command, the connection to server freezes but i can move around like normal... (nothing else but awsd)

#

where would the error be (i'm currently looking through)

kind hatch
# upper crater

That usually happens when the server is crashing. Are you sure it's your plugin that's causing it? What other plugins do you have installed? Also, how much ram are you dedicating to the server?

upper crater
#

that is the only plugin and it's the only one that pops up in the stack
idk how much ram.... i'm running it on my computer though

kind hatch
#

Can you share your code for the command class?

wet breach
#

if it is their plugin which I assume it is since they mark out their email, odds are they have a memory leak

kind hatch
wet breach
#

you can run mc with 1GB of ram, generally recommended to have 2GB minimum though

upper crater
#
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
    Player player;
    if (sender instanceof Player) {
        player = (Player) sender;
    } else {
        sender.sendMessage(ChatColor.RED + "You are not a Player.");
        return true;
    }
    if (cmd.getName().equalsIgnoreCase("dsstart")) {
        if (this.shouldSwap) {
            sender.sendMessage(ChatColor.RED + "Death Swap has already started");
        } else {
            if (sender.hasPermission("DSPlugin.default")) {
                this.shouldSwap = true;
                this.startDeathSwap(player.getWorld());
            } else {
                sender.sendMessage(ChatColor.RED + "You don't have the permissions needed.");
            }
        }
        return true;
    }
    return false;
}
public void startDeathSwap(World world) {
    List<Player> players = world.getPlayers();

    this.sinceStart.reset();
    this.sinceStart.start();
    this.sinceSwap.reset();
    this.sinceSwap.start();
    
    Random random = new Random();
    
    for (Player player: players) {
        player.resetTitle();
        String subTitle = ChatColor.GREEN + sinceStart.toString() + ChatColor.RED + " | " + ChatColor.BLUE + this.sinceSwap.toString();
        player.sendTitle("DeathSwap Started", subTitle, 10, 70, 20);
    }
    
    while (this.shouldSwap) {
        players = world.getPlayers();
        for (Player player: players) {
            player.resetTitle();
            String subTitle = ChatColor.GREEN + sinceStart.toString() + ChatColor.RED + " | " + ChatColor.BLUE + this.sinceSwap.toString();
            player.sendTitle("", subTitle, 10, 70, 20);
        }
    }
}
```I'm using StopWatch from `org.apache.common.lang3.time`
wet breach
#

however, I think this is a case of memory leak though unless they are doing something to tip off watchdog

upper crater
#

oops sorry for wall

kind hatch
#

That's why, while loop

wet breach
upper crater
#

what do i do to fix

kind hatch
#

Update the value for the while loop inside it somehow.

upper crater
#

wdym

misty ingot
#
[10:28:37 WARN]: java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
[10:28:37 WARN]:     at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
[10:28:37 WARN]:     at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
[10:28:37 WARN]:     at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:828)
[10:28:37 WARN]:     at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:448)
[10:28:37 WARN]:     at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:241)
[10:28:37 WARN]:     at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:198)
[10:28:37 WARN]:     at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:681)
[10:28:37 WARN]:     at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:229)
[10:28:37 WARN]:     at UtilsPlus-1.0.jar//com.wonkypigs.utilsplus.UtilsPlus.mySqlSetup(UtilsPlus.java:64)
[10:28:37 WARN]:     at UtilsPlus-1.0.jar//com.wonkypigs.utilsplus.UtilsPlus.onEnable(UtilsPlus.java:26)
[10:28:37 WARN]:     at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264)
[10:28:37 WARN]:     at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370)
[10:28:37 WARN]:     at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:501)
[10:28:37 WARN]:     at org.bukkit.craftbukkit.v1_18_R1.CraftServer.enablePlugin(CraftServer.java:562)
[10:28:37 WARN]:     at org.bukkit.craftbukkit.v1_18_R1.CraftServer.enablePlugins(CraftServer.java:476)
[10:28:37 WARN]:     at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:736)
[10:28:37 WARN]:     at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:503)
[10:28:37 WARN]:     at net.minecraft.server.dedicated.DedicatedServer.e(DedicatedServer.java:313)
[10:28:37 WARN]:     at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1211)
[10:28:37 WARN]:     at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:317)
[10:28:37 WARN]:     at java.base/java.lang.Thread.run(Thread.java:833)

anyone know why this is happening? the database information is correct in the code

upbeat tiger
#

?stash

undone axleBOT
kind hatch
# upper crater wdym

So, you know that while loops run forever if the value that you put in is true? You need to update that same value inside the loop somehow in order to change it's value so that you don't make an infinite loop.

wet breach
kind hatch
#

It's up to you how you do it, but you can't just expect a while loop to change it's check on its own.

upper crater
wet breach
#

you are better of using tasks for this

wet breach
#

then you are with some while loop

kind hatch
#

You could use a runnable.

wet breach
#

especially if you don't know how to stop a while loop lmao

kind hatch
#

Also, your command will never run to stop the while loop as long as the while loop is running.

upper crater
#

hm

#

gonna look into tasks then

wet breach
kind hatch
#

Code is executed in order. So if you are in a while loop, then run a command. The while loop needs to finish first.

wet breach
#

I recommend using tasks for this however

upper crater
#

what about asynchronous

#

not sure if that would work

upper crater
wet breach
#

with tasks you can run once off tasks which would seem more appropriate

#

then some while loop

misty ingot
#

setConnection(DriverManager.getConnection("jdbc:mysql://" + host + ":" + port + "/" + database, username, password));
I did this right, right?

kind hatch
#

There's multiple ways to make a task that repeats every second. Runnables, Timers, etc, but a while loop is used very rarely.

misty ingot
#
        host = getConfig().getString("database.host");
        port = getConfig().getInt("database.port");
        database = getConfig().getString("database.database");
        username = getConfig().getString("database.username");
        password = getConfig().getString("database.password");
        table = getConfig().getString("database.table");
wet breach
misty ingot
#

I have it so I can change info in config

misty ingot
#

I changed it to 127.0.0.1 in config and it still shows the same error

wet breach
#

but the issue as I pointed out is specifically the host name being localhost after the @

misty ingot
#

yeah I changed it

#

same error

#

localhost didnt change in the error

wet breach
misty ingot
#

I dont have much experience with using xampp, could you tell me how I could enable it?

wet breach
#

if it isn't, I recommend logging into the DB manually

#

and checkout the user table

#

see what you have there

wet breach
#

consult the documentation, it is why these software have one usually

misty ingot
#

uhhh I have the mysql module turned on

wet breach
#

but, either you have root login disabled, which means never set one up, in which case you need to run the mysql command

#

recommend using a console to log into the DB

#

generally xampp installs a mysql DB tool

#

for you to do so

misty ingot
wet breach
#

also recommend doing some more research on the things you are using as well

#

or learning how to use them

#

otherwise you are just going to constantly encounter problems as well as use bad practices

#

IE using root for the DB

#

should never do that, should instead setup a user with the minimum privileges necessary for it

low temple
#

On the 1.18 version of Paper PlayerDeathEvent#getDeathMessage() is deprecated. What would be the correct way to retrieve the string of the death message? I tried looking into PlayerDeathEvent#deathMessage() but couldnt find a way to convert the Component Object to the death message string. This is the same with Player#getDisplayName()

kind hatch
#

It's not deprecated in Spigot.

wet breach
low temple
#

It is in Paper

#

Oh sorry

vale ember
#

is there a way to listen to every spigot event and call other method with the event as an argument, without create event handler for each event?

eternal oxide
#

that would be pointless

#

just implement the events where you need them

vale ember
#

well, i want to convert the spigot's event system to guava's EventBus (don't ask why)

eternal oxide
#

The main issue with yoru idea is that not all Spigot events can be listened to

vale ember
#

yeah. i know that

#

but what's the issue here?

eternal oxide
#

you would have to list the events you want to forward

vale ember
#

all the events that have "getHandlerList" method?

#

via reflection ig

eternal oxide
#

yes

warm trout
#

Any idea on how to make a mob pathfind towards an ore? the default methods are kinda shit, if there's something in the way or its just above it, it will register as done

vale ember
#

the problem is, how would i register a listener for event which i have only a Class<? extends Event> instance

vale ember
#

yeah, but what method should i put in Listener if i have a Class<? extends Event> and what is EventExecutor?

eternal oxide
#

teh actual event class

vale ember
#

you mean

class EventListener implements Listener {
  @EventHandler
  public void onEvent(PlayerQuitEvent /*For Example*/ event) {
     /*...*/
  }
}
```?
wet breach
vale ember
#

cuz in this case i would still have to create handler manually for each event which i want to avoid

eternal oxide
#

Sorry I was remembering registering events not listeners

#

I did see some code a few months back about hooking into all events

#

If I can just remember why it was being done

vale ember
#

i think it is possible to register event listener directly into the HandlerList but i didn't get how RegisteredListener is created because the method in JavaPluginLoader is complete mess

granite owl
#

can i inherit the base class of minecraft items server sided build them up from scratch(e.g build my own custom sword not inherited from wooden_sword but from like the base class and build it up from there)

#

and send the clients packages of the item being "vanilla"

rough drift
#

no you cannot

granite owl
#

to create actual new items

rough drift
#

you have to have an item that the client already knows, and then add a texture and custom behavior to it yourself

granite owl
#

yea thats what ive done

#

but then i also have to deal with the pesky task of nulling its vanilla behavior

#

and as time progresses

rough drift
#

use a... stick

granite owl
#

more features might get added

rough drift
#

no wait

#

poisonous potato

#

and cancel eating

granite owl
#

i also wanna use the rightclick cooldown thing tho

#

interactevent

#

since items can have cooldowns