#help-development

1 messages · Page 275 of 1

sterile token
#

I mean to be truth i wouldnt even touch plugins without learning fully java, because that causes thousans of issue

gilded knot
#

fair

sterile token
#

I mean fully basic java*

gilded knot
#

I got an entire christmas to do it

#

¯_(ツ)_/¯

sterile token
#

oh weird, yeah that why

#

If you learnt fully basic java first, then everything is simplier*

gilded knot
#

Yeah, I can see that

sterile token
#

Ofc not wondering to make you mad or be rude, jsut telling from my experiences i used to had

gilded knot
#

Yeah no bro, I completely understand

#

I'm usually more of a guy who hangs around in the #help-server since I make servers, rather than making plugins

#

but what pissed me off was that there's no Annihilation plugin that's fully-functional

#

logically It's not difficult

#

create 4 teams

#

make a command which allows player to join team

#

Check if team is balanced

#

On server start-up, load random world

#

etc etc

#

but yeah, there we have it

sterile token
zealous scroll
#

for minigames you could use hypixel’s slime world format to save on load time and space

it’s really good

sterile token
#

And what is annihilation=

gilded knot
#

Bedwars & KitPvP mixed

#

there are 4 teams

sterile token
#

ohh okay i catch it

gilded knot
#

usually there's like 5 players in each team

#

you go to enemy bases and "break their bed" 200 times

#

to kill them

#

basically yeah lol

gilded knot
#

Canyon = Map

sterile token
#

yeah its like a protect the core

gilded knot
#

mhm

sterile token
#

Where you should break the nexus x times to finally kill them

gilded knot
#

Si

sterile token
#

Its the protect the core concept tho

sterile token
# gilded knot Si

Espanol? Im native spanish speaker tho but so far we cannot speak spanish here

gilded knot
#

I'm fully british xD

sterile token
#

ohh ok, i see you said "yes" in panish that why

gilded knot
#

yup

sterile token
#

So?

gilded knot
sterile token
#

u speak espanol?

gilded knot
#

Nope xD

#

It's just a figure of speech

sterile token
#

oh ok

sterile token
#

You can always decompile the jar, fix decompilations issues, modified it and then re compile it again

gilded knot
#

You don't always gets the full source, or it's not always accurate

sterile token
#

I dont think its allowed but if its for personal usage who would care

sterile token
gilded knot
#

I doubt it's obfuscated

#

I'll try it

sterile token
#

doubt?

chrome beacon
sterile token
gilded knot
#

mm

sterile token
#

I would do that tho

#

I wouldnt lost so much time re writting

gilded knot
#

Yup lol

sterile token
#

Because that plugin for an experienced dev will take around 1-2-3 weeks but us that we dont really have experience takes more time

gilded knot
#

I love my life :D

sterile token
#

yeah in that case you will have to re code it

#
@Override
public boolean execute(CommandSender sender, String command, String[] args) {
  if (args.length < 1 && this.hasPermission(sender, this.permission)) {
    this.sendHelp(sender);
    return true;
  }
  BukkitArgument argument = this.getArgument(args[0]);
  if (argument == null) {
    text.send(sender, "Command.Invalid-Argument", "%prefix%", text.getString("General.Prefix"), "%argument%", args[0]);
    return true;
  }
  if (!this.hasPermission(sender, this.permission) || !this.hasPermission(sender, argument.getPermission())) {
    text.send(sender, "Command.Invalid-Permission", "%prefix%", text.getString("General.Prefix"));
    return true;
  }
  argument.execute(sender, command, Arrays.copyOfRange(args, 1, args.length));
  return false;
}```

What could be wrong here, because so far its telling me that i dont have permissions to execute the sub command, when i have the permission of the sub command tho
gilded knot
#

No idea

zealous scroll
#

There’s a logical OR in that if statement

gilded knot
#

You sure the permission for the command is set correctly?

jagged monolith
sterile token
zealous scroll
#

CommandSender can have permissions

sterile token
#

So i explain what happen

zealous scroll
#

you don’t have at least one of the permissions for either the root or argument command

#

or your permission check method is, for some reason, returning false incorrectly

sterile token
#

My idea is the next:

Args is 0 and dont have command permission => return permission msg
Args is 0 and have command permission => return help msg
Arg is 1 and dont have command or sub command permission => return permission msg
Finally execute the sub command

#

Yeah problem is caused only using argument permission, having root one is perfect

jagged monolith
#

use a debug message and make sure argument.getPermission() is returning the correct thing.

zealous scroll
#

i would suggest you check if you have the command permission before you check usage to avoid leaking how the command works.

then check for the sub command’s permission after having checked the argument usage

sterile token
#

Sorry for asking this stupid thing but i couldnt find any software which allow you to evaluate conditions with logical operators and give you the truth tables

#

I already debugg everything and it should be okay, the issue shouldnt be there

zealous scroll
#

try printing if you have the command permission and then another time for the subcommand

jagged monolith
#

Never guess with coding. "should" doesn't mean it is or isn't correct. Triple check it

sterile token
#

I wont lie the code on v1 was working perfect, and v2 brokened althought no one touched the command framework

sterile token
zealous scroll
#

right

#

that’s how it’s working in your code

#

now try checking in your player permissions if you have both of them

sterile token
#

So what do you suggest, knowing what i want to do?

zealous scroll
#

because according to the code you do not have at least one

sterile token
#

Im using permisible tho

zealous scroll
#

what do you mean

sterile token
#
boolean hasPermission(Permissible permissible, String permission) { 
  return !permission.isEmpty() && permissible.hasPermission(permission);
}
jagged monolith
#

Why aren't you using the normal player.hasPermission()

sterile token
#

Someone explained something about that but i wasnt sure tho

zealous scroll
#

have you checked if you actually have both necessary permissions

jagged monolith
#

An do this: use a debug message and make sure argument.getPermission() is returning the correct thing.

zealous scroll
#

if you say no one touched the code from one code version to the other then that’s the most normal explanation for this malfunction

sterile token
zealous scroll
#

well that’s your code’s behavior

sterile token
#

And both of the permissions are okay

sterile token
zealous scroll
#

it checks if you don’t have permission for the command OR if you don’t have the permission for the subcommand. If either of these conditions are true then it sends you the permission message

sterile token
#

I mean the permissions returned via: Command#getPermission() and Argument#getPermission() are the same node setted in luckperms

zealous scroll
#

look at your if statement

sterile token
#

Either that or you are not being clarify

zealous scroll
jagged monolith
#
!this.hasPermission(sender, this.permission) || !this.hasPermission(sender, argument.getPermission())

You are literally checking that you DON'T have the permission

sterile token
jagged monolith
#

The ! means you don't have it.

zealous scroll
#

I have been saying that from the start

sterile token
zealous scroll
sterile token
#

boolean input = false;
sout(!input) // true

jagged monolith
#

So if you are getting the message in that if statement, it means you don't have one of the permissions

gilded knot
#

nvm

#

got it

zealous scroll
gilded knot
#

wrong logger

sterile token
zealous scroll
#

yea and your if condition does the opposite

#

if you do not have one permission OR the other, it doesn’t let you run it

#

just replace the || with a &&

sterile token
#

ok

twin venture
#

hi i have a problem ":
so if i add break , it will only execute first event for the quest , but other quests will not be execute the event
and if i remove the break; , the quests will be duplicate + 2 example :

zealous scroll
twin venture
#

how i can fix this diloma?

#

its 2 am for me my brain is on fire xd

sterile token
#

Is not that i havent leant how they works, i know how they works but my brains are not so smart to think the posible rults!!

zealous scroll
#

since your booleans are negated then that means one of them had to be false for your if statement to fail

zealous scroll
sterile token
#

You dont understand my point

#

Sorry man you make me raged because you confuse a lot

jagged monolith
#

Eitherway, all you need to do to fix it, is replac || with &&

twin venture
#

if i add break : it will only execute the event for only 1 quest at a time , i need to finish the quest , then it will go to next
if i remove brea; : it will duplicate the code twice

#

i want it to execute all the events at the same time , but no duplicate

gilded knot
#
[23:28:51 WARN]: [Multiverse-Core] Unable to copy directory
[23:28:51 INFO]: Successfully cloned world
#

Getting this error

zealous scroll
gilded knot
#

Oh wait

#

forgot the /

sterile token
gilded knot
gilded knot
sterile token
#

There is a getter for it

gilded knot
#

oh damn

twin venture
sterile token
gilded knot
#

I'll see

sterile token
#

I use # when i explain things via discord, but that in real code should be a dot

gilded knot
#

Yup ik

#

wait

#

it asks for a file?

#

Not a directory?

hazy parrot
#

Convention like, # represents instance method

hazy parrot
#

You have File#isDirectory

gilded knot
#

Ah, alright

limpid bloom
#

wanting to a player/clients brand, ChatGPT says their is a getClientBrand() method to the Player class but considering i can not find that method anywhere in spigot api nor does my IDE know about it so i think it's something ChatGPT came up with as it some times does, so is there a method or easy way to get a client or players brand?

limpid bloom
gilded knot
#

It's still bugging me

limpid bloom
#

i believe you have entered the realm of quantum mechanics, where something can both fail and not fail at the same time

gilded knot
#

I haven't added a check to see if it cloned xD

limpid bloom
#

you never know what really happened till you check but this solidifies it's state

buoyant viper
#

?jd-s

undone axleBOT
gilded knot
#

and basic guidance

#

but it's a bit brainless when it comes to java methods

buoyant viper
#

i forget if its possible, but u might be able to use a plugin channel (MC|Brand is what its known as last i recall) to manually read what the client reports

limpid bloom
#

considering what it's been able to help me with, i'd say it has some decent knowledge of it if a little outdated

limpid bloom
vocal cloud
#

Brand? As in version, client type or?

buoyant viper
#

the one the client sends with payload packet i think

#

MC|Brand

#

@vocal cloud

limpid bloom
#

i belive client type, as i know plugins can detect client brand such as fabric, vanilla, forge and such

#

i also think there is one for feather but i might be wrong

twin venture
#

so this code works fine , the only problem i finish a game of bedwars , it execute the event , but the handleQuestTrigger is being duplicate twice.

i tried to add a break to stop the for loop but that will make only 1 quest at a time , i want all quests execute same time , but no duplicate
this is the code :

vocal cloud
#

If you know the packet you can listen for it with protocollib

twin venture
#

it seems that the method , is being duplicated twice

#

🤔

zealous scroll
#

it could be the quest is registered twice in your lists of quests or your handleQuestTrigger method completes it twice

vocal cloud
zealous scroll
twin venture
zealous scroll
#

Then thats your issue

#

Just change the event name

twin venture
#

some quests should be diffrent in the value , and name but not in the event name

zealous scroll
#

Oh i get what you mean now

twin venture
#

lets say , win game of bedwars

#

yes 😄

#

do you know a way around this ?

zealous scroll
#

So whenever you complete a quest it’s doing it twice?

twin venture
#

yes correct

#

and i made sure , iam not registering it twice

#

ideas?xd?

subtle folio
#

SignChangeEvent exists?

twin venture
subtle folio
#

i believe so lemme look at javadoc

#

only when you hit Done

#

you want for esc aswell?

#

but wouldn’t esc be the way to get out of wtv you are doing

#

like canceling it

#

i think for most cases it’s fine

#

ah i see

twin venture
#

sorry for the wrong info ❤️

subtle folio
#

You want to know when the player cancels out of it aswell

#

might be some nms let me look

#

I can’t find anything, sorry 😦

twin venture
#

Great explain xd
Going to sleep ,-,

sterile token
#

I would make a super event (QuestEvent) and then implementations (for example, QuestCompletedEvent, etc)

young dome
#

Does a sound launched from the playSound method in the bukkit player interface launch a sound that can only be heard by this player or can all players hear it? There is no information about this in the documentation.

sterile token
#

If im not wrong sounds are played in a location

young dome
#

Yes absolutely, however, why did you link it to the player? I guess it is only audible to that player otherwise it would be illogical to put it here

#

I just saw that the packet was only sent to the player, so I have my answer. My bad, I spoke too fast.

sterile token
#

What?

#

There the packet is being sent back to the client

sharp verge
#

Soo, i have a .txt file looking something like this:

Player R4wPanda Said: TESTING SOMETHING1
Player R4wPanda Said: TESTING SOMETHING2
Player R4wPanda Said: TESTING SOMETHING3
Player R4wPanda Said: TESTING SOMETHING4
Player R4wPanda Said: TESTING SOMETHING5```

I wanna convert this file to a string, but for each line break, i wanna add \n so that it automatically goes to a new line.
Im using a library and it wants a string, but since the txt file is more of a list, well not really but it is sorted so each new line is equal to a new message. How would i go about doing something like this ?
sterile token
#

Why are you using txt files?

echo basalt
#

strings have a limit too

sharp verge
sharp verge
# echo basalt What library is it?

This one:
https://github.com/kaimu-kun/hastebin.java

But im using this code:

StringBuilder content = new StringBuilder();

        try (BufferedReader br = new BufferedReader(new FileReader(filePath))) {
            String line;
            while ((line = br.readLine()) != null) {
                content.append(line).append("\n");
            }
        } catch (IOException e) {
            e.printStackTrace();
        }

        String fileContent = content.toString();
        System.out.println(fileContent);```
GitHub

A simple Hastebin API wrapper for Java. . Contribute to kaimu-kun/hastebin.java development by creating an account on GitHub.

sharp verge
#

hmm

#

What is the limit for strings?

sterile token
#

You will have to design a pagination system tho

#

In my case i will get the size of messages that a player has and then make pagination calculations

sharp verge
#

So i would return the byteSize or something like that?

sterile token
#

hmnn

#

Im not sure, i never did that

sharp verge
#

Im not sure i completly understand what you mean with the pagination system

echo basalt
#

He means like

#

viewing the last 1000 messages, for example

sterile token
#

I mean pagination, like get x amount of messages per x page

echo basalt
#

Strings have a size limit of Integer.MAX_LIMIT (2^31 - 1, other bit is negative flag)

sterile token
#

So if player has 3000 messages, you will have 300 pages (10 msg per page)

echo basalt
#

So yeah the limit is basically 2gb

#

you'll be fine without a limit but still

#

if you actually reach that limit, RIP your ram

sharp verge
#

True

#

Dont think that would happen, with a timed server shutdown i think i will be fine

#

Anyways thanks for the enlighment

#

inlightment

#

idek

echo basalt
#

enlightenment

#

en-light-en-ment

sterile token
#

If i where you i will keep the msg in yaml, so then you can get the section keys size

#

And then having that size, just split them doing total lines / messages per page

echo basalt
wet breach
#

And each String Object would have a limit of 2GB

#

but they should be fine

#

unless they are trying to store some novel in a single String or something

echo basalt
#

stringbuilder seems fine too

wet breach
#

in which case might be better to just use a long

#

extract the binary yourself from the long

#

or use some kind of compression

sharp verge
#

I'll stick with the stringbuilder for now, and in case of destruction i'll reffer back to this conversation and beat my head over why i didn't just chose this at first lmao

vital yarrow
#

Does someone know how to make a skyblock grid system or have an idea of how to make it ?

summer sapphire
#

yo

#

getMapList kinda sucks

vital yarrow
vital yarrow
modern sluice
#

How do I disable command logging? The config file doesn't appear to affect it.

velvet chasm
#

I am making a plugin. Someone can pick a thing they want to be. Is there a way I can create a sort of custom value that will be used in future if statements to see what they chose?

jagged monolith
#

Just create a private variable in the class that can be used.

#

Then if you need to use that variable from another class, just use a public getter/setter for it.

velvet chasm
jagged monolith
#

If you code it that way, then it will.

vocal cloud
#

Use PDC and it will

torn shuttle
#

you know you are having a good programming session when you nearly faint three times and still keep going

fierce whale
#

Is there anyway to set simultaneously damage cause and attacker?

onyx fjord
#

getDamager() and getCause()?

fierce whale
#

I meaned SET damage cause and attacker of damage

jagged monolith
#

setLastDamageCause()

#

An I don't think you can set the damager.

lilac dagger
#

you can set the lastdamager @fierce whale

jagged monolith
#

None that I could see in javadocs that is.

fierce whale
#

Yeah.. There is no method set last damager

#

I try to cancel general damage of minecraft. and allow only skill damage

#

But I couldn't find way to do that 😦

jagged monolith
#

EntityDamageByEntityEvent > Get Entity > Get Damage Cause > Check it's not custom > If it isn't cancel event

fierce whale
jagged monolith
#

?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.

fierce whale
#

?paste

undone axleBOT
fierce whale
#

I think my skill plugin (MagicSpell) has own error

#

It hits entity double time

tender shard
#

wdym

#

a more detailled description of the problem would be very helpful

#

also why do you prohibit armorstands from getting damaged lol

gilded knot
#

Yeah uh

#

I'm trying to clone a worldfile

#

and move it to the root of the server

#

spits out this error

tender shard
#

print out the stacktrace

#

also why is your plugin called Multiverse-Core o0

gilded knot
#

It uses the MV API to load the world in

tender shard
#

show full code and/or print out the stacktrace

gilded knot
#

yep yep

tender shard
#

?paste

undone axleBOT
jagged monolith
#

Screenshots of code don't help. It's better to paste.

gilded knot
#

oh

#

right

#

kk

manic furnace
#

Im reading data from a zip file like this:

            String result = ""; 
             ZipEntry zipEntry = null; 
             while ((zipEntry=zis.getNextEntry()) != null){ 
                 byte[] buffer = new byte[1024]; 
                 int read = 0; 
                 while ((read=zis.read(buffer)) != -1){ 
                     result += new String(buffer, StandardCharsets.UTF_8).trim(); 
                 } 
             } 
             zis.close(); 
             result = result.trim(); 
             result = result.replaceAll("\n","");

But for some reason, the string is not completely read

gilded knot
#

For context;

#

I'm making a mini-game plugin

tender shard
#

two things:

gilded knot
#

Since the existing ones are shit

tender shard
#
  1. Do not use hardcoded "/" letters
#
  1. Do not use hardcoded paths
#

you are trying to copy /plugins/...

#

That's definitely not the correct path

#

unless your server is in /

gilded knot
#

It's not for public-use

tender shard
#

and it shouldnt be there

#

anyway

#

/ is the root directy

gilded knot
tender shard
#

like C:\ on windows

tender shard
gilded knot
#

I have no need to worry

tender shard
#

well it doesn't work right?

gilded knot
tender shard
#

so you should at least consider changing it to sth proper

gilded knot
#

How would I achieve that exactly

tender shard
#

that's however /home/container and not /

gilded knot
#

ah right

tender shard
#

you can use getDataFolder()

#
File myWorldFile = new File(new File(getDataFolder(), "Worlds"), worldName);
gilded knot
#

Ah

tender shard
#

this also fixes the hardcoded "/" problem

#

although on linux, hardcoded "/" should work, but you should try to avoid it anyway 😛

gilded knot
#

mym understood

#

mhm*

tender shard
#

I just fixed a typo in my above code

#

I forgot to put the closing ) behind "Worlds"

gilded knot
#

Ah alright

#

If it was a public spigot plugin

#

I'd be more cautious

#

but since it's a plugin for myself

#

¯_(ツ)_/¯

tender shard
#

yeah you probably just got the path wrong

#

/ instead of /home/container/

gilded knot
#

oh and just to confirm

gilded knot
obsidian drift
#

Is there a way of getting if an entity is targeting another entity?

jagged monolith
#

There's either the
EntityTargetLivingEntityEvent
Or
EntityTargetEvent

#

They both have a getTarget() method.

obsidian drift
#

And how can I tell when they stop targeting?

jagged monolith
#

When the getTarget() returns null

obsidian drift
#

It would be nice if there was a Entity.getTarget function

jagged monolith
#

LivingEntity and some specific entities have a getTarget() method.

lilac dagger
twin venture
#

i will show you what i mean

gilded knot
#

gonna post it here since that discord was useless

#

I've uploaded a WorldFile

#

named "Canyon"

#

right here

#

And I need to import it,

#

I'm trying to use the MV API but it doesn't seem to work

#

Would it be worth to just dispatch a command

twin venture
#

this is the event that is triggered :
and this is the listeners :
and how i create new Quest from here :

#

for some unkown reason :
this method is being called twice ..

#

iam trying to debugging it rn ..

#

hope i found out the reason

jagged monolith
#

?paste

undone axleBOT
gilded knot
#

How do I make my plugin initialise after a specific plugin?

#

the plugin I need initialises after

hazy parrot
#

Maybe you can use depends too

gilded knot
#

I added it as a depend

gilded knot
#

For the time being, I'll just make it so that it executes the command When the server finishes starting

twin venture
gilded knot
tender shard
#

only "Mobs" can have targets

#

Mobs are basically LivingEntities with AI

#

e.g. creepers, spiders

#

so basically just do sth like this

public static boolean hasTarget(Mob mob) {
  return mob.getTarget() != null;
}
twin venture
#

weird the code works fine now ..

tender shard
#

did you maybe just do /reload instead of properly restarting?

#

if you got a weird problem, then in 99% of cases, a proper restart will fix it

tender shard
tender shard
#

and did this fix it?

gilded knot
#

Nope

tender shard
#

"depends"

#

not "depend"

#

I guess

gilded knot
#

oh

#

shit

tender shard
#

oh no

#

you are right

#

it's indeed called "depend"

gilded knot
#

Right

tender shard
#

please paste your latest.log

#

?paste

undone axleBOT
gilded knot
#

aight

tender shard
#

what's the name of your plugin?

gilded knot
#

Annihilation

tender shard
#

your plugin DOES get enabled AFTER multiverse

#

so what's the problem exactly?

#

the order of enabling is correct

gilded knot
#

Right

#

But actually loading?

tender shard
#

it works like this:

gilded knot
tender shard
#
  1. Load Multiverse
  2. Load Annihilation
  3. Enable Multiverse
  4. Enable Annihilation
gilded knot
#

Oh wait so

#

Right

tender shard
gilded knot
#

anni is up here

tender shard
#

damn

#

damn that's weird shit

gilded knot
#

Is it possible for me to execute the command when the server finishes starting

#

instead

gilded knot
tender shard
gilded knot
tender shard
#

but tbh this shouldn't happen in the first place

gilded knot
#

Hm :|

tender shard
#

anyway, you could just do it like this:

#

(one sec, gotta start IJ)

tender shard
#
public class TestPlugin extends JavaPlugin {

    @Override
    public void onEnable() {
        Bukkit.getScheduler().runTaskLater(this, () -> {
            // This code will run one second after the server has finished starting up
            Bukkit.broadcastMessage("Hello, world!");
        }, 20L);
    }

}

#

20L = 20 ticks = 1 second

gilded knot
#

Back

#

Ah right

gilded knot
#

I'll test it now

tender shard
gilded knot
#

i will

gilded knot
#

Have you added the PlaceholderAPI into pom.xml

#

Actually, you probably have

tender shard
tender shard
gilded knot
tender shard
#

do you have the player extension installed?

#

PAPI by itself has almost no builtin placeholders

#

try /papi ecloud download player

#

or sth like that

orchid gazelle
#

Sheesh Jägermeister

gilded knot
#

/papi reload aswell

tender shard
#

yowza

tender shard
orchid gazelle
#

Guess what I got for christmas

tender shard
#

a jägermeister and 200€ in cash

orchid gazelle
#

A full bottle of Pfeffi!

tender shard
#

are you sure that %player_name% is the correct placeholder name?

tender shard
#

when are you trying to use that placeholder?

trim creek
#

in custom plugin or if not in which plugin?

tender shard
#

please paste your latest.log

#

and your pom.xml too

opal wedge
#

Hey, I'm currently developing a Minesweeper game with the following onEnable: https://paste.md-5.net/atugelexuh.java
My problem is that I need to reload/restart the server a second time after installing the plugin so that the events are captured.

tender shard
#

maybe you accidentally shaded PAPI into your plugin, so you are using the shaded version which doesn't have any extensions enabled

#

?paste

undone axleBOT
tender shard
#

wdym with that

opal wedge
#

not called when i login

tender shard
#

does it work fine after a proper restart?

opal wedge
#

If I delete the config and restart the server: nope

tender shard
#

I mean you didn't even add spigot as dependency

opal wedge
#

Maybe, if he uses the dependencies from intellij

tender shard
#

it wouldn't compile then, when using mvn package

#

how so

rich flume
#

alex tf u on about

tender shard
#

why?

#

i dont know what you mean

opal wedge
#

I compile also with ij because maven does corrupt my zip folder in resources

tender shard
rich flume
#

huh?

tender shard
#

I am trying to though. Maybe you have some better suggestions

rich flume
#

it is not useless at all

tender shard
#

If you use IntelliJ's File -> Build artifacts thingy, it 100% ignores your pom file

rich flume
#

it doesn't ignore it..

tardy delta
#

it does

#

also fucks up shading

rich flume
#

you mean the shading part? Yeah obviously it does

tender shard
#

please tell me more about how intellij parses a whole pom.xml without using maven

rich flume
#

but the dependencies itself no

rich flume
tender shard
#

@opal wedge Please build your .jar using maven

opal wedge
tender shard
#

double click on package

#

if it shows an error, then tell us the error message

opal wedge
#

The zip file in my resources folder gets corrupted

tender shard
#

that's what I said too, then you told me I'm not helping that person

#

are you a bit drunk or sth

tender shard
#

no

#

he only sent a tiny part of their pom, and then said the he's not even using maven to compile

rich flume
#

he clearly isnt shading papi

tender shard
#

how would you know that

#

IJ can also shade dependencies

tardy delta
#

why are you including a zip file in your resources anyways

tender shard
#

yeah that also sounds weird

tender shard
#

what's Minesweeper line 163?

opal wedge
#

until line 19

tender shard
#

If you think that you are better in helping people, then go ahead please

#

instead of saying "haha what mfnalex says is bullshit", maybe just utter your alternative suggestions instead

opal wedge
tender shard
#

please don't say "another error" but rather send the whole error message please

#

because "another error" is not a very detailled description 😛

rotund ravine
#

?learntoask

trim creek
#

?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!

trim creek
#

eeeeeeeeeee not quite that

rotund ravine
#

?askgoodquestion

undone axleBOT
trim creek
#

xd

opal wedge
#

Okay, if i compile it with maven, the world Minesweeper looks like this:

jagged monolith
tardy delta
#

maybe go above the surface

#

\🤓

trim creek
#

wtf

#

how isnt that Discord style?

tardy delta
#

cry about it

trim creek
tender shard
rotund ravine
#

You a def making an issue of nothing.

tender shard
#

me?

sturdy jasper
#

i am using .runTaskAsynchronously in one of my plugins whenever a specific block gets placed. now i did some performance testing by similuating 400 of those blocks being placed at the same time and the server ends up crashing (i think because there are to many threads being created) is it possible to somehow delay new thread creation or make async tasks share a thread (and just wait for the stuff that is infront of it) to limit the amount of threads that can get created

opal wedge
rotund ravine
tender shard
#

the default thread pool is not that big lol

#

if you schedule 400 runnables in one tick, then it does require 400 threads. IIRC the default thread pool has like 10 or 20 threads or sth. definitely not more. rather less

rotund ravine
#

Just use ur own queue systme to distribute in batches i guess.

tender shard
#

exactly

sturdy jasper
#

im looking at that link now

opal wedge
tender shard
gilded knot
#

How do I make a bossbar which is displayed to everyone?

#

with a custom message

rotund ravine
opal wedge
gilded knot
#

right

#

Bukkit.createBossBar()

#

got it

tender shard
opal wedge
tender shard
#

you also gotta send it

tender shard
#

or does Winrar also complain?

opal wedge
tender shard
#

then the file is broken

opal wedge
#

but only if i compile it with maven

#

ij works fine

tender shard
#

how do you include that zip file?

#

are you able to open the original zip file?

humble tulip
opal wedge
rotund ravine
#

Which buttons do you press @opal wedge

#

For both things

humble tulip
#

exclude the zip file from being filtered

opal wedge
rotund ravine
#

Where do you put it

tender shard
#

what

rotund ravine
#

And what do you press

tender shard
#

if do "mvn compile" you don't even get a .jar file

rotund ravine
#

Also u need to do package

tender shard
#

you are supposed to use mvn package

humble tulip
#

Exclude zip files from being filtered, i had this issue with schematics

tender shard
#

otherwise maven doesnt even create a .jar file

opal wedge
#

i meant

humble tulip
#

In your pom

tender shard
#

in your pom

#

yeah

#

but first of all, do mvn clean package

#

then check the .jar file in your target/ directory

#

otherwise maven doesn't even create a .jar file

opal wedge
#

i meant package

tender shard
#

compile does NOT create a .jar file

tender shard
opal wedge
#

yes

tender shard
#

ok

#

then your original .zip is broken

#

recreate the original .zip file

opal wedge
tender shard
#

a minute ago you said that you get the same error when trying to open the original .zip file

hardy garnet
#

Hey guys! So, I am having issues with mob despawning. I am summoning mobs with my command, but if the mobs are far enough away they despawn. I did set persistence to true, so I am unsure how to stop them from despawning

tender shard
#

any console errors?

humble tulip
#

@opal wedge

hardy garnet
tender shard
#

tell us both

hardy garnet
tender shard
#

and you did setPersistent(true) right?

hardy garnet
gilded knot
#

right so I've created a bossbar, how do I make it visible to players

tender shard
#

what entity types are we talking about?

hardy garnet
#

Wither skeletons

tender shard
#

hm then it should work. I have no idea, I can't help you. If you set them to persistent on 1.13+, they SHOULD be persistent. unless ofc your world is set to peaceful or sth

hardy garnet
#

yea lol its not peaceful. I've tried putting items in their hands too. Usually if a mob is holding something they don't despawn

#

with exception to wither skeletons and skeles, if they hold bows or swords respectively they still despawn

tender shard
humble tulip
#

@opal wedge did that work?

gilded knot
opal wedge
tender shard
hardy garnet
opal wedge
#

ty

hardy garnet
#

and the spigot server is localhost, so no other players

humble tulip
#

Np

hardy garnet
#

could mobcap have anything to do with it?

tender shard
#

works for me

gilded knot
#

wtf

tender shard
humble tulip
#

What's mobcap

tender shard
#

oh yeah

#

that might be a problem

hardy garnet
#

Number of hostile mobs around a player max

tardy delta
tender shard
#

I haven't thought about the mobcap

gilded knot
#

Ohh, It has to be inside a function

sage dragon
#

Is it not possible to use the Bukkit API to modify the data of Entities created with NMS?

Or am I doing something wrong?

The Entities do spawn for the player, but without data.

The AreaEffectCloud does get spawned as a passenger on the player though...

Here's my current code:
https://paste.ofcode.org/gGLUrrnf7VwVKtFMug8QC5

tardy delta
#

lmao

gilded knot
#

It's good

hardy garnet
#

The thing is though, if I go to like y = 500 all of them are gone when I get to the ground

tender shard
sage dragon
tender shard
hardy garnet
tender shard
#

you only send the packet

#

you also have to use ServerLevel

#

.addFreshEntity

#

or sth like that

#

you do create the entity object, but you never add it to the actual world

#

try ServerLevel.addEntity() or sth like that

#

or addFreshEntity()

#

both should exist

sage dragon
#

I need it to be client side only

hardy garnet
#

I'm personally using addEntity to spawn the entities. Is there something quirky with that function which could be messing me up?

tender shard
#

you could hide entities from certain players, even with API

#

Player#hideEntity(...)

sage dragon
#

It's a server limitation, not a client limitation.

The server won't allow players to switch dimensions or teleport via plugins while having passengers

tender shard
#

or the NMS "ServerLevel" class?

hardy garnet
sage dragon
tender shard
#

so it wouldn't even compile

#

?

hardy garnet
#

(WitherSkeleton)current_location.getWorld().spawnEntity(current_location, EntityType.WITHER_SKELETON);

tender shard
#

spawnEntity

#

yeah

#

that will do

#

that's fine if you actually need a bukkit entity later on

hardy garnet
#

yea, oops. Yea its spawn entity not addEntity

tender shard
#

np

#

that's perfectly fine

hardy garnet
#

I shouldn't be having this despawn issue with spawning the mobs in this way

humble tulip
#

Listen to player teleport event?

tender shard
#

the code where you make them persistent

humble tulip
#

Are you sure modifying the bukkit entity modifies the nms entity?

sage dragon
humble tulip
#

Since it's not added to the world

sage dragon
tender shard
#

show your code

#

?codeblocks

#

?codeblock

undone axleBOT
#

You can use the discord code block format to display code or just text in a more pleasing way:
```java
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {

}

}```
Becomes:

public class MyPlugin extends JavaPlugin {
    @Override
    public void onEnable() {

    }
}```
hardy garnet
#

I can never get them to work correctly >.>

tender shard
#

then use ?paste

#

?paste

undone axleBOT
humble tulip
#

Well call the nms methods yourself@sage dragon

#

See if that works

humble tulip
#

I had an issue similar to this with custom horses

#

`

tender shard
#

where "`" is the key to the left of your "backspace" key

humble tulip
#

^ that's the char

hardy garnet
tender shard
#

then I also don't know

gilded knot
sage dragon
hardy garnet
#

Lol its pretty annoying. From everything I can find online I am not doing it wrong :\

tender shard
humble tulip
tender shard
#

that's why I asked about them adding to the world, ealier

#

but they did that and it didnt help

sage dragon
tardy delta
#

on linux i had to press ` six times to get it three times lol

hardy garnet
#

Hmm. I have something I am going to try real quick. Is there a vanilla command I can issue to set persistence

humble tulip
tender shard
#

PROTOCOLLIB?!

#

protocollib is the wrost thing to ever use

#

it's the worst API that was ever made

humble tulip
#

😂😂

tender shard
#

if at all, use PacketEvents

#

or just NMS packets

tardy delta
#

reflections uwu

tender shard
#

protocolLib is a bad joke, invented by some insane person who wanted devs to suffer

#

it was invented as a joke and noone was ever supposed to use it

sage dragon
jagged monolith
#

I tried to mess with ProtocolLib once. Gave up after 10mins

drowsy helm
#

Who doesnt want to update their plugin lol

#

Protocol lib is a confusing mess

tender shard
#

it is

drowsy helm
#

With no docs

tender shard
#

use PacketEvents instead

#

or, if you are at least a bit smart:

#

just use the NMS classes

#

and use maven's modules instead

tardy delta
#

tf is that ij profiler thing

tender shard
#

it'll save you 98% of the headaches you'll have otherwise

tardy delta
#

it shows me nothing else but internal shit

tender shard
tardy delta
#

yea ive no idea what im doing tbh

tender shard
#

I also can't help you with that sorry

#

lmao

#

bc I'm going to bed again now

sage dragon
tender shard
tardy delta
#

hmm at 23h:15

#

probably

#

lol

hushed pawn
#
EntityPlayer p = ((CraftPlayer) player).getHandle();
p.getProfile().getProperties().get("textures");

it returns empty property map

#

how to fix
(i think i get it, thats because it is offline server)

tardy delta
#

the only fun thing that i see is that my char trie is allocating 20 million bytes of int arrays

#

20 mb lmao

#

then another 2 million bytes somewhere else

humble tulip
#

@sage dragon did you try with the nms methods first?

orchid gazelle
#

its easy

humble tulip
#

This packet doesn't seem to send data?

#

Not sure tho

gilded knot
#

Just a bit confused on the math here

tardy delta
orchid gazelle
#

lol

gilded knot
sage dragon
tardy delta
#

internal code

humble tulip
hardy garnet
#

Ok I modified the nbt data directly in-game and the mob isn't disappearing anymore. Its a spigot bug

humble tulip
#

So remaining time / 60

gilded knot
#

actually yeah, it should work

#

thanks

#

was a bit confused, that's all

vague swallow
#

Does anyone know how to the the block a wall sign is placed on?

tardy delta
#

getRelative(BlockFace.Whatever)

#

dunno if you call it on a block or a location

humble tulip
#

@sage dragon

#

I figured it out

#

You need to spawn the entity

#

Then send a set metadata packet

sage dragon
#

Oh, that would make sense 🤔

gilded knot
#

?paste

undone axleBOT
daring elm
#

Waht is this? config-plugins.bin 🤔

gilded knot
sage dragon
gilded knot
tardy delta
#

well executor is null

daring elm
sage dragon
humble tulip
#

Wdym?

opal wedge
#

I found another small bug in my code:

If the config has not been created yet, saveDefaultConfig(); creates it. But if then System.out.println(getConfig().getKeys(false)); is executed, the output is: [location_based, games].

However, if I run reloadConfig(); directly after saveDefaultConfig();, the output will return the correct config keys. [language, resource_pack, allow_fly, allow_default_watch, events, location_based, use_default_map, available_games_inventory_lines, games].

The config looks like this: https://paste.md-5.net/usisuzonif.http

Why do I have to run extra reloadConfig(); even though the config was just generated?

sage dragon
# humble tulip Wdym?

It just spawns where the player is standing, but doesn't actually ride the AreaEffectCloud how it's supposed to be

daring elm
#

Hey, waht is this? SUS or leggit?
plugin-config.bin

Plugin: CommandTool:
Hide Plugins & Cmd history

daring elm
#

yeah

chrome beacon
#

I'll take a look

daring elm
# chrome beacon Could you link that plugin

If you see this in your logs, that server is most likely infected. There are other indicators too - the compromised JAR will have inside of it a file called plugin-config.bin. We do have a one-liner for searching for this in your plugin directories, if you're on a Linux system:

#

& i found this in loot Plugins

#

detected maleware

chrome beacon
#

Yeah it's probably infected

#

I just wanted to double check

humble tulip
#

@sage dragon there's a set passengers packet

daring elm
#

my Windows blocked alle requests

humble tulip
daring elm
#

remove PLUGIN or the BIN File

chrome beacon
#

Have you started the server with the plugin installed

daring elm
#

i did newinstallation backup on my containers

sage dragon
daring elm
#

2nd local netzwork

summer scroll
#

Bro I'm going nuts, why does it return false? I've been stuck doing this for couple of hours now

chrome beacon
#

If you haven't run the plugin on the server yet just remove the plugin

humble tulip
daring elm
#

& Redownload?

chrome beacon
#

otherwise restore from backup or remove and replace all jar files

daring elm
#

isnt Spigot mc plugins infected from spigot resources i think?=

#

"i just download resources from spigot"

chrome beacon
#

If you don't know where it came from remove and replace all jar files

daring elm
#

how can my server infected

#

🤔

chrome beacon
#

There are cases of infected plugins on spigotmc

#

Generally avoid small unknown plugins that have been recently uploaded

sage dragon
#

I'd love to see that .bin file, sounds fun

daring elm
#

i check all my Plugins with this file.

chrome beacon
#

I've already found two cases of that malware before in our support server because it likes to break our plugin 😂

chrome beacon
daring elm
chrome beacon
#

That malware spreads to all plugin jars

daring elm
#

oh wow very fast foundet

jagged monolith
daring elm
#

my spigot-jar was infected

#

😂

jagged monolith
#

Then you'll need to replace all jars

chrome beacon
#

^

daring elm
#

yeah did already

chrome beacon
#

I hope you ran BuildTools to get your Spigot jar

#

Don't forget the libraries folder

daring elm
#

i download the resource directly from paper io server

chrome beacon
#

Gotta delete that and the cache folder if paper is installed

sage dragon
daring elm
#

i the .bin the maleware or the "PLUGIN/ Software" ?

#

i can test on my vm, Delete the bin, & restart mc server

#

/vm/network/cb-1/plugins

CityBuild.jar
plugins\Booster_v8.1.jar
plugins\CommandTool-2.2.0.jar
plugins\FastAsyncWorldEdit-Bukkit-2.5.1-SNAPSHOT-332.jar
plugins\floodgate-spigot.jar
plugins\Geyser-Spigot.jar
plugins\LuckPerms\libs\bytebuddy-1.10.22-remapped.jar
plugins\LuckPerms\libs\bytebuddy-1.10.22.jar
plugins\LuckPerms\libs\h2-driver-2.1.214.jar
plugins\Multiverse-Core-4.3.1.jar
plugins\PlaceholderAPI-2.11.2.jar
plugins\SimpleClans.jar
plugins\TAB.v3.2.1.jar
plugins\UltimateAutoRestart Build 52c.jar
plugins\Vault.jar
plugins\ViaBackwards-4.5.1.jar
plugins\ViaVersion-4.5.1.jar

sage dragon
daring elm
#

my infected files on my vm

sage dragon
#

But still, just reinstall all your plugins AND your server software, and probably your machine, just to be safe 😅

daring elm
chrome beacon
#

Yeah reinstall all jar files on your system

daring elm
#

before install network on my main server i test all systems on my vm

chrome beacon
#

Try to figure out where the malware came from

daring elm
#

i like connection is localhost the vm cant upgrade or nasted in my system

#

so stupid skid maleware

daring elm
#

skidded mc server german scene

chrome beacon
#

So you didn't download it from spigotmc?

#

ah wait you're talking about the origin of it

daring elm
#

i download my resources from spigot

daring elm
onyx fjord
#

are there any up to date NMS packet tutorials?

ornate mantle
#

is there a tool to migrate from spigot mappings to mojang mappings nms?

#

or do i do it manually

vague swallow
#

Why is .getLine() deprecated in a SignChangeEvent and what is a good alternative?

daring elm
#

1.19.3 Downloads?
Please Link Vault🙂

vague swallow
#

not there

tall dragon
#

what version u programming for

vague swallow
tall dragon
#

ru perhaps using paper api?

vague swallow
#

yes

tall dragon
#

ah yes

#

paper deprecated it because they use components

#

they want u to use that

vague swallow
#

but is it still working with .getLine()?

tall dragon
#

yea it should work fine

vague swallow
tall dragon
daring elm
#

anyone have vault 1.19.3 ?

chrome beacon
#

The latest vault works on 1.19.3

#

It's not version dependent

daring elm
gilded knot
#

Double check @daring elm

#

You just run it like a normal server.jar file

daring elm
hardy garnet
#

Figured out a work around for the problem lol

daring elm
#

No Results found

gilded knot
#

Use the spigot anti-malware

#

It's designed specifically for Java plugins

daring elm
#

MCAnitMaleware?

#

i dont trust this

gilded knot
#

Someone tell him it's legit lol

onyx fjord
#

whats up with some people making literally every variable possible final? does that even matter at all?

daring elm
#
  1. Banned on this server
  2. I did ask the onwer why used Discord-webhooks.
gilded knot
#

It's open-source too

onyx fjord
#

literally lol

daring elm
#

Idk i cant trust this plugin

#

i sus

onyx fjord
#

then check code yourself

gilded knot
#

186 Reviews, Open-Source

#

Made by Staff lol

onyx fjord
#

I STILL DONT TRUST IT!!!!

gilded knot
#

bruh

daring elm
gilded knot
#

I've used it before

jagged monolith
#

It's a legitimate plugin, but if you still don't trust it, it's fine. It's your server so only use what you trust.

gilded knot
#

welp

#

No point convincing you

tardy delta
daring elm
# jagged monolith It's a legitimate plugin, but if you still don't trust it, it's fine. It's your ...
        at optic_fusion1.antimalware.logging.CustomLogger.error(CustomLogger.jav                                                                                                                               a:139)
        at optic_fusion1.antimalware.scanner.realtime.DirectoryWatcher.lambda$ru                                                                                                                               n$0(DirectoryWatcher.java:119)
        at java.base/java.lang.Iterable.forEach(Iterable.java:75)
        at optic_fusion1.antimalware.scanner.realtime.DirectoryWatcher.run(Direc                                                                                                                               toryWatcher.java:104)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executo                                                                                                                               rs.java:539)

Ok now?

onyx fjord
#

yk what i love, when something is deprecated and theres 0 info what replaces it lol

tardy delta
#

whats deprecated

onyx fjord
#

just in general

#

not specifically spigot api (that one is documented if so)

tardy delta
#

im trying to document my parser

#

but i think the english goes brr

gilded knot
#

everyone knows letters are integers

tardy delta
#

im doing math with chars

frail gale
#

does someone know how I can change the gradle version on my IntelliJ Idea

tardy delta
#

atleast i cleaned this up

#

can probably optimize it even more

frail gale
#

bump

#

bump

tardy delta
#

i allocated 2 million ints for a char trie lol

gilded knot
#

1 sec

#

i have intellij open

frail gale
gilded knot
#

I only see it for SDKs though

#

sec

#

looking

frail gale
#

in SDKs I only have my Java JDK

#

I wanna change gradle version to 7.3 so I'll be able to develop a IntelliJ Idea Plugin

gilded knot
#

Look into

rotund ravine
#

Well it says it somewhere