#help-development

1 messages · Page 177 of 1

fluid river
#

EpicEbic has own java version

#

EpicJDK 22

old cloud
#

epic

fluid river
#

obfuscated code be like tho

crimson terrace
#

How about
if (args[0].toLowerCase().equalsIgnoreCase("HACKING".toLowerCase())) {}

#

nested toLowerCase() methods 😛

remote swallow
#

my brain didnt work then

#

i realised pretty much instantly after i slept

crimson terrace
#

we all have those moments XD

crimson terrace
#

you said "equals"

fluid river
#

oh true

crimson terrace
#

I said "equalsIgnoreCase"

#

we are not the same

fluid river
#

sry it's just half-screen discord formatting

crimson terrace
#

XD

fluid river
#

hard to read

ivory sleet
#

toLowerCase(Locale.ROOT)😌

crimson terrace
#

brains arent braining today

fluid river
#

three lines

crimson terrace
#

oh crap

remote swallow
#

what about if (args[0].toLowerCase().equalsIgnoreCase(ChatColor.stripColor(ChatColor.translateAlernateColorCodes('&', "HACKING".toLowerCase())) {

crimson terrace
remote swallow
#

there

crimson terrace
#

thanks

remote swallow
#

amazing if statement

fluid river
#
char[] args0 = args[0].toUpperCase().toCharArray();
if (new String(args0).toLowerCase().equalsIgnoreCase(new String(new char[] {'H', 'A', 'C', 'K', 'I', 'N', 'G'}).toLowerCase())) {}
remote swallow
#

lmfao

crimson terrace
#

is this a contest?

fluid river
#

probably

remote swallow
#

add chat strip color and translate alternate color codes

fluid river
#

obfuscated code be like i guess

remote swallow
#

then add minimessages strip color

crimson terrace
#

if so you broke the rules of only one statement

remote swallow
#

wonder what the longest most pointless if statement is

#

that has way too much excess

crimson terrace
#

God made the mistake of letting us call methods after a method call. The CPUs will suffer

desert loom
#
if(((Object)"HACKING") instanceof String hacking && args[0].equalsIgnoreCase(hacking))
crimson terrace
#

nobody does because theres always one more line you could pointlessly add

remote swallow
#

its probably gotta be convert a string to char then convert that char to string strip chat colour and translate alternate desterilize with minimessages then check all the to lower case stuff

#

another thing you could do is convert every character in that to its number in the alphabet then convert that back

fluid river
#

we need TextComponent tho

#

completely forgot

remote swallow
#

.desterilize thing for strings i think

#

could always .toString it

desert loom
#

contributing to a good cause (bloat)

warm light
#

Does inv have UID or something like that?

undone axleBOT
torn oyster
#

what would be the best way to store a location in mysql

#

you can store json in mysql?

brazen hollow
#

Why is nothing logged?

#

I also cant logg anything with sender.sendMessage or Bukkit.getConsoleCommandSender

hazy parrot
#

Does that code even execute?

#

Have you set executor

remote swallow
#

is it in plugin.yml

brazen hollow
#

When I set a breakpoint its "called"

#

And the command also worked for client

remote swallow
#

send your main class and that class on

#

?paste

undone axleBOT
brazen hollow
remote swallow
#

does it error/not error if either does it just not do anything

brazen hollow
#

What?

remote swallow
#

What does running the command do in game or from console

brazen hollow
#

Nothing is logged to the console

#

But the command works as expected for Player

remote swallow
#

add an else statement to your if (sender0

brazen hollow
#

sender == null?

#

or wdym?

remote swallow
#

else {

brazen hollow
#

ok

#

Thats strange...

#

When I execute the cmd clientside, its run through as expected but the else breakpoint starts

#

And when I execute the cmd serverside, still nothing happens

brazen hollow
#

It has something to do with the intelij debugging, I'll just do it the old way xd

wary topaz
#
int amount = Integer.parseInt(args[2]);
                                    if (amount == null) {
                                        sender.sendMessage("§4§lPlease use a number or do not set this argument.");
                                        return true;
                                    }

Operator '==' cannot be applied to 'int', 'null'

remote swallow
#

an int cant ever be null

echo basalt
#

int is a primitive

#

primitives cant be null

wary topaz
#

How would I check if its nots whole numbers?

echo basalt
#

You'll instead have an exception on parseInt

#

so tryCatch it

wary topaz
#

alr

glad prawn
#

I check it with regex hehe

echo basalt
#

probably takes longer

tardy delta
#

Returning null would make Sense tho

#

Should search how execution speed evolves when An exception is thrown

glad prawn
#

Never mind. I just want to look clean code. Especially for simple plugins.

echo basalt
#

ints cant be null

#

you could assign a magic value

tardy delta
#

Smh

kindred valley
#

static 😪

#

You stfu stop abusing

serene sigil
#

hi, can any 1 help me plz? i asked this question like 4 times and no one answered...

Why does the diamond sword not appear there!?!?! (the gui does)

#

okay

#

@quaint mantle doesnt work

#

but i tried an anvil gui and that works

#

i have no fking idea why it doesnt work!!

eternal oxide
#

Smithing is clearly broken

serene sigil
#

yes

eternal oxide
#

Try placing an actual smith and provide it's location to your code

serene sigil
#

can u report an issue to md_5?

eternal oxide
#

You can yourself

serene sigil
#

lol

drowsy helm
eternal oxide
#

When you create an inventory you have the option of providing a location to an actual inventory

serene sigil
#

ohh

#

alr ima try

eternal oxide
#

see if it works when you provide an actual smith

#

If it does then it's simply incomplete code in Bukkit

serene sigil
#

thx

eternal oxide
#

?jira

undone axleBOT
eternal oxide
#

yeps

#

Yep Smithing inventory is not implemented in Spigot Caused by: java.lang.UnsupportedOperationException: Not supported yet.

serene sigil
#

lol

eternal oxide
#

?stash

undone axleBOT
eternal oxide
#

Yep, only anvil and WorkBench are implemented.

serene sigil
#

dear md_5, PLEASE FIX IT NOW!!!!!!!

#

lol

eternal oxide
#

I set to watching that ticket. I'll be interested in how fast it gets closed 🙂

serene sigil
#

ye lol

#

but will it be fixed for all versions?

#

cuz im using 1.19 for my plugin

kindred valley
#

Why do you ping people

young knoll
serene sigil
#

so 1.19.2?

young knoll
#

Yes

serene sigil
#

omg

#

but i need it to be 1.19

#

-_-

#

how do u setname for an inventory

young knoll
#

After it’s open?

serene sigil
#

like the name of the inventory

untold jewel
#

(holder, slot, title)

serene sigil
kind hatch
#

Gotta open a new one every time if you want a new name.

serene sigil
young knoll
#

createInventory takes a name

untold jewel
echo basalt
untold jewel
#

he asked how to set the name

untold jewel
kind hatch
echo basalt
#

built in != hacky

young knoll
#
public void setTitle(Component name) {
        for (HumanEntity player : this.inventory.getViewers()) {
            ServerPlayer NMSPlayer = ((CraftPlayer) player).getHandle();
            int containerID = NMSPlayer.containerMenu.containerId;

            ClientboundOpenScreenPacket packet = new ClientboundOpenScreenPacket(containerID, getMenuType(),
                    PaperAdventure.asVanilla(name));
            NMSPlayer.connection.send(packet);
            ((org.bukkit.entity.Player) player).updateInventory();
        }
    }
#

:p

brave goblet
#

I know how to get these stats

#

but how would you get these

#

for individual items

young knoll
#

There’s a second method that takes a material

brave goblet
brave goblet
#

Oh thats easy thanks :D

serene sigil
#

how do u make the item just shiny, not give it an actual enchantment?

serene sigil
#

kk thx

serene sigil
untold jewel
#

?google

undone axleBOT
echo basalt
#

?bing

undone axleBOT
untold jewel
#

hell

#

nah

echo basalt
#

?duckduckgo

untold jewel
#

they actually have a bing command

#

HAHAH

echo basalt
#

rip it aint a thing

#

?baidu

hybrid spoke
river oracle
#

Bing 💀

untold jewel
#

Literally googles ugly little brother

molten hearth
#

I remember in my old high school in the Uk they blocked google and we had to use bing

#

great experience

eternal oxide
grand pebble
#

Hi everyone !
How i can make a permission system in my plugin please ?

floral drum
grand pebble
#

Actually i have a plugin where system similar to faction and i want the owner of the faction wan set a rank for a specific player into a faction
Like a hierarchy

#

I didn't know if it's clear

tardy delta
#

just use luckperms

grand pebble
#

No ?

#

Because I want the rank is only in "faction"

#

not in general

eternal oxide
#

Go look at Towny. I added a permission system to that for Mayor and King ranks

grand pebble
#

Towny is open source?

eternal oxide
#

yes

tardy delta
#

bruh code didnt want to do anything cuz i supressed exceptions from being printed

#

30 minutes to find the shit lol

#

literally wasting my time by coding in college

grand pebble
tardy delta
#

add a WHERE clause lol

grand pebble
#

...

tardy delta
#

or a LIMIT whatever

grand pebble
#

Is not my question

tardy delta
#

if that was a question, yes i know

flint coyote
#

why would you do that

#

If you wanna cache your result in an array and always do select * anyway you don't have to use a db lol

tardy delta
#

fuck everyone arriving and this room getting full of people

flint coyote
#

Why would you fuck everyone arriving? 🤔

tardy delta
#

you gotta be kiddin me

flint coyote
#

that's a lovely error you got there. Good luck

midnight shore
#

Hi, i want to make a kind of a texture painting system. For example i give the system a center and i want to have some offsets that according to the center direction will spawn a particle to the generated position.

tardy delta
#

wondering how to see table structure on sqlite cli

midnight shore
#

for example i give the system center X and offset -1,0 and it should spawn a particle here

flint coyote
tardy delta
#

ty

#

only got 5 minutes left or prof databases will get angry lol

floral drum
glossy venture
#

some sin cos shit

midnight shore
#

if only i knew that stuff

opal juniper
#

Yeah i read that but there is no question there

#

its a statement

#

what do you need help with?

midnight shore
#

The question is how can i generate a location according to the center rotation and the specified offset

opal juniper
#

well, what sort of orientation are you using? if its just a flat image you can just add to the location directly

#

is it supposed to point at the player?

midnight shore
#

like the center is going to be a bit off from the head of the player

#

forward

opal juniper
#

oh so the idea is that it always faces the direction they are looking?

twilit roost
#

Im creating Portable Furnaces and I need to somehow get its current smelt status, so I can store it into config
Any clues how?

upper mica
#

Hello, what data does spigot/bukkit cache when player disconnects, e.g. does it cache (last disconnected) location? I'm using Bukkit#getOfflinePlayer

upper mica
upper mica
tender shard
#

you could just read the player's .dat file to get their logout location

upper mica
#

I could but I have found a workaround

hollow pelican
#

Does Spigot's .sendMessage() method send any packets that I can log?

chrome beacon
naive bolt
#

line 17 is

      Guild guild = plugin.getJDA().getGuildById(plugin.getConfig().getString("guild_ID"));```
chrome beacon
#

Looks like your plugin is disabled

hollow pelican
eternal night
#

presumably your packet logger has an issue then

hollow pelican
#

It's meant to log packet reads and packet writes.

#

It logs them for the player specifically.

eternal night
#

Well something is wrong then 😅

#

sendMessage certainly sends a packet

#

specifically a ClientboundSystemChatPacket

hollow pelican
#

I'm trying to log that but nothing is showing up.

chrome beacon
#

Well your packet logger is broken then

hollow pelican
#

Oh I see the issue

#

I had a return; statement in the wrong place.

#

Thanks for all of the help. 🙂

green prism
#

help?
java.lang.IllegalStateException: InventoryCloseEvent may only be triggered synchronously.
player.closeInventory()

eternal night
#

don't trigger the code off main thread

green prism
eternal night
#

schedule a callback to the bukkit scheduler ?

chrome beacon
#

Run code sync

#

Yeah bukkit scheduler

green prism
#

Bukkit.getScheduler... etc?

#

okay

green prism
#

Something like that?

chrome beacon
#

Yeah

green prism
tardy delta
#

It just () instead of r

#

So it's a runnable instead of a unused consumer

green prism
green prism
tardy delta
#

Has nothing to do with Java 2.0

green prism
#

lmao

tardy delta
#

Ofc it does

#

Like Java 1 does

chrome beacon
#

No

tardy delta
#

Ig

chrome beacon
#

Lambda functions are Java 8

tardy delta
#

I was talking about whether Java 2 exists ig

#

Should stop wasting 4g on this anyways

green prism
tardy delta
#

Il look when im home in like half An hour

green prism
green prism
opal juniper
#

via API?

green prism
#

tomorrow update

opal juniper
arctic moth
#

i still can't find out why PlayerInteractEvent simply wont trigger if i am not looking at a block

#

ive run many checks

#

and it only triggers when i hit a block

eternal oxide
#

empty hand? If not paste your event

arctic moth
#

?paste

undone axleBOT
arctic moth
#

when i look at a block and right click it does hi1 through hi7

#

but when i do it in the air there is no debug

#

doesnt trigger at all

eternal oxide
#

what item is in your hand?

arctic moth
#

iron hoe

#

doesnt trigger with anything else either

eternal oxide
#

No clue then, it should

arctic moth
#

this always happens to me lmao

#

the spigot api just decides not to work for me

eternal oxide
#

put a torch in your offhand and see if still doesn;t trigger

fluid river
#

good evening comrades

#

where are newbies

eternal oxide
#

offhand (shield slot)

fluid river
#

any information appreciated

eternal oxide
#

I know a torch will trigger an interactevent

arctic moth
#

it doesnt trigger with torch or empty hand

eternal oxide
#

in shield slot?

arctic moth
#

empty offhand*

#

yes

#

and i also tried all the combinations of mainhand with it

eternal oxide
#

then you have a broken spigot. no reason it should not trigger

#

only an empty hand doesn't fire as its predictive

arctic moth
#

lol

#

unless it got cancelled smh but i tried it at highest priority

#

there are like 20 other plugins running on the server

opal juniper
#

well remove them and try with a fresh compile of spigot

arctic moth
#

wait am i on the latest version?

#

intellij isnt warning me to update it

#

1.19-R0.1-SNAPSHOT

opal juniper
#

1.19.2.....

#

but I mean, recompile your server is what i meant

arctic moth
#

viaversion

opal juniper
#

oh

#

that could be the issue

arctic moth
#

but it says spigot-1.19.jar is the latest download

opal juniper
#

download thonk

#

from where?

arctic moth
#

why tf do they distribute spigot

opal juniper
#

where are you downloading this from

tardy delta
arctic moth
#

bruh my msg got deleted

#

smh

tardy delta
#

looks neat for the rest

opal juniper
#

if so

#

cringe

arctic moth
#

do they delete everything containing "get bukkit" (without the space)?

opal juniper
#

yes

green prism
opal juniper
#

its illegal

arctic moth
opal juniper
arctic moth
#

oh

#

i have buildtools but i thought that just installs stuff for the api

opal juniper
#

nah it creates a server jar

fluid river
#

It both installs sources and creates server jar

arctic moth
#

buildtools is so slow

fluid river
#

with flag you can only install sources and don't build jar tho

opal juniper
arctic moth
#

i also want to allow tnt duping

fluid river
#
if(!List.of(Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK).contains(event.getAction())) return;```
heh
arctic moth
#

i just didnt want to write two ifs or use the or thing

#

too redundant for my taste

fluid river
#

switch to enum name matches

arctic moth
#

ok fine

opal juniper
#

creating a list on every interact event is terrible

arctic moth
#

but that stil is redundant

#

housekeeping

tardy delta
#

switch to if (bool || switch(state) {A -> true, default -> false})

fluid river
#

if (!event.getAction().toString().matches("RIGHT_CLICK_BLOCK|RIGHT_CLICK_AIR")) return;

tardy delta
#

isnt it [,]

fluid river
#

?

tardy delta
#

idk im bad at regex

fluid river
#

nah

#

| is regex or

tardy delta
#

never learnt that

fluid river
#

your code can produce 99 nullpointerexceptions tho

#

no check for null itemstack

arctic moth
#

i did

fluid river
tardy delta
#

lets just shut my mouth

arctic moth
#

not null itemstack though bc it wouldnt trigger on air for empty hand

tardy delta
#

/setgender bird

fluid river
#

Also you don't check for item you use is an IRON HOE

civic wind
#

./setgender 2 spirit non binary gender fluid elephant

green prism
civic wind
#

There is 2 genders, male or female.

arctic moth
fluid river
#

it's not triggered with empty hand

arctic moth
#

yes

#

so item wont be null

fluid river
#

always was

green prism
arctic moth
#

i should check if offhand is null though

#

nvm

tardy delta
#

lets keep working on this, looks kinda hot doesnt it?

arctic moth
#

cant be null

arctic moth
tardy delta
#

nah just thing im making for myself

#

might publish it if people like

#

trying to abstract away sql statements

green prism
#

You really use that theme? lmao

civic wind
arctic moth
#

i still dont see the point of using abstract classes when interfaces exist

tardy delta
#

they have their own use?

arctic moth
#

no not really

#

interfaces can do everything that abstract classes can

green prism
tardy delta
#

you cant define variables in an interface

arctic moth
tender shard
tardy delta
#

no need to redefine variables

tender shard
#

Well, fields

tardy delta
#

you can only declare constants in an interface

orchid portal
#

Help plzz, there is an OpenLogin plugin on the server, how to check if a player is authorized?

tardy delta
#

use its api

flint coyote
#

also interfaces can only implement method bodys using "default". And since you implement them instead of extending, you don't have access to the protected modifier

harsh totem
#

How would I make a custom recipe configurable in the config.yml file?

tardy delta
#

save the ingredients in some way?

green prism
#

How might I make some instances available exclusively to the project classes in order to pass them to the API class?

tardy delta
#

wha

green prism
#

yeah

#

good question

tender shard
tardy delta
#

mye just public and static too

flint coyote
green prism
#

I want to pass to the APIManager class constructor an instance

#

without making it visible to others who use the API

#

Maybe protected modifier could do the job

flint coyote
#

package-private should be enough unless you want to extend the class aswell

civic wind
flint coyote
#

But it's not necessary to overly protect your other classes. Some people might want do to more complex stuff and are happy when they can actually access those things

#

for NMS I also have to use reflection a lot and it's annoying

tender shard
#

I usually just mark stuff that's not part of api as @Internal and then, when people use it anyway, it's up to them

#

and I hide it from the javadocs

dense fjord
#

Can i ask a question how long will it take for a persons to respond to my question in #help-server

#

ty

dense fjord
#

Idk

#

how would i know tht u wouldnt know

tender shard
#

check out the pinned message in this channel

civic wind
dense fjord
#

ok

tender shard
civic wind
tender shard
#

that's unfortunate, but also not my fault

dense fjord
#

lol

civic wind
#

I didn't say it was but i also think your views on gender are delusional and argue with science... Which for someone as clever as you are, i'm shocked to hear this

tender shard
#

we can continue this discussion in #general if you like

civic wind
#

But anyway, I don't wanna get banned (Can't say anything these days)

tender shard
#

you wont get banned for discussion about this here

civic wind
#

I did on mcmarket

tender shard
#

you really have to fuck up big time to get banend here lol

civic wind
#

oh xd

flint coyote
#

fuck up big time

#

still here :o

fluid river
#

there are two types of people

#

XX and XY

#

ez

civic wind
#

^^

#

S C I E N C E

fluid river
#

When i was a kid i wanted to be a pirate

civic wind
#

I identify as a mushroom

flint coyote
fluid river
#

glad nobody took me seriously and nobody changed place i live and my gender

flint coyote
#

fair enough

fluid river
tender shard
civic wind
fluid river
#

switch to general bro

tender shard
#

you expressed only your personal opinions and think it means more?

civic wind
#

Science is proven

fluid river
#

no tho

#

science can never be fully proven

#

depends on philosophy above it tho

civic wind
#

Science is WAY more reliable than random snowflake kids saying theyre not a girl or a boy but a they lool

arctic moth
#

ew there isnt colored text in spigot console

tender shard
#

#general

tender shard
fluid river
tender shard
#

the console shouldnt be colored imho

#

it should only have 3 colors

#

normal, warning, and error

fluid river
#

basically works for me

tender shard
#

and no custom colors

arctic moth
arctic moth
fluid river
#

run a plugin with colored message to consolesender

#

there you go

arctic moth
#

also it keeps hanging for some reason

#

during startup

fluid river
#

works on both spigot and paper(tho paper has 99 colors)

arctic moth
#

idk if its a hang or just a freeze

#

oh thats what happened

#

not even my plugin for once

#

worldedit is such a buggy plugin

flint coyote
#

Nobody said you can't fork it/make your own version

arctic moth
#

ok

#

the event still doesnt trigger on a newer version of spigot

flint coyote
#

which event?

fluid river
#

did you define api-version: 1.19 in plugin.yml

arctic moth
flint coyote
arctic moth
tender shard
flint coyote
#

well in that case it's probably a missing @EventHandler or you forgot to register it

tender shard
#

not all items trigger a interactevent when clicking into air

arctic moth
tender shard
#

i am not sure, just try it with some different items

arctic moth
#

still doesnt trigger when clicking air

tender shard
#

a stick e.g. should work if I'm not mistaken

flint coyote
#

I never had an item no trigger interact event on air :o Except maybe a bow

tender shard
#

not sure about tools since they have their own logic

arctic moth
#

simply wont work

flint coyote
#

Did you register the event?

#

Does it have @EventHandler?

#

Does it implement Listener?

arctic moth
arctic moth
tender shard
#

?paste your code pls

undone axleBOT
tender shard
arctic moth
tender shard
#

so it doesnt even print "hi1" when you right-click air with a torch or stick or hoe?

arctic moth
#

nope

#

but when i right click a block it goes h1-hi7

tender shard
#

remove ignoreCancelled

#

or set it to false

#

try whether it runs now

arctic moth
tender shard
#

that's the last execution priority

arctic moth
#

oh

tender shard
#

it will probably already fire as cancelled

#

try to set ignoreCancelled to false

#

just for debugging

#

the order (from first execution to last) is
LOWEST, LOW, ..., HIGHEST, MONITOR

#

and some events already get called in cancelled state

arctic moth
#

oops i think i just broke git

flint coyote
#

sidenote: Use monitor to modify events and everyone will love you

tender shard
tender shard
#

e.g.

@EventHandler(priority = MONITOR)
public void onWhatEverEvent(WhatEverEvent event) {
  myMap.remove(event.getSomething());
}

and people are like "uuugh dont do this on monitor"

arctic moth
#

welp apparently my spigot jar just

#

disappeared

#

always a great sign

#

git is a great software

#

amazing quality

#

unbreakable

flint coyote
#

I mean you can't tell whether it will modify the event. Maybe you use the same map in the same event with different priority lol
Wouldn't make any sense but I've seen a lot of nonsense

arctic moth
#

oh now its back

#

wtf

#

i was just about to run buildtools again

#

and it just reappeared

flint coyote
#

why would you add the spigot.jar to git anyway?

arctic moth
#

git is trolling rn

tender shard
#

git is basically unbreakable unless you delete or touch the .git folder

arctic moth
#

eventually im gonna delete the repo when i find a host

flint coyote
#

Not that it breaks anything but it just doesn't change anything either

tender shard
rapid vigil
#

Hey question, how do you make a hashmap

tender shard
#

I mean

#

like you create any other object

#

maybe you should make your question a bit more precise

rapid vigil
#

Thanks

tender shard
#

usually you do it like this:

private final Map<String,Integer> agePerName = new HashMap<>();
arctic moth
tender shard
#

then you can do
agePerName.put("mfnalex",27);

arctic moth
#

thats not good

#

thread death on startup and i havent even updated my plugin

#

huh stacktrace goes to shutdown

#

wtf is happening

#

i have corrupted this poor server software so much

flint coyote
arctic moth
#

is permissions.yml actually used for anything

#

always empty for me

#

ok for some reason the server just started workign again

#

i changed absolutely nothing

tender shard
#

I mean how else you would block interacting with your custom blocks or similar

arctic moth
sterile token
arctic moth
#

oh yay my server started hanging again

tender shard
#

@floral drum are you today's date

sterile token
#

I broken git once because i had lot of git projects and i remember i run a merge and everything broken down

tender shard
#

you didnt break git, you only fucked up your repo

#

just revert that commit and it's fine again lol

arctic moth
#

oh yay thread deaths again

#

git definitely broke something

sterile token
#

No no

tender shard
#

git never breaks anything >.<

flint coyote
arctic moth
#

sevrer shutdown thread keeps dying smh

sterile token
#

I mean its fucked because then i try to run git commands and appeared an error

arctic moth
#

over and over

floral drum
tender shard
#

so ofc you need monitor to check whether it was actually placed, that's what its for

tender shard
floral drum
#

huh

tender shard
#

because you're a 10/10

floral drum
#

omg

#

you

#

are so hot

arctic moth
#

is it safe to say that i should reinstall spigot

#

oh now it loaded

#

wtf

flint coyote
#

Worldguard cancels on normal priority iirc

arctic moth
#

its like 50/50 chance of thread death

tender shard
#

And monitor is there to know the final resulg

arctic moth
#

"server attempted to load a chunk on a newer version of mc" i deleted the world 💀

#

it should be generating the world

tender shard
#

Do you actually have a spigot jar in your plugin repo?

arctic moth
#

why

tender shard
#

Idk because it doesnt really belong there

arctic moth
#

ik its server redistribution but its a private repo

#

just so people can manage the plugins and stuff

flint coyote
arctic moth
#

im just not paying for a host this early in development of the server

flint coyote
arctic moth
tender shard
#

I think they want their staff to clone the whole thing be able to run the server locally

arctic moth
#

pretty much

flint coyote
#

ohh so the git repo is a full server

fickle mist
#

Hi all! I have a question, so I display the text through Bukkit.broadcastMessage, and you can supposedly make a radius on which the text will be shown to the players text

tender shard
#

Well just replace the spigot jar and commit and push it

tender shard
arctic moth
#

ok spamming discard changes somehow uncorrupted git

#

time to get back to fixing my plugin

tender shard
arctic moth
tender shard
#

you cannot even load a Location from a YAML when the world isnt loaded

#

I've never seen location.getWorld() return null. this will only happen if you cache a location and then unload the world

tardy delta
#

some plugin might be passing location objects with a null world

tender shard
#

weird, they should use a Vector or similar instead

#

but yeah, location.getWorld() MIGHT be null, but in reality, it basically never is

flint coyote
tender shard
#

but sure, to be safe, check if the world is null before

sterile token
#

Player#getLanguage() is from paper right?

tardy delta
#

im setting the world to null to indicate a home has been invalidated and should be removed

#

abuse

tender shard
sterile token
#

I have done it

flint coyote
#

There you go

tender shard
#

the location constructor just throws whatever you toss in as "world" into a WeakReference

#

but why lol verano

fickle mist
tender shard
#

if you dont need a world, you shouldnt use a location but a Vector

arctic moth
#

weird that the client loads resource packs before you actually join the world

tender shard
fickle mist
arctic moth
#

oh cool i spawned in an unloaded chunk smh

tender shard
flint coyote
tender shard
#

wdym only once?

#

oooh

flint coyote
#

it's in a loop

tender shard
#

no, it's not

#

or actually

#

lets check

fickle mist
tender shard
#

I'm pretty sure that it does radius*radius every time

tender shard
flint coyote
#

I mean since the value doesn't change it could technically avoid it. But idk if the compiler goes that far.

arctic moth
#

ok so something was cancelling it this whole time

tender shard
#
public void onJoin(PlayerJoinEvent event) {
  broadCastWithinRadius(event.getPlayer().getLocation(), 100, event.getPlayer().getName() + " joined nearby you.");
}
tender shard
#

it calculates it every time

flint coyote
#

how did you test that?

ancient plank
#

broadCast

tender shard
flint coyote
#

ah makes sense^^

ancient plank
#

Broadcast is one word

tender shard
#

k

#

who cares lol

tardy delta
ancient plank
#

I do >:(

tender shard
flint coyote
tender shard
#

I have declared it earlier

sterile token
#

Oh common 🤡

tardy delta
#

it inlines Math.pow calls with a power of 1 or smth too so yes it will

tender shard
#

POW POW

tardy delta
#

if it sees that its always x * x

knotty meteor
#

Someone up to converting my 1.12.2 project to 1.19.2? xD
I dont understand a bit of higher versions then 1.12.2

flint coyote
tender shard
knotty meteor
#

Really?

tender shard
sterile token
#

Moving old version to new is faster but not backwards

tender shard
#

Material.ANDESITE is way more readable than using those weird numeric IDs like 0:2

sterile token
#

I prefer using the Ids

tender shard
#

okay then tell me what 53:2 is, without looking it up

ancient plank
#

Buncha weirdos in here

sterile token
#

Hey bruh respect please

#

Im not swearing you

knotty meteor
#

Alright that makes sense but i want to convert it to 1.19.2 but i will also have to import a 1.13 jar because otherwise none of the events work lol

tender shard
#

you should use maven or gradle to import an 1.19.2 .jar

sterile token
ancient plank
#

46 best id tho

tender shard
#

I mean why would use 1.13 to make it work on 1.19 o0

#

yeah but that's still 5 days longer than using the actual names

tardy delta
knotty meteor
#

Yes i use eclipse and i need to import the jars but only 1.19.2 jar will not work for some reason

undone axleBOT
#

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

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

sterile token
#

@knotty meteor select either 1.19 or 1.13 dont make multi versioning plugin

#

They are always a mess

tender shard
#

because it's marked as deprecated

sterile token
#

I can say it being a 1.8 and now moving to 1.19

tender shard
sterile token
#

😂

knotty meteor
#

Ooowh so i have to use a bootstrap jar?

tender shard
#

no

#

you are supposed to use spigot-1.19.2-R0.1-SNAPSHOT-shaded.jar

#

or use a proper build system like maven or gradle, which will handle this automatically for you

sterile token
#

Indeed

#

Maven/Gradle make lfie easier

tender shard
#

yeah they make you angry for the first 2 hours, and then everyone loves it

knotty meteor
#

Hahaha alright i will try to use maven if that isnt working out for me i will try a shaded jar

knotty meteor
#

Thanks!

tender shard
sterile token
#

I mean in my case maven shade by default every dependency into jar

#

Maybe because i dont add the correct scope

tender shard
#

it only shades stuff that is set to "compile" (which is the default scope, yes)

sterile token
#

that why haha

#

So i dont put another scope they ill be always shaded

#

So its perfect haha

#

Because i dont need to make shade via POM

#

mfalex

#

Something diff i will ask it for u on general

tardy delta
#

wdym not level column lol

sterile token
#

chec

#

its telling you that the "level" key doesnt exists on the table

tardy delta
hazy parrot
#

have you check if it even create

#

because iirc its reserved

tender shard
# tardy delta

the table probably already existed when you ran this statement

tardy delta
#

dropped it

tender shard
#

so it didnt create a table called players with a level column

#

then do DESCRIBE and see if it actually has this column

#

or use phpmyadmin or whatever that actually shows you the table

tardy delta
#

i forgot but does sqlite needs CREATE DATABASE?

sterile token
#

I dont think

tardy delta
#

works perfectly fine when doing manually lol

civic wind
#

Any beginner Java tasks to do to practice OOP anyone?

#

and nothing too "mathsy" i really am not the best with maths :/

zealous osprey
#

Battleships?

civic wind
#

Idek how i'd start with that

zealous osprey
#

Not very much OOP, but you can do alot with access modifiers and static/non-static practicing

civic wind
#

I'm just trying to focus on OOP at the minute

#

I sort of understand access modifiers, just need to practice statics tbf

zealous osprey
#

Try making Items, some with abilities, some without, some with passive abilities

#

not neccessarily in Mc, but just in the console

civic wind
#

I mean non bukkit related, sorry i should have made this clear

#

ohh

zealous osprey
#

Would be something with inheritance using both superclasses and interfaces ig

arctic moth
#

how do i spawn a particle without it shooting in a random direction

#

which method has the velocity stuff

tardy delta
#

supplier will be called before constructor right?

molten hearth
tardy delta
#

thats not the issue then

#

also code after System.exit will never be executed right?

zealous iron
#

Player player = (Player) sender;
How do i do this in kotlin

eternal night
tardy delta
#

modifying database by cli didnt seem to have effect or not directly

eternal night
zealous iron
#

Lol

#

I have for the past 45 minutes

eternal night
#

"kotlin cast"

zealous osprey
eternal night
#

the first result explains exactly what you are looking for 😅

zealous iron
#

use nms

zealous iron
#

Bro loves that emoji

eternal night
#

one of these two

#

I mean "use nms" is so incorrect I am just confused

zealous iron
#

Depends on what version you are on

tardy delta
#

yoo it works

eternal night
#

Yes, if you use a version old enough to go to school that has not been maintained for years, you might have to use hacks

#

you iterate over all players online

tender shard
eternal night
#

with kotlin cast ?

tender shard
#

I googled "kotlin cast object"

zealous iron
#

Indeed

zealous osprey
eternal night
#

kekw google just does not think of you as devs

#

confirmed

tender shard
#

it showed me examples like

if(myObj is Integer)

or

if(myObj) {
  is Integer: ...

but not how to normally cast stuff

eternal night
#

you'd have to scroll down like

#

a little

#

to unsafe casting, which is what (Player) sender is

tender shard
#

val x: String = y as String

#

damn that's ugly

tardy delta
#

thats wha she-

zealous iron
#

this worked just fine for me val player = sender.server.getPlayer(sender.name)

#

i refuse to believe thats what your supposed to do

tender shard
#

uuh yikes

zealous iron
#

but yeah

tender shard
#

that's not a good solution

#

you should do

val player = sender as Player
eternal night
#

^

#

as explained on the link I shared

zealous iron
#

your telling me

tender shard
#

and ofc also check before

zealous iron
#

it

#

was

#

that

#

simple

eternal night
#

did you just not read my link

tender shard
#

I didnt know it until 30 seconds ago myself

eternal night
#

lol

tender shard
#

I'll never use kotlin voluntarily lol

eternal night
#

not you

zealous iron
#

first time using kotlin

eternal night
#

good luck

zealous iron
#

usually use java

eternal night
#

why the switch

#

if I may ask

zealous iron
#

I wanna learn something new

#

yo how do i create a project with kotlin instead of java

#

the converting thing is annoying af

tender shard
#

in IntelliJ, just do new project and then you can choose "maven" and "kotlin"

#

or "gradle" and "kotlin"

zealous iron
#

with spigot

tender shard
#

you just add spigot as dependency as you'd normally do

zealous iron
#

i suppose

#

Tho the minecraft development pack or whatever its called is way easier

arctic moth
tender shard
hazy parrot
#

It's compiled to byte code lol

tender shard
#

kotliin would have died very early if it would not allow to use java dependencies

tardy delta
#

might wanna start using this

tender shard
#

what I still dont get is why kotlin doesnt allow normal static methods and fields

civic wind
#

For loop and then .sendTitle

tender shard
#

?learnkotlin

#

Damn

#

Would be also nice to have a list of kotlin tutorials

alpine urchin
#

?learncpp

#

?learnc

#

?learnmaven

#

?learnjava

undone axleBOT
tardy delta
#

fancy fancy

tender shard
#

?learnhtml+css

#

everyone left this channel

tardy delta
#

as it should

chrome beacon
tender shard
#

that's why you're so toxic all the time and that's probably also why you shot fourteenbrush's cat

grim ice
#

that's why you're single

#

im so unfunny

tender shard
#

I'm not

chrome beacon
tender shard
#

because you're still alive

#

ChatColor.RED + "" + ChatColor.UNDERLINE

#

or use toString() on any of the chat colors

quaint mantle
#

is using metadata as temporary storage a bad idea or should i use hashmaps

worldly ingot
#

Use Maps where possible. Metadata is meant more as a means of communication between plugins with primitive data

quaint mantle
#

thanks

wary topaz
#

(tab completer)

so the first one (args.length == 1) is working but the other one doesnt.

fluid river
#

pdc in metadata is persistent, and maps are not

#

so depends on what you want to do

fluid river
wary topaz
#

alr

fluid river
#

so what happens when you try second argument?

wary topaz
#

it does the same thing as args.length == 1

fluid river
#

you have args[0].toLowerCase() tho

wary topaz
#

BUT when I replaced the 2nd with 1 it actually worked

fluid river
#

what is in this arg

wary topaz
#

materials

fluid river
#

show command usage example

#

/yourcmd firstarg <what should be tab completed>

wary topaz
fluid river
#

umm

#

your args[0] is your nickname

#

none of the materials start with your nickname

wary topaz
#

?

#

oh crep

fluid river
#

tho you can do this a lot faster

wary topaz
#

that's embarassing

fluid river
#
if (args.length == 1) return Bukkit.getOnlinePlayers().stream().map(Player::getName()).toList();```
wary topaz
fluid river
#

returns you all online players' names on the server

#

as a list of strings for tabcompleter

fluid river
#

bro what

#

when you return null you get auto-suggested with names?

hasty prawn
#

null defaults to the player list

#

in tab completion

fluid river
#

ahaha lol

#

didn't know that

#

??

vivid skiff
#

Why it can' t find the player, it should be correct

                player.sendMessage("§3§lJAIL §8» §7Comando errato! Uso corretto: §b/jail <Player> <Jail Name>");
                return false;

            } else {

                String playerName = args[1];
                Player target = sender.getServer().getPlayerExact(playerName);

                if (target == null) {
                    player.sendMessage("§3§lJAIL §8» §7Player non trovato!");
                    return true;

                } else if (FDOCore.getInstance().checkIfJailExist(args[2])) {
                    FDOCore.getInstance().jailPlayer(target.getUniqueId(), args[2]);
                    player.sendMessage("§3§lJAIL §8» §7Hai incarcerato §b" + target.getName() + "§7 con successo!");
                }

            }```
fluid river
#

cuz you get args[1]

#

which is a jail name

vivid skiff
#

args 1 should be the player

fluid river
#

no

#

args[0]

hasty prawn
#

args[0] is the player

vivid skiff
#

like /jail TestPlayer Jail1

fluid river
#

args[0] man

vivid skiff
fluid river
#

what error can it possibly give, except arrayindexoutofbounds when you have 0 arguments

#

show stack trace

vivid skiff
#

It didn't find the player there is no error

strong girder
#

where can i get the spigot account url?

fluid river
vivid skiff
#

I don't know

fluid river
#

how can there be no error

vivid skiff
#

I will go sleep

fluid river
#

if you just said you have an error

vivid skiff
#

Isn' t jail the arg[0] in this command /jail TestPlayer Jail1?

hasty prawn
#

How would it be?

#

You start from 0 and read left to right.

#

TestPlayer is args[0]
Jail1 is args[1]

humble sleet
#

Anyone know how to serialize a block including block state?

vivid skiff
# hasty prawn TestPlayer is args[0] Jail1 is args[1]

so like this should be correct

                player.sendMessage("§3§lJAIL §8» §7Comando errato! Uso corretto: §b/jail <Player> <Jail Name>");
                return false;

            } else {

                String playerName = args[0];
                Player target = sender.getServer().getPlayerExact(playerName);

                if (target == null) {
                    player.sendMessage("§3§lJAIL §8» §7Player non trovato!");
                    return true;

                } else if (FDOCore.getInstance().checkIfJailExist(args[1])) {
                    FDOCore.getInstance().jailPlayer(target.getUniqueId(), args[1]);
                    player.sendMessage("§3§lJAIL §8» §7Hai incarcerato §b" + target.getName() + "§7 con successo!");
                }

            }```
hasty prawn
#

Yes

vivid skiff
#

It can't find the player either

wary topaz
#

if (args.length == 3) {
return getNumbers().stream().map(Number :: ++).toList();

    }

How would I make this work?

hasty prawn
#

Send the error then, and also make sure you're typing the player's full name with correct capitalization

hasty prawn
wary topaz
#

make arg3 return whole numbers

mental sorrel
#

Hey everyone,
Is there an easy way to get all the Materials into a list for TabComplete?

wary topaz
#

if (args.length == 2) {
Material[] list = Material.values();
List<String> fList = newArrayList();
for (Material s : list) {
if (s.name().toLowerCase().startsWith(args[1].toLowerCase())) {
fList.add(s.name().toLowerCase());
}
}
return fList;
}

wary topaz
#

Luckily we're trying to do the same thing @mental sorrel

mental sorrel
#

Oh lol nice :)

#

Thnx

wary topaz
#

:_)

mental sorrel
#

didn't see an option for values in Material

#

<3

hasty prawn
wary topaz
#

Incompatible types. Found: 'java.lang.Integer', required: 'java.util.List<java.lang.String>'

#

But yeah

mental sorrel
#

Yeah works :) thnx!

hasty prawn
#

Don't do tab completion for a number just let them type it in PeepoShrug

wary topaz
#

d:why not :?

#

wait alr but how can I make it return nothing (so it doesnt show player names?)

hasty prawn
#

Return an empty list

wary topaz
#

return null;?

#

wait that didnt work

hasty prawn
#

Just an empty list

#

new ArrayList();

wary topaz
#

Didnt work.

hasty prawn
#

It definitely does lol

#

Send code again