#help-development

1 messages · Page 518 of 1

ivory sleet
#

oh really?

#

thats smart

#

even w/o atomic (copy option)?

quiet ice
#

Yeah, why would it not be?

ivory sleet
#

just making sure, alr ty ty :)

quaint mantle
#

Is there a way to make a player break blocks normally while in water in 1.16.5?

fossil lily
#

But yes if you do it with packets right

glossy venture
#

is bukkit tab completion asynchronous?

#

like from TabExecutor

quiet ice
#

I don't think so

tardy delta
#

nope

pseudo hazel
quaint mantle
quaint mantle
fossil lily
#

maybe there is an easier way but thats what I think of

#

conduit power also allows it for an easy way

rough drift
#

@fossil lily you can also cancel the block break progress, so that you can then edit it server side to make it look normal

quaint mantle
#

ok thanks

quaint mantle
#

i may make it so if its 50% just break it naturally

#

but i cannot find any events for "block break progress"

#

should i use interact or something?

#

oh blockdamageevent

fossil lily
#

yea

fossil lily
#

If you want it to be perfect override the break events and send your own break packets

quaint mantle
#

well BlockDamageEvent only fires when i first touch it. so i'll just drop it

eternal oxide
#

there is a BlockDamageEvent and a BlockDamageAbortEvent

#

start on teh blockDamage event and stop if you get an abort

quaint mantle
#

which version is this? I cant see it on my editor

#

it seems to be valid javadocs 1.19.4 but

cobalt thorn
#

Hi is possible to inizialize something from a static, i need this so i can make a code for my dependency Manager

Code: https://sourceb.in/Rep9nhBXFN

hazy parrot
#

what

#

im not sure i understand what are you trying to do

river oracle
#

Uhm just use proper singleton pattern

#

You don't need a static constructor here

cobalt thorn
quaint mantle
#

i have a problem with this code https://paste.md-5.net/moputurigi.java i have errors like "Method does not override method from its superclass" "Class 'Chatnike' is never used" and "Method 'onPlayerJoin(org.bukkit.entity.Player)' is never used" what i do wrong>

remote swallow
#

because thats not a valid event listener, the class chatnike can be ignored, and the onPlayerJoin loops back to explanation 1

quaint mantle
#

soo what i need to do

remote swallow
#

?events-api

#

?eventapi

undone axleBOT
remote swallow
#

follow that

flat lark
round finch
#

No implements Listener

#

that is player object not event

#

plus you need

getServer().getPluginManager().registerEvents(this, this) in enable

remote swallow
#

?spoon smh

undone axleBOT
#

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

round finch
#

🥄

round finch
#

this is just fun

#

?docs

remote swallow
round finch
#

🥄 feed me math

#

those 3d shapes is hard

remote swallow
#

how

round finch
#

😂

remote swallow
#

if its not a square or rectangle

#

its hard, those are ez

quiet ice
#

well circles are easy too - usually

remote swallow
#

circles are ez, spheres not

quiet ice
#

Displaying spheres is tricky - yes. But everything else is easy

round finch
#

Dodecahedron?

#

with rotation

#

z and y axies

remote swallow
#

well do you want to build a 3d cone with a sphere on top

round finch
#

what i believe i gotta master algebra first hmmm

#

pain

remote swallow
#

but could you make a hexatriacontagon

round finch
remote swallow
#

footbol

eternal oxide
#

dodecahaedron

round finch
#

sh...
this word is even longer Dodecahedron-Icosahedron

#

stellation of icosidodecahedron

#

💀

remote swallow
#

hexatriacontahedron

quiet ice
#

Why not just call it Polygon?

remote swallow
#

fun

round finch
#

this is what i used as inputs

generateDodecahedron(World world, Location center, int width, int height, int depth, Material material, double rotationY, double rotationZ) {} ```
#

but chatgpt can't do shet right

quaint mantle
#

again i have a problem lol (sorry) https://paste.md-5.net/owobayiyaj.java
errors:


Variable 'fadeIn' is never used

Variable 'stay' is never used

Variable 'fadeOut' is never used

'sendTitle(java.lang.String, java.lang.String)' is deprecated```
remote swallow
#

those arent errors just warnings, first 4 are self expanatory, the 5th means you shouldnt use it

quaint mantle
#

so it won't change anything and I can use the plugin normally?

remote swallow
#

you can, but i would recommend fixing the deprecation

quaint mantle
ornate patio
#

How can I make players keep their levels on death but not inventory

remote swallow
ornate patio
#

oh i didnt know that method existed

worldly ingot
#

They just need permissions for it lol

#

Great addition, poor execution

remote swallow
worldly ingot
#

Don't think so

#

Hard to do that

slim wigeon
#

I got this server shop plugin and because my shops contains near a double chest per group, I just created a batch file that combines all these files to one yml file. But my goal now, is to find a way to load all these files so I can delete the batch file. "dir *.yml /b" example. Is there something in bukkit api that I can use for this or its only pure java?

quiet ice
#

I am not even sure who would own markdown

remote swallow
slim wigeon
#

I know I need to use bukkit to load them. I just asking a way to "dir *.yml /b" but in java. Thanks, I can just do a simple search for the code if that is the case. I asking here as there might be someone that did this before

cloud walrus
#

Is there a way to disguise mobs as player models without using libs disguise?

#

i dont need code right now i just need to know, im learning java 1st

remote swallow
cloud walrus
cloud walrus
slim wigeon
# cloud walrus ye

I have a playlist I watched for learning Java, its old but it will work

remote swallow
slim wigeon
cloud walrus
#

and yea sure

slim wigeon
# cloud walrus oh i use a website

Just to tell you, I been learning Java more while programming plugins but please see how Java works or you be thinking "What the f*** am I looking at?!

tardy delta
#

mmh

cloud walrus
#

although

slim wigeon
#

bungeecord

cloud walrus
#

public class Raaa {
public static void main(String[] args){
}
]

remote swallow
#

you just create a tmux "instance" or whatever and just start the server like normal, if you want you should use a panel like ptero or crafty

cloud walrus
#

never understood that

tardy delta
#

thats a main method

remote swallow
#

out of spigot thats how java apps start

cloud walrus
#

public static void main(String[] args){
}

#

mainly this mb if not specified

remote swallow
#

yeah thats the main method

tardy delta
#

might want to figure out what all of those words mean

cloud walrus
#

i used to work in python and javascript so this confuses me

remote swallow
#

when you start a jar that gets called

tardy delta
#

in python its def main or __main__ i forgot

#

not really an entrypoint in js

cloud walrus
#

basically a function right

tardy delta
#

yes

remote swallow
#

yeah

cloud walrus
#

whats void for btw

remote swallow
#

its the return tyype

#

void means no return type

cloud walrus
#

oo

tardy delta
#

oh man coming from a untyped lang

cloud walrus
#

lol

tardy delta
#

python has types too but ig you didnt write them

rough ibex
#

typing is optional

#

but you can definitely run type checking analysis with mypy

cloud walrus
#

wait wait wait

cloud walrus
#

as its a function

remote swallow
#

public boolean isSomeThingTrue() {
    return true;
}
// boolean return type

public String getString() {
    return string;
    // OR
    return "epic cool string";
}
// String return type
``` for example
quaint mantle
remote swallow
tardy delta
#

yes but thats not what you should do cuz that starts your program, kinda weird to do that twice no

cloud walrus
rough ibex
#

why would you

remote swallow
#

yeah, its constructors

cloud walrus
#

but for like all files in a folder or smth

undone axleBOT
cloud walrus
#

forming a circle

remote swallow
rough ibex
#

cool

cloud walrus
#

hold on

remote swallow
remote swallow
#

give me a few moments

cloud walrus
#

alr

remote swallow
remote swallow
cloud walrus
remote swallow
#

they use the same concept just starting them is how its different

cloud walrus
#

maybe once ill learn more into java ill find a way for spigot

quaint mantle
rough ibex
#

show code

quaint mantle
remote swallow
# cloud walrus ig the java example


public class Main {

    public static void main(String[] args) {
        System.out.println("My Java Application started");
        new ExampleClass();
        new ExampleClassConstructor("Example");
        ExampleClassMethods exampleClassMethod = new ExampleClassMethods();
        exampleClassMethod.example();
        new StaticClassExample();
    }
}


public class ExampleClass {

    public ExampleClass() {
        System.out.println("Example constructor ran");
    }
}

public class ExampleClassConstructor{

    public ExampleClassConstructor(String message) {
        System.out.println("Example constructor ran with string: " + message);
    }
}

public class ExampleClassMethods {

    public void example() {
        System.out.println("example method ran!");
    }
}

public class StaticClassExample {
    
      public static void exampleStatic() {
          System.out.println("Example static method");
      }
}
``` each of those gets its own file, theres a lot for you to learn about this too, abstract classes, interfaces, enums , when to and not to use static
cloud walrus
#

god damn

#

i did not expect it to be this big

remote swallow
#

dont question the formatting

#

i couldnt be arsed to open ij

cloud walrus
#

lol dw

rough ibex
#

note these classes would be in different files

remote swallow
#

^^

rough ibex
#

since you cannot have more than 1 public class per .java file

cloud walrus
#

oo

#

wait why

rough ibex
#

it's complicated

#

you don't need to know why yet

#

it just is

#

java is quirky like that hehe

cloud walrus
#

aaa

#

i wanna multiple public class D:

remote swallow
#

and also for when you get into spigot never call the main class Main, call it what your plugin is called and the public static void main String args wont work

cloud walrus
#

hold on imma try the code

quaint mantle
remote swallow
#

what version are you on

quaint mantle
#

version of?

remote swallow
#

spigot api

quaint mantle
#

1.8.8

remote swallow
#

makes sense, you can go back to the sendTitle

#

(string, string)

quaint mantle
remote swallow
#

if you want it in chat yeah

quaint mantle
#

but i dont want XD

remote swallow
#

use the player.sendTitle("", powitanie); again

tender shard
#

powitanie whut

remote swallow
#

is polish

quaint mantle
#

im from poland if u ask what is "powitanie" XD

tender shard
#

lol ok

quaint mantle
#

it is something like a welcome

tender shard
#

yeah I already googled haha

quaint mantle
#

hey we're trying to make a plugin that places a block in a random location in a area when a player is standing on a certain block. How can we get that blocks x y and z so we can add the random number to it

tender shard
#

my last name is polish too iirc but I got no clue what it means lol

quaint mantle
#

?

remote swallow
#

do you want the message big or small

quaint mantle
#

big

#

oh

remote swallow
#

do you want a subtitle

quaint mantle
#

I think I need to remove the subtitle

quaint mantle
remote swallow
vast ledge
remote swallow
#

you can use vectors for that

vast ledge
#

i dont like vectors

#

but if he wants to use em he will have to ask u 😄

tender shard
#

somebody once told me it's polish, idk

quaint mantle
#

it is polish woman name

remote swallow
#

the k is in it

#

not a typo

quaint mantle
# remote swallow correct then

'sendTitle(java.lang.String, java.lang.String)' in 'org.bukkit.entity.Player' cannot be applied to '(java.lang.String)' 🥲 🔫

remote swallow
#

add an empty string to the 2nd param

#

player.sendTitle(powitanie, "");

analog snow
remote swallow
#

lul

vast ledge
remote swallow
#

add getBlock() to the end

vast ledge
#

i wrote that in discord xD

chrome beacon
remote swallow
vast ledge
chrome beacon
#

^^

chrome beacon
analog snow
#

its @quaint mantle fault

quaint mantle
#

ey

analog snow
#

xD

quaint mantle
vast ledge
#

?paste

undone axleBOT
vast ledge
vast ledge
quaint mantle
echo basalt
#

either I'm smooth brain or my IDE's playing a prank on me

vast ledge
remote swallow
echo basalt
#

I'm just trying to decode ps3 roms 😭

vast ledge
remote swallow
#

did you update the jar

#

and is there any errors in consol

analog snow
quaint mantle
#

'sendTitle(java.lang.String, java.lang.String)' is deprecated

#

Unused import statement

remote swallow
#

ignore them

#

its draft api

#

you have no other option

quaint mantle
#

how can i delete all certain blocks(sea lantern) in a area

#

area of 4 blocks

quaint mantle
strange rain
#

Whats a good way to 'trim' a list?

remote swallow
quaint mantle
strange rain
quaint mantle
# remote swallow check console for errors

`[INFO] [chatnike] Enabling chatnike v1.0-SNAPSHOT

[INFO] [chatnike] Chatnike plugin has been enabled.

[INFO] Server permissions file permissions.yml is empty, ignoring it

[INFO] Done (2.937s)! For help, type "help" or "?"

[INFO] Starting GS4 status listener

[INFO] Query running on 0.0.0.0:41866

[INFO] Witaj na serwerze gildii Nike!`

sullen marlin
#

Loop every block, check type, set to air

remote swallow
river oracle
#

How does spigot handle Async events? For example AsyncPlayerChatEvent would it be okay to run a database call on this event without worrying about stalling the rest of chat or would this affect all chat flow

sullen marlin
#

Optionally add Chunk#contains for efficiency

remote swallow
tardy delta
strange rain
river oracle
tardy delta
#

atleast thats what i heard

#

could check event.isAsync()

vast ledge
#

@sullen marlin Btw about the forums i wanted to create a wiki page, how do i get it approved?

grim oak
#

Hi im making custom guis for my server using fonts, but will bedrock players joining through geyser be ablw to see the custom guis?

sullen marlin
#

There's no approval

quaint mantle
# remote swallow you dont join the server here

[INFO] Vlero[/no] logged in with entity id 227 at ([world]26.937500362153934, 84.62228172322708, 263.40918453158463)

say §cServer§c.pro §b- §bFree §bGame §bHosting. §6Upgrade §6to §6remove §6ads.

[INFO] [Server] §cServer§c.pro §b- §bFree §bGame §bHosting. §6Upgrade §6to §6remove §6ads.

vast ledge
sullen marlin
#

Yes

vast ledge
#

Oki thanks 😄

remote swallow
#

do you have atleast 5 posts

quaint mantle
#

wtf

remote swallow
#

you open up mc, you join and see if theres a title

strange rain
#

Whats a good way to 'trim' a list? I mean like take this {'a','b','c','d','e','f'} to this {'c','d','e'}

remote swallow
#

if you cant do that i doubt you should be developing

quaint mantle
#

else

tardy delta
#

i had that message too

vast ledge
#

It does that automatical

quaint mantle
vast ledge
#

Its there advertising the only way they make money of otf the free versions

vast ledge
remote swallow
quaint mantle
#

ikik

quaint mantle
#

I wrote that after entering the server nothing is there

remote swallow
#

okay then, add debug statements

#

add debug statements

vast ledge
#

Facts

tall saffron
#

any good tablist tutorial_

#

??

quaint mantle
vast ledge
#

use ?pastebin

remote swallow
#

then you can figure out what the error is

tardy delta
tall saffron
vast ledge
#

yes

#

?links

tardy delta
#

?jds

vast ledge
#

?link

#

heh

#

whats the command

tardy delta
#

i forgot link

quaint mantle
tall saffron
#

cant seem to find it

slim wigeon
vast ledge
remote swallow
#

you add a weight to the files then

#

or specify the path like that

quaint mantle
remote swallow
#

thats a build log

#

you need to add sysouts to your code

quaint mantle
#

How to do that bc im idiot and im learning java for First week XD

echo basalt
#

I'm struggling with the most basic task ever

remote swallow
#

?learnjava

undone axleBOT
remote swallow
#

(for @quaint mantle )

tardy delta
echo basalt
#

we're getting somewhere

#

I just had to look in a hex viewer for once

#

before realizing I was reading unsigned data

slim wigeon
#

Changing my code again, how do I sort the list by a value (Order for example)?order: 3 name: §cRedstone icon: REDSTONE items: ...

tardy delta
#

list.sort(Integer::compare) or smth

#

or if your items are comparable, Collections.sort(list)

quaint mantle
tawdry echo
#

lol

slim wigeon
#

Can you show a example please? Its not the items I want to sort, its the groups its self. You see one group with order value of 3 which should go on slot 3

tardy delta
#

what list do you have

slim wigeon
#

What do you mean? I had the file names in a config.yml but I deleted it as I don't know how its going to work for my case

tardy delta
#

well figure out a way to get that order from the config

slim wigeon
#

You mean the order value, I know how. I just need a sort function example

tardy delta
#
List<Whatever> list = ...
list.sort((item1, item2) -> Integer.compare(item1.getOrder(), item2.getOrder()));```
indigo iron
#

whats the thing to paste code again

undone axleBOT
tardy delta
#

?paste

undone axleBOT
tardy delta
#

or -compare to sort the other way around

slim wigeon
#

You was quicker than me

slim wigeon
#

Thanks

#

I will test it

remote swallow
slim wigeon
#

The sort function works, they showing at the right slots

tall saffron
#

Does smone know why my IntelliJ isnt giving me suggestions, that is a public var that exists as i reference it on top and it works

#

it should like autocomplete with hasPapi

slim wigeon
tall saffron
tardy delta
tall saffron
#

Oh yeah i think i dont have java installed on my laptop

#

i think when i exported it

#

it told me to install a java and i click smth and changed smth to java 20 or smth like that

#

and since then i cant autocomplete

slim wigeon
tall saffron
tall saffron
slim wigeon
#

I don't know, still setting up

#

I will look at it when its done

tardy delta
#

rightclick on the java dir and mark as > sources root

#

or build the project and it will probably work

tall saffron
#

when i build it there inst any error

#

but the files are still the same

remote swallow
#

yeah right click the java package, near the bottom him mark directory as, then choose sources root

tall saffron
tardy delta
#

other folder

#

java

remote swallow
#

this java one

tall saffron
#

oh yeh

#

where does it say mark directory?

remote swallow
#

check the project has a jdk

#

file > project structure

fossil lily
#

oh boy that’s set up wrong

#

your entire project isn’t right

#

make sure the base folder is correct in structure

tall saffron
fossil lily
tall saffron
#

i am sorry but where is that 😦

fossil lily
#

Right below that

#

Look

tall saffron
#

oh yeah

fossil lily
#

Double click on simples at the top left, anything in there?

tall saffron
fossil lily
#

uh

remote swallow
#

thats fine

fossil lily
#

k

remote swallow
#

add a sources route probably

fossil lily
#

is the no content root thing?

#

yea

#

Add your content route to be the folder named java I think

tall saffron
#

oh wait

#

on dependecies

#

it had the proyect sdk

fossil lily
#

eh?

remote swallow
#

the add content root

tall saffron
#

here it had the proyect sdk, shoudnt it be the openjdk 20?

fossil lily
#

add a content root

remote swallow
#

change the module source

fossil lily
#

both java 20 shouldn’t matter

tall saffron
#

k

#

in the new module what do i put?

remote swallow
#

either the src folder or java folder

#

idk which it takes

fossil lily
#

I think it’s java

#

I forgor

tall saffron
#

k

#

now all my code is in red lol

fossil lily
#

😬

tall saffron
#

was it like this?

fossil lily
tall saffron
#

still everything red

remote swallow
#

press ok then reload maven

tall saffron
#

yeah that was itlol

#

thanks allot guys for the time

#

🙂

fossil lily
#

yippee

floral drum
#

wee woo

tall saffron
#

1 more thing

#

on my pc i had like every file

#

now i just can see some on the proyect tab

floral drum
#

glass beach make banger songs, change my mind

remote swallow
tall saffron
#

oh nvm i just opened the entire plugins as a proyect so i can see cause idk why the target folder wasnt appearing

remote swallow
#

that is gonna also explain the no java intellisense

tall saffron
#

nvm that didnt work but re opening the proyect did lol

rare ether
#

Hi. I have a very simple script to modify piglin drops. Plugin works fine but I get constant ConcurrentModificationExceptions in my logs. I'd be really glad if you've helped me understand why. ```java
@EventHandler
public void onEntityDeath(EntityDeathEvent event){
for(ItemStack item: event.getDrops()){
if(item.getType().equals(Material.GOLD_NUGGET)){
int amount = item.getAmount();
event.getDrops().remove(item);

            Random rand = new Random();
            int randomInt = rand.nextInt(9);
            if(randomInt < amount){
                event.getDrops().add(new ItemStack(Material.GOLD_INGOT));
            }
        }
    }
}```
agile anvil
#

This is illegal 🫨

#

Just create new lists on top where you input what you want to delete and add

#

Then you could do it after looping over your current list

quiet ice
#

Just replace your for loop with for(ItemStack item: new ArrayList<>(event.getDrops())) {

agile anvil
#

This is a possible easier method 🥲

remote swallow
#

cant you clone lists

agile anvil
#

iirc the arraylist constructor copy the list, otherwise yes it's possible but maybe too much just for that

rare ether
#

Thank you guys for the explanation and for the quick fix. You're the best!

agile anvil
#

I'd personally use lambdas for that, this is pretty clean imo

remote swallow
#

oh also @rare ether dont use #equals for enums, use ==

quiet ice
#

Those will not be enums for very long

remote swallow
#

smh

#

ik but still

quiet ice
#

Actually they will remain singletons so I guess it is safe?

#

But still it'd be confusing

remote swallow
#

they should still be =='able

agile anvil
#

Oh and you can move your random variable outside of the loop too

agile anvil
remote swallow
#

no clue

quiet ice
#

The wonderful IF_ACMPEQ opcode is used for ==

agile anvil
#

Yeah I'm so dumb

#

Just remembered a counter example
✨String✨

quiet ice
#

String is special

agile anvil
#

Didn't actually know it

worldly ingot
#

It's still fine and is the preferred means of comparing materials (or in 1.20, ItemTypes)

uncut herald
#

so i bought src code from someone and tried fixing it up, its a custom block that opens a custom inventory, its a brewing stand, the problem is, when breaking the custom item, it drops 1 normal brewing stand and 1 custom brewing stand, how do i make it so that it deletes the normal one but not the custom one?

remote swallow
#

do you listen to a block drop item event and a block break event

flat lark
#

Is hasmap limited?

quiet ice
flat lark
#
    tasks:
      751ab970-45cb-480d-ba74-5955b488f1ee:
        name: I was testing
        by: Avoo_
      1215552d-f4a1-475a-8d11-89ff0f7df342:
        name: I was testing
        by: Avoo_
      e9625a48-e025-45d5-be6e-e7e783540207:
        name: I was testing
        by: Avoo_
      a549ddc8-9c13-4041-8bb1-e90bb101c30d:
        name: I was testing
        by: Avoo_
      f789fc43-413e-4734-9707-f8f67118d411:
        name: I was testing
        by: Avoo_
      2c683c96-77a0-4e4e-b46f-120dd90fc08f:
        name: I was testing
        by: Avoo_
      ee5b0fc6-481c-4ee8-b145-fb1c54e4ef59:
        name: I was testing
        by: Avoo_
      2c06f4dd-d607-4cd5-9d00-2a4d3a4c1401:
        name: I was testing
        by: Avoo_
      60c3d31b-3145-4cc2-8c71-e6c654055e1e:
        name: I was testing
        by: Avoo_
      ab83e100-0db4-48db-8055-08c929d5f1e9:
        name: I was testing
        by: Avoo_
      4b243d91-1af7-4eeb-b770-654e82c95da7:
        name: I was testing
        by: Avoo_
        uuid: !!java.util.UUID '4b243d91-1af7-4eeb-b770-654e82c95da7'
#

I get this uuid: java issue

quiet ice
#

seems like a serialisation/deserialisation issue rather than a Hashmap issue

flat lark
#

The issue I'm having is. I have a method that getPlayerTasks and I need to save the uuid name and who its by.

#

Because I have a gui and creates a new item for each input on tasks.

remote swallow
#

show how you save it

flat lark
#

I fixed it xD

#

I added a uuid section and forgot to remove it

agile anvil
#

The moment you're waiting to fix a satisfying issue, and you're just waiting for the code but you can't finally fix it because it's already fixed. Feeling like someone who told you "I have to tell you something" and just after "Nevermind"

flat lark
#

Yeah.

tall saffron
#

where should i put like my tab?

#

like in wich event, onplayerjoin?

fossil lily
#

Your tab?

#

Like to set up a player? Yes on join.

tall saffron
#

yeah thanks, i just wanted to make sure

tall saffron
#

Hmm i have it now like an event on the main class called loadtab, and i call it when the player joins, and i pass that player, and when the config reloads. is there a way to load the placeholders regularry or should i do it like each 5m or idk as rn the time in the picture is still and not changing

fossil lily
#

Or every second

#

Not every tick

tall saffron
#

wont that lag a bit like every second?

fossil lily
#

No

#

It’s not that intensive

#

Run it async if you’re worried

royal hawk
#

Hello guys, i'm a need show sidebar in right with title test but this doesn't work who some help?

WrapperTestPacket2 packet = new WrapperTestPacket2(); // SCOREBOARD_DISPLAY_OBJECTIVE
packet.setSlot(1);
packet.setObjectiveName("test");
packet.sendPacket(args.getPlayer());

WrapperTestPacket objective = new WrapperTestPacket(); // SCOREBOARD_OBJECTIVE
objective.setObjectiveName("test");
objective.setMethod(0);
objective.setDisplayName(WrappedChatComponent.fromText("test"));
objective.setRenderType(RenderType.INTEGER);
objective.sendPacket(args.getPlayer());
fossil lily
#

Why packets

royal hawk
#

I'm a need packets

fossil lily
#

No you don’t

#

Check the scoreboard and objectives on javadoc

royal hawk
fossil lily
#

Yes why

brave sparrow
#

Presumably they’re trying to do it with packets for a reason

tall saffron
royal hawk
#

for packet..

brave sparrow
#

But what is that reason

fossil lily
#

Exactly

#

As per my message of “why packets”

brave sparrow
#

@royal hawk why are you trying to use packets instead of the spigot api

brave sparrow
#

If there’s a reason they need to use packets then that won’t help

royal hawk
#

I need use packet, because use animated oldest my api

fossil lily
#

Well that’s why I asked first uwu

royal hawk
#

it work only with packets

royal hawk
#

but it only example.

brave sparrow
royal hawk
#

u can help me with packets?

brave sparrow
#

You don’t need packets to do that

royal hawk
#

I understand what you're saying that I don't need to use this but I'll repeat myself can you help me with the packets?

brave sparrow
#

Probably

#

Show us your code

royal hawk
#

code

#

im use version 1.19.2

sullen marlin
#

no

#

no one will help you with packets because there is no reason to use packets

brave sparrow
#

Lol

royal hawk
#

pog

brave sparrow
#

We would also need to see inside your WrapperTestPacket and WrapperTestPacket2 classes to help you anyway

fossil lily
#

💀 unnecessary packet = huge disrespect

#

no packet

#

bad

remote swallow
#

?paste huge code blocks

fossil lily
#

This looks a lot like copy pasted code

undone axleBOT
brave sparrow
#

For one thing, slot is supposed to be a byte not an integer

#

So that’s already wrong

sullen marlin
#

stop using packets for this

#

</discussion>

fossil lily
#

lmao

brave sparrow
#

The man has spoken

royal hawk
fossil lily
#

the discussion code block is over

remote swallow
#

new rule dropping

fossil lily
#

this is all invalid html

remote swallow
#

banning anyone using packets for something that has api

royal hawk
#

okey

remote swallow
#

thats a joke

#

dw

fossil lily
#

👎

remote swallow
young knoll
#

What if I want to use components

#

🤓

remote swallow
#

you ping choco

worldly ingot
#

Hey, components are done

#

Just waiting on a merge from md

#

Probably 1.20

young knoll
#

:p

#

1.20 hype update?

remote swallow
#

knew it was 1.20

fossil lily
#

Does MD stand for markdown

#

Someone tell me

remote swallow
#

no

#

its his initals

fossil lily
#

damnit

quaint mantle
#

we keep getting an exeption because the players uuid is not on the list yet. When we add the player manually it works just fine. How can we fix this? we tried with try catch but that doesnt seem to work either

undone axleBOT
remote swallow
#

a lot

#

save it as a string

#

then UUID.fromStringit

#

and use getInt

#

if anything add sysouts to the config stuff

#
  • show how you add the player to the list
quaint mantle
remote swallow
#

the list you spoke about in the message, that isnt in the trycatch

echo basalt
#

that's some wonky code

quaint mantle
echo basalt
#

or you can just

#

set(uuid, getInt(uuid, 0) + 1)

quaint mantle
# quaint mantle

if we try to set a uuid thats not in the list yet this happens

remote swallow
#

what list

quaint mantle
#

the jumptemp.yml

remote swallow
#

yeah you dont set a list there

quaint mantle
#

ikik

#

thats just literally what it is

#

the file is just uuids

#

with numbers

#

each uuid has number

#

a*

remote swallow
#

if you mean


info: 
  uuid: int
#

thats a config section

#

not a list

quaint mantle
#

wasnt talking about a list in java

#

just literally

#

a list

#

thats what it is

#

a list of uuids

#

not the term from java

#

just

#

english

#

sorry if i was confusing

remote swallow
#

im confused lol

quaint mantle
#

thats what the config file looks like

remote swallow
#

now that makes moer sense

quaint mantle
#

when we set a players score that is already in the file it works just fine

#

but when we want to add someone new

#

we get errors

remote swallow
#

i have a hunch, its a 1.8 issue

quaint mantle
#

and we dont know how to add them other then adding them manually

remote swallow
#

see if it still happens if you do
set("data." + uudString, int)

quaint mantle
#

okay

quaint mantle
#

we got it working now thx for helping

charred oriole
#

Do you know how to put a cooldown with Cluescrolls plugin?
Like when you take it you have maximum 24 hours to complet these task?

fossil lily
#

Someone asked me yesterday if it was possible to write plugins in HTML

#

They called themselves a good developer

remote swallow
#

at a glance jackson is like bukkit, it doesnt know how to save your class

atomic swift
#

PlayerInteractEvent gets triggered when you open a door with a item right?

remote swallow
#

you have a class you want to save right

hollow grotto
#

No, I'm trying to save the object in the yml, the class is the thing that contains the getter and setter for the object

remote swallow
#

yes, the objectis a class instance, it doesnt know how to save it

hazy warren
#

How do we add the background to text on latest versions of Minecraft

#

Like white text over a pink background

smoky anchor
shadow night
#

I think he means text like in chat or on signs

hazy warren
#

I do mean in chat

shadow night
#

Like, giving text a background color like this

hazy warren
#

Yep

smoky anchor
#

Then this is possibly only with custom font and negative spaces in a resourcepack I think

ornate mantle
#

how would i hide a specific player's sprinting particles?

hazy warren
#

But I'm more of a 1.8 guy so I wasn't entirely sure

smoky anchor
hazy warren
ornate mantle
#

PlayerToggleSprintEvent right?

#

but cancelling their sprint event would stop them from sprinting

#

i want the particles to be hidden when they have a specific item in their inventory

maiden kiln
ornate mantle
#

yes i think they are

hazy warren
ornate mantle
#

i tried creating a packet listener and it only picked them up randomly

ornate mantle
hazy warren
#

No

#

I'm trying to tell you that if you cancel the event it won't stop them from sprinting

ornate mantle
#

would some anticheat plugins not pick that up?

hazy warren
#

It'll just make the server think they're not sprinting when they Really are (no particles sent to other players)

#

If it's a bad anticheat then yeah

#

If it's a good anticheat then no

hazy warren
#

What did you find out

ornate mantle
#

it stops you from sprinting

#

and still displays the particles

#

even when you're not sprinting which it doesnt when you vanilla walk

hazy warren
#

that's funny

ornate mantle
#

which means the particles are client side

#

im going to kill myself

hazy warren
#

That's what I was saying

#

You'll only ever be able to stop the particles from playing on other people's clients

#

not your own

ornate mantle
#

other people is what i want

hazy warren
#

Are you sure that cancelling sprint stops you from running?

ornate mantle
#

yes

#

because when i remove the item it lets me sprint normal speed again

hazy warren
#

Thank you for sharing I did not think that was possible

#

I didn't think the server can just send a packet that stops your sprint

smoky anchor
#

Maybe if we know what you're trying to accomplish we might find a different solution ?

hazy warren
#

He would like to have it so that other players cannot see your sprinting particles

#

Aka ensure the server does not send the sprint packet to other players

ornate mantle
smoky anchor
#

I know that, I am just saying that if there is more to it then there might be something else he could do

ornate mantle
#

basically if a player has an item in their inventory you can't see their sprint particles

#

thats all

#

i dont have a person to test with either

hazy warren
#

You need to do the packet listener method if canceling sprint doesn't work sorry

ornate mantle
#

since the particles may be only for me

ornate mantle
#

how i did it was

#

create a packet listener for particle effects spawning

#

find a player in 0.6 blocks proximity of that particle

#

and if that player has the item i set the particle to null

hazy warren
#

sprint particles aren't serverside though they're client side so idk how that works

eternal oxide
#

ALL particles are client side

hazy warren
#

What I'm referring to is the fact that the server is not explicitly creating these particles

#

The client creates them on any entity that is set to sprinting

ornate mantle
#

theres an nms method called Entity#canSpawnSprintParticle() but i dont wanna modify it

#
public boolean canSpawnSprintParticle() {
    return this.isSprinting() && !this.isInWater() && !this.isSpectator() && !this.isCrouching() && !this.isInLava() && this.isAlive();
}```
smoky anchor
#

I don't think you can override player anyways

ornate mantle
#

it gets run on the tick method for the player

ornate mantle
hazy warren
#

If the server spawns these then that would be news to me

#

I really think it's the client that does it

ornate mantle
#
protected void spawnSprintParticle() {
        int i = Mth.floor(this.getX());
        int j = Mth.floor(this.getY() - 0.20000000298023224D);
        int k = Mth.floor(this.getZ());
        BlockPos blockposition = new BlockPos(i, j, k);
        BlockState iblockdata = this.level.getBlockState(blockposition);
        if (iblockdata.getRenderShape() != RenderShape.INVISIBLE) {
            Vec3 vec3d = this.getDeltaMovement();
            this.level.addParticle(new BlockParticleOption(ParticleTypes.BLOCK, iblockdata), this.getX() + (this.random.nextDouble() - 0.5D) * (double)this.dimensions.width, this.getY() + 0.1D, this.getZ() + (this.random.nextDouble() - 0.5D) * (double)this.dimensions.width, vec3d.x * -4.0D, 1.5D, vec3d.z * -4.0D);
        }

    }```
#

in the entity nms class

hazy warren
#

When you cancelled the particle packets did the sprinting particles stop?

ornate mantle
#

no

hazy warren
#

Then ignore this method

ornate mantle
#

hold on

tender shard
ornate mantle
#

i didnt make this

#

its an nms method

hazy warren
#

That's not his code, that is obfuscated

tender shard
hazy warren
#

nah jk he actually did make htat

tender shard
#

lmao wtf now

hazy warren
#

he likes to get specific with his floats "0.20000000298023224D"

ornate mantle
#

yeah i really did make it

#

i just hate myself

tender shard
#

then why did you not call it x, y, z lol

ornate mantle
#

because i hate myself and everyone who reads my code

tender shard
#

relatable

hazy warren
#

why's it all crammed together like that too

ornate mantle
#

cuz its nms

tender shard
#

I will just go back to #general and listen to weird 80's music, have a nice day everyone lol

hazy warren
#

lol

#

but we need your help!

#

To stop the sprint particles

tender shard
#

I don't know many things about particles, but feel free to ping me if you got a question about maven

hazy warren
#

based

tender shard
#

yeah

ornate mantle
#

wait hold on

#

are you the angelchest guy

tender shard
#

yes

#

I am the angelchest guy

#

but you can also DM me if you need to do your tax returns or if you wanna hear a bad joke

#

I'm quite good in telling bad jokes

tender shard
#

ok so I just told the pudding jokes to someone in DMs and that dude rekd it uuugh

#

he instantly guessed the punch line, this has never happened before

smoky anchor
#

sorry T_T

tender shard
#

it's all good as long as you pass on the story to your friend

karmic salmon
#

Guys i try use Color code In My Code like &6 &a and Taht Stuff But it just send it not color the text in player.sendMessage("You Got Launched!");

smoky anchor
#

player.sendMessage(ChatColor.YELLOW + "You Got Launched!");

karmic salmon
#

:o

smoky anchor
#

& are not the color code character
It is used because you are not allowed to type the actual character §

#

Plugins usually take that one and replace it with §

karmic salmon
#

I See-

eternal oxide
#

use ChatColor# or translateAlterateColorCodes

karmic salmon
#

Thank you Anyway!

orchid gazelle
fierce whale
#

How can I check the packet size per user? (checking bandwidth per user)

agile anvil
#

You have to listen to packets, and for each packets count the size in bit

tender shard
orchid gazelle
#

No I meant what if I don't have any friends

tender shard
#

that's what I meant too

#

you install ViaVersion and find 1.8 friends or sth, idk

orchid gazelle
#

I don't think that is gonna work out

tender shard
#

I never was in this situation, I got many friends even thugh (or maybe because of) I'm such a weirdo

young knoll
#

Simply force people to be your friend

smoky anchor
#

🔫 always works

orchid gazelle
#

Nice, gotta try

tender shard
agile anvil
#

Friends in 1.8 are not reliable

tender shard
#

from my experience, the weirdest and most uncommon online friends you got are the most reliable

#

for example, my best internet friend is some random dude from turkey and I dont even remember how I even met him but I always know, he's there for me, whatever happens

#

cazcez I love you 😗

agile anvil
#

Such a cute meeting

#

I think I'm way too a troll for being able to find internet friends

tender shard
#

don't worry, then let us be friends

#

but I cannot promise to be reliable

agile anvil
#

Depends

#

Do you use 1.8 ?

tender shard
#

ofc not

#

I am 28, not 1000 years old

agile anvil
#

Let's go 🤣

young knoll
#

My best friend is a Brit

#

The future is wild

agile anvil
#

I was surprise by my plugin community: they all agreed on abandoning versions under 1.19.4

tender shard
#

is it oliver193?

karmic salmon
#

guys this like making the command public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { but i want add more things not just like /hello no i want /hello 1 something

agile anvil
#

I'm so impressed

#

Finally

karmic salmon
agile anvil
#

It's happening

agile anvil
karmic salmon
#

:0

agile anvil
#

This is a string array

tender shard
agile anvil
#

Containing all the arguments of the command

karmic salmon
#

wait so can you guys give me example

tender shard
#

check out ACF! thank me later

karmic salmon
tender shard
#

ok

karmic salmon
#

or it's the same?

young knoll
#

1.8 is mostly dominated by the big servers like hypixel

tender shard
#

the general idea is that you parse the args manually

int someNumber = Integer.valueOf(args[0]);
String someName = args[1];

then do your stuff. ofc you gotta check the length of args, first

young knoll
#

Most other servers use latest because survival is 10x better in 1.19 than 1.8

karmic salmon
#

But now i want make it like list

tender shard
#

a list of what?

karmic salmon
#

like when i go to that arg it show "Hello He She It"

#

something like thaqt

tender shard
#

Ah I see. But you already got the "args" array, why not just use that

agile anvil
tender shard
karmic salmon
#

Hm 1 sec i will try give you example

karmic salmon
#

wait i can't send photos??

agile anvil
#

?img

undone axleBOT
tender shard
#

!verify

undone axleBOT
#

Usage: !verify <forums username>

karmic salmon
agile anvil
#

Oh you mean that you want the tab complete ?

karmic salmon
#

in like arg 1

young knoll
#

You just need to implement TabCompleter and return a list of strings

karmic salmon
#

it just help people understand what you can do with that command

tender shard
#

stop telling them to do everything manually

#

Use ACF and enjoy your life

young knoll
#

ACF for one command is silly

tender shard
#

no

karmic salmon
#

hm

agile anvil
#

I think it's great to begin raw, without lib or api

karmic salmon
agile anvil
#

Just to feel the system

tardy delta
karmic salmon
young knoll
#

Throwback to “Raw dogging the NMS”

tardy delta
#

wrong ping, stupid discord

karmic salmon
#

Rip

tardy delta
#

so you were trying to make a tabcompletion?

karmic salmon
#

Yes Sir, Something like that!

tender shard
#

that is ACF ^

tardy delta
#

well first of all let your command class implement TabCompletor

karmic salmon
#

now i become don't know what use Acf or tabcompletor ;/

#

what better

tardy delta
#

(it already implement CommandExecutor, so you can do TabExecutor instead of those two (just a wrapper of those two))

agile anvil
#

Damn

karmic salmon
#

eh

tardy delta
#

oh man

tender shard
#

implementing TabCompleter is the general idea, ACF is basically like an improved version.

tardy delta
#

no StringUtils.copyPartialMAtches :(

karmic salmon
#

ok let me see ACF

young knoll
#

Boo shading

tender shard
#

ACF is really eas to use, you can e.g. do stuff like this:

public void onWhateverCommand(CommandSender theDudeWhoEnteredThisCommand, int someNumber, String... allTheOtherArgs)
young knoll
#

Well I guess we have the libraries feature but still

tardy delta
#

let them know how it works without libs \💀

agile anvil
#

Just discovered that chatgpt totally knows how to use Command API of Spigot

karmic salmon
#

I Still Begginer in Java

karmic salmon
agile anvil
#

I'm not on PC it's quite hard to help you rn

karmic salmon
#

No Problem I Aready need learn this By My Self!

#

thank you anyway!

tender shard
karmic salmon
#

Ok!

tender shard
#

and please explain again what your current issue is - why can you not just use the args[] array that's passed by onCommand method?

karmic salmon
#

Ah I Was thinking to use it

#

but this just arg

#

not TabCompletor

quiet ice
#

Is there any special trick I need to employ to be able to use snapshot artifacts from my local maven repo in gradle?

tender shard
#

no

#

did you forget to add mavenLocal() to your repositories { } section?

quiet ice
#

If I drop the "-SNAPSHOT" bit it works, but resolves a different version

fossil lily
#

check your local repo to see what its called

quiet ice
#

It is a correct snapshot release

#

I'll try to see whether it works by just forcefully setting the maven local as a file://-repo

tender shard
#

show your build.gradle file pls

quiet ice
tender shard
#

which of those dependencies is not working?

#

I see you're adding the actual discrimanator after the SNAPSHOT stuff, you are usually not supposed to do that

quiet ice
#

compileOnlyApi "de.geolykt:starloader-api:2.0.0-SNAPSHOT"

rapid rock
#

Hello guys, I want to whitelist everyone who is online in the server at a particular time
So lets say there are 30 people at one time i run a command where it whitelists everyone online and enbale whitelist

quiet ice
#

It should be said that de.geolykt.starloader:micromixin-annotations:0.0.1-SNAPSHOT resolves fine - the only large difference is that the former (the one I have problems with) is released via gradle while the latter is released via maven

tardy delta
quiet ice
#

I guess it could be because maven uses maven-local-metadata.xml while gradle uses maven-metadata.xml?
Let me check whether using ./gradlew publishToMavenLocal instead of ./gradlew publish helps

#

Okay publishToMavenLocal doesn't seem to do what it should.
Friggn gradle always being a dick

fossil lily
#

👀

quiet ice
#

Sadly gradle is the best build tool for what I am doing right now by a long shot - so I cannot just switch build systems

fossil lily
#

Gradle > Maven

tender shard
#

debatable and also not very helpful

tender shard
#

that should tell us what the issue is

quiet ice
tender shard
# fossil lily Gradle > Maven

just to get back on this. gradle obviously has many issues, one of those being that it's so hard to debug issues with it.

#

maven also has many issues, but "not working" is none of them

#

maven, while being slower, at least properly works

fossil lily
#

im not actually that serious, I just prefer gradle

tender shard
#

yeah that's fine ofc

#

neither maven nor gradle is perfect, I use both and I think that gradle is sooo hard to debug sometimes

#

but maven takes ages for multi module projects 🥲

fossil lily
#

oh yea lol

tender shard
#

in a perfect world there'd be a working build tool that's easy to use and is fast, but there's no perfect world haha 🥲

quiet ice
tender shard
#

is the issue that gradle won't compile, or just an IDE issue?

quiet ice
#

That is when I'm running ./gradlew dependencies (even though the dependency graph says FAILED next to it) - when using ./gradlew build it doesn't bother to resolve it but I think that is because I have no actual source files yet

tender shard
#

ok that should not happen. please ?paste the whole log, otherwise nobody's able to help

quiet ice
fierce whale
#

?img

undone axleBOT
fierce whale
quiet ice
#

OH I SEE

#

It's because gradle discards my dependency because it is compiled for another java version

#

This is dumb default behaviour

tender shard
#

but maybe somebody else knows

quiet ice
#

Well building with Java 11 fixed it

#

Or rather said, setting source/target to J11

tender shard
#

instead of? 8 or 17

tender shard
quiet ice
#

Instead of 8 (building with JDK 17 though)

tender shard
#

ok that is weird. I would be fine if you'd say "in 8 it doesnt work but in 11 it does work" but you're literally downgrading to make it work, that's not supposed to happen lol

quiet ice
#

That being said I'd still like to compile to Java 8 .... but I guess I now know the bottleneck

#

Well It's because gradle uploads additional metadata that says which java version the dependency was compiled for (in this case java 11)

tender shard
#

that is normal, yeah. that's one of the reasons why I hate gradle

#

but you should have received a proper error message if this was actually the issue, earlier

quiet ice
#

probably was because I wasn't actually attempting to compile anything

tawdry echo
#

if i want to do daily rewards which resetting every day at 8am i need to do task and check using by Calendar class yes? or is any better way for do this

flat lark
humble tulip
round finch
#

SUS LINk

tender shard
#

dw I can cure sus links

round finch
#

SUMM SUUMM

#

all world problem solved

tender shard
#

ikr

weak meteor
#

someone knows about github pages? i cant setup mine :(

tender shard
#

what's the issue?

icy beacon
#

ask the question plz

tender shard
#

^

small glen
#

Someone knows how to deny a player who jumps on spigot 1.9.4

ivory sleet
#

Wdym by deny?

#

Like just disallow them to join?

flint coyote
#

he said jump lol

#

Sadly detecting a jump ain't that easy. If you don't wanna transport them up by any other means you can just compare their y. Otherwise you'll have to deal with velocity - Paper has a playerjumpevent. You could check how they detect it

tardy delta
#

stealing code

agile anvil
#

Isn't their a trick like giving jump boost infinite to the player ?

ivory sleet
#

(I thought that initially also)

misty current
#

how can I get a protected/private constructor using reflections? Class's getConstructor throws an exception even if I pass in the correct parameters

floral drum
misty current
#

getConstructor throws the exception and i can't make it accessible unless i get it first

floral drum
#

Oh the actual method throws an exception

#

What's the error it throws?

#

?paste

undone axleBOT
misty current
echo basalt
#

getDeclaredConstructor maybe

#

if that's a thing

floral drum
#

Would make the most sense

#

Yeah that's the one ^ just like getDeclaredField

misty current
#

that could work

#

lemme try

ivory sleet
#

It will work

#

Because that’s the definition of how getDeclared works

misty current
#

yea that works

#

thanks

floral drum
#

getConstructor is only for "public" constructors.
getDeclaredConstructor is for "all" constructors.

ivory sleet
#

Almost

weak meteor
#

and well