#development

1 messages · Page 56 of 1

sonic nebula
#

like pvp class

thin tendon
#

Yep

#

Lemme get an example

sonic nebula
#

i would suggest to use diffferent keyword

#

this one is a part of java its like calling a interface Double lol (not sure if IDE will allow it tho)

thin tendon
#

The current thing does actually work

#

here is the most advanced one ```java
public class MageClass implements ClassCommand.Class {
public static final NamespacedKey WAND_KEY = NamespacedKey.fromString("wand", VampirismMCPlugin.INSTANCE);
@Override
public void createInventory(PlayerInventory inventory) {
inventory.clear();
ClassUtils.goldArmor(inventory);

    ItemStack mageWand = new ItemStack(Material.STICK);
    ItemMeta meta = mageWand.getItemMeta();

    if (meta != null) {
        meta.addEnchant(Enchantment.KNOCKBACK, 2, true);

        AttributeModifier modifier = new AttributeModifier(UUID.randomUUID(), "generic.attack_damage", 5, AttributeModifier.Operation.ADD_NUMBER);
        meta.addAttributeModifier(Attribute.GENERIC_ATTACK_DAMAGE, modifier);
        meta.getPersistentDataContainer().set(WAND_KEY, PersistentDataType.STRING, "fire");

        meta.displayName(MiniMessage.miniMessage().deserialize(WandUtils.WandType.valueOf(meta.getPersistentDataContainer().get(WAND_KEY, PersistentDataType.STRING).toUpperCase(Locale.ROOT)).getName()));

        meta.lore(List.of(Component.text("A mystical wand with ancient magic")));

        mageWand.setItemMeta(meta);
    }

    inventory.setItem(0, mageWand);
}

}```

#

and the event used for the wand ```java
@EventHandler
public void onPlayerUse(PlayerInteractEvent event){
Player p = event.getPlayer();

    ItemStack wand = p.getInventory().getItemInMainHand();
    ItemMeta wandMeta = wand.getItemMeta(); // Get the ItemMeta

    if (wandMeta != null) { // Check if it's not null
        PersistentDataContainer dataContainer = wandMeta.getPersistentDataContainer();

        if (dataContainer.has(MageClass.WAND_KEY)) {
            if (event.getAction().equals(Action.LEFT_CLICK_AIR) || event.getAction().equals(Action.LEFT_CLICK_BLOCK)) {
                if (dataContainer.get(MageClass.WAND_KEY, PersistentDataType.STRING).equals(WandUtils.WandType.FIRE.name().toLowerCase(Locale.ROOT))) {
                    dataContainer.set(MageClass.WAND_KEY, PersistentDataType.STRING, WandUtils.WandType.ICE.name().toLowerCase(Locale.ROOT));
                } else {
                    dataContainer.set(MageClass.WAND_KEY, PersistentDataType.STRING, WandUtils.WandType.FIRE.name().toLowerCase(Locale.ROOT));
                }
                wandMeta.displayName(MiniMessage.miniMessage().deserialize(WandUtils.WandType.valueOf(wandMeta.getPersistentDataContainer().get(MageClass.WAND_KEY, PersistentDataType.STRING).toUpperCase(Locale.ROOT)).getName()));
                wand.setItemMeta(wandMeta);
            } else if (event.getAction().equals(Action.RIGHT_CLICK_AIR) && p.getCooldown(wand.getType()) == 0) {
                WandUtils.use(wand, p, WandUtils.WandType.valueOf(dataContainer.get(MageClass.WAND_KEY, PersistentDataType.STRING).toUpperCase(Locale.ROOT)));
            }
        }
    }
}```
sonic nebula
#
        ItemStack mageWand = new ItemStack(Material.STICK);
        ItemMeta meta = mageWand.getItemMeta();

        if (meta != null) {
            meta.addEnchant(Enchantment.KNOCKBACK, 2, true);

            AttributeModifier modifier = new AttributeModifier(UUID.randomUUID(), "generic.attack_damage", 5, AttributeModifier.Operation.ADD_NUMBER);
            meta.addAttributeModifier(Attribute.GENERIC_ATTACK_DAMAGE, modifier);
            meta.getPersistentDataContainer().set(WAND_KEY, PersistentDataType.STRING, "fire");

            meta.displayName(MiniMessage.miniMessage().deserialize(WandUtils.WandType.valueOf(meta.getPersistentDataContainer().get(WAND_KEY, PersistentDataType.STRING).toUpperCase(Locale.ROOT)).getName()));

            meta.lore(List.of(Component.text("A mystical wand with ancient magic")));

            mageWand.setItemMeta(meta);
        }
#

you clooud make a util for it to create Itemstacks

thin tendon
#

ye I probably will, already have for armor sets and potions

lyric gyro
#

How can I use the null player (from parse command) in a plugin?

#

can i just put null?

sonic nebula
#

if its Nullable you can just put a null

lyric gyro
#

yeah i just checked, null is allowed as player in .setPlaceholders

sonic nebula
#

since if its nullable it means its optional optiion in a method

#

u cant

#

u mean in PAP?

lyric gyro
#

yeah

sonic nebula
#

placeholdersAPI depend on player

#

u can make just return value same

lyric gyro
#

you know the /papi parse --null %placeholder% command

sonic nebula
#

if the placeholder as default return then i guess it not matter what u put into it

#

also go placeholder-api wrong chat

sonic nebula
#

wrong chat move on please.

lyric gyro
#

idk man even cj is providing support for papi here

sonic nebula
#

go to Placeholder-ap / general plugins

sterile hinge
lyric gyro
sonic nebula
latent remnant
#

When is DelexeMenus going to be open-sourced?

dense drift
#

at some point it will

sonic nebula
#
    @EventHandler
    public void countertest(EntityDamageEvent event){
        if (!counterhits.containsKey(event.getEntity().getUniqueId())){
            counterhits.put(event.getEntity().getUniqueId(),0);
        }
        counterhits.put(event.getEntity().getUniqueId(),counterhits.get(event.getEntity().getUniqueId()) + 1);
        Bukkit.broadcastMessage(ColorUtils.color("&d" + event.getEntity().getName() + "&f&l total hits &a" + counterhits.get(event.getEntity().getUniqueId())));
    }
#

does event execute twice everytime entity get damage

#

or im total idiot where i messed up here

#

also please dont mind that i check if he existed i know i cloud add him to map on join

#

how ever its only to test how many hits are registered on server sidie

dense drift
#

there is Map.merge btw

#

counterHits.merget(uuid, 1, Integer::sum)

sonic nebula
#

so i assume the event is just called twice everytime am i correct?

dense drift
#

idk I dont see why it would be

hoary scarab
sonic nebula
#

nah

#

my plugin does not support reload features

#

also its the only plugin in the server

#

i guess shit event execute twice

#

thanks

#

because it boardcasts only once

#

in code

#

but it boardcast twice now even after i did my 200IQ fix by doing /2 lol

#

so it goes 0 1 1 2 2 3..

river solstice
#

Cool

orchid wyvern
#

how would i send a colored placeholder using rgb colors?

sonic nebula
orchid wyvern
#

I'm writing an extension plugin

#

can i send color with my placeholder?

dense drift
#

yes, but papi no longer parses the colors, so if you send &cText, is the job of the plugin that displays the placeholder to parse it

orchid wyvern
#

I thought that might be the case

#

been a while since i've worked with spigot

dense drift
#

you can parse the colors with the ChatColor.translate .. method

orchid wyvern
#

yes of course

#

using 1.20 so chatcolor deprecated in favour of adventure api

dense drift
#

sadly you can not return components

#

only MM if that helps

proud pebble
hazy nimbus
#

I mean that's the dillema isn't it? If paper were to remove ChatColor, it would be basically impossible for plugins to be compatible with both spigot and paper

#

Either one, or the other

warm steppe
#

who even uses spigot and it's api?

#

also minimessage >>>>>>

#

makes life so musch easier

pulsar ferry
hazy nimbus
#

Yeah, but afaik it doesn't use the native methods on paper

#

So, if paper were to remove the old color system, the adventure bukkit adapter would probably break

proud pebble
hazy nimbus
#

They have not

#

This is a purely hypothetical scenario

sonic nebula
#

i still use bukkit and nms

hazy nimbus
#

I just hope that's a joke

nimble vale
#

i have tried some pubsub stuff with redis (lettuce api) and works

  • server to server
  • proxy to server

but strangely proxy is not getting the message from servers

  • server to proxy
#

using the same code for all servers and proxy, couldn't figured out for 20 hours

#

tried to debugging but it just does not getting the message on proxy if it sent from server

#

maybe it has something to do with velocity

nimble vale
#

i think i am going to use the bungee messaging for server to proxy part

dense drift
#

Keep in mind that it requires a player to be online

nimble vale
#

and i guess you need a player reference as a parameter to send a plugin message

#

or not

#

maybe sockets?

#

it started to get a little bit messy

broken elbow
#

You don't need a player reference to send it but if no player is on the receiving side, the message is discarded

nimble vale
#

i just checked some plugins and i don't think that is a velocity issue

dense drift
#

Make sure you are connecting to redis though

robust flower
#

I was trying to use mki crate (https://crates.io/crates/mki), but my antivirus didn't allow proc-macro2 to be executed when cargo was compiling my project just after I added this mki crate.

Cargo error:

error: failed to run custom build command for `proc-macro2 v1.0.66`

Antivirus log:

Event: Malicious object detected
User: DESKTOP-IJRJIGM\User
User type: Initiator
Application name: cargo.exe
Application path: C:\Users\User\.rustup\toolchains\stable-x86_64-pc-windows-msvc\bin
Component: File Anti-Virus
Result description: Detected
Type: Trojan
Name: VHO:Trojan-Downloader.Win64.Convagent.gen
Precision: Heuristic Analysis
Threat level: High
Object type: File
Object name: build_script_build-bd4b88e523d04046.exe
Object path: D:\Local Disk\Users\User\Documents\TrashProjects\CLionProjects\RustPlayground\target\debug\build\proc-macro2-bd4b88e523d04046
MD5 of an object: 297F49F22AB15A0BDE347BB071B5A5CF
Reason: Cloud Protection

Does anyone know what is this proc-macro2 and why was it blocked by an antivirus?

small arrow
#

https://paste.helpch.at/enumimihok.java
Any reason why my plugin is disabling and not picking up on Vault? Theres my main class. On startup it just doesnt recognize that vault is installed and is just disabling...

#

pls ping me if you know why

worn jasper
small arrow
#

Sure one sec

#

unless they changed the API implementation i really dont know whats wrong with what I'm dojng

#

doing

worn jasper
#

make sure vault is loaded before your plugin

#

any errors?

small arrow
small arrow
worn jasper
#

just because you check if vault is there doesn't mean he loaded first @small arrow

tight tide
#

needs a vault impl provider like essentials or something @small arrow

#

whats your current loaded plugins

wraith scarab
#

Does anyone have ressource on how to make api using a plugin ?

#

Like how can i acces playerdata of my plugin A inside my plugin B

#

An possibly without give out my code (like the devlopers of plugin B only have acces of an interface and not to a class that contains code)

river solstice
#

educate yourself

dense drift
#

Is there any way to detect what plugin dispatched a command?

worn jasper
#

I recall I did it once

#

now... how I did it... no idea

dense drift
#

yeah it is very annoying when a random plugin runs a command and I have to find it lol

river solstice
dusky harness
#

just tells you to minimize api visibility

dense drift
dusky harness
#

if you want to completely hide the code

#

but you could have an interface

#

but the api jar would still have your internal code that isn't needed (but it doesn't really matter)

worn jasper
#

unless the plugin makes the player execute it

dense drift
#

I need it for commands run through console* ups

forest jay
# wraith scarab Does anyone have ressource on how to make api using a plugin ?

From what I have seen you have a interface that has all of the methods you want the API to have. Then, in the actual code, you implement it. Then, you only give the API interface to Plugin B, so they have no access to the implementation or any of the code it calls. There is a bit more to it than just this, but this is the basics. I personally don't know exactly how to do it though.

#

I couldn't find any good resources, but I only did a quick search

dusky harness
# wraith scarab An possibly without give out my code (like the devlopers of plugin B only have a...

What you can do is have like an interface EpicPluginAPI which has like getCoolValue() for ex
Then a class EpicPluginAPIImpl (the -Impl suffix is just preference) that implements EpicPluginAPI

Then in your main class, you can have like public static EpicPluginAPI getAPI()

If you upload your plugin to GitHub, then devs can use https://jitpack.io to easily use your api (you usually don't need to do anything to make jitpack work besides upload the code to github as long as you're using gradle or maven)

Note: this is a simple method - there are better ways to do this, but the first time doesn't need all the fancy stuff

sonic nebula
#

Like it’s most simple

dense drift
#

yeah well, without doing that D:

sonic nebula
#

Hmmmm can u describe how it execute command ?

#

Via console ?

dense drift
#

Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "command here")

sonic nebula
#

i think i have an idea

#

but im via my phone

#

so get the concept + - from code snippet

#

u can use bytecode Manipulation and replace the method and then u load the modified Bukkit class at runtime

#

i have even better idea!!!!

#

sec acutally i can write this one on phone

#

if it works like it then it should be good

#
@EventHandler
public void serverExecutesCommand(ServerCommandEvent event){
System.out.printin("stacktrrace for gaby lol + " + event.toString);
#

i checked this event exists in bukkit

#

just make it toString and look at the stacktrace im not sure like what it loooks like

#

but u will find callinig class 100% theer.

#

theer

#

there*

#

fk

#

Constructor and Description
ServerCommandEvent(CommandSender sender, String command)
Method Summary
Methods
Modifier and Type Method and Description
String getCommand()
Gets the command that the user is attempting to execute from the console
static HandlerList getHandlerList()
HandlerList getHandlers()
CommandSender getSender()
Get the command sender.
boolean isCancelled()
Gets the cancellation state of this event.
void setCancelled(boolean cancel)
Sets the cancellation state of this event.
void setCommand(String message)
Sets the command that the server will execute

#

200 IQ

#

its from docs

#

actually modification to old code i send

#
@EventHandler
public void serrverExecueCommand(ServerCommandEvent event){
System.out.printin("we got you motherfuckerrr slap kawaii" + event.getSender.getclass.toString);
}
#

solved completely docs are great.

#

damn i need to get a job in IT company

dense drift
#

You are probably missunderstanding my question. I need to know what plugin dispatched the command, not whether it was run by console.

sonic nebula
#

oh shit yeah then go back to Stacktrace option...

#

also in the event sender returns the jar that executed i think

#

that class

#

of other plugin

dusky harness
#

just hopped in so sorry if I'm missing context
but if using stacktrace, use stackwalker 👍 👍 👍
(gets stack "lazily" so more performance-efficient)

sonic nebula
#

nah nah what i said will work i think

#

dkim im wrong event.getSender.getclass will return other jar class

dense drift
#

CommandSender getSender() Get the command sender.

sonic nebula
#

yes

#

when u send command u take instance of main class

dense drift
#

aka ConsoleCommandSender or Player

sonic nebula
#

its what gonna appear

dense drift
#

no you don't

#

d;bukkit#dispatchCommand

uneven lanternBOT
#
public static boolean dispatchCommand(@NotNull CommandSender sender, @NotNull String commandLine)
throws CommandException```
Description:

Dispatches a command on this server, and executes it if found.

Returns:

returns false if no target is found

Parameters:

sender - the apparent sender of the command
commandLine - the command + arguments. Example: test abc 123

Throws:

CommandException - thrown when the executor for the given command fails with an unhandled exception

hoary scarab
#

I don't think there is a way in the current software to check what plugin sent a command. You'd probably have to add your own code in the API

sonic nebula
#

tthen what can i say get the stracktrace of event via event.tostring

#

if not byte code manipulate on runtime and change class

dense drift
#

great

sonic nebula
#

else decompile and recompile

#

how ever i think iit wll be there in the stacktrace

#

99%

#

like there yes or no but i dont want to say yes for sure because im not sure about what its printing

hoary scarab
#

Whats with the spam tony? You can write more then 10 words per message lol

sonic nebula
#

nah im used to send short messages on my cellphone

minor summit
#

dkim the only one that said anything coherent lol

wraith scarab
wraith scarab
dusky harness
# wraith scarab I will try to use this method i think i understand what do you try to explain an...

On phone so I can't explain much rn but for ex

  • maven central (or self hosting a maven repo) instead of jitpack
  • gradle/maven modules to split between api interfaces and the actual plugin, and this also let's you only publish the api module
  • not using a static getter as bukkit has some built in ways (although tbh I don't use bukkits method lol)

I think that's about it (kinda ordered from most fancy to least fancy)

wraith scarab
dusky harness
#

Np
I'm prob gonna go to sleep soon so if I don't respond later that's why 🙃

worn jasper
#

is it possible that when I execute the cancel method on a scheduler, it doesn't actually cancel it?

#

Also, does canceling take any time? For instance, if I cancel a scheduler and right after I set it to null, will that still cancel it?

dusky harness
#

Bukkit scheduler cancel only cancels the next iteration

#

And so the cancelation time is however long it takes for the current iteration to run, or instant if it already ran

dense drift
#

if you call cancel() on run(), make sure to return afterwards

worn jasper
dusky harness
#

No

#

If it is currently running, it will cancel next
If it is not currently running, it will cancel immediately

#

And keep in mind what gaby mentioned too

worn jasper
minor summit
#

if you call cancel now, it won't run the next time it would run

dusky harness
#

Yes

#

Nice 1 sentence

minor summit
#

the bukkit scheduler doesn't have a ways to interrupt a task that is actively running if that's what you're wondering, there are other meanings to achieve that with java apis

worn jasper
#

so, just to clear things out, this is the method executed to delete a duel instance:

public void deleteDuel(DuelData duel, Player winner, OfflinePlayer loser) {
        for (Block block : duel.blocks()) {
            block.setType(Material.AIR, block.getType() == Material.WATER);
        }

        BukkitTask scheduler = duel.scheduler();
        if (scheduler != null) {
            scheduler.cancel();
        }
        duel.scheduler(null);
        ongoingDuels.remove(winner);
        ongoingDuels.remove(loser.getPlayer());

        duel.arena().isAvailable(true);

        DuelEndEvent event = new DuelEndEvent(winner, loser, duel.arena(), duel.type(), duel.kit());
        Bukkit.getPluginManager().callEvent(event);
    }```
#

this gets executed when a player dies

#

but for some reason, it is not being canceled.

#

don't even know why I set it to null after, since it will be deleted anyways lol

minor summit
#

that looks fine, your issue is somewhere else then, scheduling other tasks and losing a reference to them or something

worn jasper
#

this is the only scheduler I have

minor summit
#

¯_(ツ)_/¯

worn jasper
#

well, one in each duel instance

#

but outside that, no other task being executed

minor summit
#

cancelling does work, I can tell you that much

dusky harness
#

Debug time ☺

#

What

worn jasper
#

what if, since I set the task to null right afterwards, it happens in the same tick, and since it only cancels on the next tick, it's canceling a null instance? Does that make sense

dusky harness
#

Is that emoji

#

It's not discord emoji

minor summit
#

no

#

you can't "cancel a null task"

dense drift
#

minor summit
#

you are setting your reference to null

#

not the scheduler's reference to the task

worn jasper
#

you do that by canceling it correct?

minor summit
#

you cancel it, the next time the scheduler will try to run it it will see it's cancelled and get rid of it

minor summit
#

you have to if you want to run sync tasks

worn jasper
#

lol

sonic nebula
#

sorry ill read problem and try best to help u bor

#

hmmm not sure

worn jasper
#

this task is the only thing that handles a duel ending in a "draw"

sonic nebula
#

did u try to add some debugging to see if it actually executes?

worn jasper
#

so it must be this task.

dusky harness
#

Debug when u set the variable maybe

sonic nebula
#

i suggest to use map to handle arena / duel stage

dusky harness
#

I haven't really looked at the code tho since mobile formatting sucks

sonic nebula
#

easier to handle

minor summit
#

debug everything

dusky harness
#

True

worn jasper
#

will do after dinner

minor summit
#

dinner can wait a day or two

sonic nebula
#

bon appetide my best friend Afonso

#

get your vittamns !!!!!

hoary scarab
#

Since when is Chunk.setForceLoaded persistent?

#

Are plugin tickets persistent? Chunk.addPluginTicket

minor summit
#

since force loading was introduced

#

plugin chunk tickets are not persistent, no

worn jasper
hoary scarab
#

since force loading was introduced
Huh never had the chunks stay loaded after a restart when using it until now.

plugin chunk tickets are not persistent, no
Do you know off hand the version they were added?

minor summit
#

uhhhh

#

no lol

hoary scarab
#

Ok thx

minor summit
#

the API method maybe 1.14? 1.15? not sure, but chunk tickets have been a thing for a bit longer

hoary scarab
#

Well 1.14 added setForceLoaded so ill check there first

minor summit
#

yeah, mojang added /forceload around then

hoary scarab
#

Looks like 1.15 Hmmm.....

#

What can I do for 1.14 cause I can't cancel the ChunkUnloadEvent and can't forceload since its persistent (Apparently lol).

minor summit
#

the plugin chunk ticket method was introduced in 1.14.4, force loaded api in 1.13.2

hoary scarab
#

I can probs make that work then. Thank you.

#

Anyway to clear forceloaded chunks?

hazy nimbus
minor summit
#

I don't remember the exact command name but there's a force load command

hoary scarab
#

Trying to figure out how to use it to remove forceloaded chunks lol.

pulsar ferry
minor summit
#

I think they're block coords

hoary scarab
#

🤦 /forceload remove all thx matt

sonic nebula
#

💔 how u cloud

#

ii mean not u

#

afonoso

#

i wished u good appetiide

#

and u said no?

#

u deny my nice offer to have fun wiith food today

#

what a rude guy

echo wolf
#

Why "No Configuration help"?

#

out of curiosity

hoary scarab
echo wolf
#

I see.

hoary scarab
#

Anyone know if plotsquared has a way to get all entities in a plot?

river solstice
#

well if they have an api, you can likely get the plot, its low and high points and calculate from there

river solstice
#

well, something is better than nothing

#

shouldnt be too difficult having the rectagle points

hoary scarab
#

Thats not really the hard point. Just would have made the rest of what I need easier.

hoary scarab
#

Does Plot.getMembers include the owner UUID?

#

Apparently you can't just get high/low corners with plotsquared 6

worn jasper
#

100% being called and canceled

hoary scarab
#

Whats the difference between com.plotsquared.core.location.Location.getOwnedPlot and com.plotsquared.core.location.Location.getPlot?

dark garnet
#

anyone know of a way to store a boolean for a player besides scoreboard tags & file?

dark garnet
hoary scarab
#

Yeap

dark garnet
#

alright what about for older versions?

hoary scarab
#

File unfortunately

dark garnet
hoary scarab
#

Could always add your own data to the world file

minor summit
#

besides file

#

i mean

#

at the end of the day, it will be stored in a file

hoary scarab
#

Pretty sure he meant custom/Not already generated

dark garnet
#

yeah, would much rather use an existing system (like PDC) than have to setup my own file thing

#

making 1.8.8-1.13.2 use goofy custom data file system 🤪

minor summit
#

i would say that you should manage it yourself if you are making something cross-version

#

rather than dancing around using nbt on x.y.z but pdc on t.u.v but this other solution a.b.c

worn jasper
dusky harness
#

Hm?

minor summit
#

what

dark garnet
#

anyone know how reliable item nbt api's NBTInjector for modifying custom nbt on entities is?

#

cause it looks a bit like cheeky/hacky and i also dont know if it supports all versions

dusky harness
worn jasper
#

ez done

dark garnet
worn jasper
#

you problem then

#

¯_(ツ)_/¯

#

supporting almost 10 year old versions is an issue caused by the dev

minor summit
#

1.8.8 turned 8 years old today

signal grove
#

me too

minor summit
#

it's old enough to drive

dusky harness
#

What country

minor summit
#

no clue

dark garnet
sterile hinge
dense drift
dense drift
torpid raft
#

🥵

dense drift
#

Will get there dw

warm steppe
#

make it deprecated pls ty

minor aurora
#

when i goto compile my plugin it errors and says this package me.clip.placeholderapi.expansion does not exist
placeholder api is in there so im confused as it lets me import it

sterile hinge
#

what does "is in there" mean?

minor aurora
#

that Placeholder api is my my Libraries for my plugin

sonic nebula
#

And do good updates

#

And gonna tell u also it’s not about pvp update

#

Those things are easy fixable

echo wolf
tight junco
#

You didn't initialize the main class in your command

proud pebble
tight junco
#

?di

neat pierBOT
echo wolf
tight junco
#

yes sir

echo wolf
#

I thank you

tight junco
#

as a silly note, You can just do

if (!sender.hasPermission("admin")) {
  no ☺
  return;
}

this.plugin.reloadConfig();
#

dont need to check for player

echo wolf
proud pebble
echo wolf
proud pebble
echo wolf
#

Reading through it rn

echo wolf
#

Anyone has an idea, when I used my self-made command (upon writing it in chat) it shows in chat?

sterile hinge
#

what shows in chat

tight junco
#

probably just echoing the command back if i had to guess

#

isnt that a result of return false in the

#

onCommand method

sterile hinge
#

if you return false it outputs whatever you defined in the plugins.yml for usage afaik

river solstice
#

Or the command itself if usage not defined

proud pebble
dark garnet
spiral prairie
#

i think i have pdcs on players

dusky harness
#

Wait why doesn't it work on players? If PDC works on players

elder perch
#

guys how can i get last data of hashmap

#

someone help me

#

i got mad

dusky harness
spiral prairie
elder perch
spiral prairie
#

dont use its code

#

just look at the examples

#

its very good at explaining

elder perch
#

can ya send me that code

#

the last

spiral prairie
#

no

elder perch
#

why

#

just copy and send it

dusky harness
#

Ig u can use LinkedHashMap and Google how to get last element of it @elder perch

sterile hinge
#

just read javadocs and use google

dusky harness
#

Also I would only refer to chatgpt as a last resort

#

Theres no comment, upvote/downvoting on answers

#

So the chatgpt one in this case isn't actually the best way

tired olive
dense drift
minor summit
#

sequenced collections prayga

dense drift
#
    const map = search.searchField(pakage, className, field);
    console.log("request /search/field", req.query, map);
    return res.status(200).json({"result": map});```
I got this endpoint on an express app, the console.log prints the data, but somehow the json sent is just `{"result": {} }`. Is there any chance that it attempts to return (return res.status ...) before searchField finishies?
river solstice
#

what is search

dense drift
#

A class from my project, it has some data collected from javadocs (classes, methods, fields) and it just goes through them to check if the field exists (e.g. the input is org.bukkit Material STONE)

// the console.log
request /search/field { package: 'org.bukkit', class: 'Material', field: 'STONE' } Map(4) {
  '1_18_2' => true,
  '1_19_4' => true,
  '1_20' => true,
  '1_20_1' => true
}```
river solstice
#

is it sync?

dense drift
#

Yes

#

should I make it async and wait for the completion? D:

river solstice
#

no, thought that might've been the issue.
try wrapping map into json?

dense drift
#

{}

river solstice
#

return res.status(200).json({"result": JSON.stringify(map)});

dense drift
#

yeah, { "result": "{}" }

river solstice
#

same response?

dense drift
#

wdym same response?

river solstice
#

with
return res.status(200).json({"result": map});

and
return res.status(200).json({"result": JSON.stringify(map)});

dense drift
#

btw the map is a Map<string, boolean> if that matters

dense drift
#

welp looks like JSON.stringify doesn't know how to serialize a Map ?? doing this const jsonArray = Array.from(map.entries()).map(([key, value]) => ({ key, value })); works

river solstice
#

ah, right, I thought it was a list or something

#

in that case js is goofy

dense drift
#

D:

river solstice
#

you can just use Object.fromEntries(map)

#

return res.json(Object.fromEntries(map)).status(200);

#

plus the result:

dense drift
#

very dumb

#

thanks m0dii

river solstice
#

yeah weird that it doesnt do that under the hood, since, well, like json, map is storing key-value pairs.

#

classic javascript L

dense drift
dark garnet
#

and so it replaces bukkit entity class with its own and injects it to all entities (besides players obv)

mighty moth
leaden sinew
mighty moth
#

player.getInventory().getItemInMainHand().getType() == Material.AIR ?

river solstice
#

yes

mighty moth
#

\o/ thank you

river solstice
#

thats the new "null" item type

#

paper only iirc

mighty moth
#

Wut

#

What... do I do to make it spigot compatible?

dense drift
#

you can put it on a variable and check if it is null || air, at least thats what I do.

mighty moth
#

thank you

dusky harness
proud pebble
#

meaning all the previous methods that were anotated as null because of spigot are now notnull in paper

dusky harness
#

Ye prob
I think paper does that for some methods but this method is notnull for spigot as well

minor summit
#

paper doesn't change that in any place

vast jewel
#

dosen anyone know how to make my commands not red with deluxemenues?

tired olive
# spiral prairie Wot?
        var pdc = source.getPersistentDataContainer().get(key, PersistentDataType.BYTE); // move this
        if (!plugin.getConfiguration().getFilter().isEnabled()) {
            return false;
        }
        // to here
        if (pdc == null) {
            return plugin.getConfiguration().getFilter().getDefault();
        }
        return pdc == 1;
#

i think thats what he means at least

spiral prairie
#

Perhaps yes

#

But no

sudden sand
#

Hey guys is there a way to make so the dependencies I use in gradle just download a jar file into a folder and it gets the dependencies from there instead of shading

lyric gyro
dense drift
#

you are probably shading papi in your jar

lyric gyro
#

well uh

#

i use pom.xml

#

from the extendedclip repo

#

i have an intellij artifact, it builds the jar file when I build the project

minor summit
#

don't use artifacts to build it

#

use maven

#

mvn package

proud pebble
# lyric gyro nope

open your plugin using some form of decompiler, like jdgui or recaf and see if you are including papi classes in your plugin

#

well the contents of the papi jar atleast

#

it will be obvious if you are or not

river solstice
rare sorrel
#

anyone know why i'm getting this issue in my proxy console when i try join skyblock server through my hub :

Error occurred processing connection for NottLazy ConnectTimeoutException : connection timed out: rogueskies2.falix.gg/46.4.94.213:57307

minor summit
#

or just jar tf | grep

wind tapir
#

Hello, I made a system to report a message, the db is in auto increment and I have to put the id in the arguments of the command so i can check if the message has been reported or not, the thing is that, if I send a message, the id would be last_id + 1, if the last id was 1, then it would be 2, and if another player sends another message but the preview message hasn't been reported, the id would be also 2, so, if i report the second message, but not the first, the first would be impossible to report, anyone can help me please ?

torpid raft
rare sorrel
torpid raft
#

as in what arguments does it take in

#

or are you using the new chat report system

wind tapir
torpid raft
#

what is smain.getLastID()

#

is that the same autoincrement id that you have in your schema? i hope not

wind tapir
#

    public long getLastID(){
        try{
            if(connection.isClosed() || !connection.isValid(0) || connection == null){
                connection = DriverManager.getConnection(url, username, password);
            }
            Statement statement = connection.createStatement();
            ResultSet set = statement.executeQuery("SELECT id FROM reported_messages ORDER BY id DESC LIMIT 1;");
            if(set.next()) {
                return set.getLong("id");
            }else{
                return 0;
            }
        }catch (SQLException e){
            e.printStackTrace();
            return 0;
        }
    }

dense drift
torpid raft
wind tapir
#

well, if someone insults someone, that can be useful

torpid raft
#

thats not what i meant hold on

wind tapir
#

oh

torpid raft
#

in the first place, your issue is that some messages are unreportable atm. that's why i wanted you to show me the arguments that go into the /report command that a player issues when they want to report a message lol

#

i think you misunderstood and showed me usage for the command that admins use to view reports instead

rare sorrel
#

anyone know why i'm getting this issue in my proxy console when i try join skyblock server through my hub :

Error occurred processing connection for NottLazy ConnectTimeoutException : connection timed out: rogueskies2.falix.gg/46.4.94.213:57307

wind tapir
torpid raft
#

i gotcha

#

in that case i dont understand what your issue is

wind tapir
#

okay

torpid raft
#

why is it impossible to report an older message

wind tapir
#

i'll make a record

torpid raft
#

okay i think i see

#

so basically while one message is in the process of being reported, a second message can swoop in and claim the same report ID?

wind tapir
#

nah

#

just

#

the first message

#

has id 1

#

but if it's not reported

#

and i send another message

#

the other message has id 1

#

so both have same id

#

and if i report one i can't report another

torpid raft
#

right so the second message is using the same report id as the first

wind tapir
#

i translated my french message in english, i think it'll be more understandable:

moreover the code does not work correctly, when the message sent the command executed is: /report <player> last_id+1 <message>
except that if a player sends a message after and the previous message is not reported
it will be the same id
so the player reports the message according to
but the previous message is considered reported

torpid raft
#

okay i think the problem is really just that you have too much state for your own good

#

your code seems to be committing to a specific report ID too soon, you should not need to pick it ahead of time

#

just have the DB autogenerate the report ID once you actually insert the row

torpid raft
wind tapir
#

but the thing is that i have to check if the message has been reported or not

#

so the player cannot report it twice, or more

torpid raft
#

you don't need to know the ID to know if it has been reported

wind tapir
#

oh?

torpid raft
#

frankly the best solution to knowing if it is already reported is to log every single message

#

and use the UID of the message entry everywhere else

#

but a scuffed alternative is to just search the DB for any messages that have the same author, reporter, and body (although this isnt very good) actually dont even bother with this

#

using the latest autoincrement ID to check for if the message was already reported is just not a good solution since the latest id can change at any time

#

and is also shared across all players which makes it extra likely to not stay consistent

torpid raft
#

where the reported_message_id is a foreign key pointing to the messages entry

#

then checking to see if a player has already reported a message is as simple as checking if there is already a row with both a matching reportee_uuid and reported_message_id in the reports table

wind tapir
#

uh, i didn't understand everything...

torpid raft
#

tldr is that i think you should store every single message that is sent

#

that way, you will be able to have a permanent ID for every message

#

this makes it easy to check if the same message has been reported multiple times by the same person

lyric gyro
#

how do i create a dropper gui? i found out how to create a chest one, but cant figure out anything but a chest

warm steppe
#

Google it

#

Its pretty easy

#

Bukkit.createInventory(null, InventoryType.HOPPER, "title");

#

This should work

lyric gyro
#

ah okay, thank you

worn jasper
#

uhm a bit new to using gradle in kotlin, how do you set the encoding to utf8?

#

options.encoding isn't working

worn jasper
#

this is how I have it rn: tasks.compileJava.options.encoding = "UTF-8"

#

ah it needs to be inside {} after compileJava

tired olive
#

Also do tasks.withType<JavaCompile>() { ... } so it works with other tasks like test compilation

dusky harness
#

So u don't need to set it

tired olive
dusky harness
#

Oh 💀

#

OK nvm then lol

worn jasper
#

yeah couldve explained better

sonic nebula
#

sexy

#

any polish citizens here

#

wait offtopic sorry

candid arch
#

I am wondering on how to detect intricated placeholders.

%player_tier_display_%player_tier_of_karma_%player_karma_amount%%%
%player_tier_display_%player_tier_of_karma_50%%
%player_tier_display_vigilante%
&aVigilante

But with this regex %(\w+)%, I can only check %player_tier_display_% on the first line, which is not good at all. any advice ?

dense drift
#

perhaps go with smth like {placeholder}, this way you can detect when a new placeholder starts easier

candid arch
#

you mean something else than %placeholder% ? Will the problem not be the same ?

spiral prairie
#

I still don't understand what you're trying to match

candid arch
#

kind of recursive.

spiral prairie
#

Wot

dense drift
#

nested placeholders, whats so hard sky lol

candid arch
#

my english

hoary scarab
#

If you just use % you can probably make a method that parses placeholders by a priority level.

candid arch
#

Do you mean
check %player_karma_amount% first (ex HIGH PRIORITY)
check %player_tier_display_VALUE% last (LOW PRIORITY)
?

hoary scarab
#

yes

candid arch
#

Never thought about it. It could be useful as long there is no need of placeholder A needs B and B needs A ^^

#

I'll try that, thanks !

spiral prairie
#

Jet lag

candid arch
signal grove
#

synchronous brain problems

river solstice
#

gotta run lag on another thread

candid arch
#

Skyslycer must be running on minecraft 1.13+

spiral prairie
#

No I'm running Minecraft -6 hours

#

Pro ultra max + hd ultra hd wqhd 720p giga maxi mega kilo 64

torpid raft
spiral prairie
#

Lmao iPhone 42 720p kilo

small arrow
#

Please ping me

shell moon
#

just add debugs and make sure the last part is being reached or not

lyric gyro
#

How do I get gradient colors to send in bungeecord send message?

shell moon
shell moon
#

you need to make your own translate color method

worn jasper
#

or use minimessage

#

builtin paper

spiral prairie
#

Mm and bungee platform is probably the easiest

small arrow
#

It’s getting reached and all it’s just the logic of giving the player the drops I think

#

I’m 99% sure that everything is fine which is why I’m asking for help

small arrow
#

Fixed it

lyric gyro
hoary scarab
#

Is there any method to check for similar locations without yaw and pitch?
I know I can do a normal if matching x,y,z but was curious if there was already one that I'm not seeing.

robust flower
# hoary scarab Is there any method to check for similar locations without yaw and pitch? I know...

You might wanna check blockX, blockY, etc, if the specific point in the block does not matter. I don't think there is a "built-in" method to do that, I usually just create a Kotlin extension function for these cases, because it also depends on what you want to do, what is considered "similar" in your application logic. For one, maybe the point within the block matter, and in this case they might wanna calculate the distance between two locations, and if it is lower than a certain threadhold, then they are considered "the same", while others might not case about specific place within a block, and only care about the block itself, in which case two locations might be "the same" even though they are different points within the same block. I have already used both approaches in different situations, it is important for you to evaluate what is considered "similar" within your application, and choose the right approach to be able to acomplish your goals.

PS.: Not AI generated, I was just feeling very descriptive today for some reason 👀 .

river solstice
#

u good mate

#

he literally wrote I know I can do a normal if matching x,y,z

robust flower
#

Yeah I am fine, thank you, I answered him in the start of the second sentence btw: I don't think there is a "built-in" method to do that, I just wanted to point out a possible reason for why there is not a "build-in" method that does that.

hoary scarab
#

Just wanted something as simple as Location.equals(Location) but that matches yaw and pitch.

river solstice
#

MyLocation.valueOf(loc1).equals(MyLocation.valueOf(loc2)) cursed_fingerguns

river solstice
#

huh

robust flower
#

Wait, you do want to compare only the yaw and pitch?

hoary scarab
#

Oh you mean make my own object?

river solstice
#
class MyLocation {
  private int x, y, z;

  public static MyLocation valueOf(Location loc) {
    // assign xyz
  }

  // override equals
}
hoary scarab
robust flower
hoary scarab
#

Didn't want to do that either.

hoary scarab
robust flower
#

Well, I am not a native English speaker, but your sentence sounded like Locations.equals matched only x, y and z, but not yaw and pitch, and you wanted the complementary method, which would be matching only yaw and pitch.

hoary scarab
#

Read m0dii's responses too. He knew what I was asking.

river solstice
#

tldr no built-in method

hoary scarab
#

👍

robust flower
#

Yeah, so your options are limited to:

  • Create a new wrapper class (@river solstice)
  • Create a static method (or extension function if you're using Kotlin)
river solstice
#

though you can probably do loc1.distance(loc2) == 0 @hoary scarab

hoary scarab
#

I was thinking that but it does more calculation then needed.

river solstice
#

¯_(ツ)_/¯

#

could also set yaw/pitch to 0's before comparing with .equals

#

but that's additional 4 lines

hoary scarab
#

exactly

#

I'll just stick with the if(x && y && z)

dusty frost
#

but yeah no you probably should create a static method to compare two locations including pitch & yaw

barren mantle
#

well hellooo
for some random reason the function #getMenu(String) return null even if the menu exists and #getAllMenus() also return null, but until today it didn't returned null, why is that?
all the menus are loaded correctly (21 to be more precise)
I'm using DeluxeMenus-1.13.7-Release on my server and my plugin

[LIFE-RO] Task #2031976 for Lifero v0.1 generated an exception
java.lang.NullPointerException: Cannot invoke "com.extendedclip.deluxemenus.menu.Menu.getMenuItems()" because "menu" is null
        at com.lifero.modules.minecraft.automatically_events.Event.<init>(Event.java:59) ~[lifero.jar:?]
        at com.lifero.modules.minecraft.automatically_events.AutomaticallyEvents.lambda$new$0(AutomaticallyEvents.java:31) ~[lifero.jar:?]
        at org.bukkit.craftbukkit.v1_20_R1.scheduler.CraftTask.run(CraftTask.java:101) ~[purpur-1.20.1.jar:git-Purpur-2023]
        at org.bukkit.craftbukkit.v1_20_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:480) ~[purpur-1.20.1.jar:git-Purpur-2023]
        at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1507) ~[purpur-1.20.1.jar:git-Purpur-2023]
        at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:487) ~[purpur-1.20.1.jar:git-Purpur-2023]
        at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1421) ~[purpur-1.20.1.jar:git-Purpur-2023]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1192) ~[purpur-1.20.1.jar:git-Purpur-2023]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:323) ~[purpur-1.20.1.jar:git-Purpur-2023]
        at java.lang.Thread.run(Unknown Source) ~[?:?]
public Event(int max_events, List<String> played_events, boolean changeEvent) {

        Menu menu = Menu.getMenu("menu");
        Map<Integer, TreeMap<Integer, MenuItem>> menuItems = menu.getMenuItems();

        // didn't pasted the whole code..
}
dusty frost
#

does your plugin dependsOn: DeluxeMenus?

#

it might be loading before it and therefore there are no menus loaded

hoary scarab
#

Debug menu

barren mantle
dusty frost
#

oh yeah it should

barren mantle
#

i tried /dm reload but is the same

dusty frost
#

yeah you want your plugin to load after DM

barren mantle
#

hmm, alright i'll try

barren mantle
#

i don't think that it's the problem because on the first day i loaded the plugin, a few weeks ago, i didn't had this problem and i loaded it with plugman

hoary scarab
#

i didn't had this problem and i loaded it with plugman
Don't load/unload plugins with this. Restart your server.

Also you probably got lucky with which plugins loaded first.
Add some debug to check if menu is null or if its actaully in the list.

barren mantle
#

It's the same thing, it doesn't work anyway

#

It return null when i try to get all the menus

barren mantle
#

i tried loadbefore and softdepend to load after, but still doesn't work..

dense drift
#

⚙️ Development Support - Stay on topic! - Not configuration help - No favourite IDE arguments.
#general-plugins @umbral halo

umbral halo
#

ok sry

hoary citrus
#

hey folks. I'm coding a report system plugin and I wanted to make a filter item which filters items based on a variety of options, like status and user

however, for some reason whenever the inventory updates, the lore doesn't update, could anyone help me with this?`

https://pastebin.com/K2x2Ueza

#

its written in kotlin

#

I'm also using TriumphGUI's library for my gui's

dusky harness
hoary citrus
#

so the inventory gets updated every time a click happens, and the lore is set at the bottom. I tried using methods but it didnt seem to chzange anything, thats why its a bit messy

#

I send the lore in chat, and it does update it

#

it sets the active one to green and the inactive ones to red

#

it just doesnt update inside the inventory

dusky harness
#

it seems like setLore() is only changing the list, but doesn't set it back to the item

hoary citrus
#

i cant really change it since the lore for the item builder uses Components

dusky harness
#

Like what I mean is can you updateItem(newItemWithUpdatedLore)

hoary citrus
#

ohh

dusky harness
#

or maybe just doing ItemMeta#setLore and ItemStack#setItemMeta is enough but I'm not sure, I haven't done a lot of gui stuff in a while

#

TriumphTeam has a discord server btw where you can ask for help in the future as well

dense drift
#

too much code, idk even where to look

hoary citrus
#

ignore the when statements

#

that just sets the items, which almost works xd

dense drift
#

ok and where are you updating the item?

hoary citrus
#

thats a great question.

#

i assumed that every time i click a slot it updates the items

#

but i cant seem to find a way to update the lore because i cant cast an ArrayList of Components to ArrayList of Strings

dense drift
#

the lore is set with lore()

hoary citrus
#

yes

#

but theres no method

#

to change that

dense drift
#

ItemBuilder.from(fillerItem).lore(new lore).build()

hoary citrus
#

but thats creates a whole new item

#

and I'd have to set the action logic again

dense drift
#

there is GuiItem#getAction

hoary citrus
#

or i can make a whole action variable

dense drift
#

https://paste.helpch.at/naquqokatu.kotlin I got this MM tag for papi placeholders and when I simply use <papi> without any arguments, the error message set on popOr() doesn't show up anywhere, do I need to catch some exception?

hoary citrus
#
var filterItem = ItemBuilder.from(Material.BOOK).name(filterName).lore(
            setLore() as List<Component?>
        ).asGuiItem(action)

        gui.setItem(45, filterItem)
        filterItem = ItemBuilder.from(Material.BOOK_AND_QUILL).name(filterName).lore(filterLore as List<Component?>).asGuiItem(action)```
#

still doesnt update

dense drift
#

fyi you should return List<Component>, not ArrayList<>

#

and again, where do you call this? After updating an item you need to call gui.update() to re-set the items.

hoary citrus
#

this is at the bottom of the setItems function

#

so its literally the last thing thats run

dense drift
#

yeah ok, but you need to run it ever time you want the filler item to update, e.g. after clicking on it

hoary citrus
#

yes but i cant update the item inside of the guiaction

dense drift
#

why not?

hoary citrus
#

because the item isnt even initialized yet

#

and i cant access the item inside of the gui action

dense drift
#

Yeah I'm not sure how to give you an example

hoary citrus
#

im sorry for being sto stupid

#

i have a massive headache and am sleep deprived because my fire alarm went off like 20 times last night

#

I'll just put a pin in it for now

#

and come back to it when im smarter

tight junco
#

Could it be a loading isssue? aka do you have deluxemenus as a depend/softdepend

dusky harness
#

Which prevents that

dapper jackal
#

Hello, with placehoder api. if I have an extenre plugin that displays my placeholder. Knowing that the placeholder changes often, will it update automatically?

shell moon
#

I dont get the actual question tbh, other plugins parsing placeholders use PlaceholderAPI.setPlaceholders(p, text) which internally calls the class your registered when creating your plugin, so no matter which version it is, the class you choose will be used to parse the placeholders if params match your checks, every time the placeholders are parsed, your class is called, so if your plugin (with placeholders) is not updated, it will call the old code, if the server owner updated the plugin, the new code will be called as it's reading what is currently in the plugin .jar

dapper jackal
#

I mean, for example, a placeholder that displays the number of players. The number of players can change. Will it update?

shell moon
#

indeed, it will if the placeholder is parsed again (and the code of the expansion returns the current amount of players)

spiral prairie
#

Depending on how many times it's called, yes

dapper jackal
#

so tablist plugins update the placeholder automatically I guess (every x times)?

spiral prairie
#

Yes

small arrow
#

How can I add onto already existing lore? In my custom enchants plugin I'm adding lore to an item such as "Speed Enchant 1" and when I want to add lore to it (ex. they add another enchantment) the new lore just overrites the existing lore. I've tried something like heldItemMeta.getLore().add(ChatColor.LIGHT_PURPLE + "Multiplier Enchantment I"); but it wont work. Any suggestions?

spiral prairie
#

Have you set the item meta again?

tired olive
small arrow
small arrow
# spiral prairie Have you set the item meta again?

heres an example from my class:

                    ItemMeta heldItemMeta = heldItem.getItemMeta();
                    heldItemMeta.setLore(Collections.singletonList(ChatColor.GREEN + "Auto-Sell Enchantment I"));
                    heldItem.setItemMeta(heldItemMeta);
minor summit
#

get meta
get lore list
add element
set lore list
set meta

tired olive
small arrow
# minor summit get meta get lore list add element set lore list set meta
                    ItemMeta heldItemMeta = heldItem.getItemMeta();
                    List<String> lore = heldItemMeta.getLore();
                    if (lore == null) {
                        lore = new ArrayList<>();
                    }
                    lore.add(ChatColor.GREEN + "Auto-Sell Enchantment I");
                    heldItemMeta.setLore(lore);

                    heldItem.setItemMeta(heldItemMeta);

Maybe I did something wrong but this did not work

dusky harness
small arrow
small arrow
dusky harness
#

Since I think getLore returns a copy

dusky harness
#

No u added it to getLore directly

small arrow
#

so essentially, I need to create a new list, and add it to that?

dusky harness
#

That code should work

#

If it doesn't work then send the relevant code in paste again

#

Btw feel free to ping me for replies 🙃

small arrow
dusky harness
#

Hm does it send the successful message but not add lore?

small arrow
#

yes

#

the lore just replaces the already existing one

dusky harness
#

Hmm

#

Odd, that should work
Try printing out getLore

small arrow
#

wait a minute..

#

i think i know what the issue is

#

ill update you in a sec

#

okay so now it adds the lore on top of the prior enchantments, however it adds 3 of them...

#
if (!lore.contains(ChatColor.GREEN + "Auto-Sell Enchantment I")) {
            lore.add(ChatColor.GREEN + "Auto-Sell Enchantment I");
            heldItemMeta.setLore(lore);
            heldItem.setItemMeta(heldItemMeta);

I guess ill add something like this

topaz magnet
#

Hello, can anyone help me compiling GriefPrevention expansion by pixar02 using Visual Studio Code?

sonic nebula
#

relaly bad

#

also

#

lore cant be null

minor summit
#

yes it can

sonic nebula
#

isnt it my default just empty list?

#

by

#

anyway im here to help babe so ill give him the right advice

#

anyway first thing is keep adding lores so player can see how ever start using NBT tags

#

its way faster to read NBT tags then lore in performance and easier to handle

#

u can also write in the NBT tags the line off the enchantment so u can modify it later ;p

minor summit
dense drift
#

idk why it is null by default, visually at least, no lore (null) / empty list looks the same.

royal hedge
#

nullable collections on top

sonic nebula
#

thonking bruh

wary dust
#

Anyone got a clue how I could go about making blast proof glass like in hypixel? I have adjusted the hardness of the glass very high, so when tnt is placed behind glass it works (like this https://i.imgur.com/WFWI2cW.png)
However when tnt is placed on an edge (like this https://i.imgur.com/GB6Ibkr.png) the wool breaks when the tnt blows up. Any suggestions?

hoary scarab
#

They probably do their own calculations

#

Check if all sides in direction of blast are covered.

wary dust
#

Acc yeah thats a good shout so if there is an adjacent block in the positive x cancel all explosions in the positive x direction maybe

#

its not the perfect solution but thats a good shout

warm steppe
#

if entity is tnt then #blockList()

#

and do what u got to do

#

or this, imo this would be better

#

check if is glass and then cancel event ezpz

modern thunder
#

I was trying hotswap-agent with paper in Java 17, but it doesn't work.. (hotswap's errors on start)
The same configuration with spigot server works perfectly. Any ideas?

dense drift
#

do I need to modify something on the MM instance?

spiral prairie
#

Ask in kyori

#

Or dm minidgger

proud pebble
# small arrow

wouldnt you be better off just remaking the item's lore every time instead of modifying the existing lore?

#

means you wouldnt have duplicate enchantment lore if you do it properly

small arrow
river solstice
#

Are you using actual enchantment wrappers or just a string in lore

#

Because you could just check if the item has the enchant lol

spiral prairie
#

I think they're making their own enchants

lyric gyro
#

does anyone know where I can get the snapshot versions (latest build) of ProtocolLib for my spigot plugin (some sort of repo manager)? Is there no way other than to download it myself and shade it?

#

i need support for 1.20.1 but 5.0.0 doesn't have it

river solstice
#

Unlucky

#

Manz want bleeding edge support

lyric gyro
#

are there really none? not even unofficial?

spiral prairie
#

Don't shade protocol lib

small arrow
#

Relevant code: https://paste.helpch.at/evilezixun.java
Issue: during the onRightClick event, it is being registered twice, leading players to receive the same error message twice in game. Is there a reason for this?

#

so sorry for the frequent help recently! This plugin is just a headache

minor summit
#

idk i never used minimessage lol

tame flower
#

Can anyone help me with custom texture packs issue for non optifine.

I made a texture pack with custom items depends on name it have custom elytras custom swords but it only works on optifine when u play non optifine you cant see custom items textures how can i fix it?

rare sorrel
#

Anyone got experience with custom domains?

warm steppe
#

custom domains?

#

explain pls

rare sorrel
# warm steppe explain pls

like i'm trying to setup a custom ip for my minecraft server but i can't seem to get it to work. it just says unknown host whenever i try to connect using it

tame flower
#

where u bought ur domain

#

@rare sorrel

rare sorrel
#

google domains

tame flower
#

hm

#

watch on youtube maybe u can use cloudflare

rare sorrel
rare sorrel
tame flower
rare sorrel
tame flower
rare sorrel
tame flower
#

np

dense drift
signal grove
#

BigMessage

fading stag
#

For example I want to delete blocks 2 seconds after they are placed. I should create a new task when any block is placed. Does it cause lag?

#

I mean does creating a lot of tasks cause lag?

river solstice
#

depends

sonic nebula
#

How to kill an

#

ENDER_CRSYTAL ENTITY?

#

and also iit is a living entity or not?

#

or can i force it to explode

#

anyway

#

not familiar with the new API

river solstice
#

what

sonic nebula
#
        this.plugin.getServer().getPluginManager().registerEvents(this, (Plugin)this.plugin);
    }

    @EventHandler
    public void event(PlayerInteractEvent event){
          if (event.getAction().isLeftClick()){
              System.out.println(1);
              RayTraceResult rayTraceResult = event.getPlayer().getWorld().rayTrace(event.getPlayer().getEyeLocation().add(event.getPlayer().getLocation().getDirection()),
                      event.getPlayer().getEyeLocation().getDirection(),
                      7.0,
                      FluidCollisionMode.NEVER,
                      false,
                      1.0,
                      entity -> !entity.getUniqueId().equals(event.getPlayer().getUniqueId()));
              if (rayTraceResult.getHitEntity().getType() == EntityType.ENDER_CRYSTAL){
                  System.out.println(2);
                  rayTraceResult.getHitEntity().setFireTicks(20);
              }
          }
    }
#

i tried to that

#

but it seems

#

completly ignore the event

#

when player has weakness

sonic nebula
#

i changed to comparre actions manually

#

instead

#

hope it gonna wok

worn jasper
sonic nebula
#

cause an Entity to die on interact

#

an End_Crystal entity how ever im not familier with it

#

i tried to cast to LivingEntity

#

also EntityDamageEntityEvent does not work

#

when player has weakness

#
    public eventclass(rarndomshit plugin){
        this.plugin = plugin;
        this.plugin.getServer().getPluginManager().registerEvents(this, (Plugin)this.plugin);
    }

    @EventHandler
    public void event(PlayerInteractEvent event){
        System.out.println("EVENT WAS EXECUTED");
        if(event.getAction() == Action.PHYSICAL || event.getAction() == Action.LEFT_CLICK_AIR || event.getAction() == Action.LEFT_CLICK_BLOCK){
              System.out.println("EVENT STEP 1");
              RayTraceResult rayTraceResult = event.getPlayer().getWorld().rayTrace(event.getPlayer().getEyeLocation().add(event.getPlayer().getLocation().getDirection()),
                      event.getPlayer().getEyeLocation().getDirection(),
                      7.0,
                      FluidCollisionMode.NEVER,
                      false,
                      1.0,
                      entity -> !entity.getUniqueId().equals(event.getPlayer().getUniqueId()));
              if (rayTraceResult.getHitEntity().getType() == EntityType.ENDER_CRYSTAL){
                  System.out.println("EVENT STEP 2");
                  rayTraceResult.getHitEntity().setFireTicks(20);
              }
          }
    }
#

maybe ill just summon a projectile above it

#

or at its location instead of setting it on fire

#

or NMS lol

worn jasper
sonic nebula
#

the ender crystal onDie creates explosion

#

i just need to make the ender crystal to die

#

when interact / hit

worn jasper
#

that already happens....

sonic nebula
#

if player has weakness false.

worn jasper
#

when you hit an ender crystal it explodes

#

unless you have it protected with WG or smt

sonic nebula
#

yeah but not with weakness event and 0.5 damage default hand/item without damage attrriibute

#

so basically if damage u do is 1 / 20 and u have weakness 1 == 0

#

and it doesnt even execute the EntityHitEntity event

worn jasper
#

if it still does damage, you could listen to the EntityDamageByEntityEvent event, check if it's an ender crystal and boom

sonic nebula
#

so i stick to interact

worn jasper
#

you either make it explode or modify the final damage

sonic nebula
worn jasper
#

what?

#

I legit used that event....

sonic nebula
#

if player has weakness and u hit with hand

#

it ignores it

#

completely idk why

#

if u hit without weakness or weakness and something that does more then 0.5 it works

worn jasper
#
    @EventHandler
    public void onCrystalExplode(EntityDamageByEntityEvent e) {
        if (e.getDamager() instanceof Player) {
            if (e.getEntityType() == EntityType.ENDER_CRYSTAL) {
                Player player = (Player) e.getDamager();
                listOfDamagers.put(e.getEntity().getUniqueId(), player);
                Bukkit.getScheduler().runTaskLaterAsynchronously(plugin,() -> {
                    listOfDamagers.remove(e.getEntity().getUniqueId());
                }, 10);
            }
        }
    }
#

legit what I used

#

works perfectly

river solstice
#

dont make me write the entirety of the code just to prove you wrong, that it does work

worn jasper
#

well ignore the rest but it detects perfectly

sonic nebula
#

Mr Afonso did it work for u with weakness

worn jasper
#

no but still, you can modify the final damage....

sonic nebula
#

m0dii u dont have too also its just 7 lines and constractur

#

i did it already it didnt work at all... idfk

#

i did not the same as u did

#

i just set the damage to random nubmerr

worn jasper
#

wth

sonic nebula
#

like 123

#

or somethng

#

EntityDamageEntittyevent

#

if u have weakness and u hit with hand

#

it dont execute even

worn jasper
#

that's weird af

#

what about PlayerInteractEntityEvent?

#

should work

sonic nebula
#

well when there weakness it does not work so i ended up doing Raytrace

#

frrom just Interact

worn jasper
#

weakness doesn't trigger that?

#

wth

#

I wonder if that's intended

sonic nebula
#

i have no idea i never dealed with 1.20.1 befoe

#

but i was stuck for 1 hour with that

worn jasper
#

not an 1.20.1 thing

#

what even is the final intended use for this?

sonic nebula
#

to allow people blowup endercrystal even if they have weakness

#

effect applied to them

#

because if u have weakness and u use hand or any other item that by default does 0.5

#

its ignored

worn jasper
#

hmhmm

sonic nebula
#

i also dont know the logic behind it

icy shadow
worn jasper
dusky harness
#

🐡

hoary scarab
#

@wary dust Are you still looking? I have some code that does what you want. (Its kinda ugly though lol)

spiral prairie
#

Probably not

hoary scarab
barren mantle
small arrow
#

Relevant code: https://paste.helpch.at/evilezixun.java
Issue: during the onRightClick event, it is being registered twice, leading players to receive the same error message twice in game. Is there a reason for this?
so sorry for the frequent help recently! This plugin is just a headache

rare sorrel
#

Anyone got any experience with tebex?

river solstice
#

@rugged bane

#

ask this guy, he works there

#

gon have all yer answers

rare sorrel
#

Ah okay, I'm just trying to setup a theme / template I got off someone and it won't work properly so was just tryna get some help to get it to work

barren mantle
spiral prairie
#

You need softdepend and not loadbefore

dusky harness
#

So it might be some other issue

spiral prairie
#

Wrong menu name

#

Or just a fucked up api

dense drift
#

could be

#

dm wasnt made to be used by other plugins lol

sonic nebula
#

yo guys as always i like to hit off topic questons here in the must active chat

#

Oral exam , is it an english exam?

modern thunder
#

Has anyone encountered problems with hotswap-agent and paper? Because I tried same configuration with spigot and it works, but with paper console spams errors

dense drift
sonic nebula
#

not known

#

known that the student is polish

dense drift
#

Then you cant tell if it is english or polish. E.g. if the context was a final exam, like we have in Romania when you finish HS, we have a written and oral exam in Romanian.

wind tapir
#

Hello, I have this error when I try to start my server:

river solstice
#

Hello

wind tapir
river solstice
#

it tells you why

wind tapir
#

None of my plugins have the same plugin.yml

river solstice
#

java.lang.IllegalArgumentException: Plugin already initialized!

wind tapir
#

ik

dense drift
#

make sure you dont do any new Main() in your code

river solstice
#

can you show the main class of the 'vg.jar'?

wind tapir
#

my only solution is to change the package of my plugin, but i'll have to change it in all of my plugins that use the package

wind tapir
#

it's really long

#

wait

wind tapir
#

yes

#

i told you

#

it's really long

#

i'll just send you the on enable

river solstice
#

already sounds like a disaster waiting to happen

wind tapir
#

nah im checking if the file exists and all

river solstice
#

don't tell me all of your logic is in the main class

wind tapir
#

what logic

river solstice
river solstice
#

code

#

whatever

wind tapir
#

yes, i use the getrank, prefix color etc

#

in the same class

#

can y'all help me please?

river solstice
#

well your issue is likely bad initialization or duplicate jars

#

probably the latter

spiral prairie
#

Do you crazy m create a new main class anywhere?

#

Like instance = new Main

wind tapir
#

i said i don't use new Main

#

i never used that

#

and i will never

river solstice
wind tapir
#

what is the latter

#

?

#

please

river solstice
#

duplicate jars

wind tapir
#

how do I solve that please?

river solstice
#

well, delete one

wind tapir
#

I use gradle btw

#

ah no

#

i said *96+t

spiral prairie
#

?

wind tapir
#

there is no duplicate jars

spiral prairie
#

Well then you create your main twice

wind tapir
#

here is my build.gradle:

plugins {
    id 'java'
}

group 'fr.idaamo'
version '1.0-SNAPSHOT'
compileJava.getOptions().setEncoding("UTF-8")

repositories {
    maven {
        url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/'
        content {
            includeGroup 'org.bukkit'
            includeGroup 'org.spigotmc'
        }
    }
    mavenLocal()
}

dependencies {
    compileOnly 'org.spigotmc:spigot-api:1.8.8-R0.1-SNAPSHOT' // The full Spigot server with no shadowing. Requires mavenLocal.
}

river solstice
#

do you have more than one subclass of JavaPlugin?

wind tapir
#

nope

wind tapir
#

I already had the issue

spiral prairie
#

Restart your server idk

river solstice
#

how is your main class named

#

that extends JavaPlugin

wind tapir
#

I changed the name of my package and the problem was gone, but if i do that, i will have to do that with the other plugins

wind tapir
river solstice
#

then dont

wind tapir
#

okay

river solstice
#

change it to something else

wind tapir
#

I'm changing it

#

yes

river solstice
#

if you have multiple jars, that have the same package and the same name Main, then there will be a conflict, which is most likely your issue

wind tapir
#

thank you, the problem is solved

river solstice
#

👍

#

you usually want to name the main class accordingly what the plugin does in general, as a rule of thumb (for me at least)

spiral prairie
#

Shouldn't be the same package either way