#help-development

1 messages Β· Page 1129 of 1

tardy garden
#

why?

glad prawn
#

allVehicleIds.addAll(vehicle.getIds());

tardy garden
fair rock
tardy garden
#

but removeall no

glad prawn
#

?

#

"may work slowly"

tardy garden
slender elbow
#

most collections don't have a specialised implementation for removeAll and can be quite bad for performance

tardy garden
#

why addall is more fast

#

and removeall no

quaint mantle
slender elbow
#

that is not the case for addAll

tardy garden
tardy garden
#

hashset?

slender elbow
#

most

#

hashset doesn't, yes

tardy garden
slender elbow
#

I mean, that's just literally a .clear() call

quaint mantle
tardy garden
#

vehicle.getIds().forEach(allVehicleIds::remove);

#

i cant use clear here

slender elbow
#

removeIf(_ -> true) is just clear

tardy garden
slender elbow
#

it's alright yes

pseudo hazel
#

just use iterators in for loop smh

mellow edge
glad prawn
lost matrix
# tardy garden but intellij recommend foreach

It depends which collection is your base and which collection is passed for your bulk operation.
If you tell us the types we can explain in detail why the calls might be slow. And this often indicates
that a poor choice for a datastructure was made. HashSet#removeAll() will be always O(n) for every collection passed (which is good).
But there are several combinations where manual iteration via removeIf() is preferred since it can get into quadratic or even exponential space.

tardy garden
#

hum ok

#

im using hashset

pseudo hazel
tardy garden
#

i added the module and intellij not find the bukkit api, lombok. why?

tardy garden
lost matrix
tardy garden
tardy garden
lost matrix
#

Show your build.gradle

tardy garden
#

build.gradle isnt the problem

#

intellij config is the problem

lost matrix
#

Alright. I respect this opinion.
Now show your build.gradle

tardy garden
#

intellij bugged on all my projects

#

i created a new project on other project and solved it

lost matrix
#

You are missing the spigot repository

tardy garden
#

because works on all other projects

#

lombok not works too

#

all libs not works

#

but if create a new project, the problem are solved

lost matrix
#

Invalidate your caches and restart the IDE

tardy garden
#

i already tried it

slender elbow
#

what happens if you try to build from the terminal

tardy garden
slender elbow
#

also you have a typo in your build script

tardy garden
#

wdym typo

slender elbow
#

implementation("co.aikar:acf-bukkit:0.5.1-SNAPSHOT")t

lost matrix
#

Hm this should def break the groovy syntax

slender elbow
#

it's certainly valid for kts

#

are you using build.gradle or build.gradle.kts?

tardy garden
#

the problem is on intellij

tardy garden
#

idk made it

slender elbow
#

huh

lost matrix
#

./gradlew <goal>

tardy garden
#

command not found

lost matrix
#

Are you using a gradle wrapper?

tardy garden
#

idk

#

how i see

lost matrix
#

Anyways im off to the gym, the Nerd can take this one

echo basalt
#

what nerd

#

oh emily

lost matrix
echo basalt
#

thought smile was in my walls aware of my lurking

lost matrix
#

Im aware that we got some lurking basement dwellers as well XD

echo basalt
#

basement dwellers πŸ™„

lost matrix
#

No?

echo basalt
#

live in a tiny lil apartment we don't have a basement here

tardy garden
#

how i cancel all arrow dmg?

lost matrix
#

Check the EntityDamageByEntityEvent and see if the damaging entity is an instance of Arrow

#

See yall

drowsy helm
#

Go pump some iron

tardy garden
#

uif i cancel the event

#

the other events will be called?

mellow edge
tardy garden
#

// Attempt to determine which Entity (if any) we hit.
// This is necessary because while the ProjectileHitEvent fires reliably,
// the EntityDamageByEntityEvent only fires once per round / bullet.

        // This seems to work well enough, although I hope to find a better solution.
#

and I need to cancel the vanilla arrow damage

quaint mantle
#

can i create a light around a player with spigotapi?

smoky oak
#

yes

quaint mantle
smoky oak
#

while player is standing in air: replace air with the light block. then, after a set time, remove the light block you spawned

#

volia, light following the player

quaint mantle
#

aight

#

btw this will be lag ? if 100 200 player do this?

smoky oak
#

shouldnt

#

youre changing like 200 blocks/tick max, thats far from lag territory

river oracle
#

yeah I mean if you're really conerned you can only use the alternatives

#

which are actually modifying the light level with NMS

#

or work distroing the current setup

#

or packets

quaint mantle
#

AH im fine with lightblock

#

XD

echo basalt
#

will cause issues with non-occludable blocks or whatever

#

flowers, tall grass

#

doors

brazen badge
#

I need to understand a thing. If I call this method:

ItemStack key = player.getInventory().getItemInMainHand();

and the player does not have anything in his hand, this should return null.

But why it returns me an empty ItemStack?

river oracle
#

because the method says it Doesn't return null

#

?jd-s

undone axleBOT
river oracle
#

it has a @NotNull return contract

brazen badge
blazing ocean
#

check if its air

river oracle
smoky oak
#

hey illusion random question
do u know how to change block_entity_data of itemStacks? I find myself in need to work around a bug with it

river oracle
#

I mean its anagolous to internals where there is no such thing as a Null ItemStack

#

spigot just happens to have this weird ambiguity with sometimes ItemStacks are null sometimes they are empty

rugged rose
river oracle
#

this channel is for development help

#

oh you cross posted beautiful

#

clearly you don't give a shit then

rugged rose
#

eh

smoky oak
#

can the description in plugin.yml be queried from a game client connected to a server said plugin is loaded on?

pseudo hazel
#

not without sending it to them I guess

smoky oak
#

annoying. can you query it via code?

blazing ocean
#

Plugin#getDescription#getDescription

smoky oak
#

doing some inentory manipulation. is there a way to empty the cursor without desync / force an update to the player so their view of the inventory is correct?

river oracle
hard socket
#

set the ItemStack to null

river oracle
#

you should shouldn't use #setCursor for the inventory events

#

its prone to cause desync

smoky oak
hard socket
#

that depends on how you are doing it ig

river oracle
#

its not in the PlayerInventory

#

you can also use InventoryView#setCursor

smoky oak
#

cant multiple players see one inventory at once?

#

there one view per involved entity?

river oracle
#

lol

#

Want me to explain how inventories work quick :P I'm Number 1 inventory shill

smoky oak
#

im just rewriting some code i have no idea where i put it

#

specifically im trying to figure out all restrictions on inventory item placement and force it to not be restricted

river oracle
#

Basically InventoryView is a contract between a Player and an Inventory. This is a strict contract so only one player can have one view. However, multiple players can view one Inventory (depending on the inventory). Basically Inventory is a list of items with a few fancy listeners to do syncing if their are multiple viewers such as a chest, but without fail every View will only have 1 player. This is how InventoryView can have a InventoryView#getPlayer method. It will always return the same player and it will always be associated with that one player

smoky oak
#

interesting

river oracle
#

which allows you to create a view itself

worldly ingot
#

MOOOOM, HE'S SHILLING AGAIN!

blazing ocean
#

choco

#

component pr

river oracle
#

it will only get worse as I make more changes

#

should change my about me to #1 MenuType Shill

worldly ingot
river oracle
#

and I made a very mean comment on it already

worldly ingot
#

I do need to address M's comment though lol

blazing ocean
#

i don't have a stash account

river oracle
#

L

worldly ingot
#

well git gud nerd

blazing ocean
#

don't need one :P

river oracle
blazing ocean
#

whats it about

river oracle
#

deprecate/remove string methods

blazing ocean
#

!!!!!

river oracle
#

Which I actually only partially agree with

blazing ocean
#

paper pilled fr

worldly ingot
#

Yeah I'm not doing that

river oracle
#

I think string set methods should stay

worldly ingot
#

Other M comment

blazing ocean
#

watch everyone get angy

river oracle
#

String get methods should probably go tho

blazing ocean
#

and tell people to go use components

#

L

river oracle
#

most of the time people actually use those anyways its often times for naive implementations

#

Any non naive use can be done with components relatively easily

slender elbow
#

like checking inventory title to know my custom inventory

river oracle
#

removing string getters is the only reason any string methods should be deprecated anyways

blazing ocean
#

just deprecate inventory get title

slender elbow
#

deprecate inventory

blazing ocean
#

deprecate org.bukkit

slender elbow
#

it's called paper

river oracle
#

Inventory isn't that bad tbh

#

ofc it could be better but comparitvely to the rest of that API its a non issue

#

Coming soon to an API near you

@Deprecated
Inventory createInventory(InventoryHolder, InventoryType)
#

@worldly ingot so when you gonna make the spigot String -> Component that is 100% MiniMessage compliant

#

Its not like you have a job or anything so why not get started now?

blazing ocean
#

which also supports minedown and legacy

river oracle
#

legacy support is easy

#

just replace all those super silly section characters with those good ol legacy colors

worldly ingot
#

Not sure. Whenever I get to it. I might just adopt Adventure standard. If only MiniMessage were still an independent repo with a BungeeChat module hmm_parrot

blazing ocean
#

just copy-paste those paper patches

#

ez

river oracle
#

alas he can't :(

blazing ocean
#

L

river oracle
#

yada yada legal jargon etc etc

blazing ocean
#

licenses are just recommendations

#

you don't have to follow them

river oracle
#

someone is never getting their CLA approved

worldly ingot
#

I feel like that's bad legal advise KEKW

shadow night
blazing ocean
#

just don't go to court

shadow night
#

Lmao

river oracle
#

Unless you live in russia and voided a US license I have a feeling it'd be hard to avoid that

blazing ocean
blazing ocean
#

sounds like a skill issue

river oracle
#

chat I think I might try and get an internship this summer

#

or should I go back to painting???

#

hot take should I just drop 50k on College then go back to working in the trades

valid burrow
river oracle
#

because this summer is now over its now last summer

valid burrow
#

so next summer

river oracle
#

nope this summer because last summer is now over

valid burrow
river oracle
#

πŸ€“ summer vacation

#

is basically just summer for anyone in school

valid burrow
#

you mean summer break

#

which is different in every country

river oracle
#

I've had enough of you

valid burrow
#

xddd

river oracle
#

shush it

valid burrow
river oracle
#

United States Defaultism πŸ’ͺ fuck you

valid burrow
#

okay my bad

#

summer is over in 24 mcdonalds working shifts peer football field

river oracle
#

football field isn't a time unit

#

so

#

I mean if you used football games this would work

#

but you'd still be wrong because that'd mean summer is oover in 24 days

#

when its technically over in 10 days

valid burrow
#

no lol

#

theres more than one mcdonalds shift a day

#

a shift is like max 8

river oracle
#

24 mcdonalds working shifts of 8 hours each * 3 hours for each footbal game
24 * 8 * 3

#

that is the number of hours

#

than you divide by 24 to get the number of days

valid burrow
#

😭😭😭

river oracle
#

24 * 8 * 3 / 24 = 8 * 3 = 24 this is the assumption ofc that you only mean 1 football game

#

if there is one football game per shift than it simplifies to 8 * 3 * 24 which is far more days than the end of summer

#

@valid burrow never make fun of the american units ever again

#

you'll never measure up to our ability to calculate completely arbitrary numbers into even more arbitrary units

novel kite
slender elbow
#

i had a 297 hour shift once

shadow night
#

what does that mean

novel kite
valid burrow
shadow night
valid burrow
shadow night
#

._.

blazing ocean
#

I WOULDVE BOUGHT THEM

shadow night
blazing ocean
#

idc!

valid burrow
#

next time you mysteriously acquire kittens

#

tell me

#

i wont ask questions

shadow night
#

Lol

valid burrow
#

im suprised my phone still hasnt died

#

been at 2% for ages

shadow night
#

I'm surprised I haven't died

#

Ngl should've gone on that rollercoaster with that loop

slender elbow
#

same

valid burrow
#

real

#

raydan knows whats up

shadow night
#

But now I can't

#

Also, I might be in the wrong channel to regret my life decisions

#

But

#

I think the girl that wanted me to go with her to that ride didn't enjoy me despawning

lone oracle
#

I'm making hunger games in 1.8 (my first time making something using Java)
and I have a bunch of runTaskLaters for the countdown + deathmatch.
I've been trying to find a way to cancel them all for like a month now but nothing I've found has helped at all.
People have said stuff like "runTaskLater returns an event that can be cancelled", but that doesn't help because I don't know how to get their IDs and then cancel thhem from another class.
I know one way is to put the events themselves into a list but I cannot find how to do that.
If someone could give me an actual example which I could then tinker with to figure out what each part does, that would be amazing. Thanks :P

undone axleBOT
smoky oak
#

?1.8

undone axleBOT
pseudo hazel
#

if this is your first time using java, using 1.8 is a poor choice to say the least

quaint mantle
sullen canyon
sullen canyon
lone oracle
pseudo hazel
#

why forced xD

#

noone is forcing you

#

unless you are getting paid for it

#

whoch I doubt since its your first time using java

lone oracle
sullen canyon
pseudo hazel
#

okay thats a better reason

quaint mantle
#

Imagine torture just for pvp combat

pseudo hazel
#

wtf does that mean

pseudo hazel
#

strawman

sullen canyon
#

that was jsut an example

slender elbow
#

OCM in shambles

sullen canyon
#

you probably shouldn't keep hard references

lone oracle
slender elbow
#

keeping the BukkitTasks themselves is fine

#

just clear the list once you cancel them

lone oracle
#

1.9 pvp is torture itself

pseudo hazel
#

imagine if they just fixed pvp

#

that would be epic

slender elbow
#

foxed

pseudo hazel
tardy garden
#

how calculate pitch between locations?

#

I need to get the slope between a starting point and an ending point.

hybrid spoke
#

i have PTSD when clicking on prnt sc links

lapis cobalt
#

hello, i can't use the EquipmentSlot enum on my project. it says "cant resolve symbol 'EquipmentSlot' "

blazing ocean
#

update ij

hybrid spoke
lapis cobalt
#

ij as in intellij?

blazing ocean
#

yes

lapis cobalt
#

okok

safe furnace
#

How can I make custom model as npc?

hybrid spoke
#

or actual custom model like a deer or whatever

safe furnace
#

specific, like this.

hybrid spoke
#

requires a custom resourcepack tho

brazen badge
#

or use modelengine and create the model with blockbench

hybrid spoke
#

yeah or that

#

but iirc modelengine costs tho does it?

brazen badge
hybrid spoke
#

oh really

brazen badge
#

but it has like 3 models max

hybrid spoke
#

ah

#

ofc there is a downside

safe furnace
hybrid spoke
#

looks like a bunch of playerheads bound together

safe furnace
safe furnace
#

I know because these models are available on internet..

hybrid spoke
#

yeah there was a website where you can arrange armorstands to your liking and export them

safe furnace
hybrid spoke
#

but could be outdated

safe furnace
#

thanks, i'll give a try now

hybrid spoke
#

they even had a lib to convert the model to code. their github is worth a look

#

or it was from minidigger not sure

young knoll
#

Yeah those are player heads

#

The 8x8 texture gives it away

safe furnace
#

This doesn't work. its 1.12+

#

bruh

blazing ocean
#

common 1.8 L

#

just update

smoky oak
#

assuming A and B are plugins that listen to the same event, A, then B.
what happens if A cancels the plugin?

#

does B's code run or na?

blazing ocean
#

event priority

inner mulch
#

you mean cancel the event?

smoky oak
#

yea

#

brain not working lol

inner mulch
#

B will run code

young knoll
#

Depends

inner mulch
#

just that the event is cancelled

#

i guess

young knoll
#

Your listener can have ignoreCancelled

smoky oak
#

so unless it has that it wont run?

young knoll
#

By default it’s false

smoky oak
#

im assuming thats a yes
what determines event priority?

young knoll
#

The priority you give them

#

Otherwise the load order

smoky oak
#

oh the monitor to low stuff?

#

right that exists

tardy garden
glossy laurel
#

so I'm targetting a sign and it detects that im targetting it but for some reason the targetBlock instanceof Sign sign check fails. Anyone can help me?

floral drum
#

You may need to get the block state to see if it’s a sign if I’m correct

chrome beacon
#

if so that cast won't work

glossy laurel
#

worked, thanks :D

smoky oak
#

can you clone across dimensions

nimble crescent
smoky oak
#

blocks

nimble crescent
#

I am not sure what you mean by that but the dimension doesn't matter

rotund ravine
#

Yes @smoky oak

#

Just not with the /clone command i think

#

If ur using that

smoky oak
#

nah, im planning on using a separate void dimension with entity spawning disabled to temporarily store structures

rotund ravine
#

Should be fine

#

As long as u handle the cloning and switching dimensions

young knoll
#

Why not store them in memory

#

Or in a schematic format of some sort

acoustic pendant
#

If the chunk is unloaded will the second one throw an exception?

       final LevelChunk levelChunk = nmsWorld.getChunkIfLoaded(block.getX() >> 4, block.getZ() >> 4);
        final LevelChunk lChunk = nmsWorld.getChunk(block.getX() >> 4, block.getZ() >> 4);```
rotund ravine
#

A lot of world stuff just loads it if u call it

#

No clue about the nmsWorld though

#

Try it out

acoustic pendant
#

I'll try it then

tardy crystal
#

can some people help me update a plugin

chrome beacon
#

?services

undone axleBOT
tardy crystal
#

no i mean how do i update a plugin from source code

#

how

#

the exact plugin is Elevators V2

rotund ravine
#

Try it

twin venture
#

Hello there .. i have a bug :
cannot inherit from final class org.bson.codecs.MapCodec

how i can fix it?

#

iam usingn morphia and mongodb ..

inner mulch
#

its a final class

#

therefore you cant inherit from it

#

there is no fix

viscid carbon
#

Hey yall, having a strange problem. Trying to pull a HashSet i have in another class and it works everywhere but when i use Set#Size() it gives a null

#
 public Set<String> getTasks() {
        return tasks.keySet();
    }```
hazy parrot
#

That code gives us nothing

#

Explain what happens, when, and give relevant code

#

And exception

viscid carbon
#

In my Inventory class i'm grabbing my TaskManager class.

   public TasksInventory(TaskManager taskManager, PlayerDataManager playerDataManager) {
       this.taskManager = taskManager;
       this.playerDataManager = playerDataManager;
   }```
in my TaskManager i have a set and it adds the tasks into the set onEnable
```java
public Set<String> getTasks() {
       return tasks.keySet();
   }```

In my inventory i have a createInventory()
```java
public Inventory createInventory() {
       size = ((Math.max(size - 1, 0) / 9) + 1) * 9;
       return Bukkit.createInventory(null, size, color(String.format("&aTasks &7(&c%s&7)", taskManager.getTasks().Size())));
   }

The null

Caused by: java.lang.NullPointerException: Cannot invoke "me.arkallic.core.manager.TaskManager.getTasks()" because "this.taskManager" is null
        at me.arkallic.core.gui.TasksInventory.createInventory(TasksInventory.java:59) ~[?:?]
        at me.arkallic.core.gui.InventoryGUI.<init>(InventoryGUI.java:19) ~[?:?]
        at me.arkallic.core.gui.TasksInventory.<init>(TasksInventory.java:24) ~[?:?]
        at me.arkallic.core.command.TasksCommand.onCommand(TasksCommand.java:43) ~[?:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[spigot-api-1.21.1-R0.1-SNAPSHOT.jar:?]```
#

It happens when the inventory opens

#

But this.TaskManager is not null?

young knoll
#

Evidently it is

neon wraith
#

Could someone help me?

kind hatch
#

Use the lambda method on #spawnEntity() to set the transformation stuff.

I think that’ll solve the split second changes.

viscid carbon
chrome beacon
#

spawnEntity does not take a consumer

kind hatch
#

Oop

#

Mb

chrome beacon
#

And make sure to modify your entity in the consumer to ensure it's modified before spawning

tender shard
viscid carbon
#

I'm not understanding why this is null

hazy parrot
viscid carbon
#

In my TasksCommand class

public class TasksCommand implements CommandExecutor {
    /**
     * Executes the given command, returning its success.
     * <br>
     * If false is returned, then the "usage" plugin.yml entry for this command
     * (if defined) will be sent to the player.
     *
     * @param sender  Source of the command
     * @param command Command which was executed
     * @param label   Alias of the command which was used
     * @param args    Passed command arguments
     * @return true if a valid command, otherwise false
     */

    private final TaskManager taskManager;
    private final GUIManager guiManager;
    private final PlayerDataManager playerDataManager;

    public TasksCommand(TaskManager taskManager, GUIManager guiManager, PlayerDataManager playerDataManager) {
        this.taskManager = taskManager;
        this.guiManager = guiManager;
        this.playerDataManager = playerDataManager;
    }


    @Override
    public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
        if (sender instanceof Player p) {
            TasksInventory tasksGUI = new TasksInventory(taskManager, playerDataManager);
            guiManager.openGUI(tasksGUI, p.getUniqueId());
            if (args.length == 0) {
                return true;
            }
            return true;
        }
        return false;
    }```
Is this the reason?
#

Nope, tried to make a getter in my main class with the inventory and it does the same

hazy parrot
viscid carbon
hazy parrot
#

Can you show it

viscid carbon
#
public final class Core extends JavaPlugin {

    private static Core instance;

    private final TaskManager taskManager = new TaskManager();
    private final PlayerDataManager playerDataManager = new PlayerDataManager(taskManager);
    private final GUIManager guiManager = new GUIManager();
    private final Listeners event = new Listeners();
    private final Commands cmd = new Commands();

    @Override
    public void onEnable() {
        // Plugin startup logic
        instance = this;
        LangHandler.getInstance().initialize();
        taskManager.register();

        //Commands
        cmd.register("core", new CoreCommand(playerDataManager));
        cmd.register("rank", new RankCommand(playerDataManager));
        cmd.register("setrank", new SetRankCommand(playerDataManager));
        cmd.register("home", new HomeCommand(playerDataManager));
        cmd.register("sethome", new SetHomeCommand(playerDataManager));
        cmd.register("deletehome", new DeleteHomeCommand(playerDataManager));
        cmd.register("maxhomes", new MaxHomesCommand(playerDataManager));
        cmd.register("tasks", new TasksCommand(taskManager, guiManager, playerDataManager));

        //Listeners
        event.addListener(new PlayerDataListener(playerDataManager));
        event.addListener(new PlayerJoinListener());
        event.addListener(new TaskListener(taskManager, playerDataManager));
        event.addListener(new GUIListener(guiManager));

        //Reload
        for (Player player : Bukkit.getOnlinePlayers()) {
            playerDataManager.register(player.getUniqueId());
        }

        getLogger().info("Core is online!");

        this.saveDefaultConfig();
    }

    public static Core getInstance() {
        return instance;
    }
#

Sorry i do it through a commands class

    public void register(String command, CommandExecutor commandExecutor) {
        Core.getInstance().getCommand(command).setExecutor(commandExecutor);
    }```
drowsy helm
#

Why are you using di for everything but the core?

#

And you should be instantiating managers in your onenable ideally

viscid carbon
#

I didn't know you can di in the main class?

#

thats news

drowsy helm
#

No as in

#

You have static instance

hazy parrot
#

You are either not sending the correct code, or you are running an old version of the plugin

#

Or there is smth i missed

hazy parrot
#

So I would say it's not correct code

viscid carbon
drowsy helm
#

Technically there’s nothing wrong with it, but it’s just bad practice. People will argue til the cows come home about it

viscid carbon
young knoll
#

size() != Size()

viscid carbon
drowsy helm
#

Oh yeah you used capital S

#

Either way task manager is null

hazy parrot
#

That means you edited code before sending it here

viscid carbon
#

I manually typed that when i was writing it out on here.

#

That^

hazy parrot
viscid carbon
drowsy helm
#

My only guess is that it’s being passed in at the wrong time or smth

#

If you habe the plugin instance why not use a getter

#

Bit anti di tho

rotund ravine
smoky oak
#

there a tutorial on how to setup debugging for, and step through spigot code? would help debugging some of my code

eternal oxide
#

(probably) if you disable the watchdog

smoky oak
#

?

#

i mean its already showing me which methods it's in using step into but having that single line of information aint useful

eternal oxide
#

thats all you get with an attached debugger. you can expand and see variables

smoky oak
#

you saying i have to launch the server in my IDE?

eternal oxide
#

yes

smoky oak
#

well thats gonna be fun to figure out

#

wheres that link agian?

eternal oxide
#

google I'm sure πŸ™‚

smoky oak
#

SEs are trash nowadays unfortunately

#

ill try tho

smoky oak
#

well its not google

#

so it actualy works

#

imma bookmark that engine

eternal oxide
#

lol true

viscid carbon
#

Never heard of that engine before

#

@eternal oxide what're you looking up that you dont want google to see ?

#

πŸ‘€

eternal oxide
#

I stopped using google for search a few years ago

#

its shit

viscid carbon
#

Bing user

eternal oxide
#

I used duck duck go for a while but they went all crazy political

#

Now I use startpage. Nice clean and no mess

viscid carbon
#

I looked into that browser on android. i didn't like it. Anyways were talking in dev, whoops to general i go

river oracle
#

check out Mull or Fennec

#

I'd personally reccomend Fennec for mobile because it retains the ability for most sites to work. Mull is too hardened and its not as easy to switch things off on mobile

#

as for search engine I use duckduckgo, but searx is also really good

unique shuttle
#

Does anyone know the minimum and maximum values for setTextOpacity in a TextDisplay? Thanks

remote swallow
#

?jd-s

undone axleBOT
unique shuttle
rough ibex
#

likely -127 is fully one way

#

+127 is the other

unique shuttle
rough ibex
#

well byte max is 127 in java

#

byte is signed

#

which is interesting

#

and min is -128

unique shuttle
#

Maybe it's not possible to make the text completely invisible, but that would be strange

rough ibex
#

MCwiki says Since there are no unsigned bytes in NBT, values greater than 127 need to be replaced with alpha-256. So, the value is from -128 to 127. Similar to the background, the text rendering is discarded when it is less than 26. Defaults to -1, which represents 255 and is completely opaque.

#

but also has a {{verify}}

#

so not more than 26

unique shuttle
wraith delta
hybrid turret
#

i'm trying to get hex colors in minimessage in adventure to work and fsr this won't display properly:

<color:#666666>[<aqua>Admin<color:#666666>] <gray>
It just ignores the hex

hybrid turret
chrome beacon
hybrid turret
# remote swallow Show ur code
audience.sendMessage(MiniMessage.miniMessage().deserialize("<color:#666666>[<aqua>Admin<color:#666666>] <gray>Your chunk is <red>already chunk-loaded<gray>. You can <red>remove <gray>it using <red>/chunkloaded remove<gray>."));
#

manually built the message from variables together for this

#

so ignore that a prefix is just in the string

chrome beacon
hybrid turret
#

bc it doesnt apply the color

#

i mean

#

it doesnt ignore it

#

something like #000000 works

#

does it only support the hex for the default minecraft colors?!

chrome beacon
#

no

hybrid turret
#

that would kinda defeat the point

chrome beacon
#

#666666 is gray

hybrid turret
#

yea

#

before i had

#

#555555

#

dark gray

#

then i wanted it to be slightly lighter

#

now the first bracket is white

#

and after the Admin text everything is blue fsr

#

or aqua

chrome beacon
hybrid turret
#

it seems to work there idk

#

in console it's shown like:

#

ignore the different message it's just about the prefix

#

ModCheck ban?

eternal oxide
#

@young knoll ^

hybrid turret
remote swallow
#

Some consoles don't support colour and half the time there isn't a need for colour

#

Most colour needed is logger level identification

hybrid turret
#

yeah i just did this for testing

#

but istg the console let me use the color yesterday

#

so fkn weird

#

damn wtf it actually is the console

#

lol

topaz cape
#

could #sendBlockChange be ran async?

#

im looking at a 1yo code of mine and it was runnung sync

young knoll
#

Probably

topaz cape
#

actually the code was on Sep 12, 2023

#

which is crazy cuz today is the 11th xd

round pulsar
#

hello

#

Can i modify at anyway inventory title?

#

It doesn't seem respondiing to my Components with custom font

#

On chat everythings works fine

river oracle
#

Paper kekw

round pulsar
#

Why?

river oracle
#

You need to reopen a new view

round pulsar
#

Wdym reopen?

#

I mean i understand what is reopeniing

#

but just open close and open the same iinventory?

river oracle
#

No open a brand new inventory

round pulsar
#

Open one inventory and then open another one with modified title with custom font?

#

wait what it can't work like that

#

I create custom inventory (chest 6x9) and just want to lower the title of that Inventory a little bit. So i created custom font with lowered text and when i append thiis font

#

It doesn't affect the title text

#

If i do the same on chat

#

It does affect

pseudo hazel
#

so you mean the font just isnt working on the menu title?

round pulsar
#

Yes chef

pseudo hazel
#

how are you setting the font on the title in the first place

round pulsar
#
Component.text("text")
                .font(Key.key("minecraft", "boss_bar_2"))
pseudo hazel
#

oh are you using paper?

round pulsar
#

siii

pseudo hazel
#

may I kindly redirect you to the paper discord?

round pulsar
#

If i could i would go. I have beef with the owner

pseudo hazel
#

spigot doesnt allow components by default so its kinda hard to say if spigot is the cause

round pulsar
#

kekw

pseudo hazel
#

well

round pulsar
#

So spigot just takes plain text on title?

pseudo hazel
#

yeah

#

its a string for titles

#

and paper added the component titles

#

but afaik cuatom fonts should just work

#

like do you just see the default font?

#

or like what is going wrong

#

like are you modifying the title of an inventory thats already open or are you creating a new in inventory with the component title

round pulsar
#

Just the default grey font. For the test i set the size of that font to 20 and the same component sent on chat works and makes the text BIG but it does not affect inventory

#

Creating inventory

#

And the component iteself works because for example

omponent.text("text")
                        .color(TextColor.color(255, 255, 255))
                .font(Key.key("minecraft", "boss_bar_2"))

if i do that, the text becomes whte

round pulsar
#

Idk if that's how it should be

#

If i can make it some other way. if manually sending inventory packet would work

blazing ocean
#

show your code

round pulsar
#
    protected void createBukkitInventory() {
        this.bukkitInventory = Bukkit.createInventory(this, this.inventoryDeclaration.getInventoryProperties().getInventorySize(), this.inventoryDeclaration.getInventoryProperties().getInventoryComponentTitle());
    }
package pl.maxhard.commons.tiermc.inventory;

import net.kyori.adventure.text.Component;
import org.bukkit.event.inventory.InventoryType;
import utilities.helper.InventoryHelper;

public class InventoryProperties {

    private final Component inventoryTitle;
    private final InventoryType inventoryType;
    private final int inventoryRows;
    private final int inventorySize;

    public InventoryProperties(Component inventoryTitle, InventoryType inventoryType, int inventoryRows) {
        this.inventoryTitle = inventoryTitle;
        this.inventoryType = inventoryType;
        this.inventoryRows = inventoryRows;
        this.inventorySize = InventoryHelper.calculateInventorySize(inventoryRows);
    }
    public InventoryProperties(Component inventoryTitle, InventoryType inventoryType, int inventoryRows, int inventorySize) {
        this.inventoryTitle = inventoryTitle;
        this.inventoryType = inventoryType;
        this.inventoryRows = inventoryRows;
        this.inventorySize = inventorySize;
    }
    public InventoryProperties(String inventoryTitle, InventoryType inventoryType, int inventoryRows, int inventorySize) {
        this(Component.text(inventoryTitle), inventoryType, inventoryRows, inventorySize);
    }

    public Component getInventoryComponentTitle() {
        return inventoryTitle;
    }

    public String getInventoryTitle() {
        return inventoryTitle.insertion();
    }

    public InventoryType getInventoryType() {
        return inventoryType;
    }

    public int getInventoryRows() {
        return inventoryRows;
    }

    public int getInventorySize() {
        return inventorySize;
    }
}
blazing ocean
#

that is useless

#

show the part where you assign the component

remote swallow
#

i mean

#

last time i checked spigot didnt have native createInventory support with a adventure component

round pulsar
#
    protected LobbyPanelInventory() {
        this(net.kyori.adventure.text.Component.text("text")
                .font(Key.key("minecraft", "boss_bar_2")),);
    }

In the constructor like that. Then from that iis constructed InventoryPropertes

blazing ocean
#

banned from paper

blazing ocean
remote swallow
#

i cant believe paper hasnt pulled the new menu type api yet

blazing ocean
#

iirc they have? idk

round pulsar
#

Well if i could i'd use spigot i have custom forks of that engines. I think that puttiing kyorii inside paper is fucking stupid and literally forcing people to use some shit API. But i have joined the project and i have to

remote swallow
blazing ocean
#

rip

#

rip miles api

round pulsar
#

Literally making custom API based on Builder type of everything is stupid

remote swallow
#

or if they have they havent built anything yet

blazing ocean
#

they get it

remote swallow
#

also @river oracle where is bungee component support on menu type api

round pulsar
blazing ocean
#

i doubt that

#

what exactly is happening

#

send a ss

round pulsar
#

?ss

#

?screenshot

remote swallow
#

?img

undone axleBOT
#

Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.

Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org

blazing ocean
#

?img

round pulsar
#

How was that?

undone axleBOT
#

Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.

Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org

round pulsar
chrome beacon
round pulsar
#
    @Override
    public void execute(LiteContext<CommandSender> context, Player executor, PlayerProfile profile) {
        Key key = Key.key("minecraft", "boss_bar_3");

        executor.sendMessage(net.kyori.adventure.text.Component.text("test for u guys")
                .font(Key.key("minecraft", "boss_bar_2")));

Code is literally the same

#

    protected LobbyPanelInventory() {
        this(net.kyori.adventure.text.Component.text("test for u guys")
                .font(Key.key("minecraft", "boss_bar_2")));
    }
chrome beacon
#

Set the color

blazing ocean
round pulsar
chrome beacon
#

? did you set it to red

round pulsar
#

Yes

blazing ocean
#

cool

#

now show your font definition

#

?

#

font definiton

round pulsar
#

Ohh

#

Okay

#

Omfg

#
{
  "providers": [
    {
      "type": "space",
      "advances": {
        " ": 4,
        "β€Œ": 0
      }
    },
    {
      "type": "bitmap",
      "file": "minecraft:font/ascii.png",
      "ascent": 3,
      "height": 20,
      "chars": [
        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000",
        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000",
        " !\"#$%&'()*+,-./",
        "0123456789:;<=>?",
        "@ABCDEFGHIJKLMNO",
        "PQRSTUVWXYZ[\\]^_",
        "`abcdefghijklmno",
        "pqrstuvwxyz{|}~\u0000",
        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000",
        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000Β£\u0000\u0000Ζ’",
        "\u0000\u0000\u0000\u0000\u0000\u0000ΒͺΒΊ\u0000\u0000Β¬\u0000\u0000\u0000«»",
        "β–‘β–’β–“β”‚β”€β•‘β•’β•–β••β•£β•‘β•—β•β•œβ•›β”",
        "β””β”΄β”¬β”œβ”€β”Όβ•žβ•Ÿβ•šβ•”β•©β•¦β• β•β•¬β•§",
        "╨╀β•₯β•™β•˜β•’β•“β•«β•ͺβ”˜β”Œβ–ˆβ–„β–Œβ–β–€",
        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000βˆ…βˆˆ\u0000",
        "≑±β‰₯β‰€βŒ βŒ‘Γ·β‰ˆΒ°βˆ™\u0000βˆšβΏΒ²β– \u0000"
      ]
    }
  ]
}
#

Do you mean that?

#

Or what else do you mean by font definition

remote swallow
#

minecraft namespace or non minecraft stuff PES_Cry

blazing ocean
#

what do you expect it to do

#

you have the mc font in there

#

and it's displayed as mc font

round pulsar
#

The height is set to 20

#

So thiis one is bigger

#

So i expect it to be bigger for now

round pulsar
river oracle
#

I'll prob add it myself

round pulsar
#

@blazing ocean i am so stupid it works i didn't build the code of the platform i use

#

So sorry for wasting your time

blazing ocean
#

lmfao

haughty wind
#

how do i compile

quaint mantle
#

It wont compile πŸ˜‚

slender elbow
#

🀣 🀣 🀣 🀣 🀣 🀣 🀣 🀣 🀣 🀣 🀣 🀣

haughty wind
#

πŸ₯ΊπŸ™

drowsy helm
haughty wind
#

sorry first site

drowsy helm
#

Het ur eraser and remove the brackets

river oracle
haughty wind
#

what

river oracle
#

To compile it just fax it to the nearest government office

#

But you have a compile error

#

So it'll just be returned

haughty wind
#

ζˆ‘θƒ½ζ‹Ώη€

river oracle
#

English only bucko

zenith anchor
#

Is there an alt for MapPalette.matchColor()?

#

Deprecated in 1.20.2, but map data packets still use byte to indicate map colors

sullen canyon
paper viper
zenith anchor
#

oh that means no alt provided?

#

ty bro, I should create my own then

dawn flower
#

How do I make an "autoclicker" for left click to specific players?

#

At 1 hit a second it eats up 10% of the server performance

#

In some cases 20%

paper viper
#

Show your current left click code

dawn flower
#

It just checks the target entity and makes the player force attack

#

I got rid of it

glossy laurel
#
            if(!(entity instanceof Player)) {
                Vector3 entityLocation = new Vector3(entity.getLocation());
                if (((entityLocation.x >= minCorner.x) && (entityLocation.x <= maxCorner.x)) && ((entityLocation.y >= minCorner.y) && (entityLocation.y <= maxCorner.y)) && ((entityLocation.z >= minCorner.z) && (entityLocation.z <= maxCorner.z))){
                    entity.remove();
                }
            }
        });```
is there any more resource efficient way of doing this?
dawn flower
#

And Bukkit's vectors

paper viper
#

Bounding box wouldn’t be much more efficient

dawn flower
#

It cleans up the code

paper viper
#

There isn’t any faster performance wise way to do this

#

At the end it’s just a couple checks

#

But this shouldn’t be too much performance

dawn flower
#

Looping all entities though

glossy laurel
#

^

dawn flower
glossy laurel
dawn flower
#

That definatly will cause some performacne issues

glossy laurel
#

hm

#

Is getting all entities within distance of a location more efficient by any chance? Or does it just secretely loop all entities and check distance on the back end

#

oh

#

getNearbyEntities() checks with a box?

#

πŸ’€

torn badge
#

Or use getNearbyEntities yeah

glossy laurel
#

yeah im using this

grim hound
#

what packet was used by the server to inform the player about their death or damage being dealt to them?

torn badge
#

Set Health

grim hound
#

ah okay

glossy laurel
#

how do I make commands that appear red when the players try to write them as if they didnt exist

remote swallow
#

dont register them and listen to command pre process event

grim hound
#

and listen to command preprocess and cancel em

grim hound
remote swallow
#

so register it and not give players the permission

grim hound
glossy laurel
#

how do I make the command actually work

#

if Im not registering it

remote swallow
#

use the data the pre process event gives you

glossy laurel
#

but

remote swallow
#

it gives you getMessage

glossy laurel
#

preprocess event isnt called when the command is actually sent

#

right?

remote swallow
#

if it starts with a slash its called

glossy laurel
#

yes

#

OH

remote swallow
#

you have getMessage which gives you the entire chat message

glossy laurel
#

so youre telling me its when you send something with / in front of it?

#

I thought it was when player starts typing / in they chat

remote swallow
#

afaik ye

glossy laurel
#

alright good

remote swallow
#

its called after they press enter

glossy laurel
#

I knew the docs were scamming me

glossy laurel
grim ice
#

How would I render a leash between two players?

#

Only visually

real ridge
#

I just git cloned a plugin. How do I fix this import?

#

nevermind

#

it instantly fixed itself

pure dagger
#

how to check if player is hooked on fishing rod? get the hook entity and player that uses the fishing rod? - no events, in bukkitrunnable

worthy yarrow
pure dagger
#

but no event ;c

#

i need that in a runnable every lets say 1 second

worthy yarrow
#

I didn’t see an event thrown specifically for when an entity is initially hooked

pure dagger
#

i mean i dont use event

#

dont want to

worthy yarrow
#

Probably gonna have to run through some packet shit then

grim ice
#

All you have to do is use size 0 slimes

grim ice
#

but the leashes are hidden too...

torn badge
grim ice
#

How do I hide slimes without hiding their leashes?

glossy laurel
grim ice
#

Yes you can

#

I'm just a little slow

glossy laurel
gilded forge
#

does anyone know how to detect players putting items into the decorated pots?

worthy yarrow
#

Probably playerInteractEvent and check the action / block

#

I believe that would be right click

gilded forge
#

yeah but i m looking for a better way

#

playerinteractevent might be the final decision

worthy yarrow
#

Does decorated pot have an inventory?

gilded forge
#

no

#

players can put items into the pot by right clicking it

#

i want to prevent players putting certain items into the pots

worthy yarrow
#

Right ok so not one they can interact with, I don’t see any event specific to putting an item into a decorated pot

worthy yarrow
gilded forge
#

ok i will do it with playerinteractevent thx

worthy yarrow
#

Sure!

gilded forge
#

btw, how to detect player shift clicking the pot?

#

just if (player.isSneaking()) ?

#

because players may put the blocks nearby the pot

worthy yarrow
#

Sounds like that’d be fine

gilded forge
#

okay

eternal skiff
#

hi, can anyone say why when i have my plugin and i try use commands it automatly coplete is pluginname:pluginame

river oracle
eternal skiff
#

how can i fix this bug?

river oracle
#

Not a bug you could say it's intended can't do much to help you tho

#

You can do /command or /pluignname:command

#

If you only have the latter you have clashing command names

#

Please check out to make sure your plugin wasn't Reloaded wasn't loaded twice there isn't another plugin on the server with the same command

eternal skiff
#

i packege plugin and paste into plugins folder

eternal skiff
#

I tested it on different verions and it has the same result

remote swallow
#

that is your plugins namespace

eternal skiff
remote swallow
#

your plugin name is the namespace

#

it having /command and /plguinname:command is default behavoir

eternal skiff
#

I want to hide this /pluginanme:command

remote swallow
#

spigot.yml commands.send-namespaced

eternal skiff
#

Automatically

slender elbow
#

basically

#

you don't

remote swallow
#

every plugin shows that

slender elbow
#

and this is intentional

remote swallow
#

if 1 server wants to disable it they can

slender elbow
#

if you have two plugins with the same command, this is the way the system distinguishes between them both

eternal skiff
#

But some plugins you can download don't have this

slender elbow
#

such as?

eternal skiff
slender elbow
#

luckperms does have it

eternal skiff
remote swallow
#

luck perms has it

slender elbow
#

^ that

eternal skiff
#

Ok

#

So I can't hide it from plugin?

quaint mantle
#

?nms

eternal oxide
#

Do you just want to remove teh namespaced command?

remote swallow
young knoll
#

There is a way

eternal oxide
young knoll
#

But are you cool enough for the forbidden knowledge

eternal skiff
quaint mantle
#

I don't see point of hiding namespace because players except staff doesn't care

eternal oxide
#

event.getCommands()... remove if command is yrou namespaced version

young knoll
#

It exists for a reason

#

Hiding it is dumb

echo basalt
#

ggrr

eternal oxide
#

Yeah but that won't be an issue here as he only want to prevent players seeing the namespaced command

ancient plank
cedar saffron
#

nut paradise is crazy

rough ibex
#

huh

cedar saffron
rough ibex
#

oh god

cedar saffron
#

Crazy

unique shuttle
#

Is there a way to get the attributes given by a potion when applied?
For example, a strength potion that gives +3 damage. Is there a way to retrieve this AttributeModifier for both custom potions and vanilla items?

#

Or should I do it with NMS?

sly topaz
#

or is this the case where you want to get the default attribute modifiers

river oracle
#

Mmm that's when applied tho

#

I wonder if that even exists outside of the tooltip

unique shuttle
#

Yes, in the case that the potion isn't custom, I'd like to get the default values

sly topaz
#

I meant from the material

river oracle
#

Maybe it's in the PotionMeta if anything

unique shuttle
#

Yeah

river oracle
#

But like idk outside of that

unique shuttle
river oracle
#

Because it's not really a normal attribute

sly topaz
#

I mean, that attribute has to be stored somewhere

river oracle
#

I'm not near a pc so I can't look at mms but my guess is the effect isn't realized until its drinken

sly topaz
#

I'll check, though I only have paper's source at hand

river oracle
#

Oh no that's potion type

#

Forgot how that's stored internally

sly topaz
#

I'll just check the Items registry

unique shuttle
#

MobEffect

sly topaz
#

haiyaa

#

if it is just the amplifier, you can get it from the PotionEffect/PotionType instance, don't remember which one holds that info

unique shuttle
#

Lmao

#

I'm trying to create the tooltip xD

sly topaz
#

honestly, could just call that method and call it a day tbh

unique shuttle
#

Yes, I didn't know it existed on the server side. Where can I find it?

sly topaz
#

net.minecraft.world.item.alchemy.PotionContents in mojmap

#

same name in spigot apparently

unique shuttle
#

Alright, now I need to access it from an ItemStack

#

I'm going to investigate how it works

river oracle
unique shuttle
sly topaz
# unique shuttle I'm going to investigate how it works

net.minecraft.world.item.alchemy.Potions is where the vanilla potions are populated and added to the built-in Registry.POTION, each one registers a Potion instance (PotionType in Bukkit) which holds one or more MobEffectInstance(s) (PotionEffect in Bukkit) which in itself holds a MobEffect (PotionEffectType in Bukkit)

#

the tooltip however seems to be derived from the PotionContents, which is a data component

#

if you can get the ItemPotion instance from the ItemStack, you can do ItemPotion#appendHoverText and off you go

unique shuttle
#

Thank you! I'll see what I can do

sly topaz
#

you could have been able to re-create the method but PotionEffectType doesn't expose the createModifiers method (oh it does in paper)

pure dagger
sly topaz
#

but what are you trying to do

pure dagger
#

no, it doesnt detect when Player stops being hooked, not all scenerios

sly topaz
#

what are you trying to do with the fish hook?

#

There could be a more appropriate event, but without knowing what you're trying to do, I wouldn't be able to tell

pure dagger
#

oh sorry, i Just need to know if Player is hooked or not

#

it would be better with an event than bukkit runnable

sly topaz
#

have you tried the ProjectileHitEvent?

#

I'm pretty sure that one gets fired when using fish hook

pure dagger
#

but how do i check if projectile is in the Player

sly topaz
#

ProjectileHitEvent#getHitEntity and check if it is a Player

pure dagger
#

and ... i need then to apply some effect, and when Player is no longer on hook stop applying the effect, sorry i didnt say that earlier

hasty hamlet
#

?server

sly topaz
#

you could go about it in two ways

#

in the ProjectileHitEvent, schedule a repeating task which checks whether the ProjectileHitEvent#getEntity (aka the FishHook) is alive, if it is then continue applying your effect, otherwise cancel the repeating task

pure dagger
#

oh because if it stops being hooked it fΓ­es

#

dies

#

you mean like for every fishing rod crΓ©ate separate runnable?

#

or better sdd them to some list and 1 runnable

sly topaz
#

the other way is in the ProjectileHitEvent, get the FishHook#getShooter, apply a boolean PDC or just track it with a Map, whichever way you prefer and then in the PlayerFishEvent, check if the same Player is reeling in and if so stop applying your effect

pure dagger
#

umm what

sly topaz
#

the only thing that changes with the second way would be how you cancel the task, but you'd still schedule a repeating task anyway

pure dagger
#

but fish event doesnt detect it as i said, Player May die or get so fat that the hook breaks and then the event isnt calle

sly topaz
#

makes sense, then just go about it the first way

sly topaz
#

though that'd only work as long as the period is the same for every effect

pure dagger
#

yeah it is

#

i mean

#

yeah

sly topaz
#

you could do a one tick repeating task and then handle the delays inside the task itself but eh, it gets janky

#

at that point, you'd rather just create your own executor so you can freely create repeating tasks there

sly topaz
pure dagger
#

umm is this also possible to check all entities around Player maybe in distance of 3 3 3, check if they are hooks and if they are hooked on player?

#

noo.

#

i think it wont work

sly topaz
#

I mean, it would be possible to do it that way, just not very efficient lol

lucid bane
#

is there any way to know which event listener will be fired first?
i have two eventListener classes in same package with identical event,(ex- entitydamageEvent) and one listener always executed primarily. (ex-when i hit a zombie with a fist).

can i adjust there sequences? or figure out which one will be first?

lucid bane
eternal skiff
#

Can i make plugin compatible with different versions and use craftbukkit functions?

pseudo hazel
#

depends on the versions

sly topaz
#

you'd have to reflectively call the method so that you don't directly reference it, or use interfaces and modules to depend on each specific version you want to support, loading only the interface implementation for the currently running version

#

the reason people avoid it is because historically, one couldn't import NMS/CB classes without worrying about version compatibility since the current version is embedded in the package name, making it break on every version change. This is by design, it's a way to prevent people from using internal classes instead of API, though NMS classes don't have the version in the package nowadays, CB ones still do afaik

#

there's also the fact that internal classes change much more often than the API, for obvious reasons, so you'd still have to worry about compatibility even if the version isn't embedded in the package

#

all of that being said, it doesn't mean using them isn't possible, it is annoying but not impossible. If you do your reflection properly, there's no worry about performance as well so nowadays people do mostly that

eternal night
#

Would still recommend separate modules, while naming/packages might change which could be fixed by reflection, logic changing is gonna become annoying rather fast

sly topaz
#

that and there's also the fact that using reflection adds a level of indirection which makes the code much less intuitive to understand

zenith anchor
#

Using packets to update icons on map, but on client these icons just appeared and then disappeared instantly. Is there any solutions?

eternal night
#

You mean map markers?

zenith anchor
#

yes

eternal night
#

Well, you may be getting clapped by the fact that maps are rather horribly implemented internally and update themselves a lot

#

so the server may just be sending another update packet overriding your changes

zenith anchor
#

I have removed all renderers from the associated map view

sly topaz
#

not an answer to your question directly, but I'd just take a look at how some map api like cerus one does it

zenith anchor
#

and listening for MapData packets, however there's no any other update packets.

#

okay, thank you

unique shuttle
#

I've been trying for a while to remove the brackets from the beginning and the end, but I can't figure it out. In the chat, they don't appear, but when I put it in a TextDisplay, they do. Can someone help me?
json: https://paste.md-5.net/salepuyigu.json

#

😭

eternal night
#

?paste

undone axleBOT
eternal night
unique shuttle
#

Sorry xD

#

I didn't expect it to be so big

#

For some reason, it looks fine in the chat, but the TextDisplay adds those brackets

eternal night
#

What is ChatComponentUtils HMM

#

oh some spigot name

unique shuttle
#

Ignore that. It has a fix(IChatBaseComponent) method, so I tried it, but it didn’t work

#

Lmao

eternal night
#

I mean, ChatComponentUtils.a is 100 not what you wanna call

unique shuttle
#

I just fixed it, and I’m not sure what I changed xd

eternal night
#

See, if you were using normal mappings you'd know that that method is actually called

#

wrapInSquareBrackets

pseudo hazel
#

.a wtf is even that

#

lmao

unique shuttle
#

I removed it and it was fixed, but I swear I had the error before adding it

#

😭

eternal night
#

Would strongly recommend moving to mojang mappings if you can

#

makes your life a lot easier

unique shuttle
#

I swear I had the error before adding it xD

#

Thank you. It looks correct now :D

sly topaz
#

Did you just get the PotionContents from the DataComponentMap of the ItemStack?

sly topaz
unique shuttle
#

I looked a bit more and found that ItemStack also has a method to get the tooltip with all the details included

unique shuttle
sly topaz
eternal night
#

Yea I mean, all of them can

sly topaz
#

yeah, I just didn't know till earlier today when I was looking at the potion thingy that the component is the part that handled the tooltip

eternal night
#

it didn't used to be that way, but yea, since components got added that logic was moved there

tidal kettle
#

hello, can i refresh an inventory without closing and open it?

young knoll
#

What do you mean refresh

brazen badge
eternal oxide
#

depend on vault in your plugin.yml

#

AND, do you have an eco plugin?

brazen badge
eternal oxide