#help-development

1 messages · Page 705 of 1

chilly hearth
#

booom

shadow night
#

He literally said that

onyx fjord
#

If it's too big use the pasting service

echo basalt
tall dragon
#

imo

echo basalt
#

my classes average 50 lines

#

if you can scroll, you've gone too far

onyx fjord
#

Nah discord limit is pretty small

chilly hearth
#

there you go

onyx fjord
#

Isn't it like 2000 characters

chilly hearth
#

:>

tall dragon
#

idk

echo basalt
#

10$ nitro is 4000

shadow night
chilly hearth
#

.......

echo basalt
#

this is what happens when you refuse to learn the basics :)

onyx fjord
#

And what variable do you need

#

Because I don't see any

echo basalt
#

Funny how half of this could be converted to a config and be actually readable

onyx fjord
#

There's only the plugin instance you are injecting

echo basalt
#

oh well at least it works for you

chilly hearth
grizzled oasis
lost matrix
grizzled oasis
chilly hearth
#

COUGH COUGH*

grizzled oasis
chilly hearth
chilly hearth
grizzled oasis
#

ok

lost matrix
grizzled oasis
#

the method is separated only to make the code clean

#

and how should i do it not continuos but at the same time get a good location

echo basalt
#

uhh there are multiple approaches yet again :)

#

And it really depends

#

For example, on my zombies minigame, I had a bunch of map "regions" where each region had its own spawn points, and regions were connected by "doors", so I'd pick a random spawn point in any of the regions that was adjacent to the player's region

#

I've also had a gta plugin where I scanned the map and made a bunch of "safe locations"

grizzled oasis
echo basalt
#

Or you can use something like a flood-fill with some safety rules to come out with a "safe" location that the zombie can pathfind back to the player

#

So yeah, it depends

grizzled oasis
#

to make it simple, i could just add a section where they spawn and just don't care but then if the player is smart they can kill them at spawning even if its hard

lost matrix
#

What are the rules for a viable spawn location?

grizzled oasis
#

that's it in this world they cannot place or do anything so

lost matrix
#

Wait. If the world doesnt change then you even have a predefined height map?
In that case it should be trivial

grizzled oasis
#

i have a map cloned everytime

lost matrix
#

The just calculate all viable spawn points once...

grizzled oasis
lost matrix
#

But if you dont want to precalc the locations you can just do a simple flood filling algorithm.

lost matrix
#

You start at a block and visit all neighbours. Continue this recoursively until you reached the distance limit.

grizzled oasis
echo basalt
#

p sure I made a flood fill that used chunk snapshots before

#

zoink

#

doesn't really suit your needs unless you want to flood-fill the floor

#

Pretty sure I used it to scan prison mines

pseudo hazel
#

i like the non recursive version better, so nice job

echo basalt
#

I mean this is recursive

#

but adds iterations to a list of tasks

#

it's weird

#

iterative and recursive at the same time

pseudo hazel
#

oh nvm im blind

#

oof

#

its a hybrid

#

prolly because you are using futures and stuff right?

echo basalt
#

yeye

#

if I weren't it'd be single-threaded

#

this is multi-threaded

#

And uses the main thread to cache snapshots sometimes

lost matrix
#

Ouh. I see some things i dont like in there.

echo basalt
#

I wrote it like a year ago

lost matrix
#

If it works it works 🙂

echo basalt
#

think it did like 300k blocks per second

lost matrix
#

Just for the next time you need to pass collections like that as method params, think about creating a new class for it instead smileybolb

echo basalt
#

Understandably

#

I also have a class for mass block replacements

#

which is not fun because I create new threads instead of just pooling them yikes

#

good ol' 2 year old code

lost matrix
#

Yeah my old code makes feel the same way

echo basalt
#

It's a constant improvement process

#

my 5 year old minigame code puke

#

hmm I wonder what's the best way to do an audience thing

pseudo hazel
#

that just means you have vastly improved 👍

echo basalt
#

Not a fan of how it goes right now

pseudo hazel
#

whats an audience in this context

echo basalt
#

basically a multi-platform CommandSender or whatever

#

That's used in a few places,

#

Such as the command tree, for filtering out tab completion based on permission

#

Or my languages system, for sending messages based on language

#

Anyways it's used in commands n such

#

I have to revamp the messages system

lost matrix
pseudo hazel
#

so is it a collection of players?

echo basalt
#

Nope, just a single player

#

Like adventure's Audience

echo basalt
#

Either in the audience itself or somewhere else

#

But for API sake I'll just have a separate lang system

#

As this'll be public

lost matrix
echo basalt
#

yeah it is

#

How else would I do it without making yet another abstract class

lost matrix
#

factory

echo basalt
#

15 abstract classes, 32 interfaces, 91 classes

#

yikes

echo basalt
#

I might have an idea

#

but

#

probably like I did here, right?

lost matrix
#

Does .build() register your command?

echo basalt
#

yes

lost matrix
#

Hm

pseudo hazel
#

this sounds like it should be saved in come kinda json anyways

lost matrix
echo basalt
#

but

#

I'm not paid enough for that

#

As in

#

I'm paid to hardcode it

pseudo hazel
#

oof

#

then I can understand having all these classes

echo basalt
#

Converting it to json or whatever would just be mapping a bunch of strings to constructors

echo basalt
#

"Talk to this dude" and then a dialogue plays

upper hazel
#

help how get itemStack List from config.yml

#

list dont exists

#

oh wait

#

dont exists

#

Unchecked cast: 'java.util.List<capture<?>>' to 'java.util.List<org.bukkit.inventory.ItemStack>'

#

really?

#

why

chrome beacon
#

You probably do want to check the type before casting

#

Watch user error crash the plugin

#

Yeah

upper hazel
#

verification via insteof?

#

yes

#

now good

quiet ice
#

Already asked this question a year or two ago, but is anyone aware of a concurrent int hashset implementation?

ivory sleet
#

ConcurrentHashMap::newKeySet is the closest i can think of

#

But otherwise I think MAYBE fastutils

quiet ice
#

It doesn't need to be a hashset but it'd need to be able to store massive (~4 million?) amounts of unique unboxed ints

ivory sleet
#

Or trove

upper hazel
#

ConcurrentHashSet?

ivory sleet
#

Not a thing

quiet ice
#

The problem with CHM is that it's boxed. And for what I'm doing it simply is too expensive

ivory sleet
#

Yeah

quiet ice
#

I could of course allocate all the Integers ahead of time but that'd be really cursed

upper hazel
#

?

#

you want a thread-safe no-corrosion Map

quiet ice
#

A concurrent (no synchronized schenanigans - at that point I might as well run it all in a single thread) unboxed map/set/whatever. Not sure what no-corrosion is

#

I'll take a look at trove. But fastutils and eclipse collections are all not concurrent from what I know

eternal night
#

trivago had some fastutil RWlock

#

but yea, fastutil only has sync for "thread safe"

chrome beacon
#

Yeah Trivago has concurrent maps

#

They don't have Sets though

eternal night
#

aw

quiet ice
#

never heard of thse ones

eternal night
#

what a shame

chrome beacon
quiet ice
#

Well I mean a Set is not too different from a Map (in fact this is what Java does with it's sets). So I guess I'll eat the added overhead

chrome beacon
#

Yeah but it doesn't contain that type of map

#

So you'll still need to make your own map impl you can use the above implementation as reference ig

eternal night
#

I mean, at 4 million ints, you are close to the point where implementing your own would be better anyway

quiet ice
#

I just realized that I actually want to store 4 million longs but it's probably the same thing

eternal night
#

yea ehm

#

I'd go with implementing this yourself

#

you'd be looking at like what

#

30 MB

#

for just the longs

quiet ice
#

Only problem is that I have 0 idea at how to write concurrent stuff

eternal night
#

I mean, half the fun is just CASing the shit out of it

upper hazel
west bone
#

hey, i want to save data on disable, is there a way to freeze the server or something like that?

west bone
#

database

quiet ice
#

I guess I'll write my own impl. I believe I have the minor advantage that these longs aren't fully random (that is they consist of two ints that are between 0 and 1 million) where as each int element of that pair is only connected to at most 9 other ints.

upper hazel
quiet ice
#

Time for RegionatedIntIntToObjectMap the second

eternal night
upper hazel
#

wth what the name

#

who created this omg

#

for such a name I will bury him

glad prawn
#

But its good lol

dry hazel
#

oracle-level javadoc, nice essay

upper hazel
#

RegionatedIntIntToObjectMap - bruh

quiet ice
#

Should've called it ConcurrentRegionatedIntIntToObjectMap

glad prawn
#

Should we change it to A 🤓

upper hazel
quiet ice
# dry hazel oracle-level javadoc, nice essay

Yeah, it was meant to be used by many of my minecraft projects (given that this map can be used for MANY things in minecraft). However I ended up quitting minecraft plugin dev shortly after

upper hazel
#

hahaha

upper hazel
quiet ice
#

If you have any Chunk -> Data assignments, yes.

#

In this plugin I use it extensively to assign Data to Chunks.

#

However as this map doesn't have an Iterator the Data needs to be stored somewhere else too so it isn't all too efficent with writes. But damn is it fast for reads

eternal night
#

who in their right mind would store all chunk data for all available chunks in memory tho

upper hazel
dry hazel
#

me

eternal night
#

an indexed sql table with lookup and writes on ChunkLoad seems like the less painful way to do this

quiet ice
eternal night
#

understandable

upper hazel
quiet ice
#

No, it's a claiming plugin

quiet ice
#

But even for my purpose it would take a considerable amount of playtime and players to exhaust available heap space to a notable degree

eternal night
#

if it is related to chunks tho, why a (long, long) think

chilly hearth
eternal night
#

a single long would suffice no ? packed from chunk x and z

quiet ice
#

I use packed x,z hence I need a long -> ? map

onyx fjord
#

you cant just get a variable from inside a method

quiet ice
# upper hazel How many

Assuming you have 1 kb per Chunk storage unit and a player moves to a new chunk every minute: You have an exhaustion of 1 kb / player / minute
So at 100 players online at all times you'd exhaust 1 Gb of memory within 10K minutes or a bit under a week.

however my plugin assumes that players remain in their little area and that there are no 100 players online at all times

onyx fjord
#

to know whats going on

tardy flame
#

You can get parameter from a method

quiet ice
#

Conditionally.

upper hazel
chilly hearth
quiet ice
#

Not in my plugin

#

I keep all data online at all times. of course chunks are unloaded as usual but the attached metadata is still active in memory and will be reloaded across restarts

upper hazel
#

metodata not cleared?

quiet ice
#

Nope. Unless you remove the file that stores the metadata

upper hazel
#

bruh

quiet ice
#

The metadata in question are Claims.
It'd be a bit stupid to remove a player's claims

#

Of course one could make a script that periodically purges inactive claims.

upper hazel
#

you can do auto-cleaning after a certain period, as for me

#

yes

chilly hearth
#

i have a better idea iam ogna give a tag to that entity and check if that entity has an tag

#

but how do i get the entity AS AN KILLER OM

quiet ice
#

The always-in-memory policy provides lookup speeds that are necessary to offer the best possible experience

upper hazel
#

Which plugins are at risk of filling up memory?

#

those that save a bunch of data?

quiet ice
upper hazel
#

I just thought what if my memory is also full

echo basalt
#

what if you keep chunk data

#

like claim data

#

for loaded chunks

quiet ice
#

Well I hyperoptimized this since I couldn't be bothered to write the necessary APIs to do it better in order to properly support Squaremap

#

Writing the logic required to provide claim data deltas was simply deemed to take too much time

#

And in the end that was the proper play as the only server that runs this plugin hasn't seen a player for the better part of a year

lost matrix
#

Every mc server ever

eternal night
quiet ice
#

So the stored data sits at a comfortable 280 kb

echo basalt
#

I think I've reached the "oh no" phase where I have to test all my untested code

twilit roost
#

I added JDA dependency into bungee.yml and set its scope to provided in pom.xml
but now whenever I try to use the JDA, it errors out like so:

upper hazel
#

is it a good idea if I have a lot of functional classes to add them all to 1 big class and get all these additional classes through this class

echo basalt
upper hazel
#

a

#

it's just that all these classes are related to 1 big topic

#

so I'm thinking of combining them or not

#

you know, like a class object

#

he has a lot of heirs

lost matrix
#

Throw everything into your JavaPlugin class

#

This way the plugin is faster

small current
#

How can i get rid of the shop

echo basalt
#

hide the npc's name

#

on citizens

small current
#

not citizens

echo basalt
#

yet another hypixel copy

small current
#

its nms

#

how can i get rid of it

twilit roost
#

send remove player packet afaik

upper hazel
small current
echo basalt
#

scoreboard teams actually

small current
#

its not in the tab

eternal oxide
#

if it's your own NPC just create its profile with a blank name

small current
#

will it show the empty name tag?

#

or it just wont show

eternal oxide
#

?tas

undone axleBOT
small current
#

ok cool

#

and the skin overlay

#

all enabled all of it

#

how can i disable the cape

twilit roost
sterile sapphire
#

Hello

twilit roost
#

hi

sterile sapphire
#

I’m on IntelliJ and I’ve started trying to learn some stuff, I’ve made the project and I’m trying to add a command that give gives them 1 piece of dirt, I can not figure it out so can someone help me?

twilit roost
#

In this episode, I give you a brief overview of what you can expect in this MC Plugin coding series. #Spigot #MCPlugins #PluginTutorial

Java Tutorial: https://www.youtube.com/playlist?list=PLfu_Bpi_zcDPNy6qznvbkGZi7eP_0EL77
How to Setup a Test Server: https://www.youtube.com/watch?v=58MZ4THF73g&ab_channel=KodySimpson

Discord: https://rebrand.l...

▶ Play video
sterile sapphire
#

Ohh thank!

steel spindle
#

help, my plugin handles only EntityAirChangeEvent

UPD: If you write the command 'reload', everything works as it should.

code:

private void onEvent(Event event) {
        System.out.println(event.getEventName());
        hook_call.call(LuaValue.valueOf(event.getEventName()), CoerceJavaToLua.coerce(event));
    }

    private void setupHooks() {
        RegisteredListener registeredListener = new RegisteredListener(this, (listener, event) -> onEvent(event), EventPriority.NORMAL, this, false);
        for (HandlerList handler : HandlerList.getHandlerLists())
            handler.register(registeredListener);
    }
twilit roost
#

he will get the point when he sees that there are tutorials on YT

sterile sapphire
#

What should I do instead then?

sterile sapphire
twilit roost
#

I mean the one from Kody Simpson was updates 4 days ago

#

I personally started with him
or CodedRed

sterile sapphire
#

👍

upper hazel
#

what to do I will probably have many classes in the future and now I'm thinking of combining and getting them through a common instance of the class or getting them through Id. I will give an onology: is it necessary to access all engine parts through the engine or get parts according to unique features?

lost matrix
echo basalt
#

seems like a uh

#

language parser

#

ye

lost matrix
#

I see that. But this wont work as the handler list will get rebaked every so often

steel spindle
lost matrix
#

Are you russian?

echo basalt
steel spindle
lost matrix
#

Ah

#

Register every listener by hand would be my suggestion

sterile sapphire
#

Hello

lost matrix
#

Hello buddy 🙂 how is your programming coming along

steel spindle
lost matrix
sterile sapphire
#

Well. I’m trying to learn how to do simple commands and someone gave me a tutorial to follow but there files and that looks nothing like mine

echo basalt
#

having the stupidest issues rn

#

how is this null

lost matrix
echo basalt
#

if I register this and the name matches up

sterile sapphire
echo basalt
#

am I running into a hash collision or something

gilded granite
#

?nms

gilded granite
#

breh i got this fucking error Unresolved dependency: 'org.spigotmc:spigot🫙1.20.1-R0.1-SNAPSHOT'

quiet ice
#

Did you build spigot yet?

#

Via buildtools?

gilded granite
#

yes

lost matrix
quiet ice
#

You might be missing a flag then but idk

#

I always completely avoided nms

gilded granite
#

i just changed from 1pc to another and this error happened

lost matrix
gilded granite
#

Oh yeah i forget

#

mb

#

like that ? java -jar BuildTools.jar --rev 1.20.1 --remapped

kind hatch
#

Ye

chilly hearth
echo basalt
#

I'm blind ffs

chilly hearth
#

my two braincells are done for it

#

i have been stuck on this

#

for 4 days

quiet ice
#

Like

public class MyClass {
    private WitherSkeleton myEntity;

    public void performAction() {
        WhiterSkeleton ent = PseudoSource.getSkeleton();
        this.myEntity = ent;
    }
}
chilly hearth
#

but its stored inside an method

#

?paste

undone axleBOT
quiet ice
#

Yes but you can store it inside a class instead

chilly hearth
#

hold on geol you help me with this

quiet ice
#

Well not really a class but you should get the point if you know enough java

chilly hearth
#

thats my code

#

there is a variable "ent"

#

so i want to accsess it inside an other class inside and event

sterile sapphire
#

And that works and loads fine in the server

lost matrix
#

Ok cool. Then the next step is to follow the command tutorial.

sterile sapphire
quiet ice
#

And before I get bonked by someone for the static abuse: I don't need to know all about this. I'm a trained professional

chilly hearth
#

@quiet ice have you seen my code .....

quiet ice
#

@chilly hearth Basically the magic lies in static. It will be your friend for the first few weeks of your plugin development carrer. Just ignore all the naysayers (there will be many).
However, eventually you will need to learn to not use static

quiet ice
#

Which is where we would go to the big drawback of static: It is global

chilly hearth
#

so basically

sterile sapphire
quiet ice
#

However without much more detail I can only give you insufficent information

chilly hearth
#

bruh

#

ok so after that will i be able to accsess the variable in another class ?

small current
#

net.minecraft.server.v1_12_R1.CancelledPacketHandleException
What is this

i have a menu which can be opened from the npc or from a command
When i use the command and the menu opens, i can click on the items and the menu works fine and all

but when i use the npc to open it, when i click on the item nothing seems to happen and i can take it to my inventory and the error i sent happens when i close the menu and open it again using the npc

#

if any part of the code is needed, tell me.

quiet ice
#

Another alternative of what you want to do would be:

public class MyClass {
    public static final Map<WitherSkeleton, Object> EVEN_GREATER_SIN = new WeakHashMap<>();

    public void onCommand() {
        WitherSkeleton ent = PseudoSource.obtainSkeleton();
        EVENT_GREATER_SIN.put(ent, new Object());
    }
}

// Another class, another file
public class MyListener {
    public void onEvent(SomeEvent e) {
        if (MyClass.EVEN_GREATER_SIN.containsKey(e.getEntity())) {
            // This is a boss that was spawned via a command
        }
    }
}

@chilly hearth

#

Ah frick, that doesn't work that way

#

Here fixed with even more sin points

echo basalt
#

IdentityHashMap

#

Not Weak

quiet ice
echo basalt
#

ahh having completablefuture hell

#

maybe I should test my code more often

#

rather than coding 7k lines of code and randomly deciding to test it all

#

it's surprisingly functional

austere cove
#

:) JUnit is life

echo basalt
#

true but

#

I can just test it myself

#

in my case I'm tripping over "future hell" but in reality I forgot to call my custom event

chilly hearth
#

BROO NO I BROKE MY CODE

echo basalt
#

And in true enterprise code fashion

chilly hearth
#

nothing working again 😦

echo basalt
#

I can't just middle-click around the codebase because I applied dependency inversion everywhere

#

yay it works

#

if I create an island

#

let's see if this work

sterile sapphire
echo basalt
#

multi-platform skyblock core

#

loads islands from a databse

#

thing with being multi-platform is that I need to rewrite half of the logic out there

#

Custom command system, event system

sterile sapphire
#

An updated multiverse with skyblock?

echo basalt
#

not multiverse

vagrant stratus
#

Reminds me, I should look into Hypixel's Slime Region Format for some of my own stuff

echo basalt
#

y'know how hypixel loads islands in multiple servers

#

Like they don't have a single instance with 20k islands loaded

#

Yeah my plugin does the same

#

I started this project like 3 years ago or whatever but recently rewrote it all

#

And now it's testing day :)

chilly hearth
#

?paste

undone axleBOT
chilly hearth
echo basalt
chilly hearth
#

bro its saying plugin = null

echo basalt
#

I did add support for swm in a fork somewhere

#

and I might re-add it later

vagrant stratus
#

I mean, you could just fork SWM and impl WE support

echo basalt
#

nah this is fine enough

#

Just a proof of concept atm

#

SWM support takes like an afternoon to impl

#

Might release it as an update once this goes public

opal carbon
#

what even is the point of slime world

echo basalt
#

uhh

sterile sapphire
#

Doesn’t hypixle use a sort of multiverse fir there islands tho?

vagrant stratus
#

better world format

echo basalt
#

In-memory worlds that are saved to a database

opal carbon
echo basalt
#

usually around 100kb in size

echo basalt
#

dev blog 6 is also useful to read

sterile sapphire
echo basalt
#

uhh no

#

that's not how it works

#

I think you mean a grid

#

and even then it's not how it works

quiet ice
#

Apparently java.util.ConcurrentHashMap uses the jdk internal Unsafe.
This will be fun 💀.

echo basalt
#

it's there wtf

#

time to fix my lame ass code

vagrant stratus
echo basalt
#

no they just use slime

#

not a grid

#

No point in being a grid

#

Slime is just too perfect for them

vagrant stratus
#

Ah, so instead of how askyblock or whatever does it, it's literally just multiple worlds

echo basalt
#

Yep

#

And those worlds are in-memory because of slime

sterile sapphire
#

So you could use this instead of bungee cord?

echo basalt
vagrant stratus
#

no

vagrant stratus
sterile sapphire
#

Is this what a plugin files meant to look like or did I go wrong?

worldly ingot
#

LGTM

vagrant stratus
echo basalt
#

having a world pool

#

something tells me my session system is dying on me

#

it just hangs

#

how fun!

vagrant stratus
#

technically you could load the SWM files in a grid format, but there's no point if each world is only gonna be a few 100KB

echo basalt
#

uh no

#

Because SWM, as previously said, are worlds and not just "regions"

vagrant stratus
#

I said technically, it would be hell

#

I wonder if SWM supports everything listed in the dev blogs 🤔

sacred mountain
#

pomoc

opal carbon
#

"LGTM" -> Looks good to me

sacred mountain
#

co to jest lgtm

#

Oh

#

myślałem, że to LGBTQ

sterile sapphire
opal carbon
quiet ice
sacred mountain
#

sorry

twin venture
#

Hi , i have problem with mysql ,i use hikaricp , and after 10 minutes of player join / leaving the server the plugin does not load the data

sacred mountain
#

(trust me)

twin venture
#

i have 8 diffrent profiles each profile have its own data to load and save it have a load from sql , save to save

#

i got everything setup correctly , but for some reason if player's join and leave few times it stop loading the data

sacred mountain
#

too many cnnections maybe

#

did u close it

eternal oxide
#

you are not releasing resources between queries

twin venture
twin venture
sacred mountain
#

nvm idk about hikaricp

#

llol

eternal oxide
#

only if in a try with resources

sacred mountain
#

i just use good old mysql

echo basalt
#

lovely found my issue

twin venture
echo basalt
#

mans hiding his db

sacred mountain
#

lol

#

we dont want ur data

worldly ingot
#

I do

#

I want his data

sacred mountain
#

oh no

#

the data collector

twin venture
#

ik the owner told me to not share it xD

quiet ice
opal carbon
#

the table name?

sacred mountain
#

you're not getting through my efficient security system

opal carbon
#

i really feel like table time isnt compromising anything

echo basalt
#

time to go make a sandwich or something

#

and come back in 10 minutes

sacred mountain
#

make me one

#

too

#

thanks

vagrant stratus
#

looking at SWM ig the general process is

SlimePlugin plugin = (SlimePlugin) Bukkit.getPluginManager().getPlugin("SlimeWorldManager");

SlimeLoader sqlLoader = plugin.getLoader("mysql");

try {
    // Note that this method should be called asynchronously
    SlimeWorld world = plugin.loadWorld(sqlLoader, "my-world", props);

    // This method must be called synchronously
    plugin.generateWorld(world);
} catch (UnknownWorldException | IOException | CorruptedWorldException | NewerFormatException | WorldInUseException | UnsupportedWorldException ex) {
    /* Exception handling */
}

Player#teleport(Bukkit.getWorld("my-world").getSpawnLocation());

sacred mountain
#

whats swm

#

slime world manager huh

#

i remember seeing that somewhere

twin venture
vagrant stratus
twin venture
#

each profile have some values for example profile-1 have nickname , tokens, data , profile-2 have game data like wins etc

#

and each one of them need to be loadded when player join for each player join

#

there are tottal of 8

#

the problem is after sometime it stop loading of profiles if new player join , or player's keep log out and log in again ..

#

oh each profile have its own table to load data from .. xD

#

i implement the loadProfile in 8 diffrent profiles :

vagrant stratus
#

Using SWM means having to do custom versions of any gamemode though 🤔

twin venture
#

example :

eternal oxide
twin venture
eternal oxide
#

set to 100 and see how it goes

twin venture
#

only setting 10

#

if i set 100 , i will get a problem with to many connections in mysql

echo basalt
#

I wonder if connections are being returned to the pool

#

Trycatch should do it

twin venture
#

when i first join and player joins

#

after 5 mins , player join , leave it will stop working

#

it won't load

#

or get the cached profiles

echo basalt
#

Still waiting for these 10 minutes to pass so I can actually test my code

#

Might go take a shower or something

twin venture
twin venture
# twin venture ..

after 10 min or less or more it stop getting the data from the getCachedProfile

eternal oxide
#

This is my Hikari config

#

works fine for all dbs

lost matrix
#

Is class for name still a thing?

echo basalt
#

holy shit it works

echo basalt
#

It's either in v3 or v4 that it stopped being a thing

twin venture
#

same database but diffrent tables

eternal oxide
#

yes

vagrant stratus
twin venture
#

will it fix my problem ?_?

echo basalt
#

Yeah it's jdbc4

#

there you go smile princess

lost matrix
#

Yeah i thought it was discontinued in some jdbc version. But alredy a while ago.

echo basalt
#

jdbc4 came out in like 2015

#

or a bit earlier

valid basin
#

does someone know how to check for custom enchant? (eco enchant)

private boolean hasAirTightEnchantment(Player player) {
ItemStack helmet = player.getInventory().getHelmet();
if (helmet != null && helmet.getEnchantments().containsKey(Enchantment.getByKey(Enchantment.AIR_TIGHT.getKey()))) {
return true;
}
return false;
}

echo basalt
#

Check their API

valid basin
#

I believe it should be compatible with regular spigot without using their api

#

because essentials enchant works too

vagrant stratus
#

depends on how they're implemented

onyx fjord
echo basalt
#

why does it say 10 I only have like 3 windows open

sage patio
#

i'm working on 1 project atm

#

and its 3

echo basalt
sage patio
sacred mountain
chrome beacon
#

Chrome moment

echo basalt
#

32 hours on this rewrite and it works better than the original

#

I call this an absolute win

lost matrix
sage patio
fluid river
#

yo

#

if i run a task

#

does task cancel itself after code is executed?

#

isCancelled() == true?

#
public void runMyShit() {
    var r = new BukkitRunnable() {
        public void run() {
            System.out.println("Hello, world!");
        }
    }
    r.runAsync(plugin);
}

public void checkMyShit(BukkitTask task) {
    if (task.isCancelled()) {
        System.out.println("my r is done");
    }
}
quiet ice
#

I wish java had uint128 or uint256. Would make everything so neater.
But sike everything has to be difficult

sacred mountain
wary remnant
#

BigInteger duke /s

quiet ice
#

Or I could be using uint48...
Tempting...

chrome beacon
#

BitSet

sacred mountain
#

java programmers after reading a 17 page npe due to a typo

fluid river
#

yes

chrome beacon
#

eh Typos don't compile if you do right

sacred mountain
#

for some framework i was trying to make

fluid river
#

wrong regex also

sacred mountain
#

and also yml files.

#

i remember i once spent almost 2 hours rewriting a method for my config

#

when it was because i spelt a key wrong

#

cant really excuse myself i think i was just tired

lost matrix
sacred mountain
echo basalt
#

smile knows

#

time to wait another 10 minutes because my code accidentally saved a bunch of air instead of my actual island

#

ffs

#

integration hell

sacred mountain
#

sounds inefficient

lost matrix
lost matrix
echo basalt
#

and I did add like 19k lines of debug

sacred mountain
#

the word integration gives me calc flashbacks

echo basalt
#

but apparently I have so many logs that this just refused to save any of them

quiet ice
#
    static final class Bucket {
        volatile Element[] values;
        volatile Element[] nextValues;

        boolean contains(long element) {
            Element[] e = this.values;
            if (e == null) {
                return false;
            }
            int idx = e.length;
            while (--idx != -1) {
                Element val = e[idx];
                if (val != null && val.value == element) {
                    return true;
                }
            }
            return false;
        }
    }

This has to be the first time ever I use volatile

sacred mountain
tall dragon
sacred mountain
#

bucket

#

pour

quiet ice
#

This is like a quarter of a ConcurrentLongSet

echo basalt
#

lmfao you can skip youtube premiere timers by just setting the speed

sacred mountain
#

you can what

#

wait so

#

they actually play the video

#

if you skip it

echo basalt
#

well

#

it fights you

sacred mountain
#

o

sage patio
#

what this error means?

lost matrix
#

You are probably tryin to modify an unmodifiable list

quiet ice
#

What are you doing?

#

Are extending AbstractList somewhere?

sage patio
#

i'm adding a custom object named GangPlayer into a custom object named Gang which it contains a list of GangPlayer in it named members

lost matrix
#

add or remove.

#

List.of() returns an unmodifiable list

sage patio
quiet ice
#

But yeah, modifying an unmodifable List is the most explainable cause

sage patio
#

the problem is when i restart the server this command works fine

quiet ice
sage patio
#

i miss clicked on it, then did CTRL + Z, and the changes reverted

#

well, i've a

private final List<GangPlayer> members;

in my Gang object class, and the method which causes this error is:

public void addMember(GangPlayer member) {
    members.add(member);
}
remote swallow
#

that list is null unless you initalize it on constructor

small current
#

show the constructor

upper hazel
#

and player npc through NMC is done?

sage patio
# small current how is the list initialized

Collections.singletonList() of only 1 GangPlayer on gang creation, and new List of GangPlayers on server load, is this the reason this errors doesn't happens on server restarts?

small current
quiet ice
#

singletonList will stay with that single Element

#

Read the javadocs, they are you friend

sage patio
#

uh, thanks

#

ig i found the War plugin problem too (only 1 player is in the war when its started)

#

i don't have to test it anymore

upper hazel
#

lol

sterile sapphire
#

Is this right so for?


    // This method is called, when somebody uses our command
    @Override
    public boolean onCommand(playersender, Command command, String label, String[] args) {
        return false;
    }
} ```
onyx fjord
worldly ingot
sterile sapphire
#

Oh thank you

worldly ingot
#

Just make sure you're assigning it somewhere (preferrably onEnable())

sterile sapphire
#

So

sterile sapphire
worldly ingot
#

Your command executors aren't going to just know when to execute. You have to tell them that they should execute by assigning that executor to the command you want

echo basalt
#

I can't tell if worldedit is being weird or if my code is dogshit

worldly ingot
#

In your onEnable() you can do this.getCommand("company").setExecutor(new CommandCompany());

#

Then you're all good to go so long as your command is setup in the plugin.yml correctly

echo basalt
#

might be a possibility

#

I can leave and rejoin fine

#

but if I leave, stop the server and rejoin the schematic is just air

vagrant stratus
#

kekw

echo basalt
#

I can't tell if it's unloading and then saving

#

or if it's simply not reading any block data and airing it all out

upper hazel
worldly ingot
#

wut

echo basalt
#

wut

vagrant stratus
#

just remembered I have to work on an acc checker, so much to do lol

remote swallow
#

wut

vagrant stratus
#

wut?

upper hazel
echo basalt
#

working on like 5 personal projects is a hassle sometimes grr

worldly ingot
#

But... why though?

vagrant stratus
#

I have like 3920483209 personal projects lol

worldly ingot
#

You're not abstracting out a lot

echo basalt
#

lmfao wallah

#

if you're going to the effort of abstracting out command stuff

#

at least do it properly

vagrant stratus
#

Luckily something like the acc checker is stupidly simple. I just need to go through all the malware I have and pull user names and UUIDs

upper hazel
echo basalt
#

I wrote this in like 2 hours

#

Does the job

vagrant stratus
#

I still need to figure out the paid api stuff though kek

remote swallow
upper hazel
sterile sapphire
echo basalt
#

I forgot I wrote actual checks

worldly ingot
#

onEnable(), but yeah

#

In your plugin class

vagrant stratus
upper hazel
remote swallow
echo basalt
#

actually no this is fine

worldly ingot
sterile sapphire
upper hazel
vagrant stratus
upper hazel
#

By the way, I heard that for each class they create their own interface, is this true?

remote swallow
#

bukkit is entirely interfaces while craftbukkit has the impl

echo basalt
#

I wonder

#

if I generate an empty world and copy its file structure

#

and load the copy

sterile sapphire
#

How do u get this on your keyboard (I’m on phone and I can not find it)

`

echo basalt
#

is it faster than just generating another empty world

#

Fun okay I might've found my issue

upper hazel
remote swallow
#

what

echo basalt
#

`

#

yeah I have a dedicated key for it

#

à

#

grr having this weird odd issue

#

if I join, leave and wait for it to save it's ok

#

But if I save, restart the server and rejoin all the data is messed up

#

fun!

remote swallow
#

super fun

remote swallow
#

beause thats just the handler

upper hazel
#

it's almost like interface 3

remote swallow
#

it doesnt need to do anything else

remote swallow
#

tab complete would be handled by the child glass so would handling

echo basalt
sterile sapphire
#

The best phone

tall dragon
#

the most expensive one you mean

remote swallow
echo basalt
#

bruz

#

discord pls

echo basalt
#

Just wait until you find the CommandTree class

#

somewhere

upper hazel
#

this register class?

echo basalt
#

yes yes

#

lets me do this

vagrant stratus
echo basalt
#

I'm putting all my brain cells into this

vagrant stratus
echo basalt
#

7.8k lines of java

#
  • 11k on one of the dependencies
#

except it's like all my utilities

upper hazel
vagrant stratus
#

errr

#

malware's on the official site too

#

That's where most of the malware I know of comes from, spigot's forum itself

vagrant stratus
vagrant stratus
#

I have had a few people bring up them having pirated plugins in my support server actually

upper hazel
sterile sapphire
#
@override
Public void onEnable() {
    this.getCommand("company").setExecutor(new CommandCompany());

}

public class CommandCompany implements CommandExecutor {

    // This method is called, when somebody uses our command
    @Override

    public boolean onCommand(commandsender sender, Command command, String Company, String[] Create) {
        return false;
    }

Now I think this is right but what do I replace string and string with?

remote swallow
#

onEnable not onenable

glad prawn
#

Public hehe

vagrant stratus
remote swallow
upper hazel
remote swallow
sterile sapphire
vagrant stratus
remote swallow
#

what string

remote swallow
sterile sapphire
upper hazel
#

omg

remote swallow
#

yep

sterile sapphire
#

Thanks

vagrant stratus
# upper hazel WHAT

100s of resources get uploaded a day. We're volunteers. It's not feasible to check every. single. one.

upper hazel
#

A YOU SERIASLY

vagrant stratus
#

If we threw literally everything into the queue, it would be constantly backed up

sterile sapphire
# remote swallow yep

And why you do /Company it should come up with a option to auto finish that’s Create?

remote swallow
#

no

sterile sapphire
#

Oh Alr

remote swallow
#

unless you send it on the tab complete it wont show

vagrant stratus
#

Actually, it's not last I checked

vagrant stratus
#

Yea, no. The resource queue's super low

sterile sapphire
remote swallow
#

send it on th onTabComplete method

#

override that

upper hazel
#

well then SpigotMC site is another cesspool of pirates (forgive those who work there)

remote swallow
vagrant stratus
remote swallow
sterile sapphire
vagrant stratus
#

Most malware isn't even pirated plugins lmao

upper hazel
remote swallow
vagrant stratus
#

Just because we don't check every resource, doesn't mean it's full of pirates

remote swallow
#

optic

#

free resources get uploaded as wanted

#

optic will download them after upload and check them for malware

#

if malware is present, he removes it

#

7smile you good over there

lost matrix
#

fk my mouse was highjacked by my program XD

vagrant stratus
# upper hazel who say this

Me. I'm like... the only one who actively deals with the malware situation on spigot.

I'm well aware on how many come directly from spigot, and how many come from third-party methods like being DM'd the jar or it coming from a support ticket or piracy site

lost matrix
vagrant stratus
#

I literally only deal with malware LMAO

upper hazel
remote swallow
#

that is his main reason of being resource staff

vagrant stratus
lost matrix
vagrant stratus
quaint mantle
sterile sapphire
vagrant stratus
remote swallow
#

you would also change the arg number depending on what arg

upper hazel
remote swallow
#

but thats the basic

sterile sapphire
vagrant stratus
#

speaking off mass downloading. I still need to download the entirety of spigot's resource section kekw

remote swallow
#

error if it doesnt have that arg probably

glad prawn
upper hazel
vagrant stratus
#

It's not a plugin, but a third-party jar

quaint mantle
vagrant stratus
#

I uh, know how it works, I made it

upper hazel
#

that is, is it just an antivirus? Like, should I throw Jar there?

vagrant stratus
#

yes. It scans the plugins directory by default

vagrant stratus
upper hazel
#

bruh thenk for this

remote swallow
#

before you just blindly add it to ur plugins dir

#

its not a plugin

#

its a standalone app

upper hazel
#

I did not know that there are such cool projects on github

#

but what about kaspersky?

vagrant stratus
#

It doesn't really deal with java

#

let alone spigot specific malware

upper hazel
#

oh

#

listen, do you have any api libraries for all occasions for newbies in development like me

#

for plugin

vagrant stratus
#

There are other spigot resources which attempt what I do. However, mine's the only one with a very large set of detections

vagrant stratus
#

@subtle folio I plan on doing a remote scanner actually. It'll have an API

#

so uh

#

whenever that's done?

subtle folio
#

gmgmgmgn

upper hazel
#

listen, how can you find all sorts of pranks related to bukkit api in github, I just realized that api is better there than in SpigotMC spread

#

bruh

subtle folio
#

what?

upper hazel
#

translaste

subtle folio
#

pranks??

upper hazel
#

wait

vagrant stratus
# subtle folio gmgmgmgn

iirc the api is something like

/api/v1/scan -> Takes a MultipartFile and returns a json array of hashes & CARO strings
/api/v1/check -> Takes a Base64'd JSON string in the format {"hashes": []} and returns the same output as the other method
upper hazel
#

pranks = cool - translate error

vagrant stratus
#

I plan on taking a VirusTotal approach to the remote scanner. That'll come w/ its own benefits.... once I actually figure that part out

subtle folio
#

ah so it’ll handle all the logic

#

you just give it what you got and it gives back what you shouldn’t got

vagrant stratus
#

Pretty much. It'll make a lot of things so much easier, given I'm working on so many projects

subtle folio
upper hazel
#

searching minecraft-plugins on github is a good start

vagrant stratus
#

The remote scanner makes supporting server hosts easily possible, for example

subtle folio
vagrant stratus
#

Yea, that's pretty much the point lol

vagrant stratus
#

I do need to get the account stuff figured out though still

subtle folio
#

LOL

#

oh api tokens ?

#

goofy

vagrant stratus
#

Again, it'll take a VirusTotal approach. I gotta have some way to handle the free & paid stuff lololol

#

No way I can support it otherwise

upper hazel
subtle folio
#

haha

subtle folio
#

😅

upper hazel
#

oh privet bro

subtle folio
#

privet ✨

vagrant stratus
#

It'll have rate-limiting, but the limits would be higher than most server owners would hit

subtle folio
#

i see

upper hazel
vagrant stratus
#

Something like
300/unlimited
free/paid

or whatever

subtle folio
#

my vision is a virus check each startup

subtle folio
vagrant stratus
#

I have a paper fork in the works. It'll do just that LMAO

subtle folio
#

i moved to the states when i was very young

vagrant stratus
#

it'll scan each plugin -> then load -> then enable

subtle folio
#

LOL my exact idea

subtle folio
vagrant stratus
#

Partially why I'm moving everything to the remote server

subtle folio
#

mhm mhm

upper hazel
#

you use tranlate or not

subtle folio
#

no i’m fluent in english

vagrant stratus
#

The others being better support for ptero, server hosts (and networks), as well as simplifiying the current Anti-Malware project

upper hazel
#

cool

subtle folio
#

mhm

magic glacier
#

guys

#

can i get the words on a sign then edit it ?

vagrant stratus
subtle folio
#

really?

magic glacier
#

like if some one wrote on the sign meow, the plugin changes it automaticly to im a cat

#

is this possible

subtle folio
#

not gonna handle it another way

subtle folio
#

or use spring security and some like ldap solution

magic glacier
vagrant stratus
magic glacier
#

then im make set lines for each line ?

tall dragon
#

yea

#

it has getLine() and setLine()

upper hazel
#

i didn't think that bukkit api is so popular in github hmm

vagrant stratus
subtle folio
#

yep yep that makes sense

#

i need Optic Connect

upper hazel
#

well now i found a great source of information and tutorials on bukkit api so good start

vagrant stratus
#

I mean, getting them to all work with the user api is a completely different project but like... I'm not worrying about it until it's fully implemented lmao

subtle folio
#

lol

vagrant stratus
#

oh and paypal. Figuring that out is a problem too

#

Once that's all done, I'll most likely update that repo with a proper and useable example

upper hazel
vagrant stratus
#

probably not

upper hazel
#

demm

vagrant stratus
#

There's YT playlists though

vagrant stratus
upper hazel
#

yes, but I need information not for beginners, but rather for advanced

vagrant stratus
#

like?

quiet ice
#

At that point use the javadocs

upper hazel
#

well, I don't know NMC for example

quiet ice
#

NMS you mean?

upper hazel
#

yes yes

quiet ice
#

Well I don't think you need that one really

vagrant stratus
#

that's outdated every version lol

quiet ice
#

None of my plugins use NMS. Even the plugins I forked that formerly did use NMS

upper hazel
quiet ice
#

Well then just use dedicated APIs for that such as Citizens

vagrant stratus
upper hazel
quiet ice
#

What is the point in learning something you never need to use?

vagrant stratus
#

then look through their code lol

upper hazel
#

Are you sure you don't need it?

quiet ice
#

That is a bit as if I started learning fabric internals. Nice to know? Sure. Do I need it? Not really.

vagrant stratus
#

You're likely to have to figure it out on your own anyways because, again, every NMS tutorial is outdated pretty much every new MC version

upper hazel
vagrant stratus
#

yes

quiet ice
#

Figuring out NMS is pretty much based around staring at decompiled code for long enough until you understand it

vagrant stratus
#

the obfuscation and version number changes basically every update

quiet ice
#

However then mojang comes along another day and everything changes again.

vagrant stratus
#

relying on NMS guides and videos is useless, unless you're coding for that exact version

upper hazel
#

I just have a feeling that I know almost everything about the bukkit api, but at the same time I don’t know how to make cool plugins like the recent antivirus you showed or some cool animation

#

in general, there are skills but not for complex plugins

vagrant stratus
#

I'm not using spigot at all for my AV

quiet ice
#

Antivirus is just java

echo basalt
#

You need to learn more java and less bukkit

#

p much

vagrant stratus
#

^

upper hazel
#

for example, there is a plugin for cases where there is a cool animation how is it done?

remote swallow
#

armor stands and a lot of pain

quiet ice
#

Mostly just math and optionally resource packs

vagrant stratus
quiet ice
#

Java bytecode is dead easy

echo basalt
#

depends on the animations

quiet ice
#

But uh, Java bytecode and Objectweb ASM has been my life for pretty much the last two years

upper hazel
vagrant stratus
#

Probably not as soon as you get into it, but you learn quickly

echo basalt
#

Is it menus or what

remote swallow
vagrant stratus
#

I've used both consistently since 2019

quiet ice
vagrant stratus
#

It's also why my AV has the most detections, compared to what else is out

upper hazel
echo basalt
#

I hate myself

quiet ice
#

Not exactly sure whether I ended up completing it

echo basalt
#

problem I've been having for the past like

#

few hours