#help-development

1 messages ยท Page 72 of 1

tardy delta
#

current setup

#

and it doesnt even work for some reason

agile anvil
#

Without saving or creating each key individually, by creating an object you could instantally serialize, deserialize and do much more

#
  • a map isn't space friendly, but it seams memory isn't a problem here x)
agile anvil
steep surge
#

Hmm

#

I mean that is true

#

It wouldnt be as halfassed

agile anvil
#

Well since you're happy and familiar with what you do it's fine

wide coyote
#

hey, any idea why I can't add the spigot 1.19.2 depend?

#

I can add 1.19.1 but not 1.19.2

agile anvil
#

Maven ?

wide coyote
#

gradle

agile anvil
#

Have you run buildtools?

wide coyote
wide coyote
#

I am trying to import spigot-api not spigot

steep surge
#

Im completely open to that idea, in fact I was about to actually write the class, yk

agile anvil
#

CoolPlayer player = Players.get("UUID");

player.getFirstJoin();
or
player.firstJoin;

makes way more sense to me

#

But it's maybe because you're too familiar with js

agile anvil
steep surge
#

I know, that is why I even wanted to rewrite the thing with classes, but just creating a new file at all puts me off

tardy delta
#

huh

steep surge
#

In cpp its much simpler and so it is in js

wide coyote
#

thanks anyway

mystic sky
wide coyote
#

ping me if anyone has another idea

steep surge
agile anvil
#

Have a look at other plugins' code to fully apprehend the concept

#

gl

steep surge
#

Thanks

#

will do

#

Doesnt bungeecord have uuid class?

eternal night
#

uuid is jdk provided

steep surge
#

Oh

eternal night
#

java.util.UUID

#

iirc

steep surge
#

okay

#

thanks

hushed pawn
#

I still searching for pvp legacy code, event found this string xd
if (this.getName().equals("Notch")) {
this.a(new ItemStack(Items.APPLE, 1), true, false);
}

agile anvil
#

No way ๐Ÿ˜ญ

steep surge
#

he looks like a js dev to me

outer river
#

Hello, can someone explain me why my string is empty when called ? i sysout my list and my string and only the list contains stuff

List<String> rewardsname = new ArrayList<String>();
    String list = String.join(", ", rewardsname);```
chrome beacon
#

Could you show your sysouts

outer river
kind hatch
#

Which sout is that?

#

You have 2 souts, but only one in console.

chrome beacon
#

^

outer river
#

rewardsname

tardy delta
#

lets follow naming conventions and let class names start with an uppercase character

kind hatch
#

You're gonna have to show more code. Where are you populating your arraylist?

outer river
#

in my "saveConfig" method

quiet ice
#

I wish you could define local methods or even have subroutines (maybe even have GOTO)

tardy delta
#

hmm it works

#

wondering why its not growing, light level is 10

#

oh its very slow

quiet ice
#

The greatest IDE to have ever been made

tardy delta
#

never used ij then?

quiet ice
#

Oh I have, but their default keybind layout is stupid

tardy delta
#

hmm i cant really say much here ๐Ÿ˜‚

quiet ice
#

And I am not too fond of their UI

tardy delta
#

their new ui is pretty hot

#

cant say that about eclipse uwu

quiet ice
#

If you consider a recolor a new UI I have to disagree

#

Although I have to say that is less worse than what was before at first glance

tardy delta
#

uhh they changed the placement of things and how thing are looking etc

#

well anyways, my Config class extends YamlConfiguration, would it be possible to reload the config from disk while this config object still stays valid, my current implementation doesnt seem to reflect the changes on the current object

#

would probably mean i have to reassign config object

#

that would suck as the current object would become invalid then

eternal oxide
#

reassign is the way to go

tardy delta
#

i could store an yamlconfig field in that class but then i have to delegate all the get methods :/

#

imma do that ig

harsh totem
#

When I try to use the command in game it doesn't show up and doesn't work. any ideas?

I have this in my main file: getCommand("toggle").setExecutor(new toggleCommand());
and this is my plugin.yml: name: PvP Manager version: '${project.version}' main: com.ytg667.pvp.Main api-version: 1.19 permissions: togglePerm: description: "Access toggle PvP in the server" default: op commands: toggle: description: "Toggles PvP in the server!" usage: /<command>

tardy delta
#

ah we arent following naming conventions anymore?

#

any permissions checks maybe?

harsh totem
#

I have op

tardy delta
#

errors?

#

probably not as yourent gettin output

agile anvil
#

Have you tried debugging?

eternal oxide
#

you didn;t add a permission line to your command

harsh totem
tardy delta
#

would work without permission added no?

harsh totem
# eternal oxide you didn;t add a permission line to your command
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (sender.hasPermission("togglePerm")){
            if (isOn){
                isOn = false;
                sender.sendMessage(ChatColor.GOLD + "PvP is now " + ChatColor.RED + "disabled!");
            } else {
                isOn = true;
                sender.sendMessage(ChatColor.GOLD + "PvP is now " + ChatColor.GREEN + "enabled!");
            }
        }
        return true;
    }```
#

the permission is here

hushed pawn
#

Does anyone know what this is? (String from Entity Human) (some kb calculations)
entity.g((double) (-MathHelper.sin(this.yaw * 3.1415927F / 180.0F) * (float) i * 0.5F), 0.1D, (double) (MathHelper.cos(this.yaw * 3.1415927F / 180.0F) * (float) i * 0.5F));
i = 1 if sprinting

tardy delta
#

isOn = !isOn lol

eternal oxide
#

pointless checking in the command when you define it in the plugin.yml

sturdy frigate
#

Is there a decent API for making right clickable items that show up GUI menus?

harsh totem
eternal oxide
#

you add a line to the command in the plugin.yml permission: togglePerm

agile anvil
eternal oxide
#

no need for any checks in the onCommand then

hushed pawn
harsh totem
#

the command doesn't show up

eternal oxide
#

then you are not registering an executor

eternal oxide
#

show

cold tartan
#

any ideas?

harsh totem
# eternal oxide show

it's exactly like in the message that i replied to but I made the permission check like you said

eternal oxide
#

show where you are registering the executor

tardy delta
#

brr had to add 300 lines of delegate methods

agile anvil
harsh totem
#

in the main

tardy delta
#

i guess this will work

#

and then reading from the new config

eternal oxide
# harsh totem getCommand("toggle").setExecutor(new toggleCommand());

Your method simplifiedjava @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { isOn = !isOn; if (isOn){ sender.sendMessage(ChatColor.GOLD + "PvP is now " + ChatColor.RED + "disabled!"); } else { sender.sendMessage(ChatColor.GOLD + "PvP is now " + ChatColor.GREEN + "enabled!"); } } return true; }

harsh totem
#

thx but that does not solve the problem

eternal oxide
#

check yoru log you will have an error

tardy flame
#

My ide looks so bad compared to yours

harsh totem
tardy delta
#

new ui preview

eternal oxide
#

check yoru startup log

tardy flame
#

I have currently a mod for dark mode

#

Plugin*

#

But yours looks so much better

tardy delta
tardy flame
#

Thx

tardy delta
#

add via "install plugin from disk"

eternal oxide
#

Pretty sure Spigot doesn;t allow a space

sterile token
#

Hello people, i want to know which is the equipvalent of YamlConfiguration from Spigot on Bungeecord

tardy delta
#

hows your claims plugin lol

sterile token
#

I think i didnt told you

tardy delta
#

fixed so much stuff today

sterile token
#

But these last days i was having hevay stress problems. I was diagnosed with a possible heart attack. Since days before he had had tachycardia

tardy delta
#

oh no

sterile token
#

And the first thing they told me is to stop smoking seeds

tardy delta
#

no more bird seeds for you

onyx fjord
#

we need 2 make this abuse term ๐Ÿ˜ญ

#

what the fuck is THIS

boreal seal
#

hey guys im wondering

#

question about sql

#

in general

#

if there 2 queries by the same time

#

from some reason it just does only a one

#

new to sql (used flatfiles before..)

stuck flax
#

How do I send a JSON message to a player?

boreal seal
#

oh alex

kind hatch
ivory sleet
onyx fjord
stuck flax
#

ty

ivory sleet
#

Since it uses some locks and stuff to make sure the database is safely manipulated at your command

stuck flax
boreal seal
#

should i just keep the connection open all the time?

#

what would solve it?

ivory sleet
#

But not at the same time

#

Use a connection pool

boreal seal
#

they dont in general thats the problem

#

hikaricp?

#

is fine?

ivory sleet
#

Yes

boreal seal
#

i hope he have either replacement for the boiler code..

ivory sleet
#

I mean generally connections are made to be long lived

boreal seal
#

(connectionhandler...)

boreal seal
ivory sleet
#

But this indeterministic behavior of yours might just indicate that your design of code is at fault

#

I mean thats a possibility

onyx fjord
#

is there bungee.yml documentation?

ivory sleet
#

Yeah iirc in the bungee section of the wiki

ivory sleet
#

Do you remap back?

cold tartan
#

im not sure

#

i just copied and pasted this

#

and replaced 1.18.2 with 1.19.2

cold tartan
river oracle
#

it should compile 2 or 3 jars depending on your setup

#

do not put the one named remapped into your folder

#

put the normally named jar

tender shard
cold tartan
river oracle
#

contains all the outputs of the process

#

or your custom output location

#

it should contain atleast 2 jars with the mojang remapping plugin though. One plugin that is the remapped and the other which contains the reobfuscated code

west umbra
#

Code issue, don't know the right line of code

onyx fjord
#

in bungee, i must provide uuid to send message, what should i set it to?

#

Nvm

tender shard
cold tartan
#

yes i think so

tender shard
#

erm well

#

what exactly do you click on to compile?

#

in intelliJ, you have to double click on "package" here. DO NOT use intelliJ's builtin compile thing

cold tartan
vocal cloud
#

Alex needs to update his intellij

tender shard
#

you have to use maven to compile, otherwise the remapping thing won't happen

#

you can make maven automatically copy it to your server folder afterwards

wraith cradle
#

(im on 1.19.1)
Im creating a block populator for a chunk generator and i am trying to use the limitedRegion.generateTree method to create a tree, but not a single tree actually gets summoned, is there anything i should look out for? i have no idea why it doesnt want to work, this is my populate function: java @Override public void populate(@NotNull WorldInfo worldInfo, Random random, int chunkX, int chunkZ, @NotNull LimitedRegion limitedRegion) { int x = random.nextInt(16) + chunkX * 16; int z = random.nextInt(16) + chunkZ * 16; World world = Bukkit.getWorld(worldInfo.getUID()); assert world != null; Integer topPos = u.HighestBlockOfMaterialAtXZ(x,z, Material.GRASS_BLOCK, worldInfo, limitedRegion); // ^ just a helper function if (topPos == null) return; limitedRegion.generateTree( new Location(world, x, topPos, z), random, TreeType.BIG_TREE ); }

tender shard
#

is topPos maybe null?

wraith cradle
#

it isnt, no

#

omfg im a dumbass, i figured it out

tender shard
#

what was it?

wraith cradle
#

toppos is the position of the highest block, while i want to put the tree above that block

#

toppos + 1

tender shard
#

yeah that would have been my next guess - check the return value of generateTree ๐Ÿ˜›

wraith cradle
#

yeah i thought of checking it but then i thought again

#

sry for the stupid question, my brain sometimes just turns off lol

tender shard
#

thats not a stupid question lol

cold tartan
grim ice
#

anyone has an idea

#

to use neural networks

crisp forum
#

do you have any idea how can I enchant create offers?
I've tried event.getOffers().set(0, new EnchantmentOffer(Enchantment.ARROW_DAMAGE, 1, 30)). it works on enchantable items but not on unenchantables

cold tartan
#

my custom "brainless" (no ai goals) entities seem to be saving as just the normal versions of the entity type. is the best way to fix this just tag the entites, then on startup replace the tagged ones with the brainless ones?

agile anvil
agile anvil
#

Yes, but be careful:
It's a server software that is ... Empty

#

There is no feature at all

#

For instance you'll even have to code a chest

#

But if you want something really lightweight, this is the solution

cold tartan
agile anvil
split lake
#

what would be the best way to save an arraylist after the server restarts etc

cold tartan
split lake
#

so just in a file?

#

ty

cold tartan
cold tartan
# split lake so just in a file?

i mean sort of an easier, but much worse way would be through persistent data containers and just like a frozen entity that is inaccessible lol

split lake
#

lol

#

nah ill just make a file

#

lmao

robust light
cold tartan
#

in the BetterTrolling.java file try replacing Troll with troll

#

it might not accept capital letters

robust light
#

When I do /pl the plugin is red

agile anvil
#

There should be an error in console

robust light
robust light
cold tartan
#

can you send the error that you get in chat?

#

*console

robust light
#

It's the same

agile anvil
#

Send the error please

#

An error explain what is the problem

cold tartan
robust light
agile anvil
#

The text

cold tartan
agile anvil
#

We don't need the type

#

Please then the "caused by:
Blablabli
Blablabla
CoolStuffHere"

robust light
#

No error

#

Just says internal error occurred

cold tartan
#

ok, do you mind copy & pasting your console into this chat?

#

not your chat

#

the place where you run the server

robust light
agile anvil
#

Bro

#

Screen your console

cold tartan
#

do you mind sending a picture or screenshot?

#

prob a picture because you are on your phone

grim ice
#

bro

#

making spigot forks

#

without knowing wtf ur doing is funny

#

so this is a huge server called

#

and they had a bug for years and didnt fix it

#

it was so a weakness potion gives u more dmg

#

(the opposite of what it should do)

cold tartan
cold tartan
#

they prob had to override default minecraft functionality

modern vigil
#

Metadata is non-persistent right?

cold tartan
robust light
#

I can't send Screenshots

agile anvil
#

Then we can't help you until you give us the log

cold tartan
kind hatch
cold tartan
cold tartan
modern vigil
cold tartan
#

yes

#

using the players persistent data container (pdc)

modern vigil
#

Using the method PersistentDataHolder#getPersistentDataContainer()

cold tartan
#

yeah

#

so player.getPersistentDataContainer()

modern vigil
#

Yep

cold tartan
#

that helps

modern vigil
#

I've used it before

#

I want to avoid having to host a database for as long as possible

waxen plinth
#

Would anyone be interested in helping to beta test my new command library? It's already rather stable from what I can tell but I'd like to have some people try it out and make sure it works for them as well as get feedback

modern vigil
#

And storing those IDs in persistent data is probably faster aswell

cold tartan
wide coyote
#

just because you can doesn't mean you have to

modern vigil
#

Storing some tag IDs on a player

#

tags as in suffixes

cold tartan
modern vigil
#

It's kinda the opposite

#

You can purchase tags from shops using items

#

This is for a server I'm a dev on

#

Right now it overrides your tag if you apply a different one

#

I'm making a tag menu which allows you to swap your tag

agile anvil
#

Yeah PDC are fine for this purpose

cold tartan
modern vigil
#

So I just need to store a list of the tags and their current one

cold tartan
modern vigil
#

I did it in Skript but that required some hacky methods

robust light
cold tartan
agile anvil
#

I'm sad now

modern vigil
#

And getting some experience with Java and faster load times is better

#

Better than a easier language

agile anvil
modern vigil
#

I'll try to make it in Java

#

or Kotlin

cold tartan
agile anvil
sterile token
#

Do you know any alternative for the YamlConfiguration but for Bungeecord??????

agile anvil
#

TOML ๐Ÿ˜

sterile token
sterile token
#

๐Ÿคข

agile anvil
#

Oh you mean you still want to deal with yaml

sterile token
#

No yaml its perfect bruh

#

For what i do its really good

agile anvil
#

Sorry, in that case I thought there were something integrated in bungee... But I'll have to check

sterile token
#

Oh something else im having issues trying to recreate the config section? - Im really dumb haha

sterile token
quiet ice
agile anvil
quiet ice
#

Tom's obvious markup language is not at all obvious and I refuse to understand why people can understand it

agile anvil
#

I understand it can hurt people

quiet ice
#

It is okay if you have simple key -> object pairs, but beyond that it gets complicated (especially arrays of objects are kinda difficult)

#

Though I guess a fair bit of that pain comes from a stupid implementation of the format by the forge devs

sterile token
quiet ice
#

What is that?

grave charm
#

hey sorry to interrupt but is someone willing to hear my problem? it's super odd

sterile token
quiet ice
#

Yes I know that but I was rather asking what a server interpreter is

sterile token
#

The one that looks like Html but simplier

#

Oh ok, they are designing like a server where they can execute that markdown code

quiet ice
#

While I have an idea what it could be, I am not 100% sure about this

grave charm
#

I am developing a plugin using Gradle, I am getting this error when I build (not in IntelliJ itself):
https://i.imgur.com/w7CKboV.png

again, there is no error in the IDE itself:
example code: https://i.imgur.com/9XC4a7y.png
example error:

D:\...\src\main\java\...\AdvancementHandler.java:31: error: cannot access AdvancementDisplayType
        System.out.println(display.getType());
                                          ^

my gradle version is 7.5.1 (latest)
my java version is 18 eclipse temurin (I have tried others such like OpenJDK)
I have tried java 17

spigot dependency looks like this:

compileOnly 'org.spigotmc:spigot:1.19.2-R0.1-SNAPSHOT' 

this does not work on spigot 1.19 either

I also have specified in the gradle.build the java version:

sourceCompatibility = targetCompatibility = JavaVersion.VERSION_18

let me know who has any ideas

#

I had a whole 10 minutes to type up my question

sterile token
#

Hahaha

quiet ice
#

?jd-s

undone axleBOT
grave charm
quiet ice
#

This is REALLY strange

#

since this is gradle I'd just do ./gradlew clean followed by ./gradlew build which may solve it

sterile token
#

Hahaha

quiet ice
#

I have seen similar issues in the past, but they have always been related to inner classes

cold tartan
#

compileOnly 'org.spigotmc:spigot:1.19.2-R0.1-SNAPSHOT'
for that line is it supposed to be spigot? or spigot api
?

grave charm
#

spigot

#

I use some things from there that aren't available in spigot-api

cold tartan
#

ok

quiet ice
#

?stash alternatively that AdvancementDisplayType class could be package-private which would be interesting to say the least

undone axleBOT
quiet ice
#

Nope, all public

quiet ice
next wing
#

Anyone please help me.. In my server the damage of mobs are increasing or the sword powers are decreasing.. I cant understand what to do

grave charm
#

tried that lol

quiet ice
#

The classes you are referring to were only made public a month ago

next wing
#

Damage rate is much decreased

agile anvil
grave charm
#

was very excited to not have to use reflection anymore

quiet ice
ancient plank
#

ok and

sterile token
quiet ice
#

Very different thing

quiet ice
#

@grave charm The only remaining thing I can think of is to try to use the eclipse compiler

#

Also, could you give the full build.gradle file?

grave charm
#
plugins {
    id 'java'
}

group 'dev.luaq'
version '1.1'

sourceCompatibility = targetCompatibility = JavaVersion.VERSION_18

processResources {
    filesMatching('plugin.yml') {
        expand(ver: getVersion())
    }
}

repositories {
    mavenCentral()
    mavenLocal()
}

dependencies {
    compileOnly fileTree(dir: 'libs', include: [ '*.jar' ])

    compileOnly 'org.spigotmc:spigot:1.19.2-R0.1-SNAPSHOT'

    compileOnly 'org.projectlombok:lombok:1.18.24'
    annotationProcessor 'org.projectlombok:lombok:1.18.24'

    testImplementation 'junit:junit:4.13.2'
}

test {
    useJUnit()
}
quiet ice
#

add the spigot repo just in case - although building spigot should already mean that you have the spigot-api in maven local and should never cause this kind of issues

#

So unlikely that it does anything, but it does not hurt to try

onyx fjord
#

Bungee ChatEvent also applies to commands, how do i make sure that message is not a command?

agile anvil
#

Check the first char, if it's a / it's a command

onyx fjord
#

bruh

#

nvm

agile anvil
#

It's late, have a coffee mate

#

It's alright

onyx fjord
#

its event.isCommand()

#

bet

cold tartan
#

when do entities load into the world?
im running this code:

sendConsole(ChatColor.GOLD + "TESTING 123");
for (World world : Bukkit.getWorlds()) {
    sendConsole(ChatColor.GOLD + world.getName());
    for (Entity entity : world.getEntities()) {
        sendConsole(ChatColor.GOLD + entity.getName());
        if (entity.customName().equals(makeID("brainless")))
            makeBrainless(entity);
    }
}
``` after the world is loaded with: ```yml
load: POSTWORLD
``` but for some reason no entities are listed even though when i join entities are visible
quiet ice
#

The chunks may not be loaded however

grave charm
#

entities are only in loaded chunks, to my knowledge, so assuming you're calling that onEnable it wouldn't work

quiet ice
#

If the chunks are unloaded the entities are generally too

cold tartan
#

oh duh

#

lol

#

ty

agile anvil
cold tartan
#

so i guess EntitiesLoadEvent is the best option

grave charm
#
D:\...\src\main\java\...\AdvancementHandler.java:31: error: cannot access AdvancementDisplayType
        System.out.println(display.getType());
                                          ^
  bad class file: C:\...\.gradle\caches\modules-2\files-2.1\org.spigotmc\spigot-api\1.19.2-R0.1-SNAPSHOT\50be78d8de2d77eb4fa460033d83a7c003b1834c\spigot-api-1.19.2-R0.1-SNAPSHOT.jar(/org/bukkit/advancement/AdvancementDisplayType.class)
    class file is invalid for class org.bukkit.advancement.AdvancementDisplayType
    Please remove or make sure it appears in the correct subdirectory of the classpath.
#

still occuring

#

this is post-.m2 deletion (again), post-buildtools --rev 1.19.2 (again), and post-adding the spigot maven repository

quiet ice
#

oh that error is actually more interesting

grave charm
#

trying clean build

#

nope.

quiet ice
#

try to put the spigot maven repo above maven local, but I'll see if that class file is really as corrupt as javac thinks

wraith cradle
#

while setting a block of a LimitedRegion (in a block populator), how can i set the "half" property of grass? im currently using limitedRegion.setType and theres no way to do it with it

grave charm
#

ordered as such already:

repositories {
    mavenCentral()

    maven {
        url 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/'
    }

    maven { url = 'https://oss.sonatype.org/content/repositories/snapshots' }
    maven { url = 'https://oss.sonatype.org/content/repositories/central' }

    mavenLocal()
}
agile anvil
quiet ice
#
org.clyze.jphantom.exc.IllegalBytecodeException: Instruction: 5, occurred while analyzing
   Class: org.bukkit.Registry$SimpleRegistry
   Method: get(Lorg/bukkit/NamespacedKey;)Lorg/bukkit/Keyed;
   Caused by: org.clyze.jphantom.exc.InsolvableConstraintException: java.lang.Enum <: org.bukkit.Keyed
    at org.clyze.jphantom.exc.IllegalBytecodeException$Builder.build(IllegalBytecodeException.java:84)
    at org.clyze.jphantom.constraints.extractors.TypeConstraintExtractor.visit(TypeConstraintExtractor.java:113)
    at org.clyze.jphantom.constraints.extractors.TypeConstraintExtractor.visit(TypeConstraintExtractor.java:46)
    at org.clyze.jphantom.JPhantom.run(JPhantom.java:84)
    at me.coley.recaf.util.JPhantomUtil.generate(JPhantomUtil.java:76)
    at me.coley.recaf.util.CompileDependencyUpdater.createPhantoms(CompileDependencyUpdater.java:55)
    at me.coley.recaf.util.CompileDependencyUpdater.lambda$install$0(CompileDependencyUpdater.java:37)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: org.clyze.jphantom.exc.InsolvableConstraintException: java.lang.Enum <: org.bukkit.Keyed

I mean there is something wrong with the jar, but nothing specific to that class. All decompiliers work as intended too which usually suggests near-valid class files

wet breach
wraith cradle
eternal oxide
#

BiSected

wet breach
#

And elgar beating me to it

agile anvil
#

Oh I was thinking about the grass block

#

It's because you have to set not one block but two

quiet ice
#

The issue we have most likely is that spigot is built using the eclipse compiler, which javac may not necessarily like

wet breach
quiet ice
#

that is possible?

wet breach
#

also the top one doesn't have = while the others do, not sure if that makes a difference

grave charm
#

I hate gradle, I only use it because this is a collaborative project

#

but the = shouldn't affect it

wet breach
quiet ice
#

Considering that you are using arbitrary jars, gradle is the only sensical solution I am afraid

grave charm
wet breach
#

you don't have to declare all the maven urls in separate maven blocks

#

but you can if you want to

grave charm
#

no

#

it didn't work

wet breach
#

ah nvm then

grave charm
#

it downloads it again then fails

wet breach
#

What error are you getting?

eternal oxide
#

You are using a normal buildtools generated jar? Not something you've compiled yourself?

quiet ice
#

Basically some class file (AdvancementDisplayType) is invalid according to the compiler (or maybe the annotation processor, but I doubt that)

wet breach
#

that isn't a problem with dependencies

#

that is complaining about the class file not existing

grave charm
#

I hadn't mentioned this earlier because I was hoping that solving this would be easier than it has been; but the InventoryEvent class is also yielding a similar error:

D:\...\src\main\java\...\AnvilRepairFix.java:12: error: cannot access InventoryEvent
        AnvilInventory inventory = event.getInventory();
                                        ^
  bad class file: C:\...\.gradle\caches\modules-2\files-2.1\org.spigotmc\spigot-api\1.19.2-R0.1-SNAPSHOT\50be78d8de2d77eb4fa460033d83a7c003b1834c\spigot-api-1.19.2-R0.1-SNAPSHOT.jar(/org/bukkit/event/inventory/InventoryEvent.class)
    bad RuntimeInvisibleParameterAnnotations attribute: InventoryEvent
grave charm
#

apparently it's number 5 in my Downloads folder

quiet ice
small current
#

does PlayerHeldItemEvent gets called if an item is set in the current held slot or added to inventory ?

#

like when slot not changed but item changed

quiet ice
#

it should be a transitive dependency of spigot, but we can never be too sure

grave charm
#
5:15:16 PM: Executing 'build'...


> Task :compileJava FAILED
1 actionable task: 1 executed
D:\...\src\main\java\...\AdvancementHandler.java:33: error: cannot access AdvancementDisplayType
        System.out.println(display.getType());
                                          ^
  bad class file: C:\...\.gradle\caches\modules-2\files-2.1\org.spigotmc\spigot-api\1.19.2-R0.1-SNAPSHOT\50be78d8de2d77eb4fa460033d83a7c003b1834c\spigot-api-1.19.2-R0.1-SNAPSHOT.jar(/org/bukkit/advancement/AdvancementDisplayType.class)
    class file is invalid for class org.bukkit.advancement.AdvancementDisplayType
    Please remove or make sure it appears in the correct subdirectory of the classpath.
D:\...\src\main\java\...\AnvilRepairFix.java:12: error: cannot access InventoryEvent
        AnvilInventory inventory = event.getInventory();
                                        ^
  bad class file: C:\...\.gradle\caches\modules-2\files-2.1\org.spigotmc\spigot-api\1.19.2-R0.1-SNAPSHOT\50be78d8de2d77eb4fa460033d83a7c003b1834c\spigot-api-1.19.2-R0.1-SNAPSHOT.jar(/org/bukkit/event/inventory/InventoryEvent.class)
    bad RuntimeInvisibleParameterAnnotations attribute: InventoryEvent
    Please remove or make sure it appears in the correct subdirectory of the classpath.
Note: D:\...\src\main\java\...\PlayerConfig.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1s
5:15:17 PM: Execution finished 'build'.
#
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':compileJava'.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:142)
    at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:282)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:140)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:128)
    at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:77)
    at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
    at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:51)
#

^ that is with stacktrace

grave charm
#

might say fuck it and just move this to my Mac lol

#

Windows is the only OS I have issues deving with

wet breach
#

your gradle stuff is corrupted

grave charm
#

of course it is

quiet ice
#

I thought setupDecompWorkspace was a FG-specific task

agile anvil
#

I always have trouble using gradle with Windows, even if I always do the same thing on linux it just doesn't wanna work

wet breach
#

personally I only use maven

dusk flicker
#

maven is nice ๐Ÿ™‚

river oracle
#

Mayvan

agile anvil
#

Gradle is great for other stuff than spigot

#

So as I'm used to it, I use it for Minecraft

dusk flicker
#

tell that to paper

river oracle
#

its good for payper :{

quiet ice
#

Yeah setupDecompWorkspace is forgegradle specific

agile anvil
#

But maven is totally great for spigot

#

Minecraft I mean ๐Ÿ˜‚

dusk flicker
#

wonder what minecraft is actually built on

river oracle
#

Probably regular java archive ๐Ÿ˜‚

dusk flicker
#

๐Ÿคฎ

river oracle
#

ant maybe

#

:P

quiet ice
#

Maven is great until you need to define dependencies that are not in a maven repository

wet breach
#

best they start with a clean one

river oracle
wet breach
river oracle
#

that as well ^

grave charm
#

well that all sucks

#

thanks everyone for trying to help

quiet ice
#

Right, you can do that trickery

wet breach
#

it isn't trickery

grave charm
#

but I should have learned my lesson a long time ago; windows just ain't it

quiet ice
#

Still not fully as intuitive as gradle

wet breach
#

it is literally setting the attribute on the dependency in maven that it is a system dependency

quiet ice
#

That is deprecated as far as I know

wet breach
#

it isn't

quiet ice
#

At least it is highly discouraged

rough blaze
#

Im getting error null

river oracle
#

nice

rough blaze
#

/paste

river oracle
#

?paste

undone axleBOT
quiet ice
#

Maven will print a wall of text if you use an artifact which declares a dependency with the system scope

river oracle
#

which is also pretty easy

#

mvn install :P

quiet ice
river oracle
wet breach
#

there is valid reasons for specifying local dependencies

river oracle
rough blaze
agile anvil
rough blaze
glass mauve
#

p = null

#

read your error message

vocal cloud
#

Name your variables better sad

dry forum
#

if i have a player stored in a hashmap does the value just dissapear or smthn when the player leaves? cus this is happening to me

river oracle
vocal cloud
#

Yeah but still

eternal oxide
#

Player objects are not reused between sessions

glass mauve
eternal oxide
#

use UUID, that never changes

rough blaze
agile anvil
#

Version ?

undone axleBOT
river oracle
#

show your full method

rough blaze
#

thats my method

vocal cloud
#

Player p ๐Ÿ˜ญ

river oracle
#

what the fuck how does that even work

#

I see too many things wrong here for this to even load properly

mystic terrace
#

Hello I'm having a problem with my code, someone can help me please?

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!

mystic terrace
dim bronze
#

๐Ÿ˜†

river oracle
mystic terrace
#

Anyone can tell me whats the error

#

xDD

river oracle
#

funny guy

rough blaze
river oracle
# rough blaze beats me

Okay first off why the fuck is your command in the same class as your main. second what the hell is setPlugin what does it do. you should define the command as another class for organizational stuff. Thirdly because of all above factors I'm surprised you aren't getting syntax errors.

#

?di

undone axleBOT
river oracle
#

Learn dependency injection and properly make a command

#

Fourthly you don't need to manually create the plugin directory it does it for you if you have a config

#

you're just wasting processing power very little, but still a complete and utter waste

agile anvil
#

Fifthly, add ActionBarApi as dependency and put it in the plugin folder too

dry forum
#

i have a hashmap where i store a boolean with a player UUID and whenever i leave the game and join back the varialbe just dissapears from the hasmap why is this happening

quiet ice
#

So it's a Map<UUID, Boolean>?

waxen plinth
#

You're storing it by Player

dry forum
waxen plinth
#

If you store it as a UUID that won't happen unless you remove it when they leave

quiet ice
#

If so, are you sure you are not explicitly removing it only player join/leave

waxen plinth
#

Are you restarting the server?

#

HashMaps do not persist on restart

eternal oxide
#

the entry can only vanish if you remove it

dry forum
#

no just leaving and im not removing it

waxen plinth
#

Can you show us more code

#

All of it if possible

dry forum
#

yeah 1 sec

agile anvil
#

?paste

undone axleBOT
eternal oxide
#

else if (!toggle.get(e.getPlayer().getUniqueId())) { is going to reurn null if its not there, so you already cover it in teh first if

#

oh right, you are checking the return

#

clean that all up by reading the value into a boxed bool

dry forum
#

?

cold tartan
#

is there a way to cast CraftEntity to Mob?

#

trying to do Mob#removeFreeWill()

agile anvil
#

How did you get the CraftEntity instance ?

river oracle
cold tartan
#

actually im just trying to cast org.bukkit.entity.Entity to net.minecraft.world.entity.Mob

river oracle
#

CraftEntity entity = (CraftEntity) ent

river oracle
agile anvil
cold tartan
#

so something like this?
((Mob) ((CraftEntity) entity).getHandle()).removeFreeWill();

#

looks a bit janky

#

is that it tho?

#

ill try it

eternal oxide
# dry forum ?
        UUID id = e.getPlayer().getUniqueId();
        Boolean test = toggle.get(id);
        if (test == null || test.booleanValue()) {
            schem.resetDisplay();
            schem.hideAll();
            toggle.put(id, Boolean.FALSE);
        }
        else if (!test.booleanValue()) {
            schem.resetDisplay();
            schem.hide();
            toggle.put(id, Boolean.TRUE);
        }```
#

as you are using boxed Boolean

#

a boxed primitive is used differently to an unboxed

dry forum
#

but when the messages get broadcasted the schematic variable is null

cold tartan
#

:D

wraith cradle
#

is there any efficient way to create an ellipsoid out of blocks, like very very fast?

eternal oxide
cold tartan
#

that might be pretty fast

#

idk

dry forum
#

that hashmap is a player variable

#

ill change it and see if it works

eternal oxide
#

you changed toggle to use a UUID, but the schematicHashMap is still using a Player

cold tartan
dry forum
#

ahh that works ty i didnt know player variables would just dissapear

cold tartan
#

im getting this error:

[18:08:31 ERROR]: Error occurred while enabling ExtraShitIDK v1.0-SNAPSHOT (Is it up to date?)
org.bukkit.plugin.IllegalPluginAccessException: Unable to find handler list for event com.defiantburger.extrashitidk.extraevents.EntityCollideEvent. Static getHandlerList method required!
        at org.bukkit.plugin.SimplePluginManager.getRegistrationClass(SimplePluginManager.java:771) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.SimplePluginManager.registerEvents(SimplePluginManager.java:703) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        at com.defiantburger.extrashitidk.ExtraShitIDK.onEnable(ExtraShitIDK.java:62) ~[ExtraShitIDK.jar:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:542) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_19_R1.CraftServer.enablePlugin(CraftServer.java:565) ~[paper-1.19.2.jar:git-Paper-131]
        at org.bukkit.craftbukkit.v1_19_R1.CraftServer.enablePlugins(CraftServer.java:479) ~[paper-1.19.2.jar:git-Paper-131]
        at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:636) ~[paper-1.19.2.jar:git-Paper-131]
        at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:422) ~[paper-1.19.2.jar:git-Paper-131]
        at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:306) ~[paper-1.19.2.jar:git-Paper-131]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1125) ~[paper-1.19.2.jar:git-Paper-131]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:305) ~[paper-1.19.2.jar:git-Paper-131]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]
#

ive never gotten it b4 so im not sure what it means

#
package com.defiantburger.extrashitidk.extraevents;

import org.bukkit.entity.Entity;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;

public class EntityCollideEvent extends Event {

    private static final HandlerList HANDLERS = new HandlerList();
    private final Entity collider;
    private final Entity collidee;


    public EntityCollideEvent(Entity collider, Entity collidee) {
        this.collider = collider;
        this.collidee = collidee;
    }

    @Override
    public @NotNull HandlerList getHandlers() {
        return HANDLERS;
    }

    public Entity getCollider() {
        return collider;
    }

    public Entity getCollidee() {
        return collidee;
    }
}

#

thats the code that it seems to have an issue with

quiet ice
#

the method must be called getHandlerList

#

Not getHandlers

cold tartan
#

oh

eternal oxide
#

Static getHandlerList method required!

cold tartan
#

oh lol

#

cant read

worldly ingot
quiet ice
#

Aha

cold tartan
#

wait nvm

#

one is static

eternal oxide
#

Static/instance

cold tartan
quiet ice
#

just create a new instance through the unsafe class and invoke the non-static method that way - problem solved

cold tartan
#

with this code:

package com.defiantburger.extrashitidk.extraevents;

import org.bukkit.entity.Entity;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;

public class EntityCollideEvent extends Event {

    private static final HandlerList HANDLERS = new HandlerList();
    private final Entity collider;
    private final Entity collidee;


    public EntityCollideEvent(Entity collider, Entity collidee) {
        this.collider = collider;
        this.collidee = collidee;
    }

    @SuppressWarnings("unused")
    public static @NotNull HandlerList getHandlerList() {
        return HANDLERS;
    }

    public Entity getCollider() {
        return collider;
    }

    public Entity getCollidee() {
        return collidee;
    }

    @Override
    public @NotNull HandlerList getHandlers() {
        return HANDLERS;
    }
}
#

might have fixed it

#

bruh

#

u do Bukkit.getPluginManager().callEvent(collideEvent); rather than collideEvent.callEvent();

eternal oxide
#

yes

vale veldt
#

Hello,

If I use NMS for example for particles in 1.8, should I create it also for each version higher than 1.8 or just with the spawnParticle method would be enough? I have tried to use the spawnParticle but it doesn't work, maybe I'm doing something wrong, I have set that if the version is 1.8 use NMS, if it is higher than 1.8 use spawnParticle()

waxen plinth
#

What are you trying to do with spawnParticle

vale veldt
#

Simply spawn a particle when the player mines a block ๐Ÿคทโ€โ™‚๏ธ

#

I have tried to use spawnParticle when it is version 1.13.2 for example and it doesn't work, but if I use NMS it works. So my question is if I use NMS in 1.8 for example does it force me to use NMS in every version?

#

I use NMS in 1.8 because spawnParticle() does not exist, but in 1.9 this method already exists and it should not be necessary to use NMS

eternal oxide
#

simply create an interface and two classes

#

one class for teh 1.8 NMS implementing the interface. The second class wrap the Spigot spawnParticle method while also implementing the interface

#

at startup you detect if teh spawnParticle method exists, if it doesn't instance your NMS class

#

if it does you instance your wrapper

#

All yoru code simply calls the same interface method no matter the version

vale veldt
#

This is how I have it set up, but when using the class where I have the spawnParticle() method from version 1.9 to 1.19 it doesn't work, it tells me that the particle is wrong :/ Right now I'm not on PC and I can't pass the code, but simply what I do is to convert the String containing "REDSTONE" to particle with the Particle.valueOf("") and it throws an exception that it is not a particle, when it should be

faint frost
#

I feel like im doing this wrong.

wet breach
#

this way the Java API will ask the OS what path separator it uses and then plugs it in

faint frost
wet breach
#

otherwise it looks fine to me

faint frost
#

i want to make sure i do this right before i start uploading it to git, so all criticism is welcome.

wet breach
#

oh e.getUniqueId().toString() if you want to be more cautious

faint frost
#

i heard the .toString() wasnt important?

wet breach
#

its not, just semantically correct

faint frost
#

ahh gacha, ill put a mental note on that

wet breach
#

welp time for me to go to work now

#

have fun ๐Ÿ™‚

faint frost
#

ayy you have a nice day at work man. thanks

frank kettle
#

Hello, my plugin is giving an error and searching I could only find 3 threads about it and people instead skipped the error and didn't actually help to fix it.

The error is:

java.lang.NullPointerException: Cannot invoke "org.bukkit.block.BlockFace.getOppositeFace()" because the return value of "org.bukkit.material.Sign.getAttachedFace()" is null

Code where the error is:

Sign sign = (Sign) e.getBlock().getState().getData();
    if (sign.getFacing() ....```
(Import for Sign: org.bukkit.material.Sign)

**How the error is happening:**
When finishing writing a sign, the plugin will check if it's attached to a chest so it's checking it's facing to see the location of the chest. This is working fine for every locations except the sign is facing NORTH specifically(Every other direction doesn't give error.

**I'm using server version:**
 `Paper version git-Paper-56 (MC: 1.19) (Implementing API version 1.19-R0.1-SNAPSHOT) (Git: 41238a4)`

**And for the plugin maven it's:**
```java
<dependency>
    <groupId>org.spigotmc</groupId>
    <artifactId>spigot-api</artifactId>
    <version>1.19-R0.1-SNAPSHOT</version>
    <scope>provided</scope>
</dependency>```
plugin.yml does contain `api-version: 1.19`

hope someone can help. thanks ๐Ÿ™
frank kettle
sterile token
#

Sorry for asking this nooby question but the first line is only displayed on Intellij right?

grave charm
#

this isn't an ideal fix, however, I was using paper ANYWAY

#

so figured I might as well reap the benefits

tranquil viper
#

Anyone that's worked with Fabric, is it similar to spigot?

vocal cloud
#

Modding is a lot lot harder

river oracle
#

main thing with modding if you don't know java its 10000x more punishing than spigot

#

open the jarfile yourself

#

its not distributed online

#

you need a decompiler to open it

iron glade
#

Wonโ€˜t really help tho as itโ€™s obfuscated

river oracle
#

atleast the ones with the spigot mappings do

#

I just decompile the one with spigot mappings thats in my m2 after installing remapped and use screaming sandles to find equivelant fields

reef lagoon
#

What I usually do is create a new fabric mod, it's deobfuscated and you can view the source code easily as a library

desert frigate
#

how can i disable mob AI for only certain players? bascially a zombie wont attach player1 but will attack player2

waxen plinth
#

EntityTargetEvent or something like that I think?

desert frigate
#

ah i see

#

tyhanks

worldly ingot
#

It's a bit of a spammy event so be careful what all you're doing in there

signal moat
#

I would like to have an armorstand without gravity that can still be affected by velocity
Currently, I have a custom ArmorStand class that extends NMS's ArmorStand
I tried setting this.setNoGravity to true & then used:

  public void travel(Vec3 vec3d) {

    if (!super.isNoGravity()) {
      super.travel(vec3d);
    } else {
      move(MoverType.SELF, vec3d);
    }
  }```
But the armorstand still doesn't want to respond to velocity and I dont really know what I should be trying next
desert frigate
#

basically i want mobs to stop attacking once a player reaches a level but the mobs continute to attack cause the event isnt called when they are already targeted

waxen plinth
#

LivingEntity#setTarget

inland axle
faint frost
#

how hard is it to update a players name in a custom config smh

#

sorry im fuming dont mind me

#

aight i give up. im not getting an error, it just updates every time i join.

grave charm
#

do you want it to reflect in a file?

#

if so, you need to call YamlConfiguration#save

faint frost
#

while that is useful, its not really what im looking for. My issue is that when it checks the config I.E. (myuuid).yml, it keeps running even if the name is equal to the name in game.

grave charm
#

so you want to keep track of player name changes in a file?

faint frost
#

yeah basically

grave charm
#

your problem is because you only load the data AFTER checking

faint frost
#

real shit, i knew it was simple

#

thanks man

grave charm
#

YamlConfiguration also has a static method of loading

#

which means you don't even need to create a new YamlConfiguration instance, you can just do YamlConfiguration.load

faint frost
#

ahh makes sense

#

again thank you

desert frigate
#

how can i teleport a player but not change their head movement/body

grave charm
#

get their current location, store their pitch and yaw

#

then set the target location's pitch and yaw to those values

desert frigate
#

ahh lemme try

#

works amazingly

#

but it is a little glitchy

#

but i dont see any other way

grave charm
#

yeah that's just how teleporting is unfortunately

iron glade
#

Is there a better solution to allow players rotating their head but not move than this? (PlayerMoveEvent)

if(e.getTo().getYaw() != e.getFrom().getYaw() || e.getTo().getPitch() != e.getFrom().getPitch()) {
  return;
}
//else do whatever```
grave charm
#

just compare the X Y Z of the to and from and if they don't match, cancel

desert frigate
#

how can i make it so it doesnt drop the block in BlockBreakEvent

grave charm
#

there is a gamerule for tile drops, but you should be able to setDrops iirc

desert frigate
#

ah ty

lost matrix
lost matrix
desert frigate
#

i just did event.setDrop(false) and it worked

lost matrix
#

Ah that has been solved already

faint frost
#

yee

#

it worky now

quaint mantle
#

Question, for database stuff

How do I mass edit every value for a row?

I.e; updating somebody's information when they leave

#

Is it something above the lines of UPDATE userinfo WHERE UUID=?

#

And then set the values accordingly..?

grave charm
lost matrix
#

Well you simply dont add a "WHERE" clause

quaint mantle
#

Oh, you can just add multiple values

lost matrix
#

What do you mean?

quaint mantle
#

I never knew you could specify multiple columns in the UPDATE statement

lost matrix
#

if you do

UPDATE playerdata SET points=0

Then every row in playerdata will have 0 points

quaint mantle
#

Oh, I'm trying to target 1 specific Key, UUID

lost matrix
#

Ah so its

UPDATE playerdata SET points=0, name='SomeName', lastseen=10032155530 WHERE playerid=someUUID
#

But in java you should use a prepared statement

UPDATE playerdata SET points=?, name=?, lastseen=? WHERE playerid=?

and insert your variables

quaint mantle
#

I was told this would work.. and it wouldn't cause lag, and this is for my plugin specifically:
UPDATE userinfo UUID=?,RANK=?,SHARDS=?,DISPLAYRANK=?,JOIN_MESSAGE=?,DISCORD_ID=?,CHAT_ROOM=?,NAME_COLOR=?,HIDDEN_FROM_USERS=?,HIDE_COORDINATES=?,RECEIVE_STAFF_NOTIFICATIONS=?,RECEIVE_PRIVATE_MESSAGES=?,RECEIVE_TPA_REQUESTS=? WHERE UUID=?

lost matrix
#

If this causes lag greatly depend on where you call this query

quaint mantle
#

As it's the 14th value in the statement

lost matrix
#

Which DB are you using?

quaint mantle
#

MariaDB

lost matrix
#

Then setObject. And make sure the field type is UUID

#

When creating the table

quaint mantle
#

But it is the 14th value, yes?

lost matrix
lost matrix
quaint mantle
# lost matrix Index starts a 1

That doesn't answer my question well, I tried storing things as UUID and I got errors in my console about invalid characters

#

So they are just VARCHAR's

lost matrix
#

No they are not just varchars

#

They are UUIDs

quaint mantle
#

I know that, and I used the method you had told me to when I had that issue, days ago

lost matrix
#

And make sure the field type is UUID
When creating the table

quaint mantle
#

And I still got errors

robust light
#

what can cause my plugin to be red when doing /pl?
Can someone help me fix it?

lost matrix
robust light
#

like an error in the source?

lost matrix
#

When you start the server

#

There has to be an exception

torn shuttle
#

the code for integrating translations into my plugin is as genius as it is profoundly dumb

robust light
lost matrix
#

?paste

undone axleBOT
lost matrix
lost matrix
# robust light wdym?

You can take what i said literally. If you dont understand something then specifically ask about that.

#

This happens in BetterTrolling.java line 9

robust light
#

public final class BetterTrolling extends JavaPlugin implements CommandExecutor

#

do I just remove "extends Javaplugin"?

lost matrix
#

I have no idea how your code is structured so i cant answer that.
Is BetterTrolling supposed to be your JavaPlugin class?

#

Because you can only have one

robust light
#

I followed some tutorial for the command registering

lost matrix
#

Push it on github or paste your classes here

#

?paste

undone axleBOT
lost matrix
#

You should create a separate class for your commands.
There is so much wrong here that im not even going bother explaining it all.
Just create a separate class.

dim palm
robust light
lost matrix
robust light
#

do you mean like plugin.yml?

#

sorry if I have pretty stupid questions, Im just starting out with spigot

lost matrix
#

It sounds to me as if you are just starting out with Java.
Spigot is not beginner friendly and if you dont know the basics of Java then you will have a very hard time.

robust light
#

I kinda know the basics of java, I learned it a few years ago. I just really dont remember much abt it

lost matrix
#

Well then: Create a separate class for each command.

#

Here is a basic guide for commands

robust light
#

thats the exact guide I followed

lost matrix
#

The guide tells you to create a separate class. Which you didnt do.

distant wave
#

is there event when player leaves?

lost matrix
lost matrix
distant wave
#

god im so dumb lol

modern vigil
#

What could InventoryHolder be used for?

lost matrix
#

We need more context

robust light
lost matrix
small current
#

does PlayerItemHeldEvent gets called if the item in the main hand of a player changes ?

small current
#

yeah not enough info

#

slot change yes

#

but if item in hand changes

#

does it get called ?

quasi flint
#

prob yes

#

just

#

try it out and see

#

insert gif here

lost matrix
#

Those 3 events should cover most hand interactions. (Plus the drop event)

chrome beacon
#

Static instance ๐Ÿ‘€

modern vigil
lost matrix
#

Thats all you need to know

sturdy frigate
#

How can I check equality between inventories? I'm making an inventory menu where users can click to get teleported to certain places. (or should I even check if it's the right inventory they're clicking or should I just check the items being clicked?)

lost matrix
sturdy frigate
#

Yes

lost matrix
#

I would recommend using a library for some time. GUIs can be very complex and you need a lot of java knowledge for a proper implementation.

sturdy frigate
#

Which library would you recommend? Though I would still like to know the answer to my prior question if possible

distant wave
#

how can i center text in scoreboard

sturdy frigate
# lost matrix Which of those questions?

Which library would you recommend for making inventory GUIS?
&

I'm making an inventory menu where users can click to get teleported to certain places. (should I check if it's the right inventory they're clicking or should I just check the items being clicked?)

lost matrix
#

You should abstract a button which contains delegation for events like a Consumer<InventoryClickEvent> and decoration for
the viewer like a Function<Player, ItemStack>

What you are attempting to do is very fragile and error prone.

lost matrix
#

never tested it though

sturdy frigate
shadow zinc
sturdy frigate
shadow zinc
#

have a look

#

And you can add some cool stuff like auto pagination

#

It makes life a bit easier, so I would certainly recommend using a lib or making your own

zealous osprey
#

Is there a reason why "GUIAction" is an abstract class rather than an interface?
If you use an interface you can always implement multiple of them, but only ever extend one class
The bit I'm talking about:

public abstract class GUIAction {
    public abstract void action(InventoryClickEvent event);
}```
lost matrix
# shadow zinc https://github.com/KyTDK/NeoUtils/tree/master/src/main/java/com/neomechanical/ne...

GUIAction is an abstract class even though it has no fields. This should be an Interface.
Which makes it effectively just a Consumer<InventoryClickEvent>. So this class can as well be deleted.

Your InventoryUtil class has fields and is therefor not a util class anymore. InventoryManager does not belong in there.

Your InventoryManager#getMenuItem() method is very inefficient. You should do a simple Map<Integer, InventoryItem> inside your
InventoryGUI class and then get the InventoryItem by the clicked slot. Iterating over all ItemStacks and checking for equality is quite slow and error prone.

boreal seal
#

why people store UUID's instead of playername?

#

(beside player can changename)

dim palm
#

uuid dont deletes when player leaves

boreal seal
#

but lets say i store in sql database

#

at the moment i store uuid's and convert them to bytes

#

to save storage amount

onyx fjord
#

are there any tools to check what plugin uses certain event?

boreal seal
onyx fjord
#

hell no im not decompiling 60 plugins

boreal seal
#

oh

#

nah not really

dim palm
#

how can i hide a player armor

onyx fjord
#

there was one tho

#

forgor the name

boreal seal
#

maybe stick to protocol lib

#

should make it easy

dim palm
#

mm

onyx fjord
#

packetevents is more chill

#

and you can shade it

quasi flint
#

and not so

#

huge as protcollib

river oracle
#

didn't retrooper make packetevents

onyx fjord
#

yes

onyx fjord
#

๐Ÿฅต

#

and number of pull requests

river oracle
#

nice what does packetevents all do

quasi flint
#

packetevents 2.0 > protocllib

river oracle
#

might consider using it

#

Right now I just use regular NMS

#

NMS > protocollib

quasi flint
#

pain to maintain

river oracle
#

seriously though remapped is better than protocollib lol

tender shard
#

packetevents is protocollib without all the bullshit

tender shard
river oracle
#

i've never used protcollib lol

quasi flint
#

just dont

river oracle
#

it looked harder than mappings so I just never used it

#

why overcomplicate things

quasi flint
#

packetsvents is easy

#

but

#

protocllib

#

yikes

river oracle
tender shard
#

the only weird thing about packetevents is this weird init stuff

eternal oxide
#

behind the scenes there are some still using spigot mappings

tender shard
#

you need to call like 4 init methods lol

#

.load()
.init()
.anotherThing()
.andAnother()

river oracle
shadow zinc
#

how do I get the index of an item that was added using inventory.addItem()

eternal oxide
#

you don't

shadow zinc
#

okay thanks

eternal oxide
#

it may have been added to a stack or a slot, no way of knowing

shadow zinc
#

so the best way would be to create an addItem method and set the item by gettings inventory size-1

river oracle
shadow zinc
river oracle
#

eh thats shotty at best its not always guarenteed to be at that slot, but you can try

marble copper
#

Hey can someone tell me what a plugin api is?

shadow zinc
eternal oxide
#

You have been here long enough for me to know you are trolling

marble copper
shadow zinc
#

Okay lets say you had a plugin called car, and it goes honk. You can get the plugin's api to call the honk method. It basically allows you to use things contained in that plugin

#

It allows communicate between that plugin and yours

eternal oxide
#

Spigot provides an API between Minecraft and yoru plugin. A Plugin API provides an API between your plugin and theirs.

modern vigil
#

Can someone explain or link a resource on how bigger plugins handle and register commands?

eternal oxide
#

boilerplate code.

modern vigil
#

I don't see a command package in every single platform (bukkit, bungee) but I do see one in common (luckperms is this plugin). Do they use adapters or something?

shadow zinc
#

oof

shadow zinc
#

isn't ACF by aikar a command framework?

#

I've heard numerous people talk about it

modern vigil
#

If I'm talking complete bs, where can I learn about how plugins actually get loaded?

#

And about how Minecraft registers commands?

shadow zinc
#

So you want to make your own commands for your plugin?

modern vigil
#

I know how to do that but where can I read about how they actually get loaded by the server software?

eternal oxide
#

?stash

undone axleBOT
shadow zinc
#

Oh so you want to understand the actual workings?

eternal oxide
#

thats teh Spigot code

shadow zinc
#

Yep, have fun reading that

sturdy frigate
#

Is teleportation through a compass a built-in feature in spigot 1.19? (looking into a solid platform and left clicking apparently teleports you there)

shadow zinc
modern vigil
#

Does the same as //thru

sturdy frigate
#

Is there a way to disable that?

modern vigil
#

You'd have to check the config

sturdy frigate
#

Oh i found this:

    directory:
--- delete start
navigation-wand:
    item: minecraft:compass
    max-distance: 100
--- delete end
scripting:
    timeout: 3000
    dir: craftscripts
#

Can i remove the entire clause?

frank kettle
#

I don't wanna repost so will just reply towards it

modern vigil
#

Or set the max distance to 0

frank kettle
#

Nobody ever uses that and if u do, u don't click with it

modern vigil
#

I found something

#

Set the whole section of navigation-wand to -1

#

navigation-wand: -1

sturdy frigate
frank kettle
modern vigil
#

These are the 2 solutions I found on the Bukkit forums

#

Yes, it's from 2014 but it probably works

frank kettle
#

Well world edit hasn't changed much anyways ๐Ÿคฃ should work

tardy delta
#

bosjoer

modern vigil
#

I'm looking trough the Bukkit code but I can't seem to find an implementation for Server

tardy delta
#

CraftServer

young knoll
#

Almost all implantations are in craftbukkit

modern vigil
#

And where do the commands from a PluginDescriptionFile get loaded into commandMap?

tardy delta
#

lol

#

maybe in the pluginmanager

charred blaze
#

why cant i set variables in runnables?

tardy delta
#

because that variable isnt final

modern vigil
#

PluginCommandYamlParser

#

oddly specific

charred blaze
tardy delta
#

yes

eternal oxide
#

you can change teh value of a final variable, you can;t change its assignment

charred blaze
#

wdym

charred blaze
tardy delta
#

make it a one element array or an atomicboolean

charred blaze
#

what?

eternal oxide
#

Validjava final List<String> strings = new ArrayList<>(); strings.add("test");Invalidjava final List<String> strings = new ArrayList<>(); strings = new ArrayList<>();

charred blaze
modern vigil
#

Greened, you cannot change the muted variable because the Runnable is not ran on that thread (Elgar, correct me if i'm wrong)

charred blaze
#

how can i get muted variable in other runnable? rn?

modern vigil
#

also

#

final means it's a constant variable

#

it cannot be changed iirc

chrome beacon
eternal oxide
#

Your muted variable only exists inside that event/runnable

tardy delta
#

creating a getter and setter for it should work no?

#

ah wait not a field

eternal oxide
#

You are of the mistaken idea everything waits for your runnable to finish and sets muted.

#

Your event finishes and is gone by the time your runnable exits

charred blaze
#

what can i do then?

eternal oxide
#

if you want to change a value thats going to be accessed elsewhere, it needs to be a field or stored in a Collection somewhere

charred blaze
#

why wouldnt collection be empty if second runnable is running first?

eternal oxide
#

something like java PlayerRegistry.getPlayer(id).setMuted(true);

#

if you were storing a registry of players with settings you could change

tardy delta
#

hmm i dont like the lack of documentation for acf

charred blaze
eternal oxide
tardy delta
#

๐Ÿ’€

charred blaze
eternal oxide
#

no

charred blaze
#

why

eternal oxide
#

if you create a runnable it doesn't even start until your current code execution ends

#

everythign happens in a sequence, one after another

eternal oxide
#

even async doesn;t start the instant you ask it to

charred blaze
#

how can code execute if runnable is not runned?

eternal oxide
#

what?

charred blaze
#

yes

#

what?

#

sorry for my bad english

#

can you drop me example fixed code and maybe ill understand better?