#help-development

1 messages · Page 1543 of 1

granite stirrup
#

its more than that

hybrid spoke
#

okay

wraith rapids
#

literally read what you posted a screenshot of

mystic tundra
#

So heres the fun thing, I come back after retiring from my plugin development times and notice that the method to get the player’s command has changed. I used to do if(label.equalsIgnoreCase(“”)) but now that doesnt work, anyone know how I should do it?

wraith rapids
#

"foreach performance is approximately 6 times slower than foreach"

#

the excerpt is clearly lacking context

ivory sleet
#

isnt it inlined?

wraith rapids
#

by JIT probably yeah

ivory sleet
#

oo

wraith rapids
#

they do compile into slightly different bytecode but the difference is negligible unless it's a hyper hot loop

ivory sleet
#

yeah

wraith rapids
#

for/foreach

granite stirrup
#

i think it means foreach as in for (A a:as) {}

mystic tundra
#

If anyone has time for me just ping me

quiet ice
#

It is easily visible that they are different

hybrid spoke
#

the iterating is different

quiet ice
#

both basically do the same however

hybrid spoke
#

the performance stays the same

granite stirrup
#

the performance is different

quiet ice
#

There is still the lambda overhead

wraith rapids
#

the lambda overhead and the extra stack frame yeah

granite stirrup
wraith rapids
#

but all of that is negligible

hybrid spoke
wraith rapids
#

that's this guy in a nutshell

quiet ice
#

Two extra frames

wraith rapids
#

constantly screeching about shit without actually knowing anything

granite stirrup
#

who cares we need every bit of performance :)

quiet ice
#

You have the #forEach and #accept

hybrid spoke
#

"CamelCase for classnames are bad"

granite stirrup
wraith rapids
#

basically just parroting everything everyone else here says

quiet ice
#

that is pascal case my dude

wraith rapids
#

it's getting pretty tiring tbh

quiet ice
#

camelCase is this, PascalCase is this

granite stirrup
#

i thought "CamelCase" isnt camel case cuz i only knew that came case is "camelCase"

wraith rapids
#

someone asks a code review and at some point someone points out the wrong casing

#

5 minutes later you're still all capsing about DO YOU REALLY USE CAMELCASE FOR PACKAGES or some shit

hybrid spoke
granite stirrup
hybrid spoke
#

even wikipedia says that

#

"Upper CamelCase (or "Pascal Case")"

wraith rapids
#

upper CamelCase and lower camelCase

#

things have several names

hybrid spoke
#

if i google for "Pascal Case" i get many articles about Camel Case

wraith rapids
#

they are largely synonymous

hybrid spoke
#

^

quiet ice
#

okay, then what is the one we are actually using

wraith rapids
#

for classes, pascalcase or upper camelcase

#

the two being synonymous

granite stirrup
hybrid spoke
#

both is correct

quiet ice
#

ah, so pascal case is explicit

granite stirrup
#

thats why i said it isnt camelcase

hybrid spoke
wraith rapids
#

camelcase just refers to there being humps in the casing

hybrid spoke
#

because everyone else was saying that too

granite stirrup
#

i didnt even know of PascalCase

quiet ice
#

So I stand true

wraith rapids
#

whether the first characer is uppercase or not, it's still camelcase

granite stirrup
hybrid spoke
wraith rapids
#

hence the more verbose definitions of upper and lower camelcase

quiet ice
#

ambiguity is the last thing one needs

#

As such I hereby declare that pascal case is not a form of camel case

#

there, spigot solving real problems

hybrid spoke
granite stirrup
#

lol

wraith rapids
#

do you even develop anything ever

#

every time someone asks a question you link to some unrelated javadoc page or an irrelevant spigot thread

#

and then say idk idk 5 times

#

unless of course there is wrong casing somewhere in which case let the all capsing about camelcase resume

granite stirrup
#

i just dont know about cases lol

wraith rapids
#

it looks categorically silly for you to be bashing people about casing when that's the only issue you can tell from their code or question

wraith rapids
#

stop doing it

#

it makes you look stupid and hypocritical

granite stirrup
#

but packages should be named in lowercase

#

and anyway who even cares at this point

#

lmao

wraith rapids
#

yes, but you don't need to scream about it as if not knowing that makes someone subhuman

#

it's a clear inferiority complex where you try to shove others down with overly agressive remarks about irrelevant shit to make yourself feel better than they are

#

it disgusts me

#

stop doing it

#

and yes, i'm going pretty hard on you here

granite stirrup
#

you think im screaming just cuz i used all caps lol

wraith rapids
#

but i've been looking at you doing that shit for weeks and you haven't improved at all

granite stirrup
#

im just asking them who even uses camel case for package names lol

quiet ice
#

NNY has spoken

eternal oxide
#

Yeah you tell him NNY! You aggressively push him down and subjugate him 👀

wraith rapids
#

yeah i need to sate my fucking inferiority complex

hybrid spoke
#

yeah you was obv. typing

ivory sleet
#

whats going on

lucid bane
#

seems serious here

granite stirrup
#

maybe the caps was a little excessive.... but like i was just trying to tell him who uses camelcase for package names lol

torn frost
#

Sir, how do i list all the worlds in the server (all worlds created using multiverse.)? Please point me to the docs if it's considered spoon feeding.
Thank You

eternal oxide
granite stirrup
ivory sleet
#

I don't think you can track all the worlds created/loaded by mv specifically

eternal oxide
#

You can all loaded worlds

wraith rapids
#

you can track all loaded worlds, but for unloaded worlds managed by MV you need to hook into their api

ivory sleet
#

idkidk tho pretty sure that's just their api version of Server#getWorlds 🤷

granite stirrup
#

nah it says "Returns a list of all the worlds Multiverse knows about."

ivory sleet
#

Yeah

#

which would be every world loaded

wraith rapids
#

that should return unloaded worlds as well then if their documentation is in line with their normal terms used

ivory sleet
#

myeah idk somewhat ambiguous imo

granite stirrup
#

i looked at the code lmao it just returns this.worlds.values()

wraith rapids
#

real men would just get their plugin directory and read their worlds.yml

granite stirrup
#

i think multiverse does read a file

#

but i think thats at startup maybe

quaint mantle
#

Wats better spigot-api-1.12.2.jar or spigot-1.12.2.jar ?

ivory sleet
#

Inevitably yes idkidk

ivory sleet
quaint mantle
#

For intellij

granite stirrup
#

wouldnt u have access to nms if you use the spigot jar?

#

and not the api jar

ivory sleet
#

Yes

quaint mantle
#

The normal spigot-1.12.2.jar?

ivory sleet
#

But the latter has the api and nms and all the other things shaded in

granite stirrup
#

@quaint mantle just use the spigot-api

quaint mantle
#

Spigot-api-1.12.2.jar?

granite stirrup
quaint mantle
#

Its for modules for intellij

granite stirrup
#

?

quaint mantle
#

Dependencies

granite stirrup
#

ok i dont know lol just use the spigot api... which is how you make a spigot plugin

quaint mantle
#

Agree

#

But

#

I have an error when i start my server its says plugin.yml didnt work

granite stirrup
#

im pretty new with intellij so dont ask me for intellij stuff

granite stirrup
#

are you using maven also?

quaint mantle
#

I use java

wraith rapids
#

hh

quaint mantle
#

Kotlin

wraith rapids
#

i don't have a list of 1.12 plebians

#

perhaps I should start one

granite stirrup
#

isnt 1.12 like outdated lmao

hybrid spoke
#

yeah it is

#

1.5.2 is the real version

granite stirrup
#

no 1.9 :) since its higher than every version

hybrid spoke
#

9>10 🤔

granite stirrup
#

thats how it is in decimal

#

1.9 > 1.10

#

i think

hybrid spoke
#

i would say since we are in java its version 8, version 9, version 10, version 12.2 rn

#

so 10>9

granite stirrup
#

yeah

#

but 1.9 > 1.10

#

lol

hybrid spoke
#

put it in a black hole

ivory sleet
#

That’s not how versioning works

granite stirrup
#

ik

#

but it is greater than

hybrid spoke
quaint mantle
#

how do i pull an OfflinePlayer from uuid of a player that i know is cached

granite stirrup
lucid bane
#

Imao

granite stirrup
#

isnt there a Bukkit.getOfflinePlayer?

topaz moon
hybrid spoke
ivory sleet
ivory sleet
#

getOfflinePlayerIfCached

granite stirrup
quaint mantle
quaint mantle
granite stirrup
quaint mantle
#

not a thing?

#

just .getName

hybrid spoke
quaint mantle
#

uuid.toString into that method?

ivory sleet
#

thejakwe yeah the name is null if the player hasn’t joined the server

hybrid spoke
#

you can pass a uuid

granite stirrup
#

"Names are no longer unique past a single game session. For persistent storage it is recommended that you use getUniqueId() instead." <-- it says in the getName on docs lol

quaint mantle
#

but its in usercache.jsonm

hybrid spoke
#

which gives you back the offlineplayer with the given uuid

wraith rapids
#

if they are in the usercache, the name shouldn't be null, unless the entry expired

#

have you checked whether the usercache entry is expired

quaint mantle
#

it shouldnt

granite stirrup
#

it would have to expire at some point?

ivory sleet
#

Essentially Server#getOfflinePlayer(uuid) may just wrap the uuid with an OfflinePlayer object leaving name to be null

quaint mantle
#

i cant send images here but this

public OfflinePlayer getOfflinePlayer(UUID id) {
        Validate.notNull(id, "UUID cannot be null");

        OfflinePlayer result = this.getPlayer(id);
        if (result == null) {
            result = this.offlinePlayers.get(id);
            if (result == null) {
                result = new CraftOfflinePlayer(this, new GameProfile(id, null));
                this.offlinePlayers.put(id, result);
            }
        } else {
            this.offlinePlayers.remove(id);
        }

        return result;
    }
``` (from CraftServer)
topaz moon
#

?paste

undone axleBOT
quaint mantle
#

it creates with null name

ivory sleet
#

as I just mentioned

granite stirrup
#

cant you just get the name urself?

quaint mantle
#

why tho? the username is available in the cache

hybrid spoke
#

it takes his data from playerdata

ivory sleet
#

idk exactly how the usercache.json works

wraith rapids
#

you'll have to complete the game profile

quaint mantle
wraith rapids
#

accessing the cache directly requires nms

quaint mantle
#

is there a method to pull from cache

wraith rapids
#

there's a get usercache method somewhere in nms or cbo

granite stirrup
cyan bluff
#
Bukkit.broadcastMessage(ChatColor.RED+"The worldborder will begin to shrink in 3 minutes.");
//wait 3 min
Bukkit.broadcastMessage(ChatColor.RED+"The worldborder is shrinking!");
world.getWorldBorder().setSize(800, 300);
Bukkit.broadcastMessage(ChatColor.GREEN+"The worldborder will resume shrinking in 3 minutes.");
//wait 3 min
Bukkit.broadcastMessage(ChatColor.RED+"The worldborder is shrinking!");
world.getWorldBorder().setSize(500, 300);
Bukkit.broadcastMessage(ChatColor.GREEN+"The worldborder will resume shrinking in 4 minutes.");
//wait 4 min
Bukkit.broadcastMessage(ChatColor.RED+"The worldborder is shrinking!");
world.getWorldBorder().setSize(200, 180);
Bukkit.broadcastMessage(ChatColor.GREEN+"The worldborder will resume shrinking in 2 minutes.");
//wait 2 min
Bukkit.broadcastMessage(ChatColor.RED+"The worldborder is shrinking!");
world.getWorldBorder().setSize(100, 60);
Bukkit.broadcastMessage(ChatColor.GREEN+"The worldborder will resume shrinking in 1 minute.");
//wait 1 min
Bukkit.broadcastMessage(ChatColor.RED+"The worldborder is shrinking!");
world.getWorldBorder().setSize(50, 60);
Bukkit.broadcastMessage(ChatColor.DARK_RED+"The worldborder will resume shrinking in 30 seconds!");
//wait 30 seconds
world.getWorldBorder().setSize(0.5, 60);

How can I have this stop constantly after running each line of code?

wraith rapids
#

that said, that should still have a nonnull name

#

as it does query the offlineplayers list

undone axleBOT
quaint mantle
#

so how do i get it to work

#

lmao

granite stirrup
#

couldnt that guy use the bukkit scheduler lol

cyan bluff
granite stirrup
quaint mantle
#

oh

cyan bluff
#

like its just weird cuz i need so many delayed tasks

granite stirrup
#

you dont

#

u need just 1

hybrid spoke
#

if you want to crash the server

cyan bluff
#

thank you for the advice

cyan bluff
granite stirrup
#

just do it every minute

#

idk

cyan bluff
#

yeah see the time needs to fluctuate

wraith rapids
#

Thread.sleep is not something you should use on the main thread

wraith rapids
#

and WorldBorder::setSise is not something you should use off the main thread

#

so you have something of a conundrum if you don't use the scheduler

quaint mantle
#

i was doing normal java and also didnt think that was running on main :okayge:

#

anyway

#

so theres no way to pull it from cache?

ivory sleet
hybrid spoke
opal juniper
undone axleBOT
#

Spoonfeed a newbie for a day and they'll come back with more questions. Teach them to find their own answers and you'll both be better off: you won't get stuck answering the easy questions and they'll be much more productive than before.

hybrid spoke
#

ah

ivory sleet
#

its a pseudo code tho

opal juniper
#

Lmao

granite stirrup
#

im bored

wraith rapids
#

getprovidingplugin calls getClassLoader on the given class and tests if it's an instance of pluginclassloader

quaint mantle
wraith rapids
#

if it is, it'll return the pluginclassloader's associated plugin

ivory sleet
granite stirrup
opal juniper
#

How does the dependency injection stuff work - I normally just pass the plugin instance thru the constructor

granite stirrup
#

we need nms documentation :) someone painfully go through the files and make one

ivory sleet
#

I mean that's dependency injection

opal juniper
#

Wait is it

#

Oh

paper viper
granite stirrup
opal juniper
#

I thought it was a bit different to that but very nice

granite stirrup
#

but we need a doc with every single version

paper viper
#

Ok well I’m not doing that

ivory sleet
#

you can go ahead and start then idkidk

granite stirrup
#

with not for*

paper viper
#

You can wish and pray

opal juniper
#

That is a metric butttonne of work

paper viper
#

But I’m not doing it

#

Lol

opal juniper
#

I’m not doing it

paper viper
#

Not worth anyone’s time tbh

#

Nobody wants to do it

granite stirrup
ivory sleet
#

consider we do have mappings also

paper viper
#

It’s not like you would be recognized or anything if you did create docs…

opal juniper
#

I mean - I’m not sure how you stand legally after making a jd

granite stirrup
#

lets make nms a api :)

quaint mantle
#

yes.

paper viper
#

Again, I’m not doing that

#

Lmao

granite stirrup
#

lol

#

why not

#

seeems fun

opal juniper
#

When you say “make nms an api” you should just pr nms features into Bukkit

#

And by extension spigot

ivory sleet
paper viper
#

NMS changes so much every version

opal juniper
#

Nah it won’t

wraith rapids
#

bukkit is a nms api

paper viper
#

You need concrete implementation

granite stirrup
#

i really wished there was a way to do packets in spigot apI

opal juniper
granite stirrup
#

without nms in your project

wraith rapids
#

there isn't and there won't be

paper viper
wraith rapids
#

this is at least the third time we've gone over this

granite stirrup
ivory sleet
#

closed

wraith rapids
#

packets and their specific implementation is an implementation detail

paper viper
#

Same, idk what the heck is with you and your wishing lmao

wraith rapids
#

it is not and it cannot be a part of the api

paper viper
#

Sometimes certain stuff won’t happen

#

¯_(ツ)_/¯

granite stirrup
#

yeah but they want people to not use nms why not make it impossible to use nms if they have everything you can do in nms in spigot no one would use nms

paper viper
#

“But”

granite stirrup
#

just saying it would be cool to do packet stuff with spigot lol

wraith rapids
#

packets, once again, change freely and without constraint between versions

#

you can't have that in the bukkit api

paper viper
#

Literally protocollib exists

wraith rapids
#

that the game runs on packets is an implementation detail, and not part of the api

granite stirrup
wraith rapids
#

the api may provide functions that leverage packets, like sendBlockChange, but no direct access to packets will ever be provided in the api

granite stirrup
#

doesnt work on spigot tho

#

only on paper

#

1.17

ivory sleet
quaint mantle
#

you shouldnt be running just spigot Okayge

wraith rapids
#

splögget bad

sonic dirge
quaint mantle
#

use tuinity or at least paper

paper viper
#

If we even added a proper API, you realize how complex that would be too… right

#

Go look at the packet structure

quaint mantle
#

:YEP:

granite stirrup
paper viper
#

Yeah hell no nobody is gonna do that

opal juniper
#

Have you seen the packet structure for a chunk - the fuck I’m not touching that shit

granite stirrup
#

no i havent

paper viper
#

Exactly

granite stirrup
#

i just skimmed through it

wraith rapids
#

not to mention that that shit changes like every version

#

especially now that mojang is doing world format changes

paper viper
#

Do you even know the patch list idkkid

quaint mantle
#

this is why we have apis YEP

paper viper
#

It’s humongous

granite stirrup
#

kk i get it

paper viper
#

We always give you the same response

#

What do you expect for us to say…

granite stirrup
#

but we need hiding entitys from players in spigot api

#

atleast

ivory sleet
#

pr it

paper viper
#

Dude

sonic dirge
#

It sucks, yeah. Ask me about what it's like dealing with Mojang's world generator. :|

wraith rapids
#

doing that is trivial with protocollib, but you can pr it to the api if you want

#

it's something that could maybe get accepted if it doesn't have a high maintenance overhead

#

that nobody has done it yet is simply because it's so easy to do via protocollib that it's not worth the effort to modify the server for it

opal juniper
#

It’s a bit more complicated to re show them

granite stirrup
#

i dont think i would pr something cuz i really dont know how to make things for spigot or use patch files lol but i think the Entity class should have like a hide(Player player) and show(Player player) tho because some non experienced users gonna find it hard using packets and stuff

opal juniper
#

They have to have all the meta data packets as well

#

The showing is hard

opal juniper
wraith rapids
#

Bukkit.shutdown() is a pretty good concrete impl for it

#

can't see the entity if the server goes offline

opal juniper
#

That hides all entities though

#

Only want one

#

Just don’t look at it

opal juniper
#

What

granite stirrup
#

hiding players for entitys when?

wraith rapids
#

i wonder how far it boids could be taken with clientside entities spoofed via the protocol

opal juniper
#

No

wraith rapids
#

for flat areas it should be somewhat fine, i think

#

perhaps a meta entity that takes the shape of a bounding box that encloses the boid group

#

and caches terrain and block collisions within its bounds

#

which could then be used for the boids' movement, processed asynchronously

#

shit like projectiles would be a pain

#

perhaps just braindead dummy entities that do exist on the server side but would not do entity or block collisions, and be updated from the async processing from the boid group

#

still uses memory, but that should be fine

#

how are the entity update packets done internally, I wonder

#

are they buffered onto the main thread before sending

#

tons of entities would also overload the chunk distance tracker shit that keeps track of entity destroy/create packets

#

perhaps that could be managed externally

#

i remember someone doing an optimization on top of paper to the distance tracker, because they had like 100 thousand non-ticking armorstands

granite stirrup
#

is Minecraft servers still running on 1 thread?

wraith rapids
#

they didn't tick, but the constant checks on whether they should be shown to players or not were killing the server

#

it was a relatively simple patch that changed the time complexity from linear to logarithmic, I think, but I can't remember for the life of me what it was

eternal oxide
#

ish

wraith rapids
#

how complicated is it to remove an entity from the view distance manager, I wonder

#

i should fire up some alts later and ask in paper

#

i doubt anyone here knows

#

everybody here are just plugin developers that occasionally dabble in small parts of nms

#

with the exception of md69 who only materializes here when I shit on bukkit to threaten me with a ban if I don't sugarcoat shit

eternal oxide
#

we too dumb

sonic dirge
#

lol

wraith rapids
#

and choco who has stopped existing entirely in recent weeks

#

at least they took my suggestion to heart and sprinkled some mod perms to more users

opal juniper
#

He was here earlier

wraith rapids
#

maybe he's avoiding me

#

i'd avoid me

opal juniper
#

I would if I was him

granite stirrup
#

i tbh dont know what half of NNY said XD

opal juniper
#

Mean swing on you 😎

wraith rapids
#

the swing of a king

opal juniper
granite stirrup
opal juniper
#

Reply to it

wraith rapids
#

0x4

granite stirrup
#

XD

#

funny joke there

opal juniper
#

I don’t get it

#

What did I miss

#

I’m soooo tired so that doesn’t help

wraith rapids
#

0x4 is the 4 bit

granite stirrup
#

0xff is 255 right or is that wrong?

eternal oxide
#

0x4 "should" be bit 3

wraith rapids
#

yes but it's the bit with the 4 value

eternal oxide
#

0,2,4

#

ah ok

wraith rapids
#

like, the second digit in decimal is the tens digit

#

i suppose 4 bit is a little ambiguous

opal juniper
#

Oh I get it now

#

Smh

#

I’m a bit late to the party

eternal oxide
#

0x4 or 0b100

wraith rapids
#

at any rate, for the full factorio experience on my tech server, I want hordes of hundreds or maybe thousands of mobs

granite stirrup
#

so is it 0x0 - 0ff? for 0-255?

wraith rapids
#

which is kind of infeasible without something like boids

eternal oxide
#

0x0 - 0xFF

wraith rapids
#

flocks of a few thousand phantoms would be interesting as well

ivory sleet
#

if my client wouldnt crash that is

wraith rapids
#

the weak should fear the strong

ivory sleet
#

depends on what you mean with weak and strong

wraith rapids
#

manliness, of course

granite stirrup
#

is 0x9AB = 2475?

wraith rapids
#

i don't know, use an online hexadecimal converter

granite stirrup
#

it said that

#

idk if its correct

eternal oxide
granite stirrup
#

nah google

eternal oxide
#

You really want google to know you can't count in hex?

granite stirrup
#

all i know is 0xFF is 255 XD

ivory sleet
granite stirrup
#

anyone know what a Googol is in hex?

ivory sleet
opal juniper
#

I think that with that many entities the client is the problem

wraith rapids
#

well, that's not my problem

opal juniper
#

I mean - how can you test it without a client. Actually I take that back. You seem like you assume your code works

wraith rapids
#

my code always works

#

testing is for pussies

granite stirrup
#

no ones perfect

wraith rapids
#

you just can't comprehend it because you're not a real man

proud basin
#

Mr skull head

granite stirrup
torn oyster
#
                for (int i = 10; i > 0; i--) {
                    if (parkourLeaderboard != null) {
                        if (parkourLeaderboard.size() >= 10 - i) {
                            new Hologram("" + ChatColor.DARK_GRAY + (10 - i + 1) + ". " + ChatColor.GRAY + parkourLeaderboard.get(10 - i).replace("null", "N/A") + "s",
                                    new Location(world, x, y + (increment * i), z));
                            continue;
                        }
                    }
                    new Hologram("" + ChatColor.DARK_GRAY + (10 - i + 1) + ". " + ChatColor.GRAY + " N/A - 0.0s",
                            new Location(world, x, y + (increment * i), z));
                }```
That code is causing this error:
`java.lang.IndexOutOfBoundsException: Index 1 out of bounds for length 1`

The line that is causing it is: 
```java
                            new Hologram("" + ChatColor.DARK_GRAY + (10 - i + 1) + ". " + ChatColor.GRAY + parkourLeaderboard.get(10 - i).replace("null", "N/A") + "s",
                                    new Location(world, x, y + (increment * i), z));```
#

please help

granite stirrup
#

really

torn oyster
#

yes

#

i literally don't know what to do

#

probably really simple

granite stirrup
#

cuz the array is only size 1 and not size 10

eternal oxide
torn oyster
#

well it starts on 0

granite stirrup
#

please read the fucking stacktrace

eternal oxide
#

So do you understand the error now?

torn oyster
#

yes

#

i know

#

i always understood the error

eternal oxide
#

Um, ok. So what are you asking?

torn oyster
#

idk how to fix it

eternal oxide
#

get element 0 not 1

torn oyster
#

so -1?

#

cuz i have already tried that but then it says "Index -1 out of bounds for length 1"

eternal oxide
#

for (int i = 10; i > 0; i--) { is going to loop 11 times

torn oyster
#

oh

whole stag
eternal oxide
#

11, its inclusive

torn oyster
#

okay

#

so what do i do

#

i made it repeat 10

#

nothing changed

whole stag
#

That's a >, not >=

eternal oxide
#

yes, so 11

#

10 would be >=

granite stirrup
#

well you havent made the array have 10 items

torn oyster
#

yeah

#

thats why im checking to see if the length is higher than the index

whole stag
#
#!/usr/bin/java --source 11

public class PrintTable {
    public static void main(String[] args) {
       for(int i = 10; i > 0; --i) {
           System.out.println(i);
       }
    }
}
10
9
8
7
6
5
4
3
2
1
#

10 times

eternal oxide
#

11 times, it includes zero

whole stag
#

And even if it was 11, it wouldn't cause the issue

#

It doesn't print 0

eternal oxide
#

it only ends when its LESS than zero

ivory sleet
#

wouldnt that be i >= 0

whole stag
#

It ends when it's less than or equal to zero, run the code yourself, test it

ivory sleet
#

🤷

eternal oxide
#

yep, >=0 would be 10 times

eternal oxide
torn oyster
#

it ends when it is = 0

whole stag
#

Fite me

stone light
#

So I have this plugin I'm making and I have it so that when the game ends its supposed to delete the world file I already have it so it can delete the world file but how do I make it so when theres only one player left it does that?

wraith rapids
#

it never reaches 0 as the x > 0 condition fails when 0 is reached, and the loop terminates

#

so yes, 10 times

#

10 through 1

#

x >= 0 would run 11 times, 10 through 0

eternal oxide
wraith rapids
#

yes

#

which means that changing > to >= increases it by 1 iteration

#

as 0 will be counted

whole stag
#

The issue is on this line

if (parkourLeaderboard.size() >= 10 - i)
eternal oxide
#

ah I see

whole stag
#

That should be > there, not >=

eternal oxide
#

I guess I'm tired and blind

#

However the answer is, just loop the contents of yoru array not a counter

whole stag
#

@torn oyster swapping that should do the trick

torn oyster
#

alrighty

granite stirrup
#

my nitro classic is running out soon

#

:(

torn oyster
#

rip

whole stag
#

There's probably a more elegant solution, but this works fine

torn oyster
#

it works ty

whole stag
#

np

wraith rapids
#

it turns out what I was looking for under the name of navigable is what java actually calls list iterators

#

not that knowing that fucking helps any because there are still no collections that do what I want

granite trail
#

Something seems to be not right... 🤔
The code is actually same, with other config names, but it makes me appear with three errors...

#

Where did I messed up?

chrome beacon
#

What does it tell you

granite trail
#

Multiple markers at this line
- No exception of type Object can be thrown; an exception type must be a subclass of
Throwable
- InvaildConfigurationExcepton cannot be resolved to a type
and
The method printStackTrace() is undefined for the type Object

#

Oh

#

Found one

#

xd

cosmic patrol
granite stirrup
wraith rapids
#

yes

#

java 101

#

or well, programming 101

granite stirrup
#

he did a typo

#

lol

wraith rapids
#

never repeat yourself needlessly

granite trail
#

-.-

granite trail
#

Multiple markers at this line
- InvaildConfigurationException cannot be resolved to a type
- No exception of type Object can be thrown; an exception type must be a subclass of
Throwable

wraith rapids
#

and your code is needlessly repetitive

granite trail
#

BRUHMOMENT.exe

whole stag
#

F

granite trail
wraith rapids
#

more code to maintain means it's more difficult to maintain, which leads to issues like these

#

having to type large blocks of code by hand just to repeat a function is a serious fault point and will inevitably result in you making a typo like this

#

even if you copy paste and only modify certain values within the code blocks, the same can happen

granite trail
#

Exp.: copy-pastes makes you learn nothing

wraith rapids
#

not really what i was going for but whatever

granite stirrup
#

yeah so when i read a stack overflow i write it myself

granite trail
#

Writeing a code yourself makes you learn it.

wraith rapids
#

that doesn't mean you should write the same code repeatedly over and over

cosmic patrol
whole stag
#

The point is that your two functions could be one function

granite trail
#

But how to do that? D:

wraith rapids
#

look at the differences in your code blocks

#

they are currently hard-coded; you are changing them in the source code of the method itself

granite trail
#

(and don't force me Java wikis or Bukkit stuff. That actually won't help me)

wraith rapids
#

change them to variables

cobalt lagoon
granite trail
#

🤔

wraith rapids
#

instead of "Configurations/Bedwars.yml", use "Configurations/" + configName + ".yml"

cosmic patrol
# granite trail But how to do that? D:

String configName, and just use that instead of the file name. Also I don't get why your using saveDefaults() multiple times, it's the same function and will do the same thing in this case so call it once outside of that function. Is more efficient 😉

granite trail
wraith rapids
#

and change the method name from generateBedwarsConfig() to generateConfig(String configName)

#

can call it once with generateConfig("Bedwars") and a second time with generateConfig("Main")

granite stirrup
#
private void generateConfig(String path) {
  saveDefaultConfig();
  File f = new File(getDataFolder, path);
  if (!f.exists()) { this.saveResource(path,false); }
  YamlConfiguration playerData = new YamlConfiguration();
  try { playerData.load(f); } catch (IOException | InvalidConfigurationException e) { e.printStackTrace(); }
}

private void generateMainConfig() { generateConfig("Configurations/Main.yml"); }

private void generateBedWarsConfig() { generateConfig("Configurations/BedWars.yml"); }
wraith rapids
#

also something you can do, but not strictly necessary

granite stirrup
#

idk if thats correct or not

#

havent got time to test

granite trail
#

Lemme see it

cosmic patrol
# granite trail

Oh something you might like, you can do new File(getDataFolder, path); instead of doing + File.seperator+ the file class file handle that for you by going this

cobalt lagoon
#

Also, you don’t own the exception; I’d throw it up the stack. However, I assume that might be a bit advanced for now.

granite stirrup
#

i wrote it in discord so indents might be fucked

granite trail
#

Return types are missing.

cosmic patrol
#

that's for generateMainConfig() and generateBedWarsConfig()

whole stag
#

F

granite stirrup
#

oh

cosmic patrol
#

add void since you don't return anything

cobalt lagoon
#

Add «void»

granite stirrup
#

shit i forgot that

#

sorry i forgot to add them

#

just remember to not just copy code tho

#

sometimes you gotta do things yourself but i added them now

cosmic patrol
granite trail
#

Agreed

#

I added the code, and there are no errors.

#

Too sad I need to actually export the jar, upload to the VPS, and restart the server. 😹
(jk)

granite stirrup
#

just do a local server

granite trail
#

(but that's not a jk to test it)

granite trail
#

😁

granite stirrup
#

f

#

i do wish if maven was as fast as gradle but i really dont care about the speed lol

nocturne cedar
#

is there a way for me to list every online player name onto a scoreboard with skript? I know I might get criticized for using skript, but I simply don't have enough time to learn java atm

undone axleBOT
granite stirrup
#

this is for java stuff

#

not shitty non programming languages

granite trail
#

"Jar creation failed!" - ALLRIGHT! You won again! 🙄

granite stirrup
#

f

limpid axle
#

@granite stirrup if hes using skript he doesnt need java docs

granite stirrup
#

lol

granite trail
#

Creation failed, but there was already one JAr.

granite stirrup
#

ik that

granite trail
#

Nice job, editor.

granite stirrup
#

did i say u couldnt read?

limpid axle
granite trail
granite stirrup
granite trail
#

Works with both

granite stirrup
granite trail
#

'cause console cannot be killed lol

#

And I like errors. :)

granite stirrup
#

lol

granite trail
#

Yes. You're reading right.

#

I like errors from Skript.

#

😹

granite stirrup
#

yeah they are intresting

#

they like 10000 lines long XD

granite trail
#

Yeah. 😹

#

I also like how I needed to delete all of my scripts 'cause of the addons.

#

They f*cked up the main plugin

stone light
#

I'm trying to make it so when there is only one player left in the game it deletes the world I think I got how to delete the world but how will I make it so it happens after only one player is left alive?

reef wind
#

so if i understand you correctly u want to check if only one person is alive in the game?

cobalt lagoon
#

Cache the players in the game

#

Check the data structure size

#

If 1, delete world.

dusty herald
#

I mean that would only execute if no players are alive

granite trail
#

Isn't poiting an idea?
(when players join, the a variable gets one point. Each deaths removes one point. At 1, it deletes the world - if it is a minigame)

reef wind
#

I would just use a for loop

#

i have used it for similar before

#

worked fine

cobalt lagoon
#

Loop over what?

granite stirrup
#

players?

reef wind
#

and check if they are alive

granite stirrup
#

also check there world

stone light
#

so I want it to check for players alive not online because the dead players will be in spectator if that helps

reef wind
#

doesn't spectator count as alive?

#

if so just check if they are in spectator instead

cobalt lagoon
#

Hmm. Would the plugin not scale better with a cache system and checking size instead of looping over every server player?

#

collectionType#size might scale linear as well though. Can’t remember rn.

ivory sleet
#

what is collectionType?

cobalt lagoon
#

Whatever data structure he would use. Just wrote collectionType as they all inherent from Collection

ivory sleet
#

oh that highly depend on implementation

#

its O(n) for a concurrent hashmap keyset for instance while other data structures like arraylist caches the size making it O(1)

wraith rapids
#

most things do cache it, even linkedlists

cobalt lagoon
#

Oh yeah make sense, since they save by index

wraith rapids
#

stuff like the concurrent collections may be an exception

#

but i'd expect most of them to maintain a tally of it as well

#

regardless, if we are talking about the Bukkit.getPlayers() collection, that will realistically never be large enough for any of these to be valid considerations

cobalt lagoon
#

Conclure swedish 😮 I’m from norway

wraith rapids
#

the only case where you might run into performance issues with time complexity because of it would be if you were trying to sort it with bogosort

ivory sleet
#

😮

wraith rapids
#

sweden is kind of like norway

#

but norway is less gay

cobalt lagoon
#

Yes

ivory sleet
#

lmao

cobalt lagoon
#

Norway is real viking

#

Denmark is most gay though

granite stirrup
ivory sleet
#

gay = happy

reef wind
#

even though it sucks

ivory sleet
#

lol

reef wind
#

sviden

ivory sleet
#

I mean

reef wind
#

its boring

ivory sleet
#

What makes it sucky?

reef wind
#

it has nothing fun

ivory sleet
#

comparing to?

reef wind
#

usa

wraith rapids
#

sweden is too brown

#

i prefer the white ethnostate of norway

ivory sleet
#

Not that type of attitude here my dude

reef wind
cobalt lagoon
#

D:

reef wind
#

in sviden

granite stirrup
wraith rapids
#

the most racist

nova notch
#

is there any easy way to clone a region like with worldedit, but in code?

wraith rapids
#

depend on the worldedit api

reef wind
#

fuck me

wraith rapids
#

lmao

reef wind
#

everyone i make friends with here is racist

#

part of why i hate it

wraith rapids
#

in every person there's a small racist inside

reef wind
#

not really

wraith rapids
#

i for one do love formula racing

reef wind
#

imagine being racist

wraith rapids
#

i guess going fast isn't in your blood

reef wind
#

actual trash human

daring sierra
#

nnya you should verify

wraith rapids
#

never

proud basin
#

If I was going to change a player name for a "nickname" should I be using Player#setDisplayName

wraith rapids
#

yes

gilded ermine
#
        Document document = new Document("uuid", uuid.toString());
        document.append("name", name);

        mSkyblock.getInstance().getMongoHandler().collection.insertOne(document);


    }```

this code works but I can't find a way for the life of me to get a check as to whether a user is already in the db.. all the ways I've tried either just duplicate the entry every time i log in or do nothing at all

anyone know a way to check if there's already a db entry under the UUID
cyan bluff
lunar wedge
#

What java command would allow me to move an item from the helmet slot to the inventory?

wraith rapids
#

get the player's equipment, get the helmet slot, save it to a variable, set the slot to air or null, get the player's inventory and add the item in it

nova notch
next stratus
#

One minute it accepts it in the code but then doesn't accept it in game :/

nova notch
#

im just pasting a spleef map to reset it so this works fine for me

next stratus
nova notch
#

this is all it is:

World world = player.getWorld();
        int x = -252;
        int y = 23;
        int z = -7;
        Block block;
        Location blockLoc;
        while (x != -305 && z != 47 && y != 2) {
            block = world.getBlockAt(x, y, z);
            blockLoc = block.getLocation();
            blockLoc.add(100, 0, 0);
            blockLoc.getBlock().setType(block.getType());
            if (x == -304) {
                x = -251;
                z++;
                if (z == 46) {
                    y--;
                    z = -7;
                }
            }
            x--;
        }```
#

why did it

#

ok

next stratus
#

I mean, don't you paste it via schematic?

nova notch
#

i built it in the world

next stratus
#

Oh, you're harding coding it

nova notch
#

yeah

wraith rapids
#

lol

nova notch
#

thats what i said

next stratus
#

I miss read sorry its 2am

rain cypress
#

Hmm, I don't think BlockIgniteEvent is properly handling candles ignited from fireballs

wraith rapids
#

i don't know if ignite event is supposed to handle those

#

isn't that for stuff literally catching fire

#

as in, fire blocks being formed

rain cypress
#

That's how it's handled for campfires

wraith rapids
#

there's a little bit of a difference between a campfire and a candle, but I suppose I can see the logic there

sage swift
#

pfft why do you need it anyways intelli 🙄

rain cypress
#

🙄

#

Also I should clarify

#

candles ignited from fireballs launched from dispensers

sage swift
#

@md_5

#

ayup

quaint mantle
#
public void playerJoin(PlayerJoinEvent event) {
        event.joinMessage(null);
        new BukkitRunnable() {
            @Override
            public void run() {
                event.getPlayer().sendPlayerListFooter(Component.text(getServer().getCurrentTick()));
            }
        }.runTaskTimer(this, 20, 1);
    }

is this ok or will it break everything (testing)

wraith rapids
#

should be fine

#

consider using the bukkit scheduler rather than a bukkitrunnable, though, as that is cleaner

quaint mantle
#

ok cuz it says dont call api methods from async runnables

#

this wont like block the method?

wraith rapids
#

that isn't an async runnable

#

that is being run synchronously

#

runTaskTimerAsynchronously would run it asynchronously

#

or whatever that method is called

quaint mantle
#

for this what should i use

wraith rapids
#

sync is fine

#
Bukkit.getScheduler().runTaskTimer(plugin, () -> {
    event.getPlayer().sendPlayerListFooter(Component.text(getServer().getCurrentTick()))
}, 20, 1);
quaint mantle
#

that works

#

just making sure it wont lock the event thread

wraith rapids
#

it's the same but using a Runnable with the scheduler rather than a BukkitRunnable

quaint mantle
#

ah oke

wraith rapids
#

since Runnable is a one-method interface, you can use the () -> lambda function instead of having to create an entire anonymous class

#

and no, it won't block the event

quaint mantle
#

yeah i get that

#

ok cool

#

thanks

snow ember
#

Here's a function I made to delete a world.

    public void deleteMap(String mapName){
        System.out.println("deleting " + mapName);
        Bukkit.getWorld(mapName).getWorldFolder().delete();
    }

However, when I do System.out.println(Bukkit.getWorld(mapName).getWorldFolder().getAbsolutePath()); it outputs "C:\mypath\bla\bla\bal\.\world_name
it adds a .\ before world_name and this is confusing me a lot any help would be appreciated :)

wraith rapids
#

that's the least of your worries

#

i'd be more concerned about fucking with a world that is loaded

snow ember
#

o

wraith rapids
#

that can cause far worse things than just explosions

snow ember
#

no but I unload it

#

before

#

deleting

#

its not that hard

wraith rapids
#

if it were unloaded, getWorld wouldn't return it

snow ember
#

mh

#

hm

#

ok

quaint mantle
#

@wraith rapids will it auto cancel the task when the player disconnects or do i have to do that manually

snow ember
#

just tell me how to get the .\ removed

#

:/

brittle island
#

oi dee kay

#

idk

wraith rapids
#

no, you need to do it manually

#

the only case where tasks are cancelled automatically is when your plugin is disabled

quaint mantle
#

alr

quaint mantle
vagrant stratus
#

If i were to do a GUI based Item Builder what would be the best way to implement that 🤔
I instantly think of using NBT to do it dynamically. Which would be a single class with the needed info and the GUI would said class to pull the supported NBT and modify/create said item.

I could also do a bunch of if/else statements or one class per item, however i feel like that'll get messy the more items I'd want to support.

edit for quote:
Lets say you wanted to create a monster spawner.
You'd be able to set all of the values via said GUI and while bukkit supports it it's limited to an extent (e.g. one entity only).

Now, lets say you wanted to create a spawn egg using the same GUI based creator.
Bukkit support falls apart, massively, depending on what you're trying to create and with each spawn egg being a different material it's an even bigger pain to do. I could do separate classes or if/else statements for each case however i don't think that's a clean implementation.

Doing it via NMS means a fuck ton of registering and shit and a lot of it already done via bukkit impl, but it would get rid of the edge cases...however I'm not really sure that's the best implementation method either :/

quaint mantle
#

The goal is to put specific items in specific slots?

vagrant stratus
#

Nah, that's the easy part 👀
It would serve as a way to create spawn eggs, monster spawners, etc easily

civic socket
#

I am trying to import a /nick plugin into spigot and nothing is working, can somebody vc and help me

vagrant stratus
#

The issue with that though is some don't play nice the bukkit way

broken hare
quaint mantle
#

Hmm I guess I’m lacking some info. So the gui would serve the purpose of running different code blocks per item you click on? What would you store in nbt

snow ember
#

how am I supposed to delete it at that point?

civic socket
#

I am trying to import a /nick plugin into spigot and nothing is working, can somebody vc and help me

wraith rapids
#

no, nobody will vc you

#

ask your questions in text

#

if you can't explain through text, use screenshots

quaint mantle
#

Off of server,

vagrant stratus
# quaint mantle Hmm I guess I’m lacking some info. So the gui would serve the purpose of running...

Lets say you wanted to create a monster spawner.
You'd be able to set all of the values via said GUI and while bukkit supports it it's limited to an extent (e.g. one entity only).

Now, lets say you wanted to create a spawn egg using the same GUI based creator.
Bukkit support falls apart, massively, depending on what you're trying to create and with each spawn egg being a different material it's an even bigger pain to do. I could do separate classes or if/else statements for each case however i don't think that's a clean implementation 🤔

#

Doing it via NMS means a fuck ton of registering and shit and a lot of it already done via bukkit impl, but it would get rid of the edge cases...however I'm not really sure that's the best implementation method either :/

snow ember
whole stag
#

I am reminded of why I hate java so much

vagrant stratus
#

why?

whole stag
#

Mainly because it sucks

broken hare
#

I think that issue is resolved

whole stag
#

Ah, yes. Comments

unreal quartz
#

/**

  • Get name
  • @ return name
    */
    String getName();
tame wolf
#

How would I allow an item to have enchantments

#

Like a trident can have sharpness

whole stag
#

ooh, setArrowsInBody(int count)

#

Is there a max number?

sage swift
sage swift
whole stag
#

Dang

#

Let's see how many it is

sage swift
#

100 or so

#

or less

tame wolf
sage swift
tame wolf
#

Wait so this isn’t what I’m looking for

#

I’m looking for a way for uses to be able to add sharpness to an item that isn’t supported by sharpness

#

Like a trident with sharpness

tame wolf
lunar wedge
#

I'd like to make a very very simple chunk based land claiming plugin - where should I start? Any tutorials available that anyone knows of?

sage swift
#

towny

tame wolf
#

Can I set the damage of a item?

hexed hatch
#

You can set attributes, yes

#

If you're talking about attack damage

tame wolf
#

How

tame wolf
hexed hatch
#

Yep

tame wolf
#

How

hexed hatch
#

ItemMeta#addAttributeModifier()

tame wolf
#

Thx

novel pendant
#

So I am making plugin for a game and Im working on the countdown for when people join the lobby... Any reason why this isn't erroring but isn't sending the message? It did at one point but stopped after further development.

                for (Player player: Bukkit.getOnlinePlayers()) {
                    player.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText("Game Starts in 15 Seconds"));
                    //^Plays Title Screen at the 15 Seconds mark at ActionBar
whole stag
#

docker plugin for vscode is very nice

quaint mantle
#

@novel pendant Use a countdown task.

#

Make a new class that extends BukkitRunnable

#
public class Save extends BukkitRunnable {
    @Override
    public void run() {
        for(Engine instance : EntryPoint.getWorldTracker().values()){
            instance.saveMappedDataToFile(false);
        }
    }
}```
#

?

#

He wants to know how to countdown 15 seconds.

#

i know

#

He can do this with a BukkitRunnable and then do runTaskTimer

#

but why the example code

#
        for(Engine instance : EntryPoint.getWorldTracker().values()){
            instance.saveMappedDataToFile(false);
        }
#

lol

#

🤷

#

Yeah it's a backup task that I use in my plugin

#

I have it set to run every 12 hours

dusty estuary
#

cant you just do this

Bukkit.getScheduler().runTaskLater(Main.plugin, () -> {
  //your code here
},time);
quaint mantle
#

yep. That is valid too.

#

better to have an object than have a huge stack of lambda code

novel pendant
#

wait why would I make a countdown task for that though, I need it to put out a message at each milestone

quaint mantle
#

Ah.

#

Wasn't aware of this

#

I thought you just wanted to count 15 seconds, then execute some task

sage swift
novel pendant
#

No I was mainly asking why this wasnt running even without any errors
for (Player player: Bukkit.getOnlinePlayers()) {
player.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText("Game Starts in 15 Seconds"));

quaint mantle
#

show before code

#

full class

sage swift
#

does it run in the first place? try a broadcast above the for loop

dusty estuary
#

just use new TextComponent()

sage swift
#

that's not the issue

novel pendant
#

I cant send the full class

sage swift
#

?paste

undone axleBOT
novel pendant
#

ah thanks

quaint mantle
#

Remove line 34 as well.

#

you don't need to register it twice

novel pendant
#

aight yeah probably a copy paste error at some point

sage swift
#

you're only setting ifHap to true at the very start

novel pendant
#

should it be above the onEight function?

sage swift
#

it's running for the first player that logs in and setting ifHap to false, but at that point the player count is 1

#

so you see nothing

#

you can check booleans directly, ie if (ifHap) {

#

i don't know what ifHap is, but you should probably be setting it within the PlayerJoinEvent as well as at the start

dusty estuary
#

btw is it possible to set that some file in the local repository is not copied to github (cuz some file are too large and github is complaining)

sage swift
#

gitignore *.jar?

quaint mantle
#

^

dusty estuary
#

how to make one

sage swift
#

right click on it in github desktop and press ignore

quaint mantle
#

do you have git integrated into your ide?

dusty estuary
#

i am using vscode

quaint mantle
#

Is VCS enabled? or whatever its called in vscode

#

I use intelli J...

dusty estuary
#

i mean yea

#

but it cant just right click and ignore

#

it has a .gitignore.txt

#

?paste

undone axleBOT
quaint mantle
#

I can just right click and ignore, Idk how to do it manually

dusty estuary
quaint mantle
#

I suck with Git

dusty estuary
#

this

#

is the file

quaint mantle
#

Yeah sorry. I don't really know

torn oyster
#
    @EventHandler
    public void onBlockForm(BlockFromToEvent e) {
        int id = e.getBlock().getType().getId();
        if (id >= 8 && id <= 11) {
            Block block = e.getToBlock();
            int toId = block.getType().getId();
            if (toId == 0) {
                if (generatesCobble(id, block)) {
                    if (rand.nextInt(5) == 1) {
                        block.setType(Material.COAL_ORE);
                    } else if (rand.nextInt(7) == 1) {
                        block.setType(Material.IRON_ORE);
                    } else if (rand.nextInt(12) == 1) {
                        block.setType(Material.LAPIS_ORE);
                    } else if (rand.nextInt(18) == 1) {
                        block.setType(Material.REDSTONE_ORE);
                    } else if (rand.nextInt(22) == 1) {
                        block.setType(Material.GOLD_ORE);
                    } else if (rand.nextInt(45) == 1) {
                        block.setType(Material.EMERALD_ORE);
                    } else if (rand.nextInt(50) == 1) {
                        block.setType(Material.DIAMOND_ORE);
                    }
                }
            }
        }
    }```
#

this isnt working

#

i updated it from 1.8 - 1.16

#

changed a few things

sage swift
#

that is 100% the best way to do random selection lol

#

hold on let me get my cobble gen plugin

torn oyster
#

diamond is 2%

sage swift
#

?paste

undone axleBOT
sage swift
#

gotta cancel the event

torn oyster
#

can i copy it

sage swift
#

that's lava flow only

torn oyster
#

what is the lavaFaces and waterFaces variable

#

and pickmaterial

sage swift
#
    private final Set<BlockFace> waterFaces = EnumSet.of(BlockFace.NORTH, BlockFace.EAST, BlockFace.SOUTH, BlockFace.WEST);
    private final Set<BlockFace> lavaFaces = EnumSet.of(BlockFace.DOWN, BlockFace.NORTH, BlockFace.EAST, BlockFace.SOUTH, BlockFace.WEST);```
#
    private Material pickMaterial(String tier) {
        if (tier == null) return null;
        double runningTotal = 0;
        double choice = plugin.random.nextDouble() * 100;
        Set<String> keys = plugin.getConfig().getConfigurationSection("generators." + tier + ".blocks").getKeys(false);
        for (String materialName : keys) {
            runningTotal += plugin.getConfig().getDouble("generators." + tier + ".blocks." + materialName);
            if (choice < runningTotal) {
                return Material.getMaterial(materialName.toUpperCase());
            }
        }
        return null;
    }```
#

i was also lazy and didnt make it a relative total, so the chances have to add up to 100

#

easy to change though

dusty estuary
#

wut are you guyz making rn

sage swift
#

babies

dusty estuary
#

-_-

sage swift
#

idk what he's making just wanted to show off a simple cobble gen plugin

torn oyster
sage swift
#

because MagicCobblestoneGenerator is a terrible bentobox addon

torn oyster
#

for my server

sage swift
#

why not just use bentobox

#

there are some things not worth (re-)creating, in my opinion

dusty estuary
#

whats that magic cobblestone generator thing

digital plinth
#

wait i cant cancel a bukkittask from within itself, i thought it was supposed to be possible?

sage swift
#

doesn't detect permission properly, breaks when the permission are taken away (people still have access to tiers they dont have permission for)

#

what are you trying supa

digital plinth
digital plinth
dusty estuary
#

manhunts? fun

#

i am thinking of the random item thing

digital plinth
#

ahh thats soo old

#

im making something original

#

hope it gets popular

#

🙏

dusty estuary
#

i am training a machine learning model for minecraft

#

interacting with C++ libs are annoying

digital plinth
#

and decided minecraft is too difficult for a AI

#

XD

#

well gl

dusty estuary
#

who?

digital plinth
#

dunno

dusty estuary
#

like for speedrunning?

#

or what?

digital plinth
#

watched a vid like a long time ago

digital plinth
#

ik theres bots for

#

PVP

#

Mining(hacking)

#

bots != ai

dusty estuary
#

cuz i am doing one for outlining buildings from real life building images

digital plinth
#

ahh so feed the AI a picture of a real life building

#

and it builds it in mc?

dusty estuary
#

yes

digital plinth
#

nice

dusty estuary
#

but i know little about AI and need someone to help me fix the model

digital plinth
#

i dunno much either

dusty estuary
#

cuz the IO size is not desirable

digital plinth
#

ik they are like 2 AIs competing

#

and making each other smarter and stuff

#

:/

dusty estuary
#

thats reinforcement learning

#

what i am doing is 3D convolution

#

theres many types of ai

#

my type is (similar) to those that regconize pictures

digital plinth
digital plinth
#

NOOO

#

there is a AI

#

there is like

#

SOOO BAD

#

at recongnizing pictures

#

here

#

an example

#

face depixalizer

#

try not to um

whole stag
#

I know this one

digital plinth
#

vomit

dusty estuary
#

i knew theres a AI to depixalize some umm..... you know.... videos...

digital plinth
#

hold on a moment

dusty estuary
#

not good to say it out here

digital plinth
#

hent AI ?

dusty estuary
#

idk , i know someone made it

digital plinth
#

hmmm

whole stag
#

This the one?

digital plinth
dusty estuary
#

this one sucks , only good for western people

digital plinth
#

wait y they not png

dusty estuary
#

cuz it generated from matplotlib

vagrant stratus
#

are you on a phone @digital plinth ?

digital plinth
#

no