#help-development

1 messages · Page 773 of 1

wet breach
#

Cant really get more efficient then that

umbral ridge
#

Show me how to do it?

#

xD

#

Meh I think It's fine

#

this is what I currently have

wet breach
#
    int first = 1010;
    int second = 0011;
    int result = (first << 4) | second;
    printf("%d", result);

You would do something similar to this. This is the basic way to concatenate two binary numbers

umbral ridge
#

meh

wet breach
#

We shift the first set of binary numbers to the left we so we have room to set the second. And then you get your result and do it again for the third. And then you compare with bitwise operator the resulting binary if the are the same

umbral ridge
#

thank you for explanation xD

#

I could use this somewhere where i have to be super efficient

wet breach
#

I try to teach people how to do bitwise and bitshifting stuff lol

umbral ridge
#

But I kinda forgot xD

#

It's an interesting topic though

#

bytes and bits :D

wet breach
umbral ridge
#

Copyright 2020 Frostalf xD

wet breach
#

This compresses hex or rgb colors into 8bit colors and back

#

But it uses bitshifting to do it

#

Ansi 8bit colors to be specific

umbral ridge
#

noice

wet breach
#

Since most consoles implement ansi

#

I made this because someone needed it. Feel free to use it. It is licensed mit after all uwu

umbral ridge
#

It could definitely come in handy xD

#

thanks

echo basalt
#

oh hi frosty

umbral ridge
#

why does this fire like every ~ 2 seconds, when it should fire every second (20 ticks) ?

BukkitTask task = new BukkitRunnable() {
  @Override
  public void run() { }
}.runTaskTimerAsynchronously(essentials, 0L, timeSeconds * 20L);
#

is it because it's async?

echo basalt
#

wild take

#

what if you registered it 5x

umbral ridge
#

No

#

once

#

I've got a class for it

#

and in it I have a method which creates the runnable and starts it

#

let me check, i fixed it

umbral ridge
#

if player.getInventory().getItemInMainHand(); is not null then what does it become if player isn't holding anytihng in their hand?

#

AIR?

river oracle
remote swallow
#

7smile stop spoon feeding smh

ivory sleet
#

use Material::isAir

umbral ridge
ivory sleet
#

for future compat since it can be different types of air

umbral ridge
#

huh

#

is thaaaat so

umbral ridge
#

and stuff like that

ivory sleet
#

prob

#

idk tho

umbral ridge
#

that'd be epicc

ivory sleet
#

i mean like in inv, u have normal Material.AIR

#

but like, in the future it might be changed

#

who knows

#

so isAir and null check ftw

umbral ridge
#

nicenice

umbral ridge
#

hey

#

how do you get item durability? (damage)

ivory sleet
#

Cast ItemMeta to Damageable

#

if its an instance of it

#

Which it almost always is

umbral ridge
#

Ohhh itemMeta, i was casting to itemstack loll

umbral ridge
#

But that gets the damage right? So

#

hmm

#

Damage and durability are two different things?

ivory sleet
#

it probably just var damage = itemMeta instanceof Damageable damageable : damageable.getDamage() : -1;

#

or sth

#

lol

umbral ridge
#

Ohh I see thanks

#

How would I iterate over this?

#

to also get the enchantment level

ivory sleet
#

entrySet()

umbral ridge
#

Ahhh

#

thats what I was looking for schnitzel

carmine mica
#

don't say air. that doesn't have itemmeta so it can't be "not Damageable"

umbral ridge
#

Enchantment#.getName() - deprecated? what's the alternative

#

nvm figured it out

ivory sleet
carmine mica
#

all ItemMeta are also Repairable and BlockDataMeta which is yikes

eager smelt
#

Minecraft Plugin.
How do I load an ini file?

spare hazel
#

how can i launch the player up in the air based on their yaw and pitch? do i have to use sin and cos?

eager smelt
#

Thank you.
I'll use YAML.

spare hazel
zealous osprey
onyx fjord
#

Wasn't it namespacedkeys

topaz cape
#

since OfflinePlayer is @NotNull ed how do I check if the OfflinePlayer was found

#

and no im not checking if the player played before, I'm just willing to get his UUID from Mojang API

spare hazel
#
player.setVelocity(new Vector(
                -Math.sin(Math.toRadians(player.getLocation().getYaw())) * 30,
                2,
                -Math.cos(Math.toRadians(player.getLocation().getYaw())) * 30
                ));```
this is still not workin
echo basalt
#

you can just getDirection

spare hazel
spare hazel
#

how can i detect taking damage by drowning

shadow night
#

The entity damage event and then check if the cause is drowning, probably

slate tinsel
#

Can I rotate a falling block?

smoky anchor
#

(Unless you're supporting some archaic versions like > 1.19)

icy beacon
#

You can check if the player is online by doing #getPlayer (returns null if not online), and you can use #hasPlayedBefore

topaz cape
#

how is it found

rotund ravine
#

Good question

#

@topaz cape Turn off ur internet and try

onyx fjord
#

Aren't players cached

rotund ravine
#

But like if he wants to get some random ass player who hasn’t it fetches

onyx fjord
#

It's some Unicode character

#

I remember having something like that in my tablist

slate tinsel
smoky anchor
# slate tinsel I'm using display entities right now, but thought of switching to falling blocks...

Why do you feel the need to support 12 versions...
One of them is like 9 years old
My guess is that only a fraction would play on those
Just stick to latest smh

You'd either degrade the quality of your plugin by using outdated features just to support old versions
Or you'd have to use modules to support the old versions and not break quality for newer versions (not sure about this one, haven't used modules)

slate tinsel
#

So it's just something I came up with, or is it the case that usually servers only have support for the latest versions?

smoky anchor
#

I wouldn't say servers only support latest version, maybe a few latest versions (unless it's those weird 1.8 pvp servers that are still somehow alive)
(For example Wynncraft is slowly dropping the lowest version)
I guess your plugin being a "Hub plugin" would justify multi-version support.

#

But in that case... enjoy working with 1.8 API
I know I wouldn't

slate tinsel
eternal oxide
#

I can honestly say I've never worked with 1.8. I stopped at 1.7 and came back around 1.12 (ish)

wet breach
spare hazel
#
private void join(Player player, int id){
        switch (id){
            case 1: Bukkit.dispatchCommand(player, "server skyblock"); break;
        }
    }```
why does this give unknown command /help
wet breach
#

Need you to keep gm updated you know

eternal oxide
#

everything pre 1.18 sucks 🙂

wet breach
#

It is because of 1.7 where holograms were born

rotund ravine
#

Use plugin messaging channels to transfer plebs between servers

spare hazel
young knoll
#

?pmc

worldly ingot
#

I would opt for the messaging channels instead, yeah

spare hazel
worldly ingot
#

See Coll's link above ^

#

You'll want the Connect message

rotund ravine
wet breach
rotund ravine
#

Ye kicking em is a good idea

wet breach
#

I think mojang has a packet for it

#

Where it kicks and automatically makes them join at new address

spare hazel
#

i checked that but that wasnt an api
i want something to install on bungee and the server so those plugins can communicate and i wouldnt have to do the boring stuff

wet breach
#

Technically dont really need a plugin on bungee to make them connect to other servers

eternal oxide
#

I think he means he wants to issue server commands for bungee, which you can;t so via spigot

#

he has to use PMC

spare hazel
rotund ravine
#

I see

worldly ingot
#

You can write that

#

Using the API we linked above lol

wet breach
#

Plugin message channel supports one sided requests. Dont need a plugin on the bungee for this if you really dont need it or want it

rotund ravine
#

Idek what it is

#

But it showed up on google 👌🏻

wet breach
#

Lol but you linked it anyways

rotund ravine
#

Well

#

I looked slightly at it and it had a connect and seemed to use plugin messages

spare hazel
#

private void sendConnectMessage(Player player, String server){
ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeUTF("Connect");
out.writeUTF(server);

    player.sendPluginMessage(IranSkyLobby.getPlugin(), "BungeeCord", out.toByteArray());
}
#

like this?

worldly ingot
#

Yep, just be sure to register an outgoing message channel in your onEnable()

spare hazel
#

oh alright

worldly ingot
#

Bukkit.getMessenger().registerOutgoingPluginChannel(this, "BungeeCord"); You can just copy paste that at the start of onEnable()

worldly ingot
#

Then you should be good to go 👍

spare hazel
#

'newDataOutput()' is declared in unstable class 'com.google.common.io.ByteStreams' marked with @Beta

#

wait what?

worldly ingot
#

You must be on an old version of the server or something because that API's been stable for quite some time now

#

You can suppress that warning

worldly ingot
#

Yeah Guava was a bit dated then

wet breach
#

Unless you have some old dependency

worldly ingot
#

We only bumped Guava in newer versions because there were some API breaks iirc that we wanted to avoid

#

Either way, that API is safe to use. It's stable so the Beta annotation can be ignored

#

Yes?

#

Oh, no. They're not logged in at that point

#

That's like the handshake packet

wet breach
#

You cant sent spawn from that event as the player hasnt even logged in yet

spare hazel
#

yoooooooo

wet breach
#

Use the join one if you need to set spawn

spare hazel
#

it works

#

no way

worldly ingot
spare hazel
#

thatnks @worldly ingot @rotund ravine @young knoll

lost matrix
#

I mean... kind of. You can put them in a Map<UUID, Location>, then wait for the PlayerSpawnLoactionEvent and read them from the map again

wet breach
#

At login player isnt quite fully on the server yet

lost matrix
#

But at that point you can as well just only listen to the PlayerSpawnLoactionEvent

wet breach
#

Or use that event

worldly ingot
#

Only reason you'd use the async one is if you desperately need to fetch a location from a database or something :p

#

That way you can block the login until the location's available

umbral ridge
#

I have a function that parses it from the config, fancy stuff xD Feel free to use it, I dont mind

smoky oak
#

is there a way to make the enchantment table temporarily deterministic / locked so that i can test the enchant event easier?

lost matrix
smoky oak
#

they are, but i also need to test that event so this aint gonna help lol

lost matrix
#

Just register a new method with a lower prio

smoky oak
#

oh just be like 'youre this now'

#

yea thatd work

#

actually

#

can you give event handlers numeric priority values? iirc logger has numbers that represent the log levels but idk if that'D work for event handler

rotund ravine
#

Event handlers use the lowest to highest for priorirty

umbral ridge
# onyx fjord Wasn't it namespacedkeys

It's a namespaced key yeah but I can't find the right function that gives me just the name if I use getKey().toString() I get something like Enchantment[minecraft:efficiency,DIG_SPEED.. .. ...] and I want efficiency, not DIG_SPEED - I get that from getName().

rotund ravine
spare hazel
#

what is org.bukkit.conversations

smoky oak
rotund ravine
#

Atleast not natively

umbral ridge
smoky oak
#

I mean i know how to do it non natively but i really dont want to do that lol

lost matrix
umbral ridge
lost matrix
umbral ridge
umbral ridge
lost matrix
#

Yeah ofc

#

But not server side

umbral ridge
#

Let me try it

#

No it stays the same

smoky oak
#

if no name and no localized name is set then it switches

#

the client generates the item names from the item metadata

rotund ravine
rotund ravine
lost matrix
umbral ridge
rotund ravine
#

I think so

umbral ridge
#

isn't there a fixed id for these things?

#

why would it have to change when the users language changes

rotund ravine
#

The Namespacedkey should be

umbral ridge
rotund ravine
umbral ridge
#

getKey() is the Namespacedkey

lost matrix
#

The user gets sent the translatable component, not a name.
And this component gets traslated on the client.

worldly ingot
#

I do wish that alex didn't PR a Translatable interface to Bukkit because I was planning on having one in BungeeChat, but I've kinda gotta roll with the punches now

smoky oak
#

mfn?

worldly ingot
#

but I do plan on improving translatability Bukkit-wide after I get components merged in

#

Yeah

smoky oak
#

guess this is what happens if more than one person works on a project lol

#

*competent

#

u dont want me to mess with spigot code lol

worldly ingot
#

I mean the Translatable interface is fine in Bukkit, I was just hoping to target it in BungeeChat and ultimately Spigot

#

:p I'll probably end up creating one in BungeeChat anyways and having the Bukkit one extend it

smoky oak
#

probs will work

#

honestly the main reason i dont try to do prs is cuz of the stupid way it works

#

source code is impossible to get cuz its just three repositories of patches on top of nms

worldly ingot
#

I wanna be able to do new TranslatableComponent(material), or new TranslatableComponent(enchantment), just instead of having to invoke getTranslationKey() each time

young knoll
#

Very noice

worldly ingot
#

tbqh maybe I should do that now

#

It would end up in the same BungeeChat patch anyways

umbral ridge
#

what is double getHealthScale()?

#

scale? what scale

smoky oak
#

its the amount of health per dragon scale :kekw:

young knoll
#

It’s uhh

#

Some kind of weird black magic you can apply to players health

#

I think it lets you give the player say 100 health but still only 10 hearts

#

Rather than 50

umbral ridge
#

Oh damn nicee

#

I also wanted to ask, how can you limit the golden hearts to 2? when a player eats an enchanted golden apples they get like 6 or 8

#

Is there an event where I catch that kind of stuff

young knoll
#

There’s the potion effect event

#

You can limit absorption level to 1

#

However max absorption is also an attribute now

umbral ridge
#

I guess limiting the absorption level to 1 is enough?

young knoll
#

Should be

umbral ridge
#

How can I do it with an attribute? I haven't used that before

#

setAttributeModifiers?

lost matrix
#

@worldly ingot which pool would i occupy for the craftbukkit impl of something like this?

#

For CFs in general

young knoll
#

How does create world async work

worldly ingot
#

Which thread pool you mean? I'm unsure. Maybe a better question for Zocker. I'd say create it just with the default CompletableFuture thread pool for the time being, then leave a comment once you create the PR and ping Zocker for input

lost matrix
#

Thats the plan at least

smoky oak
#

i mean

#

minecraft really needs its worlds multi threaded

#

just sync ticks if one starts lagging

orchid trout
#

sin
ce when coll and smile discord helper!?!!!!!!!!????

smoky oak
#

dunno a while

#

i do try to help out when i can but more often than not i run into walls myself 😅

lost matrix
#

2 days for me, yesterday for coll

young knoll
#

I’ve gotten my world creation to 4ms so I’m content :p

orchid trout
#

what do you even do as helper?

#

monitor the chat?

#

babysitting stuff

hazy parrot
#

I would assume they help

young knoll
#

We eat sand

worldly ingot
#

Was quick and simple

smoky oak
#

its still checking lol

#

btw choco

worldly ingot
#

I only just PR'd it

smoky oak
#

is there a tutorial or smth for how to contribute to spigot?

worldly ingot
#

Oh I definitely have some checkstyle errors though oops lol

lost matrix
#

🙂

worldly ingot
#

KEKW Checkstyle, yeah

#

I forgot to build

umbral ridge
#

on this event, how to change the potion effect? I understand I have to use setOverride(true) but what do I do from there? there are no set() functions?

#

I want to set the absorption level to 1

brazen badge
#

I'm building a plugin with gradle, but when I build it it stays at an old version of the code and doesn't change the code inside the plugin. Does anyone know how I can fix it?

lost matrix
#

How do you build this plugin?

wet breach
worldly ingot
smoky oak
#

do u mean like bukkit and spigot?

worldly ingot
#

Spigot's README leaves a bit to be desired but you'll likely be targeting Bukkit and CraftBukkit anyways

#

Yes

brazen badge
smoky oak
#

kthx

wet breach
#

you should be restarting it, and are you sure you actually replaced it? Also, might want to check you are copying the appropriate jar from the build directory

#

if anything else, just do a clean build

#

also probably make sure you hit save too

lost matrix
#

What am i missing? I built bukkit and applied the patches in CB... Has been a while

wet breach
brazen badge
wet breach
#

did you use the big green play button?

brazen badge
wet breach
#

try right clicking the project instead

#

and have it build with gradle

young knoll
umbral ridge
brazen badge
wet breach
#

@young knoll do you use IntelliJ?

young knoll
#

nop

wet breach
#

hmmm

#

do you know how to make intelliJ build with gradle by chance?

#

lol

young knoll
#

no idea :p

wet breach
#

wonder where all the intelliJ people are at

umbral ridge
#

I use intellij but with maven :P

remote swallow
#

Hi i use intellij gradle

wet breach
#

wooo

wet breach
brazen badge
remote swallow
#

Run the clean task and make sure your updating the jar

brazen badge
remote swallow
#

Right side of ur screen should be a gradle panel inside tasks and build should be clean

brazen badge
#

ok I found it

worldly ingot
lost matrix
worldly ingot
#

Mmm that helps as well

smoky oak
wet breach
#

he uses eclipse

#

I use netbeans

worldly ingot
rotund ravine
wet breach
smoky oak
#

i hate discord pings

rotund ravine
wet breach
#

never, netbeans has not done me wrong XD

smoky oak
#

Im forced to use IJU atm

rotund ravine
icy beacon
wet breach
#

yep

smoky oak
#

i mean i doubt hes imaginary

icy beacon
#

That is

#

Quite chad

rotund ravine
#

Doesn’t md5 also use netbeans?

wet breach
icy beacon
#

But also unexpected

#

xD

cold pawn
#

Anyone know if the Actions Field in the PlayerInfoPacket change? When I tried to set it like I used to in previous versions, I get a Index out of bounds for length. Im on version 1.20.2, and I know how you remove the player changed, so im wondering if adding the player changed too. (This is using protocolLib btw)

smoky oak
#

cant u just check the wiki.vg entry?

cold pawn
#

I did but it's still the same

smoky oak
#

hm. gl with nms lol

orchid trout
#

yo what is uuuuuuuuupppppppppppppppppppppppppppppppooooopoopppppppopopppppppppp

smoky oak
#

huh i have a VCS issue lol

#

does anyone know how IJ differentiates between the name of a commit and it's explanation? there only seems to be one text field

young knoll
#

Visual Code Studio

smoky oak
#

Version Control Software

#

in IJ

orchid trout
#

is the re visual studo code built into intellij

#

is that a theme

#

what did you do yesterday

wet breach
rotund ravine
#

Well

smoky oak
#

i dont see it

rotund ravine
#

Yes

#

What do you want to add?

smoky oak
#

i want to know where the commit's title is if thats the description or, where the commit's description is if that'S the title

#

like

#

github desktop for example

rotund ravine
#

Oh didn’t know that was a thing

#

Lel IJ rabbithole

slender elbow
#

it's just a commit message

#

GitHub will word split at some character count

#

but that's just gh, not a git thing

bronze crystal
#

i have the problem that the users of my plugin need to remove the old config.yml in order to get the new config.yml if they for example get a newer .jar of my plugin. There are methods to add variables that are missing but how do I add the comments? Maybe I am creating the config file wrong with saveDefaultConfig()?

slender elbow
#

alternatively you can use newlines too

young knoll
#

Pretty sure you can set the comments for an entry

#

setComments(String path, List<String> comments)
setInlineComments(String path, List<String> comments)

umbral ridge
#

hey

#

regardless of which enchanted apple i eat (golden apple or enchanted golden apple) the amplifier is always 1. how can i detect the ..level of it?

#

enchanted golden apple log

#

1 is the amplifier

#

how to get the level of it

icy beacon
#

Well yeah amplifier is basically the level

umbral ridge
#

is it

icy beacon
#

It should be

#

Amplifier is by how much you amplify it

#

Afaik there's some nuance to it, like it might return 0 when the level is 1, or something else related to off-by-one errors

#

Just play around with it

umbral ridge
#

this is when i eat a regular golden apple

#

o nvm

#

XD

rotund ravine
#

👀

umbral ridge
#

I Guess level 1 is basically level 0

#

huh

icy beacon
#

The naming is a bit ambigious. It makes sense for amplifier to return 0, because amplifier is technically the amount by which you amplify the level (if level is 1, then the amplifier is 0, because 1 + 0 = 1)

umbral ridge
#

goes from 0 -> ...

icy beacon
#

I used to run into a lot of off-by-one errors with it

young knoll
#

amplifier is 0 indexed

#

Because mojang likes to confuse us

umbral ridge
#

me too

young knoll
#

Enchant levels for example are not 0 indexed

icy beacon
#

If they had named them amplifiers, they'd probably have been 0 indexed

umbral ridge
#

effect clear @a doesnt help

#

suiciding doesnt help

#

how to get rid of these effects?

#

bug? XD

young knoll
#

does relogging help

umbral ridge
#

No

#

Im trying a server restart now

#

didnt work

#

im eternally cursed with resistance and fire resistance

lost matrix
#

Just, clear those or drink some milk

young knoll
glad prawn
#

drink milk sir

umbral ridge
#

i did and doesnt work

#

im gonna try restarting the client

smoky anchor
#

sounds like a client bug to me

young knoll
#

That means you have to have something constantly giving you those effects

lost matrix
#

Do you listen to the potion change event?

young knoll
#

Or your client is really fucked

umbral ridge
#

its minecrafts client

#

XD

young knoll
#

Because if they were client side relogging would have fixed it

lost matrix
# umbral ridge XD

Do you listen to the PotionEffectChangeEvent or have a scheduled task?

umbral ridge
lost matrix
#

Code pls

umbral ridge
#

I wish I could I changed some things since then but that's basically it what I have right now

young knoll
#

You are cancelling the event

lost matrix
#

Well. Always cancelling means you never lose them

young knoll
#

That also cancels effects expiring

umbral ridge
#

also by default, what are the values of absorption? in these two fields?

young knoll
#

Not ambient yes particles

#

so false true

naive jolt
#

I'm fairly new to Spigot but the programmer in me does not enjoy this, like this is only 10 commands is there no better way?

```@Override
public void onEnable() {
    // Plugin startup logic

    //Commands
    this.getCommand("ExampleCommand").setExecutor(new AbilityCommand());
    this.getCommand("ExampleCommand").setExecutor(new AbilityCommand());
    this.getCommand("ExampleCommand").setExecutor(new AbilityCommand());
    this.getCommand("ExampleCommand").setExecutor(new AbilityCommand());
    this.getCommand("ExampleCommand").setExecutor(new AbilityCommand());
    this.getCommand("ExampleCommand").setExecutor(new AbilityCommand());
    this.getCommand("ExampleCommand").setExecutor(new AbilityCommand());
    this.getCommand("ExampleCommand").setExecutor(new AbilityCommand());
    this.getCommand("ExampleCommand").setExecutor(new AbilityCommand());
    this.getCommand("ExampleCommand").setExecutor(new AbilityCommand());
}```
young knoll
#

Command framework

#

Or some kind of loop

naive jolt
#

Hm?

#

Do you have a place/website you can refer me to?

young knoll
#

You could create a Map<String, Supplier<CommandExecutor>> to loop through

#

Or you could just use a framework like ACF/Cloud

lost matrix
naive jolt
#

Okay I'll look into the frameworks thank you all

umbral ridge
#

Ok I dont understand. When I eat the golden apple, it works - no potion effect is removed, but when I eat the enchanted one, it doesn't remove the effect and it doesn't set it to absorption 1, it stays at default..?

young knoll
#

Add some debug lines

#

Also I doubt the removePotionEffect in that event works

#

Since the event is called before the effect is applied to the player

umbral ridge
young knoll
#

Just cancel the event

umbral ridge
#

okok

young knoll
#

But only when you actually need to

umbral ridge
#

I'm not cancelling the event anywhere

umbral ridge
#

nvm

#

it was equals issue

wet breach
#

some consider it as part of comments

umbral ridge
#

should have put equals when comparing objects

young knoll
#

I mean, the header is a comment

#

I just never use it

bronze crystal
#

yeah I am you are right

#

But i means comment in the files

#

not on top or on the bottom

young knoll
#

I sent the 2 methods for that

bronze crystal
#

yeah I know I see it

#

I will try these methods, thank you

crimson path
#

Hello all. Im setting upp a whaterfall/spigot network and want to make a portal to move between my lobby word and other servers on my network (and back again to the lobby world). I have tried to google this some time now but I only get instructions on how to use citizens for that. I want an old fashion portal for this. Do I need a plugin for that?

young knoll
#

Yes

crimson path
#

@young knoll Ah. I see... Can you point me to a good tutorlial on what and how?

crimson path
#

@young knoll Thank you so much!

grim hound
#

why am I getting CancelledPacketHandleException?

#

whenever the player leaves

#

I really don

#

't know what's causing it

storm raven
#

Hello, I have a questio, can you create craft on we plugin ?

wet breach
grim hound
#

they're synonyms

storm raven
wet breach
#

its depends how the quit happens

young knoll
#

Yes a plugin can create crafting recipes

grim hound
wet breach
#

if you don't exit the normal way, it won't send the packet, so you just get an exception and that is how you also know the player left 🙂

#

its normal

storm raven
grim hound
#

I don't think so

young knoll
#

Bukkit.addRecipe

storm raven
grim hound
wet breach
grim hound
wet breach
#

whatever tasks AlixSystem is generating lol

grim hound
#

what I meant is

#

what exactly does this error mean?

#

trying to send a packet to a player that's offline?

wet breach
#

need to sync back for some things

#

like, player quiting for example

grim hound
#

so why would sending them asynchronously be a problem?

wet breach
#

they still at some point have to sync back to main thread, they are not autonomous

grim hound
#

so wait

#

what exactly is the problem?

#

Sending async packets is fine as long as he doesn't quit?

wet breach
#

the problem is the main thread sees the player left, the thread where the packet is being sent from doesn't see this and tries to send a packet to a connection that doesn't exist anymore

grim hound
#

can I just check for Channel#isClosed?

wet breach
#

possibly

#

but as I said, at some point you have to come back to main thread to check things

umbral ridge
#

how to get player maximum food level

#

is it constant? is it possible to change it? like health

young knoll
#

It's just 20

#

Yes it's constant

umbral ridge
#

Ok VERyniceE

wooden hearth
#

for development is it better to use the latest version?

wooden hearth
wet breach
grim hound
#

it's easier to use the newest versions

#

if that is what he meant by better

wet breach
#

but then you can't complain about not having certain features though

wooden hearth
#

Nah, I'm making a plugin and I was wondering if it's better to use the latest version

wet breach
#

typically you should keep your dependencies updated whenever possible

wooden hearth
#

ofc but if I'm selling the plugin it should support most versions right?

icy beacon
#

You can sell a plugin that supports only the latest version. Though you'll lose potential buyers

river oracle
twin venture
river oracle
glad prawn
#

1.7.10

wooden hearth
#

Alright thank you

wet breach
wooden hearth
#

I use 1.8 atm hahha

river oracle
wet breach
#

if you want a good range, generally supporting the most recent 3 versions is typically sufficient

#

that will yield, on average over half the server population

eternal oxide
#

I support back to 1.8 but I require Java 11+

#

well my older plugins do

#

newer (private) are always for current version only

dull goblet
#

If I am making a custom plugin, how can i let my client test it on their own server without them being able to steal it afterwards without paying?

rotund ravine
#

Don’t

#

Require some form of payment / deposit before you start

dull goblet
#

I work through fiverr

quaint mantle
#

Or alternatively you could just record you testing it how they want and forward them the video

eternal oxide
#

you allow them to "test" it on your server.

eternal night
#

yea, would also suggest just inviting them to a server you control

eternal oxide
#

when they are happy they pay and you give them teh plugin

umbral ridge
#

how do you open player's enderchest

#

so that they can edit it also

icy beacon
#

I assume player.openInventory(player.getEnderChest())

umbral ridge
#

but can they edit it?

#

will it save?

icy beacon
#

That's why I said "I assume"

#

That's all I could find

#

Not sure about the details

#

?tas

undone axleBOT
umbral ridge
#

I asked because you suggested it

#

i shall try it :D

#

works!

slender elbow
#

yeah

icy beacon
upper hazel
#

who knows how to block the worldguard event with your own event (when breaking a block, it is necessary that, despite the cancel, it can break a certain block)

river oracle
icy beacon
river oracle
#

you can be a real naughty boy and do changes on EventPriority Monitor

eternal oxide
#

No^

upper hazel
river oracle
#

or just uninstall world guard if you're going to ignore it

eternal oxide
#

If you want to bypass WG protection and break a block just do it yourself 1 tick later in your own code so you have no event

river oracle
#

that's probably the simplest solution

upper hazel
#

if so, how do dev create custom flags if worldguard blocks any events?

river oracle
#

why use world guard if you're going to ignore it?

#

if you want to ignore it, why not just do what ElgarL said

upper hazel
#

I want to make it so that you can place a certain block in a certain region, but so that in this region an ordinary player can only break his placed block

#

so this mean need block protect region flag

eternal oxide
#

Then manage all your own placement/break when in that region

upper hazel
#

and do exception

#

what?

elfin atlas
#

Does someone know why I'm getting this error: https://hastebin.com/share/licovebeza.ruby
Version 1.20.1
And I'm using rmapped-mojang obfucations

remote swallow
#

you probably arent remapping

#

?nms

icy beacon
#

?nocode

undone axleBOT
#

It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.

elfin atlas
fathom oak
#

hello how can i put maybe with discordsrv a channel that gets being updated with the amount of players that are connected somthing like 8/24 players on

elfin atlas
pine sandal
#

When I get a StructureSearchResult what is the Location relative to? Like is it a corner of the structure, the center or something else.

young knoll
#

It's the same one you get with /locate afaik

#

Which i think is just whatever part of the structure it hits first?

pine sandal
#

hm. Still trying to figure out a good way to find a structure in a chunk to check if a player is inside its BB without having to use NMS or record all this information during world gen. (Since then I can only find them generated after my plugin is installed)

elfin atlas
#

Hey now I'm getting a new error when creating a Custom Mob
Error: https://hastebin.com/share/esocomonur.ruby
Code

public class Mice extends Silverfish {
    public Mice(Location loc, Location point) {
        super(EntityType.SILVERFISH, ((CraftWorld) Bukkit.getWorld("world")).getHandle());
        this.setNoAi(true);
        this.setPosRaw(loc.getX(), loc.getY(), loc.getZ());
        this.goalSelector.addGoal(1, new MicePathfindingGoal(this, point.getX(), point.getY(), point.getZ()));
        ((CraftWorld) Bukkit.getWorld("world")).getHandle().addFreshEntity(this, CreatureSpawnEvent.SpawnReason.CUSTOM);
    }
}

Spawn code:

  new Mice(new Location(Bukkit.getWorld("world"), 9, -11, 526), new Location(Bukkit.getWorld("world"), -3, -11, 526));
echo basalt
young knoll
echo basalt
#

no clue about the others

#

Might just be where the structure is "spawned" so it might depend on each structure

#

unless someone at mojank has standards

young knoll
#

Treasure chests are a single block

#

Not much room for variance there :p

pine sandal
#

I am starting to think about exploring reading the MCA files directly to discover existing structures on first run then just hook the structure gen event.

echo basalt
#

also there's no Y level in that findStructure thing

echo basalt
#

but try recompiling your plugin

elfin atlas
#

Okay

lost matrix
meager wolf
#

is it possible to make a custom potion effect with a custom picture ?

river oracle
echo basalt
#

while it is bad practice it still shouldn't crash the jvm

young knoll
#

Best you can do is override ones that aren’t used

river oracle
meager wolf
#

im using that

lost matrix
elfin atlas
echo basalt
#

I'm also seeing paper

lost matrix
pine sandal
#

I have learned to test my plugins on paper after my normal testing. Because something their versions of stuff acts in funny weird ways.

elfin atlas
young knoll
#

Add the entity using the instance you create

#

Register the goals by override the method mentioned earlier

lost matrix
#

You register the goals by overwriting the registerGoals method and you add the entitiy
after it is fully constructed.
But more importantly: Plugman into the trash and dont touch the reload command.

timid hedge
#

Does anyone know how i fix this error in mcp?
When i am trying to launch it says: Unrecognized options: -Xincgc

remote swallow
#

oh no

lost matrix
timid hedge
#

The client isnt, but it is for an older verison

lost matrix
#

Are you on eclipse or intellij?

timid hedge
#

I want to use intellij but i feel like if i use intellij i am getting some errors im not getting in eclipse, so therefor i am using eclipse

lost matrix
#

Alright then go into your run configurations and check in the arguments if you have this jvm flag enabled.
If so, remove it.

timid hedge
#

where should the jvm falg be?

lost matrix
timid hedge
#

Wait i think i found the error, at arguments it says "-Xincgc -Xmx1024M -Xms1024M", what should i change it to if it isnt correct?

timid hedge
lost matrix
#

Why not?

timid hedge
#

Becuase you run a decompile.bat and there will be created a folder with minecraft server and client that you can use

timid hedge
lost matrix
#

Those are already there

pine sandal
#

Why are you asking questions about MCP on the Discord for Spigot / Bungeecord stuff? Just asking.

timid hedge
#

If i use this: -Xmx1024M -Xms1024M
It says:
Error: could not find or load main class Start
Casued by: java.lang.ClassNotFOundExeption: Start

timid hedge
lost matrix
#

Well, then the jar is broken

timid hedge
#

Oh thanks, i will restart it and see if it works, thanks for the help

pine sandal
#

Not sure why your even using MCP, its very old and there are a lot better methods.

shadow night
#

there are alternatives to mcp?

chrome beacon
#

Just use Mixins or smth

#

There's no need for MCP

pine sandal
#

And if you just want to explore the source code there are many many options now.

thin iris
#

does every plugin automatically get a folder like this?

dull goblet
#

no only when you want to create a file

thin iris
#

so do i have to make one

lost matrix
#

Only if they create it or save the default config file

thin iris
#

well its not config more of like

#

csv files

dull goblet
#

yeah you're gonna have to create it

thin iris
#

should this work?

#
private void makeDataFolder() {
        File file = new File(Main.main.getDataFolder() + "/TranslationsX");
        if (!file.exists()) {
            file.mkdir();
        }
    }
dull goblet
#

i would use #getDataFolder()

#

don't hardcode it

young knoll
#

^

thin iris
#

like that?

tranquil dome
#

Since plugins are single threaded is there any advantage to using sql over sqlite?

dull goblet
#

without the + "/TranslationsX"

#

thats already included in getdatafolder

young knoll
#

And you very much should regardless of which sql type you are using

tranquil dome
#

Wouldn't multithreading break stuff? Iirc I had to use bukkitrunnables because other threads interfered with the main thread.

young knoll
#

Using other threads is fine as long as you do it properly

tranquil dome
#

But in case of multithreading, it could cause concurrent modifications for sqlite, so I should use sql?

young knoll
#

It should be fine

#

Presumably the other threads would just block while the database is locked

eternal oxide
#

sqlite is not thread safe,last I looked

#

you have to queue

young knoll
#

Huh

#

I’ve never encountered an issue, but maybe HikariCP is just handling it for me

dull goblet
#

isn't that in most db that it waits for one instruction before executing the next?

young knoll
#

Concurrent reads should be fine

dull goblet
#

yesa

young knoll
#

And I figured writes would just block

dull goblet
#

as it should

eternal oxide
#

looks like default is thread safe (Serialized)

young knoll
#

Nice

slender elbow
#

i wonder if the jdbc wrapper honours the defaults

#

wtf the github repo is gone?

#

github down as usual

thin iris
#

is github down

#

lol

#

oop

chrome beacon
#

Who pushed untested changes to prod

#

xd

silent slate
#

Hi, ive searched everywhere how to customize the tablist with headers and footers and how to customize the name of the players.
Ive only found this for header and footer:

player.setPlayerListHeader("");
player.setPlayerListFooter("");

Both of them are in my player join event but they dont work. Any alternatives around?

young knoll
#

Wdym they don’t work

hazy parrot
#

Stackoverflow seems to be down too lol

young knoll
#

You are setting them to “” which is nothing

#

Which is the default

silent slate
#

yeah ik

#

i set it to test

#

this wa sjust a bare bones function

quaint mantle
#

from this

#

to this

#

what's the point of that

chrome beacon
#

Thread safety

ivory sleet
#

first one is thread safe

rotund ravine
#

Ahaha looks like a kotlin object

ivory sleet
#

important esp if that singleton is accessed concurrently in multiple threads

quaint mantle
#

for the second one

rotund ravine
#

Companion object 💪🏻

quaint mantle
rotund ravine
#

It’s pretty much the same thing

tranquil dome
#

Does anyone have a source for making custom guis? I've seen it on some servers but I'm not sure what to look for.

rotund ravine
#

Setting it in a holder class will just create the object the first time that class is done smth with explained simply

young knoll
#

If you mean fancy textures

#

They either use items with custom model data

#

Or a custom font in the inventory name

slate tinsel
quaint mantle
#

so that static class doesn't exist until it's used?

eternal night
#

it isn't loaded

slender elbow
grim hound
eternal night
#

the second one just uses JVM unique initialization lock for class loading

rotund ravine
young knoll
#

For what it’s worth

eternal night
#

for what its worth

ivory sleet
rotund ravine
#

I see

#

And

#

Did she miss a verb in her message

quaint mantle
#

uh

#

ima just do the first one

rotund ravine
#

Sry

#

Adjective

quaint mantle
#

not gonna do something I dont understand

eternal night
#

Just do the second one kekwhyper

quaint mantle
#

nah

young knoll
#

“Second one is too for what it’s worth”

ivory sleet
#

enum singleton :>

young knoll
#

Seems fine to me

rotund ravine
#

Ohh

#

In regards to threadsafe

#

Didn’t see the reply

quaint mantle
ivory sleet
#

sorta the point of it

grim hound
#

wait no

ivory sleet
#

i think the second one is a bit nicer since u dont need to null check every time

grim hound
quaint mantle
#

yeah but

rotund ravine
#

Both are correct, one just looks nicer, and less complex

thin iris
#

githubs back

quaint mantle
#

idk

grim hound
quaint mantle
#

how that

#

second one works

rotund ravine
#

Yes it does

grim hound
quaint mantle
#

ok well idk why it works

grim hound
#

and the first one looks like you just had a stroke

quaint mantle
#

but atleast ik what it does

#

it makes sense to me

grim hound
#

or read some code on stack overflow and got scared

tranquil dome
chrome beacon
#

First one has explicit thread safety

grim hound
chrome beacon
#

second one is fine too

chrome beacon
grim hound
rotund ravine
grim hound
#

on multi-thread environments

rotund ravine
thin iris
#

hi im tryna use opencsv in my bot but get this error, is there a way to fix this https://hastebin.com/share/isipitoqar.less

young knoll
#

Lol

grim hound
#

Take Math.random() for example

young knoll
quaint mantle
rotund ravine
#

Mhm

tranquil dome
grim hound
#

there's absolutely no reason

grim hound
young knoll
quaint mantle
grim hound
quaint mantle
#

nope

tranquil dome
#

Alright, I'll have a look. Thank you

grim hound
#

't really care what you think

#

you wanna code like this I don't care, your choice

#

It's unnecessary

rotund ravine
grim hound
#

and looks like shit

grim hound
quaint mantle
rotund ravine
#

Then leave kindly thank you.

grim hound
#

you're bullshitting

rotund ravine
#

Just ignore him

pine sandal
#

^

grim hound
#

ok

young knoll
#

My girlfriend is also a secret

rotund ravine
#

@young knoll Coll.. keeping ur relationship a secret from her friends and parents isn’t a healthy seceret

ivory sleet
young knoll
#

Lol since never

#

I was making a joke

ivory sleet
#

😭

#

getting my hopes up

rotund ravine
#

Girlfriends can be so much work

#

Get a low maintenance girl when you go for it

thin iris
#

very helpful thank you

rotund ravine
#

Ahahaha

thin iris
#

can i get a bit more context

rotund ravine
#

@young knoll look at this

#

Look it up in relation to gradle or maven

#

Whichever tool you use

thin iris
#

am very confused

rotund ravine
#

?

young knoll
#

You either want maven shade plugin

#

Or gradle shadowJar plugin

thin iris
#

im using maven

young knoll
#

Then yeah check out the maven shade plugin

thin iris
#

like intellij plugin?

chrome beacon
#

maven plugin

rotund ravine
#

It’s for ur build tool

thin iris
#

errr what

#

oh

rotund ravine
#

?shading

thin iris
#

is that all?

rotund ravine
#

Pretty much

thin iris
#

so if i pasted that in it will work

rotund ravine
#

Idk

chrome beacon
#

Don't just paste it in

#

do make sure to modify the relocations

thin iris
#

so do i put opencsv in there?

#

in teh reloatcaiton

chrome beacon
#

relocate it to somewhere inside of your plugin package

thin iris
#

huhh

rotund ravine
#

Inside ur own package

thin iris
#

like org.transl.translationsx ?

rotund ravine
#

Ye

thin iris
rotund ravine
#

No

thin iris
#

errr

rotund ravine
#

@chrome beacon looks super wrong to me

#

I am a gradle user tho

chrome beacon
#

Yeah

#

You want to move the dependency to inside your package

#

Not move your package to your package

thin iris
#

how do i do that

rotund ravine
#

Getting off explaining by saying I am a gradle user is nice

chrome beacon
#

pattern is the the package pattern of the dependency

#

shadedPattern is the package pattern of the where the shaded dependency will be

#

include and exclude should be self explanatory

thin iris
#

i dont hav ean include

rotund ravine
#

Just ignore it then

chrome beacon
#

You could have one if you want to but ^^

thin iris
#

so like this?

chrome beacon
#

no

#

Why do you want to move opencsv to opencsv

thin iris
#

oh

chrome beacon
#

You need to move opencsv to your plugin package

thin iris
rotund ravine
#

Pattern = before
Shaded pattern = after yeees

thin iris
#

can i remove <excludes>

chrome beacon
thin iris
#

and this looks right?

rotund ravine
#

Suure

thin iris
#

am i able to use clean package install as maven cmd line

rotund ravine
#

Yes

chrome beacon
# thin iris

to make it clear what the dependency is I recommend org.transl.translationsx.shaded.opencsv

thin iris
#

do i have to maek that package

#

or can i just say it there

chrome beacon
#

You can just tell it to put it there

thin iris
#

do i use the -shaded jar

chrome beacon
#

No just use the regular one

#

The one without a suffix

thin iris
chrome beacon
#

middle one

thin iris
#

alr

#

lol it went up by 78000 kb

chrome beacon
#

Yeah that's one large lib

rotund ravine
#

Big boy

thin iris
#

if this doesnt work i cry

rotund ravine
#

It will probably break in a second cause the lib uses some dumb native code thst doesn’t like relocation

thin iris
#

oof

#

i have to submit this in 2 1/2 hours

rotund ravine
#

Is this a spigot plugin?

thin iris
#

a discord bot

fathom oak
#

hello how can i put maybe with discordsrv a channel that gets being updated with the amount of players that are connected somthing like 8/24 players on

thin iris
#

for the discord hackathon

rotund ravine
#

Oh

rotund ravine
rotund ravine
fathom oak
#

but, there isnt a plugin?

rotund ravine
#

Ask there thank you

thin iris
#

i get this now lol

chrome beacon
#

oh if it's a discord bot you don't need to relocate

fathom oak
#

i did 5 hours ago, no answer, is why im asking here

thin iris
chrome beacon
thin iris
#

so then

#

wait huh

#

so then what do i do

rotund ravine
#

Gotta add spme exclude stuff

chrome beacon
#

wait that error shows it's a plugin

#

??

fathom oak
#
  • info please
thin iris
#

yeah im using it as a bungeecord plugin?

fathom oak
chrome beacon
#

Then keep relocation

thin iris
chrome beacon
#

so open csv is signed it looks like

peak depot
#

anyone know what packets I need to change a players skin?

chrome beacon
# chrome beacon so open csv is signed it looks like

you should be able to strip the signature with a filter

               <filters>
                    <filter>
                        <artifact>*:*</artifact>
                        <excludes>
                            <exclude>META-INF/*.SF</exclude>
                            <exclude>META-INF/*.DSA</exclude>
                            <exclude>META-INF/*.RSA</exclude>
                        </excludes>
                    </filter>
                </filters>

Put that in shade config ^^

rotund ravine
quaint mantle
#

hi

#

i need help with database

rotund ravine
#

?ask

undone axleBOT
#

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

quaint mantle
#

code : ```java
package pl.playgroundhc.survival.commands.tests;

import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;

import java.sql.*;

public class dbtest implements CommandExecutor {
@Override
public boolean onCommand(@NotNull CommandSender commandSender, @NotNull Command command, @NotNull String s, @NotNull String[] strings) {

    if (command.getName().equalsIgnoreCase("dbtest")){
        String url = "jdbc:mysql:mysql.titanaxe.com:3306/srv272320";
        String uname = "srv272320";
        String pass = "pass";
        Player p = (Player) commandSender;
        try {
            Connection connection = DriverManager.getConnection(url,uname,pass);
            Statement statement = connection.createStatement();
            statement.execute("INSERT INTO deathtable (uuid, deaths) VALUES (?, ?)" + p.getUniqueId() + 1);


            connection.close();
        } catch (SQLException e) {
            throw new RuntimeException(e);
        }
    }
    return false;
}

}```

chrome beacon
#

oh no async database

#

and a new connection every time

quaint mantle
#

yes

chrome beacon
#

and string concat in SQL Query 💀

young knoll
#

Oofers

quaint mantle
#

ok, but why it not work?

chrome beacon
#

?notworking

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.

hushed spindle
#

am i stupid (yes) or what am i missing, how can a list have something one line and then nothing the next?

chrome beacon
#

is pool.getPredicates() == predicates

#

by any chance

thin iris
#

is that eclipse dark theme

hushed spindle
#

yuh

thin iris
#

best theme to ever be created

#

ever

hushed spindle
#

hold on yeah lemme check that lol

#

huh well yeah it is damn

rotund ravine
#

Make it a nonmutable list when passed

#

Easy

chrome beacon
#

Clearing and then adding it back again is a pointless operation

hushed spindle
#

yeah i know

#

removed all that

quaint mantle
thin iris
#

there you have it

quaint mantle
#

?

slender elbow
#

jdbc:mysql://

#

etc

dry hazel
#

you're also concating bs to the sql statement

quaint mantle
#

ok

#

thanks

#

now i know how to fix it

meager wolf
#

how do u guys store data needed by plugin?

young knoll
#

What kind of data

#

You can use yaml, json, sql, pdc, etc

rotund ravine
#

Depends on my needs tbh

meager wolf
#

i want to save how many times a player have used ability