#help-archived

1 messages · Page 172 of 1

keen compass
#

Yes

#

players are "spawned" when they log in

wheat mirage
#

Well yes, but you can see why you continuously saying "spawn location" could be misleading

keen compass
#

that is why when you teleport the respawn packet is used

#

because the server really does remove them from the world and then respawns them

#

Well I am not talking to everyone else, you are understanding what I am referring to

wheat mirage
#

I didn't until I realised you meant the players stored location while offline

#

and not their spawn point

keen compass
#

well just about everything with the player you can get while they are offline

wheat mirage
#

Could you point to where in OfflinePlayer that is possible?

#

As far as I can tell OfflinePlayer#getPlayer gets a Player instance if they are online

#

But has no inventory related methods

#

Also, getting is different to modification

#

From what I can tell, basically 90% of what you've said is wrong.

sturdy oar
#

why the hell if i execute /kill @a , the event is EntityDamageByBlock

#

is it because command block

wheat mirage
#

@sturdy oar Probably, yeah.

#

@sturdy oar EntityDamageEvent should still fire though perhaps, or at the very least death events

keen compass
#

@wheat mirage you can cast OfflinePlayer to HumanEntity for the inventory stuff if necessary. Can even technically cast to Player as well. Not all methods actually require a player to be spawned in or Entity. They can merely exist in memory without being present physically. Anyways, thought there was method for the last location, what you could do instead is just look at the PlayerDat file

wheat mirage
#

@keen compass You can't cast OfflinePlayer to human entity

#

Player extends the HumanEntity interface

#

Not OfflinePlayer

#

Player extends OfflinePlayer

#

Why are you giving out advice you're not even sure is correct?

keen compass
#

Cast to Player and then to HumanEntity

wheat mirage
#

Not if they're OFFLINE.

#

jesus christ

#

Revise your spigot knowledge

keen compass
#

since you are not spawning them in, you don't need their gameprofile o.O

subtle blade
#

Nah, none of the HumanEntity stuff is accessible from an offline player

#

Two separate entity trees

keen compass
#

Not directly

subtle blade
#

Only way you'll get a Player instance is if the player is online PES_SadShrug

wheat mirage
#

What are you talking @keen compass

#

Just look at the code my man

fringe cairn
#

if I check if an OfflinePlayer is online and they are, can I just cast it to Player or do I need to use getPlayer(OfflinePlayer.getUniqueId())

keen compass
#

yes

wheat mirage
#

You can also just do OfflinePlayer#getPlayer @fringe cairn

#

Basically does what you've just said tbh

keen compass
#

^

subtle blade
#

Which is just a cast, but yes

fringe cairn
#

what does offlinePlayer.getPlayer do if player is offline

subtle blade
#

Returns null

fringe cairn
#

oh okay so no difference than casting?

#

performance wise the same?

wheat mirage
#

I'm not sure

subtle blade
#

Well a cast would give you a CCE

wheat mirage
#

I think it's a different object

subtle blade
#

You're best to use OfflinePlayer#getPlayer() in this situation

wheat mirage
#

Yeah what Choco said

fringe cairn
#

okay

keen compass
#

Anyways, you can use the playerdat file to modify their last saved location

wheat mirage
#

Here you may want to use that to learn the spigot api

keen compass
#

I know it

wheat mirage
#

Clearly not very well

subtle blade
#

Would be nice to shift the last location into OfflinePlayer though

keen compass
#

not hard to do

fringe cairn
#

and I it wont produce a null pointer unless player is offline?

subtle blade
#

Nah, would just require some deprecation and a different name

wheat mirage
#

@subtle blade Would require editing of the player.dat file for changes. I reckon that's more trouble for md_5 than it's worth

keen compass
#

its just NBT data

wheat mirage
#

I agree it would be good though

fringe cairn
#

because intelliJ is yelling at me bc it thinks itll produce null pointer even though it already checks if player is online and only runs if they are

wheat mirage
#

@fringe cairn IntelliJ can't infer if a null pointer won't occur

#

It will always give that warning if a method can return null

#

And you've not directly checked

#

You can always supress warnings on certain functions etc

keen compass
#

But like I said, not all methods of a player object, actually requires a game profile though. Therefore you can technically create a player object without there being a valid player to facilitate some of these things.

fringe cairn
#

how do you suppress warning with intelliJ?

wheat mirage
#

@keen compass just quit.

keen compass
#

Oh you can't create player objects? o.O

#

because nothing says you can't XD

wheat mirage
#

@fringe cairn There's an annotation, I think @SupressWarnings

#

You can give it a certain type

#

@keen compass That would be useless, as it won't actually connect to any relevant player data most likely.

#

And would cause huge issues if that player actually logs in I wager

keen compass
#

are you certain of that?

wheat mirage
#

No, but I'm certain you're either trolling or have no clue what you're talking about

#

As you've changed your stance 10 different times acting like you're correct all along

#

You're clearly not educated enough to help anyone having anything more than basic issues, and you're costing people more time than you're saving

#

fin

red zenith
#

Never heard of the Citizens plugin? Pretty sure it does some of the things that you’re refuting

keen compass
#

If you choose to believe its not possible

#

that is on you

wheat mirage
#

@red zenith not the same thing, AT. ALL.

#

Please can all members of the frost clan go to some other discord to spread mis-information.

#

Pinging @subtle blade as I've had my differences with him, but he knows his stuff.

#

I don't know if there's anything to be done about people spreading mis-information in here, but it's definitely not good for quality of this discord

keen compass
#

Are you saying it is impossible to create player objects without a player?

#

o.O

wheat mirage
#

No, stop strawmanning

keen compass
#

Are you saying it is impossible to get an offline players inventory?

wheat mirage
#

Leave me alone, you're wrong, move on, educate yourself

#

You've been wrong about literally almost everything you've said

keen compass
#

I am not, I have done it and there is plugins that do it as well

wheat mirage
#

Stop trolling

keen compass
#

ever since 1.7

wheat mirage
#

Leave me alone.

keen compass
#

Now for the last location thing, probably will either need to look at the playerdat file or just create a player object to facilitate that

#

one of the two will work

#

As for your event to solve that, will need a task so that the event completes and not get that Ticking Entity Exception

red zenith
#

Right, comrade, how’s the weather in Москва? I think you’re just another self obsessed troll, trying to exert yourself in a toxic, divisive way @wheat mirage. I wouldn’t care if you created the Java language.

keen compass
#

That took you a while to say XD

#

unless discord is being dumb again

red zenith
#

It did, but I find typing on a phone to be cumbersome

tough kraken
#

@wheat mirage it actually is possible to get offline inventories, idk how, but i saw it on the youtuber's "Varo" projects, where they got invcleared while offline. so dont tell stuff if you dont know it exactly

frigid ember
#

does OfflinePlayer#getPlayer() not work

tough kraken
#

it will probably return null, but idk

frigid ember
#

oh yea

#

they have to be online

tough kraken
#

i think its maybe possible with saving them somehow if they go offline, but idk

keen compass
#

There is a few different ways to do it @tough kraken

sturdy oar
#

I'm so sad, they removed the feature to make someone sleep anywhere with packets on newer versions

tough kraken
#

😦

sturdy oar
#

I've been told this twice in ViaVersion discord, after having noticed that I couldn't replicate 1.8 sleep packets on newer versions

#

just wanted to share this info with you all

tough kraken
#

why does this actually need about 1-2 seconds to get recogniced as "not moving"?

#

Fendi

sturdy oar
#

?paste

worldly heathBOT
tough kraken
#

didnt knew that, ty

sturdy oar
#

dude use a switch smh

frigid ember
#

i got a question, if i ban-ip someone. what ip does it ban.??

wheat mirage
#

@sturdy oar Really? Why would they do that? 😦 That was my favourite packet

subtle blade
#

because of your interval. You have it set to check every second

#

Also, don't switch at all. Use some basic logic

tough kraken
#

because of your interval. You have it set to check every second
@subtle blade isnt it?

sturdy oar
#

@sturdy oar Really? Why would they do that? 😦 That was my favourite packet
@wheat mirage They didn't remove the packet, you now set that in the metadata packet

wet bronze
#

I'll wait on posting my issue until you guys are done

wheat mirage
#

@sturdy oar Your second msg got removed

#

So you can still do it?

tough kraken
#

the interval is actually at 20ticks

wheat mirage
#

But it has to be done as a part of a much larger packet

sturdy oar
#

The bed packet now got deleted, you now have to set the entity status in the entity metadata packet

#

and it looks real bad tbh

wheat mirage
#

How you mean?

#

Very interested in this situation

sturdy oar
#

I've been unable to make someone sleep on NON-BED locations, so they probably blocking this

stoic shell
#

Yay!

#

Thanks for all your help everyone. I got the game completely functional now!

wheat mirage
#

@sturdy oar but that was actually a pretty cool feature.

tough kraken
#

congrats 🙂

sturdy oar
#

As you see, i'm setting the POSE from the DataWatcher

wheat mirage
#

I can't think of a reason for doing that other than to prevent players accidentally seeing playerrs as sleeping

stoic shell
#

hmm

sturdy oar
#

which sets correctly, however after having sent a metadata packet to nearby players, I don't see the entity sleeping

#

I'll try one more thing

stoic shell
#

I can put this on a private GitHub repo, right?

wheat mirage
#

@sturdy oar Try removing the player move packet after

#

The move packet may auto cancel sleeping on the client now

#

Or something

#

@tough kraken What the hell is going on with those ifs

sturdy oar
#

I'll try , however i don't really think that's the issue.

wheat mirage
#

@sturdy oar Just a thought, but the other option is it's just disabled now lol

#

So wishful thinking

#

Do you have another idea?

frigid ember
#

?paste

worldly heathBOT
sturdy oar
#

idea for what

wheat mirage
#

Why it isn't working

wet bronze
#

K can I post my issue now?

wheat mirage
#

Always @wet bronze 🙂

tough kraken
#

@tough kraken What the hell is going on with those ifs
@wheat mirage maybe im dumb, but whats the difference between if's and case's in my code?

sturdy oar
#

I have no idea why it's working, i think the client now checks if the sleeping packet is in an actual valid sleep location , otherwise it doesn't display

#

I'll check my incoming packets to see if i actually receieve it

wheat mirage
#

All your ifs are doing the same thing @tough kraken

forest plaza
#

@sturdy oar is a bed nearby?

wheat mirage
#

This is horrible coding practice

wet bronze
#

There is something on my server breaking Movecraft and I have verified that it’s not Movecraft’s fault due to the fact that it works perfectly fine on other servers and that the developer has updated it and it still has the same glitch.

wheat mirage
#

@sturdy oar Try without the move and lmk what happens

sturdy oar
#

no @forest plaza, the thing is that there should be no bed involved in this

forest plaza
#

I read that there has to be a bed, try it

wet bronze
#

The plugin loads fine, but it has a major glitch

sturdy oar
#

the thing is that it's not useful anymore if i need a bed

forest plaza
#

That’s why it’s not working anymore afaik

sturdy oar
#

the cool thing about PacketPlayOutBed was that you didn't need a bed

wheat mirage
#

@forest plaza No the whole point is we want it to display with nobed

forest plaza
#

I know

#

But I think I that’s why

tough kraken
#

its anyway not fixing my problem i think

forest plaza
#

He could test it, if it works, he at least knows why it doesn’t work

wheat mirage
#

@tough kraken Do yourself a favour and learn good coding practices. You're using 20 lines for what could be done in 2

#

You'll save so much time and stress in the long run

#

And you'll be infinitely more hireable

stoic shell
#

Can I put the code of the updated plugin on a private GitHub?

sturdy oar
#

nobody sees your private stuff anyway

frigid ember
tough kraken
#

i am nowhere coding for anyone else, i am coding for my own server, and my public plugin thats for free, i dont even want to code for anyone so in my opinion if something works it works...then i see no cause to change it.

maybe a weird point of view but idk

#

i actually see your point, but i think i have different sight of that

sturdy oar
#

if it works it works is not a good thing

#

i would be doing a loop from 1 to 1000 by writing 1000 lines of code, just because it works, is not a good idea

tough kraken
#

so just tell me, why should i do anything other because of "its the better way" if it works the same way? idk

#

yeah 1000 is a big difference, but that if thing costed me 2 minutes so idk

forest plaza
#

Performance and readability

#

You may come back later and want to add something, a good Code base is a first step

tough kraken
#

i am the only person that reads my code (i hope so) and i can understand all

#

never really had problems read my code

sturdy oar
#

I mean, I document private repositories 🤷‍♂️

forest plaza
#

Told myself that way too often

tough kraken
#

i dont really think we will get to the same point so,

does anyone know my problem anyway?
i am checking the moving every second

forest plaza
#

Did you send it somewhere further up?

tough kraken
#

?paste

worldly heathBOT
tough kraken
wheat mirage
#

VNGC, please don't be an idiot

#

People are giving you advice to save you time

tough kraken
#

that my codes are bad to see for others is possible, but i can understand my code

wheat mirage
#

not cost you it

keen compass
forest plaza
#

Wow, did you know you can cast integers to strings?

#

What’s not working?

tough kraken
#

it does, it takes my time for learning stuff i dont need (in my opinion!!) so i am only learning stuff i need for myself

wheat mirage
#
notMoving.put(player.getName(), currentTime);
TimerClass.moveTime = currentTime;```
tough kraken
#

i am checking if someone is moving or not

wheat mirage
#

Because that's your entire line 14 to line 41

#

In 3 fucking lines

forest plaza
#

But I don’t understand what’s not working

wheat mirage
#

I'm trying to save YOU time and stress.

tough kraken
#

if it is moving, it gets marked as "10"

but it needs nearly 4 seconds to change to "9"

wheat mirage
#

You're being ignorant

keen compass
#

using if blocks isn't any less valid

tough kraken
#

we won't get to the same point

wheat mirage
#

Updated do-not-listen-to list of #help-archived:

  • Frostalf
  • VNGC
  • frost-byte
tough kraken
#

so what should i say wtf

wheat mirage
#

@subtle blade May want to pin this

tough kraken
#

lmao

keen compass
#

@wheat mirage if blocks are most of the time faster speed wise, however reduces readability

wheat mirage
#

LOL WHAT

#

You're such an idiot

#

You must be trolling

keen compass
#

Want to prove it?

forest plaza
#

if it is moving, it gets marked as "10"

but it needs nearly 4 seconds to change to "9"
@tough kraken are you calling this in the player move event?

wheat mirage
tough kraken
#

nah, its on starting my timer

keen compass
#

its like when using bitshifting that it is faster to use a bitshift then it is to have the JVM do some math, again readability is reduced

forest plaza
#

The formatting is a little weird

wheat mirage
#

@tough kraken lastLocation only ever gets updated if they're not already in the list

#

You need to update each cycle

#

Also, I'm trying to help YOU save time and effort

#

With my advice

#

I have no other motive

tough kraken
#

i know that, and i appreciate it

#

but we have different pov's

wheat mirage
#

VNGC, this is pretty objective as far as coding goes

#

I'd recommend maybe making a post on stackoverflow asking why your code is being called bad quality

#

They'll explain it far more eloquently than me

#

It's always worth the effort to learn

tough kraken
#

i know why my code is called bad quality

#

said about 4 times

wheat mirage
#

Yes but you're costing yourself more time and hassle by not learning

#

and I can't understand that

tough kraken
#

2-minutes, yeah i see

forest plaza
#

Aren’t you coding to have fun? For me the fun comes from learning and writing code as clean as possible

wheat mirage
#

Yes, but it's a more extensible concept

#

If every code you write could be done 2 minute shorter

#

you'll save hours

#

days

#

weeks

#

In the long run

#

And debugging will be 10x faster

#

Changing something will be 10x faster

#

I speak from experience here

#

I once wrote code like yours

#

It's not a preference, it's an objectively bad choice.

forest plaza
#

And debugging will be 10x faster
This right here especially

#

Lol

wet bronze
#

There is something on my server breaking Movecraft and I have verified that it’s not Movecraft’s fault due to the fact that it works perfectly fine on other servers and that the developer has updated it and it still has the same glitch.
https://pastebin.com/aNLpB1EY
Can anybody help me with this?

wheat mirage
#

@wet bronze What spigot are you running

#

Is it the latest build

#

Aka does your server startup without a 20s delay

#

From what I can tell that plugin has a bug with 1.16

wet bronze
#

PaperMC because it's optimized for 1.16

wheat mirage
#

I'd contact the plugin author

#

And try it with regular spigot

#

just to see

wet bronze
#

I have

wheat mirage
#

Yeah?

wet bronze
#

Yeah it's not a problem with movecraft

#

They've updated the plugin 2 times

wheat mirage
#

Give it a try on vanilla spigot

subtle blade
#

PaperMC because it's optimized for 1.16
dab So dab why dab are dab you dab here dab

wheat mirage
#

Otherwise you may want to visit the paper discord

wet bronze
#

Because the PaperMC discord is useless

tough kraken
#

true call

wheat mirage
#

@subtle blade u see my pings lol

subtle blade
#

This issue has to do either with Movecraft or with the server software

#

It's to do with their towny integration

wet bronze
#

Wait what?

frigid ember
#

try the same thing on spigot and see if u still have the problem?

wheat mirage
#

Oh yeah I just noticed that too

subtle blade
#

Fun fact, they have two issues

wheat mirage
#

It's their towny hook

#

Just saw it in the stacktrace

subtle blade
#

et.minecraft.server.v1_16_R1.WorldServer.notifyAndUpdatePhysics(Lnet/minecraft/server/v1_16_R1/BlockPosition;Lnet/minecraft/server/v1_16_R1/Chunk;Lnet/minecraft/server/v1_16_R1/IBlockData;Lnet/minecraft/server/v1_16_R1/IBlockData;Lnet/minecraft/server/v1_16_R1/IBlockData;I)V
They're also using a method from the server that no longer exists in 1.16

#

Presumably because they're using reflection

wheat mirage
#

Yeah that was my thoughts too

wet bronze
#

I don't get what you mean by that

subtle blade
#

To me this looks like a plugin being stupid trying to support 10 different versions

#

So go bother the developers

wet bronze
#

I'll tell him about the towny integration but what do you mean by reflection

subtle blade
#

Just send them that stacktrace and tell them there are 2 different errors

#

They should be competent enough to fix them

keen compass
#

If every code you write could be done 2 minute shorter
@wheat mirage shorter doesn't always mean better

#

Anyways obviously the person likes their way and it isn't a problem for them 😉

wet bronze
#

et.minecraft.server.v1_16_R1.WorldServer.notifyAndUpdatePhysics(Lnet/minecraft/server/v1_16_R1/BlockPosition;Lnet/minecraft/server/v1_16_R1/Chunk;Lnet/minecraft/server/v1_16_R1/IBlockData;Lnet/minecraft/server/v1_16_R1/IBlockData;Lnet/minecraft/server/v1_16_R1/IBlockData;I)V
They're also using a method from the server that no longer exists in 1.16
@subtle blade I send him this?

#

And the towny integration thing?

tough kraken
#

if you wanna tell me you dont wanna help me because you dont like my coding-style its okay, but i won't change it just because you say it, no front of course

#

like said, i appreciate your help

forest plaza
#

I was trying to help you, but it’s rather hard to read

tough kraken
#

i meant Liquake

forest plaza
#

But I think liquake spotted your mistake

subtle blade
#

The whole thing you sent us, Janny

#

That whole pastebin

wheat mirage
#

@tough kraken I sent you new code to use

#

It's a spoonfeed which I hate but I think you can look and see what it's doing

#

@tough kraken I'll write a fixed version of your class if you can promise to try learn from it to help yourself in future.

tough kraken
#

i dont think, because it doesnt helps me if i dont really want it

if someone tells me, to buy another car that i want, just because its faster, and would take me faster from a to b, but costs less then what i want, i actually would tell them i dont want that, because i dont need it

#

like i said, maybe my pov is weird

#

and maybe a very weird comparison yeah

forest plaza
#

Actually, why not use server ticks as a way to measure passed time?

#

Or integers in the map?

tough kraken
#

i dont know how... thats the thing

#

and learning it would not help me, as it makes no difference FOR ME

forest plaza
#

Performance

tough kraken
#

and Liquake, where did you sent it to me? got no message

#

or anything

#

then i maybe look at it

forest plaza
#

@tough kraken lastLocation only ever gets updated if they're not already in the list
@wheat mirage

tough kraken
#

ah i saw

#

i thought he meant another

#

then nvm

forest plaza
#
notMoving.put(player.getName(), currentTime);
TimerClass.moveTime = currentTime;```
wheat mirage
#

@tough kraken Not an accurate simile, and that code buddy just posted lowers your entire class down

#

@forest plaza Ah, I missed a "" + on the last moveTime =

#

To convert to a string

#

But that's all

#

Idek if the static thing is a good idea lol

forest plaza
#

But why even use strings?!

wheat mirage
#

I know

#

My thoughts exactly

#

This is why learning is so important

forest plaza
#

I would do it with server ticks

wheat mirage
#

but this guy wants to not be bothered

forest plaza
#

Maybe even system.currentMillis

wheat mirage
#

@forest plaza I maybe wouldn't, as the less this task runs the better

#

You've got to think the level of precision you actually need

#

in order to optimise

forest plaza
#

No I mean, saving the last ticks, and then check time passed every second or so

wheat mirage
#

Don't quite get what you mean

#

But honestly

#

I'd probably just hook into moveevent

#

and check if loc was different

forest plaza
#

He’s running a task every second right?

wheat mirage
#

yeah

tough kraken
#

yeah every 20 ticks

wheat mirage
#

Also VNGC

tough kraken
#

I'd probably just hook into moveevent
@wheat mirage doesnt PME only gets called on move?

#

obviously

forest plaza
#

Just save the current server tick, and then check every second if enough time has passed

tough kraken
#

Just save the current server tick, and then check every second if enough time has passed
@forest plaza how? 😦

wheat mirage
#

@tough kraken You've also got to think of efficiency concerns, on small scale it doesn't matter. But the difference between your if statements and my one line of subtraction

#

It's a huge efficiency difference

forest plaza
#

Wdym how?

wheat mirage
#

@fallen hatch I don't understand what you're saying either

tough kraken
#

i dont even know how to save server tick...

forest plaza
#

In a map?

wheat mirage
#

@fallen hatch Do you mean store the server tick each time they move?

forest plaza
#

It should be a long

subtle blade
#

I was about to suggest Buddy's idea as well

#

Significantly better imo

forest plaza
#

Thanks

wheat mirage
#

@forest plaza What's the method to get server tick?

subtle blade
#

Don't worry about ticks. System.currentTimeMillis() will suffice

forest plaza
#

I would have to google

fallen hatch
#

You got the wrong Buddy 2 times lul

#

xDDD

wheat mirage
#

Oh sorry man

forest plaza
#

Don't worry about ticks. System.currentTimeMillis() will suffice
@subtle blade if he only checks every second, this will not suffice

tough kraken
#

that qctually was my question

@forest plaza What's the method to get server tick?
@wheat mirage

keen compass
#

apparently there is 2 buddy's on this server o.O

#

someone is going to wake up to why they were pinged

forest plaza
#

Wait I got pinged every time

subtle blade
#

Sure it will. Checking every second won't interrupt that at all. You still have a time period against which you can compare every interval

forest plaza
#

@fallen hatch lets be buddies

subtle blade
#

System.currentTimeMillis() the last time the player moved (optionally excluding head movements, that's up to you). Every second, check if current time - saved time > 10 seconds

tough kraken
#

oh god...

forest plaza
#

Yes, but if he’s checking at 9,999 seconds because the server lagged the delay will be one second longer

fallen hatch
#

LUL

wheat mirage
#

@tough kraken It can be easy to get overwhelmed by this.

keen compass
#

@forest plaza if server lagged player movement will lag too

wheat mirage
#

@tough kraken I'd be willing to guide you personally on a call if you'd like. But it's important to look at your inefficiencies too in that scenario.

subtle blade
#

Alternatively you can run your own timer if you really care

#

Though 1 second difference isn't terrible

rotund orbit
#

NBT Tags seem confusing to me. Is using an item's lore a bad way of implementing a food spoilage system?

forest plaza
#

It’s 10% inaccuracy

subtle blade
#

That's also worst case

#

At worst case, yes

keen compass
#

at most you will miss 2 movement packets in a single second if you miss that 1 second

forest plaza
#

He could check if it’s >9, that would be enough buffer

tough kraken
#

well i would set the player in spectator if he is not moving for 10 secs

and showing the time, he is not moving in the actionbar

subtle blade
#

Yeah, that'd do too

forest plaza
#

at most you will miss 2 movement packets in a single second if you miss that 1 second
@keen compass it’s not about Movement packages

subtle blade
#

Depends on whether you want to fire too early or too late

#

I'd also honestly prefer earlier

forest plaza
#

True

tough kraken
forest plaza
#

9 should be just the right time though

#

Then system.currentMillis is the best way to go

tough kraken
#

whats about making a own Timer?

keen compass
#

just fyi, depending on your system, currentMillis() isn't accurate

forest plaza
#

You would have to cancel it every move event then

tough kraken
#

well...

forest plaza
#

just fyi, depending on your system, currentMillis() isn't accurate
Really? Why?

keen compass
#

also every 4 years currentMillis() becomes an issue too 😛

#

currentMillis() every 4 years, you can go back into the past 😉

#

on windows milliseconds are not updated every millisecond

forest plaza
#

Every 50 milliseconds should be enough

keen compass
#

but, I can see some of these plugins that use currentMillis() having some issues every 4 years 😛

wheat mirage
#

I tend to use p.getStatistic(Statistic.PLAY_ONE_MINUTE)

#

Despite the name

#

It's updated every tick lol

keen compass
#

most people don't realize your system can go backwards as far as time goes XD

forest plaza
#

but, I can see some of these plugins that use currentMillis() having some issues every 4 years 😛
I use it for cooldowns that last 5 seconds, imagine it would be 4 years and 5 seconds

tough kraken
#

well what would actually be the less-lagging method

frigid ember
#

repost

I have an issue with my server just crashing for some reason, it just started when I added some code to make totems also give you invulnerability for a few seconds when activated. i honestly have no idea what's going on. any help would be appreciated; thanks in advance!

here's the crash report: https://paste.md-5.net/eyokugakuw.rb
here's the code i added: https://paste.md-5.net/guwewosepi.java
and here's the server output when it crashed: https://paste.md-5.net/pabikesawu.bash
@frigid ember

forest plaza
#

IMO current Millis

wheat mirage
#

@tough kraken Either you're concerned about efficiency, or you're not.

#

I will help you rewrite it in a fixed state if you wish.

keen compass
#

During leapyear, depending how you use currentMillis(), you will get a negative number instead @forest plaza

wheat mirage
#

I deal with bad code all the time in my job

#

I want to stop it before it reaches somewhere important

tough kraken
#

if i get help, i would appreciate it, but things like "just learn" actually sucks me down, as thats no help for me

#

thats my opinion

wheat mirage
#

Sure, give me a PM and I'll call you in a bit and break down your code for you.

#

In an easy to understand way

tough kraken
#

well im german... that would not be a good call xd

#

cant speak english, my writing is good(i think) but if i speak english... pray to god

flint vine
#

hey guys. Please advise plugin for bungee portals for 1.16.1

wheat summit
#

How would I disable spawn protection in a world from a plugin?

wheat mirage
#

@tough kraken Pm me and I'll do my best via text

forest plaza
tough kraken
#

thanks

wheat mirage
#

@forest plaza Ticks or millis?

#

I'm assuming ticks

forest plaza
#

Ticks

wheat mirage
#

That's pretty cool

#

Doesn't work for cross dimensional stuff

#

But for the majority of stuff

#

very nice

#

I personally like eitherr the statistic

#

Or for non players

forest plaza
#

Changing dimension would be considered moving

wheat mirage
#

getTicksLived

forest plaza
#

Ah that’s nice too

wheat mirage
#

Yeah but a general use I mean

forest plaza
#

This was just a quick google search for ways to get time passed in server ticks

keen compass
#

changing dimension is a teleport

forest plaza
#

I know

keen compass
#

Don't think a movement packet is thrown along with a teleport

forest plaza
#

Well that’s one case he would need to check too then

keen compass
#

yep

forest plaza
#

Unless theres no way to teleport in his server

sleek ivy
#

anyone know if theres a way bridge chat between a forge server and spigot/paper?

vale slate
#

write a spigot plugin and a forge mod which socket to each other or use a proxy

rapid yacht
#

is spigot better than paper

wheat mirage
#

Is there any way to clear all bossbars for a player?

#

Having issues with bossbars sticking around when a player switches server

vale slate
#

is spigot better than paper
don't start this discussion

wheat mirage
#

Clearing it in the leave event doesn't work

latent oasis
#

Hi

#

I was wondering if someone could help me figure out why the heck people on my server no matter what join with like an unholy amount of speed

#

but when they look in their inventory they have no effects

#

Also opped players for some reason don't get the same effect

peak glade
#

guy

wheat mirage
#

@latent oasis Are you a dev? check player.getWalkingSpeed etc

#

probably a plugin

peak glade
#

whos beest essentials or essentialsx ?

latent oasis
#

how do I check @wheat mirage

peak glade
#

whos beest essentials or essentialsx ? ?

keen compass
#

only other sure method would be to grab the packets

#

EssentialsX is the continuation of Essentials @peak glade

wheat mirage
#

@keen compass I only need to remove it once the player has switched servers

woven raft
#

i am making a skyblock server and i am wondering what are good plugins for it to make it more my own
i allready have ore gens, shop, quests

latent oasis
#

fabledskyblock is heavily customizable

peak glade
#

hello

#

but why this spawn ?

fathom coral
#

hi, I am having some problems with EssentialsX.

peak glade
#

yes me too

sturdy oar
#

hi, I am having some problems with EssentialsX.
@fathom coral Is it the spawn height?

fathom coral
#

I do not think so. What happens is the plugin is red when I do /plugins and it does not work. The only command that works is /tps.

wheat mirage
#

Anyone know a way to clear all boss bars in the PlayerQuitEvent

#

I don't think it works because the client can't actually receive anymore packets

tiny dagger
#

well do you have their instances?

wheat mirage
#

But I need to clear all bossbars when they change servers

#

I do

#

And I tried it

#

But it doesn't work

#

As the client has already left

#

Problem is, on bungee

tiny dagger
#

well bossbar#unregister

#

oh

#

he still has them?

wheat mirage
#

They are told they're changing worlds I think

#

Yeah

tiny dagger
#

oh so do it in bungee then

wheat mirage
#

So the bossbar never gets removed naturally

tiny dagger
#

🤔

wheat mirage
#

I... don't know how?

tiny dagger
#

seems like a proxy oversight to me

wheat mirage
#

Yeah, any ideas? Kind of need to fix this. @tiny dagger

tiny dagger
#

let me see the packets first

fathom coral
#

is there a essentials for 1.8.0?

sturdy oar
#

.-. yes

wheat mirage
#

Yeah I've taken a look myself and it seems only the client really knows what bossbars it currently has when it switches server

#

I might try upating bungee

fathom coral
#

.-. yes
@sturdy oar where can I find it?

frigid ember
#

Hey guys ! I'm actually trying to develop a plugin which allows me to add crafts for Items with nbt in datapacks. So I tried to create a method which would make things way easier. https://pastebin.com/A3Xv9Drc Here is the pastebin of my code. I'm trying to understand what should I put instead of these "?" which are in the "onEnable" method

tiny dagger
#

@wheat mirage there seems to be a packetplayout boss packet

wheat mirage
#

@tiny dagger Yeah but it requires knowledge of the boss bar ID or something I think

tiny dagger
#

it wouldn't be impossible to fetch on packet listening

#

did bungee had a built in way to listen to packets or?

wheat mirage
#

@tiny dagger Updated to latest bungee

#

Issue is gone

#

Lol

#

I only updated like 4 days ago

#

There you go I guess

#

Either that or the new bungee lets my leavelistener code work?

#

Who knows

tiny dagger
#

good to hear

wheat mirage
#

Yeah it's new bungee

#

thanks for your time @tiny dagger

fathom coral
tiny dagger
#

no problem

tiny pebble
#

I have just spent a wonderful amount of time re-organizing all of my code as well as making my gigantic class file separated into 7 different classes. As well as that, I got my one problem solved from last night that I worked hours on. Thank you @keen compass ! Wonderful tutorial btw on github

austere flame
#

does anyone know why it says in JavaPlugin is null?
I have this code in my main class

@Override
public void onEnable()
{
//...
PocketWatch.nameUpdateRunnable.runTaskTimer(this, 0, 5);
//...
}

But whenever I run it on my server it throws:
Caused by: java.lang.IllegalArgumentException: Plugin cannot be null

tiny pebble
#

the file extends JavaPlugin right?

austere flame
#

yup

tiny pebble
#

hmmm

austere flame
#

i tried doing workarounds like getting my plugin through Bukkit.getPluginManager() but its still null

fair abyss
#

maybe dont use static

#

how do you get that runnable instance

austere flame
#

for the runnable?

#

the runnable is static

tiny pebble
#

within onEnable() do you have something like
instance = this;?

In all of my plugins I have:
private static Main instance;
And then I set it so instance = this within onEnable() and instance = null in onDisable()

not sure if everyone does this, but just wanted to put that out there

#

also yeah static isn't always the best idea to use

keen compass
#

@tiny pebble lol, the plugin code I showed you isn't so much a tutorial on how to do something, its named that because it allows creating tutorials in the server. Need to update it though. However, I from time to time use it to show examples 😛

tiny pebble
#

Ah, well, it was still a tutorial in my eyes since it was a great example hahaha

keen compass
#

the thing I really use it for to show an example of most commonly is conversation API

#

and what you can use it for 😉

austere flame
#

@tiny pebble i have something like that but idk what difference it would make since instance and this would reference the same thing in this case. I'll try making my runnable non-static though ill see how that goes

keen compass
#

I make use of the conversation API to allow altering of the config from in game 😛

#

instead of a series of commands

tiny pebble
#

ah that sounds nice

fair abyss
#

its so weird

keen compass
#

using static to allow referencing the main class isn't necessarily bad btw

#

I use it sometimes

#

Main class of a plugin isn't just going to magically go away so its ok 😛

fair abyss
#

my message sents after minutes sorry

keen compass
#

would help if you showed the relevant code @austere flame

#

specifically what is in PocketWatch.nameUpdateRunnable

lyric cypress
#

How would I make a command that loads a fake chest from config?
But have the players actions be synced to config

keen compass
#

create custom inventories

#

you can create an inventory that is the size of a chest or double chest

lyric cypress
#
public class RewardStorage implements Listener {
    public Inventory inv;

    public RewardStorage() {
        this.inv = createInventory();
        Bukkit.getPluginManager().registerEvents(this, Main.getPlugin(Main.class));
    }
    public static Inventory createInventory() {
        return Bukkit.createInventory(null, 9, ChatColor.GOLD + "Unclaimed Rewards");
    }
}

like this?

austere flame
#

I defined PocketWatch.nameUpdateRunnable like this

public class PocketWatch {
...
public static BukkitRunnable nameUpdateRunnable = new BukkitRunnable() {...};

I know the event works fine because I launched it before from other methods it just started breaking down in onEnable()

keen compass
#

it depends how you are setting the Plugin requirement in that class

#

which is why it would help if you showed the code for that

#

@lyric cypress yes something like that

austere flame
#
nameUpdateRunnable = new BukkitRunnable(){
            @Override
            public void run() {
                String newTime = ChatColor.GREEN + Time.getCurrentTime().toString();
                for(Player p : Bukkit.getOnlinePlayers())
                {
                    ItemStack watch = findPocketWatch(p);
                    if(watch != null)
                    {
                        ItemMeta newMeta = watch.getItemMeta();
                        newMeta.setDisplayName(newTime);
                        watch.setItemMeta(newMeta);
                    }
                }
            }
        };
fair abyss
#

running this code can cause problem

#

performance problems

tiny dagger
#

that's time complexity to you

#

got knows what findpocketwatch does

fair abyss
#

probably loops players inventory -_-

lyric cypress
#
public class RewardStorage implements Listener {
    public Inventory inv;

    public RewardStorage() {
        this.inv = createInventory();
        Bukkit.getPluginManager().registerEvents(this, Main.getPlugin(Main.class));
    }
    public RewardStorage(ArrayList<ItemStack> items) {
    this.inv = createInventory();
    items.forEach(item -> {
        if(item!=null) {
            this.inv.addItem(item);
        }
    });
    }
    public static Inventory createInventory() {
        return Bukkit.createInventory(null, 9, ChatColor.GOLD + "Unclaimed Rewards");
    }
    public void openInventory(HumanEntity ent) {
    ent.openInventory(inv);
    }
}

In Main

public HashMap<String, RewardStorage> rStorages = new HashMap<String, RewardStorage>();

on Command

ArrayList<ItemStack> inv =  (ArrayList<ItemStack>) plugin.getConfig().get(p.getName());
if (inv != null) {
    plugin.rStorages.put(p.getName(), new RewardStorage(inv));
    plugin.rStorages.get(p.getName()).openInventory(p);
} else {
    RewardStorage storage = new RewardStorage();
    plugin.rStorages.put(p.getName(), new RewardStorage(inv));
    plugin.rStorages.get(p.getName()).openInventory(p);
}
keen compass
#

use BukkitScheduler to pass in your bukkitrunnable

fair abyss
#

and gets the required item

austere flame
#

i mean i know the event itself is problematic but im just trying to get it to launch from onEnable without throwing execptions

fair abyss
#

he is running this code every 5tick

lyric cypress
#

I put event handlers in the RewardStorage, but they do not run when they are opened from the hashmap

austere flame
#

also I managed to get it going by making the runnable nonstatic so ty everyone!

lyric cypress
#

They do run if the RewardStorage is opened as a RewardStorage instead of an element of the hashmap

fathom coral
keen compass
#

Bukkit.getPluginManager().registerEvents(this, Main.getPlugin(Main.class));
this is your issue here ^

#

your event isn't in the Main class

#

it is in the rewardstorage

lyric cypress
#

the event is in the rewardstorage

keen compass
#

yes, but you are specifying the event class as the main class

#

instead of the class that actually has the EventHandlers

lyric cypress
#

Main is the plugin

fair abyss
#

@fathom coral search for eseentialsx

lyric cypress
#

this, is this

fair abyss
#

@lyric cypress get reference of main class

peak glade
#

hey guy

#

please

keen compass
#

it should be plugin and then class with EventHandler

#

you have it backwards

peak glade
#

i want spawn plugins ?

lyric cypress
#

oh

peak glade
#

hello ?

fair abyss
#
  • you arent listening for "open"
#

just use fucking google

peak glade
#

ok

fair abyss
#

it will give you thousonds of spawn plugin

lyric cypress
#

it says listener first though


void org.bukkit.plugin.PluginManager.registerEvents(@NotNull Listener arg0, @NotNull Plugin arg1)
fair abyss
#

@lyric cypress i cant see any event in your code

#

you dont need to register it

lyric cypress
#
    @EventHandler
    public void onInventoryClick(final InventoryClickEvent e) {
        Bukkit.broadcastMessage("click event");
        if (e.getClickedInventory() == inv && e.getSlot() > -1) {
            Bukkit.broadcastMessage("in inv");
            ItemStack slot = inv.getContents()[e.getSlot()];
            if (e.getCurrentItem() != null) {
                if (Events.availableSlot((Player) e.getWhoClicked())) {
                    e.getWhoClicked().getInventory().addItem(slot);
                    slot = null;
                    Main.getPlugin(Main.class).getConfig().set(e.getWhoClicked().getName(), this);
                } else {
                    e.setCancelled(true);
                    e.getWhoClicked().sendMessage(ChatColor.DARK_RED + "You do not have inventory space");
                    Bukkit.getScheduler().runTask(Main.getPlugin(Main.class), task -> {
                        e.getWhoClicked().closeInventory();
                    });
                }
            }
            e.setCancelled(true);
        }
        else {
            Bukkit.broadcastMessage(e.getClickedInventory().toString() + " != " + inv.toString());
            Bukkit.broadcastMessage("slot " + e.getSlot());
        }
    }
#

this is in RewardStorage.java

fair abyss
#

so then yeah you need

#

fuck my internet connection

#

like frostfalt told

#

your main instance is wrong

#

you can use singleton to get it

#

go your main class

private static Main instance;
public static Main getInstance(){
return instance;}

public synchronized void onEnable() {
....
instance = this;
...}

tough kraken
fair abyss
#

it says fix

#

just read it

fathom coral
#

@fathom coral search for eseentialsx
@fair abyss EssentialsX does not work for me. That is why I am trying to use the essentials that I linked.

fair abyss
#

why?

#

essentials was abondon for years

fathom coral
#

I dont know

fair abyss
#

it wont work

keen compass
#

you don't need the synchronized modifier

fair abyss
#

why?

keen compass
#

because onEnable() isn't called from another thread

fathom coral
#

It just shows up as red when I type /plugins and none of the commands work.

fair abyss
#

so check console for errors

lyric cypress
#

ty kingOf0, that makes the event work!

#

I thought Main.getPlugin(Main.class) was just a slower method of getting the plugin

#
    @EventHandler
    public void onInventoryClick(final InventoryClickEvent e) {
        Bukkit.broadcastMessage("click event");
        if (e.getClickedInventory() == inv && e.getSlot() > -1) {
            Bukkit.broadcastMessage("in inv");
            ItemStack slot = inv.getContents()[e.getSlot()];
            if (e.getCurrentItem() != null) {
                if (Events.availableSlot((Player) e.getWhoClicked())) {
                    e.getWhoClicked().getInventory().addItem(slot);
                    slot = null;
                    Main.getPlugin(Main.class).getConfig().set(e.getWhoClicked().getName(), this);
                } else {
                    e.setCancelled(true);
                    e.getWhoClicked().sendMessage(ChatColor.DARK_RED + "You do not have inventory space");
                    Bukkit.getScheduler().runTask(Main.getPlugin(Main.class), task -> {
                        e.getWhoClicked().closeInventory();
                    });
                }
            }
            e.setCancelled(true);
        }
        else {
            Bukkit.broadcastMessage(e.getClickedInventory().toString() + " != " + inv.toString());
            Bukkit.broadcastMessage("slot " + e.getSlot());
        }
    }

does anyone know why this if is false?

if (e.getClickedInventory() == inv && e.getSlot() > -1) {
sturdy oar
#

Plugin.getPlugin(Class<? extends Plugin>) it is a slower method

#

i wouldn't recommend it

keen compass
#

should use .equals() for this check

#

== does a reference check and thus even if the inventories might be the same, they are probably not pointing to the same memory address

frigid ember
#

#general

#

help

keen compass
#

.equals() will do a check on the objects values instead, to see if they are the same

lyric cypress
#

ok I replaced it with .equals(), but it is still not going in

fathom coral
woven raft
#

someone know about a free plugin that is kind of like Jets Minions

keen compass
#

not sure why people want to stop tab

#

XD

#

not like hiding it makes your server magically secure

nimble stump
#

It doesn’t make it secure but if you want to hide what plugins you’re using it’s a valid thing to do

keen compass
#

who cares who knows what plugins you use

nimble stump
#

¯_(ツ)_/¯

#

You may want to prevent other servers from mimicking you

keen compass
#

doesn't stop that but ok

#

I can make a plugin based on what I observe

nimble stump
#

Yes but if you’re using public plugins you may want to make it harder to copy you without having to pay to develop a custom server

lyric cypress
#

in Main

public HashMap<String, RewardStorage> rStorages = new HashMap<String, RewardStorage>();
plugin.rStorages.put(p.getName(), new RewardStorage(inv));
plugin.rStorages.get(p.getName()).openInventory(p);
@EventHandler
public void onInventoryClick(final InventoryClickEvent e) {
    Bukkit.broadcastMessage("click event");
    if (e.getClickedInventory().equals(inv) && e.getSlot() > -1) {
        Bukkit.broadcastMessage("in inv");
        ItemStack slot = inv.getContents()[e.getSlot()];
        if (e.getCurrentItem() != null) {
            if (Events.availableSlot((Player) e.getWhoClicked())) {
                e.getWhoClicked().getInventory().addItem(slot);
                slot = null;
                Main.getPlugin(Main.class).getConfig().set(e.getWhoClicked().getName(), this);
            } else {
                e.setCancelled(true);
                e.getWhoClicked().sendMessage(ChatColor.DARK_RED + "You do not have inventory space");
                Bukkit.getScheduler().runTask(Main.getPlugin(Main.class), task -> {
                    e.getWhoClicked().closeInventory();
                });
            }
        }
        e.setCancelled(true);
    } else {
        Bukkit.broadcastMessage(e.getClickedInventory().toString() + " != " + inv.toString());
        Bukkit.broadcastMessage(
                e.getClickedInventory().getContents().toString() + " != " + inv.getContents().toString());
        Bukkit.broadcastMessage("slot " + e.getSlot());
    }
}

It is still going into the else, even though it should be going into the if

keen compass
#

lol anyways, stupid endeavor to block such a petty thing

#

because you believe copied servers magically do better

#

if someone copies your server and does better, then you were obviously doing something wrong 😛

nimble stump
#

Less competition in your market space is better for your business

#

¯_(ツ)_/¯

keen compass
#

except blocking the tab complete

#

doesn't remove competition

lyric cypress
#

tab complete removing is bad

nimble stump
#

Makes it harder

keen compass
#

no

lyric cypress
#

it makes it so much harder to type commands

nimble stump
#

If you can’t figure out how someone does something, it’s harder to copy them

keen compass
#

I can make a server right now to compete with whatever server I want. I don't even need to know the plugins you use

#

I didn't even really need to join it

nimble stump
#

But you know how to develop plugins

lyric cypress
#

At least they can't copy your config

#

so it's fine

nimble stump
#

The average person doesn’t know how to develop

#

They just know how to copy public plugins

keen compass
#

the average statistic is a lie too 😉

nimble stump
#

Lol

keen compass
#

but that is a different topic though

#

anyways, I agree it will stop the less competent people

lyric cypress
#

press the jar

#

agree to eula

#

port forward

keen compass
#

shouldn't double click the jar lol

lyric cypress
#

do you want spigot or paperspigot

#

paper

rotund orbit
#

Is there spigot support for setting a player's spawn, or do I have to keep track of them individually and teleport them when they die?

lyric cypress
#

just replace the jar

#

but for normal spigot

#

you have to use the buildtools

kindred plover
#

do you think we can get in a call so i can screen share?

lyric cypress
#

read the wiki

#

or use paperspigot

#

yes

#

probably

#

yes

#

so .equals() is not working

nimble stump
#

I would recommend using spigot via build tools rather than paper

lyric cypress
#

yeah actually use normal spigot

noble aurora
#

hm

#

i cant upload my picture

frigid ember
#

is there a event for player fall damage?

noble aurora
#

it just says failed

#

😂

subtle blade
#

is there a event for player fall damage?
Just EntityDamageEvent

#

There are damage causes though

noble aurora
#

please help my discord is not accepting my images

#

hm, it seems this is the only server I cannot post the picture in

#

😩

#

it just said failed to upload

karmic sable
#

whenever I regenerate a world, I keep getting the same seed for some reason

    public static void createWorld(){
        String worldName = ResetWorld.getInstance().getConfig().getString("worldName");
        if (doesWorldExist(worldName)){
            System.out.println("A world already exists with the name: " + worldName);
        }
        else {
            Bukkit.createWorld(new WorldCreator(worldName).seed(new Random().nextLong()));
            Bukkit.getWorld(worldName).getWorldBorder().setSize(10000);
            System.out.println("New world created with the name: " + worldName);
        }
    }```
unborn jewel
#

did i do this wrong public String replace("[" with " ")

tacit trellis
#

how can I get 1.16 block type without specifying api-version?

sturdy oar
#

should i use a webserver manger
@kindred plover for what

#

like pterodactyl?

#

Tbh many times it's not worth it

#

I only install pterrodactyl or Multicraft when I have to manage huge networks

#

If you have something like 2-3 servers I personally feel like it would be a waste of resources

#

Yeah definitely not worth it

#

whats warps xd

#

Why would it be a different server

#

Are you experienced with Linux?

bold anchor
#

@tacit trellis You don't

unborn jewel
#

How could i make a lobby compass?

sturdy oar
#

With a compass

#

😂

unborn jewel
#

👏

sturdy oar
#

You mean a gui with server selection

unborn jewel
#

yea

marsh hawk
#

will an abstract function carry over its annotations?

unborn jewel
#

Yes I think so

marsh hawk
#

sweet

sturdy oar
#

You basically listen to player interact event I think

unborn jewel
#

I'm not totally sure

#

though

#

first I need to make it so they receive the item

sturdy oar
#

Wait what

#

Is your dedi running windows oh God

#

Lmaooo

#

Ubuntu is Linux

unborn jewel
#

yea

#

Actually wouldn't Ubuntu be a software for linux

sturdy oar
#

Ubuntu is a distro based on Debian

unborn jewel
#

ah

sturdy oar
#

Maintained by community and experts

unborn jewel
#

You remember Unix?

sturdy oar
#

? What does this mean

unborn jewel
#

wait

#

i forgot the name

#

Yea unix

#

The guy that made linux got the name from unix

sturdy oar
#

ik i was trying to say i never used linux in the pass so i have no experience with it
@kindred plover you should learn Linux. If you learn it well you won't ever need a web panel

#

The guy that made linux got the name from unix
@unborn jewel Linus Torvalds

#

Pretty sure he got Linux from his name...

unborn jewel
#

Didn't he make it in his basement

#

I remember reading it was from unix

#

but idk people got different stories

#

linux isn't hard to use

sturdy oar
#

Well

unborn jewel
#

it's just like command prompt

sturdy oar
#

I use Ubuntu on my PC

unborn jewel
#

but you can do more things

sturdy oar
#

For 1 months now

#

It's real fast

unborn jewel
#

I use Ubuntu on my dedi

#

ok so how would I give the user an item

#

is there like a spigot doc

#

or something

sturdy oar
#

Yes

#

Look at Inventory

#

I'll send link

rotund orbit
sturdy oar
#

Title

unborn jewel
#

I don't need @NotNull right?

sturdy oar
#

NotNull is just an annotation

unborn jewel
#

so I really don't need it then

sturdy oar
#

Means that if will never be null

unborn jewel
#

ah ok

#

I would want to put this on my onEnable correct?

sturdy oar
#

Wut

#

that's @Override

unborn jewel
#

yea

sturdy oar
#

Yeah it's not the same thing

rotund orbit
sturdy oar
#

Probably 99% that's a title

rotund orbit
#

I'll give it a shot, thank you

sturdy oar
#

Titles have been a thing in Minecraft for so much time

#

I think like 1.7

wheat mirage
#

@sturdy oar Any luck with the bed stuff?

sturdy oar
#

No I abandoned

#

Only 1.8.8 support

wheat mirage
#

Ouch that's rough

#

I had it working in 1.12

sturdy oar
#

?

#

How

unborn jewel
#
    @NotNull
    HashMap<0345, minecraft:compasss> {
        
    }
``` did i do this wrong
sturdy oar
#

Are you randomly putting java stuff together

unborn jewel
#

noooo

lament wolf
#

Lmao

#

No sense

sturdy oar
#

int 32 horse |= HashMap<>[]

#

New java feature

unborn jewel
#

Ok soo uh

#

How am i suppose to do this then

#

Im not so good at java

sturdy oar
#

Learn java

frigid ember
#

player.getInventory.add(new ItemStack(Material.COMPASS, 1));

unborn jewel
#

Really wow

sturdy oar
#

player.getInventory.add(new ItemStack(Material.COMPASS, 1));
@frigid ember why add

#

More like setItem

unborn jewel
#

Friendi I am

frigid ember
#

oh i didnt read the entire convo

#

thats mb

unborn jewel
#

How come that’s soo much different then the doc

rotund orbit
#

How hard is it to update a plugin from 1.15.2 to 1.16.1?

zealous shore
#

Not hard just switch the jar file

sturdy oar
#

Are you using NMS

rotund orbit
#

What is NMS

sturdy oar
#

Or reflection on server code

rotund orbit
#

Reflection?

zealous shore
#

net.minecraft.server @rotund orbit its coding stuff

frigid ember
#

just switch jar file if you dont know what hes talking about

sturdy oar
#

It's fun dependency

rotund orbit
#

I don't mess with NMS or reflection no haha

#

I pretty much rely on my own stuff

#

and Spigot

sturdy oar
#

I like NMS, they are the best

rotund orbit
#

So plugins that work with 1.15.2 generally work with 1.16.1?

subtle blade
#

More often than not, yes

zealous shore
#

@rotund orbit most times yes

anyways can someone please tell me how to convert the three world files (world, world_the_nether, and world_the_end) to a world that I can run on single player

rotund orbit
#

And how do I switch my jar file?

zealous shore
#

how r u running ur server?

#

on ur computer or on a hosting site

subtle blade
#

okay, so let's just clarify real quick lol. When you say "Updating a plugin", are you speaking from the perspective of a server owner or a developer?

rotund orbit
#

Developer

#

Sorry

subtle blade
#

You have two people giving two answers from two different perspectives

rotund orbit
#

I know how to update my server

zealous shore
#

o ok

rotund orbit
#

I have a Medieval Factions plugin and several others

subtle blade
#

So yeah, just update your dependencies and see if there are any breakages

#

If you're using internal server code (anything from CraftBukkit or NMS) it will likely need an update

#

else, Bukkit API had no breaking changes in 1.16

rotund orbit
#

Great!

#

Sounds like my plugins will just work then

#

I appreciate it 🙂

#

I'll update the Spigot dependency

subtle blade
#

That's generally Bukkit's goal is to update without breaking plugins

rotund orbit
#

I think it's my only one

#

Well that's good

#

My current version in my pom.xml is <version>1.15.2-R0.1-SNAPSHOT</version>

Do I just change the 1.15.2. to 1.16.1? And is this all I need to do to update my dependencies?

subtle blade
#

Yes, though if there are no breaking changes, you can keep it on 1.15.2

#

Just update real quick to see if anything broke. If not, revert back to 1.15.2

#

It's best to stay on the lowest version you're supporting unless you need to use something from a future version

rotund orbit
#

Oh is that so?

subtle blade
#

My VeinMiner plugin for instance depends still on 1.13 but supports up to 1.16.1

#

I just use API

rotund orbit
#

Should I try to make it depend on 1.13?

subtle blade
#

If you want to, sure

rotund orbit
#

Only if I test it huh

subtle blade
#

Breaking changes were far and few between since 1.13

rotund orbit
#

Well then I'll just say it supports 1.13, 1.14, 1.15 and 1.16 but that the native version was 1.15

#

And I'll switch to 1.13

#

Thanks! 😄

#

Is it 1.13 or 1.13.1? It's 1.13.1

wheat mirage
#

@sturdy oar I had it working in 1.12 using protocollib

#

Just sent the entity metadata packet i think

subtle blade
#

Well that all depends on the api-version in your plugin.yml, Dan

#

If it's set to 1.15, it won't load on 1.13 or 1.14 servers

#

(Native Version on your resource page should match the api-version in your plugin.yml)

rotund orbit
#

I'm using api version 1.13

#

I thought Native was the version you programmed it for my bad haha

wheat mirage
#

@sturdy oar Oh yeah Fendi I know how I did it

#

I sent a block change for a bed

#

Send the sleeping packet

#

Then use entitymove to get the sleeping entity where i want

#

Job's a good'en

#

I recommend checking if the player is in the top half or bottom half of the world

#

If top half, send the block change 1 above bedrock

#

if below, send it to the top of the world

#

That's best advice I have, but it WILL work! 😄

sturdy oar
#

Bruh

frigid ember
#

how do i get when a player takes an item from an inventory? ive forgotten its been months since ive had to do it

sturdy oar
#

So I need a bed after all

wheat mirage
#

Sadly I think so

#

But the headline here

#

is you can move them once they're in a bed

#

So you just need to fake a bed

#

then move them where you want them to be

#

no bed needed in that location

#

@sturdy oar So yes, you need a bed, but it doesn't have to even be visible. You can have them sleep anywhere you want, just a bit of legwork for developers.

rotund orbit
#

Any way to increase the size or get it to show at the top of the screen?

#

using this:

event.getPlayer().spigot().sendMessage(ChatMessageType.ACTION_BAR, new ComponentBuilder("Entering The Wilderness").create());

unborn jewel
#

how could I reload my scoreboard

#

so it updates

subtle blade
#

Player#sendTitle()

zealous shore
#

Any way to increase the size or get it to show at the top of the screen?
@rotund orbit I dont think so. Maybe make it a title. (player#sendTitle())

subtle blade
#

Titles and action bars are not the same thing

rotund orbit
#

ohhh

lyric cypress
#

I have a hashmap to save RewardStorages

private HashMap<String, RewardStorage> rStorages = new HashMap<String, RewardStorage>();

And a command to load the storage

if (command.getName().equalsIgnoreCase("reward")) {
             ArrayList<ItemStack> inv =  (ArrayList<ItemStack>) plugin.getConfig().get(p.getName());
            if (inv != null) {
                rStorages.put(p.getName(), new RewardStorage(inv));
                rStorages.get(p.getName()).openInventory(p);
            } else {
                rStorages.put(p.getName(), new RewardStorage());
                rStorages.get(p.getName()).openInventory(p);
            }
}

I know it will reset when the server resets but I'm just trying to get it to work right now

#

this is the class

public class RewardStorage implements Listener {
    public Inventory inv;

    public RewardStorage() {
        this.inv = createInventory();
        Bukkit.getPluginManager().registerEvents(this, Main.instance);
    }

    public RewardStorage(Inventory invIn) {
        this.inv = invIn;
    }

    public RewardStorage(ItemStack[] items) {
        this.inv = createInventory();
        for (int i = 0; i < items.length; i++) {
            if (i > 9) {
                Bukkit.getLogger().log(Level.WARNING,
                        "Too many ItemStacks in RewardStorage ItemStack array constructor");
            }
            this.inv.setItem(i, items[i]);
        }
    }

    public RewardStorage(ArrayList<ItemStack> items) {
        this.inv = createInventory();
        items.forEach(item -> {
            if(item!=null) {
                this.inv.addItem(item);
            }
        });
    }

    public void openInventory(HumanEntity ent) {
        ent.openInventory(inv);
    }

    public static Inventory createInventory() {
        return Bukkit.createInventory(null, 9, ChatColor.GOLD + "Unclaimed Rewards");
    }

    public static ItemStack[] addItem(ItemStack[] items, ItemStack toAdd) {
        for (int i = 0; i < items.length; i++) {
            if (items[i] == null) {
                items[i] = toAdd;
                return items;
            }
        }
        return items;
    }
#
    @EventHandler
   public void onInventoryClick(final InventoryClickEvent e) {
       Bukkit.broadcastMessage("click event");
       if (e.getClickedInventory().equals(inv) && e.getSlot() > -1) {
           Bukkit.broadcastMessage("in inv");
           ItemStack slot = inv.getContents()[e.getSlot()];
           if (e.getCurrentItem() != null) {
               if (Events.availableSlot((Player) e.getWhoClicked())) {
                   e.getWhoClicked().getInventory().addItem(slot);
                   slot = null;
                   Main.getPlugin(Main.class).getConfig().set(e.getWhoClicked().getName(), this);
               } else {
                   e.setCancelled(true);
                   e.getWhoClicked().sendMessage(ChatColor.DARK_RED + "You do not have inventory space");
                   Bukkit.getScheduler().runTask(Main.getPlugin(Main.class), task -> {
                       e.getWhoClicked().closeInventory();
                   });
               }
           }
           e.setCancelled(true);
       } else {
           Bukkit.broadcastMessage(e.getClickedInventory().toString() + " != " + inv.toString());
           Bukkit.broadcastMessage(
                   e.getClickedInventory().getContents().toString() + " != " + inv.getContents().toString());
           Bukkit.broadcastMessage("slot " + e.getSlot());
       }
   }
}

It always goes to the else. How do I make the check work properly?

keen compass
#

&& e.getSlot() > -1 this part is what is throwing it off

#

you have &&, so it will only be true if both conditions are true

#

if either one is false it is false overall

hardy cedar
#

im trying to update the scoreboard FOR A 20 DAY but i couldn't :(((((

wheat mirage
#

Is actionbar ever going to be moved out of player.spigot()?

#

Not sure I understand why its in there really

#

Is it because it depends on Bungee chat componentz?

unborn jewel
#

How can i reload my scoreboard

hardy cedar
#

@unborn jewel have i saw u before?

#

xd

unborn jewel
#

hm

#

idk

hardy cedar
#

wtf

#

didnt u just chat with me in papi support lmfao?

unborn jewel
#

idk

lapis plinth
#

Huuuh

#

Block block = event.getBlock();

subtle blade
#

block.getType()

#

Though really, an if statement is probably best here anyways

#

unless you're using a fall-through, a switch statement typically isn't necessary

lapis plinth
#

kk

hardy cedar
lyric cypress
#

@keen compass

&& e.getSlot() > -1 this part is what is throwing it off

e.getSlot() is almost always true though. It's only not true if the click is not on a slot, where e.getSlot() would be -999

keen compass
#

then I am not sure

#

unless it is the inside else being ran

frigid ember
#

Did 1.16 finally add a brown chat color?

hardy forge
#

@frigid ember they added over 10000+ new colors.

#

You can basicaly get any color to the game.

frigid ember
#

How?

hardy forge
#

With hexcolors

frigid ember
#

oh.....

#

Gotta say I love me some good old COLOR.{color name}

#

Any idea of what could be going wrong?

subtle blade
#

Not a question to ask on the Spigot Discord

#

The answer will always be Spigot

unborn jewel
#

really?

subtle blade
#

*should always be Spigot

unborn jewel
#

give me a good reason

subtle blade
#

the Spigot Discord

unborn jewel
#

I want a University Level Reason

subtle blade
#

We're not going to recommend third party software

#

We have no control over it

unborn jewel
#

I mean he could of googled it

subtle blade
#

At which point it's beyond our control

frigid ember
#

Ask in here, you'll get Spigot as an answer
Ask in the Paper discord, you'll get Paper as an answer

#

¯_(ツ)_/¯

keen compass
#

you want to go to the original source maintainers and ask which is better? o.O

#

that is pretty disrespectful XD

frigid ember
#

So i've been wondering if modifying the swimming speed is possible (for changing how fast you can swim in water/lava)

#

I think I found where the speed is defined but it is hardcoded in this method in EntityLiving.java:

protected float dL() {
        return 0.8F;
    }```
#

any way to change this? either by overriding or reflection?

subtle blade
#

No and no, would have to be done with either ASM or a server patch. Though I have a feeling the client will hate you

frigid ember
#

oof ok

#

is there any other way it can be done?

keen compass
#

can change their velocity maybe

frigid ember
#

i'll try that but i feel like that would end up looking janky

#

i guess that's as good as it well get though

keen compass
#

I guess you can always hope for 5G in your area @subtle blade and then use that for internet XD

subtle blade
#

Neither

#

1.16.1

frigid ember
#

1.8.8

subtle blade
#

Either way, it sounds stupid

#

You're supporting 9 major versions

#

Don't

dusk shard
#

Can someone point me in the correct direction to see how spigot api helps with making messages?

subtle blade
#

Making messages?

#

Text components you mean?

dusk shard
#

Yeah

subtle blade
fringe cairn
#

I created a persitentDataType to convert LinkedLists<UUID> to long arrays, but it isn't actually saving any of that longs. It worked with the same code converting UUID[] to long[] (and I've tested both the toPrimitive and fromPrimitive and they work correctly), and the only thing I changed was the variable type and the getComplexType method to return (Class<LinkedList<UUID>>) new LinkedList<UUID>().getClass();.
https://pastebin.com/2fR1bH3z
codes there if anyone want's to take a look

tawny whale
#

Hey, since updating my server to 1.16, I've been having alot of issues with crashing. I get "exception generating new chunk" errors when my server crashes. This only started happening after updating to 1.16

frigid ember
#

Can someone help me with my minecraft server I have tried multiple times to port forward and it isnt opening the port

tough kraken
#

@subtle blade maybe

#

Hey, since updating my server to 1.16, I've been having alot of issues with crashing. I get "exception generating new chunk" errors when my server crashes. This only started happening after updating to 1.16
@tawny whale same for me. seems to happen at old worlds, or in my case, if you use < 1.16 plugins, specially in world-category

#

i created a world with a 1.14 plugin. for sure it breaks on 1.16

tawny whale
#

@tough kraken See, I created a new world for 1.16 to try to avoid this problem. The only world I have left from 1.15 is my spawn world

tough kraken
#

maybe paste the whole error?

#

?paste

tawny whale
#

I was digging through my files and I found that there was a stray 1.15 spigot jar hiding out, and deleted a few plugins that could be conflicting with it

worldly heathBOT
tough kraken
#

now its fixed?

tawny whale
#

I haven't had any crashes yet, but they happen very inconsistently

tough kraken
#

well good luck in future 🙂

tawny whale
#

I had someone go on and spam /rtp and ender pearls, which could be contributing to the crashing, and the server didn't crash at all. So, I'll update again when/if it crashes again

limpid yoke
#

Issue ticket shout-out

I were looking to how to make translate text (text that change depend on the player client language setting //rp dependent) and I run into a problem. I digging around and found that the ticket created on Mar/19 but it hasn't been fix yet.

So I need some help please vote the ticket to push it up. 🔥 thx a lot

frozen cedar
#

Is there a way to make blazes not fly? I have AI disabled and gravity set to true but they don't fall

marsh hawk
#

apply a constant velocity

frigid ember
#
   public static void main(String[] args)
or a JavaFX application class must extend javafx.application.Application``` ?
#

[17:33:40] [Server thread/ERROR]: Cannot load plugins\AdvancedHelp\gui.yml
org.bukkit.configuration.InvalidConfigurationException: while parsing a block mapping
in 'string', line 615, column 9:
item-name: '&9? ? ? &f&lNo Grief ...
^
expected <block end>, but found '<scalar>'
in 'string', line 620, column 25:
- '&bIf you don't have permission to'
^

    at org.bukkit.configuration.file.YamlConfiguration.loadFromString(YamlConfiguration.java:56) ~[server.jar:git-Spigot-800b93f-8160e29]
    at org.bukkit.configuration.file.FileConfiguration.load(FileConfiguration.java:160) ~[server.jar:git-Spigot-800b93f-8160e29]
    at org.bukkit.configuration.file.FileConfiguration.load(FileConfiguration.java:128) ~[server.jar:git-Spigot-800b93f-8160e29]
    at org.bukkit.configuration.file.YamlConfiguration.loadConfiguration(YamlConfiguration.java:183) ~[server.jar:git-Spigot-800b93f-8160e29]
#

at me.codedred.advancedhelp.data.files.GUI.reloadConfig(GUI.java:32) ~[?:?]
at me.codedred.advancedhelp.commands.AdminHelp.onCommand(AdminHelp.java:47) ~[?:?]
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[server.jar:git-Spigot-800b93f-8160e29]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:149) ~[server.jar:git-Spigot-800b93f-8160e29]
at org.bukkit.craftbukkit.v1_15_R1.CraftServer.dispatchCommand(CraftServer.java:711) ~[server.jar:git-Spigot-800b93f-8160e29]
at me.codedred.advancedhelp.listeners.AdminGUIClick.onAdminClick(AdminGUIClick.java:29) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_251]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_251]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_251]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_251]
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:316) ~[server.jar:git-Spigot-800b93f-8160e29]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[server.jar:git-Spigot-800b93f-8160e29]
at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:529) ~[server.jar:git-Spigot-800b93f-8160e29]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:514) ~[server.jar:git-Spigot-800b93f-8160e29]
at me.codedred.advancedhelp.listeners.GUIClick.onClick(GUIClick.java:30) ~[?:?]
at sun.reflect.GeneratedMethodAccessor41.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_251]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_251]