#help-development

1 messages · Page 530 of 1

wary mountain
#

such as inline parameters*

tender shard
#

rider still exists? I thought it again died

wary mountain
#

again? when was the first time

tender shard
#

in the time between it was announced and was actually released

echo basalt
#

rider is ass

tender shard
#

are you not into ass or what

echo basalt
#

like you can try to do winforms and it'll just freeze

river oracle
#

When's last time you use it

wary mountain
#

also 2019 community

river oracle
#

I'm not really familiar with Visual Studio IMHO it sucks ass

#

I prefer VSC for everything

wary mountain
#

oh vsc

echo basalt
#

there's no proper nice c# ide

lavish cliff
#

Hi guys , i have a problem with this event , literally don't work , i can swap this item (&eʟᴀɴᴛᴇʀɴᴀ &6(ᴄᴏsᴍᴇᴛɪᴄᴏ)) . How i can do?

    public void onSwapHandItems(PlayerSwapHandItemsEvent event) {
        Player player = event.getPlayer();
        ItemStack mainHandItem = event.getMainHandItem();
        ItemStack offHandItem = event.getOffHandItem();

        if (offHandItem != null && offHandItem.hasItemMeta() && mainHandItem != null && mainHandItem.hasItemMeta()) {
            ItemMeta offHandItemMeta = offHandItem.getItemMeta();
            ItemMeta mainHandItemMeta = mainHandItem.getItemMeta();

            if (offHandItemMeta.hasDisplayName() && offHandItemMeta.getDisplayName().equals(ColorUtils.translateColorCodes("&eʟᴀɴᴛᴇʀɴᴀ &6(ᴄᴏsᴍᴇᴛɪᴄᴏ)"))
                    && mainHandItemMeta.hasDisplayName() && mainHandItemMeta.getDisplayName().equals(ColorUtils.translateColorCodes("&eʟᴀɴᴛᴇʀɴᴀ &6(ᴄᴏsᴍᴇᴛɪᴄᴏ)"))) {
                event.setCancelled(true);
                player.updateInventory();
            }
        }
    }```
undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

tender shard
#

are you actually checking the item by its name?

#

why do you not use a PDC tag instead?

#

which MC version are you coding for?

lavish cliff
tender shard
#

that's great, you can use PDC

lavish cliff
#

oh ok

tender shard
#

instead of checking "is this item called "...", you can check "does this item have the following PDC tag: ..."

lavish cliff
#

ok thanks but i don't think it's the problem

tender shard
#

it is

#

the issue's your comparison of the name

#

but you can ofc add a ton of debug statements. inside every if(...) { statement, you can print out sth

#

for example, like this:

#
System.out.println("event called");
if(item.hasItemMeta()) {
  System.out.println("item has meta");
  if(item.getItemMeta().hasDisplayName()) {
    System.out.printlnt("item has display name");
#

etc

#

then you can check which is the last line that got printed, then you know where the issue is

lavish cliff
#

ok thanks

elfin pilot
#

Can anyone help me with some MySQL shenanigans? I keep getting the generic "access denied" exception when trying to access. I checked the credentials - they are correct - but I'm trying to access the database remotely so I think it may have something to do with access hosts? Any help appreciated

echo basalt
#

Check your ssl settings and access hosts, yeah

#

could just be firewall

tender shard
#

remember, the "host" part is part of the user

#

for example, you can have a user mfnalex@127.0.0.1 and it'll have access on localhost -> localhost but it won't work if you try to access from "your home pc" -> "your vps"

#

usually that's the issue

tender shard
#

e.g. ' mfnalex'@'%'

#

are you using mariadb or mysql as server?

elfin pilot
#

I'm really unfamiliar with this but I think it's mysql. Here's a screenshot of the access hosts panel

tender shard
#

ah, you got a host panel, ok that's easy then. Yes, please show a screenshot of the users

#

the "host" part of your user should say "%"

#

percentage sign

#

% = all hosts = "from anywhere"

#

if it says "localhost" or "127.0.0.1" or similar, it cannot work

#

btw you cannot send pics here because you're not verified. you either need to get verified, or use imgur or similar

#

!verify

undone axleBOT
#

Usage: !verify <forums username>

elfin pilot
#

I'm locked out of my old account which is verified sadly :(

#

I'll send an imgur link

tender shard
#

oki

fallen pecan
#

Does anyone know how to disable the vanilla hotbar in the game? I want to show only the hotbar I added. I'm talking about life, armor and hunger bar.

elfin pilot
#

A resource pack would work

tender shard
#

hm what panel is that? same gameserver panel? does not look like phpmyadmin nor webmin or anything

#

also the "user" is missing the host part

fallen pecan
elfin pilot
#

Cpanel, lemme give you a full screenshot

#

Ohhhhhhh, so I'd add an @ at the end of the username? Like terracl2_tcserver@localhost?

tender shard
#

yeah that is not helphul unfortunately. Can you SOMEHOW connect to mysql and execute statements? If so, try to enter the statement I highlighted in blue here

#

it should result in a table like in the screenshot

#

the Host part might also show Ip addresses instead of localhost, like this

#

are you using some "minecraft hoster" where you pay like 10$ per month for a normal MC server?

#

if yes, you should message their support and ask them whether remote connections are even allowed / possible

elfin pilot
#

Yeah, using pebblehost. I'll shoot them a message

tender shard
#

ah okay. Yes, maybe check if they got any FAQ on their website. If there's nothing about it there, message their support

elfin pilot
#

The plot thickens

#

Ty anyway :>

tender shard
#

np

#

most hosters do not allow random SQL access

elfin pilot
#

Ah dang, I didn't know that

#

For years I've used pebble and they have, but I've been away from MC for kind of a while

#

Maybe they changed something internal

#

Actually found an article on their website about configuring remote hosts for an SQL server. I'm assuming this means they allow remote connections, which makes me think it's something on my end. Still will send them a message though

elfin pilot
# tender shard most hosters do not allow random SQL access

Apologies for the ping, but if it were the access hosts, would adding the wildcard (%) symbol work? I've added just this symbol and it still rejected my credentials, it could still be something else, but any clarity on this would help greatly

tender shard
#

mysql users consist of 2 parts:

  1. the actual username, aka what you can control in the web-panel you showed
  2. the host part, which is probably limited to "localhost" at the hoser you currently use
#

as said, you will have to contact your hoster to ask whether external access is possible in the first place

#

changing your username or sth definitely won't change anything

#

maybe there's a setting in your panel that says "allow remote connections" or sth

#

if there's not, chances are small you can access it from anywhere else than the server you booked

elfin pilot
#

Ahhhh I understand. Thank you again :>

#

I'm woefully unfamiliar with sql databases and how they work haha

tender shard
#

the general idea is like e,g,... on windows you say "mfnalex" is a user and he got a password "password123"

#

but mysql is like:

#

user is "mfnalex" and he got a password "password123" and he connects from ip address 68.123.182.42

#

so yeah it just got a third thing which is "where does it come from"

#

and some hosters simply only allow "from the Mc ip" and not "from everywhere"

vital sandal
#

some how I got my server reject my from connecting

#

even though it is my localhost

smoky anchor
#

Try to restart the game & launcher

#

Either the authentication servers are down (as the message suggests) or your token expired

vital sandal
#

nothing work

#

If I try I can login with like a few minuates once

#

and I can still login other server with ease

heavy mural
#

Yeah that is my issue hmm

#

I am not sure how to fix that?
It has to be some form of other interaction causing this?

turbid crest
#

Hello, I have a weird question

I'm actually storing a List of chunk coordinates. For this, I created a new ChunkCoord object with getX() and getZ() methods. Here is the list example:
List<ChunkCoord> chunks;
But I feel like it can take a long time to check if a chunk is already present. What I actually do:

for(ChunckCoord cc : chunks) {
if(cc.getX() == x && cc.getZ() == z) { return true}
}
return false

Would it be a bad idea to just storing as String ? For example "x;z" ("-5;65")
So now I would just have to check if the string "x;z" is present using the List method and not iterating everything.

Do you think it's a bad idea or do you have any other solution ?
Thanks !

smoky anchor
#

I believe HashSet does not have a linear search and should be faster.

#

So I suggest somehow using this, unless you need the same object in the list more times or you need the list to be ordered.

turbid crest
#

So HashSet<ChunkCoord> ?

pseudo hazel
#

yes

turbid crest
#

And do I still need to iterate it ?

pseudo hazel
#

also why arent you just using a vector xD

smoky anchor
smoky anchor
pseudo hazel
#

but also like how many chunks are you going to save

#

no I mean a position vector

turbid crest
#

1024x1024 block so 64x64

pseudo hazel
#

instead of a chunk coord

turbid crest
#

4096

smoky anchor
pseudo hazel
#

true ig

#

I mean it doesnt really matter, I was just wondering

#

because I would not go to the effort of making a new class just for 2 numbers

#

unless you made it a record then its perfectly fine

pseudo hazel
#

why yes

hybrid spoke
#

its a good practice

pseudo hazel
#

I wouldnt personally

hybrid spoke
#

to give your values a name

pseudo hazel
#

well yes

#

okay if I were to make it I would either use a vector or I would make a record

hybrid spoke
#

like that you can change everything around the value without having to adjust it everywhere

pseudo hazel
#

which I guess is a class

sterile axle
#

a record compiles to the same code that a class does with final fields, all args constructor, and getters

#

so lol

pseudo hazel
#

yes

#

but its easier to type

sterile axle
#

kek

hybrid spoke
#

ah yes

#

skipping words in a book because its easier to type

sterile axle
#

old man persona: these damn kids are so spoiled these days! shakes fist GET OFF MY LAWN

pseudo hazel
#

?

sterile axle
#

what did we ever do before records

#

:(

pseudo hazel
#

make classes

hybrid spoke
sterile axle
#

ok my jokes are going right over his head

#

ill stop

smoky anchor
#

I do have one concern tho, I am not exactly sure how has set works but
He would need one object to compare the objects in the list.
Would it ever return true even if two objects have the same values, I am asking since they are two different objects ?

pseudo hazel
#

no they arent its just not very funny imo

sterile axle
#

ouchy :(

hybrid spoke
smoky anchor
#

I believe I used to solve this by overriding the equals & hashcode method
But I am not sure if that is the solution

pseudo hazel
#

which a record does for you 😳

#

but imma go since im probably too old for this fucking chat

hybrid spoke
#

lombok ftw

pseudo hazel
#

good luck with your classes

sterile axle
#

dog a record is a class

#

it desugars to a class

pseudo hazel
#

yes

pseudo hazel
#

but the reason to use it because of the sugar ofc

#

thats the whole point

sterile axle
#

you are arguing about nothing xD

#

it's literally a class

pseudo hazel
#

so are you

sterile axle
#

yes i live in the jvm

pseudo hazel
#

so lets just move on

hybrid spoke
#

damn why use interface when you can have a class

sterile axle
#

yeah anyway im just trolling ima go back to watching YT

pseudo hazel
#

yes im going back to my retirement

#

no but for real I think if you want to use your type in a hashmap you need to have an equals method, or a hash method, or use a record, which does the same thing, is just as slow as the rest but you dont have to think about how you wanna write your hash or equals even though its trivial in this case

echo basalt
#

or use lombok's equalsAndHashCode

pseudo hazel
#

true, but I assumed that they didnt need to be mutable for this usecase

#

i could be wrong tho

warm mica
#

Because that's not the purpose of records

sterile axle
#

i think for that you would just need to add int b to the parameter list and then have a factory that produces the record with b always 5

#

but meh

#

sure

#

but, not with a record

#

til

hybrid spoke
#

then a record is the wrong choice

#

or you just exchange the object

warm mica
#

The use cases for records are usually very slim

hybrid spoke
#

not really

#

i mean depends in what context you're programming

#

im a big fan of value objects

warm mica
#

How many data classes without dynamically changeable fields do you usually have?

#

I'd be using them more if I could at least use them for serialization, but i.a. gson isn't able to handle tecords

#

Ya that's not an effort that's worth it

#

Okay interesting

sterile axle
#

we're all learning shit tonight

#

well i might be learning more

#

(at me)

warm mica
#

I hope nobody does

#

But they added it pretty late, just half a year ago

hybrid spoke
#

wait there are versions after java 8

#

oh okay

wide cipher
#

I'm trying to make a thing where mobs spawn at a location, and there to be a mob cap, but it isn't working, anyone have an idea why?

sterile axle
#

what if diff > 1?

tardy delta
#

interesting stuff this

echo basalt
#

f.lux

tardy delta
#

ah yes

#

never expose collections and dont make them static

#

with the listener yes

#

just do it the normal way

#

just have two events, for openinventory and closeinventory

wide cipher
#

wdym

tardy delta
#

myes strlen impl in java

#

ofc its a hidden jdk class, so many useful stuff in those classes that they hide

smoky anchor
#

Literally what tf are you doing
Am I too smooth brain to understand this ?

tardy delta
#

foreign function memory api

#

trying to get java to run my c++ code

smoky anchor
#

Wait are you the guy trying to optimize the pathfinding of mobs ?

tardy delta
#

could always use jni but i thought why not give this a try

#

nah that was someone elese

#

would be a fun thing to do ig, wondering what algorithm they are using

echo basalt
#

what the actual fuck

#

you are literally registering a listener for a single method call?

sly venture
#

It's a code that my friend made, so please give me advice.

smoky anchor
echo basalt
#

or you can just

#

ask for proper advice instead of hiding the skeletons in your closet

heavy mural
#
 @EventHandler
  public void onVehicleHit(VehicleDamageEvent event) {
event.getVehicle().getWorld().playEffect(event.getVehicle().getLocation(), Effect.MOBSPAWNER_FLAMES, 0);

        Bukkit.getScheduler().runTaskLater(this, () -> {
          event.getVehicle().setVelocity(new Vector(0, 0, 0));
        }, 1);

        event.setCancelled(true);
}

If a TNT explodes next to this vehicle (while you are in survival) it prevents the vehicle from being destroyed, but the vehicle still moves. I thought my Vector approach would remove the movement the explosion causes.

What could be going wrong?

echo basalt
#

you could just teleport the vehicle back to its original location

smoky anchor
#

What is the reason behind the one tick delay ?
Could it be that the vehicle moves at the tick the TNT explodes ?

heavy mural
#

I attempted without the tick delay which did not work, then I thought it might be because the explosion push is one tick later .

#

I will try the location teleport

hazy parrot
#

btw you can write runTaskLater(this, ()->{}, 1); just like runTask(this, ()->{});

echo basalt
#

As for that thing

#

cancelling the event should cancel knockback

heavy mural
#

it does not;
somebody else in this chat also went over it earlier and they got the same result.
Explosion damage gets cancelled, knockback remains.

echo basalt
tardy delta
#

i hate those // CraftBykkit end everywhere

echo basalt
smoky anchor
# echo basalt

how is the lastDamageCancelled being set ?
it does not look like the VehicleDamageEvent does anything to this
If this code is from the tnt exploding then the entity would get momentum regardless of the outcome of the VehicleDamageEvent.

echo basalt
#

yeah it's not

#

genuine spigot bug

#

VehicleDamageEvent inherits VehicleEvent rather than being an extension of EntityDamageEvent so the variable is never set

#

so yeah just teleport back on the tick after

#

@worldly ingot you might want to look into this

heavy mural
#

oeh so it just so happened to be my logic was not fully at fault here?

hybrid spoke
echo basalt
#

Not signing cla

hybrid spoke
#

not old enough?

smoky anchor
#

I believe you can set the variable yourself
Might have to use some reflection and nms tho

echo basalt
#

I turned 18 a couple months ago

#

Just not doxxing myself

hybrid spoke
remote swallow
echo basalt
#

No

remote swallow
#

Smh

smoky anchor
#

try to manually set the lastDamageCancelled
Might be ugly but should work, just keep an eye on this bug till it is fixed so you can remove it later.

heavy mural
#
 @EventHandler
  public void onVehicleHit(VehicleDamageEvent event) {
event.getVehicle().getWorld().playEffect(event.getVehicle().getLocation(), Effect.MOBSPAWNER_FLAMES, 0);
        event.getVehicle().getLastDamageCause().setCancelled(true);

        Bukkit.getScheduler().runTaskLater(this, () -> {
         event.getVehicle().getLastDamageCause().setCancelled(true);
        }, 1);

        event.setCancelled(true);
}

Like this?
(I am not sure if it should be done with both scheduler and without)

echo basalt
#

just teleport the entity back and move on

heavy mural
#

I had tried the teleport as well but that did not bring me luck as the vehicle still was being pushed

#

this is what I had tried:

 @EventHandler
  public void onVehicleHit(VehicleDamageEvent event) {
event.getVehicle().getWorld().playEffect(event.getVehicle().getLocation(), Effect.MOBSPAWNER_FLAMES, 0);
                Location location = event.getVehicle().getLocation();

        Bukkit.getScheduler().runTask(this, () -> {
          event.getVehicle().teleport(location);
        });
        event.setCancelled(true);
}
smoky anchor
heavy mural
#

ah well I tried that as well it doesn't seem to affect the problem of the vehicle moving sadly

smoky anchor
tardy delta
#

some parameters

hybrid spoke
#

cant you just set the ai to null
EDIT: a nvm its only an entity

echo basalt
heavy mural
#

hmm

wide cipher
#

I fixed it but for some reason before i join the server the mob cap doesnt do anything

smoky anchor
tardy delta
#

why is the zombie wet

wide cipher
wide cipher
hybrid spoke
#

?paste your full class

undone axleBOT
quaint mantle
#

player's name or player uuid ? for coinplugins

#

ty

#

alright

wide cipher
#

what does this mean??

#

wait nevermind i found the problem

quaint mantle
#

i look "vault" plugin
and i saw this
no player data store file
if this plugin didnt store player datas in file
where does it store?

echo saddle
#

vault is an api

quaint mantle
#

alright

#

but i was look at other skillpoints plugin

#

and i don't saw player data file

#

is there another data storage method?

echo saddle
#

vault is good, been there for a long time

quaint mantle
#

i just wonder this

quaint mantle
echo saddle
#

yes

chrome beacon
#

?pdc

echo basalt
#

pdc, proprietary files, database

quaint mantle
#

wait i need check pdc first

#

😄

echo saddle
#

hmm. straight to the dark side

#

nah

#

you can store stuff

quaint mantle
#

i will not

#

i just wanna learn this

#

to improve myself

echo saddle
#

there is a way, but i'm just not 100% there anymore

#

you can store data

quaint mantle
#

what is this

echo saddle
#

there's even a spigot api

#

for plugin data to store stuff

quaint mantle
#

ah

echo saddle
#

i just forgot

quaint mantle
#

i understand

echo saddle
#

mew knows

quaint mantle
#

but i decided to use sql and file

#

what do u prefer
yml or database ? or database and yml together ?

wet breach
#

Flatfile would be terrible in the long run

echo saddle
#

nah , best to store in the actual item, but others will say otherwise

wet breach
#

Unless you set up some kind of mechanism to clean up old data

quaint mantle
#

i understood but can u give me tutorial video or link for do this:

undone axleBOT
quaint mantle
#

if i change money in the sql, yml file will does it change automatically?

echo saddle
#

never store state data not in the object itself

#

its poor design

wet breach
#

What happened to letting user choose? Pdc can ve used for this and the downsides are no different then flat file lol

quaint mantle
#

i was want to guide for this

#

alright thx

wet breach
#

Its possible it could

#

But its still an option

#

So is flat file

#

No

#

Pdc is at least serialized

#

Flat file is not

#

Anyways there is 2 negatives with flat file.

#

First is if you decide to use 1 file, it will become super large and therefore will take longer for the program to fetch anything. You could memory map but you only have two options with this. You could load the entire file at once but the amount of memory used is that of the size of the file. Second is only loading part of the file into memory but then anytime something is outside of the memory you incur an expensive unload and load operation. The other option with flat file is to make one file per user. This does fine for a while but this ends up taking up file handles of the system because of simply too many files. So if you want flat file best option is to store it as binary

#

Yes but the way bukkit implements it and the default jvm is that its not binary serialized

smoky anchor
#

the description needs more keywords imo :D

tardy delta
#

ive been looking at that like 2 days ago

quaint mantle
#

How database software can do with latency?

#

AYO GUYS

sage patio
#

how can i create an empty arraylist in kotlin D:

hazy parrot
quaint mantle
#

if i make a eu proxy and an asia proxy and a na proxy connecting to the same server which runs on eu proxies will the na and as players still get good ping cuz they connected to the proxy?

sage patio
orchid trout
#

is it not empty by default?

echo basalt
#

That's not how proxies work

quaint mantle
#

:(

echo basalt
#

here's a basic example on paint

hazy parrot
sage patio
#

thanks

hazy parrot
#

emptyList is returning List, not array list

compact haven
#

why are you strict typing like that

#

no need to specify ArrayList unless it specifically must be one

sage patio
hazy parrot
compact haven
#

emptyList<Player>()

#

needs the type somewhere

hazy parrot
#

Take a note that list in kotlin are immutable by default

quaint mantle
sage patio
#

nice

echo basalt
#

basically

#

you're adding latency by having a man in the middle

#

but if the connection between the man in the middle is quite faster than your connection to the target server anyways

#

then you could have a slight ping boost

compact haven
#

guys some bathroom cleaner (I don’t think it’s bleach but like some hydrogen peroxide or whatever, it’s a bottle of spray bathroom cleaner) got onto my hands and I have a paper cut. Will I die

hybrid spoke
#

yes

echo basalt
compact haven
#

I washed it with soap and water for like 5 minutes

echo basalt
#

you're fine

compact haven
#

okay good thank you

#

I hate those fucking bottles

echo basalt
#

all fun and games until you had scraped hands in 2020

compact haven
#

it spilled onto my hand instead of out the fucking nozzle

#

scraped hands ????

echo basalt
#

yeah like

pseudo hazel
#

according to google you are already dead

echo basalt
#

when you fall into asphalt

#

and you fuck your hands up

#

by trying to catch yourself

compact haven
#

well I wasn’t trying to have fun, I was trying to clean mold 😭

#

Jesus fuck

sage patio
compact haven
#

I’m sorry about that ;-;

echo basalt
#

know a guy that fell in his bike on the way to the gym

remote swallow
echo basalt
#

then had to like

#

wipe between every single exercise

sage patio
young knoll
#

Epic is a Kotlin user now

remote swallow
#

no

#

i just see enough of it

hazy parrot
#

without new

#

smh didn't see it was answered lol

#

sorry

wet breach
#

Ie its good for cleaning cuts and scrapes lol

compact haven
#

it’s whatever they in bathroom cleaner with a hydrogen compound

tardy delta
compact haven
#

this place is just as dirty sometimes

tender shard
#

my most useful class ever

worldly ingot
#

It's not even a class

tender shard
#

choco... interfaces are classes

#

it compiles to a .class file and the Class class has a method isInterface() 🥲

sullen marlin
#

Oh no

tender shard
#

(md is australian, for norther hemisphere, it means "oh yes")

sullen marlin
#

Yeah, nah

tender shard
#

that's ma boi

ivory sleet
#

Semantically it’s not a class; or more precise not a concrete type

#

But effectively is a class still hehe

worldly ingot
#

:/ Java should be like C++ where there is no interface keyword. Just virtual methods

#

(/s)

remote swallow
#

but bukkit

young knoll
#

Butt bucket

hybrid spoke
#

its not a class

ivory sleet
#

Semantically its not a class, but there are aspects when you consider both to be classes

hybrid spoke
#

and still its not

ivory sleet
#

Depends

hybrid spoke
#

it doesnt

#

its not

ivory sleet
#

It does

quaint mantle
#

Interface is interface.

hybrid spoke
#

wise words

ivory sleet
#

That’s literally the semantic java specification

#

Hence semantically

hybrid spoke
#

thats the java language specification

#

you can interpret what you want

#

an interface is not a class

ivory sleet
#

Yes and implies semantically

hybrid spoke
#

the JLS is not how its meant to be

#

nor how its spoken

quaint mantle
#

How spigot checks if sync method called async?

worldly ingot
#

AsyncCatcher iirc?

ivory sleet
remote swallow
#

is it spigot or bukkit that catches

worldly ingot
#

If I'm not mistaken, Bukkit doesn't really give a shit. Spigot patches in hard checks

young knoll
#

Boooo

#

This is why I run craftbukkit

remote swallow
ivory sleet
#

The JLS strictly speaking is the semantic specification of Java, that is the meaning in regards to Java as in the language. You can say class and mean class file for instance in which one could consider a semantic interface and semantic class to be isomorphic. Now of course you can argue for informality and sloppy use of terms but this is used in enterprise and professionally as well in other places regularly.

tardy delta
#

Thread.sleep overrated, lets just ask the windows kernel

#

im pretty sure conclure wants to hit me now

weak meteor
#

hell nah

#

💀💀

ivory sleet
#

yeet maybe?

proven sierra
tardy delta
#

i can directly call exit() on the jvm with this 💀

#

oh ye it works

#

jvm exit i mean, not the win32 exit 💀

tardy delta
#

i can even create files

#

used thr wrong function only

quaint mantle
#

where can i find a copy of spigot 1.7 source so i can add modifications

eternal oxide
#

?stash

undone axleBOT
tardy delta
#

best toString i have no idea what it says

late sonnet
#

many L

sour willow
#

hei you pick up

onyx fjord
#

hmm how do i get the cactus block that was broken when growing by fence?
BlockGrowEvent results AIR as block and source block

#

im guessing because its within the same tick?

misty current
#

can you change the block contents of a Structure object

#

if not, can I do it using DefinedStructures?

#

i've already figued out entities but sadly blocks are more obfuscated

tardy delta
#

tf am i even doing

#

shouldnt be talking with the win32 kernel directly

#

didnt even know that was possible

agile anvil
#

Wait

#

Are you telling me I missed that malloc feature of java?

chrome beacon
#

That's preview api

#

you need a flag to enable it

agile anvil
#

Yeah I'm seeing that

#

Since 17

#

That's great

#

I'm watching everything I missed since 16 🤣

#

There are so much stuff

chrome beacon
#

There are so many good proposals for Java 21

agile anvil
#

Even as now, just discovered Pattern Matching and Vector API, how did I missed that

agile anvil
chrome beacon
#

And there are a lot of changes in non-lts versions that we can use

agile anvil
#

Yeah 21 is going to be LTS right?

chrome beacon
#

Yes

agile anvil
#

So much to read

#

How can I even feel hype about it lmao

tardy delta
#

i can interact with all dlls that the jvm allows me to

#

bruh did they realize their main method is bloat or smth?

quaint mantle
#

.db files is sqlite files ?

tardy delta
#

file extensions dont matter, but probably ye

agile anvil
#

Could literally be anything

#

Where did you find them?

compact haven
#

(forgot that an export is .sql)

tardy delta
#

i somehow try to avoid file extensions but then i somehow forgot whats in the file

worldly ingot
#

Remember back to your early Java days. Were you ever told "Just ignore the public static void part for now"

tardy delta
#

are we lowering ourselves to noobies their level now

worldly ingot
#

You can and still should write the full main entry point. But for beginners, or even just for very simple testing, this is extremely convenient

#

C# has a similar concept called top-level statements

#
using System;

namespace Application
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
        }
    }
}```
#

That whole thing can be compacted down just to this:

Console.WriteLine("Hello, World!");```
tardy delta
#

feels more intuitive to me to have an explicit entrypoint of the application rather than some random code hanging around

worldly ingot
#

For you, yes

#

For beginners, it's easier to ease them into Java

#

Again, you still can and should use public static void main(String[] args) and the works

tardy delta
#

imma just continue with c++

worldly ingot
#

But for instructional purposes, starting people off to teach them how to write a Hello World program is easier done in 3 lines than it is 6

misty current
#

hey, i've tried using the nms mappings plugin and now i'm getting ClassNotFoundExceptions when i try accessing any class: Caused by: java.lang.ClassNotFoundException: net.minecraft.world.level.Level

#

have I replaced something i was not supposed to?

quaint mantle
#

Issue
I am trying to get mob spawners to work. I would place a pig spawner and it does not spawn any pigs. Tried Cow and Zombies as well (In their correct environment). None of them are working.
Mobs are normally spawning in my world, just not from spawners.

misty current
#

wrong channel

quaint mantle
#

no its not

misty current
#

are you talking about mob spawners in general or are you coding a plugin that has something to do with spawners

misty current
quaint mantle
#

am talking about a general spawners error

misty current
#

then this is not the correct channel, this is for plugin development

quaint mantle
#

no its not specifically for plugin development

misty current
#

anyways for passive mobs make sure there is grass and for hostile ones make sure you're not in peaceful

quaint mantle
#

check my message please

misty current
quaint mantle
#

in their envoirment

misty current
#

in their environment doesn't imply that there are grass block around

eternal oxide
#

How are you getting and placing the spawners?

misty current
tardy delta
#

laughs in c++ iterators

remote swallow
misty current
#

the description of the channel clearly says Serious Spigot and BungeeCord programming/development help | Ask development-related questions here, and the scope of your question does not fall under this category

misty current
#

do i need to replace anything in <inputFile>${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar</inputFile>?

kind hatch
eternal oxide
#

How are you building?

kind hatch
#

Maybe try using the latest version of the maven shade plugin as well. (3.4.1)

misty current
eternal oxide
#

I see no issue then

#

pom is fine

misty current
#

import net.minecraft.server.level.ServerLevel; this is the correct import isn't it

#

also does it matter that my server jar is paper?

kind hatch
#

Actually I just noticed, what's with the <outputFile> being under the shade plugin? If you want to copy your final jar, you should be using the maven-jar-plugin.

misty current
#

it's to avoid having to copy and paste the jar each time, i remember seeing someone do it 2 years ago and i've never bothered looking for another way to do it

kind hatch
#

It should be as simple as adding this.

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-jar-plugin</artifactId>
  <version>3.3.0</version>
  <configuration>
    <outputDirectory>/my/path</outputDirectory>
  </configuration>
</plugin>
misty current
#

ah

#

could that be the issue?

kind hatch
#

Considering it's the shade plugin, probably.

misty current
#

aight lemme try

kind hatch
#

Oof, alex even covered this exact case.

misty current
#

yea that worked

#

thank you

pseudo hazel
#

lmao, time to fix my pom

quaint mantle
#

what u think for sqlite ?

#

this is what i'm looking for

#

as if it is saving data to file but has sql features

tardy delta
#

all databases are a file

quaint mantle
#

this perfect

quaint mantle
eternal oxide
#

eventually

tardy delta
#

where do you think the data is saved? in the gnomes their home?

quaint mantle
#

okey how can i get mysql data file ?

#

wait

#

i can look google for this

tardy delta
#

C:/ProgramData i believe

#

if its running locally

#

bruh am i the only one that always forgets their mongodb cloud password

quaint mantle
tardy delta
#

with their stupid requirements

#

uh thats not how it works

#

you just create a mysql database in the already existing configuration and throw your data in there

#

not caring about where the data is saved

fringe yew
#

how do I remove a string from a string list in a yml file?

tardy delta
#

get the list, modify it and set it back

kind hatch
fringe yew
#

but how do i actually remove it

tardy delta
kind hatch
tardy delta
quaint mantle
#

so this is sqlite ?

young knoll
#

probably

tardy delta
#

ig

quaint mantle
#

ah now if i change the database in config sqlite to mysql

kind hatch
quaint mantle
#

can i lost sqlite datas ?

kind hatch
#

You'll have to migrate the data.

#

You might be able to export it to .sql files.

tardy delta
#

hmm that mongodb cloud ip whitelist sucks, my server runs locally and thereby it needs my homes public ip but that changes everytime 💀

kind hatch
#

Then import it via the mysql command line.

quaint mantle
#

omg thats good idea

tardy delta
#

by hand

quaint mantle
#

wut

#

how can i save datas to two sql ?
but if i change one data in one sql the other sql will change

kind hatch
#

Not really. Both are technically SQL. You can convert SQLite to MySQL no issue, but not the other way around because SQLite doesn't support the full range of features that MySQL offers.

quaint mantle
#

ah 😦

tardy delta
#

still no autoincrement iin sqlite :(

kind hatch
#

or LIMIT commands. 😭

tardy delta
#

bruh

eternal night
quaint mantle
kind hatch
#

???

MySQL and Flat Files are two different forms of storage.

eternal oxide
#

yml and sql are not related nor connected at all

quaint mantle
#

thanks for teach me this sql rules

tardy delta
young knoll
quaint mantle
#

how would you store user ids

eternal night
#

sqlite literally has autoincrement

young knoll
#

^

eternal night
#

idk what fourteen is on xD

#
sqlite> CREATE TABLE users ( id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT );
sqlite> INSERT INTO users (name) VALUES ('lynxplay'),('fourteenbrush');
sqlite> SELECT * FROM users;
1|lynxplay
2|fourteenbrush
sqlite>
kind hatch
#

What about the LIMIT command? Does that still not work?

eternal night
#

limit is implemented in sqlite

kind hatch
#

Wat? Bro, when? Last time I tried to use it, it told me it didn't exist. 💀

eternal night
tawdry echo
#

How can set one use of item

wise mesa
#

could you elaborate on what you mean?

kind hatch
quaint mantle
#

can i register player uuid to mysql with only onfirstjoinevent ?

kind hatch
#

Yes?

tawdry echo
eternal oxide
#

there is no onFirstJoinEvent

quaint mantle
quaint mantle
young knoll
#

yes

quaint mantle
#

oke thx

young knoll
#

Player#hasPlayedBefore

quaint mantle
wise mesa
#

another option would just be to clear the slot in the interact event

tardy delta
#

it lacks other things

fringe yew
#

does \n work when sending a player a message

kind hatch
#

When you use Player#sendMessage() It does.
It doesn't work if you manually typed it in chat.

fringe yew
#

thanks

onyx fjord
#

can i break a block and emit particles in code but without any drops?

young knoll
#

Yes

#

You could just set the block to air and then spawn the particles manually

#

Or remove the drops using an event like ItemSpawnEvent

quaint mantle
#

where can i find the spigot 1.7 server that supports both 1.7 and 1.8 clients source?

onyx fjord
#

got it its BlockDropItemEvent

remote swallow
onyx fjord
#

not worth it

agile anvil
#

🫣

quaint mantle
#

...

remote swallow
#

get bukkit isnt offical

onyx fjord
#

?paste

undone axleBOT
remote swallow
#

you shouldnt be using it

quaint mantle
#

SPIGOT-1.7.10-SNAPSHOT-B1657.JAR

onyx fjord
#

lmao

remote swallow
#

not offical

#

its not us

young knoll
#

1.7 is no longer officially available

onyx fjord
#

good luck with that

remote swallow
#

we dont distribute that anymore

onyx fjord
#

doesnt it have log4shell?

young knoll
#

No

quaint mantle
#

where can i find a 1.7 spigot source

young knoll
#

1.7 didn't use log4j

remote swallow
quaint mantle
#

why

agile anvil
#

There isn't even anyone still using 1.7 in 2023

#

Nor 2022

remote swallow
#

it would've been on github, then deleted after the dmca

tribal quarry
#

hey there

#

are there any events for checking if somehow an item is moved from main hand to off hand?

quaint mantle
quaint mantle
remote swallow
#

thats for you to find out

quaint mantle
#

ok

young knoll
#

Actually I lied

#

1.6 doesn't use log4j, I think 1.7 does

eternal oxide
#

some still play 1.7.10 modded

onyx fjord
#

thats a different story

#

because if you mod

#

you either play solo

quaint mantle
#

yeah its not for modding

onyx fjord
#

or with ppl you trust

#

lets be real

#

if you make a public 1.7 server with no patches it will fail

#

it will get nuked

agile anvil
#

Just wondering why you need 1.7

quaint mantle
#

why do u care

#

i need it for my minecraft server

#

ok?

remote swallow
#

why do you want to run 1.7

quaint mantle
#

to make my minecraft server function

remote swallow
#

like kacper said, it will literally get nuked

grim oak
#

How do i use fonts for guis. Like where does the font go?

quaint mantle
remote swallow
#

it doesnt matter

quaint mantle
#

ok

#

i dont care

onyx fjord
quaint mantle
#

how is it gonna get "nuked"

onyx fjord
#

ancient exploits

remote swallow
#

the log4j exploit

onyx fjord
#

not that

quaint mantle
#

thats why im looking for the source

onyx fjord
#

just general dupes / crashes

quaint mantle
#

...

onyx fjord
#

its a heavy task

quaint mantle
#

Ok

onyx fjord
#

you better have a team dedicated to it

quaint mantle
#

Ok

remote swallow
#

is there a reason you cant run a later version?

grim oak
young knoll
#

Custom GUIs with fonts usually use the title

onyx fjord
young knoll
#

But we don't have component support for inventories yet

onyx fjord
#

for chat

grim oak
grim oak
remote swallow
quaint mantle
#

Its weird

remote swallow
#

great excuse

#

just use 1.8

quaint mantle
#

No

onyx fjord
quaint mantle
#

wtf

remote swallow
#

its atleast had some of the bugs patched

quaint mantle
#

Ok

onyx fjord
#

you are on your own

remote swallow
#

and you can get the source of 1.8

quaint mantle
remote swallow
#

?stash

undone axleBOT
remote swallow
#

1.8 branch

onyx fjord
#

no matter if 1.7 or 1.8 you are on your own

grim oak
quaint mantle
#

How about 1.7

#

if can i add cooldown to command example 1 day
if i restart my server this cooldown will reset ?

remote swallow
#

its not on stash

grim oak
young knoll
quaint mantle
young knoll
#

Nowhere

#

Gone

#

Reduced to atoms

remote swallow
#

no where offical

quaint mantle
#

where unofficialy

onyx fjord
remote swallow
#

idfk

onyx fjord
#

only chat supports truly custom

remote swallow
#

not my problem

quaint mantle
#

Ok

young knoll
#

Nah custom fonts work everywhere

onyx fjord
#

rly?

young knoll
#

We just need the component PR first

grim oak
quaint mantle
#

Would it be enough to just send the error to the console?

Or should I print it to a file or something?

worldly ingot
quaint mantle
#

ah i understand

#

errors message and error code

#

together ?

worldly ingot
#

Prints the exception, its messages, and its call stack to the standard output

#

Yeah

quaint mantle
#

alright i will use but

#

only console log is good or

#

i need log to file ? to errors ?

worldly ingot
#

Just console is fine

quaint mantle
worldly ingot
#

Console output is already logged to file anyways

#

logs/<date>.log

tribal quarry
#

thanks!

opal carbon
#

can clients respond to ForwardToPlayer bungeecord messages?

tall furnace
#

Did you use InventoryClickEvent, on click check inventory type, if inventory type is crafting, check contents, if contents contains N items, set output?

#

Ye that's what I had to do too XD Kinda alot to type out just to make it work, but hey it does what it needs to

opal carbon
#

pre 1.13 api is wack

#

this is why i dont make plugins for old versions lol

young knoll
#

No ExactChoice?

#

F

opal carbon
#

earliest ill go for plugin dev is 1.14.4 cause before that it feels a bit silly imo

glossy venture
#

just use via backwards or whatever and run 1.19.4

#

except blockhitting might be a problem

remote swallow
#

earliest version ill dev for is 1.17

worldly ingot
#

Y'all use versions before 1.19.4?

#

Cringe

young knoll
#

Y'all aren't using 1.20 pre-release?

remote swallow
worldly ingot
#

Actually, surprisingly, no. I join teams and they're almost exclusively on the latest version

remote swallow
#

how many teams are you joining

worldly ingot
#

If they operate on 1.8, hard no. If they operate on 1.12, hard no. If they operate on 1.13... I'll consider it but lean towards no

remote swallow
#

damn

young knoll
#

He currently works for 45 teams

remote swallow
#

average choco moment

young knoll
#

If they operate on 1.13 they get a hard no because who tf runs 1.13

worldly ingot
#

I think I've worked with 5 networks thus far

young knoll
#

Like at least do 1.16 or something

#

1.13 14 and 15 were wack

worldly ingot
#

big wack

glossy venture
#

1.8 is one of the best versions but has the worst api

remote swallow
#

no

#

get out

opal carbon
#

i prefer devving for 1.17+ since it has a lot of the newer stuff

glossy venture
#

better off rewriting the whole minecraft server yourself

remote swallow
glossy venture
#

than doing 1.8 nms

glossy venture
#

i wrote a kit plugin for 1.8

opal carbon
#

but 1.14 is still like at least not thaaat old a version

heavy mural
#

What is the best event to take when it comes to an arrow popping a chorus fruit?

opal carbon
#

but i still definitely prefer 1.17+ overall

#

anything before 1.14 is definitely hard pass

worldly ingot
opal carbon
#

either way it contained major features

#

and not that many massive changes have honestly happened that i know of

#

most plugins i write for later versions work on 1.14

young knoll
#

World height

opal carbon
#

nms obviously not included

worldly ingot
#

All my contributions mean nothing then :((

#

I've added so much API since then!

opal carbon
#

musta not ended up using it then

remote swallow
#

when did you join chococococo

worldly ingot
#

Join what?

opal carbon
#

cause most api works back since 1.14

remote swallow
#

spigot staff

worldly ingot
#

I think it was 6 and a half years ago

opal carbon
#

wait choco are you the person who complains about obfuscation on spigot forums?

young knoll
#

Ha nerd

opal carbon
#

feel like i recognize ur pfp

remote swallow
#

ur older than 1.14, nerd

young knoll
#

So are you

remote swallow
#

his staffing time

worldly ingot
remote swallow
#

ui meant

opal carbon
#

yeah i was right

#

"Open source
Stop obfuscating"

worldly ingot
#

Yeah. Open source > obfuscation

young knoll
#

he's right

worldly ingot
#

Obfuscation is stupid and dumb

#

Open source is a Chad move

quiet ice
#

Also, hiding stupid code in plain sight is the best obfuscation

opal carbon
#

just thought i remembered you from seeing that on old posts lol

worldly ingot
#

Exactly

remote swallow
#

i hide all my code being 93 different sub libs

#

choco just doesnt want people to obsfucate so his life is easie

quiet ice
#

Attempting to obfuscate by hand is the worst obfuscation (I have modded a game in the past where the devs hid field access through Reflection and a Base64 decoder - so I instantly knew which stuff was to be hidden away).

young knoll
#

They obfuscated by hand?

opal carbon
#

i just wish bungee messaging channel documentation was better

#

its not very good especially for the custom messages (the forward messages)

#

especially ForwardToPlayer

quiet ice
#

Well they basically used boilerplate encryption for assets as well as reflection for obtaining the values of "secret" fields

opal carbon
#

documention gives like no info on what it actually does

quiet ice
opal carbon
#

bungee messaging channel?

#

maybe idk

#

nah for docs it just links to the official docs

quiet ice
#

Yeah, but what is the issue with those?

#

The forwardtoplayer docs seem okay

opal carbon
#

ForwardToPlayer has little to no documentation of how it actually works

#

what channel should a client listen to? how do they reply? how does it tell the server what server to send the reply to?

quiet ice
#

It just forwards a PMC message from the backend to a certain player

#

There isn't much to understand

#

And rarely useful

opal carbon
#

id assume they use the bungeecord channel but then again what format does the client reply with

#

can it even reply?

eternal oxide
#

the client doesn;t reply

quiet ice
#

You'd need to test it out whether bungee forwards PMC messages from client to the backend

opal carbon
#

well the docs show steps for reading replys

opal carbon
eternal oxide
#

replies from servers not clients, unless they are modded

quiet ice
#

I mean you are basically never going to use it because the client won't send PMC messages unless they are modded as ElgarL asserted

opal carbon
#

but what if they are modded

eternal oxide
#

then it all depends on the mod

worldly ingot
#

Then you'd still need to know which channel to listen to

#

That's up to the mod to document those types of messages

#

If they even choose to document it. Most don't

#

Not to mention the fact that you probably would not need to respond on the proxy to begin with. Responding to a message from the client is probably best done on the server on which they're logged onto anyways

#

ForwardToPlayer really isn't super useful in a majority of situations

eternal oxide
#

Pretty sure it will just be something you are doing wrong

blissful wagon
#
ItemStack.serialize() 

give us a map , how we can get a item from that map later on ?

blissful wagon
#

thx

visual laurel
eternal oxide
#

Just in case you miss it

quaint mantle
#

No suitable driver found for root

visual laurel
#

🤦‍♂️ i hit capslock and forgot

quaint mantle
#

i got this sql error why ?

earnest wasp
visual laurel
remote swallow
eternal oxide
#

you are still using capitols in your earlier keys

visual laurel
#

those work, do those affect it then?

eternal oxide
#

it should throw an error at least

visual laurel
#

nope

eternal oxide
#

?stash

undone axleBOT
visual laurel
#

does paper remove this error?

eternal oxide
#

oh sec

#

Seems it converts just in case this.namespace = plugin.getName().toLowerCase(Locale.ROOT);

visual laurel
#

ah. so do you know why its not registering?

eternal oxide
#

Do you have to discover them like you do normal recipes?

#

player has to be taught them

young knoll
#

Unless you have the gamerule set you don't have to discover them

eternal oxide
#

No clue then

visual laurel
#

its very wierd

#

i see it flicker for a second and then disappear

worldly ingot
#

Which version?

visual laurel
worldly ingot
#

There was a recent fix pertaining to smithing recipes so update to the latest build if you haven't already

visual laurel
#

in on 1.19.4-R0.1-SNAPSHOT

young knoll
#

That isn't a spigot version

#

?bt

undone axleBOT
quaint mantle
#

why my plugin size is big ?
my plugin size was 5kb after load mysql be 4000kb

#

its normal ?

kind hatch
#

Probably shaded something in that you forgot to exclude.

river oracle
#

My plugins are 7mbs uwu

quaint mantle
river oracle
#

Nothing but shading 2 databse drivers lol

river oracle
#

Spigot provides jdbc

kind hatch
quaint mantle
river oracle
quaint mantle
#

sorry for my ignorance

river oracle
#

Make sure you aren't maven shading

quaint mantle
#

oke

river oracle
#

I'd need to make some sort of library feature for myself

kind hatch
#

That's fair. The only solution to that is to just have it download the libraries, but that would require internet access and a permanent file location.

river oracle
echo basalt
#

Is it even allowed to use the libraries feature in premium plugins given that they must work without an internet connection?

kind hatch
#

Apparently it is.

young knoll
#

Yes, since it only needs internet the first time

#

Which is fine

quaint mantle
#

how can i create custom method with spigotapi
exeample i wanna get player level and do this with method
for do this i need get Player.class and return player.getLevel ?

eternal night
quaint mantle
#

I used my imagination

rapid dome
quaint mantle
rapid dome
#

its a void, you cant retunr

quaint mantle
#

ah

#

wait

#

mb

#

is right ?

rapid dome
#

yeah

#

now its correct

quaint mantle
#

^^

hazy parrot
#

Why would you do that

rapid dome
#

infact

quaint mantle
#

my mmo server levels works with minecraft levels

#

and i wanna control this from database

#

in playerstats

#

money,level,skillpoints

rapid dome
#

a lil bit inconvenient to use the experience levels

#

you could create an int e store the level in it, save it in the database if you want and show the level in the scoreboard

grim oak
#

Hi I asked earlier but didnt get much of a response, but how do I add custom fonts to a gui

#

Ive added fonts and got it as a text component in the plugin

#

But where do I put it in the GUI. I dont think components work in GUI titles?

chrome beacon
#

or if you're using Paper they have api methods for creating an inventory with a component name

#

It appears they're missing a component version of setTitle though

young knoll
#

setTitle is fairly new

#

Also bug MD to merge the component PR :p

remote swallow
#

after 1.20

peak jetty
#

why is this not working?

@EventHandler
    public void onEntityDamage(EntityDamageEvent e) {
        getLogger().info("event triggerd");
        if(e.getEntityType() == EntityType.DROPPED_ITEM) {
            getLogger().info("entity is item");
            if(e.getCause().equals(EntityType.ENDER_CRYSTAL)) {
                getLogger().info("cause checked");
                e.setCancelled(true);
                getLogger().info("event cancelled");
            }
        }
    }```