#help-development

1 messages · Page 2279 of 1

tacit drift
#

i made the response to be the html file

#

💀

#

and so any request would be the html file

quiet ice
#

Smh

tacit drift
#

:))))))

eternal oxide
#

or its a 403 and you don't have the correct file permissions

tacit drift
#

nah

quiet ice
#

We assumed it was a regular-ish webserver

eternal oxide
#

^

torn shuttle
#

I really want to dissect the brain of people who show up on my support chatrooms, say they want free stuff because they're from X country where money isn't a thing, actually get free stuff and then tell people to go fuck themselves

eternal oxide
#

Anyone who asks for free stuff because of XX is overly self entitled. Never give.

quiet ice
torn shuttle
#

I am not giving them anything special, I just have a lot of free content out there

#

and people don't read

#

one of these days I will go off the deep end and actually find a way to disable my plugin remotely on servers that just really annoyed me lol

eternal oxide
#

hard to tell what server teh ass is on

quiet ice
#

Could be easy

eternal oxide
#

unless you add a special key to any versions you give away

quiet ice
#

Just send them a rat

torn shuttle
#

if I really wanted to it wouldn't be that hard to do, just make them open tickets with some persistent server id generated by the plugin

cunning canopy
#

any way to remove all values from a scoreboard?

torn shuttle
#

then host a blacklist somewhere the plugin reads and if the server is blacklisted don't initialize the plugin

quiet ice
#

Yeah

rugged lagoon
#

Annybody here a mongodb shard expert got a problem with a plugin that only work standalone.. seems to be a problem with SingleResultCallback

eternal oxide
#

fetch teh blacklist when your plugin checks for any updates 😉

torn shuttle
#

well who knows I've been doing this every day for 5 years now, maybe in 5 more years I will actually act on it

eternal oxide
#

its better to not disable your plugin. Sabotage is better

torn shuttle
#

that is against TOS and generally not something I'd want to do

eternal oxide
#

Like the arkham devs made Batman spaze out when flying if the game was cracked.

#

So many posts complaining about it until they posted it was anti piracy

quiet ice
torn shuttle
#

boy things are getting heated, my AC is overheating again

tardy delta
#

System.exit(0) is the best

eternal oxide
#

randomly 🙂

torn shuttle
#

there's some fun anti-piracy things you can do that are fine with the TOS if you want to do a little trolling

tardy delta
#

tell us

noble lantern
#

sadness still get that same msg

torn shuttle
#

message every non-op (or non-admin if you can be bothered to do a few permission checks) that a server is running pirated content if that is the case and then recommending them better servers to play on lol

tardy delta
#

lmao

torn shuttle
#

see how long it takes before admins realize where that message is coming from

young knoll
#

Strip all the signatures from chat messages to annoy players with that little warning icon

torn shuttle
#

oh yeah

#

you could do a little chat reformatting

eternal oxide
#

Anything it does should be quite random. Makes it near impossible to track down

torn shuttle
#

maybe add come cool prefixes like [asshole]<username>: if they really managed to go out of their way to be a dick or [pirate]<username>: if they are running pirated content

#

but only do that every 10th boot

#

and only for 5 minutes at a time

#

is it against TOS to make it look like another plugin is doing things your plugin actually is lol

eternal oxide
#

No clue

#

If it was me I'd just make it random enough to be near impossible to track down without removing plugins

#

after all the whole end goal is to get them to remove your plugin, but have some fun first

young knoll
#

Fill ram 1 byte at a time

torn shuttle
#

every 15 minutes fill the console with "errors" from a random plugin in their plugin list

eternal oxide
#

or plugins NOT in their plugin list 🙂

#

That will confuse them

torn shuttle
#

SpigotMalware.jar has thrown a null pointer exception!

tardy delta
#

then you have users which ignore console errors ;/

eternal oxide
#

Throw the error in chat 🙂

tardy delta
#

like people asking here i have a error in my console and its literally full of it

torn shuttle
#

NSAWatchdog has thrown a CME!

#

once got a message from a user asking to help diagnose an error

#

it was a really weird error

#

couldn't figure it out

#

asked for the full log

#

170k lines of errors before mine

eternal oxide
#

lol

torn shuttle
#

async thread was fucked

earnest forum
#

if i'm trying to modify a FileConfiguration in a hashmap, do i have to re-put the FileConfiguration object back into the hashmap? or can i just modify it

eternal oxide
#

um an FC in a hashman?

young knoll
#

They are mutable

#

So you can just modify it

earnest forum
#

thanks

noble lantern
#

Holy shit

#

sometimes i question how i make shit work

#

so after signing a cert, you can just change the ip to the secondary one since the ip isnt tied

#

why does that feel so redneck

frozen cedar
#

find WOODEN_HOE in player inventory and set damage

#

how?

#

help please

noble lantern
#

loop through the players inventory and if ItemStack.getType == Material.WOODEN_HOE do your thing

frozen cedar
#

Is the if (inv.contains(Material.WOODEN_HOE)) check necessary or useless?

eternal oxide
#

useless

frozen cedar
#

before loop

#

ok

eternal oxide
#

your inventory will never contain a Material

#

it Contains ItemStacks and null/Air

earnest forum
#

is it safe to do file operations statically

frozen cedar
eternal oxide
#

remove teh first if it will never be true

eternal oxide
#

if(inv.contains(Material.WODDEN_HOE) {

#

that will NEVER be true

smoky oak
#

isnt that missing a parenthesis

#

you cant even compile

tardy delta
eternal oxide
#

my typing from screenshots 🙂

tardy delta
#

wodden hoe lets goo

frozen cedar
eternal oxide
#

an inventory will NEVER contain a Material

earnest forum
#

an inventory contains item stacks not materials

smoky oak
#

actually does it run correctly if you check against a entry of an enum thats non existent, or will it err out at compile/execution?

#

or is it just considered null

eternal oxide
#

contains usually accepts an Object so it would probably compile

#

just never pass

smoky oak
#

no i meant if you check for example a direction against BlockFace.FORWARDS which doesnt exist does it give an error or just return false

eternal oxide
#

Wow I've been schooled 🙂

#

seems Inventory does support a Material contains

eternal oxide
#

keep it then 🙂

frozen cedar
ivory sleet
#

Tho that’s at most just a helper method

#

Wrong import probably

#

There are two Damageable

eternal oxide
#

One for Entity and one for Meta

ivory sleet
#

^

frozen cedar
smoky oak
#

this is the same annoyance as with shulkers again

noble lantern
#

be lucky you werent here when you had to add damage to coacoa beans to get lapis

#

or colored glass

eternal oxide
#

lol yep, damage values for wool color

noble lantern
#

was annoying asf

#

i seriously wonder who thought of that, or if thats minecraft code and not spigot

#

either way i still wonder

eternal oxide
#

I'm glad I took a break and didn't have to rewrite my code handling that.

noble lantern
#

i would of been pissed cause i would made a whole system for that

#

jesus finally

#

weirdest ptero install ive ever done

#

daemon is in ssl... doesnt like the ssl port so it needs http port

#

yet is communicating in ssl okay 😐

tardy delta
#

github smh

noble lantern
#

are

#

you

#

no your not

#

you cant be

#

theres no fucking way your pushing commits by dragging and dropping files into the github website...

#

pls

#

tell me your not

tardy delta
#

dunno how to do it via vscode lmao

noble lantern
#

github desktop

#

look into it

torn badge
noble lantern
#

grafana time

tardy delta
#

just looking at code

smoky oak
#

i found that the intellij github integration works well enough

noble lantern
#

yeah it does ngl

#

it used to be shit

tardy delta
#

lmao updated 50 dlls to github

devout bronze
#

hey guys ! i was developing my lifesteal plugin
so when i change the hearts of players on lifestael world they keep their amount of hearts on hub too i want it to reset hearts on hub world and set it back once joined lifesteal world
is there a plugin o store player data per world

eternal oxide
#

?pdc store their Max health under a world key

short raptor
#

Say I have a config file

test:
  item1: 1
  item2: 409358
  item3: -2304230

What's the method to get all the items under test?

eternal oxide
#

config.get("test").getValues(true)

tardy delta
#

getConfigSection

eternal oxide
#

^

short raptor
#

getConfigurationSection I assume?

eternal oxide
#

yes, then getValues

tardy delta
#

uh oh i found my first discord bot ever made

short raptor
#

Fun times

tardy delta
#

its made in js 💀

short raptor
#

I learned Python through making Discord bots so the code is horrific

#

That first bot was also my first time in Python

tardy delta
sage patio
#

can i create a armor stand without spawning that?

eternal night
#

not from the API

golden turret
#

yes

eternal needle
#

hi do some one know if its poseble to move a intellij proj... to my new computer?

delicate lynx
#

just copy the folder

eternal needle
#

what folder?

delicate lynx
#

the project folder

eternal needle
#

but where?

eternal night
#

the new computer ?

eternal needle
#

i have a new one now

eternal night
#

Well then copy the folder from the old one onto the new one ?

eternal needle
#

hole folder?

eternal night
#

Yes

eternal needle
#

and do i need to install plugin first?

eternal night
#

if you want plugins then yes ?

eternal needle
#

no i did use one on intelij

#

do i need that?

tardy delta
#

copy iDeaProjects folder

#

then reinstall it

eternal night
#

you don't need any plugin but yea, if you wanna use that then install it 👀

tardy delta
#

cuz it will give you a plain new ij installation on ya new pc

eternal needle
tardy delta
#

plugins

eternal needle
#

so i take the hole folder in to appdata and reinstall?

eternal night
#

wat

#

you copy over the project folder

#

like your /home/blobsky/documents/ideaprojects/myawesomeproject

#

and just copy it somewhere onto your new computer

tardy delta
#

or just put in on gh 😏

eternal oxide
#

Pen and paper is teh safest way to transfer

eternal night
#

then you install intellij on the new PC like any other program and open that folder

eternal needle
#

i don't find the folder

eternal night
#

Well if you cannot find your code then that is a rather unfortunate situation for you

eternal needle
#

send a vid pls

eternal night
#

you are trolling right ? XD

eternal needle
#

nope

#

do you mean a folder when i have the program open?

tardy delta
#

C/users/ya name/IdeaProjects

#

or well where you installed it

eternal night
#

If you want to transfer the project "CoolPlugin" from your old PC to the new one then copy the folder "CoolPlugin". Where you created that is completely up to you

#

but yea, that is the default I guess on windows ^

eternal needle
#

but in the program?

tardy delta
#

or just rightclick on a project open in explorer in intellij itslf

eternal needle
#

what java versjon do i need?

eternal oxide
#

19

eternal night
eternal needle
#

i hav 18 and it say openjdk-17 is missing

eternal oxide
#

oh no

#

do they still do adverts on milk cartons?

placid birch
#

what java should i use if im coding a plugin for a 1.19 server?

eternal oxide
placid birch
#

ok ty

eternal oxide
#

lol, that was a joke for someone else, but 17 is fine 🙂

placid birch
#

oh my bad lol. so will the plugin work for all previous versions too?

eternal oxide
#

no

#

well, yes and no

#

depends what version you build for

#

Mc/Spigot 1.19 requires java 17 (I think)

#

But if you set teh API version in your plugin.yml lower and set the compiler.source and target in your pom to lower, it can run

#

but you lose functionality

placid birch
#

ok i will try to figure it out. im pretty new to java so i dont understand everything you're talking about, but thank you.

eternal oxide
#

Build for the lowest version you want to target

dreamy canopy
#

hey guys do you know where is the problem plz ? I don't understand I get an IndexOutOfBoundsException: Index 1, Size: 1 with that code

placid birch
#

i dont think you can write chatcolor just like that

dreamy canopy
#

like §b ?

placid birch
#

ChatColor.translateAlternateColorCodes('&', "message");

#

i think it should be like that

dreamy canopy
#

no it works with just §

placid birch
#

oh it does?

dreamy canopy
#

yes

#

it's easier than ChatColor.

eternal oxide
dreamy canopy
#

okay I think I see but How can I fix that

eternal oxide
#

You are looping over your List using the index of your inventory size? Thats never going to work unless they are the exact same size

dreamy canopy
#

okay because I just want to check if inventory contains an itemstack who is contained in blacklist

eternal oxide
#
for (Material item: list) {
    if (inv.contains(item)) {```If your list is a List of Materials.
dreamy canopy
#

it's a list of items

eternal oxide
#

change to ItemStacks else

dreamy canopy
#

okay thx so much I'm gonna try this

dull whale
#

how can I break an elytra, or create a broken elytra

worldly ingot
#

Correct. Set its damage to Material.ELYTRA.getMaxDurability()

sharp flare
#

are there any ways to check if a block is a wall torch-able

eternal oxide
#

um, if its already a block then its already a wall torch. Do you mean ItemStack?

lost matrix
sharp flare
#

yeah

#

attached at the block

#

since torch and wall torch are different from each other

#

wall torch is directional

#

is there a specific tag for checking this

eternal oxide
#

All torches CAN be attached to as block.

#

You want to see if it is?

sharp flare
#

I'm not doing the attaching manually but through raytracing

#

when the raytrace result hits a block i gotta check

lost matrix
sharp flare
#

aight, thanks

eternal oxide
#

or get the material and see if it has WALL_TORCH in its name

eternal night
#

choco added API for this like a few days ago no ?

sharp flare
eternal night
eternal oxide
#

That would also apply for ladders

meager crest
#

who wanna make a- srv

sharp flare
#

I'do an isSolid check first, I'm currently supporting older spigot versions

#

I could do cross version checks if isSolid check aint enough

#

since lynx mentioned a new api for it

worldly ingot
#

My friend, I did just add those methods to 1.19 PES_Blush

#

Oh Lynx beat me to it

#

Update your server if you haven't already but yeah those are the methods you want

eternal night
#

I'm currently supporting older spigot versions

#

is their issue ^

worldly ingot
#

Oop, in that case, yeah, isSolid()

sharp flare
#

Currently the plugin supports 1.15-1.19.x

worldly ingot
#

Nothing else you can do

#

It was the whole reason I added those methods. I needed them for a plugin I was writing lol

sharp flare
#

once most servers are out from those older versions, I'd ditch supporting older versions

worldly ingot
#

I mean 👀

#

Are you tracking this yourself with Metrics? Because as far as I'm concerned, 1.18 is the most used version

#

At least with my userbase

sharp flare
#

bstats

worldly ingot
#

Actually, 1.19 is the most used for me

#

4.25k servers, 56% on 1.19

#

21% on 1.18

sharp flare
worldly ingot
#

Yeah, bigger concerns for you are those 1.18 versions which still consist of about 45% of your userbase

#

The other 17% or so on 1.17 and 1.16 are marginal and could be dropped. Remember that server owners can still use older versions of your plugin

#

They lose out on features, but they do that anyways by running an older version of Minecraft

sharp flare
#

will take a look at it soon, since I never really like supporting older versions for numerous reasons

worldly ingot
#

I like to hear that lol

#

but ye, for 1.19, those methods will be super handy. I specifically added them for torches and amethyst buds

sharp flare
#

for that I appreciate you, cheers

worldly ingot
#

o/

eternal oxide
#

darkreader hates teh bstats website 😦

#

I have teh choice of blinding white, or unreadable

dreamy canopy
#

hi back ! do you know if it's possible to check if an item is cooking

tardy delta
#

hello back

lost matrix
dreamy canopy
#

yes

worldly ingot
#

If it's > 0, somethin' be cookin'

lost matrix
#

^

dreamy canopy
#

thx a lot !

manic furnace
#

Is it better to use a infinity while or a runnable in java net?

tardy delta
#

?scheduling

undone axleBOT
eternal night
#

I mean, a runnable just runs things once

#

not really the same as a while(true) loop

manic furnace
#

I mean to scheduel

valid solstice
#

is there a way to make leather armor have the same durability as netherite?

tardy delta
#

while true on the main thread will not like that

manic furnace
#

Yes it crashes the server

tardy delta
#

i mean while true is synchronized on the device hardware, the scheduler methods on the tps

sharp flare
#

I thought these aint full solid blocks

tardy delta
#

why does it always looks ass

lost matrix
lost matrix
tardy delta
#

btw is calling event.setstuff safe on the cf threadpool?

worldly ingot
#

Some of its faces aren't sturdy, but the block is solid

sharp flare
#

aight, just a bad assumption from me

ivory sleet
worldly ingot
#

tbqh with you, I would just ignore stairs and slabs entirely if that's an option

tardy delta
#

uh oh smells like problems

ivory sleet
#

You’d have to join the thread that’s running the mutation statement in the event listener callback

valid solstice
sharp flare
#

same with fences and other stuffs xD

worldly ingot
#

Right

#

and unfortunately that's something you have to manually list out

tardy delta
sharp flare
#

yeah tedious but doable

lost matrix
tardy delta
#

the whole chain is joined then ig

#

hmm y

lost matrix
#

Joining mitigates this obvsly

sharp flare
#

I'd just check on some other tags for it

worldly ingot
#

Right

#

This was my recent implementation (because we were still writing against 1.18.2),

    private static final Set<Material> IGNORED_SOLID_BLOCKS = new HashSet<>();

    static {
        IGNORED_SOLID_BLOCKS.addAll(Tag.SLABS.getValues());
        IGNORED_SOLID_BLOCKS.addAll(Tag.STAIRS.getValues());
        IGNORED_SOLID_BLOCKS.add(Material.AMETHYST_CLUSTER);
        IGNORED_SOLID_BLOCKS.add(Material.SMALL_AMETHYST_BUD);
        IGNORED_SOLID_BLOCKS.add(Material.MEDIUM_AMETHYST_BUD);
        IGNORED_SOLID_BLOCKS.add(Material.LARGE_AMETHYST_BUD);
    }
#

Which sucks, but I had no choice lol

tardy delta
#

so in my case it should be fine right? (as im calling cf::join on the end?)

sharp flare
#

thanks

tardy delta
#

ah good good

worldly ingot
#

(I ignored buds and clusters there specifically because I was placing buds next to buds, so they'd stick to one another lol)

ivory sleet
#

But joining isn’t exactly the cheapest thing to do, but if you really need then do it

tardy delta
#

hmm i was always wondering if that join method worked like the toList method on a stream

ivory sleet
#

Ugh what

tardy delta
#

so the whole thing is a chained method but the stuff iis only executed when you call toList or smth

sharp flare
worldly ingot
#

Order isn't important (hence the Set) and its contains operation is faster than a List

ivory sleet
#

Ig you could draw a distant parallel brush

worldly ingot
#

EnumSet would be ideal but there are efforts to make Material not an enum anymore

#

Up to you

sharp flare
#

oh for most of the time I thought list was faster, I'm badly doomed

tardy delta
#

and what kind of animal is a distant parallel?

worldly ingot
#

tbh the Material enum is large enough to where an EnumSet's benefits aren't even applicable

#

HashSet is fine

sharp flare
#

fair, I'd do hashset

ivory sleet
tardy delta
#

ah yes 🤔

ivory sleet
#

But iirc toList just uses collect internally

opal juniper
worldly ingot
#

Ye

ivory sleet
#

Which is just a glorified binary operation

tardy delta
#

uhhm ye wtf

sharp flare
ivory sleet
#

Oh nvm

#

I was wrong

analog inlet
#

Hey guys im trying include full spigot server(with nms) into my project classpath using gradle. I followed this https://www.spigotmc.org/wiki/spigot-gradle/#build-gradle-kts. But some libraries can not be find(com.mojang:authlib:3.5.41 com.mojang:datafixerupper:5.0.28 and com.mojang:logging:1.0.0). How can i fix this problem

ivory sleet
#

joining a CF would just make current thread await the computation for the thread that’s running the computation

#

Unless interruption or sth yk

tardy delta
#

yes

#

i dont want to write two separate methods to load a user sync and async :/ as i need both

#

and those methods should be specified in the database interface

ivory sleet
#

I usually have an async view, and a sync view

#

Whenever I am facading something like IO related

ivory sleet
#

But yeah

tardy delta
#

hmm well actually i could write two methods

#

as im not interacting with the Database but the DatabaseWrapper

#

brr

ivory sleet
#

Well, main issue is that CF::join would imply that you in principle use concurrency when it’s not needed

#

so then, just running the computation as is might reduce some footprint

worldly ingot
#

Are you loading data on join or something?

tardy delta
#

yes

worldly ingot
#

AsyncPlayerLoadEvent

ivory sleet
#

Is that a thing?

worldly ingot
#

PreLogin*, sorry

tardy delta
#

thats why am blocking the async thread kekw

ivory sleet
#

Ah ye

tardy delta
worldly ingot
#

Do synchronous computations there because the event is async

tardy delta
#

youre late

worldly ingot
#

o

tardy delta
#

but ye i might want to not use a cf there

#

and then in other code i want :/

lost matrix
worldly ingot
#

Ye that makes sense

tardy delta
ivory sleet
lost matrix
ivory sleet
#

🥲

lost matrix
#

But there is still a short timeframe where data could be lost.

ivory sleet
#

Myeah it’s far from ideal, just sitting here and praying everything is going as it should

tardy delta
#

basically me everyday

#

hmm so this would be the sync way

#

well both are sync but i mean without the cf

ivory sleet
#

Looks like it

#

Btw I believe you can use the shorthand method disallow instead

tardy delta
#

oh thats smth too

#

btw does it make a difference to print a stacktrace before doing like recovery stuff in a catch block or doesnt it matter?

ivory sleet
#

Recovery stuff?

eternal oxide
#

it would be good to know what the error was else there could be a huge number of causes

tardy delta
#

uhh like stuff you would do in a catch block

eternal oxide
#

ever tried debugging a users issues with no stack trace? 😦

tardy delta
#

uh well actually i was asking if i should print the stacktrace before doing other stuff in a catch block?

ivory sleet
#

Doesn’t matter

tardy delta
#

not that exceptions are that heavy but ye

#

ok

lost matrix
tranquil dome
#

In my plugin I cancel the EntityShootBow event. To the player, it seems that it still takes away an arrow, even tho the event has been cancelled. If the player clicks on the shot of the arrows, they will go back to the original amount. Is there a way I can make it so the player doesn't see their arrows disappear?

tardy delta
#

ye i forgot

lost matrix
tranquil dome
lost matrix
tranquil dome
#

Well, it's a plugin made for a 1.8 style pvp.

#

Is there no other way to go around it?

tardy delta
#

hmm i was also thinking about how to bind a player instance to a KingdomsPlayer (my class), lemme show some code
https://github.com/FourteenBrush/xKingdoms/blob/master/src/main/java/me/fourteendoggo/xkingdoms/listeners/PlayerListener.java
like its loading a player on the async pre login and then putting the retrieved kingdomsplayer object into the cache, in the join event, it simply gets it from cache and calls KingdomsPlayer#login(player) to bind a player object to it (for some internal stuff)
maybe i could just use Bukkit.getPlayer(uuid) too but i believe there is a cleaner way
https://github.com/FourteenBrush/xKingdoms/blob/de32143f643f1cb078dc4d5bb8e17d189808cb14/src/main/java/me/fourteendoggo/xkingdoms/player/KingdomPlayer.java#L28

opal juniper
#

Ok so imagine i have a list of a million strings, and then a value for each string. What is the most overengineered way of getting the value of a specific one

tardy delta
#

😳

opal juniper
#

i could just use a map

#

but I want to over engineer this shit out of this

jagged thicket
#

ez

vocal cloud
#

A hashmap?

opal juniper
#

This is cause its for a school project and i get marks for implementing things

opal juniper
vocal cloud
#

Write your own hashmap class?

tardy delta
#

school moment

opal juniper
#

this is the quote on quote "mark scheme"

lost matrix
#

A million strings would be gigabytes of ram in a hashmap

opal juniper
#

and that^

tranquil dome
eternal oxide
#

So much crazy you could do...
A CompleteableFuture which pushes a String to a Queue. A Thread waiting on that queue pulls the key and fetches the value using a regex match of the key.
Add in any other crap to make it really stupid.

#

Tree traversal means not just pulling a key/value. That means searching yourself

opal juniper
#

i dont really see how i can represent it as a tree though thats the main issue

eternal oxide
#

neither do I

long breach
#

can someone help me

opal juniper
#

its a text file in the format

key: value
key: value
#

for a lot more lines lul

tardy delta
undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

eternal oxide
#

You could bubble sort on the key hash

opal juniper
#

oh my god that would take an age no?

eternal oxide
#

yes

long breach
#

I have a server and i had to disable every chest in the world because when i downloaded map there is TONS of chest with items i dont use within the play style of the server i want to link every single one to phatloot but it would takes weeks on weeks because theres over 7000 chest. how can i do it instantly

opal juniper
#

fucking merge sort it when i ingest it

long breach
#

also i cannot install new plugins to my server because when i install plugins it for some reason breaks all permissions, nobody can /warp or anything after ive installed a new plugin

eternal oxide
ivory sleet
opal juniper
#

@eternal oxide what about if i split the key into sections and then use a tree

#

Ie the first 5 chars form one node

#

and then that groups to all the next five

#

I suppose i could sort them all by a comparator like that

#

although that still requires them to be loaded in memory

charred blaze
#

public Configuration configuration = ConfigurationProvider.getProvider(YamlConfiguration.class).load(data);

#

Default constructor cannot handle exception type IOException thrown by implicit super constructor. Must define an explicit constructor

#

bungeecord

#

fixed it

#

public Configuration config;

@Override
public void onEnable() {
    try {
        config = ConfigurationProvider.getProvider(YamlConfiguration.class).load(data);
    } catch (IOException e2) {
        // TODO Auto-generated catch block
        e2.printStackTrace();
    }
#

like this

tardy delta
#

wut

#

wait is that bungeecord stuff or smth?

delicate lynx
#

that's bungee

slim brook
#

Hello guys ! Someone know why when i get CreatureSpawner, I edit value likeCreatureSpawner blockSpawner = (CreatureSpawner) clickedBlockState; blockSpawner.setMinSpawnDelay(10); blockSpawner.setMinSpawnDelay(20);but when i check with command /data get values was not changed

eternal oxide
#

or blockSpawner.update()

slim brook
#

No error in console

eternal oxide
slim brook
tardy delta
#

is it recommended to save config file async when running the server? i mean like big config files like the one from essentials?

dry forum
#

i have https://pastebin.com/VLdkTyDw which gets all blocks between 2 locations, but if given 2 locations how can i get each row of between the 2 locations? sort of hard to explain but if i made a cube y 1 -> y 6 how can i get the rows from y1 -> y6

eternal oxide
slim brook
eternal oxide
#

how did you get teh BlockState?

slim brook
#

teh ?

#

the?

#
            if (clickedBlock.getType().equals(Material.SPAWNER)) {
                BlockState clickedBlockState = clickedBlock.getState();
                CreatureSpawner blockSpawner = (CreatureSpawner) clickedBlockState;
                blockSpawner.setMinSpawnDelay(10);
                blockSpawner.setMinSpawnDelay(20);
                blockSpawner.update(true);
                player.sendMessage("Modif");
            }
        }``` Yes i did
waxen plinth
#

Don't nest if statements

#

Use && or guard clauses

eternal oxide
#

Looks fine to me

#

You are correctly updating the block

slim brook
#

That the pb X)

#

Maybe an restart the server patch ?

#

I only reload

eternal oxide
#

However, max of 20 and min of 10, thats a super fast spawn

slim brook
eternal oxide
#

those are in ticks

slim brook
#

Yes i know

#

You thinks it's maybe the fault of paper ?

eternal oxide
#

and how are you checking the values to see if they changed?

#

no

slim brook
young shell
#

Is there a way to get the Saturation an Item provides when consumed?

eternal oxide
#

so you click the spawner to set values, then use a command to check them?

slim brook
eternal oxide
#

So long as you are actually testing the same block, and its not in the same tick as you set the values, I see no issue

#

Your code looks fine

slim brook
#

Maybe 1.19 problem ?

eternal oxide
#

unlikely

#

I'd test it on Spigot to be sure though

slim brook
#

I will

eternal oxide
#

Paper does some weird stuff with spawning (I believe)

zenith gate
#

Okay so I wanna create mobs that are hard to defeat but base them off of the biome that they spawn in. So if a Zombie spawns in a Jungle it's difficulty would be level 15, and it would have more health and damage. How can I get where the mob has spawned? Can I get the spawn biome of where it spawned? I don't want to change the mobs attribute whene they are in the biome only when they spawn in it.

zenith gate
#

thank you

eternal oxide
#

Entity#getLocation().getBlock().getBiome()

#

listen to the spawn event

#

and modify the Mob as required

zenith gate
#

Ah alright.. I understand it now

young shell
#

Is there a way to get the Saturation an Item provides when consumed? Or do I still need to use NMS do do this?

vivid cave
#

i'm trying to send a respawn packet to the player (just to make the client think it has to fetch the skin again), so it shouldn't affect his position at all, nor his yaw pitch, etc

ClientboundRespawnPacket
(
ResourceKey<DimensionType> dimensionType,
ResourceKey<Level> dimension,
long sha256Seed,
GameType gameMode,
GameType previousGameMode,
boolean debugWorld,
boolean flatWorld,
boolean keepPlayerAttributes,
Optional<GlobalPos> lastDeathPos
)
i struggle getting the first 3

thin lantern
#

how i can manipulate entity nbt?

tardy delta
#

but the FoodLevelChange event has a getFoodLevel method, dunno if thats what youre lookin for

eternal oxide
trail lintel
#

Hey guys, question for you. I have an existing custom item that uses the ender pearl as a base item for people who don't have the texture pack. However, since I am using Material.ENDER_EYE as the base, it comes with some caveats. If I want to support enchantments (mending for example), I need to use a tool or a something as a base that supports mending. I think I have a way around this, but I want to be sure there isn't an easier way first.

I was thinking about listening to the InventoryMoveItemEvent for when the custom item is placed into the enchanting table, then replacing the item itself with an item that supports the enchants I want (skinned to match the normal custom item for continuity), then listening to the EnchantItemEvent and replacing the result with the original custom item + the enchantments that were on the mock item.

Its possible this whole process is crazy convoluted so I was wondering if anybody knew a simpler way, thanks in advance!

eternal oxide
#

You probably need to send a ClientboundPlayerInfoPacket for ClientboundPlayerInfoPacket.Action.REMOVE_PLAYER and again for ClientboundPlayerInfoPacket.Action.ADD_PLAYER

young shell
slim brook
#

Ok so it's not Paper

eternal oxide
#

first to 10, second to 20

slim brook
#

XD

#

Thx c/p

onyx fjord
#

what do yall think about saving player inventory to file all the time instead of on server stop

#

i personally think its safer

#

lets say server crashes right

tardy delta
#

what do yall think about not using plugins that make the whole server crash

onyx fjord
#

which one does that

tardy delta
#

well why would you do that if nothing is going to crash

onyx fjord
#

no look

#

lets say

#

server crashes somehow

#

not by plugin

#

there are disasters, other plugins, lag etc

#

i dont think few kb of files being managed every x seconds is a lot

vivid cave
# eternal oxide You probably need to send a `ClientboundPlayerInfoPacket` for `ClientboundPlayer...

to be fair, I haven't tested. But according to what i'm seeing online, this wouldn't be sufficient; updating someone's skin happens in multiple steps: (at least for older version)

  1. sending info packet "removing player" to everyone
  2. update their gameprofile with new textures
  3. sending info packet "adding player" to everyone
  4. refreshing the player for self (that is "telling all the client to retrieve the information of the player again") and a way to do that is respawning the player
    Here's how they did it (but that's old code, those fields don't exist anymore)
PacketPlayOutRespawn respawn = new PacketPlayOutRespawn(ep.getWorld().getDimensionManager(), ep.getWorld().getDimensionKey(), ((long)player.getWorld().getSeed()),
                ep.d.getGameMode(), ep.d.getGameMode(), false, false, true);```
5) refreshing the player for the other players

**Ressource (but for <= 1.17):** https://www.spigotmc.org/threads/refreshing-the-player-applying-skin-texture-example-used.525091/
**Some already given inputs (but <= 1.17):** https://www.spigotmc.org/threads/refreshing-the-player-applying-skin-texture-example-used.525091/
tardy delta
#

well idk if players inventory is saved every x time but if it isnt you might want to do it yourself i guess

opal juniper
#

its not terrible by any stretch of the imagination...

#

Around 1.2 seconds to parse 1million entries

#

and cause of the maps, near instant lookup

eternal oxide
dreamy canopy
#

guys do you know if it's possible to get the floor type (block type) at the PlayerDropItemEvent ?

tardy delta
#

getItem().getType()?

slim brook
#

@eternal oxide Ok i don't know why but know the code work -_-

#

THx a lot

dreamy canopy
tardy delta
dreamy canopy
#

not really I would like to send message if the floor is a block of stone and if the item is dropped on the floor

tardy delta
#

so you need the location where the item lands?

dreamy canopy
#

so I throw the item on the floor and if the floortype is stone we send message

#

yes I need the location of the item at the floor

tardy delta
#

the drop is an entity and so has a getLocation

#

dunno if thats the correct location too

stark nebula
#

How do I check if a block is a mob-spawner is a 1.8.8 - 1.19 compatible way? Currently doing if(loc.getBlock().getType().getId() == 52)
Material.SPAWNER && Material.LEGACY_MOB_SPAWNER both aren't working on 1.8.

dreamy canopy
#

entity is the Thrower ?

fiery prairie
#
#externalclass1
    public boolean onCommand(CommandSender sender, Command command, String label , String[] args){
        if(command.getName().equalsIgnoreCase("vanish")){
            if(sender instanceof Player){
                Player p = (Player) sender;
                if(p.hasPermission("evanishplus.vanish")){
                    if(plugin.invisible_list.contains(p)){
                        for (Player people : Bukkit.getOnlinePlayers()){
                            people.hidePlayer(plugin, p);
                        }
                        plugin.invisible_list.remove(p);
                        p.sendMessage("you r now vanished");
                    }else if(!plugin.invisible_list.contains(p)){
                        for (Player people : Bukkit.getOnlinePlayers()){
                            people.showPlayer(plugin, p);
                        }
                        plugin.invisible_list.add(p);
                        p.sendMessage("you r no more vanished");
                    }
                }
            }else{
                System.out.println("Wrong executor for this command, please enter the server!" );
            }
        }



#external class2 
    @EventHandler
    public void onJoin(PlayerJoinEvent e){
        Player p = e.getPlayer();
        for (int i = 0; i < plugin.invisible_list.size(); i++){
            p.hidePlayer(plugin, plugin.invisible_list.get(i));
        }
    }
}

#mainclass
    public ArrayList<Player> invisible_list = new ArrayList<>();

hello, above i have put everything I use for a vanish command, external class2 is supposed to hide all vanished players from a player who just joined the server, because otherwise he can still see a vanished player unless he was on the server while the player typed the vanish command

However the external classes 2 job doesnt seem to be done, how can i fix that?

tardy delta
#

no

#

check docs pls

fiery prairie
#

me?

tardy delta
#

no

fiery prairie
#

oh ok

dreamy canopy
#

okay

tardy delta
#

stuff he added

frozen cedar
#

I have 10 doors (figuratively) and 1 is the same. what can I then do with it in order to understand in the code this is that door?

tardy delta
#

wha

frozen cedar
#

when I track a click on a block in the plugin, I need to understand that a person clicked on this door, for example

tardy delta
#

PlayerInteractEvent lol

#

check the blocktype and stuff and cast it to a door

agile anvil
#

And define how you need to differentiate this door 😂

frozen cedar
#

That's exactly how?

frozen cedar
gusty bough
#

Hey, I would like to get the block that the player is standing on. I use player#getLocation()#getRelative(BlockFace.DOWN);
The problem is that on slabs; stairs etc... (non full height blocks) i get the blocks under the slab, stairs etc instead of the good one. Any idea how to fix?

#

I tried to calculate with block height but seems like there is no way to get blocks height

agile anvil
agile anvil
gusty bough
#

Doesn't work

#

On slabs etc

agile anvil
frozen cedar
gusty bough
#

I want the block the player is standing on

agile anvil
#

Then substract 0.4 and I guess it will work

agile anvil
frozen cedar
#

what to do with the door, then to understand what it is in the event

gusty bough
quaint mantle
#

[16:54:55 ERROR]: Error occurred while enabling DeepSMP_plugin v1.0-SNAPSHOT (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "[Ljava.lang.String;.clone()" because "this.rows" is null
at org.bukkit.inventory.ShapedRecipe.getShape(ShapedRecipe.java:195) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_19_R1.inventory.CraftShapedRecipe.fromBukkitRecipe(CraftShapedRecipe.java:32) ~[paper-1.19.jar:git-Paper-58]
at org.bukkit.craftbukkit.v1_19_R1.CraftServer.addRecipe(CraftServer.java:1389) ~[paper-1.19.jar:git-Paper-58]
at org.bukkit.Bukkit.addRecipe(Bukkit.java:971) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]
at deepsmp_plugin.deepsmp_plugin.Main.onEnable(Main.java:118) ~[DeepSMP_plugin-1.0-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:536) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_19_R1.CraftServer.enablePlugin(CraftServer.java:563) ~[paper-1.19.jar:git-Paper-58]
at org.bukkit.craftbukkit.v1_19_R1.CraftServer.enablePlugins(CraftServer.java:477) ~[paper-1.19.jar:git-Paper-58]
at org.bukkit.craftbukkit.v1_19_R1.CraftServer.reload(CraftServer.java:1018) ~[paper-1.19.jar:git-Paper-58]
at org.bukkit.Bukkit.reload(Bukkit.java:909) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]

quaint mantle
#

?paste

undone axleBOT
agile anvil
#

We can't help you LMAO, you have to choose how to differentiate this door : maybe you can save it's location, or maybe count it relatively. When you'd successful choose how to differentiate this door from other doors, we can tell you how to do

frozen cedar
#

put a block under the door and then check which block is in the code

gusty bough
#

Its sad that there is no created method to get the exact block the player is standing on

#

I think the only way is to get the actual block height but there is no such method

hot wolf
#

Hey! I'm trying to prevent users to put items into specific slots, and it works. Unless the player clicks really fast. Is there a specific reason for that?

agile anvil
# gusty bough Doesn't work either.

Then do a if statement: if the player location modulo (int) location is > 0.2, get the current block at the location. Else get the block under (if it's air, get the block under the under block)

agile anvil
quaint mantle
#

[16:54:55 ERROR]: Error occurred while enabling DeepSMP_plugin v1.0-SNAPSHOT (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "[Ljava.lang.String;.clone()" because "this.rows" is null
at org.bukkit.inventory.ShapedRecipe.getShape(ShapedRecipe.java:195) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_19_R1.inventory.CraftShapedRecipe.fromBukkitRecipe(CraftShapedRecipe.java:32) ~[paper-1.19.jar:git-Paper-58]
at org.bukkit.craftbukkit.v1_19_R1.CraftServer.addRecipe(CraftServer.java:1389) ~[paper-1.19.jar:git-Paper-58]
at org.bukkit.Bukkit.addRecipe(Bukkit.java:971) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]
at deepsmp_plugin.deepsmp_plugin.Main.onEnable(Main.java:118) ~[DeepSMP_plugin-1.0-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:536) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_19_R1.CraftServer.enablePlugin(CraftServer.java:563) ~[paper-1.19.jar:git-Paper-58]
at org.bukkit.craftbukkit.v1_19_R1.CraftServer.enablePlugins(CraftServer.java:477) ~[paper-1.19.jar:git-Paper-58]
at org.bukkit.craftbukkit.v1_19_R1.CraftServer.reload(CraftServer.java:1018) ~[paper-1.19.jar:git-Paper-58]
at org.bukkit.Bukkit.reload(Bukkit.java:909) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]

opal juniper
#

Sir, this is Spigot

agile anvil
quaint mantle
#

uh yes no i mean no

hot wolf
quaint mantle
#

wait lemme see

agile anvil
hot wolf
#

Java moment

#

thx tho

frozen cedar
#

How to make a safe and fast teleport to a random position?

quaint mantle
#

Bukkit.addRecipe(Recipe3);

ornate patio
#

is there a door open/close event

quaint mantle
#

do i delete it ?

ornate patio
#

for players and villagers

eternal night
#

cam you provide the entire code here ?

#

including the addRecipe calls

quaint mantle
eternal night
#

Yea

quaint mantle
#

this is the entire code

eternal night
#

mb

frozen cedar
eternal night
#

I cannot scroll

#

your issue is with recipe3

quaint mantle
#

oh wait

eternal night
#

you are shaping recipe

#

not recipe3

#

which leads to a shapeless shaped recipe

#

which errors

quaint mantle
#

the code too long

eternal night
#

hm ?

quaint mantle
#

i cant paste hre

#

here

#

i need nitro

#

do i deleted recipe 3 ?

eternal night
#

don't anyway

#

no

quaint mantle
#

or change it

eternal night
#
ShapedRecipe recipe3 = new ShapedRecipe(new NamespacedKey(this, "FINAL_SWORD"), FinalSword);
        recipe.shape("   ","SC ","   ");
        recipe.setIngredient('S', new RecipeChoice.ExactChoice(DarknessSword));
        recipe.setIngredient('C', new RecipeChoice.ExactChoice(CustomIngot));
#

like, you want to recipe3.shape(bla bla bla)

#

and so on

quaint mantle
#

OH

eternal night
#

you are using the wrong variable

quaint mantle
#

YES

#

ok thx

ornate patio
zenith gate
#

?jd-s

undone axleBOT
ornate patio
#

ive already looked

#

i dont see an event that could work for villagers

eternal night
#

a block redstone event should be fired

#

that is about it

zenith gate
#

is loot table used for zombie/entity drops?

ornate patio
#

i also can't really get the player who opened the door with this event (if a player did open it)

eternal night
#

should be

#

no

#

beyond interact

ornate patio
#

huh

gusty bough
agile anvil
gusty bough
#

oh yeah mb

cunning canopy
#

im trying to do a countdown on a scoreboard. What is the best most efficient way to update the lines without flickering?

vast zenith
#

so im wanting to make a reload command for my plugin and for some reason this isn't working


        if (cmd.getName().equalsIgnoreCase("pcreload")) {
            config = YamlConfiguration.loadConfiguration(PokeClearPlugin);
            sender.sendMessage(ChatColor.YELLOW + "PokeClear has been reloaded");


        }

        return true;
    }```
vast zenith
#

it just says command doesn't exist when I run it as a player, but no errors in intellij

cunning canopy
#

oh

vast zenith
#

and when i do it through console it doesn't work either

cunning canopy
#

Did you remember to register the command in your plugin.yml?

gusty bough
vast zenith
#

ye this is what I have

  pcreload:
    usage: /pcreload
    description: reloads config.yml for PokeClear!```
#

or would i do this

#

pcreload:
usage: /<command>
description: reloads config.yml for PokeClear!

cunning canopy
#

so

#

I think the things needs to be in quotes

#

and commands is lowercase

#

the aliases might also be necessary

vast zenith
#
  pcreload:
    usage: "/pcreload"
    description: "reloads config.yml for PokeClear!"
    aliases: "pokeclear"```
#

?

crisp steeple
#

you need to lowercase the Commands

cunning canopy
#

looks good

#

but

#

lowercase commands

vast zenith
#

ok got it lemme see if this works rq also would I be able run it as a player?

#

or only through console like that

#

        if (cmd.getName().equalsIgnoreCase("pcreload")) {
            config = YamlConfiguration.loadConfiguration(PokeClearPlugin);
            sender.sendMessage(ChatColor.YELLOW + "PokeClear has been reloaded");


        }

        return true;
    }```
cunning canopy
#

if you have remembered to set the executor

vast zenith
#

it still doesn't send the reload message

tardy delta
#

registered it?

vast zenith
#

I did I registered the command

agile anvil
vast zenith
#
  [Thu 17:24:46 INFO  BuycraftX] Fetched due players (0 found).
  [Thu 17:25:08 INFO  Minecraft/ServerPlayNetHandler] JohnShiesty issued server command: /pcreload```
#

ye it just says this in console

tardy delta
#

i dunno either lol

tardy delta
vast zenith
#

how do I do that? (im like extremely new)

#

to java

tardy delta
#

System.out.println("booo")

#

lol

vast zenith
#

if (cmd.getName().equalsIgnoreCase("pcreload")) {
config = YamlConfiguration.loadConfiguration(PokeClearPlugin);
System.out.println("config loaded");

    }
#

just that?

tardy delta
#

uh and put your send message there to see if it gets printed

proud basin
#

use lombok

tardy delta
#

die

#

never

proud basin
#

I’ll send you money if you use it

zenith gate
#

what attribute gives skeletons more damage? GENERIC ATTACK DAMAGE does nothing as they are a bow...

tardy delta
#

how much

proud basin
#

how much do you want

steel swan
#

hey !
while putting my plugin on a server, i get this error :

[17:33:26 ERROR]: Could not load 'plugins/NarutoNew-1.0-SNAPSHOT.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: java.lang.NoClassDefFoundError: com/sk89q/worldedit/MaxChangedBlocksException
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:135) ~[server.jar:git-Spigot-21fe707-741a1bd]
    at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:329) ~[server.jar:git-Spigot-21fe707-741a1bd]
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:251) [server.jar:git-Spigot-21fe707-741a1bd]
    at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugins(CraftServer.java:292) [server.jar:git-Spigot-21fe707-741a1bd]
    at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:198) [server.jar:git-Spigot-21fe707-741a1bd]
    at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:525) [server.jar:git-Spigot-21fe707-741a1bd]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_312]
Caused by: java.lang.NoClassDefFoundError: com/sk89q/worldedit/MaxChangedBlocksException
    at java.lang.Class.forName0(Native Method) ~[?:1.8.0_312]
    at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_312]
    at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:64) ~[server.jar:git-Spigot-21fe707-741a1bd]
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:131) ~[server.jar:git-Spigot-21fe707-741a1bd]
    ... 6 more
Caused by: java.lang.ClassNotFoundException: com.sk89q.worldedit.MaxChangedBlocksException
    at java.net.URLClassLoader.findClass(URLClassLoader.java:387) ~[?:1.8.0_312]
    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:101) ~[server.jar:git-Spigot-21fe707-741a1bd]
    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:86) ~[server.jar:git-Spigot-21fe707-741a1bd]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:418) ~[?:1.8.0_312]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[?:1.8.0_312]
    at java.lang.Class.forName0(Native Method) ~[?:1.8.0_312]
    at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_312]
    at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:64) ~[server.jar:git-Spigot-21fe707-741a1bd]
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:131) ~[server.jar:git-Spigot-21fe707-741a1bd]
    ... 6 more

Idk what to show u, if anyone knows why tel lme !

vast zenith
#

thats my main class

vast zenith
proud basin
#

Is there an error?

vast zenith
#

no

crisp steeple
#

make a command executor and register it

#

it’s the proper way of doing it

opal juniper
#

you still need to set the executor

crisp steeple
#

getCommand(“pcreload”).setExecutor(new CommandPCReload(this), this);

#

to register it

torn badge
#

Someone have any idea how I can allow another plugin to spawn a mob in an unloaded chunk? The plugin itself is already calling Chunk#load, I tried setting Entity#setRemoveWhenFarAway to false in EntitySpawnEvent, but the spawn method still returns null when in an unloaded chunk

ornate patio
#

is there something more accurate than player#getTargetBlockExact?

crisp steeple
ornate patio
vast zenith
#

so im like super super new and don't know all the basics of java how would I set the command executor?

crisp steeple
steel swan
river oracle
#

you cant add a dependency as a provided state and expect it to work without any classes provided

solid cargo
#

wait how was i able to replace lets say all "Bukkit.broadcastMessage" with "players.sendMessage"?

#

intellij btw

crisp steeple
#

what?

solid cargo
#

my ass cant explain

#

there was a shortcut

ornate patio
#

Player#getTargetBlockExact is pretty inaccurate, when I try right clicking here, it thinks that I'm right clicking air

#

and therefore it bypasses all my lock checks and the player can open the door

jagged thicket
solid cargo
#

no but in intellij itself there was a shortcut

jagged thicket
#

do u have copilot

solid cargo
#

that replaces all text that matches something

river oracle
solid cargo
#

found it

#

yes

#

thanks

jagged thicket
#

oh now i understand what you mean

thin lantern
#

how i can read nbt of entity?

eternal night
#

you should never have to

#

what is the xy here

tardy delta
#

people dont seem to care about naming conventions lol

tardy delta
lusty stream
#

how can i use "Expansion-ChangeOutput" to substract 1 from any value, like %server_online%

thin lantern
lusty stream
#

or how to substract a number from a placeholder using another way, not using expansion-changeoutput exactly

eternal oxide
#

?paste

undone axleBOT
eternal night
#

and then iterate over its effects

thin lantern
#

oh thanks

eternal night
#

e.g.

#
final FireworkMeta fireworkMeta = firework.getFireworkMeta();
for (final FireworkEffect effect : fireworkMeta.getEffects()) {
    final FireworkEffect.Type type = effect.getType();
    final List<Color> colors = effect.getColors();
    final List<Color> fadeColors = effect.getFadeColors();
}
thin lantern
#

i know

#

i need only star count lol

sterile token
#

Who tagged me?

tardy delta
#

search it up

sterile token
sterile token
eternal night
#

I like finals

sterile token
#

I see then more as fields modifiers

tardy delta
sterile token
#

Because want to do something similar but with key-value

sterile token
#

Something like:

public void sendMessage(String path, String... replacements) {

}

tardy delta
#

check out ma code

sterile token
#

Allright thaks bro

tardy delta
#

its not perfect but im working on it

sterile token
#

Allright but allow to replace key-value from the path?

tardy delta
#

yes

sterile token
#

Nicee

#

Perfect bro

opal juniper
#

@eternal night you got a sec? need an opinion

frozen cedar
#

how to create Component object with hex colored text?

tardy delta
#

ChatColor.of from the md blablabla package

tardy delta
ornate patio
#

the event doesn't have the right clicked block

tardy delta
ornate patio
tardy delta
frozen cedar
sterile token
zenith gate
#

?jd-s

undone axleBOT
frozen cedar
tardy delta
#

since when does the displayname needds to be a component?

trail lintel
#

Hey guys, I notice when I cancel a PlayerInteractEvent with a placeable block in hand, the block appears for a split second before disappearing. Is there a way to stop this behavior, or is that just always gonna be the case?

eternal night
#

you cannot. the client predicts the block being placed

#

the server updates the client as fast as possible

#

but yeeaa

opal juniper
#

I have a very large data set of hashes, i need to parse them all somehow. They are 40 long and all have a value.

At the moment i have this tree thing set up:
https://paste.ollieee.xyz/okigopuxic.csharp
Where it sets up nodes of substrings of length 5.

It works well for a couple million but eats memory cause of the pure amount of hashmaps.

Have you got a better way of doing this you can think of. Its important i mention that this is for comp sci work and the reason it is overly-complicated is cause i would get more marks lol

trail lintel
#

Its not a huge deal, just a little extra touch that would be nice =] but its fine that it appears for a second

#

ty lynx

opal juniper
eternal night
opal juniper
#

yeye, the dataset is just a huge .txt in the format hash:value where value is int

#

the tree i find really cool, but the hashmaps are eating my ram :p

#

ingesting about 2m values is about 5GB of ram

#

so its not tooo bad, but its more than id like

eternal night
#

Yea I see, you do go to 5 buckets initial capacity. I presume you are preventing over allocation in the actual addChild method ye ?

opal juniper
#

er. no

eternal night
#

I mean just to grasp the concept of your tree.

opal juniper
#

didnt think it really mattered

eternal night
#

you split each hash into 5 char long subsets

lusty stream
#

guys how do i get rid of the decimal?

fiery prairie
#

Yo im receiving the error in the attachment with the code:

 p.sendMessage(ChatColor.translateAlternateColorCodes('&', plugin.getConfig().getString("vanish-success").replace('%player%', p.getDisplayName())));```Yo im receiving the error in the attachment with the code:
```java
 p.sendMessage(ChatColor.translateAlternateColorCodes('&', plugin.getConfig().getString("vanish-success").replace('%player%', p.getDisplayName())));```
eternal night
#

and basically grab the first 5 char long subset, throw at the first node and see which subnode that hash belongs to

lusty stream
#

im a newbie can u speak english

#

ye js

fiery prairie
#

well thats a plot twist i actually thought its c# tbh xD

lusty stream
#

who said i wrote that

fiery prairie
#

youre still programming it

lusty stream
#

true

summer scroll
#

I think that's a placeholder js for papi or something.

opal juniper
eternal night
#

Yea

eternal night
#

have you checked what your actual coverage with that is ?

#

like,

#

how often you can reuse a bucket

#

idk what hashing function you used but I would think this tree becomes horribly wide

opal juniper
#

its SHA-1

#

thats what this DEFAULT_WIDTH thing is, i was messing with it earlier

#

The reuse is fairly high for the first map, but drops to 0 basically immediately

#

well, its about 3

eternal night
#

so it is wide af

#

xD

opal juniper
#

she a chonker

eternal night
#

but anyway, an intiial capacity of 5 won't help you there

#

the hashmap just grows

#

java doesn't lock it at 5 buckets and then just does conflict resolution from there on

opal juniper
#

wonder if i could reuse a bucket. have some sort of pointer system

#

if we have already had a certain sequence before

eternal night
#

I mean, the 5 isn't the issue here. you are just going horribly wide which creates presumably giant hashmaps on level 0 and 1 of the tree

stark wedge
#

So I have created a plugin I am using to amplify a SMP server for my friends and I. I wanted to get all the basic essentials down like Config setup, Simple Listeners, Economy & Database Integration. I decided to go with the already integrated JDBC with my remote setup.

I am having some issues where my plugin only works for about a minute after I have reloaded the server or restarted it. The code will run fine for about a minute or two, but then will stop working and I get errors.

Here is the error code: https://pastebin.com/YsZJaQHR

If anyone could tell me what I am really doing wrong, or assist me in the right direction, that would be much appreciated it.

Code for entire plugin: https://github.com/projectbrady/NewLife/tree/master/src/main/java/me/projectbrady/newlife

GitHub

Contribute to projectbrady/NewLife development by creating an account on GitHub.

opal juniper
#

level 0 is 600k keys in the map

#

actually reusing could get difficult

#

two different hashes could end at the same point

eternal night
#

I wonder, it's all ASCII right ?

#

Your hash

opal juniper
#

yeah

eternal night
#

Yea sha1

opal juniper
#

uppercase and numbers only

eternal night
#

Would be interesting to see how far your get with a sorted array when you just interpret the substrings as longs

#

Insert would be horrible

#

But I presume that isn't the goal here

solid cargo
#

is there any way i can shut players the fuck up from writing minecraft:me?

#

does this for anyone wondering

eternal night
#

Like, sorted long array that you can traverse like a binary tree

opal juniper
#

that would be a very long array lol

eternal night
#

I might try it later 😜 am cooking now tho

#

I mean, array might be nicer than a lot of buckets with arrays inside XD

#

Actually how does java hashmap resolve collision

#

What's the strategy ?

#

I don't recall it

opal juniper
#

not sure

torn badge
#

Hey guys, does anyone know how I can spawn entities in a unloaded chunk?

opal juniper
#

load it?

torn badge
#

I tried Chunk#load and Entity#setRemoveWhenFarAway, didn't work

opal juniper
#

You need to use a chunk ticket

#

not #load

stark nebula
#

Is there any way I can get the locations of every block of a certain type in a chunk, without scanning to entire chunk. Like is there any already existing methods

torn badge
#

Also tried

torn badge
#

World#spawnEntity still returns an entity which returns false for #isValid

solid cargo
#

do i need to put the slash?

#

assuming its getMessage, yes otherwise no

stark nebula
#

Alright. That's what I'm doing right now, but just thinking it might get too intensive when I need to start doing it to alot of chunks.

stark nebula
eternal oxide
#

Things like Chests is easy. normal Blocks, not so easy

ivory sleet
stark nebula
#
for(slocation : getAllChunks())
{
  for(int i = 0; i <= 15; i++) {
    for(int j = 0; j <= 15; j++) {
      for(int k = 0; k <= 254; k++) {
        if(slocation.getChunk().getBlock(i, j, k).getWorldLocation.getBlock().getType() == Material.DIAMOND_BLOCK)
        {
          // diamond block found
        }
      }
    }
  }
}``` this is what I'm doing right now basically. But when I need to start doing this to a few thousand chunks I think performance will not be great =p
opal juniper
#

ew

#

ijk < xyz

stark nebula
#

Scanning 10 chunks is like ~40ms currently, which isn't terrible

echo basalt
#

you should make a chunk snapshot per chunk

#

and then have a bunch of worker threads parsing all the data

jagged thicket
#

or make your own permision handler

solid cargo
#

figured

frozen cedar
#

is there an FillEvent for glass_bottle??

jagged thicket
frozen cedar
dim palm
#

how can i set a armorstand facing the player location

#

the player eye location*

fiery prairie
#

p.sendMessage(ChatColor.translateAlternateColorCodes('&', plugin.getConfig().getString("vanish-success").replace('%player%', p.getDisplayName())));

help?

jagged thicket
fiery prairie
dim palm
#

use " instead of '

#

' is only for 1 character

fiery prairie
#

thanks!

jagged thicket
#
    if(event.getAction == ACTION.RIGHT_CLICK_GLASS_BOTTLE){
//your code here 
}
}```
#

smth like that

#

@frozen cedar

quaint mantle
solid cargo
#

give me the plugin daddy

subtle folio
#

imajin plugins 🤮

quaint mantle
#

Ok

#

Try it

#

I dont know if it works on minecraft commands

solid cargo
#

review "works like a sharm"

quaint mantle
#

idek what that means

solid cargo
#

prolly mistyped for charm

subtle folio
#

prolly charm

#

yeah

frozen cedar
#

RIGHT_CLICK_GLASS_BOTTLE doesn't exists

jagged thicket
torn badge
lusty stream
#

i ended up with this random nonsense, i give up lmao

sterile token
#

@tardy delta

drowsy harness
#

is armor contents sorted so that first is boots, second leggings, and so on?

sterile token
#

From top to botton

drowsy harness
#

alright

sterile token
#

Try it becaue im not sure

#

But im think position 0 on armors array is helmet

summer scroll
jagged thicket
frozen cedar
jagged thicket
summer scroll
frozen cedar
glossy venture
# frozen cedar i check getClickedBlock
// check if they right clicked and
// if they used an item
if (event.getAction() != Action.RIGHT_CLICK_BLOCK && 
  event.getAction() != Action.RIGHT_CLICK_AIR && event.getItem() != null)
  return;
// check if they used a glass bottle
if (event.getItem().getType() != Material.GLASS_BOTTLE) 
  return;

// get real targeted block
Block firstIntersectingBlock = player.getTargetBlockExact(
  /* max reach */ 3,
  /* only accept fluid source */ FluidCollisionMode.SOURCE_ONLY
);

// check if it is a water source
if (firstIntersectingBlock.getType() == Material.WATER) {
  // they filled a bottle
}
jagged thicket
# frozen cedar i check getClickedBlock

yes do String x = getClickedBlock.getLocation.getBlockX();
String y = getClickedBlock.getLocation.getBlockY();
String z = getClickedBlock.getLocation.getBlockZ();
and with that now increase the y and check if the location is water

glossy venture
#

what if the block is behind the water horizontally

#

just use getTargetBlockExact

#

should work